Browse Source

在院查询患者的信息

xiaochan 3 năm trước cách đây
mục cha
commit
6860a929d3

+ 112 - 104
src/api/medical-insurance/si-query.js

@@ -1,168 +1,176 @@
 import request from '../../utils/request'
 
 export function getSiPatInfo(data) {
-  return request({
-    url: '/siQuery/getSiPatInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/getSiPatInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function obtainBasicPersonInfo(data) {
-  return request({
-    url: '/siQuery/obtainBasicPersonInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/obtainBasicPersonInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function obtainMedicalInstitutionInfo(type, fuzzyName) {
-  return request({
-    url: '/siQuery/obtainMedicalInstitutionInfo',
-    method: 'get',
-    params: { type, fuzzyName },
-  })
+    return request({
+        url: '/siQuery/obtainMedicalInstitutionInfo',
+        method: 'get',
+        params: {type, fuzzyName},
+    })
 }
 
 export function queryVisitInfo(data) {
-  return request({
-    url: '/siQuery/queryVisitInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/queryVisitInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function queryInHospitalPatientsInfo(data) {
-  return request({
-    url: '/siQuery/queryInHospitalPatientsInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/queryInHospitalPatientsInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function queryPersonnelCumulativeInfo(data) {
-  return request({
-    url: '/siQuery/queryPersonnelCumulativeInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/queryPersonnelCumulativeInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function queryPersonnelTransferHospitalInfo(data) {
-  return request({
-    url: '/siQuery/queryPersonnelTransferHospitalInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/queryPersonnelTransferHospitalInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function querySpecialChronicDiseasesAccreditation(data) {
-  return request({
-    url: '/siQuery/querySpecialChronicDiseasesAccreditation',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/querySpecialChronicDiseasesAccreditation',
+        method: 'post',
+        data,
+    })
 }
 
 export function queryMzMatnDises() {
-  return request({
-    url: '/siQuery/queryMzMatnDises',
-    method: 'get',
-  })
+    return request({
+        url: '/siQuery/queryMzMatnDises',
+        method: 'get',
+    })
 }
 
 export function querySpecialChronicDiseasesMedicalRecord(data) {
-  return request({
-    url: '/siQuery/querySpecialChronicDiseasesMedicalRecord',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/querySpecialChronicDiseasesMedicalRecord',
+        method: 'post',
+        data,
+    })
 }
 
 export function queryDiagnosisInfo(data) {
-  return request({
-    url: '/siQuery/queryDiagnosisInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/queryDiagnosisInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function querySettlementInfo(data) {
-  return request({
-    url: '/siQuery/querySettlementInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/querySettlementInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function queryFeeDetails(data) {
-  return request({
-    url: '/siQuery/queryFeeDetails',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/queryFeeDetails',
+        method: 'post',
+        data,
+    })
 }
 
 export function queryInsuplcAdmdvsByMdtrtId(mdtrtId) {
-  return request({
-    url: '/siQuery/queryInsuplcAdmdvsByMdtrtId',
-    method: 'get',
-    params: { mdtrtId },
-  })
+    return request({
+        url: '/siQuery/queryInsuplcAdmdvsByMdtrtId',
+        method: 'get',
+        params: {mdtrtId},
+    })
 }
 
 export function checkPersonTreatment(data) {
-  return request({
-    url: '/siQuery/checkPersonTreatment',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/checkPersonTreatment',
+        method: 'post',
+        data,
+    })
 }
 
 export function queryPersonnelAssignmentInfo(data) {
-  return request({
-    url: '/siQuery/queryPersonnelAssignmentInfo',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/queryPersonnelAssignmentInfo',
+        method: 'post',
+        data,
+    })
 }
 
 export function querySiSetlIndex(data) {
-  return request({
-    url: '/siQuery/querySiSetlIndex',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/querySiSetlIndex',
+        method: 'post',
+        data,
+    })
 }
 
 export function querySiSetlList(data) {
-  return request({
-    url: '/siQuery/querySiSetlList',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/querySiSetlList',
+        method: 'post',
+        data,
+    })
 }
 
 export function fetchSiTimesList(patNo) {
-  return request({
-    url: '/siQuery/fetchSiTimesList',
-    method: 'get',
-    params: { patNo },
-  })
+    return request({
+        url: '/siQuery/fetchSiTimesList',
+        method: 'get',
+        params: {patNo},
+    })
 }
 
 export function selectSetlinfoStatistics(data) {
-  return request({
-    url: '/siQuery/selectSetlinfoStatistics',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/selectSetlinfoStatistics',
+        method: 'post',
+        data,
+    })
 }
 
 export function selectSetldetailStatistics(data) {
-  return request({
-    url: '/siQuery/selectSetldetailStatistics',
-    method: 'post',
-    data,
-  })
+    return request({
+        url: '/siQuery/selectSetldetailStatistics',
+        method: 'post',
+        data,
+    })
+}
+
+export function weiJieSuanZaiYuanHuanZhe(patNo, startTime, endTime, name, certno) {
+    return request({
+        url: '/siQuery/weiJieSuanZaiYuanHuanZhe',
+        method: 'get',
+        params: {patNo, startTime, endTime, name, certno},
+    })
 }

+ 51 - 18
src/utils/ExportExcel.js

@@ -1,6 +1,8 @@
 import fs from 'file-saver'
 import XLSX from 'xlsx'
 import {clone} from "./clone";
+import {ElMessageBox} from "element-plus";
+import {stringIsBlank, stringNotBlank} from "./blank-utils";
 
 export function Export(json, fields, filename) {
     const temp = clone(json)
@@ -12,24 +14,55 @@ export function Export(json, fields, filename) {
             delete item[i]; //删除原先的对象属性
         }
     })
-
-    let sheetName = filename //excel的文件名称
-    let wb = XLSX.utils.book_new()  //工作簿对象包含一SheetNames数组,以及一个表对象映射表名称到表对象。XLSX.utils.book_new实用函数创建一个新的工作簿对象。
-    let ws = XLSX.utils.json_to_sheet(temp, {header: Object.values(fields)}) //将JS对象数组转换为工作表。
-    wb.SheetNames.push(sheetName)
-    wb.Sheets[sheetName] = ws
-    const defaultCellStyle = {font: {name: "Verdana", sz: 13, color: "FF00FF88"}, fill: {fgColor: {rgb: "FFFFAA00"}}};//设置表格的样式
-    let wopts = {
-        bookType: 'xlsx',
-        bookSST: false,
-        type: 'binary',
-        cellStyles: true,
-        defaultCellStyle: defaultCellStyle,
-        showGridLines: false
-    }  //写入的样式
-    let wbout = XLSX.write(wb, wopts)
-    let blob = new Blob([s2ab(wbout)], {type: 'application/octet-stream'})
-    fs.saveAs(blob, filename + '.xlsx')
+    if (stringNotBlank(filename)) {
+        let sheetName = filename //excel的文件名称
+        let wb = XLSX.utils.book_new()  //工作簿对象包含一SheetNames数组,以及一个表对象映射表名称到表对象。XLSX.utils.book_new实用函数创建一个新的工作簿对象。
+        let ws = XLSX.utils.json_to_sheet(temp, {header: Object.values(fields)}) //将JS对象数组转换为工作表。
+        wb.SheetNames.push(sheetName)
+        wb.Sheets[sheetName] = ws
+        const defaultCellStyle = {
+            font: {name: "Verdana", sz: 13, color: "FF00FF88"},
+            fill: {fgColor: {rgb: "FFFFAA00"}}
+        };//设置表格的样式
+        let wopts = {
+            bookType: 'xlsx',
+            bookSST: false,
+            type: 'binary',
+            cellStyles: true,
+            defaultCellStyle: defaultCellStyle,
+            showGridLines: false
+        }  //写入的样式
+        let wbout = XLSX.write(wb, wopts)
+        let blob = new Blob([s2ab(wbout)], {type: 'application/octet-stream'})
+        fs.saveAs(blob, filename + '.xlsx')
+    } else {
+        ElMessageBox.prompt('请输入导出的文件名称', '提示', {
+            type: 'warning'
+        }).then(({value}) => {
+            let sheetName = value  //excel的文件名称
+            let wb = XLSX.utils.book_new()  //工作簿对象包含一SheetNames数组,以及一个表对象映射表名称到表对象。XLSX.utils.book_new实用函数创建一个新的工作簿对象。
+            let ws = XLSX.utils.json_to_sheet(temp, {header: Object.values(fields)}) //将JS对象数组转换为工作表。
+            wb.SheetNames.push(sheetName)
+            wb.Sheets[sheetName] = ws
+            const defaultCellStyle = {
+                font: {name: "Verdana", sz: 13, color: "FF00FF88"},
+                fill: {fgColor: {rgb: "FFFFAA00"}}
+            };//设置表格的样式
+            let wopts = {
+                bookType: 'xlsx',
+                bookSST: false,
+                type: 'binary',
+                cellStyles: true,
+                defaultCellStyle: defaultCellStyle,
+                showGridLines: false
+            }  //写入的样式
+            let wbout = XLSX.write(wb, wopts)
+            let blob = new Blob([s2ab(wbout)], {type: 'application/octet-stream'})
+            fs.saveAs(blob, sheetName + '.xlsx')
+        }).catch((e) => {
+            console.error(e)
+        })
+    }
 }
 
 const s2ab = s => {

+ 148 - 51
src/views/medical-insurance/allpatient/InhospInfo.vue

@@ -1,28 +1,57 @@
 <template>
   <el-container>
     <el-header style="height: 35px; margin-top: 8px">
-      <el-input size="small" v-model="patNo" clearable style="width: 260px" placeholder="此项可以为空">
-        <template #prepend>住院号/门诊ID</template>
-      </el-input>
+      <el-input size="mini" v-model="patNo" clearable style="width: 120px" placeholder="住院/门诊号"></el-input>
       <el-date-picker
-        v-model="dateRange"
-        type="daterange"
-        :shortcuts="maxHalfYear"
-        range-separator="至"
-        start-placeholder="开始日期"
-        end-placeholder="结束日期"
-        size="small"
-        style="width: 240px"
+          v-model="dateRange"
+          type="daterange"
+          :shortcuts="maxHalfYear"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          size="mini"
+          style="width: 240px"
       ></el-date-picker>
+      <el-input v-show="benYuanFlag" size="mini" v-model="name" clearable style="width: 120px"
+                placeholder="姓名"></el-input>
+      <el-input v-show="benYuanFlag" size="mini" v-model="certno" clearable style="width: 120px"
+                placeholder="身份证"></el-input>
       <el-divider direction="vertical"></el-divider>
+      <div class="benYuanFlagDiv">
+        <input type="checkbox" v-model="benYuanFlag" style="cursor: pointer"
+               id="benYuanFlagCheckbox"> <span @click="benYuanFlag = !benYuanFlag">查询本院</span>
+      </div>
       <el-button type="primary" icon="el-icon-search" @click="getInhospInfo">查询</el-button>
-      <el-button type="primary" @click="beforeGetCumulativeInfo">累计信息查询</el-button>
-      <el-button type="success" @click="beforeGetRefMedins">转院查询</el-button>
-      <el-button type="success" @click="beforeTransHospRcd">转院备案</el-button>
-      <el-button type="success" @click="beforeCancelTransHospRcd">转院备案撤销</el-button>
+      <el-divider direction="vertical"></el-divider>
+      <div style="display: inline-flex;" v-if="benYuanFlag">
+        <el-button type="primary" icon="el-icon-download" @click="benYuanDownload" :disabled="inhosps.length === 0">导出
+        </el-button>
+      </div>
+      <div style="display: inline-flex;" v-else>
+        <el-button type="primary" @click="beforeGetCumulativeInfo">累计信息查询</el-button>
+        <el-button type="success" @click="beforeGetRefMedins">转院查询</el-button>
+        <el-button type="success" @click="beforeTransHospRcd">转院备案</el-button>
+        <el-button type="success" @click="beforeCancelTransHospRcd">转院备案撤销</el-button>
+      </div>
+
     </el-header>
     <el-main>
-      <el-table :data="inhosps.slice((currentPage - 1) * pageSize, currentPage * pageSize)" stripe highlight-current-row :height="tableHeight" @row-click="handleClickInHospInfo">
+      <el-table v-if="benYuanFlag" :data="inhosps.slice((currentPage - 1) * pageSize, currentPage * pageSize)" stripe
+                highlight-current-row :height="tableHeight">
+        <el-table-column prop="inpatientNo" label="住院号"></el-table-column>
+        <el-table-column prop="admissTimes" label="住院次数"></el-table-column>
+        <el-table-column prop="name" label="姓名"></el-table-column>
+        <el-table-column prop="responceTypeName" label="医保身份"></el-table-column>
+        <el-table-column prop="referPhysicianName" label="管床医生"></el-table-column>
+        <el-table-column prop="sexName" label="性别"></el-table-column>
+        <el-table-column prop="smallDeptName" label="入院科室"></el-table-column>
+        <el-table-column prop="disDiag" label="诊断代码"></el-table-column>
+        <el-table-column prop="disDiagComment" label="诊断名称"></el-table-column>
+        <el-table-column prop="totalCharge" label="总费用"></el-table-column>
+      </el-table>
+      <el-table v-else :data="inhosps.slice((currentPage - 1) * pageSize, currentPage * pageSize)" stripe
+                highlight-current-row
+                :height="tableHeight" @row-click="handleClickInHospInfo">
         <el-table-column prop="mdtrtId" label="就诊Id"></el-table-column>
         <el-table-column prop="psnNo" label="人员编号"></el-table-column>
         <el-table-column prop="psnCertTypeName" label="人员证件类型"></el-table-column>
@@ -37,14 +66,14 @@
         <el-table-column prop="outFlagName" label="异地标志"></el-table-column>
       </el-table>
       <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-sizes="[15, 30, 45, 70, 100]"
-        :page-size="pageSize"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="inhosps.length"
-        style="margin-top: 5px"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-sizes="[15, 30, 45, 70, 100]"
+          :page-size="pageSize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="inhosps.length"
+          style="margin-top: 5px"
       ></el-pagination>
       <el-dialog v-model="showTrsHspRcdInfo" title="转院备案" width="70%" :close-on-click-modal="false">
         <el-row :gutter="5">
@@ -183,24 +212,25 @@
           <el-table-column prop="enddate" label="结束日期"></el-table-column>
           <el-table-column label="操作">
             <template #default="scope">
-              <el-button type="warning" icon="el-icon-refresh-left" @click="executeCancelTransHospRcd(scope.row)">撤销</el-button>
+              <el-button type="warning" icon="el-icon-refresh-left" @click="executeCancelTransHospRcd(scope.row)">撤销
+              </el-button>
             </template>
           </el-table-column>
         </el-table>
       </el-dialog>
       <el-dialog title="人员累计信息查询" v-model="showCumInfo" width="50%">
-        <Cuminfo :psn-no="currentInHospInfo.psnNo" />
+        <Cuminfo :psn-no="currentInHospInfo.psnNo"/>
       </el-dialog>
       <el-dialog title="转院信息查询" v-model="showRefMedins" width="70%">
         <el-date-picker
-          v-model="refMedinsRange"
-          type="daterange"
-          :shortcuts="maxHalfYear"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          size="small"
-          style="width: 240px"
+            v-model="refMedinsRange"
+            type="daterange"
+            :shortcuts="maxHalfYear"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            size="small"
+            style="width: 240px"
         ></el-date-picker>
         <el-divider direction="vertical"></el-divider>
         <el-button type="primary" icon="el-icon-search" @click="executeGetRefMedins">查询</el-button>
@@ -238,15 +268,28 @@
 </template>
 
 <script>
-import { onMounted, ref } from 'vue'
-import { maxHalfYear } from '@/data/shortcuts'
-import { ElMessage } from 'element-plus'
-import { obtainMedicalInstitutionInfo, queryInHospitalPatientsInfo, queryInsuplcAdmdvsByMdtrtId, queryPersonnelTransferHospitalInfo } from '@/api/medical-insurance/si-query'
-import { formatDatetime } from '@/utils/date'
+import {onMounted, ref, watch} from 'vue'
+import {maxHalfYear} from '@/data/shortcuts'
+import {ElMessage} from 'element-plus'
+import {
+  obtainMedicalInstitutionInfo,
+  queryInHospitalPatientsInfo,
+  queryInsuplcAdmdvsByMdtrtId,
+  queryPersonnelTransferHospitalInfo, weiJieSuanZaiYuanHuanZhe
+} from '../../../api/medical-insurance/si-query'
+import {formatDatetime} from '@/utils/date'
 import store from '@/store'
-import { getHospTypes, getReflTypes } from '@/api/medical-insurance/si-dict'
-import { getAllTrsHospRcdByPsnNo, revokeTransferHospitalRecord, transferHospitalRecord } from '@/api/medical-insurance/si-psn-rcd'
+import {getHospTypes, getReflTypes} from '@/api/medical-insurance/si-dict'
+import {
+  getAllTrsHospRcdByPsnNo,
+  revokeTransferHospitalRecord,
+  transferHospitalRecord
+} from '@/api/medical-insurance/si-psn-rcd'
 import Cuminfo from '../../../components/medical-insurance/cuminfo/Index.vue'
+import {getDateRangeFormatDate} from "../../../utils/date";
+import {cptSex} from "../../../utils/computed"
+import {Export} from "../../../utils/ExportExcel";
+
 export default {
   components: {
     Cuminfo,
@@ -274,6 +317,9 @@ export default {
     const refMedins = ref([])
     const showRefMedins = ref(false)
     const refMedinsRange = ref(null)
+    const benYuanFlag = ref(false)
+    const name = ref('')
+    const certno = ref('') // 身份证
     const nullDateRange = () => {
       if (!dateRange.value) {
         ElMessage({
@@ -305,17 +351,25 @@ export default {
       currentPage.value = val
     }
     const getInhospInfo = () => {
-      if (nullDateRange()) {
-        return
-      }
-      const param = {
-        patNo: patNo.value,
-        begntime: formatDatetime(dateRange.value[0]),
-        endtime: formatDatetime(dateRange.value[1]),
+      if (benYuanFlag.value) {
+        let dateS = getDateRangeFormatDate(dateRange.value)
+        weiJieSuanZaiYuanHuanZhe(patNo.value, dateS.startTime, dateS.endTime,
+            name.value, certno.value).then((res) => {
+          inhosps.value = res
+        })
+      } else {
+        if (nullDateRange()) {
+          return
+        }
+        const param = {
+          patNo: patNo.value,
+          begntime: formatDatetime(dateRange.value[0]),
+          endtime: formatDatetime(dateRange.value[1]),
+        }
+        queryInHospitalPatientsInfo(param).then((res) => {
+          inhosps.value = res
+        })
       }
-      queryInHospitalPatientsInfo(param).then((res) => {
-        inhosps.value = res
-      })
     }
 
     const handleClickInHospInfo = (row) => {
@@ -455,6 +509,27 @@ export default {
       // })
     })
 
+    watch(() => benYuanFlag.value,
+        () => {
+          inhosps.value = []
+        })
+
+    const benYuanDownload = () => {
+      let title = {
+        inpatientNo: "住院号",
+        admissTimes: "住院次数",
+        name: "姓名",
+        responceTypeName: "医保身份",
+        referPhysicianName: "管床医生",
+        sexName: "性别",
+        smallDeptName: "入院科室",
+        disDiag: "诊断代码",
+        disDiagComment: "诊断名称",
+        totalCharge: "总费用",
+      }
+      Export(inhosps.value, title)
+    }
+
     return {
       tableHeight,
       patNo,
@@ -494,7 +569,29 @@ export default {
       searchHospitals,
       dbClickMedins,
       executeGetRefMedins,
+      benYuanFlag,
+      name,
+      certno,
+      cptSex,
+      benYuanDownload
     }
   },
 }
 </script>
+
+<style scoped>
+.required {
+  color: red
+}
+
+.benYuanFlagDiv {
+  display: inline-flex;
+  padding: 0 5px;
+  height: 28px;
+  cursor: pointer
+}
+
+.benYuanFlagDiv:hover {
+  color: #7373e7;
+}
+</style>