From a272f6f1864a2c0073fbb8fb84b0cd0ddde8c32a Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Fri, 28 Oct 2022 18:04:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E8=B4=A7=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ProcessMaterialsAllotForm.vue | 36 ++++- .../form/ProcessMaterialsDeliveryForm.vue | 145 +++++++++++++++++- .../form/ProcessSmaterialsScrapForm.vue | 11 +- 3 files changed, 177 insertions(+), 15 deletions(-) diff --git a/src/views/activiti/form/ProcessMaterialsAllotForm.vue b/src/views/activiti/form/ProcessMaterialsAllotForm.vue index 14fd1c1..8e43d52 100644 --- a/src/views/activiti/form/ProcessMaterialsAllotForm.vue +++ b/src/views/activiti/form/ProcessMaterialsAllotForm.vue @@ -31,7 +31,7 @@ - + @@ -57,7 +57,7 @@ :columns="processMaterialsAllotListTable.columns" :dataSource="processMaterialsAllotListTable.dataSource" :maxHeight="300" - :disabled="formDisabled" + :disabled="this.heid" :rowNumber="true" :rowSelection="true" :actionButton="true"/> @@ -103,6 +103,7 @@ }, data() { return { + heid: true, labelCol: { xs: { span: 24 }, sm: { span: 6 }, @@ -130,7 +131,24 @@ dataSource: [], columns: [ { - title: '器材编号', + title: '物料组', + key: 'materialGroup', + // type: FormTypes.slot, // <-------------改为 slot 格式 + // slotName: 'actions', // <-------------slot 的名称,对应 v-slot 冒号后面和等号前面的内容 + type: FormTypes.sel_search, + dictCode: '', + width: '200px', + placeholder: '请输入${title}', + options: [], + // props:{title: 'show title'} + // scopedSlots: { customRender: 'edit' },//引入的插槽 + // customRender:function (t,r,index) { + // console.log(t,r); + // + // } + }, + { + title: '物料编号', key: 'equipment', type: FormTypes.sel_search, dictCode:"", @@ -141,7 +159,7 @@ { title: 'WBS', key: 'wbs', - type: FormTypes.sel_search, + type: FormTypes.input, dictCode:"", width:"200px", placeholder: '请输入${title}', @@ -150,7 +168,7 @@ { title: '物料名称及规格型号', key: 'materialName', - type: FormTypes.sel_search, + type: FormTypes.input, dictCode:"", width:"200px", placeholder: '请输入${title}', @@ -159,7 +177,7 @@ { title: '单位', key: 'materialUnit', - type: FormTypes.select, + type: FormTypes.input, dictCode:"", width:"200px", placeholder: '请输入${title}', @@ -305,6 +323,12 @@ this.popupCallback(company,userInfo); }, methods: { + + materialType(val){ + if(val !== undefined){ + this.heid = false; + } + }, /*回显数据*/ init(){ this.btndisabled = true; diff --git a/src/views/activiti/form/ProcessMaterialsDeliveryForm.vue b/src/views/activiti/form/ProcessMaterialsDeliveryForm.vue index 607311e..5ad66c8 100644 --- a/src/views/activiti/form/ProcessMaterialsDeliveryForm.vue +++ b/src/views/activiti/form/ProcessMaterialsDeliveryForm.vue @@ -30,8 +30,8 @@ - - + + @@ -51,12 +51,13 @@ @@ -103,6 +104,9 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany' }, data() { return { + accountingAttributesVal: '', + heid: true, + bigIdMerchandiseNewsList:[], labelCol: { xs: { span: 24 }, sm: { span: 6 }, @@ -139,7 +143,7 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany' width: '200px', placeholder: '请输入${title}', options: [], - props:{title: 'show title'} + // props:{title: 'show title'} // scopedSlots: { customRender: 'edit' },//引入的插槽 // customRender:function (t,r,index) { // console.log(t,r); @@ -153,7 +157,8 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany' dictCode:"", width:"200px", placeholder: '请输入${title}', - defaultValue:'', + // defaultValue:'', + options: [], }, { title: 'WBS', @@ -255,6 +260,7 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany' edit: "/hy/processMaterialsDelivery/edit", queryById: "/hy/processMaterialsDelivery/queryById", descriptionRake: "/suppliesstronger/processSuppliesStronger/descriptionName", //查询物料组 + merchandiseNewsList: '/suppliesstronger/processSuppliesStronger/merchandiseNews', processMaterialsDeliveryList: { list: '/hy/processMaterialsDelivery/queryProcessMaterialsDeliveryListByMainId' }, @@ -306,7 +312,7 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany' } return true } - return this.disabled + return this.disabled = false; }, showFlowSubmitButton(){ if(this.formBpm===true){ @@ -331,10 +337,135 @@ import JSelectCompany from '../../../components/jeecgbiz/JSelectCompany' this.fetchData(); }, methods: { + isMaterialType(val){ + if(val !== undefined){ + this.accountingAttributesVal = val; + this.heid = false; + } + // console.log("执行l",val); + }, + //table 值改变触发 + onSelect(record) { + console.log(record) + if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment === ''){ + // console.log("执行materialGroup") + this.fetchMerchandiseNews(record.row.materialGroup); + } + if(record.row.materialGroup !== '' && record.row.materialGroup !== undefined && record.row.equipment !== ''){ + // console.log("执行materialNumber") + let materialName = { } + this.bigIdMerchandiseNewsList.forEach( item => { + if( item.merchandiseNewsId === record.row.equipment ){ + materialName ={ + name: item.merchandiseName, + unit: item.materialsUnit, + supplierName: item.supplierName, + price: item.price, + residueNumber : item.residueNumber === undefined ? 0 : item.residueNumber, + } + + } + }) + let values = [ + { + rowKey: record.row.id, + values: { + 'equipment': record.row.equipment, + 'materialGroup': record.row.materialGroup, + 'materialName': materialName.name, + 'materialUnit': materialName.unit, + 'supplier': materialName.supplierName, + 'materialPrice': materialName.price, + 'actualSendNumber': materialName.residueNumber, + 'materialAmount': materialName.price * materialName.residueNumber, + }, + }, + ] + this.$refs.processMaterialsDeliveryList.setValues(values); + } + // + // if(record.row.pleaseSendNumber !== '' && record.row.materialPrice !== '' && record.row.pleaseSendNumber !== undefined && record.row.materialPrice !== undefined){ + // // record.row.materialAmount = record.row.materialQuantity * record.row.materialPrice; + // let values = [ + // { + // rowKey: record.row.id, + // values: { + // 'equipment': record.row.equipment, + // 'materialGroup': record.row.materialGroup, + // 'materialName': record.row.materialName, + // 'materialUnit': record.row.materialUnit, + // 'supplier': record.row.supplier, + // 'materialPrice': record.row.materialPrice, + // 'materialAmount': record.row.pleaseSendNumber * record.row.materialPrice, + // }, + // }, + // ] + // this.$refs.processMaterialsDeliveryList.setValues(values); + // } + + }, + fetchMerchandiseNews(value){ //查询物料清单信息 + //查询大品类数据 + let par = { + delFlag: 0, + descriptionId:value, + } + this.bigIdMerchandiseNews = []; + 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.merchandiseNewsList,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); + this.bigIdMerchandiseNewsList = res.result; + } + }); + }, fetchData(){ //查询物料组 //查询大品类数据 let par = { delFlag: 0, + accountingAttributes: this.accountingAttributesVal, } getAction(this.url.descriptionRake,par).then((res)=>{ if(res.success){ diff --git a/src/views/activiti/form/ProcessSmaterialsScrapForm.vue b/src/views/activiti/form/ProcessSmaterialsScrapForm.vue index 52e7618..88506e0 100644 --- a/src/views/activiti/form/ProcessSmaterialsScrapForm.vue +++ b/src/views/activiti/form/ProcessSmaterialsScrapForm.vue @@ -31,7 +31,7 @@ - + @@ -56,7 +56,7 @@ :columns="processSmaterialsScrapListTable.columns" :dataSource="processSmaterialsScrapListTable.dataSource" :maxHeight="300" - :disabled="formDisabled" + :disabled="this.heid" :rowNumber="true" :rowSelection="true" :actionButton="true"/> @@ -105,6 +105,7 @@ }, data() { return { + heid:true, labelCol: { xs: { span: 24 }, sm: { span: 6 }, @@ -304,6 +305,12 @@ this.popupCallback(company,userInfo); }, methods: { + materialType(val){ + if(val !== undefined){ + this.heid = false; + } + + }, /*回显数据*/ init(){ this.btndisabled = true;