|  |  |  | 
|---|
|  |  |  | {type: 'checkbox', fixed: 'left'} | 
|---|
|  |  |  | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} | 
|---|
|  |  |  | ,{field: 'templateName', align: 'center',title: '模板名', width: 220, style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} | 
|---|
|  |  |  | ,{field: 'orderNum', align: 'center',title: '报价预算单号'} | 
|---|
|  |  |  | ,{field: 'inOrderNum', align: 'center',title: '报价编号'} | 
|---|
|  |  |  | ,{field: 'planId$', align: 'center',title: '规划单号'} | 
|---|
|  |  |  | ,{field: 'createTime$', align: 'center',title: '创建时间'} | 
|---|
|  |  |  | ,{field: 'updateTime$', align: 'center',title: '更新时间'} | 
|---|
|  |  |  | ,{field: 'memberId$', align: 'center',title: '业务员'} | 
|---|
|  |  |  | ,{field: 'userId$', align: 'center',title: '创建人员'} | 
|---|
|  |  |  | ,{field: 'updateUserId$', align: 'center',title: '更新人员'} | 
|---|
|  |  |  | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:200} | 
|---|
|  |  |  | ,{field: 'orderNum', align: 'center',title: '报价预算单号',hide: false} | 
|---|
|  |  |  | ,{field: 'inOrderNum', align: 'center',title: '报价编号',hide: false} | 
|---|
|  |  |  | ,{field: 'planId$', align: 'center',title: '规划单号',hide: false} | 
|---|
|  |  |  | ,{field: 'planName$', align: 'center',title: '规划单名称',hide: false} | 
|---|
|  |  |  | ,{field: 'settle$', align: 'center',title: '进度', width: 150,hide: false} | 
|---|
|  |  |  | ,{field: 'createTime$', align: 'center',title: '创建时间',hide: false} | 
|---|
|  |  |  | ,{field: 'updateTime$', align: 'center',title: '更新时间',hide: false} | 
|---|
|  |  |  | ,{field: 'memberId$', align: 'center',title: '业务员',hide: false} | 
|---|
|  |  |  | ,{field: 'userId$', align: 'center',title: '创建人员',hide: true} | 
|---|
|  |  |  | ,{field: 'updateUserId$', align: 'center',title: '更新人员',hide: false} | 
|---|
|  |  |  | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:280} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | request: { | 
|---|
|  |  |  | pageName: 'curr', | 
|---|
|  |  |  | 
|---|
|  |  |  | table.on('tool(priQuote)', function(obj){ | 
|---|
|  |  |  | var data = obj.data; | 
|---|
|  |  |  | switch (obj.event) { | 
|---|
|  |  |  | case 'approval': | 
|---|
|  |  |  | layer.confirm('审批通过?', { | 
|---|
|  |  |  | skin: 'layui-layer-admin', | 
|---|
|  |  |  | shade: .1, | 
|---|
|  |  |  | offset: '200px', | 
|---|
|  |  |  | title: data.name | 
|---|
|  |  |  | }, function (i) { | 
|---|
|  |  |  | layer.close(i); | 
|---|
|  |  |  | approval(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 'refuse': | 
|---|
|  |  |  | layer.confirm('拒绝?', { | 
|---|
|  |  |  | skin: 'layui-layer-admin', | 
|---|
|  |  |  | shade: .1, | 
|---|
|  |  |  | offset: '200px', | 
|---|
|  |  |  | title: data.name | 
|---|
|  |  |  | }, function (i) { | 
|---|
|  |  |  | layer.close(i); | 
|---|
|  |  |  | refuse(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 'more': | 
|---|
|  |  |  | top.priQuoteByMore = data.id; | 
|---|
|  |  |  | console.log(top.priQuoteByMore) | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function refuse(planId, plannerId, dIdx) { | 
|---|
|  |  |  | let loadIndex = layer.load(2); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/priQuote/refuse/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | planId: planId, | 
|---|
|  |  |  | plannerId: plannerId | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (dIdx) { | 
|---|
|  |  |  | layer.close(dIdx); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | layer.close(loadIndex); | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 1}); | 
|---|
|  |  |  | tableReload(); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | function approval(planId, plannerId, dIdx) { | 
|---|
|  |  |  | let loadIndex = layer.load(2); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/priQuote/approval/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | planId: planId, | 
|---|
|  |  |  | plannerId: plannerId | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (dIdx) { | 
|---|
|  |  |  | layer.close(dIdx); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | layer.close(loadIndex); | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 1}); | 
|---|
|  |  |  | tableReload(); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //更新form | 
|---|
|  |  |  | function showEditForm(mData) { | 
|---|
|  |  |  | admin.open({ | 
|---|