From 8b560afdb26b27ca2a905eb017b4c1831444579e Mon Sep 17 00:00:00 2001 From: qiuyt Date: Fri, 13 Dec 2024 15:51:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=AE=A1=E7=90=86=E8=8D=AF?= =?UTF-8?q?=E5=93=81=E5=AD=97=E5=85=B8=E7=BB=B4=E6=8A=A4=E9=80=89=E5=85=A5?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=80=BB=E8=BE=91=E6=94=B9=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/basic/product/drugUdiinfos.js | 7 ++ src/views/basic/product/drug/drugAdd.vue | 89 +++++++----------------- 2 files changed, 31 insertions(+), 65 deletions(-) diff --git a/src/api/basic/product/drugUdiinfos.js b/src/api/basic/product/drugUdiinfos.js index 3bff3fd..385a111 100644 --- a/src/api/basic/product/drugUdiinfos.js +++ b/src/api/basic/product/drugUdiinfos.js @@ -68,3 +68,10 @@ export function getDrugLevelListBycode(query) { }); } +export function updateLevelDrugAli(query) { + return axios({ + url: "/udi/udirel/updateLevelDrugAli", + method: "post", + data: query + }); +} diff --git a/src/views/basic/product/drug/drugAdd.vue b/src/views/basic/product/drug/drugAdd.vue index 8176a92..23e8b97 100644 --- a/src/views/basic/product/drug/drugAdd.vue +++ b/src/views/basic/product/drug/drugAdd.vue @@ -529,17 +529,22 @@ - + - + - + + + + + +
{ if (response.code == 20000) { this.selectDrugLevelList = response.data.list || [] @@ -1010,71 +1015,25 @@ export default { }) }, selectDrugLevelItem(row){ - getDrugLevelListBycode({nameCode:row.nameCode}).then((response) => { + var drug = { + "nameCode":row.nameCode, + "uuid":this.newProductData.uuid, + "ybbm":this.newProductData.ybbm, + } + // console.log('drug',drug) + updateLevelDrugAli(drug).then((response) => { 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]; - console.log(item) - 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.id, - 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() + } ,