From e5a4af4d73bf7bb55af8c423128a5bed37c39979 Mon Sep 17 00:00:00 2001 From: qiuyt Date: Tue, 24 Dec 2024 19:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8E=E4=BE=9B=E5=BA=94=E5=95=86=E9=80=89?= =?UTF-8?q?=E5=85=A5=E8=8D=AF=E5=93=81=E9=80=89=E5=85=A5=E8=8D=AF=E5=93=81?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E5=8A=9F=E8=83=BD=E6=90=AC=E5=88=B0=E5=86=85?= =?UTF-8?q?=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/basic/product/drugUdiinfos.js | 14 + src/views/basic/product/drug/drugAdd.vue | 425 ++++++++++++----------- 2 files changed, 229 insertions(+), 210 deletions(-) diff --git a/src/api/basic/product/drugUdiinfos.js b/src/api/basic/product/drugUdiinfos.js index 7aa1fd5c..59138f27 100644 --- a/src/api/basic/product/drugUdiinfos.js +++ b/src/api/basic/product/drugUdiinfos.js @@ -48,5 +48,19 @@ export function calculateUseCount(query) { data: query }); } +export function getDrugLevelList(query) { + return axios({ + url: "udiwms/aliDrug/getDrugLevelList", + method: "get", + params: 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 4b6e77a3..d3b55dac 100644 --- a/src/views/basic/product/drug/drugAdd.vue +++ b/src/views/basic/product/drug/drugAdd.vue @@ -36,6 +36,10 @@ text-align: right; margin-bottom: 8px;" > + 选入药品层级 + 新增药品层级 @@ -162,6 +166,7 @@ @@ -259,7 +265,7 @@ - + @@ -347,6 +353,13 @@ > + + + + + @@ -354,6 +367,9 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -522,120 +497,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -643,32 +504,6 @@ 取消
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 查询 + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+ @@ -697,8 +612,10 @@ import { addDrug, updatetDrug, delDrugLevel, - updateLevelDrug, calculateDistCount, calculateUseCount + updateLevelDrug, calculateDistCount, calculateUseCount, + getDrugLevelList,getDrugLevelListBycode,updateLevelDrugAli } from '@/api/basic/product/drugUdiinfos' +import {getCodeRelDetail} from '@/api/basic/product/udiRelevance' import {isBlank} from "@/utils/strUtil"; import { @@ -706,7 +623,7 @@ import { } from '@/api/basic/product/udiRelevance' import {filterClassify} from '@/api/purchase/classifyCode' import {filterByUuid, levelByUuid} from '@/api/basic/product/udiInfo' -import selectChargesProjectDialog from './selectChargesProjectDialog' +// import selectChargesProjectDialog from './selectChargesProjectDialog' import chooseHouseDrug from './chooseHouseDrug' export default { @@ -742,11 +659,20 @@ export default { required: true } }, - components: {selectChargesProjectDialog, chooseHouseDrug}, + // components: {selectChargesProjectDialog, chooseHouseDrug}, + components: { chooseHouseDrug}, data() { return { ybDrugDetail: {}, productData: {}, + filterQueryDrugLevel: { + nameCode: '', + cpmctymc: '', + page: 1, + limit: 20, + total: 0, + approvalNum:"", + }, newProductData: { cpmctymc: null, bzgg: null, @@ -754,6 +680,7 @@ export default { measname: null, manufactory: null, ybbm: null, + sptm: null, cpms: null, productsType: 2, //高级设置默认开启扫码 @@ -776,6 +703,7 @@ export default { }, thirdSys: [], classifyList: [], + selectDrugLevelList: [], saveLoading: false, activeNames: ['0', '1', '2'], formRules: { @@ -831,14 +759,19 @@ export default { // {required: true, message: '请选择允许采集的最大层级', trigger: 'blur'} // ], }, + formRulesSelectedDrug: { + cpmctymc: [ + { required: true, message: '请输入药品通用名', trigger: 'blur' } + ], + }, detailList: [ // 初始化一个空对象或包含默认值的对象 { productId: null, nameCode: '', packLevel: null, - packRatio: null, bhxjsl: null, + packRatio:null, isDisabled: false, isUpDisabled: true, rowDisabled: false @@ -852,13 +785,15 @@ export default { tollProjectDialogVisible: false, sysList: [], chooseHouseDrugVisible: false, + selectDrugLevelVisible: false, isImport: false, defaultSys: null, levelUnitList: [], maxLevel: 1, editRowSwitch: false, //产品标识编辑开关 没保存前其他编辑不能按 - isSpecial:false + //以89开头的标识码 + isSpecial: false } }, @@ -987,7 +922,6 @@ export default { } }) } else { - // this.setDefaultLevel() this.$refs['dataForm'].validate((valid) => { if (!valid) { return this.$message.error('请补充必要数据') @@ -1000,7 +934,6 @@ export default { this.newProductData.uuid = this.rowData.uuid this.newProductData.nameCode = this.rowData.nameCode this.newProductData.relId = this.newProductData.id - updatetDrug(this.newProductData).then(res => { this.saveLoading = false if (res.code == 20000) { @@ -1019,25 +952,9 @@ export default { this.closeDialog() }, - //设置层级 - // 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 - // } - // }, //层级保存 levelSave(row) { + this.editRowSwitch = false if (isBlank(row.nameCode)) { this.$message.error('层级标识不能为空') @@ -1058,7 +975,6 @@ export default { this.$message.error('层级单位不能为空') return } - let editQuery = { nameCode: row.nameCode, packLevel: row.packLevel, @@ -1081,6 +997,21 @@ export default { this.selectedIndex = null this.getDetailList() 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() + } + } + }).catch(() => { + }) + } + } else { this.isSave = true this.$message.error(res.message) @@ -1092,11 +1023,60 @@ export default { row.isUpDisabled = true row.rowDisabled = false }, + selectDrugLevel() { + this.selectDrugLevelVisible = true + setTimeout(() => { + this.$refs['formSelectedDrug'].validate((valid) => { + if (valid) { + this.filterQueryDrugLevel.uuid = this.newProductData.uuid + this.filterQueryDrugLevel.ybbm = this.newProductData.ybbm + //获取分页列表 + // this.filterQueryDrugLevel.approvalNum = this.newProductData.zczbhhzbapzbh + getDrugLevelList(this.filterQueryDrugLevel).then((response) => { + if (response.code == 20000) { + this.selectDrugLevelList = response.data.list || [] + this.filterQueryDrugLevel.total = response.data.total || 0 + } + }).catch(() => { + }) + } + + }) + }, 500) + + }, + selectDrugLevelItem(row){ + this.filterQueryDrugLevel.uuid = this.newProductData.uuid + this.filterQueryDrugLevel.ybbm = this.newProductData.ybbm + this.filterQueryDrugLevel.nameCodeRow = row.nameCode + // console.log('drug',drug) + updateLevelDrugAli(this.filterQueryDrugLevel).then((response) => { + if (response.code == 20000) { + // this.selectedIndex = this.detailList.length - 1 + // this.isSave = false + this.selectDrugLevelVisible = false + var filterQueryDrugLevelNew = this.filterQueryDrugLevel + this.getDiLevel() + this.getDetailList() + this.getThirdSysDetail() + this.filterQueryDrugLevel = filterQueryDrugLevelNew + } + }).catch(() => { + }) + + + } + , + + + handleCurrentChange() { + this.selectDrugLevel() + }, addDrugLevel() { this.detailList.push({ nameCode: '', - packLevel: 0, - bhxjsl: 0, + packLevel: null, + bhxjsl: null, isDisabled: false, rowDisabled: false, isUpDisabled: true @@ -1108,10 +1088,12 @@ export default { rowChange(index, val) { + if(this.editRowSwitch == true ){ this.$message.error('请先保存当前产品标识编辑') return } + this.selectedIndex = index this.isSave = false this.editRowSwitch = true @@ -1146,6 +1128,24 @@ export default { }) }, + + //设置层级 + // 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) { @@ -1168,6 +1168,8 @@ export default { }) } }, + + //判断是否特殊药品 checkIsSpecial(){ if (this.detailList.length > 0){ this.detailList.forEach(item => { @@ -1177,6 +1179,7 @@ export default { }) } }, + distributeLevelDiChange(val) { const matchingItem = this.detailList.find(item => item.nameCode == val) if (matchingItem) { @@ -1326,6 +1329,8 @@ export default { } + + }, created() { if (this.rowData != null) {