فهرست منبع

Merge branch 'master' into 'master'

新增口服药退药设置功能

See merge request lighter/vue-intergration-platform!132
huangshuhua 9 ماه پیش
والد
کامیت
9c8263297f
2فایلهای تغییر یافته به همراه61 افزوده شده و 2 حذف شده
  1. 12 0
      src/api/yp-dict/yp-dict-info.js
  2. 49 2
      src/views/yp-dict/YpDictInfo.vue

+ 12 - 0
src/api/yp-dict/yp-dict-info.js

@@ -166,4 +166,16 @@ export function updateYpFocusMonitor(code, serial, flag) {
         method: 'get',
         params: { code, serial, flag },
     })
+}
+
+/**
+ * 更新口服药品是否允许退药标志(1:允许退药)
+ * @returns
+ */
+export function updateYpReturnFlag(code, serial, flag) {
+    return request({
+        url: '/ypDict/updateYpReturnFlag',
+        method: 'get',
+        params: { code, serial, flag },
+    })
 }

+ 49 - 2
src/views/yp-dict/YpDictInfo.vue

@@ -43,7 +43,7 @@
           </el-table-column>
           <el-table-column prop="pyCode" label="拼音码" width="150" />
           <el-table-column prop="dCode" label="五笔码" width="150" />
-          <el-table-column fixed="right" label="操作" min-width="625" width="625" center>
+          <el-table-column fixed="right" label="操作" min-width="710" width="710" center>
             <template #default="scope">
               <el-button type="primary" size="small" v-if="!scope.row.isEdit"
                          @click="editYpDict(scope.row)">编辑</el-button>
@@ -69,6 +69,8 @@
                 <span v-if="scope.row.ykFlag === '1'">药库启用</span>
                 <span v-else>药库停用</span>
               </el-button>
+              <el-button :type="scope.row.returnFlag === '1' ? 'primary' : 'info'" size="small" v-show="scope.row.categoriesFlag === '0'"
+                         v-if="!scope.row.isEdit" @click="kfReturnDrug(scope.row)">口服退药</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -106,7 +108,8 @@ import {
   updateYpTempPurchase,
   updateYpHighWarning,
   updateYpWinningBidder,
-  updateYpFocusMonitor
+  updateYpFocusMonitor,
+  updateYpReturnFlag
 } from '@/api/yp-dict/yp-dict-info.js'
 import YpZdDict from '@/views/yp-dict/YpZdDict.vue'
 import YpPrintName from '@/views/yp-dict/YpPrintName.vue'
@@ -501,6 +504,50 @@ const focusMonitorDrug = (row) => {
     }
   })
 }
+// 口服药能否退药标志kfReturnKDrug
+const kfReturnDrug = (row) => {
+  if('0' !== row.categoriesFlag){
+    ElMessage({
+      type: "error",
+      message: '非口服药不能设置口服药退药标志',
+      duration: 2500,
+      showClose: true,
+    });
+    return
+  }
+
+  let flag
+  let title
+  if ('1' === row.returnFlag) {
+    flag = ''
+    title = '请确认是否取消药品<span style="color:#d12020;">' + row.name + '</span>允许退药?'
+  } else {
+    flag = '1'
+    title = '请确认是否将药品<span style="color:#d12020;">' + row.name + '</span>设置成允许退药?'
+  }
+
+  ElMessageBox.confirm(title, {
+    cancelButtonText: '取消',
+    confirmButtonText: '确定',
+    type: 'warning',
+    distinguishCancelAndClose: true,
+    dangerouslyUseHTMLString: true
+  }).then(() => {
+    updateYpReturnFlag(row.code, row.serial, flag).then((res) => {
+      ElMessage({
+        type: "success",
+        message: res.cg,
+        duration: 2500,
+        showClose: true,
+      });
+      queryYpDict()
+    })
+  }).catch((action) => {
+    if (action === 'cancel') {
+      queryYpDict()
+    }
+  })
+}
 
 // 导出药品账页信息
 const exportData = () => {