审批模块时间就算兼容苹果的safari浏览器,把基础的审批类型写入coonfig配置中。
This commit is contained in:
parent
ab16f85da5
commit
7e0147a213
@ -29,7 +29,15 @@ class Cate extends BaseController
|
||||
public function flow_type()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$cate = Db::name('FlowType')->order('id asc')->select();
|
||||
$cate = Db::name('FlowType')->order('id asc')->select()->toArray();
|
||||
$type = get_config('approve.type');
|
||||
foreach ($cate as $key => &$value){
|
||||
foreach ($type as $k => $val){
|
||||
if($value['type'] == $val['id']){
|
||||
$value['type_name'] = $val['title'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return to_assign(0, '', $cate);
|
||||
} else {
|
||||
return view();
|
||||
@ -76,6 +84,7 @@ class Cate extends BaseController
|
||||
View::assign('detail', $detail);
|
||||
}
|
||||
View::assign('id', $id);
|
||||
View::assign('type', get_config('approve.type'));
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ class Flow extends BaseController
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$type = get_config('approve.type');
|
||||
$list = Db::name('Flow')
|
||||
->field('f.*,a.name as username,t.title as flow_cate')
|
||||
->alias('f')
|
||||
@ -32,6 +33,11 @@ class Flow extends BaseController
|
||||
if($value['department']==''){
|
||||
$value['department'] = '全公司';
|
||||
}
|
||||
foreach ($type as $k => $val){
|
||||
if($value['type'] == $val['id']){
|
||||
$value['type_name'] = $val['title'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return to_assign(0, '', $list);
|
||||
} else {
|
||||
@ -133,6 +139,7 @@ class Flow extends BaseController
|
||||
View::assign('detail', $detail);
|
||||
}
|
||||
View::assign('id', $id);
|
||||
View::assign('type', get_config('approve.type'));
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
@ -33,28 +33,7 @@
|
||||
var html='<strong class="iconfont '+d.icon+'"></strong> '+d.icon;
|
||||
return html;
|
||||
}}
|
||||
,{field:'type', title: '所属分类',width:100,align:'center',templet: function(d){
|
||||
var html='';
|
||||
if(d.type==1){
|
||||
html = '假勤';
|
||||
}
|
||||
else if(d.type==2){
|
||||
html = '行政';
|
||||
}else if(d.type==3){
|
||||
html = '财务';
|
||||
}else if(d.type==4){
|
||||
html = '人事';
|
||||
}else if(d.type==5){
|
||||
html = '其他';
|
||||
}else if(d.type==6){
|
||||
html = '报销';
|
||||
}else if(d.type==7){
|
||||
html = '发票';
|
||||
}else if(d.type==8){
|
||||
html = '合同';
|
||||
}
|
||||
return html;
|
||||
}}
|
||||
,{field:'type_name', title: '所属分类',width:100,align:'center'}
|
||||
,{field:'status', title: '状态',width:80,align:'center',templet: function(d){
|
||||
var html1='<span class="green">正常</span>';
|
||||
var html2='<span class="yellow">禁用</span>';
|
||||
|
@ -10,14 +10,9 @@
|
||||
<td>
|
||||
<select name="type" lay-verify="required" lay-reqText="请选择所属分类">
|
||||
<option value="">--请选择--</option>
|
||||
<option value="1">假勤</option>
|
||||
<option value="2">行政</option>
|
||||
<option value="3">财务</option>
|
||||
<option value="4">人事</option>
|
||||
<option value="5">其他</option>
|
||||
<option value="6">报销</option>
|
||||
<option value="7">发票</option>
|
||||
<option value="8">合同</option>
|
||||
{volist name="$type" id="vo"}
|
||||
<option value="{$vo.id}">{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray">名称<font>*</font></td>
|
||||
@ -49,14 +44,9 @@
|
||||
<td>
|
||||
<select name="type" lay-verify="required" lay-reqText="请选择所属分类">
|
||||
<option value="">--请选择--</option>
|
||||
<option value="1" {eq name="$detail.type" value="1"}selected=""{/eq}>假勤</option>
|
||||
<option value="2" {eq name="$detail.type" value="2"}selected=""{/eq}>行政</option>
|
||||
<option value="3" {eq name="$detail.type" value="3"}selected=""{/eq}>财务</option>
|
||||
<option value="4" {eq name="$detail.type" value="4"}selected=""{/eq}>人事</option>
|
||||
<option value="5" {eq name="$detail.type" value="5"}selected=""{/eq}>其他</option>
|
||||
<option value="6" {eq name="$detail.type" value="6"}selected=""{/eq}>报销</option>
|
||||
<option value="7" {eq name="$detail.type" value="7"}selected=""{/eq}>发票</option>
|
||||
<option value="8" {eq name="$detail.type" value="8"}selected=""{/eq}>合同</option>
|
||||
{volist name="$type" id="vo"}
|
||||
<option value="{$vo.id}" {eq name="$detail.type" value="$vo.id"}selected=""{/eq}>{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray">名称<font>*</font></td>
|
||||
|
@ -24,14 +24,9 @@
|
||||
<td>
|
||||
<select name="type" lay-filter="type" lay-verify="required" lay-reqText="请选择应用模块">
|
||||
<option value="">--请选择--</option>
|
||||
<option value="1">假勤</option>
|
||||
<option value="2">行政</option>
|
||||
<option value="3">财务</option>
|
||||
<option value="4">人事</option>
|
||||
<option value="5">其他</option>
|
||||
<option value="6">报销</option>
|
||||
<option value="7">发票</option>
|
||||
<option value="8">合同</option>
|
||||
{volist name="$type" id="vo"}
|
||||
<option value="{$vo.id}">{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray">审批类型<font>*</font></td>
|
||||
@ -154,14 +149,9 @@
|
||||
<td>
|
||||
<select name="type" lay-filter="type" lay-verify="required" lay-reqText="请选择应用模块">
|
||||
<option value="">--请选择--</option>
|
||||
<option value="1" {eq name="$detail.type" value="1"}selected=""{/eq}>假勤</option>
|
||||
<option value="2" {eq name="$detail.type" value="2"}selected=""{/eq}>行政</option>
|
||||
<option value="3" {eq name="$detail.type" value="3"}selected=""{/eq}>财务</option>
|
||||
<option value="4" {eq name="$detail.type" value="4"}selected=""{/eq}>人事</option>
|
||||
<option value="5" {eq name="$detail.type" value="5"}selected=""{/eq}>其他</option>
|
||||
<option value="6" {eq name="$detail.type" value="6"}selected=""{/eq}>报销</option>
|
||||
<option value="7" {eq name="$detail.type" value="7"}selected=""{/eq}>发票</option>
|
||||
<option value="8" {eq name="$detail.type" value="8"}selected=""{/eq}>合同</option>
|
||||
{volist name="$type" id="vo"}
|
||||
<option value="{$vo.id}" {eq name="$detail.type" value="$vo.id"}selected=""{/eq}>{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray">审批类型<font>*</font></td>
|
||||
|
@ -39,27 +39,7 @@
|
||||
}
|
||||
return html;
|
||||
}}
|
||||
,{field:'name',title: '应用模块',width:80, align:'center',templet:function(d){
|
||||
var html = '其他';
|
||||
if(d.type==1){
|
||||
html = '假勤';
|
||||
}else if(d.type==2){
|
||||
html = '行政';
|
||||
}else if(d.type==3){
|
||||
html = '财务';
|
||||
}else if(d.type==4){
|
||||
html = '人事';
|
||||
}else if(d.type==5){
|
||||
html = '其他';
|
||||
}else if(d.type==6){
|
||||
html = '报销';
|
||||
}else if(d.type==7){
|
||||
html = '发票';
|
||||
}else if(d.type==8){
|
||||
html = '合同';
|
||||
}
|
||||
return html;
|
||||
}}
|
||||
,{field:'type_name',title: '应用模块',width:80, align:'center'}
|
||||
,{field:'flow_cate',title: '审批类型',width:100, align:'center'}
|
||||
,{field:'department',title: '适用部门'}
|
||||
,{field:'username',title: '最后修改人',width:90,align:'center'}
|
||||
|
@ -55,6 +55,7 @@ class Approve extends BaseController
|
||||
} else {
|
||||
$list = Db::name('FlowType')->where(['status'=>1])->select()->toArray();
|
||||
View::assign('list', $list);
|
||||
View::assign('type', get_config('approve.type'));
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b">
|
||||
@ -43,7 +43,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="">
|
||||
@ -99,7 +99,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" readonly class="layui-input" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" readonly class="layui-input select-time" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b" lay-verify="required" lay-reqText="请选择具体时间">
|
||||
@ -131,7 +131,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" readonly class="layui-input" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" readonly class="layui-input select-time" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="{$detail.duration}">
|
||||
@ -212,19 +212,11 @@ const moduleInit = ['tool','employeepicker'];
|
||||
employeepicker = layui.employeepicker,
|
||||
laydate = layui.laydate;
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false
|
||||
lay('.select-time').each(function () {
|
||||
laydate.render({
|
||||
elem: this,
|
||||
trigger: 'click'
|
||||
});
|
||||
});
|
||||
|
||||
if (typeof (flowStep) == "function") {
|
||||
|
@ -11,7 +11,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b">
|
||||
@ -66,7 +66,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="">
|
||||
@ -137,7 +137,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b" lay-verify="required" lay-reqText="请选择具体时间">
|
||||
@ -192,7 +192,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="{$detail.duration}">
|
||||
@ -279,8 +279,10 @@ function leaveTime() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var start = new Date(data_1+' '+data_1_1);
|
||||
var end = new Date(data_2+' '+data_2_1);
|
||||
var start_date = data_1+' '+data_1_1;
|
||||
var end_date = data_2+' '+data_2_1;
|
||||
var start = new Date(start_date.replace(/-/g,'/'));
|
||||
var end = new Date(end_date.replace(/-/g,'/'));
|
||||
var diff=end.getTime() - start.getTime();//时间差的毫秒数
|
||||
if(diff<0){
|
||||
return 0;
|
||||
@ -298,41 +300,23 @@ const moduleInit = ['tool','employeepicker'];
|
||||
|
||||
if (typeof (flowStep) == "function") {
|
||||
flowStep();
|
||||
}
|
||||
}
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#duration').html('-');
|
||||
lay('.select-time').each(function () {
|
||||
laydate.render({
|
||||
elem: this,
|
||||
trigger: 'click',
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#duration').html('-');
|
||||
}
|
||||
else{
|
||||
$('#duration').html('共'+hours+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours);
|
||||
}
|
||||
else{
|
||||
$('#duration').html('共'+hours+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours);
|
||||
}
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#duration').html('-');
|
||||
}
|
||||
else{
|
||||
$('#duration').html('共'+hours+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
form.on('select(time_b)', function(data){
|
||||
|
@ -28,7 +28,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b">
|
||||
@ -54,7 +54,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="">
|
||||
@ -123,7 +123,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b" lay-verify="required" lay-reqText="请选择具体时间">
|
||||
@ -149,7 +149,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="{$detail.duration}">
|
||||
@ -231,8 +231,10 @@ function leaveTime() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var start = new Date(data_1+' '+data_1_1);
|
||||
var end = new Date(data_2+' '+data_2_1);
|
||||
var start_date = data_1+' '+data_1_1;
|
||||
var end_date = data_2+' '+data_2_1;
|
||||
var start = new Date(start_date.replace(/-/g,'/'));
|
||||
var end = new Date(end_date.replace(/-/g,'/'));
|
||||
var startHour = start.getHours(); //16
|
||||
var startMin = start.getMinutes();
|
||||
var endHour = end.getHours();
|
||||
@ -292,52 +294,27 @@ const moduleInit = ['tool','employeepicker'];
|
||||
if (typeof (flowStep) == "function") {
|
||||
flowStep();
|
||||
}
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#hours,#days').html('-');
|
||||
}
|
||||
else{
|
||||
$('#hours').html('共'+hours/10+'小时');
|
||||
var days = 0;
|
||||
if(hours>75){
|
||||
days = parseInt(hours/75);
|
||||
lay('.select-time').each(function () {
|
||||
laydate.render({
|
||||
elem: this,
|
||||
trigger: 'click',
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#hours,#days').html('-');
|
||||
}
|
||||
$('#days').html('共'+days+'天,'+(hours%75)/10+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours/10);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#hours,#days').html('-');
|
||||
}
|
||||
else{
|
||||
$('#hours').html('共'+hours/10+'小时');
|
||||
var days = 0;
|
||||
if(hours>=75){
|
||||
days = parseInt(hours/75);
|
||||
else{
|
||||
$('#hours').html('共'+hours/10+'小时');
|
||||
var days = 0;
|
||||
if(hours>=75){
|
||||
days = parseInt(hours/75);
|
||||
}
|
||||
$('#days').html('共'+days+'天,'+(hours%75)/10+'小时');
|
||||
}
|
||||
$('#days').html('共'+days+'天,'+(hours%75)/10+'小时');
|
||||
$('[name="duration"]').val(hours/10);
|
||||
}
|
||||
$('[name="duration"]').val(hours/10);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
form.on('select(time_b)', function(data){
|
||||
|
@ -15,7 +15,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b">
|
||||
@ -41,7 +41,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="">
|
||||
@ -97,7 +97,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b" lay-verify="required" lay-reqText="请选择具体时间">
|
||||
@ -123,7 +123,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="{$detail.duration}">
|
||||
@ -205,9 +205,11 @@ function leaveTime() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var start = new Date(data_1+' '+data_1_1);
|
||||
var end = new Date(data_2+' '+data_2_1);
|
||||
var startHour = start.getHours(); //16
|
||||
var start_date = data_1+' '+data_1_1;
|
||||
var end_date = data_2+' '+data_2_1;
|
||||
var start = new Date(start_date.replace(/-/g,'/'));
|
||||
var end = new Date(end_date.replace(/-/g,'/'));
|
||||
var startHour = start.getHours();
|
||||
var startMin = start.getMinutes();
|
||||
var endHour = end.getHours();
|
||||
var endMin = end.getMinutes();
|
||||
@ -267,49 +269,42 @@ const moduleInit = ['tool','employeepicker'];
|
||||
flowStep();
|
||||
}
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#hours,#days').html('-');
|
||||
}
|
||||
else{
|
||||
$('#hours').html('共'+hours/10+'小时');
|
||||
var days = 0;
|
||||
if(hours>75){
|
||||
days = parseInt(hours/75);
|
||||
lay('.select-time').each(function () {
|
||||
laydate.render({
|
||||
elem: this,
|
||||
trigger: 'click',
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#hours,#days').html('-');
|
||||
}
|
||||
$('#days').html('共'+days+'天,'+(hours%75)/10+'小时');
|
||||
else{
|
||||
$('#hours').html('共'+hours/10+'小时');
|
||||
var days = 0;
|
||||
if(hours>75){
|
||||
days = parseInt(hours/75);
|
||||
}
|
||||
$('#days').html('共'+days+'天,'+(hours%75)/10+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours/10);
|
||||
}
|
||||
$('[name="duration"]').val(hours/10);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#hours,#days').html('-');
|
||||
}
|
||||
else{
|
||||
$('#hours').html('共'+hours/10+'小时');
|
||||
var days = 0;
|
||||
if(hours>=75){
|
||||
days = parseInt(hours/75);
|
||||
}
|
||||
$('#days').html('共'+days+'天,'+(hours%75)/10+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours/10);
|
||||
form.on('select(time_b)', function(data){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#hours,#days').html('-');
|
||||
}
|
||||
else{
|
||||
$('#hours').html('共'+hours/10+'小时');
|
||||
var days = 0;
|
||||
if(hours>=75){
|
||||
days = parseInt(hours/75);
|
||||
}
|
||||
$('#days').html('共'+days+'天,'+(hours%75)/10+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours/10);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b">
|
||||
@ -66,7 +66,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="">
|
||||
@ -150,7 +150,7 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">开始时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="start_time_a" name="start_time_a" autocomplete="off" class="layui-input select-time" value="{$detail.start_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<select lay-filter="time_b" id="start_time_b" name="start_time_b" lay-verify="required" lay-reqText="请选择具体时间">
|
||||
@ -205,7 +205,7 @@
|
||||
</td>
|
||||
<td class="layui-td-gray">结束时间<font>*</font></td>
|
||||
<td>
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
<input id="end_time_a" name="end_time_a" autocomplete="off" class="layui-input select-time" value="{$detail.end_time_a}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="duration" value="{$detail.duration}">
|
||||
@ -305,8 +305,10 @@ function leaveTime() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var start = new Date(data_1+' '+data_1_1);
|
||||
var end = new Date(data_2+' '+data_2_1);
|
||||
var start_date = data_1+' '+data_1_1;
|
||||
var end_date = data_2+' '+data_2_1;
|
||||
var start = new Date(start_date.replace(/-/g,'/'));
|
||||
var end = new Date(end_date.replace(/-/g,'/'));
|
||||
var diff=end.getTime() - start.getTime();//时间差的毫秒数
|
||||
if(diff<0){
|
||||
return 0;
|
||||
@ -322,41 +324,23 @@ const moduleInit = ['tool','employeepicker'];
|
||||
var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate;
|
||||
if (typeof (flowStep) == "function") {
|
||||
flowStep();
|
||||
}
|
||||
}
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#duration').html('-');
|
||||
lay('.select-time').each(function () {
|
||||
laydate.render({
|
||||
elem: this,
|
||||
trigger: 'click',
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#duration').html('-');
|
||||
}
|
||||
else{
|
||||
$('#duration').html('共'+hours+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours);
|
||||
}
|
||||
else{
|
||||
$('#duration').html('共'+hours+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours);
|
||||
}
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time_a',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(){
|
||||
var hours = leaveTime();
|
||||
if(hours == 0){
|
||||
$('#duration').html('-');
|
||||
}
|
||||
else{
|
||||
$('#duration').html('共'+hours+'小时');
|
||||
}
|
||||
$('[name="duration"]').val(hours);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
form.on('select(time_b)', function(data){
|
||||
|
@ -17,57 +17,19 @@
|
||||
<div class="layui-row layui-col-space12">
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header" style="border-bottom:1px solid #eee;"><h3 class="h3-title">审批新申请</h3></div>
|
||||
<div class="layui-card-header"><strong>假勤</strong></div>
|
||||
<div class="layui-card-header" style="border-bottom:1px solid #eee;"><h3 class="h3-title">审批新申请</h3></div>
|
||||
{volist name="type" id="v" offset="0" length='5'}
|
||||
<div class="layui-card-header"><strong>{$v.title}</strong></div>
|
||||
<div class="square">
|
||||
<div class="layui-row">
|
||||
{volist name="list" id="vo"}
|
||||
{eq name="vo.type" value="1"}
|
||||
<div class="layui-col-md4" data-type="{$vo.id}" title="{$vo.title}"><div><i class="iconfont {$vo.icon}"></i>{$vo.title}</div></div>
|
||||
{/eq}
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-header"><strong>行政</strong></div>
|
||||
<div class="square">
|
||||
<div class="layui-row">
|
||||
{volist name="list" id="vo"}
|
||||
{eq name="vo.type" value="2"}
|
||||
<div class="layui-col-md4" data-type="{$vo.id}" title="{$vo.title}"><div><i class="iconfont {$vo.icon}"></i>{$vo.title}</div></div>
|
||||
{/eq}
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-header"><strong>财务</strong></div>
|
||||
<div class="square">
|
||||
<div class="layui-row">
|
||||
{volist name="list" id="vo"}
|
||||
{eq name="vo.type" value="3"}
|
||||
<div class="layui-col-md4" data-type="{$vo.id}" title="{$vo.title}"><div><i class="iconfont {$vo.icon}"></i>{$vo.title}</div></div>
|
||||
{/eq}
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-header"><strong>人事</strong></div>
|
||||
<div class="square">
|
||||
<div class="layui-row">
|
||||
{volist name="list" id="vo"}
|
||||
{eq name="vo.type" value="4"}
|
||||
<div class="layui-col-md4" data-type="{$vo.id}" title="{$vo.title}"><div><i class="iconfont {$vo.icon}"></i>{$vo.title}</div></div>
|
||||
{/eq}
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-header"><strong>其他</strong></div>
|
||||
<div class="square">
|
||||
<div class="layui-row">
|
||||
{volist name="list" id="vo"}
|
||||
{eq name="vo.type" value="5"}
|
||||
{eq name="vo.type" value="$v.id"}
|
||||
<div class="layui-col-md4" data-type="{$vo.id}" title="{$vo.title}"><div><i class="iconfont {$vo.icon}"></i>{$vo.title}</div></div>
|
||||
{/eq}
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md9">
|
||||
|
59
config/approve.php
Normal file
59
config/approve.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 审批类型
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 审批类型
|
||||
'type' => [
|
||||
[
|
||||
'id' => '1',
|
||||
'title'=> '假勤',
|
||||
'db_type'=>1,
|
||||
'db_name'=>'',
|
||||
],
|
||||
[
|
||||
'id' => '2',
|
||||
'title'=> '行政',
|
||||
'db_type'=>1,
|
||||
'db_name'=>'',
|
||||
],
|
||||
[
|
||||
'id' => '3',
|
||||
'title'=> '财务',
|
||||
'db_type'=>1,
|
||||
'db_name'=>'',
|
||||
],
|
||||
[
|
||||
'id' => '4',
|
||||
'title'=> '人事',
|
||||
'db_type'=>1,
|
||||
'db_name'=>'',
|
||||
],
|
||||
[
|
||||
'id' => '5',
|
||||
'title'=> '其他',
|
||||
'db_type'=>1,
|
||||
'db_name'=>'',
|
||||
],
|
||||
[
|
||||
'id' => '6',
|
||||
'title'=> '报销' ,
|
||||
'db_type'=>2,
|
||||
'db_name'=>'',
|
||||
],
|
||||
[
|
||||
'id' => '7',
|
||||
'title'=> '发票',
|
||||
'db_type'=>3,
|
||||
'db_name'=>'',
|
||||
],
|
||||
[
|
||||
'id' => '8',
|
||||
'title'=> '合同',
|
||||
'db_type'=>4,
|
||||
'db_name'=>'',
|
||||
],
|
||||
],
|
||||
];
|
Loading…
x
Reference in New Issue
Block a user