From bdafab2675bff960f6b94d955e52f2c7ed573f6c Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Wed, 2 Apr 2025 12:09:33 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../picking/apply/component/AddPicking1.vue | 119 +++++++++++------- 1 file changed, 71 insertions(+), 48 deletions(-) diff --git a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue index 4665a75..af23910 100644 --- a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue +++ b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue @@ -17,7 +17,7 @@ placeholder="请选择领用类型" clearable style="width: 240px" - :disabled="isEdit" + @change="leaseTypeChange" > @@ -37,7 +37,7 @@ @change="GetProData" style="width: 240px" placeholder="请选择" - :disabled="isEdit" + > @@ -50,7 +50,7 @@ @change="GetUnitData" style="width: 240px" placeholder="请选择" - :disabled="isEdit" + > @@ -111,7 +111,7 @@ @remove-tag="onRemoveTag" v-model="queryParams.wholeTypeName" multiple - :disabled="isEdit" + > @@ -155,9 +155,10 @@ clearable style="width: 240px" placeholder="请选择费用承担方" - :disabled="isEdit" + @change="costBearingPartyChange" + @blur="handleSelectBlur" > - + @@ -176,7 +177,7 @@ - 保存 + 提交 @@ -456,6 +457,7 @@ export default { //领料详情集合 leaseApplyDetails: [], wholeTypeName: '', + costBearingParty: '', //费用承担方 }, typeList: [ { id: '0', name: '工程租赁' }, @@ -758,30 +760,27 @@ export default { this.leaseApplyDetails = data.leaseApplyDetails.map((item) => { return this.handelEchoData(item) }) - let selectList = [] - for (let i = 0; i < this.leaseApplyDetails.length; i++) { - selectList.push(this.getParentsById(this.deviceTypeTree, this.leaseApplyDetails[i].typeId)) - - } // this.leaseApplyDetails.forEach((e) => { // selectList.push(this.getParentsById(this.deviceTypeTree, e.typeId)) // }) this.$nextTick(() => { + let selectList = [] + for (let i = 0; i < this.leaseApplyDetails.length; i++) { + selectList.push(this.getParentsById(this.deviceTypeTree, this.leaseApplyDetails[i].typeId)) + + } this.deviceType = selectList this.propsKey++ - // 等待 1 秒 - setTimeout(() => { - // 这里可以添加等待 1 秒后要执行的代码 - }, 1000); + this.$set(this.queryParams, 'leaseType', data.leaseType); }) - if (data.ctLeaseApplyDetails) { - this.getCtFileList(data.ctLeaseApplyDetails) + this.getCtFileList(data.ctLeaseApplyDetails) } }) }, // 驳回提交 任务详情数据 async GetTaskDetail2(taskId) { + await this.GetDeviceTypeTree() const res = await getLeaseApplyAuditListAll({ taskId }) const data = res.rows[0] @@ -811,14 +810,15 @@ export default { return this.handelEchoData(item) }) - let selectList = [] - this.leaseApplyDetails.forEach((e) => { - selectList.push(this.getParentsById(this.deviceTypeTree, e.typeId)) + this.$nextTick(() => { + let selectList = [] + this.leaseApplyDetails.forEach((e) => { + selectList.push(this.getParentsById(this.deviceTypeTree, e.typeId)) + }) + this.deviceType = selectList + this.propsKey++ + this.$set(this.queryParams, 'leaseType', data.leaseType); }) - this.deviceType = selectList - this.propsKey++ - await this.$nextTick(); - if (data.ctLeaseApplyDetails) { this. this.getCtFileList(data.ctLeaseApplyDetails) @@ -826,7 +826,7 @@ export default { }, // 生成成套附属设备 - getCtFileList(ctData) { + async getCtFileList(ctData) { const ctList = [] for (const key in ctData) { ctList.push({ @@ -838,25 +838,20 @@ export default { } ctList.forEach((e) => { - // queryCompleteSetToolsApi(e).then((res) => { - // e.childrenList = res.data.map((j) => { - // return { - // ...j, - // initNum: j.deviceNum, - // preNum: j.preNum, - // } - // }) - - // e.childrenList.forEach((i) => { - // i.deviceNum = i.initNum * e.wholeTypeNum - // }) - // this.wholeTypeNameList.push(e) - // }) - e.childrenList = ctData[e.wholeTypeName].map((j) => { - console.log("pppppppp",j) + let temp = [] + queryCompleteSetToolsApi(e).then((res) => { + temp = res.data.map((k) => { + return { + ...k, + initNum: k.deviceNum, + } + }) + e.childrenList = ctData[e.wholeTypeName].map((j,index) => { return { ...j, - initNum: j.deviceNum, + deviceType : temp[index].deviceType, + deviceAscription : temp[index].deviceAscription, + initNum: temp[index].deviceNum, preNum: j.preNum, } }) @@ -865,7 +860,26 @@ export default { i.preNum = Number(i.preNum ) }) this.wholeTypeNameList.push(e) - console.log("hhhhhhhhhhhh",this.wholeTypeNameList) + }) + // e.childrenList.forEach((i) => { + // i.deviceNum = i.initNum * e.wholeTypeNum + // }) + // this.wholeTypeNameList.push(e) + // }) + // e.childrenList = ctData[e.wholeTypeName].map((j) => { + // console.log("pppppppp",j) + // return { + // ...j, + // initNum: j.preNum, + // preNum: j.preNum, + // } + // }) + // e.childrenList.forEach((i) => { + // i.deviceNum = i.initNum * e.wholeTypeNum + // i.preNum = Number(i.preNum ) + // }) + // this.wholeTypeNameList.push(e) + // console.log("hhhhhhhhhhhh",this.wholeTypeNameList) }) }, //生成回显数据 @@ -980,7 +994,6 @@ export default { const wholeTypeList = [] this.wholeTypeNameList.forEach((i) => { i.childrenList.forEach((e) => { - console.log("uiiiiiiiiiiiiiiiii",e) const items = { companyId: '101', guigeCn: e.deviceType, @@ -1204,6 +1217,14 @@ export default { const { data: res } = await getCostBearingApi() this.costBearingList = res }, + costBearingPartyChange(val) { + console.log("qqqqqqqqq",val) + this.queryParams.costBearingParty = val + }, + handleSelectBlur() { + // 确保数据更新 + this.$forceUpdate(); + }, // 领用类型修改时清空费用承担方 leaseTypeChange(val) { @@ -1252,6 +1273,7 @@ export default { } }) this.wholeTypeNameList.push(wholeTypeNameData) + console.log('🚀 ~ this.wholeTypeNameList:', this.wholeTypeNameList) }) } }) @@ -1269,10 +1291,11 @@ export default { /* 更改数量 */ onChangeInput(val, v) { - console.log("sssssssssss",this.wholeTypeNameList), + console.log("gggggggg",val,v), + console.log("sssssssssss",this.wholeTypeNameList), this.wholeTypeNameList[v].childrenList.forEach((e) => ( console.log("uuuuuuuuuu",e), - e.deviceNum = e.deviceNum * val,e.preNum = e.preNum * val)) + e.deviceNum = e.initNum * val,e.preNum = e.initNum * val)) }, // 获取规格型号 async getMaTypeDataByIdFun(val) {