From 9a0387f7fd7c740098435378f96844a50140b37a Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Thu, 3 Nov 2022 10:51:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E5=BA=93=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E6=98=BE=E7=A4=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ProcessMaterialsDeliveryForm.vue | 141 +++++++++++++----- 1 file changed, 105 insertions(+), 36 deletions(-) diff --git a/src/views/activiti/form/ProcessMaterialsDeliveryForm.vue b/src/views/activiti/form/ProcessMaterialsDeliveryForm.vue index aa3399a..e4fa25b 100644 --- a/src/views/activiti/form/ProcessMaterialsDeliveryForm.vue +++ b/src/views/activiti/form/ProcessMaterialsDeliveryForm.vue @@ -122,6 +122,7 @@ data() { return { libraryAssociationIdInvisible:'ZK', + rolePlay :false , jiy:[], heid: true, addId : '', @@ -280,9 +281,10 @@ add: '/hy/processMaterialsDelivery/add', edit: '/hy/processMaterialsDelivery/edit', queryById: '/hy/processMaterialsDelivery/queryById', - descriptionRake: '/suppliesstronger/processSuppliesStronger/descriptionName', //查询物料组 - wasteMaterialsUrl: '/suppliesstronger/processSuppliesStronger/descriptionName', //查询物料组 + descriptionRake: '/suppliesstronger/processSuppliesStronger/descriptionName', //查询总库物料组 + wasteMaterialsUrl: '/wastematerials/processWasteMaterials/wasteMaterialsName', //查询账外物料组 merchandiseNewsList: '/suppliesstronger/processSuppliesStronger/merchandiseNews', + wasteMaterialsList: '/wastematerials/processWasteMaterials/merchandiseNewsName', //账外 puwwlist: "/unitwaste/processUnitWasteWarehouseCode/queryById", unitWasteWarehouseList: "/unitwaste/processUnitWasteWarehouseCode/queryById", //查询目标库 processMaterialsDeliveryList: { @@ -383,7 +385,13 @@ // console.log(record) if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment === ''){ // console.log("执行materialGroup") - this.fetchMerchandiseNews(record.row.materialGroup,1); + if(this.rolePlay ){ + await this.fetchMerchandiseNewsZW(record.row.materialGroup, 1); + }else{ + await this.fetchMerchandiseNews(record.row.materialGroup, 1); + } + + } if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== '' && record.row.actualSendNumber === '' ){ // console.log("执行materialNumber") @@ -394,7 +402,7 @@ name: item.merchandiseName, unit: item.materialsUnit, supplierName: item.supplierName, - price: item.price, + price: item.materialPrice, residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber, } } @@ -473,7 +481,6 @@ descriptionId:value, } - this.bigIdMerchandiseNews = []; this.bigIdMerchandiseNewsList = []; let qc = []; let numberList = []; @@ -527,6 +534,69 @@ }); + }, + fetchMerchandiseNewsZW(value){ //查询物料清单信息 + //查询大品类数据 + return new Promise((resolve, reject) => { + //你的逻辑代码 + let par = { + delFlag: 0, + descriptionId:value, + + } + this.bigIdMerchandiseNewsList = []; + let qc = []; + let numberList = []; + if(this.processMaterialsDeliveryListTable.columns[1].options.length > 0){ + this.processMaterialsDeliveryListTable.columns[1].options = []; + } + this.$refs.processMaterialsDeliveryList.getValues((a,b,c)=>{ + // console.log(a,b,c) + b.forEach(item =>{ + if(item.equipment !== '' && item.equipment !== undefined && item.equipment !== null){ + numberList.push(item.materialNumber); + } + }); + }); + getAction(this.url.wasteMaterialsList,par).then((res)=>{ + if(res.success){ + // console.log(res.result); + let newList = res.result; + // console.log("12312312:"+numberList.length); + if(numberList.length > 0){ + newList.forEach( item => { + qc.push({ + title : item.materialsNumber, + value : item.merchandiseNewsId, + disabled : false + }) + }) + numberList.forEach( num => { + qc.forEach( i => { + if(num === i.value){ + // console.log(num,i.value); + i.disabled = true; + } + }); + }) + this.processMaterialsDeliveryListTable.columns[1].options = qc; + }else{ + newList.forEach( item => { + this.processMaterialsDeliveryListTable.columns[1].options.push({ + title : item.materialsNumber, + value : item.merchandiseNewsId, + disabled : false + }) + }) + } + // console.log(this.processUdgetPlanMaterialTable.columns[1].options); + resolve(this.bigIdMerchandiseNewsList = res.result ); + // return + } + }); + + }); + }, //table 值改变触发 // async onSelect(record) { @@ -813,57 +883,56 @@ // }); // // }, - fetchData(value){ //查询物料组 - console.log("this.data==============>",this.data) - let params={} - params.id= sessionStorage.getItem('PUWWC_Id') - getAction(this.url.unitWasteWarehouseList,params).then((res)=>{ - console.log(res) - if(res.success){ - // 查询大品类数据 账外库 - - + fetchData(value) { //查询物料组 + // console.log("this.data==============>",this.data) //部门id + let params = {} + params.id = sessionStorage.getItem('PUWWC_Id')//关联中间表id + getAction(this.url.unitWasteWarehouseList, params).then((res) => { + // console.log(res) + if (res.success) { + // 查询大品类数据 账外库 let par = { delFlag: 0, accountingAttributes: value, sysOrgCode: this.data.sysOrgCode } - getAction(this.url.wasteMaterialsUrl,par).then((res)=>{ - if(res.success){ - if(this.processMaterialsDeliveryListTable.columns[0].options.length > 0){ - this.processMaterialsDeliveryListTable.columns[0].options = []; + getAction(this.url.wasteMaterialsUrl, par).then((res) => { + console.log(res) + if (res.success) { + if (this.processMaterialsDeliveryListTable.columns[0].options.length > 0) { + this.processMaterialsDeliveryListTable.columns[0].options = [] } - res.result.forEach( item => { + res.result.forEach(item => { this.processMaterialsDeliveryListTable.columns[0].options.push({ - title : item.descriptionName, - value : item.descriptionId, + title: item.descriptionName, + value: item.descriptionId }) }) } - }); - - }else{ + }) + this.rolePlay = true; + } else { //查询大品类数据 总库 let par = { delFlag: 0, - accountingAttributes: value, + accountingAttributes: value } - getAction(this.url.descriptionRake,par).then((res)=>{ - if(res.success){ - if(this.processMaterialsDeliveryListTable.columns[0].options.length > 0){ - this.processMaterialsDeliveryListTable.columns[0].options = []; + getAction(this.url.descriptionRake, par).then((res) => { + if (res.success) { + if (this.processMaterialsDeliveryListTable.columns[0].options.length > 0) { + this.processMaterialsDeliveryListTable.columns[0].options = [] } - res.result.forEach( item => { + res.result.forEach(item => { this.processMaterialsDeliveryListTable.columns[0].options.push({ - title : item.descriptionName, - value : item.descriptionId, + title: item.descriptionName, + value: item.descriptionId }) }) } - }); + }) + this.rolePlay = false; } - }); - + }) },