From cc909c892f37f1615a1899a24f115b1b05015939 Mon Sep 17 00:00:00 2001 From: qiuyt Date: Fri, 13 Dec 2024 16:09:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E6=98=AF=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=85=A5=E9=99=A2=E8=8D=AF=E5=93=81=E7=BB=B4=E6=8A=A4=E9=80=89?= =?UTF-8?q?=E5=85=A5=E5=89=8D=E7=AB=AF=E9=80=BB=E8=BE=91=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../companyDrug/basicCompanyproductEdit.vue | 88 +++++-------------- 1 file changed, 23 insertions(+), 65 deletions(-) diff --git a/src/views/supplier/companyDrug/basicCompanyproductEdit.vue b/src/views/supplier/companyDrug/basicCompanyproductEdit.vue index 16df3bc..a0d79e5 100644 --- a/src/views/supplier/companyDrug/basicCompanyproductEdit.vue +++ b/src/views/supplier/companyDrug/basicCompanyproductEdit.vue @@ -698,17 +698,22 @@ - + - + - + + + + + +
{ if (response.code == 20000) { - if (response.data.length > 0) { - response.data.forEach(item => { - let parts = item.bzgg.split('/'); - const levels = item.packRatio.split(":").map(Number); - const calculatedLevels = [levels[0]]; - for (let i = levels.length - 1; i > 0; i--) { - const ratio = levels[i] / levels[i - 1]; - calculatedLevels.unshift(ratio); - } - calculatedLevels.reverse(); - let selectedValue = calculatedLevels[item.packLevel - 1]; - if (item.packLevel == 1) { - selectedValue = this.extractNumber(this.newProductData.bzgg) - item.xjdw = this.extractUnitAfterNumber(this.newProductData.bzgg) - } - - // const ratioParts = item.packRatio.split(':'); - // let selectedValue; - // if (item.packLevel >= 0 && item.packLevel < ratioParts.length) { - // selectedValue = ratioParts[item.packLevel]; - // } else { - // selectedValue = 1; // 或者你可以设置一个默认值 - // } - - let editQuery = { - nameCode: item.nameCode, - packLevel: item.packLevel, - packUnit: parts[1] || '', - bhxjsl: selectedValue, - relId: this.newProductData.rlId, - uuid: this.newProductData.uuid, - productId: item.productId, - diType: item.packLevel == 1 ? 1 : 4, - xjdw: item.xjdw - } - updateLevelDrug(editQuery).then(res => { - this.saveLoading = false - if (res.code == 20000) { - this.detailList.push({ - nameCode: item.nameCode, - packLevel: item.packLevel, - packUnit: parts[1] || '', - bhxjsl: selectedValue, - diType: item.packLevel == 1 ? 1 : 4, - isDisabled: false, - rowDisabled: false, - isUpDisabled: true - }) - } - }) - - }) - } - + // this.selectedIndex = this.detailList.length - 1 + // this.isSave = false + this.selectDrugLevelVisible = false + this.getDiLevel() + this.getDetailList() + this.getThirdSysDetail() } }).catch(() => { }) - this.newProductData.productId = null - this.selectedIndex = this.detailList.length - 1 - this.isSave = false - this.selectDrugLevelVisible = false - this.getDetailList() } , addDrugLevel() {