Parcourir la source

艾迪康报告抽取到体检数据库

lighter il y a 1 an
Parent
commit
be568d6a8d

+ 71 - 0
src/api/inspections/adicon.js

@@ -0,0 +1,71 @@
+import request from '../../utils/request'
+
+export function adiconLogin() {
+    return request({
+        url: '/adicon/login',
+        method: 'get',
+    })
+}
+
+export function getReportList(data) {
+    return request({
+        url: '/adicon/getReportList',
+        method: 'post',
+        data
+    })
+}
+
+export function getReportItems(data) {
+    return request({
+        url: '/adicon/getReportItems',
+        method: 'post',
+        data
+    })
+}
+
+export function setSampleDown(data) {
+    return request({
+        url: '/adicon/setSampleDown',
+        method: 'post',
+        data
+    })
+}
+
+export function getByteReport(data) {
+    return request({
+        url: '/adicon/getByteReport',
+        method: 'post',
+        data
+    })
+}
+
+export function getUnMatchedList(data) {
+    return request({
+        url: '/adicon/getUnMatchedList',
+        method: 'post',
+        data
+    })
+}
+
+export function getZdItems() {
+    return request({
+        url: '/adicon/getZdItems',
+        method: 'get',
+    })
+}
+
+export function executeMatch(data) {
+    return request({
+        url: '/adicon/executeMatch',
+        method: 'post',
+        data
+    })
+}
+
+export function saveToTjResult(data) {
+    return request({
+        url: '/adicon/saveToTjResult',
+        method: 'post',
+        data
+    })
+}

+ 0 - 39
src/api/inspections/index.js

@@ -32,45 +32,6 @@ export function checkTestDetail(data) {
   })
 }
 
-export function adiconLogin() {
-  return request({
-    url: '/adicon/login',
-    method: 'get',
-  })
-}
-
-export function getReportList(data) {
-  return request({
-    url: '/adicon/getReportList',
-    method: 'post',
-    data
-  })
-}
-
-export function getReportItems(data) {
-  return request({
-    url: '/adicon/getReportItems',
-    method: 'post',
-    data
-  })
-}
-
-export function setSampleDown(data) {
-  return request({
-    url: '/adicon/setSampleDown',
-    method: 'post',
-    data
-  })
-}
-
-export function getByteReport(data) {
-  return request({
-    url: '/adicon/getByteReport',
-    method: 'post',
-    data
-  })
-}
-
 export function fetchCovidExamData(data) {
   return request({
     url: '/covidExamReport/queryResult',

+ 57 - 14
src/views/examination/AdiconQuery.vue

@@ -18,6 +18,7 @@
       ></el-input>
       <el-divider direction="vertical" />
       <el-button icon="Search" type="primary" @click="queryList">查询</el-button>
+      <el-button icon="Upload" type="primary" @click="beforeExtract">提取到体检</el-button>
     </header>
     <div class="layout_main layout_container layout-horizontal">
       <aside class="layout_el-table">
@@ -42,11 +43,19 @@
       </div>
     </div>
   </div>
+
+<!--  <div style="position:absolute; top:0; left: 0;right: 0;bottom: 0;background-color: white;z-index: 999">-->
+<!--    <AdiconItemMatch />-->
+<!--  </div>-->
+
 </template>
 
 <script setup>
 import useDateRange from "@/utils/cy-use/useDateRange";
-import {getByteReport, getReportList} from "@/api/inspections";
+import {getByteReport, getReportItems, getReportList, getUnMatchedList, saveToTjResult} from "@/api/inspections/adicon";
+import AdiconItemMatch from "@/views/examination/component/AdiconItemMatch.vue";
+import useDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
+import {xcMessage} from "@/utils/xiaochan-element-plus";
 
 const {CyDateRange, dateRange} = useDateRange({aFewDaysAgo: 3, clearable: false})
 
@@ -87,20 +96,9 @@ function queryList() {
 }
 
 const pdfSrc = ref('')
+const currentRow = ref({})
 function handleClickRow(row) {
-  // let barcode = row.customerBarcode
-  // inquiry.barcodeType = 'CUSTOMER'
-  // if (!barcode || barcode.length < 5) {
-  //   barcode = row.adiconBarcode
-  //   inquiry.barcodeType = 'ADICON'
-  // }
-  // inquiry.barcode = barcode
-  // inquiry.reportType = row.reportType
-  // inquiry.key = key.value
-  // getReportItems(inquiry).then(res => {
-  //   console.log(res)
-  // })
-
+  currentRow.value = row
   inquiry.key = key.value
   inquiry.id = row.id
   getByteReport(inquiry).then(res => {
@@ -129,6 +127,51 @@ function filterReportTime(time) {
   return time.split('.')[0].replace('T', ' ')
 }
 
+const reportList = ref([])
+function beforeExtract() {
+  let barcode = currentRow.value.customerBarcode
+  inquiry.barcodeType = 'CUSTOMER'
+  if (!barcode || barcode.length < 5) {
+    barcode = currentRow.value.adiconBarcode
+    inquiry.barcodeType = 'ADICON'
+  }
+  inquiry.barcode = barcode
+  inquiry.reportType = currentRow.value.reportType
+  inquiry.key = key.value
+  getReportItems(inquiry).then(res => {
+    reportList.value = res
+    checkMatchState(res)
+  })
+}
+
+function checkMatchState(list) {
+  console.log(list)
+  const params = []
+  list.forEach(item => {
+    params.push({ itemCode: item.itemCode, itemName: item.itemNameCN})
+  })
+  params.push({itemCode: '000', itemName:'肝脏脂肪衰减值'})
+  getUnMatchedList(params).then(res => {
+    if (res.length === 0) {
+      extractDataToTj()
+    } else {
+      useDialogToJs(AdiconItemMatch, {
+        rawItems: res
+      }).then(() => {
+        extractDataToTj()
+      }).catch(() => {
+        console.log('adicon match canceled.')
+      })
+    }
+  })
+}
+
+function extractDataToTj() {
+  saveToTjResult(reportList.value).then(res => {
+    xcMessage.success(res)
+  })
+}
+
 onMounted(() => {
   // adiconLogin().then(res => {
   //   jyKey.value = res.jyKey

+ 228 - 0
src/views/examination/component/AdiconItemMatch.vue

@@ -0,0 +1,228 @@
+<template>
+  <CyDialog
+      title="艾迪康检验项目匹配"
+      body-width="900px"
+      body-height="600px"
+      cancel-text="关闭"
+      confirm-text="执行匹配"
+      :confirm-click="handleClickConfirm"
+  >
+    <div class="layout_container layout-horizontal adicon-item-match">
+      <div class="layout_flex_1-x layout_container layout_el-table">
+        <el-table
+            size="large"
+            :data="checkItems"
+            highlight-current-row
+            @row-click="handleLeftRowClick"
+        >
+          <el-table-column prop="itemCode" label="项目编码" width="100"></el-table-column>
+          <el-table-column label="项目名称">
+            <template #default="{row}">
+              <span class="m-r_8px">
+                {{row.itemName}}
+              </span>
+              <el-icon v-if="row.matchCode" color="green">
+                <Check />
+              </el-icon>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <div class="match-area-box">
+        <div>
+          <div>
+            <el-tag type="success" effect="plain" class="m-b_8px">当前待匹配项目</el-tag>
+          </div>
+          <div class="green-text bold-text">
+            <div class="m-b_8px">
+              {{ currentRow.itemCode }}
+            </div>
+            <div>
+              {{ currentRow.itemName }}
+            </div>
+          </div>
+          <el-divider class="el-divider_shorter"></el-divider>
+          <div>
+            <el-tag type="primary" effect="plain" class="m-b_8px">当前已选择项目</el-tag>
+          </div>
+          <div class="blue-text bold-text">
+            <div class="m-b_8px">
+              {{ currentRow.matchCode }}
+            </div>
+            <div>
+              {{ currentRow.matchName }}
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="layout_flex_1-x layout_container">
+        <el-input
+            size="large"
+            prefix-icon="Search"
+            v-model="matchItemInput"
+            placeholder="输入 编码/名称 进行检索"
+            clearable
+        ></el-input>
+        <div class="layout_main layout_el-table">
+          <el-auto-resizer>
+            <template #default="{height,width}">
+              <el-table-v2
+                  size="large"
+                  :data="cptZdItems"
+                  :columns="columns"
+                  :width="width"
+                  :height="height"
+                  :row-event-handlers="tableV2RowEvent"
+              >
+                <template v-if="disableRightTable" #overlay>
+                  <div class="loading-mask">
+                    <span>
+                      请先从左侧列表选择待匹配项目
+                    </span>
+                  </div>
+                </template>
+              </el-table-v2>
+            </template>
+          </el-auto-resizer>
+        </div>
+      </div>
+    </div>
+  </CyDialog>
+</template>
+
+<script setup>
+import CyDialog from "@/components/cy/dialog/src/CyDialog.vue";
+import {executeMatch, getZdItems} from "@/api/inspections/adicon";
+import {xcMessage} from "@/utils/xiaochan-element-plus";
+import {clone} from "xe-utils";
+import {Check} from "@element-plus/icons-vue";
+
+const props = defineProps({
+  rawItems: {
+    type: Array,
+    required: true
+  }
+})
+
+const checkItems = ref(clone(props.rawItems))
+
+const currentRow = ref({})
+function handleLeftRowClick(row) {
+  currentRow.value = row
+}
+
+const disableRightTable = computed(() => {
+  return currentRow.value.itemCode === null
+      || currentRow.value.itemCode === undefined
+      || currentRow.value.itemCode === ''
+})
+
+const allZdItems = ref([])
+const matchItemInput = ref('')
+
+const cptZdItems = computed(() => {
+  return allZdItems.value.filter(item => {
+    return item.itemName.indexOf(matchItemInput.value) !== -1
+    || item.itemCode.indexOf(matchItemInput.value) !== -1
+  })
+})
+
+function handleRightRowClick(row) {
+  currentRow.value.matchCode = row.itemCode
+  currentRow.value.matchName = row.itemName
+}
+
+const tableV2RowEvent = {
+  'onClick': (row) => {
+    handleRightRowClick(row.rowData)
+  }
+}
+
+
+function handleClickConfirm(next) {
+  // todo 执行匹配,并判断是否有没匹配的项目
+  executeMatch(checkItems.value).then(res => {
+    if (res.length === 0) {
+      next()
+    } else {
+      xcMessage.error('有未匹配的项目')
+      checkItems.value = res
+    }
+  })
+}
+
+const columns = [
+  {
+    key: 'itemCode',
+    dataKey: 'itemCode',
+    title: '项目编码',
+    width: 100,
+    color: 'black'
+  }, {
+    key: 'itemName',
+    dataKey: 'itemName',
+    title: '项目名称',
+  }
+]
+
+onMounted(() => {
+  getZdItems().then(res => {
+    allZdItems.value = res
+  })
+})
+</script>
+
+<style lang="scss">
+.adicon-item-match {
+  .loading-mask {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    top: 0;
+    background-color: rgba(0, 0, 0, .7);
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    > span {
+      color: #349aff;
+      font-size: 16px;
+      font-weight: bold;
+      border-radius: 4px;
+      padding: 8px 12px;
+      background-color: #303030;
+    }
+  }
+  .match-area-box {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 200px;
+    background-color: #f3faff;
+
+    > div {
+      margin-top: -100px;
+
+      > div {
+        text-align: center;
+        padding: 4px;
+        font-size: 14px;
+      }
+    }
+  }
+
+  .green-text {
+    color: green;
+  }
+
+  .blue-text {
+    color: blue;
+  }
+
+  .bold-text {
+    font-weight: bold;
+  }
+}
+</style>