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..f83ed55 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;" > + 选入药品层级 + 新增药品层级 @@ -657,6 +661,74 @@ + + + + + + + + + + + + + + + +
+ 查询 + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
+ @@ -665,7 +737,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 +790,13 @@ export default { return { ybDrugDetail: {}, productData: {}, + filterQueryDrugLevel: { + nameCode: "", + cpmctymc: "", + page: 1, + limit: 20, + total: 0, + }, newProductData: { cpmctymc: null, bzgg: null, @@ -747,6 +827,7 @@ export default { }, thirdSys: [], classifyList: [], + selectDrugLevelList: [], saveLoading: false, activeNames: ['0', '1', '2'], formRules: { @@ -819,6 +900,7 @@ export default { tollProjectDialogVisible: false, sysList: [], chooseHouseDrugVisible: false, + selectDrugLevelVisible: false, isImport: false, defaultSys: null, levelUnitList: [], @@ -1045,6 +1127,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 +1265,7 @@ export default { filterByUuid(query) .then((response) => { this.loading = false - this.detailList = response.data || [] + this.detailList = response.data.list || [] }) .catch(() => { this.loading = false diff --git a/src/views/basic/product/drug/drugMaintain.vue b/src/views/basic/product/drug/drugMaintain.vue index a6d15f2..6bdbef3 100644 --- a/src/views/basic/product/drug/drugMaintain.vue +++ b/src/views/basic/product/drug/drugMaintain.vue @@ -355,6 +355,7 @@ export default { this.fileList = fileList; if (res.code === 20000) { this.$message.success(res.message); + this.fileList = [] } else { this.$message.error(res.message); } diff --git a/src/views/collect/relCode/relCode.vue b/src/views/collect/relCode/relCode.vue index 9a27c1e..0a67c64 100644 --- a/src/views/collect/relCode/relCode.vue +++ b/src/views/collect/relCode/relCode.vue @@ -333,6 +333,7 @@ export default { this.fileList = fileList; if (res.code === 20000) { this.$message.success(res.message); + this.fileList = [] } else { this.$message.error(res.message); } diff --git a/src/views/supplier/companyDrug/basicCompanyDrugProducts.vue b/src/views/supplier/companyDrug/basicCompanyDrugProducts.vue index 389ca9a..c5dbd24 100644 --- a/src/views/supplier/companyDrug/basicCompanyDrugProducts.vue +++ b/src/views/supplier/companyDrug/basicCompanyDrugProducts.vue @@ -161,6 +161,24 @@ 重置 查询 选入 + + 药品标识上传 + @@ -526,6 +544,7 @@ import selectDrugProductsEdit from "./selectDrugProductsEdit" import { getHead, executeFuc } from "@/utils/customConfig"; +import {getAdminId, getToken} from '@/utils/auth'; export default { data() { @@ -623,11 +642,65 @@ export default { titleMap:{ 1 : '药品信息编辑', 2 : '药品信息详情', - } + }, + headers:{ + ADMINID: getAdminId(), + ADMINTOKEN: getToken() + }, + extraData:{"uuid": "upload-txt"}, + uploadLoading: false, + action: process.env.VUE_APP_BASE_API + "/udiwms/aliDrug/txtUpload", + fileList: [] }; }, methods: { + handleRemove(file, fileList) { + console.log(file, fileList); + }, + handlePreview(file) { + console.log(file); + }, + handleExceed(files, fileList) { + this.$message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); + }, + beforeRemove(file, fileList) { + return this.$confirm(`确定移除 ${ file.name }?`); + }, + handleSuccess(res, file, fileList) { + fileList = fileList.filter(item => item.response.code === 20000); + this.fileList = fileList; + if (res.code === 20000) { + this.$message.success(res.message); + this.fileList = [] + } else { + this.$message.error(res.message); + } + this.uploadLoading.close(); + }, + beforeUpload(file) { + const isXML = file.name.endsWith('.txt'); + const isLt5M = file.size / 1024 / 1024 < 10; + if (!isXML) { + this.$message.error('上传文件只能是 TXT 格式!'); + } + if (!isLt5M) { + this.$message.error('上传文件大小不能超过 10MB!'); + } + return isXML && isLt5M; + }, + handleProgress() { + this.uploadLoading = this.$loading({ + lock: true, + text: '文件上传中…', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.5)' + }); + }, + handleError() { + this.uploadLoading.close(); + this.$message.error('文件上传失败,请检查文件大小或文件格式'); + }, hideSearch() { this.showSearch = !this.showSearch; }, diff --git a/src/views/supplier/companyDrug/basicCompanyproductEdit.vue b/src/views/supplier/companyDrug/basicCompanyproductEdit.vue index b495076..32be21e 100644 --- a/src/views/supplier/companyDrug/basicCompanyproductEdit.vue +++ b/src/views/supplier/companyDrug/basicCompanyproductEdit.vue @@ -37,6 +37,10 @@ margin-bottom: 8px;" v-if="type != 2" > + 选入药品层级 + 新增药品层级 @@ -657,6 +661,74 @@ + + + + + + + + + + + + + + + +
+ 查询 + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
+ @@ -665,7 +737,8 @@ import { addDrug, updatetDrug, delDrugLevel, - updateLevelDrug, calculateDistCount, calculateUseCount + updateLevelDrug, calculateDistCount, calculateUseCount, + getDrugLevelList,getDrugLevelListBycode } from '@/api/basic/product/drugUdiinfos' import {isBlank} from "@/utils/strUtil"; @@ -821,6 +894,15 @@ export default { defaultSys: null, levelUnitList: [], maxLevel: 1, + selectDrugLevelVisible: false, + selectDrugLevelList: [], + filterQueryDrugLevel: { + nameCode: "", + cpmctymc: "", + page: 1, + limit: 20, + total: 0, + }, } }, @@ -1026,6 +1108,72 @@ 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 + }, addDrugLevel() { this.detailList.push({ nameCode: '', @@ -1242,7 +1390,7 @@ export default { created() { if (this.rowData != null) { this.newProductData = this.rowData - console.log("和水水水水",this.newProductData) + // console.log("和水水水水",this.newProductData) this.newProductData.cpmctymc = this.rowData.cpmctymc this.newProductData.zczbhhzbapzbh = this.rowData.zczbhhzbapzbh if (this.rowData.requireScanCode == 1) {