Browse Source

Merge branch 'master' into 'master'

新增门诊发药增加变更追溯码功能

See merge request lighter/vue-intergration-platform!169
huangshuhua 3 weeks ago
parent
commit
51b2d39f92

+ 9 - 0
src/api/yp-codg/yp-codg-match.js

@@ -62,4 +62,13 @@ export function selectMzDrugTracCodgData(data) {
         method: 'post',
         data
     })
+}
+
+// 发药后更新门诊处方药品追溯码匹配情况
+export function updateMzDrugCodgDataNew(data){
+    return request({
+        url: '/ypMatch/updateMzDrugCodgDataNew',
+        method: 'post',
+        data
+    })
 }

+ 6 - 3
src/views/yp-codg/YpCodgMatch.vue

@@ -62,10 +62,12 @@
                 <el-table-column prop="mdtrtId" label="就诊ID" width="120"/>
                 <el-table-column fixed="right" label="操作" min-width="180" width="180" header-align="center" align="center">
                   <template #default="scope">
-                    <el-button type="primary" size="small" @click="matchCodgForCf(scope.row)">配药
+                    <el-button type="primary" size="small" @click="matchCodgForCf(scope.row, 0)">配药
                     </el-button>
                     <el-button v-if="scope.row.confirmFlag !== 1 " type="danger" size="small" @click="deleteCodgForCf(scope.row)">删除配药
                     </el-button>
+                    <el-button v-if="scope.row.confirmFlag === 1 " type="danger" size="small" @click="matchCodgForCf(scope.row, 1)">变更配药
+                    </el-button>
                   </template>
                 </el-table-column>
               </el-table>
@@ -177,11 +179,12 @@ const queryMzChargePrescription = () => {
 // 处方匹配药品追溯码
 const showMzMatchCodg = ref(false)
 const ypMzCfData = ref({})
-const matchCodgForCf = (row) => {
+const matchCodgForCf = (row, flag) => {
   ypMzCfData.value = {
     ...row,
     patNo: row.patientId,
-    times: row.times
+    times: row.times,
+    flag: flag
   }
   showMzMatchCodg.value = true
 }

+ 39 - 16
src/views/yp-codg/YpMzCodgMatch.vue

@@ -12,6 +12,7 @@
       <el-button type="danger" icon="Remove" @click="drugBarRepeat" style="margin-left: 5px">去重</el-button>
       <el-button type="warning" icon="Filter" @click="matchCodgData" style="margin-left: 5px">匹配</el-button>
       <el-button type="success" icon="Select" @click="saveMatchCodgData" style="margin-left: 5px" v-if="confirmFlag !== 1">保存</el-button>
+      <el-button type="success" icon="Select" @click="saveMatchCodgData" style="margin-left: 5px" v-if="chargeFlag === 1">变更</el-button>
       <el-button type="danger" v-show="setlText" disabled :icon="Star"><span style="font-size: 14px">医保病人</span></el-button>
     </header>
     <div class="layout_display_flex_y">
@@ -39,11 +40,11 @@
         <el-row :gutter="5">
           <el-col :span="3">
             <el-divider content-position="left">追溯码采集信息</el-divider>
-            <el-input v-model="codgLine" type="textarea" rows="36"/>
+            <el-input v-model="codgLine" type="textarea" :rows="36"/>
           </el-col>
           <el-col :span="3">
             <el-divider content-position="left">追溯码检查信息</el-divider>
-            <el-input v-model="drugTracCodgAt" type="textarea" rows="36"/>
+            <el-input v-model="drugTracCodgAt" type="textarea" :rows="36"/>
           </el-col>
           <el-col :span="18">
             <el-divider content-position="left">追溯码匹配信息</el-divider>
@@ -82,7 +83,8 @@ import {
   selectMatchCodgInfo,
   selectMzCfDetail,
   selectMzDrugTracCodgData,
-  updateMzDrugCodgData
+  updateMzDrugCodgData,
+  updateMzDrugCodgDataNew
 } from "@/api/yp-codg/yp-codg-match.js";
 import {isEmpty} from "xe-utils";
 import {ElMessage, ElMessageBox} from "element-plus";
@@ -96,6 +98,8 @@ const codgTotal = ref(0)
 // 处方匹配的追溯码信息
 const codgInfo = ref([])
 const confirmFlag = ref(0)
+// 已经发药了,变更追溯码信息
+const chargeFlag = ref(0)
 const emit = defineEmits(['close', 'closeYpMzCodgMatch'])
 
 const props = defineProps({
@@ -108,6 +112,7 @@ onMounted( () => {
   nextTick(() => {
     mzCfData.value = props.ypMzCfData
     confirmFlag.value = props.ypMzCfData.confirmFlag
+    chargeFlag.value = props.ypMzCfData.flag
     setlText.value = props.ypMzCfData.setlId
     queryMzCfDetail()
     queryMzDrugCodgMatch()
@@ -116,6 +121,7 @@ onMounted( () => {
 watch(() => props.ypMzCfData, () => {
   mzCfData.value = props.ypMzCfData
   confirmFlag.value = props.ypMzCfData.confirmFlag
+  chargeFlag.value = props.ypMzCfData.flag
   setlText.value = props.ypMzCfData.setlId
 })
 
@@ -279,25 +285,42 @@ const saveMatchCodgData = () => {
     });
     return false
   }
-
-  ElMessageBox.confirm('确定保存药品匹配信息?', {
+  let tips = "确定保存药品匹配信息?"
+  if(chargeFlag.value === 1){
+    tips = "确定变更药品匹配信息?【友情提示:已经上传医保的追溯码,请取消上传再变更追溯码信息!】"
+  }
+  ElMessageBox.confirm(tips, {
     cancelButtonText: '取消',
     confirmButtonText: '确定',
     type: 'warning',
     distinguishCancelAndClose: true,
     dangerouslyUseHTMLString: true
   }).then(() => {
-    updateMzDrugCodgData(codgInfo.value).then((res) => {
-      if(res.code === 0){
-        ElMessage({
-          type: "success",
-          message: res.message,
-          duration: 2500,
-          showClose: true,
-        });
-        emit('closeYpMzCodgMatch', true)
-      }
-    })
+    if(chargeFlag.value === 1){
+      updateMzDrugCodgDataNew(codgInfo.value).then((res) => {
+        if(res.code === 0){
+          ElMessage({
+            type: "success",
+            message: res.message,
+            duration: 2500,
+            showClose: true,
+          });
+          emit('closeYpMzCodgMatch', true)
+        }
+      })
+    } else {
+      updateMzDrugCodgData(codgInfo.value).then((res) => {
+        if(res.code === 0){
+          ElMessage({
+            type: "success",
+            message: res.message,
+            duration: 2500,
+            showClose: true,
+          });
+          emit('closeYpMzCodgMatch', true)
+        }
+      })
+    }
   }).catch((action) => {
     if (action === 'cancel') {
       console.log("已取消。。。")