Kaynağa Gözat

优化耗材匹配

lighter 3 yıl önce
ebeveyn
işleme
bd4668a1ac
1 değiştirilmiş dosya ile 65 ekleme ve 20 silme
  1. 65 20
      src/views/dictionary/NationalSiMatch.vue

+ 65 - 20
src/views/dictionary/NationalSiMatch.vue

@@ -75,6 +75,32 @@
         @current-change="handleCurrentChange"
       ></el-pagination>
     </el-main>
+
+    <el-dialog
+        title="耗材查询"
+        v-model="showSuppliesQueryForm"
+        width="420px">
+      <div style="background: lightblue; color:black; padding: 4px; border-radius: 4px">
+        小提示:每次查询只需填写一项条件。如果填写了多项,程序也只会根据优先级最高的一项来查询。
+        <div style="margin-top: 8px">
+          优先级:国家编码 > 注册证号 > 耗材名称
+        </div>
+      </div>
+      <div style="width: 300px;margin-top: 16px">
+        国家编码:<el-input v-model="currentSupplyRow.nationalCode" placeholder="耗材国家编码 - 精准查询" clearable style="width: 200px"></el-input>
+      </div>
+      <div style="width: 300px;margin-top: 8px">
+        注册证号:<el-input v-model="currentSupplyRow.approvalNumber" placeholder="耗材注册证号 - 精准查询" clearable style="width: 200px"></el-input>
+      </div>
+      <div style="width: 300px;margin-top: 8px">
+        耗材名称:<el-input v-model="currentSupplyRow.fuzzyName" placeholder="耗材名称 - 模糊查询" clearable style="width: 200px"></el-input>
+      </div>
+      <template #footer>
+        <el-button type="info" icon="Close" @click="showSuppliesQueryForm = false">取消</el-button>
+        <el-button type="primary" icon="Search" @click="getNationalItems">查询</el-button>
+      </template>
+    </el-dialog>
+
     <el-dialog v-model="showNationalList" top="5vh" width="80%">
       <div class="data-title">HIS数据</div>
       <el-descriptions :column="4" border>
@@ -88,7 +114,7 @@
         </el-descriptions-item>
         <el-descriptions-item v-if="queryParam.type !== 3">
           <template #label> 大小包装</template>
-          {{ data.row.serial }}
+          {{ data.row.serial === '01' ? '大包装' : '小包装' }}
         </el-descriptions-item>
         <el-descriptions-item v-if="queryParam.type !== 3">
           <template #label> 剂型</template>
@@ -155,9 +181,14 @@
         <el-table-column v-if="queryParam.type === 4" label="耗材企业" prop="factory"></el-table-column>
         <el-table-column label="开始时间" prop="startTime"></el-table-column>
         <el-table-column label="结束时间" prop="endTime"></el-table-column>
+        <el-table-column label="状态">
+          <template #default="scope">
+            <div v-html="filterMatchedCount(scope.row.matchedCount)"></div>
+          </template>
+        </el-table-column>
         <el-table-column label="匹配">
           <template #default="scope">
-            <el-button circle icon="Thumb" type="success" @click="doMatch(scope.row)"></el-button>
+            <el-button circle icon="Pointer" type="success" @click="doMatch(scope.row)"></el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -223,6 +254,7 @@ import { computed } from '@vue/runtime-core'
 import { cptYesOrNo } from '@/utils/computed'
 import { revokeCatalogueContrast, uploadCatalogueContrast } from '@/api/medical-insurance/si-manage'
 import { Export } from '@/utils/ExportExcel'
+import { clone } from '@/utils/clone'
 
 const windowSize = store.state.app.windowSize
 const tableHeight = windowSize.h - 85
@@ -283,11 +315,7 @@ const queryParam = reactive({
 const queryTypeChanged = (val) => {
   data.list = []
   data.national = []
-  if (val === 4) {
-    fuzzy.value = true
-  } else {
-    fuzzy.value = false
-  }
+  fuzzy.value = val === 4;
 }
 
 const search = () => {
@@ -353,31 +381,44 @@ const confirmModify = () => {
 }
 
 const showNationalList = ref(false)
+const showSuppliesQueryForm = ref(false)
+const currentSupplyRow = ref({})
+
 const beforeMatch = (row) => {
-  if (fuzzy.value) {
-    ElMessageBox.prompt('请调整关联查询的名称:', '提示', {
-      inputValue: row.name,
-      confirmButtonText: '查询',
-      cancelButtonText: '取消',
-    })
-      .then(({ value }) => {
-        row.fuzzyName = value
-        getNationalItems(row)
-      })
-      .catch(() => {})
+  if(queryParam.type === 4) {
+    currentSupplyRow.value = clone(row)
+    currentSupplyRow.value.fuzzyName = null
+    showSuppliesQueryForm.value = true
   } else {
-    row.fuzzyName = row.name
-    getNationalItems(row)
+    if (fuzzy.value) {
+      ElMessageBox.prompt('请调整关联查询的名称:', '提示', {
+        inputValue: row.name,
+        confirmButtonText: '查询',
+        cancelButtonText: '取消',
+      })
+          .then(({ value }) => {
+            row.fuzzyName = value
+            getNationalItems(row)
+          })
+          .catch(() => {})
+    } else {
+      row.fuzzyName = row.name
+      getNationalItems(row)
+    }
   }
 }
 
 const getNationalItems = (row) => {
+  if (queryParam.type === 4) {
+    row = currentSupplyRow.value
+  }
   selectNationalItems(row)
     .then((res) => {
       factory.value = ''
       data.row = row
       data.national = res
       showNationalList.value = true
+      showSuppliesQueryForm.value = false
     })
     .catch((e) => {
       if (e === '没有符合条件的国家目录。') {
@@ -406,6 +447,10 @@ const getNationalItems = (row) => {
     })
 }
 
+const filterMatchedCount = (count) => {
+  return count > 0 ? '<span style="color: red">已被匹配</span>' : '<span style="color: green">未被匹配</span>'
+}
+
 const doMatch = (row) => {
   const header =
     '<div style="font-weight: bold">选中的数据为:</div><div style="color: #409EFF">' +