|  |  | 
 |  |  | var pageCurr; | 
 |  |  | var admin; | 
 |  |  | var treeCond; | 
 |  |  | var htmlCstme; | 
 |  |  | var htmlCstmrData; | 
 |  |  | var indexS = "9999,8888"; | 
 |  |  | var indexDelSign = 0; | 
 |  |  | layui.config({ | 
 |  |  |     base: baseUrl + "/static/layui/lay/modules/" | 
 |  |  | }).extend({ | 
 |  |  | 
 |  |  |             {field: 'id', align: 'center',title: 'ID',hide : true} | 
 |  |  |             ,{field: 'startTime$', align: 'center',title: '开始日期',hide : true} | 
 |  |  |             ,{field: 'endTime$', align: 'center',title: '结束日期',hide : true} | 
 |  |  |             ,{field: 'weeklyDayMonth', align: 'center',title: '周',hide : false} | 
 |  |  |             ,{field: 'userId$', align: 'center',title: '所属人员',hide : true} | 
 |  |  |             ,{field: 'hostId$', align: 'center',title: '所属商户',hide : true} | 
 |  |  |             ,{field: 'deptId$', align: 'center',title: '所属部门',hide : true} | 
 |  |  | 
 |  |  |             ,{field: 'status$', align: 'center',title: '状态',hide : false} | 
 |  |  |             ,{field: 'settle$', align: 'center',title: '进度',hide : false} | 
 |  |  |             ,{field: 'settleMsg', align: 'center',title: '审核进度',hide : true} | 
 |  |  |             ,{field: 'weeklyDailyPlan', align: 'center',title: '日计划',hide : false, toolbar: '#tbLookPlan'} | 
 |  |  |             ,{field: 'weeklyDailyReality', align: 'center',title: '日行程',hide : false, toolbar: '#tbLookReality'} | 
 |  |  |             ,{field: 'comment', align: 'center',title: '评论',hide : false} | 
 |  |  |             ,{field: 'createBy$', align: 'center',title: '添加人员',hide : true} | 
 |  |  |             ,{field: 'createTime$', align: 'center',title: '添加时间',hide : true} | 
 |  |  | 
 |  |  |             ,{field: 'settleSize', align: 'center',title: '流程长度',hide : true} | 
 |  |  |             ,{field: 'settleCurrent', align: 'center',title: '当前进度',hide : true} | 
 |  |  |             ,{field: 'cstmrIdsPlan', align: 'center',title: '计划甲方单位ID集合',hide : true} | 
 |  |  |             ,{field: 'weeklyAll', align: 'center',title: '周数',hide : false}                                                                                                                                                                                                                                                                                                                                                      | 
 |  |  |             ,{field: 'weeklyAll', align: 'center',title: '周数',hide : true} | 
 |  |  |             ,{field: 'weeklyNowMonth', align: 'center',title: '当月第几周',hide : true} | 
 |  |  |             ,{field: 'weeklyYear', align: 'center',title: '年',hide : true} | 
 |  |  |             ,{field: 'weeklyMonth', align: 'center',title: '月',hide : true} | 
 |  |  |             ,{field: 'weeklyDay', align: 'center',title: '日',hide : true} | 
 |  |  |             ,{field: 'weeklyDayMonth', align: 'center',title: '周',hide : true} | 
 |  |  |  | 
 |  |  |             ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} | 
 |  |  |             ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:240} | 
 |  |  |         ]], | 
 |  |  |         request: { | 
 |  |  |             pageName: 'curr', | 
 |  |  | 
 |  |  |             case "edit": | 
 |  |  |                 showEditModel(data); | 
 |  |  |                 break; | 
 |  |  |             case "look": | 
 |  |  |                 var $a = $(obj.tr).find('a[lay-event="look"]'); | 
 |  |  |             case "editReality": | 
 |  |  |                 showEditModel2(data); | 
 |  |  |                 break; | 
 |  |  |             case "lookPlan": | 
 |  |  |                 var $a = $(obj.tr).find('a[lay-event="lookPlan"]'); | 
 |  |  |                 var offset = $a.offset(); | 
 |  |  |                 var top2 = offset.top; | 
 |  |  |                 var left = offset.left; | 
 |  |  |                 layer.open({ | 
 |  |  |                     type: 1, | 
 |  |  |                     title: false, | 
 |  |  |                     area: '2100px', | 
 |  |  |                     offset: [top2 + 'px', (left - 1430 + $a.outerWidth()) + 'px'], | 
 |  |  |                     area: '1100px', | 
 |  |  |                     offset: [top2 + 'px', (left - 430 + $a.outerWidth()) + 'px'], | 
 |  |  |                     shade: .01, | 
 |  |  |                     shadeClose: true, | 
 |  |  |                     fixed: false, | 
 |  |  | 
 |  |  |                         table.render({ | 
 |  |  |                             elem: '#lookSSXMTable', | 
 |  |  |                             headers: {token: localStorage.getItem('token')}, | 
 |  |  |                             url: baseUrl+'/weeklyDetl/list/auth', | 
 |  |  |                             url: baseUrl+'/weeklyDailyPlan/list/auth', | 
 |  |  |                             where: { | 
 |  |  |                                 order_id: data.id | 
 |  |  |                                 weekly_id: data.id | 
 |  |  |                             }, | 
 |  |  |                             page: true, | 
 |  |  |                             cellMinWidth: 100, | 
 |  |  |                             cols: [[ | 
 |  |  |                                 {type: 'checkbox'} | 
 |  |  |                                 ,{field: 'id', align: 'center',title: 'ID'} | 
 |  |  |                                 ,{field: 'dailyTime$', align: 'center',title: '日报日期'} | 
 |  |  |                                 ,{field: 'userId$', align: 'center',title: '所属人员'} | 
 |  |  |                                 ,{field: 'hostId$', align: 'center',title: '所属商户'} | 
 |  |  |                                 ,{field: 'deptId$', align: 'center',title: '所属部门'} | 
 |  |  |                                 ,{field: 'status$', align: 'center',title: '状态'} | 
 |  |  |                                 ,{field: 'settle$', align: 'center',title: '进度'} | 
 |  |  |                                 ,{field: 'settleMsg', align: 'center',title: '审核进度'} | 
 |  |  |                                 ,{field: 'comment', align: 'center',title: '评论'} | 
 |  |  |                                 ,{field: 'createBy$', align: 'center',title: '添加人员'} | 
 |  |  |                                 ,{field: 'createTime$', align: 'center',title: '添加时间'} | 
 |  |  |                                 ,{field: 'updateBy$', align: 'center',title: '修改人员'} | 
 |  |  |                                 ,{field: 'updateTime$', align: 'center',title: 'update_time'} | 
 |  |  |                                 ,{field: 'weeklyMatter', align: 'center',title: '需协助事项'} | 
 |  |  |                                 ,{field: 'director$', align: 'center',title: '负责人'} | 
 |  |  |                                 ,{field: 'settleSize', align: 'center',title: '流程长度'} | 
 |  |  |                                 ,{field: 'settleCurrent', align: 'center',title: '当前进度'} | 
 |  |  |                                 ,{field: 'weeklyId', align: 'center',title: '周报ID'} | 
 |  |  |                                 ,{field: 'cstmrId', align: 'center',title: '甲方单位ID'} | 
 |  |  |                                 ,{field: 'weeklyDay', align: 'center',title: '星期'} | 
 |  |  |                                 ,{field: 'memo', align: 'center',title: '备注'} | 
 |  |  |  | 
 |  |  |                                 ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} | 
 |  |  |                                 {type: 'numbers'} | 
 |  |  |                                 ,{field: 'weeklyDay$', align: 'center',title: '星期'} | 
 |  |  |                                 ,{field: 'dailyTime$', align: 'center',title: '日期'} | 
 |  |  |                                 ,{field: 'workContent', align: 'center', title: '工作内容', edit:false} | 
 |  |  |                                 ,{field: 'workPurpose', title: '工作目的', edit:false} | 
 |  |  |                                 ,{field: 'comment', title: '评论', edit:false} | 
 |  |  |                                 ,{field: 'weeklyMatter', title: '需协助事项',  edit:false} | 
 |  |  |                                 // ,{field: 'dailyTime$', align: 'center',title: '日报日期'} | 
 |  |  |                                 // ,{field: 'settleMsg', align: 'center',title: '审核进度'} | 
 |  |  |                                 // ,{field: 'director', align: 'center',title: '负责人'} | 
 |  |  |                                 // ,{field: 'settleSize', align: 'center',title: '流程长度'} | 
 |  |  |                                 // ,{field: 'settleCurrent', align: 'center',title: '当前进度'} | 
 |  |  |                                 ,{field: 'cstmrId', align: 'center',title: '甲方单位ID'}//, templet: function () { return htmlCstme;} | 
 |  |  |                                 ,{field: 'memo', align: 'center',title: '备注',   edit:false} | 
 |  |  |                             ]], | 
 |  |  |                             request: { | 
 |  |  |                                 pageName: 'curr', | 
 |  |  |                                 pageSize: 'limit' | 
 |  |  |                             }, | 
 |  |  |                             parseData: function (res) { | 
 |  |  |                                 return { | 
 |  |  |                                     'code': res.code, | 
 |  |  |                                     'msg': res.msg, | 
 |  |  |                                     'count': res.data.total, | 
 |  |  |                                     'data': res.data.records | 
 |  |  |                                 } | 
 |  |  |                             }, | 
 |  |  |                             response: { | 
 |  |  |                                 statusCode: 200 | 
 |  |  |                             }, | 
 |  |  |                             done: function () { | 
 |  |  |                                 $(layero).find('.layui-table-view').css('margin', '0'); | 
 |  |  |                             }, | 
 |  |  |                             size: '' | 
 |  |  |                         }); | 
 |  |  |                     } | 
 |  |  |                 }); | 
 |  |  |                 break; | 
 |  |  |             case "lookReality": | 
 |  |  |                 var $a = $(obj.tr).find('a[lay-event="lookReality"]'); | 
 |  |  |                 var offset = $a.offset(); | 
 |  |  |                 var top2 = offset.top; | 
 |  |  |                 var left = offset.left; | 
 |  |  |                 layer.open({ | 
 |  |  |                     type: 1, | 
 |  |  |                     title: false, | 
 |  |  |                     area: '1100px', | 
 |  |  |                     offset: [top2 + 'px', (left - 830 + $a.outerWidth()) + 'px'], | 
 |  |  |                     shade: .01, | 
 |  |  |                     shadeClose: true, | 
 |  |  |                     fixed: false, | 
 |  |  |                     content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', | 
 |  |  |                     success: function (layero) { | 
 |  |  |                         table.render({ | 
 |  |  |                             elem: '#lookSSXMTable', | 
 |  |  |                             headers: {token: localStorage.getItem('token')}, | 
 |  |  |                             url: baseUrl+'/weeklyDailyReality/list/auth', | 
 |  |  |                             where: { | 
 |  |  |                                 weekly_id: data.id | 
 |  |  |                             }, | 
 |  |  |                             page: true, | 
 |  |  |                             cellMinWidth: 100, | 
 |  |  |                             cols: [[ | 
 |  |  |                                 {type: 'numbers'} | 
 |  |  |                                 ,{field: 'weeklyDay$', align: 'center',title: '星期'} | 
 |  |  |                                 ,{field: 'dailyTime$', align: 'center',title: '日期'} | 
 |  |  |                                 ,{field: 'workContent', align: 'center', title: '工作内容', edit:false} | 
 |  |  |                                 ,{field: 'workPurpose', title: '工作目的', edit:false} | 
 |  |  |                                 ,{field: 'comment', title: '评论', edit:false} | 
 |  |  |                                 ,{field: 'weeklyMatter', title: '需协助事项',  edit:false} | 
 |  |  |                                 // ,{field: 'dailyTime$', align: 'center',title: '日报日期'} | 
 |  |  |                                 // ,{field: 'settleMsg', align: 'center',title: '审核进度'} | 
 |  |  |                                 // ,{field: 'director', align: 'center',title: '负责人'} | 
 |  |  |                                 // ,{field: 'settleSize', align: 'center',title: '流程长度'} | 
 |  |  |                                 // ,{field: 'settleCurrent', align: 'center',title: '当前进度'} | 
 |  |  |                                 ,{field: 'cstmrId', align: 'center',title: '甲方单位ID'}//, templet: function () { return htmlCstme;} | 
 |  |  |                                 ,{field: 'memo', align: 'center',title: '备注',   edit:false} | 
 |  |  |                             ]], | 
 |  |  |                             request: { | 
 |  |  |                                 pageName: 'curr', | 
 |  |  | 
 |  |  |     function showEditModel(expTpe) { | 
 |  |  |         admin.open({ | 
 |  |  |             type: 1, | 
 |  |  |             title: (expTpe ? '修改' : '添加') + '报销审批', | 
 |  |  |             title: (expTpe ? '修改' : '创建') + '周计划', | 
 |  |  |             content: $('#editDialog').html(), | 
 |  |  |             area: '2200px', | 
 |  |  |             success: function (layero, dIndex) { | 
 |  |  |                 $(layero).children('.layui-layer-content').css('overflow', 'visible'); | 
 |  |  |                 var isExpAdd = !expTpe; | 
 |  |  |                 // if (expTpe){ | 
 |  |  |                 //     document.getElementById('weeklyDisplay').style.display = 'none'; | 
 |  |  |                 // } | 
 |  |  |                 if (expTpe){ | 
 |  |  |                     document.getElementById('weeklyDisplay').style.display = 'none'; | 
 |  |  |                 } | 
 |  |  |                 // 回显数据 | 
 |  |  |                 form.val('editForm', expTpe); | 
 |  |  |                 console.log(expTpe) | 
 |  |  | 
 |  |  |                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                         data: JSON.stringify({ | 
 |  |  |                             weeklyType: Number(data.field.weeklyType), | 
 |  |  |                             orderId: data.field.orderId, | 
 |  |  |                             weeklyId: data.field.id, | 
 |  |  |                             // type: Number(data.field.type), | 
 |  |  |                             type: Number(1), | 
 |  |  |                             weeklyDailyPlanList: nList | 
 |  |  | 
 |  |  |                         contentType:'application/json;charset=UTF-8', | 
 |  |  |                         method: 'POST', | 
 |  |  |                         success: function (res) { | 
 |  |  |                             console.log(data) | 
 |  |  |                             layer.closeAll('loading'); | 
 |  |  |                             if (res.code === 200){ | 
 |  |  |                                 layer.close(dIndex); | 
 |  |  | 
 |  |  |                     cols: [[ | 
 |  |  |                         {type: 'numbers', title: '#'} | 
 |  |  |                         ,{field: 'weeklyDay$', align: 'center',title: '星期'} | 
 |  |  |                         ,{field: 'comment', title: '评论', width: 100, style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{field: 'weeklyMatter', title: '需协助事项', width: 100, style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{field: 'dailyTime$', align: 'center',title: '日报日期'} | 
 |  |  |                         ,{field: 'settleMsg', align: 'center',title: '审核进度'} | 
 |  |  |                         ,{field: 'director', align: 'center',title: '负责人'} | 
 |  |  |                         ,{field: 'settleSize', align: 'center',title: '流程长度'} | 
 |  |  |                         ,{field: 'settleCurrent', align: 'center',title: '当前进度'} | 
 |  |  |                         ,{field: 'cstmrId', align: 'center',title: '甲方单位ID'} | 
 |  |  |                         ,{field: 'workContent', title: '工作内容', style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{field: 'workPurpose', title: '工作目的', style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{field: 'comment', title: '评论', style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{field: 'weeklyMatter', title: '需协助事项', style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         // ,{field: 'dailyTime$', align: 'center',title: '日报日期'} | 
 |  |  |                         // ,{field: 'settleMsg', align: 'center',title: '审核进度'} | 
 |  |  |                         // ,{field: 'director', align: 'center',title: '负责人'} | 
 |  |  |                         // ,{field: 'settleSize', align: 'center',title: '流程长度'} | 
 |  |  |                         // ,{field: 'settleCurrent', align: 'center',title: '当前进度'} | 
 |  |  |                         ,{field: 'cstmrId', align: 'center',title: '甲方单位ID', style: 'color: blue;font-weight: bold', templet: '#cstmrId'}//, templet: function () { return htmlCstme;} | 
 |  |  |                         ,{field: 'memo', align: 'center',title: '备注', width: 100, style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{align: 'center', title: '操作', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'} | 
 |  |  |                     ]], | 
 |  |  |                     parseData: function (res) { | 
 |  |  |                         return { | 
 |  |  |                             'code': res.code, | 
 |  |  |                             'msg': res.msg, | 
 |  |  |                             'count': res.data.total, | 
 |  |  |                             'data': res.data.records | 
 |  |  |                         } | 
 |  |  |                     }, | 
 |  |  |                     done: function (res, curr, count) { | 
 |  |  |                         $(".layui-table-cell").css('overflow', 'visible');//解决layui数据表格中嵌套下拉框显示问题 | 
 |  |  |                         $(".laytable-cell-2-0-6").css('color', 'rgba(0, 0, 0, 0)'); | 
 |  |  |  | 
 |  |  |                         $(layero).find('.layui-table-view').css('margin', '0'); | 
 |  |  |                         var options = this; | 
 |  |  |                         var indexSign = 0; | 
 |  |  |                         // 获取当前行数据 | 
 |  |  |                         table.getRowData = function(elem){ | 
 |  |  |                             var index = $(elem).closest('tr').data('index'); | 
 |  |  |                             console.log("index-----") | 
 |  |  |                             console.log(index) | 
 |  |  |                             var indexArray = indexS.split(","); // 将字符串拆分为数组 | 
 |  |  |                             // 遍历数组中的每个元素 | 
 |  |  |                             for (var i = 0; i < indexArray.length; i++) { | 
 |  |  |                                 var element = Number(indexArray[i]); | 
 |  |  |                                 // 进行相应的操作 | 
 |  |  |                                 console.log("element-----"); | 
 |  |  |                                 console.log(element); | 
 |  |  |                                 if (element===index){ | 
 |  |  |                                     indexSign = 1; | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                             if (indexSign === 0){ | 
 |  |  |                                 indexS = indexS+","+index; | 
 |  |  |                                 console.log("indexS-----") | 
 |  |  |                                 console.log(indexS) | 
 |  |  |                             } | 
 |  |  |                             return table.cache[options.id][index] || {}; | 
 |  |  |                         }; | 
 |  |  |  | 
 |  |  |                         if (indexSign === 0 && indexDelSign === 0){ | 
 |  |  |                             console.log("渲染") | 
 |  |  |                             // 渲染搜索模板 | 
 |  |  |                             $.ajax({ | 
 |  |  |                                 url: baseUrl+"/cstmr/all/get/kv", | 
 |  |  |                                 headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                                 data: { | 
 |  |  |                                     limit: 9999 | 
 |  |  |                                 }, | 
 |  |  |                                 method: 'POST', | 
 |  |  |                                 // async: false, // 设置为同步执行 | 
 |  |  |                                 success: function (res) { | 
 |  |  |                                     console.log(res) | 
 |  |  |                                     console.log($("#cstmrId").html()) | 
 |  |  |                                     res.data.forEach((item) => { | 
 |  |  |                                         console.log(item) | 
 |  |  |                                         $("#cstmrId").append("<option value='" + item.value  + "';"+" class=\"cstmrDetl\""+">" + item.name + "</option>") | 
 |  |  |                                     }) | 
 |  |  |                                 } | 
 |  |  |                             }) | 
 |  |  |                         } | 
 |  |  |  | 
 |  |  |                         $('.select-cstmr').on('change', function(){ | 
 |  |  |                             console.log("cstmrId") | 
 |  |  |                             var value = this.value; // 获取选中项 value | 
 |  |  |                             var data = table.getRowData(this); | 
 |  |  |                             xxDataList.forEach(res => { | 
 |  |  |                                 if (data.LAY_TABLE_INDEX === res.LAY_TABLE_INDEX){ | 
 |  |  |                                     console.log(res) | 
 |  |  |                                     // console.log(data) | 
 |  |  |                                     res.cstmrId = value; | 
 |  |  |                                 } | 
 |  |  |                             }) | 
 |  |  |                         }); | 
 |  |  |  | 
 |  |  |                         $(document).ready(function () { | 
 |  |  |                             $.ajax({ | 
 |  |  |                                 url: baseUrl + "/cstmr/all/get/kv", | 
 |  |  |                                 headers: { 'token': localStorage.getItem('token') }, | 
 |  |  |                                 data: { | 
 |  |  |                                     limit: 9999 | 
 |  |  |                                 }, | 
 |  |  |                                 method: 'POST', | 
 |  |  |                                 success: function (res) { | 
 |  |  |                                     if (res.code === 200) { | 
 |  |  |                                         // console.log("res111111111111") | 
 |  |  |                                         // console.log(res) | 
 |  |  |                                         var template = $('#cstmrId').html(); // 获取模板内容 | 
 |  |  |                                         var compiledTemplate = Handlebars.compile(template); // 编译模板 | 
 |  |  |                                         var html = compiledTemplate(res.data); // 将数据应用到模板中 | 
 |  |  |                                         $('.select-cstmr').html(html); // 渲染模板到页面 | 
 |  |  |                                     } else { | 
 |  |  |                                         // 处理异常情况 | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             }); | 
 |  |  |                         }); | 
 |  |  |                     }, | 
 |  |  |                     size: '' | 
 |  |  |                 }; | 
 |  |  |                 if (!isExpAdd) { | 
 |  |  |                     $.ajax({ | 
 |  |  |                         url: baseUrl+"/weekly/detl/all/auth?weeklyId=" + expTpe.id, | 
 |  |  |                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                         method: 'GET', | 
 |  |  |                         async: false, | 
 |  |  |                         success: function (res) { | 
 |  |  |                             if (res.code === 200){ | 
 |  |  |                                 xxDataList = res.data; | 
 |  |  |                                 tbOptions.data = xxDataList; | 
 |  |  |                             } else if (res.code === 403){ | 
 |  |  |                                 top.location.href = baseUrl+"/"; | 
 |  |  |                             }else { | 
 |  |  |                                 layer.msg(res.msg, {icon: 2}) | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                     }) | 
 |  |  |                 } | 
 |  |  |                 var insTbSSXM = table.render(tbOptions); | 
 |  |  |                 // 工具条点击事件 | 
 |  |  |                 table.on('tool(formSSXMTable)', function (obj) { | 
 |  |  |                     var data = obj.data; | 
 |  |  |                     var layEvent = obj.event; | 
 |  |  |                     if (layEvent === 'edit') { | 
 |  |  |                         showEditModel2(data); | 
 |  |  |                     } else if (layEvent === 'del') { | 
 |  |  |                         layer.confirm('确定要删除吗?', { | 
 |  |  |                             shade: .1, | 
 |  |  |                             skin: 'layui-layer-admin' | 
 |  |  |                         }, function (i) { | 
 |  |  |                             layer.close(i); | 
 |  |  |                             for (var j = 0; j < xxDataList.length; j++) { | 
 |  |  |                                 if (xxDataList[j].matnr === data.matnr && xxDataList[j].batch === data.batch) { | 
 |  |  |                                     xxDataList.splice(j, 1); | 
 |  |  |                                     break; | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                             insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); | 
 |  |  |                         }); | 
 |  |  |                     } | 
 |  |  |                 }); | 
 |  |  |                 // 明细数据修改 | 
 |  |  |                 table.on('edit(formSSXMTable)', function (obj) { | 
 |  |  |                     let index = obj.tr.attr("data-index"); | 
 |  |  |                     let data = xxDataList[index]; | 
 |  |  |                     if (obj.field === 'anfme'){ | 
 |  |  |                         let vle = Number(obj.value); | 
 |  |  |                         if (isNaN(vle)) { | 
 |  |  |                             layer.msg("请输入数字", {icon: 2}); | 
 |  |  |                             return false; | 
 |  |  |                         } else { | 
 |  |  |                             if (vle <= 0) { | 
 |  |  |                                 layer.msg("数量必须大于零", {icon: 2}); | 
 |  |  |                                 return false; | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     data[obj.field] = obj.value; | 
 |  |  |                     insTbSSXM.reload({data: xxDataList}); | 
 |  |  |                 }); | 
 |  |  |  | 
 |  |  |                 $('#matAddBtnComment').click(function () { | 
 |  |  |                     showEditModel2(); | 
 |  |  |                 }); | 
 |  |  |  | 
 |  |  |                 // 显示添加明细表单弹窗 | 
 |  |  |                 function showEditModel2(exp) { | 
 |  |  |                     admin.open({ | 
 |  |  |                         type: 1, | 
 |  |  |                         offset: '150px', | 
 |  |  |                         area: '680px', | 
 |  |  |                         title: (exp ? '修改' : '添加') + '明细', | 
 |  |  |                         content: $('#matEditDialog').html(), | 
 |  |  |                         success: function (layero, dIndex) { | 
 |  |  |                             if (!exp){ | 
 |  |  |                                 indexDelSign = 1; | 
 |  |  |                             } | 
 |  |  |                             // 回显数据 | 
 |  |  |                             form.val('matEditForm', exp); | 
 |  |  |                             // 表单提交事件 | 
 |  |  |                             form.on('submit(matEditSubmit)', function (data) { | 
 |  |  |                                 let selectList = matXmSelect.getValue(); | 
 |  |  |                                 console.log(selectList) | 
 |  |  |                                 for (let i = 0; i<selectList.length; i++) { | 
 |  |  |                                     let item = selectList[i]; | 
 |  |  |                                     // 查询物料详情 | 
 |  |  |                                     $.ajax({ | 
 |  |  |                                         url: baseUrl+"/weeklyCostTypes/covert/plan/"+item.value+"/auth", | 
 |  |  |                                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                                         method: 'GET', | 
 |  |  |                                         async: false, | 
 |  |  |                                         success: function (res) { | 
 |  |  |                                             if (res.code === 200){ | 
 |  |  |                                                 var bige=true; | 
 |  |  |  | 
 |  |  |                                                 if (bige){ | 
 |  |  |                                                     // console.log("-------2.3-------") | 
 |  |  |                                                     xxDataList.push(res.data); | 
 |  |  |                                                     insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); | 
 |  |  |                                                 } | 
 |  |  |                                             } else if (res.code === 403){ | 
 |  |  |                                                 top.location.href = baseUrl+"/"; | 
 |  |  |                                             }else { | 
 |  |  |                                                 layer.msg(res.msg, {icon: 2}) | 
 |  |  |                                             } | 
 |  |  |                                         } | 
 |  |  |                                     }) | 
 |  |  |                                 } | 
 |  |  |                                 layer.close(dIndex); | 
 |  |  |                                 return false; | 
 |  |  |                             }); | 
 |  |  |                             // 渲染物料选择 | 
 |  |  |                             var matXmSelect = xmSelect.render({ | 
 |  |  |                                 el: '#weeklyCostTypes', | 
 |  |  |                                 style: { | 
 |  |  |                                     width: '340px', | 
 |  |  |                                 }, | 
 |  |  |                                 autoRow: true, | 
 |  |  |                                 toolbar: { show: true }, | 
 |  |  |                                 filterable: true, | 
 |  |  |                                 remoteSearch: true, | 
 |  |  |                                 remoteMethod: function(val, cb, show){ | 
 |  |  |                                     $.ajax({ | 
 |  |  |                                         url: baseUrl+"/weeklyCostTypes/all/get/kv", | 
 |  |  |                                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                                         data: { | 
 |  |  |                                             condition: val | 
 |  |  |                                         }, | 
 |  |  |                                         method: 'POST', | 
 |  |  |                                         success: function (res) { | 
 |  |  |                                             if (res.code === 200){ | 
 |  |  |                                                 cb(res.data) | 
 |  |  |                                             } else { | 
 |  |  |                                                 cb([]); | 
 |  |  |                                                 layer.msg(res.msg, {icon: 2}); | 
 |  |  |                                             } | 
 |  |  |                                         } | 
 |  |  |                                     }); | 
 |  |  |                                 } | 
 |  |  |                             }) | 
 |  |  |                             // 弹窗不出现滚动条 | 
 |  |  |                             $(layero).children('.layui-layer-content').css('overflow', 'visible'); | 
 |  |  |                             layui.form.render('select'); | 
 |  |  |                         } | 
 |  |  |                     }); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // 显示表单弹窗 | 
 |  |  |     function showEditModel2(expTpe) { | 
 |  |  |         admin.open({ | 
 |  |  |             type: 1, | 
 |  |  |             title: (expTpe ? '创建' : '创建') + '日行程', | 
 |  |  |             content: $('#editDialog').html(), | 
 |  |  |             area: '2200px', | 
 |  |  |             success: function (layero, dIndex) { | 
 |  |  |                 $(layero).children('.layui-layer-content').css('overflow', 'visible'); | 
 |  |  |                 var isExpAdd = !expTpe; | 
 |  |  |                 if (expTpe){ | 
 |  |  |                     document.getElementById('weeklyDisplay').style.display = 'none'; | 
 |  |  |                 } | 
 |  |  |                 // 回显数据 | 
 |  |  |                 form.val('editForm', expTpe); | 
 |  |  |                 console.log(expTpe) | 
 |  |  |                 if (expTpe) { | 
 |  |  |                     // $('#orderNo').attr("disabled", "disabled"); | 
 |  |  |                 } | 
 |  |  |                 // 表单提交事件 | 
 |  |  |                 form.on('submit(weeklyEditSubmit)', function (data) { | 
 |  |  |                     // 组装数据 | 
 |  |  |                     if (xxDataList.length <= 0) { | 
 |  |  |                         layer.tips('请添加报销明细', '#matAddBtnComment', {tips: [1, '#ff4c4c']}); | 
 |  |  |                         return false; | 
 |  |  |                     } | 
 |  |  |                     let nList = admin.util.deepClone(xxDataList); | 
 |  |  |                     for (let xi = 0; xi < nList.length; xi++) { | 
 |  |  |                         // if (nList[xi].anfme <= 0){ | 
 |  |  |                         //     layer.msg('明细修改数量不合法', {icon: 2}); | 
 |  |  |                         //     return false; | 
 |  |  |                         // } | 
 |  |  |                     } | 
 |  |  |                     layer.load(2); | 
 |  |  |                     $.ajax({ | 
 |  |  |                         url: baseUrl+"/weekly/from/" + (isExpAdd?"add":"modify") + "/auth2", | 
 |  |  |                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                         data: JSON.stringify({ | 
 |  |  |                             weeklyType: Number(data.field.weeklyType), | 
 |  |  |                             weeklyId: data.field.id, | 
 |  |  |                             // type: Number(data.field.type), | 
 |  |  |                             type: Number(1), | 
 |  |  |                             weeklyDailyRealityList: nList | 
 |  |  |                         }), | 
 |  |  |                         contentType:'application/json;charset=UTF-8', | 
 |  |  |                         method: 'POST', | 
 |  |  |                         success: function (res) { | 
 |  |  |                             layer.closeAll('loading'); | 
 |  |  |                             if (res.code === 200){ | 
 |  |  |                                 layer.close(dIndex); | 
 |  |  |                                 $(".layui-laypage-btn")[0].click(); | 
 |  |  |                                 layer.msg(res.msg, {icon: 1}); | 
 |  |  |                             } else if (res.code === 403){ | 
 |  |  |                                 top.location.href = baseUrl+"/"; | 
 |  |  |                             }else { | 
 |  |  |                                 layer.msg(res.msg, {icon: 2}); | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                     }) | 
 |  |  |                     return false; | 
 |  |  |                 }); | 
 |  |  |                 // 明细表格 | 
 |  |  |                 var xxDataList = []; | 
 |  |  |                 var tbOptions = { | 
 |  |  |                     elem: '#formSSXMTable', | 
 |  |  |                     headers: {token: localStorage.getItem('token')}, | 
 |  |  |                     data: xxDataList, | 
 |  |  |                     page: true, | 
 |  |  |                     height: '350px;', | 
 |  |  |                     cellMinWidth: 100, | 
 |  |  |                     cols: [[ | 
 |  |  |                         {type: 'numbers', title: '#'} | 
 |  |  |                         ,{field: 'weeklyDay$', align: 'center',title: '星期'} | 
 |  |  |                         ,{field: 'workContent', title: '工作内容', style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{field: 'workPurpose', title: '工作目的', style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{field: 'comment', title: '评论', style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{field: 'weeklyMatter', title: '需协助事项', style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         // ,{field: 'dailyTime$', align: 'center',title: '日报日期'} | 
 |  |  |                         // ,{field: 'settleMsg', align: 'center',title: '审核进度'} | 
 |  |  |                         // ,{field: 'director', align: 'center',title: '负责人'} | 
 |  |  |                         // ,{field: 'settleSize', align: 'center',title: '流程长度'} | 
 |  |  |                         // ,{field: 'settleCurrent', align: 'center',title: '当前进度'} | 
 |  |  |                         ,{field: 'cstmrId', align: 'center',title: '甲方单位ID', style: 'color: blue;font-weight: bold', templet: '#cstmrId'}//, templet: function () { return htmlCstme;} | 
 |  |  |                         ,{field: 'memo', align: 'center',title: '备注', width: 100, style: 'color: blue;font-weight: bold', edit:true} | 
 |  |  |                         ,{align: 'center', title: '操作', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'} | 
 |  |  |                     ]], | 
 |  |  |                     parseData: function (res) { | 
 |  |  |                         return { | 
 |  |  |                             'code': res.code, | 
 |  |  |                             'msg': res.msg, | 
 |  |  |                             'count': res.data.total, | 
 |  |  |                             'data': res.data.records | 
 |  |  |                         } | 
 |  |  |                     }, | 
 |  |  |                     done: function (res, curr, count) { | 
 |  |  |                         $(".layui-table-cell").css('overflow', 'visible');//解决layui数据表格中嵌套下拉框显示问题 | 
 |  |  |                         // $(".laytable-cell-2-0-6").css('color', 'rgba(0, 0, 0, 0)'); | 
 |  |  |  | 
 |  |  |                         $(layero).find('.layui-table-view').css('margin', '0'); | 
 |  |  |                         var options = this; | 
 |  |  |  | 
 |  |  | 
 |  |  |                             return table.cache[options.id][index] || {}; | 
 |  |  |                         }; | 
 |  |  |  | 
 |  |  |                         $('.input-occupation').on('text', function(){ | 
 |  |  |                         $('.select-cstmr').on('change', function(){ | 
 |  |  |                             console.log("cstmrId") | 
 |  |  |                             var value = this.value; // 获取选中项 value | 
 |  |  |                             var data = table.getRowData(this); | 
 |  |  |                             console.log(value); | 
 |  |  |                             console.log("value------==="); | 
 |  |  |                             xxDataList.forEach(res => { | 
 |  |  |                                 if (data.id === res.id){ | 
 |  |  |                                 if (data.LAY_TABLE_INDEX === res.LAY_TABLE_INDEX){ | 
 |  |  |                                     console.log(res) | 
 |  |  |                                     res.occupation = value; | 
 |  |  |                                     // console.log(data) | 
 |  |  |                                     res.cstmrId = value; | 
 |  |  |                                 } | 
 |  |  |                             }) | 
 |  |  |  | 
 |  |  |                         }); | 
 |  |  |                     }, | 
 |  |  |                     size: '' | 
 |  |  |                 }; | 
 |  |  |                 if (!isExpAdd) { | 
 |  |  |                     $.ajax({ | 
 |  |  |                         url: baseUrl+"/weekly/detl/all/auth?weeklyId=" + expTpe.id, | 
 |  |  |                         url: baseUrl+"/weekly/detl/all/auth2?weeklyId=" + expTpe.id, | 
 |  |  |                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                         method: 'GET', | 
 |  |  |                         async: false, | 
 |  |  | 
 |  |  |                                     let item = selectList[i]; | 
 |  |  |                                     // 查询物料详情 | 
 |  |  |                                     $.ajax({ | 
 |  |  |                                         url: baseUrl+"/weeklyCostTypes/covert/plan/"+item.value+"/auth", | 
 |  |  |                                         url: baseUrl+"/weeklyCostTypes/covert/reality/"+item.value+"/auth", | 
 |  |  |                                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                                         method: 'GET', | 
 |  |  |                                         async: false, |