| | |
| | | var pageCount = 0; |
| | | var treeCond; |
| | | var admin; |
| | | var planNeedXmlSelData; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | |
| | | if (plan.orderId) { orderSel.setValue([{name: plan.orderId$, value: plan.orderId}]); } |
| | | if (plan.cstmrId) { cstmrSel.setValue([{name: plan.cstmrId$, value: plan.cstmrId}]); } |
| | | if (plan.userId) { userSel.setValue([{name: plan.userId$, value: plan.userId}]); } |
| | | // console.log(plan); |
| | | // console.log(plan.planNeed); |
| | | // console.log(plan.planNeed.split("-")); |
| | | // console.log(plan.planNeed.split("-").length); |
| | | let split = plan.planNeed.split("-"); |
| | | // console.log(split); |
| | | // console.log(split.length); |
| | | if (plan.planNeed) { |
| | | var planNeedValue1=split[0]; |
| | | for (var i=1;i<split.length;i++){ |
| | | planNeedValue1 = planNeedSel+"-" +split[i]; |
| | | } |
| | | planNeedSel.setValue([{name: plan.planNeed$, value: planNeedValue1}]); |
| | | var data = [] |
| | | split.forEach((item,idx) => { |
| | | data.push(parseInt(item)) |
| | | }) |
| | | planNeedXmlSelData = data |
| | | } |
| | | layDateRender(plan); |
| | | plan['planTypeName'] = plan.planType$; |
| | |
| | | } |
| | | |
| | | window.loadPlanNeedSel = function () { |
| | | return xmSelect.render({ |
| | | var planNeedXmlSel = xmSelect.render({ |
| | | el: '#planNeedXmlSel', |
| | | autoRow: true, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | remoteMethod: function (val, cb, show) { |
| | | $.ajax({ |
| | | url: baseUrl + "/planNeed/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}); |
| | | } |
| | | } |
| | | }); |
| | | data: [] |
| | | }); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/planNeed/all/get/kv", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | condition: "" |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | console.log(planNeedXmlSelData) |
| | | planNeedXmlSel.update({ |
| | | initValue: planNeedXmlSelData, |
| | | data: res.data |
| | | }) |
| | | } else { |
| | | cb([]); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | return planNeedXmlSel; |
| | | } |
| | | |
| | | window.loadUserSel = function () { |