diff --git a/src/views/basic/product/drug/drugAdd.vue b/src/views/basic/product/drug/drugAdd.vue index 9ce9903..147f944 100644 --- a/src/views/basic/product/drug/drugAdd.vue +++ b/src/views/basic/product/drug/drugAdd.vue @@ -256,6 +256,26 @@

基本信息

+ + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + + - - + + + - - --> + + + - - - + + + @@ -363,9 +390,6 @@ - - - @@ -375,6 +399,10 @@ + + + + - - - - - - - - - + @@ -427,7 +445,13 @@ - + + + + + + + + - - - @@ -500,6 +524,7 @@ :close-on-press-escape="false" width="85%" v-if="selectDrugLevelVisible" + @close="closeSelectDrugLevelVisible" > @@ -534,6 +559,7 @@ + @@ -570,7 +596,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,18 +643,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, @@ -709,6 +735,9 @@ export default { useLevel: [ {required: true, message: '请选择计量单位', trigger: 'blur'} ], + detailSort: [ + {required: true, message: '请选择明细分类', trigger: 'blur'} + ], // useMaxLevel: [ // {required: true, message: '请选择允许采集的最大层级', trigger: 'blur'} // ], @@ -900,24 +929,27 @@ export default { //层级保存 levelSave(row) { + this.editRowSwitch = false if (isBlank(row.nameCode)) { this.$message.error('层级标识不能为空') return } - if (isBlank(row.packLevel)) { - this.$message.error('包装级别不能为空') + if (isBlank(row.bhxjsl)) { + row.bhxjsl = 0 + } + if (isNaN(row.packLevel)) { + row.packLevel = 0 + } + if(this.newProductData.detailSort > 9 && row.packLevel == '0' ){ + this.$message.error('包装级别必须大于0') return + } if (isBlank(row.packUnit)) { this.$message.error('层级单位不能为空') return } - - if (isBlank(row.bhxjsl)) { - this.$message.error('请填写下级数量') - return - } let editQuery = { nameCode: row.nameCode, packLevel: row.packLevel, @@ -942,14 +974,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 +997,7 @@ export default { row.isUpDisabled = true row.rowDisabled = false }, - selectDrugLevel() { + selectDrugLevel(){ //获取分页列表 this.filterQueryDrugLevel.approvalNum = this.newProductData.zczbhhzbapzbh getDrugLevelList(this.filterQueryDrugLevel).then((response) => { @@ -977,23 +1009,8 @@ 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) => { + selectDrugLevelItem(row){ + getDrugLevelListBycode({nameCode:row.nameCode}).then((response) => { if (response.code == 20000) { if (response.data.length > 0) { response.data.forEach(item => { @@ -1064,8 +1081,7 @@ export default { handleCurrentChange() { this.selectDrugLevel() - } - , + }, addDrugLevel() { this.detailList.push({ nameCode: '', @@ -1078,13 +1094,12 @@ 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 } @@ -1092,8 +1107,7 @@ export default { this.selectedIndex = index this.isSave = false this.editRowSwitch = true - } - , + }, deleteLevel(index, row) { this.$confirm('此操作将删除该层级,是否继续?', '提示', { @@ -1122,28 +1136,27 @@ 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 = { @@ -1163,8 +1176,7 @@ export default { this.detailList = [] }) } - } - , + }, distributeLevelDiChange(val) { const matchingItem = this.detailList.find(item => item.nameCode == val) @@ -1179,8 +1191,7 @@ export default { } }) - } - , + }, useLevelDiChange(val) { const matchingItem = this.detailList.find(item => item.nameCode == val) if (matchingItem) { @@ -1193,8 +1204,7 @@ export default { useLeverCount: res.data.useLeverCount } }) - } - , + }, getDiLevel() { let query = { id: this.relId @@ -1210,8 +1220,7 @@ export default { this.loading = false this.levelUnitList = [] }) - } - , + }, findMaxLevelObject() { this.maxLevel = 1; @@ -1220,22 +1229,19 @@ export default { this.maxLevel = Number(obj.packLevel); } } - } - , + }, /** * 选择收费项目 */ selectPayFeecode() { this.tollProjectDialogVisible = true - } - , + }, getData(data) { this.tollProjectDialogVisible = false this.newProductData.payFeeCode = data.medCatalogCode - } - , + }, /** * 第三方系统药品信息 */ @@ -1253,8 +1259,7 @@ export default { this.loading = false this.sysList = [] }) - } - , + }, resetThirdId() { this.sysList.forEach((item) => { if (item.sysId === 'thirdId') { @@ -1269,8 +1274,7 @@ export default { this.newProductData.thirdId4 = item.thirdId } }) - } - , + }, /** * 关联 第三方 */ @@ -1278,8 +1282,7 @@ export default { this.defaultSys = row.sysId this.isImport = false this.chooseHouseDrugVisible = true - } - , + }, removeErp(row) { this.$confirm('此操作将解除该绑定药品信息, 是否继续?', '提示', { confirmButtonText: '确定', @@ -1308,19 +1311,17 @@ 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); } @@ -1343,21 +1344,19 @@ 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/basicCompanyProductsImport.vue b/src/views/supplier/companyDrug/basicCompanyProductsImport.vue index fe0e34c..3616a29 100644 --- a/src/views/supplier/companyDrug/basicCompanyProductsImport.vue +++ b/src/views/supplier/companyDrug/basicCompanyProductsImport.vue @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - --> + + + - - - + + @@ -364,8 +395,6 @@ - - @@ -375,6 +404,10 @@ + + + + - - - - - - - - - + @@ -427,7 +450,13 @@ - + + + + + + + + - - - @@ -671,6 +700,7 @@ :close-on-press-escape="false" width="85%" v-if="selectDrugLevelVisible" + @close="closeSelectDrugLevelVisible" > @@ -709,6 +739,7 @@ + @@ -747,13 +778,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,53 +860,56 @@ 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' } + ], + detailSort: [ + {required: true, message: '请选择明细分类', trigger: 'blur'} + ], }, detailList: [ // 初始化一个空对象或包含默认值的对象 @@ -1075,9 +1109,17 @@ export default { this.$message.error('层级标识不能为空') return } - if (isBlank(row.packLevel)) { - this.$message.error('包装级别不能为空') + if (isBlank(row.bhxjsl) ) { + row.bhxjsl = 0 + } + + if (isNaN(row.packLevel)) { + row.packLevel = 0 + } + if(this.newProductData.detailSort > 9 && row.packLevel == '0' ){ + this.$message.error('包装级别必须大于0') return + } if (isBlank(row.packUnit)) { this.$message.error('层级单位不能为空') @@ -1145,21 +1187,6 @@ 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) => { if (response.code == 20000) { @@ -1232,8 +1259,8 @@ export default { addDrugLevel() { this.detailList.push({ nameCode: '', - packLevel: null, - bhxjsl: null, + packLevel: 0, + bhxjsl: 0, isDisabled: false, rowDisabled: false, isUpDisabled: true @@ -1256,7 +1283,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 @@ -1442,12 +1469,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); }