From bb48244ceec4e284cd15a650d4d7064890accf04 Mon Sep 17 00:00:00 2001
From: chenhc <2369838784@qq.com>
Date: Fri, 8 Nov 2024 11:47:50 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E9=98=BF=E9=87=8C=E8=8D=AF=E5=93=81?=
=?UTF-8?q?=E5=85=B3=E7=B3=BB=E7=BB=B4=E6=8A=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/basic/product/drugUdiinfos.js | 18 +++
src/views/basic/product/drug/drugAdd.vue | 156 ++++++++++++++++++++++-
2 files changed, 171 insertions(+), 3 deletions(-)
diff --git a/src/api/basic/product/drugUdiinfos.js b/src/api/basic/product/drugUdiinfos.js
index 7aa1fd5..3bff3fd 100644
--- a/src/api/basic/product/drugUdiinfos.js
+++ b/src/api/basic/product/drugUdiinfos.js
@@ -50,3 +50,21 @@ export function calculateUseCount(query) {
}
+export function getDrugLevelList(query) {
+ return axios({
+ url: "udiwms/aliDrug/getDrugLevelList",
+ method: "get",
+ params: query
+ });
+}
+
+
+
+export function getDrugLevelListBycode(query) {
+ return axios({
+ url: "/udiwms/aliDrug/getDrugLevelListBycode",
+ method: "get",
+ params: query
+ });
+}
+
diff --git a/src/views/basic/product/drug/drugAdd.vue b/src/views/basic/product/drug/drugAdd.vue
index e4aad46..b7bc958 100644
--- a/src/views/basic/product/drug/drugAdd.vue
+++ b/src/views/basic/product/drug/drugAdd.vue
@@ -36,7 +36,10 @@
text-align: right;
margin-bottom: 8px;"
>
- 选入药品层级
+ 新增药品层级
@@ -657,6 +660,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选入
+
+
+
+
+
+
+
+
@@ -665,7 +736,8 @@ import {
addDrug,
updatetDrug,
delDrugLevel,
- updateLevelDrug, calculateDistCount, calculateUseCount
+ updateLevelDrug, calculateDistCount, calculateUseCount,
+ getDrugLevelList,getDrugLevelListBycode
} from '@/api/basic/product/drugUdiinfos'
import {getCodeRelDetail} from '@/api/basic/product/udiRelevance'
import {isBlank} from "@/utils/strUtil";
@@ -717,6 +789,13 @@ export default {
return {
ybDrugDetail: {},
productData: {},
+ filterQueryDrugLevel: {
+ nameCode: "",
+ cpmctymc: "",
+ page: 1,
+ limit: 20,
+ total: 0,
+ },
newProductData: {
cpmctymc: null,
bzgg: null,
@@ -747,6 +826,7 @@ export default {
},
thirdSys: [],
classifyList: [],
+ selectDrugLevelList: [],
saveLoading: false,
activeNames: ['0', '1', '2'],
formRules: {
@@ -819,6 +899,7 @@ export default {
tollProjectDialogVisible: false,
sysList: [],
chooseHouseDrugVisible: false,
+ selectDrugLevelVisible: false,
isImport: false,
defaultSys: null,
levelUnitList: [],
@@ -1045,6 +1126,75 @@ export default {
row.isUpDisabled = true
row.rowDisabled = false
},
+ selectDrugLevel(){
+ //获取分页列表
+ getDrugLevelList(this.filterQueryDrugLevel).then((response) => {
+ if (response.code == 20000) {
+ this.selectDrugLevelList = response.data.list || []
+ this.filterQueryDrugLevel.total = response.data.total || 0
+ this.selectDrugLevelVisible = true
+ }
+ }).catch(() => {
+ })
+ },
+ selectDrugLevelItem(row){
+ getDrugLevelListBycode({nameCode:row.nameCode}).then((response) => {
+ if (response.code == 20000) {
+ if (response.data.length > 0){
+ response.data.forEach( item => {
+ //新增层级
+ let parts = item.bzgg.split('/');
+ // 首先,根据 ':' 分割字符串
+ const ratioParts = item.packRatio.split(':');
+ let selectedValue;
+ if (item.packLevel >= 0 && item.packLevel < ratioParts.length) {
+ selectedValue = ratioParts[item.packLevel];
+ } else {
+ selectedValue = null; // 或者你可以设置一个默认值
+ }
+
+ 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
+ })
+ }
+ })
+
+ })
+ }
+
+ }
+ }).catch(() => {
+ })
+
+ this.newProductData.productId = null
+ this.selectedIndex = this.detailList.length - 1
+ this.isSave = false
+ this.selectDrugLevelVisible = false
+ },
+ handleCurrentChange(){
+ this.selectDrugLevel()
+ },
addDrugLevel() {
this.detailList.push({
nameCode: '',
@@ -1114,7 +1264,7 @@ export default {
filterByUuid(query)
.then((response) => {
this.loading = false
- this.detailList = response.data || []
+ this.detailList = response.data.list || []
})
.catch(() => {
this.loading = false