Browse Source

Merge branch 'master' into 'master'

解决药品账页维护编辑问题

See merge request lighter/vue-intergration-platform!161
huangshuhua 1 month ago
parent
commit
f6ba3515db
2 changed files with 33 additions and 4 deletions
  1. 16 3
      src/api/yp-dict/yp-dict-info.js
  2. 17 1
      src/views/yp-dict/YpDictInfo.vue

+ 16 - 3
src/api/yp-dict/yp-dict-info.js

@@ -37,9 +37,9 @@ export function updateYpStopOrUsed(code, serial, delFlag) {
 }
 
 /**
- * 根据code(药品编码)查询药品账页信息
- * @param {string} code
- * @param serial serial
+ * 根据code(药品编码)和serial(包装规格)查询药品账页信息
+ * @param {string} code 药品编码
+ * @param {string} serial 包装规格
  * @returns
  */
 export function selectYpDictByCode(code, serial) {
@@ -50,6 +50,19 @@ export function selectYpDictByCode(code, serial) {
     })
 }
 
+/**
+ * 根据code(药品编码)查询药品账页信息
+ * @param {string} code 药品编码
+ * @returns
+ */
+export function selectYpDictByCodeNoSerial(code) {
+    return request({
+        url: '/ypDict/selectYpDictByCodeNoSerial',
+        method: 'get',
+        params: { code },
+    })
+}
+
 /**
  * 保存药品账页信息
  * @param data

+ 17 - 1
src/views/yp-dict/YpDictInfo.vue

@@ -100,6 +100,7 @@ import {Export} from '@/utils/ExportExcel'
 import {
   selectYpDict,
   selectYpDictByCode,
+  selectYpDictByCodeNoSerial,
   selectYpGroupNameByYfFlag,
   selectYpStorageInfo,
   updateYkYpStopOrUsed,
@@ -194,7 +195,22 @@ const closeYpEditAdd = () => {
 }
 
 // 编辑
-const editYpDict = (row) => {
+const zdList = ref([])
+const editYpDict = async (row) => {
+    await selectYpDictByCodeNoSerial(row.code).then((res) => {
+         zdList.value = res
+    })
+
+    if(row.serial === '01' && zdList.value.length > 1) {
+      ElMessage({
+        type: "warning",
+        message: "有大包装规格,请选择大包装规格进行编辑,会同步修改小包装规格的相对应信息!",
+        duration: 2500,
+        showClose: true,
+      });
+      return false
+    }
+
     selectYpDictByCode(row.code, row.serial).then((res) => {
         ypTitle.value = '编码:' + row.code + ' 序号:' + row.serial + ' 规格:' + row.specification + ' 名称:' + row.name + ' 账页信息'
         ypDetail.value = res