lighter 9 місяців тому
батько
коміт
a969862305

+ 18 - 2
src/api/medical-insurance/si-outpatient.js

@@ -152,13 +152,21 @@ export function rxPreCheck(data) {
   })
 }
 
-export function getRxForAuditing() {
+export function getRxIndex() {
   return request({
-    url: '/siMz/getRxForAuditing',
+    url: '/siMz/getRxIndex',
     method: 'get',
   })
 }
 
+export function getRxDetail(hospRxno) {
+  return request({
+    url: '/siMz/getRxDetail',
+    method: 'get',
+    params: { hospRxno },
+  })
+}
+
 export function rxSign(data) {
   return request({
     url: '/siMz/rxSign',
@@ -205,4 +213,12 @@ export function rxSetlQuery(data) {
     method: 'post',
     data,
   })
+}
+
+export function regRevoke(data) {
+  return request({
+    url: '/siMz/regRevoke',
+    method: 'post',
+    data,
+  })
 }

+ 121 - 19
src/views/medical-insurance/outpatient/DigitalRx.vue

@@ -6,19 +6,58 @@
         <el-button circle icon="Refresh" title="重新获取" @click="refreshRxList"></el-button>
       </div>
       <el-table :data="rxList" stripe highlight-current-row @row-click="handleClickRow">
-        <el-table-column prop="rxTraceCode" label="处方追溯码" width="150"></el-table-column>
         <el-table-column prop="patnName" label="患者姓名" width="90"></el-table-column>
-        <el-table-column prop="prscDrName" label="处方开具医师" width="100"></el-table-column>
+        <el-table-column prop="prscDrName" label="开具医师" width="90"></el-table-column>
+        <el-table-column prop="prscTime" label="开具时间" width="140"></el-table-column>
+        <el-table-column label="处方状态" width="100">
+          <template #default="{row}">
+            {{ filterRxState(row.state) }}
+          </template>
+        </el-table-column>
       </el-table>
     </aside>
     <div class="layout_main layout_container">
       <header class="round-header">
-        <el-button type="primary" @click="doRxSign">处方签名</el-button>
-        <el-button type="primary" @click="doRxUpload">处方上传</el-button>
-        <el-button type="primary" @click="doRxInfoQuery">处方信息查询</el-button>
-        <el-button type="primary" @click="doRxAuditingQuery">处方审核查询</el-button>
-        <el-button type="primary" @click="doRxSettleQuery">处方结算查询</el-button>
-        <el-button type="danger" @click="doRxRevoke">撤销处方上传</el-button>
+        <el-button
+            type="primary"
+            @click="doPreCheck"
+            :disabled="currentRow.state !== 'NEW_RECEIPT'"
+        >处方预核验</el-button>
+        <el-button
+            type="primary"
+            @click="doRxSign"
+            :disabled="currentRow.state !== 'PRE_CHECKED'"
+        >处方签名</el-button>
+        <el-button
+            type="primary"
+            @click="doRxUpload"
+            :disabled="currentRow.state !== 'SIGNED'"
+        >处方上传</el-button>
+        <el-button
+            type="primary"
+            @click="doRxInfoQuery"
+            :disabled="currentRow.state !== 'UPLOADED'"
+        >处方信息查询</el-button>
+        <el-button
+            type="primary"
+            @click="doRxAuditingQuery"
+            :disabled="currentRow.state !== 'UPLOADED'"
+        >处方审核查询</el-button>
+        <el-button
+            type="primary"
+            @click="doRxSettleQuery"
+            :disabled="currentRow.state !== 'UPLOADED'"
+        >处方结算查询</el-button>
+        <el-button
+            type="danger"
+            @click="doRxRevoke"
+            :disabled="currentRow.state !== 'UPLOADED'"
+        >撤销处方上传</el-button>
+        <el-button
+            type="danger"
+            @click="doRegRevoke"
+            :disabled="currentRow.state !== 'NEW_RECEIPT'"
+        >撤销医保登记(限门诊)</el-button>
       </header>
       <div class="layout_main">
         <iframe class="layout_full_iframe" :src="pdfSrc" />
@@ -90,8 +129,17 @@
 
 <script setup>
 
-import {getRxForAuditing, rxInfoQuery, rxRevoke, rxSign, rxUpload} from "@/api/medical-insurance/si-outpatient";
+import {
+  getRxIndex,
+  getRxDetail,
+  rxAuditingQuery,
+  rxInfoQuery,
+  rxRevoke,
+  rxSign,
+  rxUpload, rxPreCheck, rxSetlQuery, regRevoke
+} from "@/api/medical-insurance/si-outpatient";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
+import {ElMessageBox} from "element-plus";
 
 const rxList = ref([])
 
@@ -103,9 +151,28 @@ const rxFromQuery = ref({
   rxDetlList: []
 })
 
+function filterRxState(state) {
+  switch (state) {
+    case 'NEW_RECEIPT':
+      return '待预核验'
+    case 'PRE_CHECKED':
+      return '待签名';
+    case 'SIGNED':
+      return '待上传';
+    case 'UPLOADED':
+      return '已上传';
+    case 'REVOKED':
+      return '已撤销';
+    case 'SETTLED':
+      return '已取药';
+  }
+}
+
 function handleClickRow(row) {
   currentRow.value = row
-  showPDF('data:application/pdf;base64,' + row.rxFile)
+  getRxDetail(row.hospRxno).then(res => {
+    showPDF('data:application/pdf;base64,' + res)
+  })
 }
 
 function showPDF(base64) {
@@ -125,28 +192,37 @@ function base64ToBlob(base64) {
   return new Blob([uInt8Array], {type: contentType});
 }
 
+function doPreCheck() {
+  rxPreCheck({
+    hospRxno: currentRow.value.hospRxno,
+  }).then(res => {
+    currentRow.value.state = 'PRE_CHECKED'
+    xcMessage.success('预核验成功。')
+    currentRow.value.state = 'PRE_CHECKED'
+  })
+}
+
 function doRxSign() {
   rxSign({
-    patientId: currentRow.value.patientId,
-    times: currentRow.value.times
+    hospRxno: currentRow.value.hospRxno,
   }).then(res => {
     xcMessage.success('签名成功。')
+    currentRow.value.state = 'SIGNED'
   })
 }
 
 function doRxUpload() {
   rxUpload({
-    patientId: currentRow.value.patientId,
-    times: currentRow.value.times
+    hospRxno: currentRow.value.hospRxno,
   }).then(res => {
     xcMessage.success('上传成功。')
+    currentRow.value.state = 'UPLOADED'
   })
 }
 
 function doRxInfoQuery() {
   rxInfoQuery({
-    patientId: currentRow.value.patientId,
-    times: currentRow.value.times
+    hospRxno: currentRow.value.hospRxno,
   }).then(res => {
     rxFromQuery.value = res
     showRemoteRx.value = true
@@ -154,22 +230,48 @@ function doRxInfoQuery() {
 }
 
 function doRxAuditingQuery() {
+  rxAuditingQuery({
+    hospRxno: currentRow.value.hospRxno,
+  }).then(res => {
+    const message = `处方状态:${res.rxStasName};<br/>处方审核状态:${res.rxChkStasName}。`
+    ElMessageBox.alert(message, '查询成功', {
+      type: 'success',
+      dangerouslyUseHTMLString: true,
+    })
+  })
 }
 
 function doRxSettleQuery() {
+  rxSetlQuery({
+    hospRxno: currentRow.value.hospRxno,
+  }).then(res => {
+    const message = `处方状态:${res.rxStasName};<br/>处方使用状态:${res.rxUsedStasName}。`
+    ElMessageBox.alert(message, '查询成功', {
+      type: 'success',
+      dangerouslyUseHTMLString: true,
+    })
+  })
 }
 
 function doRxRevoke() {
   rxRevoke({
-    patientId: currentRow.value.patientId,
-    times: currentRow.value.times
+    hospRxno: currentRow.value.hospRxno,
   }).then(res => {
     xcMessage.success("处方撤销成功。")
+    currentRow.value.state = 'REVOKED'
+  })
+}
+
+function doRegRevoke() {
+  regRevoke({
+    hospRxno: currentRow.value.hospRxno,
+  }).then(res => {
+    xcMessage.success(res)
   })
 }
 
 function refreshRxList() {
-  getRxForAuditing().then(res => {
+  getRxIndex().then(res => {
     rxList.value = res
   })
 }

+ 1 - 13
src/views/medical-insurance/outpatient/MzRegister.vue

@@ -67,7 +67,6 @@
             <el-dropdown-item icon="Upload" command="upload">医保处方上传</el-dropdown-item>
             <el-dropdown-item icon="RefreshLeft" command="retract">撤销处方上传</el-dropdown-item>
             <el-dropdown-item divided icon="Edit" command="diags">医保诊断补录</el-dropdown-item>
-            <el-dropdown-item divided icon="Document" command="rxPrecheck">电子处方预核验</el-dropdown-item>
           </el-dropdown-menu>
         </template>
       </el-dropdown>
@@ -260,7 +259,7 @@ import {
   revokeOutpatientRegistration,
   uploadOutpatientFeeDetails,
   outpatientSettlement,
-  revokeOutpatientSettlement, rxPreCheck,
+  revokeOutpatientSettlement,
 } from '@/api/medical-insurance/si-outpatient'
 import {ElMessageBox, ElSelect} from 'element-plus'
 import {
@@ -522,17 +521,6 @@ const receiptsOpts = (command) => {
     case 'diags':
       showInputDiags.value = true
       break
-    case 'rxPrecheck':
-      if (injuryMode.value) {
-        xcMessage.danger('工伤患者无法上传电子医保处方。')
-      } else {
-        rxPreCheck({
-          patientId: patientId.value,
-          times: times.value
-        }).then(res => {
-          xcMessage.success('医保电子处方预核验成功。')
-        })
-      }
   }
 }