From e9d527c0639fe5a6738f2c2c20f4d599308a06a9 Mon Sep 17 00:00:00 2001
From: wangwei <1610949092@qq.com>
Date: Tue, 12 Nov 2024 18:15:34 +0800
Subject: [PATCH 1/4] =?UTF-8?q?11/12=20=E7=95=8C=E9=9D=A2=E4=BC=98?=
=?UTF-8?q?=E5=8C=961.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/basic/product/drug/drugAdd.vue | 154 ++++++++++--------
.../companyDrug/basicCompanyproductEdit.vue | 19 +++
2 files changed, 105 insertions(+), 68 deletions(-)
diff --git a/src/views/basic/product/drug/drugAdd.vue b/src/views/basic/product/drug/drugAdd.vue
index 60813c0..7009415 100644
--- a/src/views/basic/product/drug/drugAdd.vue
+++ b/src/views/basic/product/drug/drugAdd.vue
@@ -66,7 +66,8 @@
+ style="width: 90%" placeholder="选择标识类型" clearable
+ >
@@ -524,18 +525,19 @@
:close-on-press-escape="false"
width="85%"
v-if="selectDrugLevelVisible"
+ @close="closeSelectDrugLevelVisible"
>
-
+
-
+
-
+
@@ -555,7 +557,7 @@
-
+
@@ -569,7 +571,7 @@
-
+
选入
@@ -595,16 +597,16 @@ import {
updatetDrug,
delDrugLevel,
updateLevelDrug, calculateDistCount, calculateUseCount,
- getDrugLevelList,getDrugLevelListBycode
+ getDrugLevelList, getDrugLevelListBycode
} from '@/api/basic/product/drugUdiinfos'
-import {getCodeRelDetail} from '@/api/basic/product/udiRelevance'
-import {isBlank} from "@/utils/strUtil";
+import { getCodeRelDetail } from '@/api/basic/product/udiRelevance'
+import { isBlank } from '@/utils/strUtil'
import {
getYbDrugDetail, removeRl, thirdSysDetail
} from '@/api/basic/product/udiRelevance'
-import {filterClassify} from '@/api/purchase/classifyCode'
-import {filterByUuid, levelByUuid} from '@/api/basic/product/udiInfo'
+import { filterClassify } from '@/api/purchase/classifyCode'
+import { filterByUuid, levelByUuid } from '@/api/basic/product/udiInfo'
// import selectChargesProjectDialog from './selectChargesProjectDialog'
import chooseHouseDrug from './chooseHouseDrug'
@@ -642,18 +644,18 @@ export default {
}
},
// components: {selectChargesProjectDialog, chooseHouseDrug},
- components: { chooseHouseDrug},
+ components: { chooseHouseDrug },
data() {
return {
ybDrugDetail: {},
productData: {},
filterQueryDrugLevel: {
- nameCode: "",
- cpmctymc: "",
+ nameCode: '',
+ cpmctymc: '',
page: 1,
limit: 20,
total: 0,
- approvalNum:"",
+ approvalNum: ''
},
newProductData: {
cpmctymc: null,
@@ -690,49 +692,49 @@ export default {
activeNames: ['0', '1', '2'],
formRules: {
cpmctymc: [
- {required: true, message: '请输入药品通用名', trigger: 'blur'}
+ { required: true, message: '请输入药品通用名', trigger: 'blur' }
],
prepnSpec: [
- {required: true, message: '请输入制剂规格', trigger: 'blur'}
+ { required: true, message: '请输入制剂规格', trigger: 'blur' }
],
packUnit: [
- {required: true, message: '请输入包装单位', trigger: 'blur'}
+ { required: true, message: '请输入包装单位', trigger: 'blur' }
],
prepnUnit: [
- {required: true, message: '请输入制剂单位', trigger: 'blur'}
+ { required: true, message: '请输入制剂单位', trigger: 'blur' }
],
// packRatio: [
// {required: true, message: '请输入包装比例', trigger: 'blur'}
// ],
packMatrial: [
- {required: true, message: '请输入包装材质', trigger: 'blur'}
+ { required: true, message: '请输入包装材质', trigger: 'blur' }
],
zczbhhzbapzbh: [
- {required: true, message: '请输入批准文号', trigger: 'blur'}
+ { required: true, message: '请输入批准文号', trigger: 'blur' }
],
manufactory: [
- {required: true, message: '生产企业不能为空', trigger: 'blur'}
+ { required: true, message: '生产企业不能为空', trigger: 'blur' }
],
physicType: [
- {required: true, message: '药品类型不能为空', trigger: 'blur'}
+ { required: true, message: '药品类型不能为空', trigger: 'blur' }
],
ybbm: [
- {required: true, message: '医保编码不能为空', trigger: 'blur'}
+ { required: true, message: '医保编码不能为空', trigger: 'blur' }
],
price: [
- {required: true, message: '药品价格不能为空', trigger: 'blur'}
+ { required: true, message: '药品价格不能为空', trigger: 'blur' }
],
majorStatus: [
- {required: true, message: '请选择药品状态', trigger: 'blur'}
+ { required: true, message: '请选择药品状态', trigger: 'blur' }
],
distributeLevel: [
- {required: true, message: '请选择计量单位', trigger: 'blur'}
+ { required: true, message: '请选择计量单位', trigger: 'blur' }
],
// distributeMaxLevel: [
// {required: true, message: '请选择允许采集的最大层级', trigger: 'blur'}
// ],
useLevel: [
- {required: true, message: '请选择计量单位', trigger: 'blur'}
+ { required: true, message: '请选择计量单位', trigger: 'blur' }
],
detailSort: [
{required: true, message: '请选择明细分类', trigger: 'blur'}
@@ -803,7 +805,7 @@ export default {
this.newProductData.zczbhhzbapzbh = this.ybDrugDetail.approvalCode
this.newProductData.cpmctymc = this.ybDrugDetail.registeredProductName
this.newProductData.spmc = this.ybDrugDetail.goodsName
- this.newProductData.bzgg = this.ybDrugDetail.factor + this.ybDrugDetail.minUnit + "/" + this.ybDrugDetail.unit
+ this.newProductData.bzgg = this.ybDrugDetail.factor + this.ybDrugDetail.minUnit + '/' + this.ybDrugDetail.unit
this.newProductData.matrial = this.ybDrugDetail.materialName
this.newProductData.packMatrial = this.ybDrugDetail.materialName
this.newProductData.packUnit = this.ybDrugDetail.unit
@@ -811,12 +813,12 @@ export default {
this.newProductData.manufactory = this.ybDrugDetail.companyNameSc
this.newProductData.prepnUnit = this.ybDrugDetail.realityMedicinemodel
- if (this.ybDrugDetail.productInsuranceType != "" && this.ybDrugDetail.productInsuranceType != null) {
- if ("甲" == this.ybDrugDetail.productInsuranceType) {
+ if (this.ybDrugDetail.productInsuranceType != '' && this.ybDrugDetail.productInsuranceType != null) {
+ if ('甲' == this.ybDrugDetail.productInsuranceType) {
this.newProductData.medicareType = 1
- } else if ("乙" == this.ybDrugDetail.productInsuranceType) {
+ } else if ('乙' == this.ybDrugDetail.productInsuranceType) {
this.newProductData.medicareType = 2
- } else if ("丙" == this.ybDrugDetail.productInsuranceType) {
+ } else if ('丙' == this.ybDrugDetail.productInsuranceType) {
this.newProductData.medicareType = 3
} else {
this.newProductData.medicareType = null
@@ -835,7 +837,7 @@ export default {
},
saveNewProduct() {
if (!this.isSave) {
- return this.$message.error("请先保存药品层级")
+ return this.$message.error('请先保存药品层级')
}
this.addProductDialogVisible = false
this.newProductData.registerNo = this.newProductData.zczbhhzbapzbh
@@ -969,18 +971,18 @@ export default {
this.$message.success('保存成功!')
this.selectedIndex = null
this.getDetailList()
- this.getDiLevel();
+ this.getDiLevel()
//如果都为空 进行补充
if (!this.$isNotBlank(this.newProductData.sptm) && !this.$isNotBlank(this.newProductData.ybbm)) {
- getCodeRelDetail({drugCode:row.nameCode}).then((response) => {
- if (response.code == 20000) {
- if (response.data != null && response.data.length > 0) {
- this.newProductData.sptm = response.data[0].sptm;
- this.newProductData.ybbm = response.data[0].ybbm;
- this.getYbDrugData()
- }
+ getCodeRelDetail({ drugCode: row.nameCode }).then((response) => {
+ if (response.code == 20000) {
+ if (response.data != null && response.data.length > 0) {
+ this.newProductData.sptm = response.data[0].sptm
+ this.newProductData.ybbm = response.data[0].ybbm
+ this.getYbDrugData()
}
+ }
}).catch(() => {
})
}
@@ -996,7 +998,7 @@ export default {
row.isUpDisabled = true
row.rowDisabled = false
},
- selectDrugLevel(){
+ selectDrugLevel() {
//获取分页列表
this.filterQueryDrugLevel.approvalNum = this.newProductData.zczbhhzbapzbh
getDrugLevelList(this.filterQueryDrugLevel).then((response) => {
@@ -1008,20 +1010,20 @@ export default {
}).catch(() => {
})
},
- selectDrugLevelItem(row){
- getDrugLevelListBycode({nameCode:row.nameCode}).then((response) => {
+ selectDrugLevelItem(row) {
+ getDrugLevelListBycode({ nameCode: row.nameCode }).then((response) => {
if (response.code == 20000) {
- if (response.data.length > 0){
- response.data.forEach( item => {
+ if (response.data.length > 0) {
+ response.data.forEach(item => {
//新增层级
- let parts = item.bzgg.split('/');
+ let parts = item.bzgg.split('/')
// 首先,根据 ':' 分割字符串
- const ratioParts = item.packRatio.split(':');
- let selectedValue;
+ const ratioParts = item.packRatio.split(':')
+ let selectedValue
if (item.packLevel >= 0 && item.packLevel < ratioParts.length) {
- selectedValue = ratioParts[item.packLevel];
+ selectedValue = ratioParts[item.packLevel]
} else {
- selectedValue = null; // 或者你可以设置一个默认值
+ selectedValue = null // 或者你可以设置一个默认值
}
let editQuery = {
@@ -1032,7 +1034,7 @@ export default {
relId: this.newProductData.id,
uuid: this.newProductData.uuid,
productId: item.productId,
- diType: item.packLevel == 1?1:4,
+ diType: item.packLevel == 1 ? 1 : 4,
xjdw: item.xjdw
}
updateLevelDrug(editQuery).then(res => {
@@ -1043,7 +1045,7 @@ export default {
packLevel: item.packLevel,
packUnit: parts[1] || '',
bhxjsl: selectedValue,
- diType: item.packLevel == 1?1:4,
+ diType: item.packLevel == 1 ? 1 : 4,
isDisabled: false,
rowDisabled: false,
isUpDisabled: true
@@ -1062,8 +1064,26 @@ export default {
this.selectedIndex = this.detailList.length - 1
this.isSave = false
this.selectDrugLevelVisible = false
+ this.filterQueryDrugLevel = {
+ nameCode: '',
+ cpmctymc: '',
+ page: 1,
+ limit: 20,
+ total: 0,
+ approvalNum: ''
+ }
},
- handleCurrentChange(){
+ closeSelectDrugLevelVisible(){
+ this.filterQueryDrugLevel = {
+ nameCode: '',
+ cpmctymc: '',
+ page: 1,
+ limit: 20,
+ total: 0,
+ approvalNum: ''
+ }
+ },
+ handleCurrentChange() {
this.selectDrugLevel()
},
addDrugLevel() {
@@ -1082,8 +1102,7 @@ export default {
rowChange(index, val) {
-
- if(this.editRowSwitch == true ){
+ if (this.editRowSwitch == true) {
this.$message.error('请先保存当前产品标识编辑')
return
}
@@ -1100,7 +1119,7 @@ export default {
type: 'warning'
}).then(() => {
if (row.id != null) {
- let params = {nameCode: row.nameCode}
+ let params = { nameCode: row.nameCode }
delDrugLevel(params).then((res) => {
if (res.code === 20000) {
this.isSave = true
@@ -1122,7 +1141,6 @@ export default {
})
},
-
//设置层级
// setDefaultLevel(){
// //判断流通 最大层级
@@ -1147,7 +1165,7 @@ export default {
uuid: this.newProductData.uuid,
id: this.newProductData.id,
nameCode: this.newProductData.nameCode,
- productType: this.newProductData.productsType,
+ productType: this.newProductData.productsType
}
this.loading = true
filterByUuid(query)
@@ -1207,10 +1225,10 @@ export default {
},
findMaxLevelObject() {
- this.maxLevel = 1;
+ this.maxLevel = 1
for (const obj of this.levelUnitList) {
if (obj.packLevel > this.maxLevel) {
- this.maxLevel = Number(obj.packLevel);
+ this.maxLevel = Number(obj.packLevel)
}
}
},
@@ -1300,13 +1318,13 @@ export default {
this.chooseHouseDrugVisible = false
this.getThirdSysDetail()
},
- handleInput(index, value,type){
- const intValue = parseInt(value, 10);
+ handleInput(index, value, type) {
+ const intValue = parseInt(value, 10)
// 更新行的数据
- if (type == 1){
- this.$set(this.detailList[index], 'packLevel', intValue);
- }else {
- this.$set(this.detailList[index], 'bhxjsl', intValue);
+ if (type == 1) {
+ this.$set(this.detailList[index], 'packLevel', intValue)
+ } else {
+ this.$set(this.detailList[index], 'bhxjsl', intValue)
}
}
diff --git a/src/views/supplier/companyDrug/basicCompanyproductEdit.vue b/src/views/supplier/companyDrug/basicCompanyproductEdit.vue
index 678d317..2e37c32 100644
--- a/src/views/supplier/companyDrug/basicCompanyproductEdit.vue
+++ b/src/views/supplier/companyDrug/basicCompanyproductEdit.vue
@@ -695,6 +695,7 @@
:close-on-press-escape="false"
width="85%"
v-if="selectDrugLevelVisible"
+ @close="closeSelectDrugLevelVisible"
>
@@ -1236,6 +1237,24 @@ export default {
this.selectedIndex = this.detailList.length - 1
this.isSave = false
this.selectDrugLevelVisible = false
+ this.filterQueryDrugLevel = {
+ nameCode: '',
+ cpmctymc: '',
+ page: 1,
+ limit: 20,
+ total: 0,
+ approvalNum: ''
+ }
+ },
+ closeSelectDrugLevelVisible(){
+ this.filterQueryDrugLevel = {
+ nameCode: '',
+ cpmctymc: '',
+ page: 1,
+ limit: 20,
+ total: 0,
+ approvalNum: ''
+ }
},
addDrugLevel() {
this.detailList.push({
From d3778a11d90b0ecbb15ea73430a110c24695dd0a Mon Sep 17 00:00:00 2001
From: yewj
Date: Wed, 13 Nov 2024 09:38:06 +0800
Subject: [PATCH 2/4] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/basic/product/drug/drugAdd.vue | 220 +++++++++++-------
.../companyDrug/basicCompanyproductEdit.vue | 99 +++++---
2 files changed, 198 insertions(+), 121 deletions(-)
diff --git a/src/views/basic/product/drug/drugAdd.vue b/src/views/basic/product/drug/drugAdd.vue
index 589967b..9ce9903 100644
--- a/src/views/basic/product/drug/drugAdd.vue
+++ b/src/views/basic/product/drug/drugAdd.vue
@@ -502,16 +502,16 @@
v-if="selectDrugLevelVisible"
>
-
+
-
+
-
+
@@ -531,7 +531,7 @@
-
+
@@ -542,9 +542,9 @@
-
+
-
+
选入
@@ -570,7 +570,7 @@ import {
updatetDrug,
delDrugLevel,
updateLevelDrug, calculateDistCount, calculateUseCount,
- getDrugLevelList,getDrugLevelListBycode
+ getDrugLevelList, getDrugLevelListBycode
} from '@/api/basic/product/drugUdiinfos'
import {getCodeRelDetail} from '@/api/basic/product/udiRelevance'
import {isBlank} from "@/utils/strUtil";
@@ -617,7 +617,7 @@ export default {
}
},
// components: {selectChargesProjectDialog, chooseHouseDrug},
- components: { chooseHouseDrug},
+ components: {chooseHouseDrug},
data() {
return {
ybDrugDetail: {},
@@ -628,7 +628,7 @@ export default {
page: 1,
limit: 20,
total: 0,
- approvalNum:"",
+ approvalNum: "",
},
newProductData: {
cpmctymc: null,
@@ -925,7 +925,7 @@ export default {
sjcpbm: row.sjcpbm,
bhxjcpbm: row.bhxjcpbm,
bhxjsl: row.bhxjsl,
- relId: this.newProductData.id,
+ relId: this.newProductData.rlId,
uuid: this.newProductData.uuid,
productId: row.productId,
diType: row.diType,
@@ -942,14 +942,14 @@ export default {
//如果都为空 进行补充
if (!this.$isNotBlank(this.newProductData.sptm) && !this.$isNotBlank(this.newProductData.ybbm)) {
- getCodeRelDetail({drugCode:row.nameCode}).then((response) => {
- if (response.code == 20000) {
- if (response.data != null && response.data.length > 0) {
- this.newProductData.sptm = response.data[0].sptm;
- this.newProductData.ybbm = response.data[0].ybbm;
- this.getYbDrugData()
- }
+ getCodeRelDetail({drugCode: row.nameCode}).then((response) => {
+ if (response.code == 20000) {
+ if (response.data != null && response.data.length > 0) {
+ this.newProductData.sptm = response.data[0].sptm;
+ this.newProductData.ybbm = response.data[0].ybbm;
+ this.getYbDrugData()
}
+ }
}).catch(() => {
})
}
@@ -965,7 +965,7 @@ export default {
row.isUpDisabled = true
row.rowDisabled = false
},
- selectDrugLevel(){
+ selectDrugLevel() {
//获取分页列表
this.filterQueryDrugLevel.approvalNum = this.newProductData.zczbhhzbapzbh
getDrugLevelList(this.filterQueryDrugLevel).then((response) => {
@@ -977,21 +977,48 @@ export default {
}).catch(() => {
})
},
- selectDrugLevelItem(row){
- getDrugLevelListBycode({nameCode:row.nameCode}).then((response) => {
+ extractNumber(bzgg) {
+ // 使用正则表达式提取数字
+ const match = bzgg.match(/^\d+/);
+ // 如果匹配到,则返回数字,否则返回null
+ return match ? parseInt(match[0], 10) : null;
+ },
+
+ extractUnitAfterNumber(bzgg) {
+ // 使用正则表达式提取数字后面的单位
+ const match = bzgg.match(/^\d+([^\d/]+)/);
+ // 如果匹配到,则返回单位,否则返回null
+ return match ? match[1].trim() : null;
+ },
+
+
+ selectDrugLevelItem(row) {
+ getDrugLevelListBycode({nameCode: row.nameCode}).then((response) => {
if (response.code == 20000) {
- if (response.data.length > 0){
- response.data.forEach( item => {
- //新增层级
+ 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; // 或者你可以设置一个默认值
+ 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,
@@ -1001,7 +1028,7 @@ export default {
relId: this.newProductData.id,
uuid: this.newProductData.uuid,
productId: item.productId,
- diType: item.packLevel == 1?1:4,
+ diType: item.packLevel == 1 ? 1 : 4,
xjdw: item.xjdw
}
updateLevelDrug(editQuery).then(res => {
@@ -1012,7 +1039,7 @@ export default {
packLevel: item.packLevel,
packUnit: parts[1] || '',
bhxjsl: selectedValue,
- diType: item.packLevel == 1?1:4,
+ diType: item.packLevel == 1 ? 1 : 4,
isDisabled: false,
rowDisabled: false,
isUpDisabled: true
@@ -1022,7 +1049,6 @@ export default {
})
}
-
}
}).catch(() => {
})
@@ -1031,10 +1057,15 @@ export default {
this.selectedIndex = this.detailList.length - 1
this.isSave = false
this.selectDrugLevelVisible = false
- },
- handleCurrentChange(){
+ this.getDetailList()
+ }
+ ,
+
+
+ handleCurrentChange() {
this.selectDrugLevel()
- },
+ }
+ ,
addDrugLevel() {
this.detailList.push({
nameCode: '',
@@ -1047,12 +1078,13 @@ export default {
this.newProductData.productId = null
this.selectedIndex = this.detailList.length - 1
this.isSave = false
- },
+ }
+ ,
rowChange(index, val) {
- if(this.editRowSwitch == true ){
+ if (this.editRowSwitch == true) {
this.$message.error('请先保存当前产品标识编辑')
return
}
@@ -1060,7 +1092,8 @@ export default {
this.selectedIndex = index
this.isSave = false
this.editRowSwitch = true
- },
+ }
+ ,
deleteLevel(index, row) {
this.$confirm('此操作将删除该层级,是否继续?', '提示', {
@@ -1089,27 +1122,28 @@ export default {
}
}).catch(() => {
})
- },
-
-
- //设置层级
- // setDefaultLevel(){
- // //判断流通 最大层级
- // if (this.newProductData.distributeMaxLevel == null){
- // let levelUnit = this.levelUnitList[this.levelUnitList.length - 1];
- // this.newProductData.distributeMaxLevel = levelUnit.packLevel
- // }
- // // 判断使用 采集最大层级
- // if (this.newProductData.useMaxLevel == null){
- // //获取获取第一个 如果packUnit且为null的话就设置第二个
- // let levelUnit = this.levelUnitList[0];
- // if (isBlank(levelUnit.packUnit)){
- // levelUnit = this.levelUnitList[1]
- // }
- // this.newProductData.useMaxLevel = levelUnit.packLevel
- // }
- // },
- //获取层级标识
+ }
+ ,
+
+
+//设置层级
+// setDefaultLevel(){
+// //判断流通 最大层级
+// if (this.newProductData.distributeMaxLevel == null){
+// let levelUnit = this.levelUnitList[this.levelUnitList.length - 1];
+// this.newProductData.distributeMaxLevel = levelUnit.packLevel
+// }
+// // 判断使用 采集最大层级
+// if (this.newProductData.useMaxLevel == null){
+// //获取获取第一个 如果packUnit且为null的话就设置第二个
+// let levelUnit = this.levelUnitList[0];
+// if (isBlank(levelUnit.packUnit)){
+// levelUnit = this.levelUnitList[1]
+// }
+// this.newProductData.useMaxLevel = levelUnit.packLevel
+// }
+// },
+//获取层级标识
getDetailList() {
if (this.newProductData.uuid != null) {
let query = {
@@ -1129,7 +1163,8 @@ export default {
this.detailList = []
})
}
- },
+ }
+ ,
distributeLevelDiChange(val) {
const matchingItem = this.detailList.find(item => item.nameCode == val)
@@ -1144,7 +1179,8 @@ export default {
}
})
- },
+ }
+ ,
useLevelDiChange(val) {
const matchingItem = this.detailList.find(item => item.nameCode == val)
if (matchingItem) {
@@ -1157,7 +1193,8 @@ export default {
useLeverCount: res.data.useLeverCount
}
})
- },
+ }
+ ,
getDiLevel() {
let query = {
id: this.relId
@@ -1173,7 +1210,8 @@ export default {
this.loading = false
this.levelUnitList = []
})
- },
+ }
+ ,
findMaxLevelObject() {
this.maxLevel = 1;
@@ -1182,19 +1220,22 @@ export default {
this.maxLevel = Number(obj.packLevel);
}
}
- },
+ }
+ ,
/**
* 选择收费项目
*/
selectPayFeecode() {
this.tollProjectDialogVisible = true
- },
+ }
+ ,
getData(data) {
this.tollProjectDialogVisible = false
this.newProductData.payFeeCode = data.medCatalogCode
- },
+ }
+ ,
/**
* 第三方系统药品信息
*/
@@ -1212,7 +1253,8 @@ export default {
this.loading = false
this.sysList = []
})
- },
+ }
+ ,
resetThirdId() {
this.sysList.forEach((item) => {
if (item.sysId === 'thirdId') {
@@ -1227,7 +1269,8 @@ export default {
this.newProductData.thirdId4 = item.thirdId
}
})
- },
+ }
+ ,
/**
* 关联 第三方
*/
@@ -1235,7 +1278,8 @@ export default {
this.defaultSys = row.sysId
this.isImport = false
this.chooseHouseDrugVisible = true
- },
+ }
+ ,
removeErp(row) {
this.$confirm('此操作将解除该绑定药品信息, 是否继续?', '提示', {
confirmButtonText: '确定',
@@ -1264,17 +1308,19 @@ export default {
})
.catch(() => {
})
- },
+ }
+ ,
closeUdi(val) {
this.chooseHouseDrugVisible = false
this.getThirdSysDetail()
- },
- handleInput(index, value,type){
+ }
+ ,
+ handleInput(index, value, type) {
const intValue = parseInt(value, 10);
// 更新行的数据
- if (type == 1){
+ if (type == 1) {
this.$set(this.detailList[index], 'packLevel', intValue);
- }else {
+ } else {
this.$set(this.detailList[index], 'bhxjsl', intValue);
}
@@ -1297,19 +1343,21 @@ export default {
} else {
this.selectedIndex = 0
}
- },
+ }
+ ,
directives: {
- 'debounce-input': {
- inserted(el, binding) {
- let timeout
- el.addEventListener('input', () => {
- clearTimeout(timeout)
- timeout = setTimeout(() => {
- binding.value()
- }, parseInt(binding.arg) || 300)
- })
+ 'debounce-input':
+ {
+ inserted(el, binding) {
+ let timeout
+ el.addEventListener('input', () => {
+ clearTimeout(timeout)
+ timeout = setTimeout(() => {
+ binding.value()
+ }, parseInt(binding.arg) || 300)
+ })
+ }
}
- }
}
}
diff --git a/src/views/supplier/companyDrug/basicCompanyproductEdit.vue b/src/views/supplier/companyDrug/basicCompanyproductEdit.vue
index d7d893f..3e56f45 100644
--- a/src/views/supplier/companyDrug/basicCompanyproductEdit.vue
+++ b/src/views/supplier/companyDrug/basicCompanyproductEdit.vue
@@ -717,7 +717,7 @@
-
+
选入
@@ -747,13 +747,13 @@ import {
updateLevelDrug, calculateDistCount, calculateUseCount,
getDrugLevelList, getDrugLevelListBycode
} from '@/api/basic/product/drugUdiinfos'
-import { isBlank } from '@/utils/strUtil'
+import {isBlank} from '@/utils/strUtil'
import {
getYbDrugDetail, removeRl, thirdSysDetail
} from '@/api/basic/product/udiRelevance'
-import { filterClassify } from '@/api/purchase/classifyCode'
-import { filterByUuid, levelByUuid } from '@/api/basic/product/udiInfo'
+import {filterClassify} from '@/api/purchase/classifyCode'
+import {filterByUuid, levelByUuid} from '@/api/basic/product/udiInfo'
// import selectChargesProjectDialog from './selectChargesProjectDialog'
// import chooseHouseDrug from './chooseHouseDrug'
@@ -829,52 +829,52 @@ export default {
activeNames: ['0', '1', '2'],
formRules: {
cpmctymc: [
- { required: true, message: '请输入药品通用名', trigger: 'blur' }
+ {required: true, message: '请输入药品通用名', trigger: 'blur'}
],
prepnSpec: [
- { required: true, message: '请输入制剂规格', trigger: 'blur' }
+ {required: true, message: '请输入制剂规格', trigger: 'blur'}
],
packUnit: [
- { required: true, message: '请输入包装单位', trigger: 'blur' }
+ {required: true, message: '请输入包装单位', trigger: 'blur'}
],
prepnUnit: [
- { required: true, message: '请输入制剂单位', trigger: 'blur' }
+ {required: true, message: '请输入制剂单位', trigger: 'blur'}
],
// packRatio: [
// {required: true, message: '请输入包装比例', trigger: 'blur'}
// ],
packMatrial: [
- { required: true, message: '请输入包装材质', trigger: 'blur' }
+ {required: true, message: '请输入包装材质', trigger: 'blur'}
],
zczbhhzbapzbh: [
- { required: true, message: '请输入批准文号', trigger: 'blur' }
+ {required: true, message: '请输入批准文号', trigger: 'blur'}
],
manufactory: [
- { required: true, message: '生产企业不能为空', trigger: 'blur' }
+ {required: true, message: '生产企业不能为空', trigger: 'blur'}
],
physicType: [
- { required: true, message: '药品类型不能为空', trigger: 'blur' }
+ {required: true, message: '药品类型不能为空', trigger: 'blur'}
],
ybbm: [
- { required: true, message: '医保编码不能为空', trigger: 'blur' }
+ {required: true, message: '医保编码不能为空', trigger: 'blur'}
],
price: [
- { required: true, message: '药品价格不能为空', trigger: 'blur' }
+ {required: true, message: '药品价格不能为空', trigger: 'blur'}
],
majorStatus: [
- { required: true, message: '请选择药品状态', trigger: 'blur' }
+ {required: true, message: '请选择药品状态', trigger: 'blur'}
],
distributeLevel: [
- { required: true, message: '请选择计量单位', trigger: 'blur' }
+ {required: true, message: '请选择计量单位', trigger: 'blur'}
],
distributeMaxLevel: [
- { required: true, message: '请选择允许采集的最大层级', trigger: 'blur' }
+ {required: true, message: '请选择允许采集的最大层级', trigger: 'blur'}
],
useLevel: [
- { required: true, message: '请选择计量单位', trigger: 'blur' }
+ {required: true, message: '请选择计量单位', trigger: 'blur'}
],
useMaxLevel: [
- { required: true, message: '请选择允许采集的最大层级', trigger: 'blur' }
+ {required: true, message: '请选择允许采集的最大层级', trigger: 'blur'}
]
},
detailList: [
@@ -1145,28 +1145,54 @@ export default {
}).catch(() => {
})
},
+ extractNumber(bzgg) {
+ // 使用正则表达式提取数字
+ const match = bzgg.match(/^\d+/);
+ // 如果匹配到,则返回数字,否则返回null
+ return match ? parseInt(match[0], 10) : null;
+ },
+
+ extractUnitAfterNumber(bzgg) {
+ // 使用正则表达式提取数字后面的单位
+ const match = bzgg.match(/^\d+([^\d/]+)/);
+ // 如果匹配到,则返回单位,否则返回null
+ return match ? match[1].trim() : null;
+ },
+
+
selectDrugLevelItem(row) {
- getDrugLevelListBycode({ nameCode: row.nameCode }).then((response) => {
+ 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 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.id,
+ relId: this.newProductData.rlId,
uuid: this.newProductData.uuid,
productId: item.productId,
diType: item.packLevel == 1 ? 1 : 4,
@@ -1199,7 +1225,10 @@ export default {
this.selectedIndex = this.detailList.length - 1
this.isSave = false
this.selectDrugLevelVisible = false
- },
+
+ this.getDetailList()
+ }
+ ,
addDrugLevel() {
this.detailList.push({
nameCode: '',
@@ -1227,7 +1256,7 @@ export default {
type: 'warning'
}).then(() => {
if (row.id != null) {
- let params = { nameCode: row.nameCode }
+ let params = {nameCode: row.nameCode}
delDrugLevel(params).then((res) => {
if (res.code === 20000) {
this.isSave = true
@@ -1413,12 +1442,12 @@ export default {
},
//自动去除小数
- handleInput(index, value,type){
+ handleInput(index, value, type) {
const intValue = parseInt(value, 10);
// 更新行的数据
- if (type == 1){
+ if (type == 1) {
this.$set(this.detailList[index], 'packLevel', intValue);
- }else {
+ } else {
this.$set(this.detailList[index], 'bhxjsl', intValue);
}
From 21a0594f888decbbca9817d6185f1eca3c929d55 Mon Sep 17 00:00:00 2001
From: chenhc <2369838784@qq.com>
Date: Wed, 13 Nov 2024 14:55:12 +0800
Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../distribution/PanelCreateOrderCodes.vue | 54 ++++++++++++++++++-
1 file changed, 52 insertions(+), 2 deletions(-)
diff --git a/src/views/pharmaceuticals/distribution/PanelCreateOrderCodes.vue b/src/views/pharmaceuticals/distribution/PanelCreateOrderCodes.vue
index ee87409..1b44b91 100644
--- a/src/views/pharmaceuticals/distribution/PanelCreateOrderCodes.vue
+++ b/src/views/pharmaceuticals/distribution/PanelCreateOrderCodes.vue
@@ -118,11 +118,19 @@
关联
+ 查看
+
@@ -203,11 +211,32 @@
-
+
+
+
+
+
+