xiaochan 1 year ago
parent
commit
a22980f4b9

+ 20 - 12
src/App.vue

@@ -409,17 +409,17 @@ table th.star div::before {
   color: white;
 }
 
-.el-message {
-  border: none;
-  border-radius: 2px;
-  background-color: white;
-  padding: 10px 16px;
-  box-shadow: 1px 3px 8px 4px rgb(0 0 0 / 10%);
-
-  .el-message__content {
-    color: #333333;
-  }
-}
+//.el-message {
+//  border: none;
+//  border-radius: 2px;
+//  background-color: white;
+//  padding: 10px 16px;
+//  box-shadow: 1px 3px 8px 4px rgb(0 0 0 / 10%);
+//
+//  .el-message__content {
+//    color: #333333;
+//  }
+//}
 
 .el-table .el_table__current {
   background-color: #a7d3ff;
@@ -482,7 +482,7 @@ input[type=number]::-webkit-outer-spin-button {
 
   .vxe-body--row {
     .vxe-cell {
-      padding: 0 4px pximportant;
+      padding: 0 4px !important;
     }
   }
 }
@@ -578,4 +578,12 @@ input[type=number]::-webkit-outer-spin-button {
   user-select: none;
 }
 
+
+.cy_card {
+  border-radius: 10px;
+  border: 1px solid var(--el-border-color);
+  background: var(--el-bg-color);
+  padding: 10px;
+}
+
 </style>

+ 15 - 4
src/components/cy/flex/src/CyFlex.vue

@@ -3,13 +3,19 @@
       style="height: 100%; width: 100%; display: flex"
       :style="{'flex-flow': tabPosition === 'transverse' ? 'column nowrap' : '' }"
   >
-    <div>
+    <div :class="props.headerClass">
       <slot name="header"/>
     </div>
-    <div :style="style" ref="contentRef" v-if="slots.content">
+    <div :style="style"
+         ref="contentRef"
+         class="contentClass"
+         v-if="slots.content">
       <slot name="content" :height="height" :width="width"/>
     </div>
-    <div :style="style" ref="contentRef" v-if="slots.default">
+    <div :style="style"
+         ref="contentRef"
+         class="contentClass"
+         v-if="slots.default">
       <slot name="default" :height="height" :width="width"/>
     </div>
   </div>
@@ -27,7 +33,12 @@ const props = defineProps({
   contentSize: {
     type: Boolean,
     default: false
-  }
+  },
+  headerClass: {
+    type: String,
+    default: ''
+  },
+  contentClass: String
 })
 
 const slots = useSlots()

+ 73 - 9
src/utils/cy-use/useVxeTable.tsx

@@ -1,18 +1,22 @@
-import {computed, nextTick, reactive, Ref, ref, watch, onMounted} from 'vue'
+import {computed, nextTick, onMounted, reactive, ref, Ref, watch} from 'vue'
 import type {VxePagerProps, VxeTableProps} from "vxe-table";
-import {VxePager, VxeTable, VxeColumn} from "vxe-table";
-import {TablePublicMethods, VxeTableEventProps} from "vxe-table/types/table";
+import {VxeColumn, VxePager, VxeTable} from "vxe-table";
+import {TablePublicMethods, VxeTableEventProps, VxeTablePropTypes} from "vxe-table/types/table";
 import XEUtils from "xe-utils";
+// @ts-ignore
 import {stringIsBlank, stringNotBlank} from "@/utils/blank-utils";
 import {TableExportMethods} from "vxe-table/types/export";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
 import {eachAndReturnList} from "@/utils/cyRefList";
 import {ElButton, ElPopover} from "element-plus";
 import setDialogToJs from "@/components/js-dialog-comp/useDialogToJs";
+// @ts-ignore
 import CyDialog from "@/components/cy/dialog/src/CyDialog.vue";
 import {IsCyDialog} from "@/components/cy/dialog/src/useCyDialog";
+// @ts-ignore
 import CyFlex from "@/components/cy/flex/src/CyFlex.vue";
 import {tsxVModel} from "@/utils/cy-use/useTsxUtils";
+import {isDev} from "@/utils/public";
 
 export declare type PageQuery = {
     currentPage?: number,
@@ -32,6 +36,7 @@ declare type SimplifiedConfiguration<D> = {
         '--vxe-table-column-padding-mini'?: string | number,
     },
     showPage?: boolean,
+    localPaging?: boolean,
     result?: string,
     total?: string,
     pagesProps?: VxePagerProps,
@@ -49,6 +54,7 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
         keyField: '',
         showPage: false,
         mountedQuery: false,
+        localPaging: false,
         result: 'result',
         total: 'total',
         ...simplifiedConfiguration
@@ -113,6 +119,16 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
         }
     }
 
+    if (simplifiedConfiguration.localPaging) {
+        simplifiedConfiguration.showPage = true
+        delete props.rowConfig?.height
+        props.scrollY!.enabled = false
+        props!.showOverflow = false
+        if (!XEUtils.isFunction(simplifiedConfiguration.remoteSearch)) {
+            console.error('请设置remoteSearch函数')
+        }
+    }
+
     const pageVO = reactive({
         currentPage: 1,
         pageSize: 30,
@@ -123,6 +139,13 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
         loading: false,
     })
 
+    const localPaging = {
+        data: [],
+        change: () => {
+            props.data = localPaging.data.slice((pageVO.currentPage - 1) * pageVO.pageSize, pageVO.currentPage * pageVO.pageSize)
+        }
+    }
+
     watch(() => props.currentKey, () => {
         if (stringNotBlank(defaultProps.value.rowConfig?.keyField)) {
             const findData = XEUtils.find(tableRef.value?.getData(), (item) => {
@@ -139,7 +162,25 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
     const defaultProps = computed(() => {
         return {
             ...simplifiedConfiguration?.tableProps,
-            ...props
+            ...props,
+            onResizableChange: () => {
+                if (!isDev) {
+                    return
+                }
+                const columns = tableRef.value!.getColumns();
+
+                const tmp: {
+                    [key: string]: any
+                } = {}
+
+                columns.forEach(column => {
+                    if (column.field) {
+                        tmp[column.field] = tableRef.value!.getColumnWidth(column.field)
+                    }
+                })
+
+                console.log(tmp)
+            }
         } as VxeTableProps<D>
     })
 
@@ -272,19 +313,29 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
         if (!XEUtils.isString(filename)) {
             filename = ''
         }
-        tableRef.value?.openExport({
+
+        const opt: VxeTablePropTypes.ExportConfig = {
             filename,
             sheetName,
             types: ['xlsx', 'csv', 'html', 'xml', 'txt'],
             type: 'xlsx',
-            useStyle: true,
-            original: true,
-        })
+        }
+
+        if (simplifiedConfiguration.localPaging) {
+            opt.data = localPaging.data
+        }
+
+        tableRef.value?.openExport(opt)
     }
 
     let queryParamsCache = {}
 
     function pageChange() {
+        if (simplifiedConfiguration.localPaging) {
+            localPaging.change()
+            return;
+        }
+
         if (XEUtils.isEmpty(queryParamsCache)) {
             return
         }
@@ -374,7 +425,20 @@ function useVxeTable<D>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}
 
     function querySearch() {
         props.loading = true
-        if (simplifiedConfiguration.showPage) {
+        if (simplifiedConfiguration.localPaging) {
+            simplifiedConfiguration?.remoteSearch?.({}).then(res => {
+                pageVO.total = (res as any[]).length
+                pageVO.currentPage = 1
+                localPaging.data = res
+                localPaging.change()
+                console.log(res)
+            }).catch(() => {
+                localPaging.data = []
+                localPaging.change()
+            }).finally(() => {
+                props.loading = false
+            })
+        } else if (simplifiedConfiguration.showPage) {
             const parameterData = simplifiedConfiguration?.getQueryParams?.()
             const pageData = {
                 ...pageVO,

+ 3 - 3
src/utils/request.js

@@ -64,7 +64,7 @@ service.interceptors.response.use(
             ElMessage({
                 type: 'success',
                 title: '成功',
-                duration: 2800,
+                duration: 3500,
                 dangerouslyUseHTMLString: true,
                 message: response.data.message,
                 showClose: true,
@@ -87,7 +87,7 @@ service.interceptors.response.use(
             ElMessage({
                 type: 'error',
                 message: response.data.message,
-                duration: 3000,
+                duration: 3500,
                 showClose: true,
                 grouping: true,
             })
@@ -166,7 +166,7 @@ service.interceptors.response.use(
         ElMessage({
             message: error,
             type: 'error',
-            duration: 2500,
+            duration: 3500,
             showClose: true,
             grouping: true,
         })

+ 1 - 1
src/utils/xiaochan-element-plus.ts

@@ -5,7 +5,7 @@ function message(msg: string, type: string, isHtml: boolean) {
     return ElMessage({
         type: type,
         // @ts-ignore
-        duration: 2800,
+        duration: 3500,
         dangerouslyUseHTMLString: isHtml,
         message: msg,
         showClose: true,

+ 86 - 104
src/views/hospitalization/zhu-yuan-yi-sheng/PatientInformationInquiry.vue

@@ -1,7 +1,6 @@
 <template>
-  <page-layer>
-    <template #headerBlock>
-
+  <CyFlex header-class="cy_card patinfo_query">
+    <template #header>
       <el-form :inline="true" ref="formRef" :model="param">
 
         <el-form-item label="住院号" prop="patNo">
@@ -79,86 +78,81 @@
         </el-form-item>
 
         <el-form-item>
-          <el-button @click="queryClick" type="primary">查询</el-button>
+          <el-button @click="querySearch" type="primary">查询</el-button>
           <el-button @click="reset" type="warning">重置</el-button>
-          <el-button @click="exportClick" type="success">导出</el-button>
+          <el-button @click="exportExcel" type="success">导出</el-button>
         </el-form-item>
       </el-form>
     </template>
-
-    <template #main="{height}">
-      <pat-infomation-dialog
-          v-if="dialog"
-          @closed="dialog = false"
-          :admiss-date="rowData.admissDate"
-          :pat-no="rowData.patNo"
-          :times="rowData.admissTimes"
-          :leave-hospital="param.leaveHospital ? 2 : 1"
-          :dics="dics"/>
-      <xc-table :local-data="patInfoList"
-                :final-height="getWindowSize.h / 1.15">
-        <el-table-column label="操作" fixed="left" width="80">
-          <template #default="{row}">
-            <el-button @click="openPatient360(row.inpatientNo)"
-                       text
-                       type="danger"
-                       plain>
-              患者360
-            </el-button>
-            <div></div>
-            <el-button @click="details(row)"
-                       text
-                       type="primary"
-                       plain>
-              详情
-            </el-button>
-            <div></div>
-            <el-button style="margin-left: 0"
-                       @click="openEmr(row)"
-                       text
-                       type="primary"
-                       plain>
-              病历
-            </el-button>
-          </template>
-        </el-table-column>
-        <el-table-column label="住院号" prop="inpatientNo" width="60"/>
-        <el-table-column label="次数" prop="admissTimes" width="30"/>
-        <el-table-column label="床位" prop="bedNo" width="30"/>
-        <el-table-column label="审核" width="30">
-          <template #default="{row}">
-                        <span v-if="row.emrAudit > 0 ">
-                            √
-                        </span>
-          </template>
-        </el-table-column>
-        <el-table-column label="姓名" prop="name">
-          <template #default="{row}">
-            {{ row.name + '(' + row.sexName + ')' }}
-          </template>
-        </el-table-column>
-        <el-table-column label="入院时间" prop="admissDate" width="80"/>
-        <el-table-column label="出院时间" prop="disDate" width="80"/>
-        <el-table-column label="入院病区" prop="admissWardName"/>
-        <el-table-column label="小科室" prop="zkWardName"/>
-        <el-table-column label="年龄" prop="tempAge"/>
-        <el-table-column label="医保身份" prop="responceName"/>
-        <el-table-column label="总费用" prop="totalCharge"/>
-        <el-table-column label="余额" prop="balance"/>
-        <el-table-column label="入院诊断" prop="admissDiagStr"/>
-      </xc-table>
-
-    </template>
-  </page-layer>
+    <pat-infomation-dialog
+        v-if="dialog"
+        @closed="dialog = false"
+        :admiss-date="rowData.admissDate"
+        :pat-no="rowData.patNo"
+        :times="rowData.admissTimes"
+        :leave-hospital="param.leaveHospital ? 2 : 1"
+        :dics="dics"/>
+
+    <CyVxeTable>
+      <vxe-column title="操作" fixed="left" min-width="80">
+        <template #default="{row}">
+          <el-button @click="openPatient360(row.inpatientNo)"
+                     text
+                     type="danger"
+                     plain>
+            患者360
+          </el-button>
+          <div></div>
+          <el-button @click="details(row)"
+                     text
+                     type="primary"
+                     plain>
+            详情
+          </el-button>
+          <div></div>
+          <el-button style="margin-left: 0"
+                     @click="openEmr(row)"
+                     text
+                     type="primary"
+                     plain>
+            病历
+          </el-button>
+        </template>
+      </vxe-column>
+
+      <vxe-column title="住院号" field="inpatientNo" min-width="70"/>
+      <vxe-column title="次数" field="admissTimes" min-width="56"/>
+      <vxe-column title="床位" field="bedNo" min-width="53"/>
+      <vxe-column title="审核" min-width="61" field="emrAudit">
+        <template #default="{row}">
+          <span v-if="row.emrAudit > 0 ">√</span>
+        </template>
+      </vxe-column>
+      <vxe-column title="姓名" field="name" min-width="101"/>
+      <vxe-column title="性别" field="sexName" min-width="60"/>
+      <vxe-column title="入院时间" field="admissDate" min-width="80"/>
+      <vxe-column title="出院时间" field="disDate" min-width="80"/>
+      <vxe-column title="入院病区" field="admissWardName" min-width="101"/>
+      <vxe-column title="小科室" field="zkWardName" min-width="99"/>
+      <vxe-column title="年龄" field="tempAge" min-width="63"/>
+      <vxe-column title="医保身份" field="responceName" min-width="86"/>
+      <vxe-column title="总费用" field="totalCharge" min-width="87"/>
+      <vxe-column title="余额" field="balance" min-width="67"/>
+      <vxe-column title="入院诊断" field="admissDiagStr" min-width="82"/>
+      <vxe-column title="住院天数" field="actIptDays" min-width="91"/>
+      <vxe-column title="入院医生" field="admissPhysicianName" min-width="82"/>
+      <vxe-column title="管床医生" field="referPhysicianName" min-width="90"/>
+      <vxe-column title="离院方式" field="zyDismissWay" min-width="79"/>
+      <vxe-column title="出院主诊断" field="disMainDiag" min-width="101"/>
+      <vxe-column title="出院科室" field="disDeptName" min-width="70"/>
+    </CyVxeTable>
+  </CyFlex>
 </template>
 
 <script setup lang="ts">
-import PageLayer from "@/layout/PageLayer.vue";
 import {getHospWardAndDept, getPatientInfo, diagnosis, employeeList} from "@/api/zhu-yuan-yi-sheng/pat-info-query";
 import SelectV4 from "@/components/xiao-chan/select-v4/SelectV4.vue";
 import XcDatePicker from "@/components/xiao-chan/date-picker/XcDatePicker.vue";
-import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
-import {getWindowSize} from "@/utils/window-size";
 import {getAllDictionary} from "@/api/case-front-sheet";
 import {operations} from "@/data";
 import {autopsies, haveOrNot, yesOrNo} from "@/views/hospitalization/case-front-sheet/common";
@@ -176,6 +170,8 @@ import router from "@/router";
 import sleep from "@/utils/sleep";
 import {Export} from '@/utils/ExportExcel'
 import {openPatient360} from "@/views/view/patient360/src";
+import CyFlex from "@/components/cy/flex/src/CyFlex.vue";
+import UseVxeTable from "@/utils/cy-use/useVxeTable";
 
 const param = ref({
   patNo: '',
@@ -202,11 +198,19 @@ const dics = ref([])
 const diagnosisData = ref([])
 const empList = ref([])
 
+
+const {CyVxeTable, querySearch, exportExcel, tableRef} = UseVxeTable({
+  localPaging: true,
+  keyField: "patId",
+  remoteSearch: () => {
+    return getPatientInfo(param.value)
+  }
+})
+
 onActivated(async () => {
   const params = router.currentRoute.value.query
-  console.log('params', params)
   if (params && params.patNo) {
-    param.value.patNo = params.patNo
+    param.value.patNo = params.patNo as string
     param.value.name = ''
     param.value.leaveHospital = false
     param.value.admissionTime = []
@@ -218,17 +222,12 @@ onActivated(async () => {
     param.value.empCode = ''
     param.value.disDept = ''
     param.value.emrAudit = 0
+    await nextTick()
     await sleep(300);
-    await queryClick()
+    await querySearch()
   }
 })
 
-
-const queryClick = () => {
-  getPatientInfo(param.value).then(res => {
-    patInfoList.value = res
-  })
-}
 const reset = () => {
   formRef.value?.resetFields()
 }
@@ -268,26 +267,6 @@ const openEmr = async (data) => {
   }
 }
 
-const title = {
-  inpatientNo: '住院号',
-  admissTimes: '住院次数',
-  bedNo: '床位',
-  name: '姓名',
-  admissDate: '入院时间',
-  disDate: '出院时间',
-  admissWardName: '入院病区',
-  zkWardName: '小科室',
-  tempAge: '年龄',
-  responceName: '医保身份',
-  totalCharge: '总费用',
-  balance: '余额',
-  admissDiagStr: '入院诊断',
-}
-
-function exportClick() {
-  Export(patInfoList.value, title, '患者信息')
-}
-
 onMounted(async () => {
   getHospWardAndDept().then(res => {
     deptWardList.value = res
@@ -311,7 +290,10 @@ let audit = [
 
 </script>
 
-<style lang="scss" scoped>
-
+<style lang="scss">
+.patinfo_query {
+  padding: 10px 10px 0 10px;
+  margin-bottom: 5px;
+}
 
 </style>

+ 0 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/shou-shu-shen-qing/src/components/AddShouShuEditor.vue

@@ -112,7 +112,6 @@ const updateClick = async () => {
     message: '是否生成处置医嘱',
     confirmButtonText: '处置医嘱',
     cancelButtonText: '排斥医嘱',
-    dangerouslyUseHTMLString: true,
   }).then(() => {
     data.generateRejectedOrders = true
   }).catch(({action}) => {