|  |  |  | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | // 模板下载 | 
|---|
|  |  |  | layer.load(1, {shade: [0.1,'#fff']}); | 
|---|
|  |  |  | location.href = baseUrl + "/mould/甲方单位导入模板.xls"; | 
|---|
|  |  |  | location.href = baseUrl + "/mould/跟踪项目导入模板.xls"; | 
|---|
|  |  |  | layer.closeAll('loading'); | 
|---|
|  |  |  | break | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | 
|---|
|  |  |  | skin: 'line', | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'checkbox'} | 
|---|
|  |  |  | // ,{field: 'id', align: 'center',title: 'ID'} | 
|---|
|  |  |  | // ,{field: 'hostId$', align: 'center',title: '所属商户'} | 
|---|
|  |  |  | ,{field: 'deptId$', align: 'center',title: '所属部门'} | 
|---|
|  |  |  | ,{field: 'userId$', align: 'center',title: '所属人员'} | 
|---|
|  |  |  | ,{field: 'cstmrId$', align: 'center',title: '甲方单位'} | 
|---|
|  |  |  | ,{field: 'uuid', align: 'center',title: '客户代号'} | 
|---|
|  |  |  | ,{field: 'name', align: 'center',title: '客户名称'} | 
|---|
|  |  |  | ,{field: 'money', align: 'center',title: '总金额'} | 
|---|
|  |  |  | ,{field: 'company$', align: 'center',title: '所属公司'} | 
|---|
|  |  |  | ,{field: 'remarks', align: 'center',title: '备注'} | 
|---|
|  |  |  | ,{field: 'director$', align: 'center',title: '负责人'} | 
|---|
|  |  |  | ,{field: 'province', align: 'center',title: '省', hide: true} | 
|---|
|  |  |  | ,{field: 'city', align: 'center',title: '市', hide: true} | 
|---|
|  |  |  | ,{field: 'district', align: 'center',title: '县', hide: true} | 
|---|
|  |  |  | ,{field: 'town', align: 'center',title: '镇', hide: true} | 
|---|
|  |  |  | ,{field: 'addr', align: 'center',title: '详细地址', hide: true} | 
|---|
|  |  |  | ,{field: 'files', align: 'center',title: '附件', hide: true} | 
|---|
|  |  |  | ,{field: 'status$', align: 'center',title: '状态', hide: true} | 
|---|
|  |  |  | ,{field: 'createBy$', align: 'center',title: '添加人员', hide: true} | 
|---|
|  |  |  | ,{field: 'createTime$', align: 'center',title: '添加时间', hide: true} | 
|---|
|  |  |  | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} | 
|---|
|  |  |  | ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true} | 
|---|
|  |  |  | ,{field: 'memo', align: 'center',title: '注释', hide: true} | 
|---|
|  |  |  | ,{field: 'name', align: 'left',title: '跟踪项目名称', style: 'color: #1890ff;cursor:pointer', event: 'more', width: 300} | 
|---|
|  |  |  | ,{field: 'uuid', align: 'left',title: '项目代号'} | 
|---|
|  |  |  | ,{field: 'cstmrId$', align: 'left',title: '甲方单位', style: 'color: #1890ff;cursor:pointer', event: 'cstmrMore', templet:function(d){return emptyShow(d.cstmrId$)}} | 
|---|
|  |  |  | ,{field: 'pcd$', align: 'left',title: '所属区域', templet:function(d){return emptyShow(d.pcd$)}} | 
|---|
|  |  |  | ,{field: 'addr', align: 'left',title: '项目地址', templet:function(d){return emptyShow(d.addr)}} | 
|---|
|  |  |  | ,{field: 'money', align: 'right',title: '项目总金额', templet:function(d){return emptyShow(d.money)}} | 
|---|
|  |  |  | ,{field: 'director$', align: 'left',title: '项目负责人', templet:function(d){return emptyShow(d.director$)}} | 
|---|
|  |  |  | ,{field: 'remarks', align: 'left',title: '备注', templet:function(d){return emptyShow(d.remarks)}} | 
|---|
|  |  |  | ,{field: 'createTime$', align: 'left',title: '添加时间'} | 
|---|
|  |  |  | ,{field: 'company$', align: 'left',title: '所属公司', hide: true} | 
|---|
|  |  |  | ,{field: 'province', align: 'left',title: '省', hide: true} | 
|---|
|  |  |  | ,{field: 'city', align: 'left',title: '市', hide: true} | 
|---|
|  |  |  | ,{field: 'district', align: 'left',title: '县', hide: true} | 
|---|
|  |  |  | ,{field: 'town', align: 'left',title: '镇', hide: true} | 
|---|
|  |  |  | ,{field: 'files', align: 'left',title: '附件', hide: true} | 
|---|
|  |  |  | ,{field: 'updateBy$', align: 'left',title: '修改人员', hide: true} | 
|---|
|  |  |  | ,{field: 'updateTime$', align: 'left',title: '修改时间', hide: true} | 
|---|
|  |  |  | ,{field: 'memo', align: 'left',title: '注释', hide: true} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 'cstmrMore': | 
|---|
|  |  |  | top.cstmrByMore = data.cstmrId; | 
|---|
|  |  |  | admin.popupRight({ | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | window: "top", | 
|---|
|  |  |  | area: "1250px", | 
|---|
|  |  |  | url: "../cstmr/cstmr_more.html", | 
|---|
|  |  |  | end: function () { | 
|---|
|  |  |  | // $(".layui-laypage-btn")[0].click(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 'edit': | 
|---|
|  |  |  | showEditModel(data); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  | admin.open({ | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | area: '1500px', | 
|---|
|  |  |  | title: (mData ? '修改' : '添加') + '订单状态', | 
|---|
|  |  |  | title: (mData ? '修改' : '添加') + '跟踪项目', | 
|---|
|  |  |  | content: $('#editDialog').html(), | 
|---|
|  |  |  | success: function (layero, dIndex) { | 
|---|
|  |  |  | let cstmrSel = loadCstmrSel(); | 
|---|
|  |  |  | let companySel = loadCompanySel(); | 
|---|
|  |  |  | if (mData) { | 
|---|
|  |  |  | $('#cascaderVal').val(mData.pcd); | 
|---|
|  |  |  | if (mData.cstmrId) { cstmrSel.setValue([{name: mData.cstmrId$, value: mData.cstmrId}]); } | 
|---|
|  |  |  | if (mData.company) { companySel.setValue([{name: mData.company$, value: mData.company}]); } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | layDateRender(mData); | 
|---|
|  |  |  | cascaderRender(); | 
|---|
|  |  |  | form.val('detail', mData); | 
|---|
|  |  |  | form.on('submit(editSubmit)', function (data) { | 
|---|
|  |  |  | data.field.cstmrId = cstmrSel.getValue()[0] ? cstmrSel.getValue()[0].value : null; | 
|---|
|  |  |  | data.field.company = companySel.getValue()[0] ? companySel.getValue()[0].value : null; | 
|---|
|  |  |  | if (!data.field.company) { | 
|---|
|  |  |  | layer.msg("所属公司不能为空", {icon: 2}); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var loadIndex = layer.load(2); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/order/"+(mData?'update':'add')+"/auth", | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | window.loadCstmrSel = function () { | 
|---|
|  |  |  | return xmSelect.render({ | 
|---|
|  |  |  | el: '#cstmrXmlSel', | 
|---|
|  |  |  | autoRow: true, | 
|---|
|  |  |  | filterable: true, | 
|---|
|  |  |  | remoteSearch: true, | 
|---|
|  |  |  | radio: true, | 
|---|
|  |  |  | remoteMethod: function (val, cb, show) { | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/cstmr/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}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | window.loadCompanySel = function () { | 
|---|
|  |  |  | return xmSelect.render({ | 
|---|
|  |  |  | el: '#companyXmlSel', | 
|---|
|  |  |  | autoRow: true, | 
|---|
|  |  |  | filterable: true, | 
|---|
|  |  |  | remoteSearch: true, | 
|---|
|  |  |  | radio: true, | 
|---|
|  |  |  | remoteMethod: function (val, cb, show) { | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/company/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}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 关闭动作 | 
|---|