From 0111f92c72bfb922db6f01b5a92ea49364ce9394 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Wed, 4 Sep 2024 17:20:39 +0800 Subject: [PATCH] =?UTF-8?q?9/4=20bug=20=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 | 487 +++++++++--------- src/views/basic/product/drug/drugMaintain.vue | 2 +- src/views/basic/product/productEdit.vue | 68 +-- src/views/basic/workplace/workplaceManage.vue | 42 +- src/views/collect/IoCreateOrder.vue | 16 +- src/views/collect/fieldOperation.vue | 8 +- 6 files changed, 328 insertions(+), 295 deletions(-) diff --git a/src/views/basic/product/drug/drugAdd.vue b/src/views/basic/product/drug/drugAdd.vue index 0e0da64a..fef74f13 100644 --- a/src/views/basic/product/drug/drugAdd.vue +++ b/src/views/basic/product/drug/drugAdd.vue @@ -13,7 +13,7 @@ - + @@ -33,18 +34,20 @@
+ margin-bottom: 8px;" + > 新增药品层级 + style="text-align:right" + >新增药品层级
@@ -95,22 +98,23 @@ @@ -177,22 +181,23 @@ > + + + + + + + - - + - - - - - + - - - + @@ -212,6 +215,9 @@ + + + @@ -221,8 +227,6 @@ - - + + + - - - - - - - - + + + + + + + + + + + + + + + + @@ -307,32 +313,33 @@ - 选入 - - - - - - - - + 选入 + + + + + + + + + - - - - - - - - + + + + + + + + @@ -356,12 +363,14 @@ + placeholder="请选择流通计量层级标识" + > + v-for="item in detailList" + :key="item.nameCode" + :value="item.nameCode" + :label="item.nameCode" + > {{ item.nameCode }} {{ item.packLevel }} @@ -373,12 +382,14 @@ + placeholder="请选择流通计量层级标识" + > + v-for="item in detailList" + :key="item.nameCode" + :value="item.nameCode" + :label="item.nameCode" + > {{ item.nameCode }} {{ item.packLevel }} @@ -442,9 +453,9 @@ @@ -462,19 +473,19 @@ @@ -521,9 +532,9 @@ import { import { getYbHcflDetail, removeRl, thirdSysDetail } from '@/api/basic/product/udiRelevance' -import {filterClassify} from '@/api/purchase/classifyCode' -import {filterByUuid} from "@/api/basic/product/udiInfo"; -import selectChargesProjectDialog from "./selectChargesProjectDialog" +import { filterClassify } from '@/api/purchase/classifyCode' +import { filterByUuid } from '@/api/basic/product/udiInfo' +import selectChargesProjectDialog from './selectChargesProjectDialog' import chooseHouseDrug from './chooseHouseDrug' export default { @@ -544,22 +555,22 @@ export default { }, uuid: { type: Object, - required: true, + required: true }, relId: { type: Object, - required: true, + required: true }, thisData: { type: Object, - required: true, + required: true }, relevanceEdit: { type: Object, - required: true, - }, + required: true + } }, - components: {selectChargesProjectDialog,chooseHouseDrug}, + components: { selectChargesProjectDialog, chooseHouseDrug }, data() { return { ybHcflDetail: {}, @@ -586,52 +597,53 @@ export default { useLevelUnit: null, distributeLevel: null, useLevel: null, + }, thirdSys: [], classifyList: [], saveLoading: false, - activeNames: ['0','1', '2'], + 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'} - ], - packRatio: [ - {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' } ], - registerNo: [ - {required: true, message: '请输入批准文号', trigger: 'blur'} + zczbhhzbapzbh: [ + { 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' } ] }, detailList: [ // 初始化一个空对象或包含默认值的对象 - {nameCode: '', packLevel: null, bhxjsl: null, isDisabled: false, isUpDisabled: true, rowDisabled: false} + { nameCode: '', packLevel: null, bhxjsl: null, isDisabled: false, isUpDisabled: true, rowDisabled: false } ], status: false, rowDisabled: false, @@ -641,7 +653,7 @@ export default { sysList: [], chooseHouseDrugVisible: false, isImport: false, - defaultSys: null, + defaultSys: null } }, @@ -656,14 +668,14 @@ export default { key: key } filterClassify(query) - .then(response => { - this.loading = false - this.classifyList = response.data.list || [] - }) - .catch(() => { - this.loading = false - this.classifyList = [] - }) + .then(response => { + this.loading = false + this.classifyList = response.data.list || [] + }) + .catch(() => { + this.loading = false + this.classifyList = [] + }) }, getYbHcData() { let query = { @@ -690,6 +702,9 @@ export default { }, saveNewProduct() { this.addProductDialogVisible = false + this.newProductData.registerNo = this.newProductData.zczbhhzbapzbh + this.newProductData.splitEnable = true + this.newProductData.autoCode = true //新增 if (this.type == 1) { this.$refs['dataForm'].validate((valid) => { @@ -706,24 +721,24 @@ export default { } else { const validateItem = (item, fieldName, errorMessage) => { if (!item[fieldName]) { - this.$message.error(errorMessage); - return false; + this.$message.error(errorMessage) + return false } - return true; - }; + return true + } for (let i = 0; i < this.detailList.length; i++) { - const item = this.detailList[i]; + const item = this.detailList[i] if (!validateItem(item, 'nameCode', '药品层级标识不能为空!') || - !validateItem(item, 'packLevel', '包装级别不能为空') || - !validateItem(item, 'packUnit', '层级单位不能为空')) { - return; + !validateItem(item, 'packLevel', '包装级别不能为空') || + !validateItem(item, 'packUnit', '层级单位不能为空')) { + return } } - const isLevel1 = this.detailList.some(item => item.packLevel === 1); + const isLevel1 = this.detailList.some(item => item.packLevel === 1) if (!isLevel1) { - this.$message.error('药品层级缺少一级标识!'); + this.$message.error('药品层级缺少一级标识!') } - this.newProductData.drugLevelLists = this.detailList; + this.newProductData.drugLevelLists = this.detailList } this.saveLoading = true @@ -743,23 +758,28 @@ export default { } }) } else { - if (this.status) { - this.newProductData.requireScanCode = 1 - } else { - this.newProductData.requireScanCode = 0 - } - 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) { - //清空弹窗数据 - this.closeDialog() - this.$message.success('保存成功') + this.$refs['dataForm'].validate((valid) => { + if (!valid) { + return this.$message.error('请补充必要数据') + } + if (this.status) { + this.newProductData.requireScanCode = 1 } else { - this.$message.error(res.message) + this.newProductData.requireScanCode = 0 } + 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) { + //清空弹窗数据 + this.closeDialog() + this.$message.success('保存成功') + } else { + this.$message.error(res.message) + } + }) }) } @@ -771,15 +791,15 @@ export default { //层级保存 levelSave(row) { if (row.nameCode == null) { - this.$message.error("层级标识不能为空"); + this.$message.error('层级标识不能为空') return } if (row.packLevel == null) { - this.$message.error("包装级别不能为空"); + this.$message.error('包装级别不能为空') return } if (row.packUnit == null) { - this.$message.error("层级单位不能为空"); + this.$message.error('层级单位不能为空') return } let editQuery = { @@ -795,10 +815,11 @@ export default { updateLevelDrug(editQuery).then(res => { this.saveLoading = false if (res.code == 20000) { - this.$message.success("保存成功!"); + this.$message.success('保存成功!') this.selectedIndex = null - if (this.newProductData.id != null) - this.getDetailList(); + if (this.newProductData.id != null) { + this.getDetailList() + } } else { this.$message.error(res.message) } @@ -817,13 +838,12 @@ export default { isDisabled: false, rowDisabled: false, isUpDisabled: true - }); - this.selectedIndex = this.detailList.length -1 + }) + this.selectedIndex = this.detailList.length - 1 }, - rowChange(index, val) { - this.selectedIndex = index; + this.selectedIndex = index }, deleteLevel(index, row) { @@ -832,20 +852,20 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { - if (row.id != null){ - let params = {nameCode: row.nameCode}; + if (row.id != null) { + let params = { nameCode: row.nameCode } delDrugLevel(params).then((res) => { if (res.code === 20000) { - this.$message.success("删除成功"); - this.getDetailList(); + this.$message.success('删除成功') + this.getDetailList() } }) } else { - this.detailList.splice(index, 1); - this.$message.success("删除成功"); + this.detailList.splice(index, 1) + this.$message.success('删除成功') } }).catch(() => { - }); + }) }, //获取层级标识 @@ -855,44 +875,43 @@ export default { uuid: this.newProductData.uuid, id: this.newProductData.id } - this.loading = true; + this.loading = true filterByUuid(query) - .then((response) => { - this.loading = false; - this.detailList = response.data || []; - }) - .catch(() => { - this.loading = false; - this.detailList = []; - }); + .then((response) => { + this.loading = false + this.detailList = response.data || [] + }) + .catch(() => { + this.loading = false + this.detailList = [] + }) } }, distributeLevelDiChange(val) { - const matchingItem = this.detailList.find(item => item.nameCode == val); + const matchingItem = this.detailList.find(item => item.nameCode == val) if (matchingItem) { - this.newProductData.distributeLevelUnit = matchingItem.packUnit; + this.newProductData.distributeLevelUnit = matchingItem.packUnit this.newProductData.distributeLevel = matchingItem.packLevel } calculateDistCount(matchingItem).then((res) => { this.newProductData = { ...this.newProductData, - distributeLevelCount: res.data.distributeLevelCount, + distributeLevelCount: res.data.distributeLevelCount } }) - }, useLevelDiChange(val) { - const matchingItem = this.detailList.find(item => item.nameCode == val); + const matchingItem = this.detailList.find(item => item.nameCode == val) if (matchingItem) { - this.newProductData.useLevelUnit = matchingItem.packUnit; - this.newProductData.useLevel = matchingItem.packLevel; + this.newProductData.useLevelUnit = matchingItem.packUnit + this.newProductData.useLevel = matchingItem.packLevel } calculateUseCount(matchingItem).then((res) => { this.newProductData = { ...this.newProductData, - useLeverCount: res.data.useLeverCount, + useLeverCount: res.data.useLeverCount } }) }, @@ -912,31 +931,31 @@ export default { */ getThirdSysDetail() { let query = { - id: this.relevanceEdit.id, - }; + id: this.relevanceEdit.id + } thirdSysDetail(query) .then((response) => { - this.loading = false; - this.sysList = response.data.list || []; - this.resetThirdId(); + this.loading = false + this.sysList = response.data.list || [] + this.resetThirdId() }) .catch(() => { - this.loading = false; - this.sysList = []; - }); + this.loading = false + this.sysList = [] + }) }, resetThirdId() { this.sysList.forEach((item) => { - if (item.sysId === "thirdId") { - this.newProductData.thirdId = item.thirdId; - } else if (item.sysId === "thirdId1") { - this.newProductData.thirdId1 = item.thirdId; - } else if (item.sysId === "thirdId2") { - this.newProductData.thirdId2 = item.thirdId; - } else if (item.sysId === "thirdId3") { - this.newProductData.thirdId3 = item.thirdId; - } else if (item.sysId === "thirdId4") { - this.newProductData.thirdId4 = item.thirdId; + if (item.sysId === 'thirdId') { + this.newProductData.thirdId = item.thirdId + } else if (item.sysId === 'thirdId1') { + this.newProductData.thirdId1 = item.thirdId + } else if (item.sysId === 'thirdId2') { + this.newProductData.thirdId2 = item.thirdId + } else if (item.sysId === 'thirdId3') { + this.newProductData.thirdId3 = item.thirdId + } else if (item.sysId === 'thirdId4') { + this.newProductData.thirdId4 = item.thirdId } }) }, @@ -944,58 +963,58 @@ export default { * 关联 第三方 */ addSelectErp(row) { - this.defaultSys = row.sysId; - this.isImport = false; - this.chooseHouseDrugVisible = true; + this.defaultSys = row.sysId + this.isImport = false + this.chooseHouseDrugVisible = true }, removeErp(row) { - this.$confirm("此操作将解除该绑定药品信息, 是否继续?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", + this.$confirm('此操作将解除该绑定药品信息, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' }) .then(() => { let query = { relId: this.relId, thirdSys: row.sysId - }; + } removeRl(query) .then((response) => { if (response.code == 20000) { this.$message({ - type: "success", - message: "解绑成功!", - }); - this.getThirdSysDetail(); + type: 'success', + message: '解绑成功!' + }) + this.getThirdSysDetail() } else { - this.$message.error(response.message); + this.$message.error(response.message) } }) .catch(() => { - }); + }) }) .catch(() => { - }); + }) }, closeUdi(val) { - this.chooseHouseDrugVisible = false; - this.getThirdSysDetail(); - }, + this.chooseHouseDrugVisible = false + this.getThirdSysDetail() + } }, created() { if (this.rowData != null) { this.newProductData = this.rowData this.newProductData.cpmctymc = this.rowData.cpmctymc - this.newProductData.registerNo = this.rowData.zczbhhzbapzbh + this.newProductData.zczbhhzbapzbh = this.rowData.zczbhhzbapzbh if (this.rowData.requireScanCode == 1) { this.status = true } else { this.status = false } - this.getDetailList(); + this.getDetailList() this.getThirdSysDetail() - }else { + } else { this.selectedIndex = 0 } diff --git a/src/views/basic/product/drug/drugMaintain.vue b/src/views/basic/product/drug/drugMaintain.vue index 1b397177..5211eb23 100644 --- a/src/views/basic/product/drug/drugMaintain.vue +++ b/src/views/basic/product/drug/drugMaintain.vue @@ -99,7 +99,7 @@ - + diff --git a/src/views/basic/product/productEdit.vue b/src/views/basic/product/productEdit.vue index 5abb8672..fac193b8 100644 --- a/src/views/basic/product/productEdit.vue +++ b/src/views/basic/product/productEdit.vue @@ -726,39 +726,39 @@ - - - 是否拆零 - - - - - - - - - - - 是否拆零 - - - - - - 是否自动赋码 - - - - - - - - - - - 是否自动赋码 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1397,6 +1397,8 @@ export default { }, onAddSubmit(relSubmit) { this.editQuery.relSubmit = relSubmit; + this.editQuery.splitEnable = true; + this.editQuery.autoCode = true; this.onAddLoading = true updatetUdiInfos(this.editQuery) .then((response) => { diff --git a/src/views/basic/workplace/workplaceManage.vue b/src/views/basic/workplace/workplaceManage.vue index 2ef53ee3..4130bd18 100644 --- a/src/views/basic/workplace/workplaceManage.vue +++ b/src/views/basic/workplace/workplaceManage.vue @@ -395,17 +395,16 @@ style="width: 80%" @change="handleInvChange" > - - {{ item.name }} - + + + + + + + @@ -665,7 +664,7 @@ import { deleteWorkplace, createWorkplaceId, printWorkLabel, getUsers } from '@/api/basic/workPlace/sysWorkplaceManage' -import {filterAllByUser, getInvListByUser} from '@/api/system/invWarehouse' +import { filterAllByUser, filterList, getInvListByUser } from '@/api/system/invWarehouse' import {addTree, deleteTree, getTree, updateTree} from '@/api/basic/collectPoint/collectPointManage' import {getCollectBusType} from '@/api/basic/collectPoint/gatherOrderType' import panelGroup from '@/views/dashboard/PanelGroup' @@ -1233,14 +1232,25 @@ export default { }, getDeptList() { this.deptList = [] - filterAllByUser() - .then((response) => { - this.deptList = response.data || [] - this.getInvList() - }) - .catch(() => { - }) + let data = + {enable: true, + } + filterList(data).then(res => { + if (res.code == 20000) { + this.deptList = res.data.list || [] + } + }) }, + // getDeptList() { + // + // filterAllByUser() + // .then((response) => { + // this.deptList = response.data || [] + // this.getInvList() + // }) + // .catch(() => { + // }) + // }, deptChange() { this.getInvList() this.formData.invCode = '' diff --git a/src/views/collect/IoCreateOrder.vue b/src/views/collect/IoCreateOrder.vue index baf5774b..9f381854 100644 --- a/src/views/collect/IoCreateOrder.vue +++ b/src/views/collect/IoCreateOrder.vue @@ -181,14 +181,14 @@ - - - - 拆零上货 - 整取上货 - - - + + + + + + + + diff --git a/src/views/collect/fieldOperation.vue b/src/views/collect/fieldOperation.vue index 81447f67..f4e3f69f 100644 --- a/src/views/collect/fieldOperation.vue +++ b/src/views/collect/fieldOperation.vue @@ -7,7 +7,7 @@ - + @@ -54,14 +54,16 @@