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() {