From 3edf61bbfb37cce3ce6eb1ef5c4fca07f7a99111 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Sat, 8 Mar 2025 18:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/claimAndRefund/receive.js | 9 + src/api/repairTest/repair.js | 9 + .../picking/apply/component/AddPicking1.vue | 193 ++-- .../auditing/component/EditPicking.vue | 462 +++++----- .../claimAndreturn/picking/outbound/index.vue | 6 +- .../return/apply/component/addReturn1.vue | 16 +- .../return/receive/component/addReturn1.vue | 268 +++--- src/views/repairTest/repair/dialogOneForm.vue | 53 +- .../repairTest/repair/dialogThreeForm.vue | 53 +- .../repairTest/repair/dialogTwoForm copy.vue | 825 ++++++++++++++++++ src/views/repairTest/repair/dialogTwoForm.vue | 116 +-- vue.config.js | 4 +- 12 files changed, 1471 insertions(+), 543 deletions(-) create mode 100644 src/views/repairTest/repair/dialogTwoForm copy.vue diff --git a/src/api/claimAndRefund/receive.js b/src/api/claimAndRefund/receive.js index 2232623..cb9fcba 100644 --- a/src/api/claimAndRefund/receive.js +++ b/src/api/claimAndRefund/receive.js @@ -372,4 +372,13 @@ export function getMaTypeDataById(data) { }, data, }) +} + +// 获取预退数量 +export function getPreAuditNum(params) { + return request({ + url: '/material/base/backReceive/getPreAuditNum', + method: 'get', + params, + }) } \ No newline at end of file diff --git a/src/api/repairTest/repair.js b/src/api/repairTest/repair.js index 21bb97b..c4e6390 100644 --- a/src/api/repairTest/repair.js +++ b/src/api/repairTest/repair.js @@ -128,3 +128,12 @@ export function getMaTypeSelectApi(query) { params: query }) } + +// 获取配件总费用 +export function getCostByPidAndNumApi(query) { + return request({ + url: '/material/base/repair/getCostByPidAndNum', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue index 072a1ee..b3a74cc 100644 --- a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue +++ b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue @@ -73,7 +73,7 @@ /> - + + + + + + { this.deviceTypeTree = res.data + console.log('🚀 ~ getDeviceTypeTree ~ this.deviceTypeTree:', this.deviceTypeTree) }) }, getParentsById(list, id) { @@ -934,12 +951,12 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - this.deviceType.forEach((e, index) => { - if (e[3] === row.typeId) { - this.deviceType.splice(index, 1) - this.propsKey++ - } - }) + // this.deviceType.forEach((e, index) => { + // if (e[3] === row.typeId) { + // this.deviceType.splice(index, 1) + // this.propsKey++ + // } + // }) this.leaseApplyDetails.splice(row.index, 1) }, /** 导出按钮操作 */ @@ -959,99 +976,79 @@ export default { }, /////// 设备类型树 切换 deviceTypeChange(val) { - const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes() + console.log('🚀 ~ deviceTypeChange ~ val:', val) + this.queryParams.typeId = '' + this.typeListDev = [] + // console.log('🚀 ~ deviceTypeChange ~ val:', val) + this.$nextTick(() => { + const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes() + console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0]) + this.selectParams = { + createBy: this.user.name, + companyId: deviceTypeList[0].data.companyId, + // num: deviceTypeList[0].data.num, + typeCn: deviceTypeList[0].data.label + } + console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams) + this.getMaTypeDataByIdFun(val[val.length - 1]) + }) // if (val.length > 0) { - // for (let i in val) { - // console.log(val[i], '----+++') + // const items = val.map((e) => { + // return e[3] + // }) + // for (let i in items) { + // for (let z in deviceTypeList) { + // if (deviceTypeList[z].data.id === items[i]) { + // let { num, companyId, id, unitName } = deviceTypeList[z].data + + // const isRepeat = this.leaseApplyDetails.some((e) => e.typeId === id) + // if (!isRepeat) { + // this.leaseApplyDetails.push({ + // createBy: this.user.name, + // typeId: id, + // num, + // companyId, + // unitCn: unitName, + // typeCn: deviceTypeList[z].pathLabels[2], + // guigeCn: deviceTypeList[z].pathLabels[3], + // }) + // } + // } + // } // } + // console.log('🚀 ~ deviceTypeChange ~ this.leaseApplyDetails:', this.leaseApplyDetails) + // } else { + // this.leaseApplyDetails = [] // } - let tempList = [] - - // const isRepeat = this.tempList.some((e) => e.typeId == val[val.length - 1]) - - if (val.length > 0) { - const items = val.map((e) => { - return e[3] - }) - for (let i in items) { - for (let z in deviceTypeList) { - if (deviceTypeList[z].data.id === items[i]) { - let { num, companyId, id, unitName } = deviceTypeList[z].data - - const isRepeat = this.leaseApplyDetails.some((e) => e.typeId === id) - if (!isRepeat) { - this.leaseApplyDetails.push({ - createBy: this.user.name, - typeId: id, - num, - companyId, - unitCn: unitName, - typeCn: deviceTypeList[z].pathLabels[2], - guigeCn: deviceTypeList[z].pathLabels[3], - }) - - // break - } - } - } - } - - // const newDataList = [...this.leaseApplyDetails, ...tempList] - // const map = new Map() - // for (let item of newDataList) { - // if (!map.has(item.typeId)) { - // map.set(item.typeId, item) - // } - // } - // const newArray = [...map.values()] - - // let newArray_array = [] - // items.forEach((e) => { - // newArray.forEach((j) => { - // if (e == j.typeId) { - // newArray_array.push(j) - // } - // }) - // }) - // this.leaseApplyDetails = newArray_array - } else { - this.leaseApplyDetails = [] + }, + // 获取规格型号 + async getMaTypeDataByIdFun(val) { + const res = await getMaTypeDataById({ id: val }) + this.typeListDev = res.data + console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res) + }, + // 选择规格型号 + changeType(e) { + // console.log('🚀 ~ changeType ~ e:', e) + if (!e) return + // 获取选中的规格型号 + const selectType = this.typeListDev.find((item) => item.id == e) + console.log('🚀 ~ changeType ~ selectType:', selectType) + this.selectParams.typeId = selectType.id + this.selectParams.guigeCn = selectType.name + this.selectParams.unitCn = selectType.unit + this.selectParams.num = selectType.num + console.log('🚀 ~ changeType ~ this.selectParams:', this.selectParams) + // 判断是否重复 + const isRepeat = this.leaseApplyDetails.find((item) => item.typeId == selectType.id) + // console.log('🚀 ~ changeType ~ isRepeat:', isRepeat) + if (isRepeat) { + this.$message.error('当前设备已添加,不可重复添加!') + return } - - // const templateList = deviceTypeList.map((e) => { - // let { num, companyId, id, unitName } = e.data - // return { - // createBy: this.user.name, - // num, - // companyId, - // typeId: id, - // unitCn: unitName, - // typeCn: e.pathLabels[2], - // guigeCn: e.pathLabels[3], - // } - // }) - // this.leaseApplyDetails = [...new Set(templateList)] - // console.log(templateList, '----') - - // let nodes = null - // nodes = - // this.$refs.deviceTypeCascader.getCheckedNodes().length > 0 - // ? this.$refs.deviceTypeCascader.getCheckedNodes() - // : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)] - // if (nodes[0].level != 4) { - // return - // } - // // console.log(this.leaseApplyDetails) - // // console.log(nodes[0].data.id) - // for (let i = 0; i < this.leaseApplyDetails.length; i++) { - // if (this.leaseApplyDetails[i].typeId == nodes[0].data.id) { - // this.leaseApplyDetails.splice(i, 1) - // break - // } - // } - // this.leaseApplyDetails.push(this.handelTableItemData(nodes[0])) - // this.deviceType = {} + this.leaseApplyDetails.push({...this.selectParams}) + console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails) }, //// 将数据处理成 表格中需要的数据 handelTableItemData(node) { diff --git a/src/views/claimAndreturn/picking/auditing/component/EditPicking.vue b/src/views/claimAndreturn/picking/auditing/component/EditPicking.vue index 115fe11..43040d5 100644 --- a/src/views/claimAndreturn/picking/auditing/component/EditPicking.vue +++ b/src/views/claimAndreturn/picking/auditing/component/EditPicking.vue @@ -38,12 +38,7 @@ placeholder="请选择" :disabled="isEdit" > - + @@ -56,39 +51,24 @@ placeholder="请选择" :disabled="isEdit" > - + - + - + + + + + + + - + @@ -171,14 +156,7 @@ - + 保存 @@ -200,26 +178,14 @@ - +