| | |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | cascader: 'cascader/cascader', |
| | | }).use(['table','laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function() { |
| | | }).use(['table', 'laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | |
| | | hide: false |
| | | } |
| | | , {field: 'itemId', align: 'center', title: '规划单号', hide: true} |
| | | , {field: 'status$', align: 'center', title: '状态',hide : false} |
| | | , {field: 'status$', align: 'center', title: '状态', hide: false} |
| | | // ,{field: 'memberId$', align: 'center',title: ''} |
| | | , { |
| | | field: 'settle$', |
| | |
| | | event: 'more', |
| | | hide: false |
| | | } |
| | | , {field: 'user$', align: 'center', title: '业务员',hide : false} |
| | | , {field: 'deptId$', align: 'center', title: '部门',hide : true} |
| | | , {field: 'checkDataStatus$', align: 'center', title: '报价数据',hide : false} |
| | | , {field: 'createTime$', align: 'center', title: '创建时间',hide : true} |
| | | , {field: 'updateUserId$', align: 'center', title: '更新人员',hide : false} |
| | | , {field: 'updateTime$', align: 'center', title: '更新时间',hide : false} |
| | | , {field: 'settleSize', align: 'center', title: '流程长度', hide: true} |
| | | , {field: 'user$', align: 'center', title: '业务员', hide: false} |
| | | , {field: 'deptId$', align: 'center', title: '部门', hide: true} |
| | | , {field: 'checkDataStatus$', align: 'center', title: '报价数据', hide: false} |
| | | , {field: 'createTime$', align: 'center', title: '创建时间', hide: true} |
| | | , {field: 'updateUserId$', align: 'center', title: '更新人员', hide: false} |
| | | , {field: 'updateTime$', align: 'center', title: '更新时间', hide: false} |
| | | , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 350} |
| | | ]], |
| | | request: { |
| | |
| | | title: data.name |
| | | }, function (i) { |
| | | layer.close(i); |
| | | console.log(data) |
| | | approvalEnd(data.id); |
| | | }); |
| | | break; |
| | |
| | | offset: '200px', |
| | | title: data.name |
| | | }, function (i) { |
| | | console.log(data) |
| | | layer.close(i); |
| | | // 指定规划员 |
| | | if (data.settle === 1) { |
| | | // 指定模板 |
| | | if ((data.settle === 1 && data.settleSize===3) || (data.settle===2 && data.settleSize===4)) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '300px', |
| | | title: '选择规划员', |
| | | title: '选择报价模板', |
| | | content: $('#plannerListDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | let plannerSel = xmSelect.render({ |
| | |
| | | } |
| | | }); |
| | | } |
| | | function approvalEnd(planId, plannerId, dIdx) { |
| | | |
| | | function approvalEnd(priOnlineId, plannerId, dIdx) { |
| | | let loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/priOnline2/approvalEnd/auth", |
| | | url: baseUrl + "/priOnline2/approvalEnd/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | priOnlineId: priOnlineId, |
| | |
| | | layer.close(dIdx); |
| | | } |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | |
| | | function approval(priOnlineId, plannerId, dIdx) { |
| | | let loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/priOnline2/approval/auth", |
| | | url: baseUrl + "/priOnline2/approval/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | priOnlineId: priOnlineId, |
| | |
| | | layer.close(dIdx); |
| | | } |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | $(document).on('click', '#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr=curr; |
| | | pageCurr = curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | curr: pageCurr - 1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | if (showImg) { |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0)) { |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.9); |
| | | var height = detail.height() + 60; |
| | | if (height > ($(window).height() * 0.9)) { |
| | | height = ($(window).height() * 0.9); |
| | | } |
| | | layer.style(index, { |
| | | top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | top: (($(window).height() - height) / 3) + "px", |
| | | height: height + 'px' |
| | | }); |
| | | $(".layui-layer-shade").remove(); |
| | | } |