| | |
| | | var pageCurr; |
| | | var admin; |
| | | var treeCond; |
| | | var htmlCstme; |
| | | var htmlCstmrData; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // // 渲染搜索模板 |
| | | // $.ajax({ |
| | | // url: baseUrl+"/cstmr/all/get/kv", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // data: { |
| | | // limit: 9999 |
| | | // }, |
| | | // method: 'POST', |
| | | // // async: false, // 设置为同步执行 |
| | | // success: function (res) { |
| | | // htmlCstme = "<select id=\"select_cstmr\" name=\"select_cstmr\" lay-vertype=\"tips\" lay-verify=\"required\" required=\"\">" |
| | | // htmlCstme = htmlCstme + |
| | | // " <option style=\"display: none\"></option>\n" |
| | | // if (res.code === 200){ |
| | | // for (var val in res.data) { |
| | | // var cstmrVal = res.data[val] |
| | | // console.log(cstmrVal) |
| | | // htmlCstme = htmlCstme + |
| | | // " <option value = \""+cstmrVal.value+"\"+\n" + |
| | | // " > "+cstmrVal.name+" </option>\n" |
| | | // } |
| | | // } else { |
| | | // htmlCstme = htmlCstme + |
| | | // "<option value=\"0\">异常</option>" |
| | | // } |
| | | // htmlCstme = htmlCstme + "\n" + " </select>"; |
| | | // } |
| | | // }) |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | 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) |
| | |
| | | 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数据表格中嵌套下拉框显示问题 |
| | | $(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; |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | $(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: '' |