소스 검색

病案首页优化

lighter 3 년 전
부모
커밋
c34bbc8222
1개의 변경된 파일201개의 추가작업 그리고 201개의 파일을 삭제
  1. 201 201
      src/views/hospitalization/case-front-sheet/AllCaseFrontSheet.vue

+ 201 - 201
src/views/hospitalization/case-front-sheet/AllCaseFrontSheet.vue

@@ -213,10 +213,10 @@
 </template>
 
 <script setup name="AllCaseFrontSheet">
-import { yesOrNo, haveOrNot, searchMethods, autopsies } from './common';
-import { onActivated, onMounted, reactive, ref, watchEffect } from 'vue';
-import store from '@/store';
-import { operations, frontSheetMedTypes } from '@/data/index';
+import { yesOrNo, haveOrNot, searchMethods, autopsies } from './common'
+import { onActivated, onMounted, reactive, ref, watchEffect } from 'vue'
+import store from '@/store'
+import { operations, frontSheetMedTypes } from '@/data/index'
 import {
   basOutPatients,
   executeAdvanceSearch,
@@ -228,36 +228,36 @@ import {
   getSheetInfo,
   sheetSearch,
   analyzeDismissCount,
-} from '@/api/case-front-sheet';
-import maleIcon from '@/assets/male-icon.png';
-import femaleIcon from '@/assets/female-icon.png';
-import { ElMessage, ElMessageBox } from 'element-plus';
-import { shortcuts } from '@/data/shortcuts';
-import { formatDate, getOneMonthOffset } from '@/utils/date';
-import { initLodop, getLodop } from '@/utils/c-lodop';
-import { formatMonth } from '@/utils/date';
-import HeadPage from '../../../components/inpatient/frontsheet-printpage/HeadPage.vue';
-import TailPage from '../../../components/inpatient/frontsheet-printpage/TailPage.vue';
-import { Export } from '../../../utils/ExportExcel';
+} from '@/api/case-front-sheet'
+import maleIcon from '@/assets/male-icon.png'
+import femaleIcon from '@/assets/female-icon.png'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { shortcuts } from '@/data/shortcuts'
+import { formatDate, getOneMonthOffset } from '@/utils/date'
+import { initLodop, getLodop } from '@/utils/c-lodop'
+import { formatMonth } from '@/utils/date'
+import HeadPage from '../../../components/inpatient/frontsheet-printpage/HeadPage.vue'
+import TailPage from '../../../components/inpatient/frontsheet-printpage/TailPage.vue'
+import { Export } from '../../../utils/ExportExcel'
 
-const currentPage = $ref(1);
+const currentPage = $ref(1)
 const handleCurrentPageChange = (val) => {
-  currentPage = val;
-};
-const userWards = $ref([]);
-const windowSize = store.state.app.windowSize;
-const tableHeight = windowSize.h - 75;
-const overview = $ref([]);
+  currentPage = val
+}
+const userWards = $ref([])
+const windowSize = store.state.app.windowSize
+const tableHeight = windowSize.h - 75
+const overview = $ref([])
 const sheet = $ref({
   disdiagList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
   surgeryList: [{}, {}, {}, {}, {}],
-});
+})
 const mainInfo = {
   height: windowSize.h - 45 + 'px',
   padding: '0 20px',
   overflowY: 'scroll',
-};
-const dics = $ref({});
+}
+const dics = $ref({})
 const overviewParam = reactive({
   ward: '',
   start: '',
@@ -265,59 +265,59 @@ const overviewParam = reactive({
   fileStatus: '0',
   lateFlag: '3',
   bah: '',
-});
-const isLateDataMode = $ref(false);
+})
+const isLateDataMode = $ref(false)
 const searchPatient = () => {
-  overviewParam.start = formatDate(dateRange[0]);
-  overviewParam.end = formatDate(dateRange[1]);
+  overviewParam.start = formatDate(dateRange[0])
+  overviewParam.end = formatDate(dateRange[1])
   basOutPatients(overviewParam).then((res) => {
-    isLateDataMode = overviewParam.lateFlag === '1';
-    overview = res.list;
+    isLateDataMode = overviewParam.lateFlag === '1'
+    overview = res.list
     if (res.list.length === 1) {
-      fetchSheetInfo(res.list[0]);
+      fetchSheetInfo(res.list[0])
     }
-  });
-};
+  })
+}
 
-const dateRange = $ref([]);
+const dateRange = $ref([])
 
 const fetchSheetInfo = (row) => {
   if (row.bah !== sheet.bah || row.times !== sheet.admissTimes) {
-    forceVerifies = [];
-    adviceVerifies = [];
+    forceVerifies = []
+    adviceVerifies = []
   }
-  row.inOutFlag = 2;
+  row.inOutFlag = 2
   getSheetInfo(row).then((res) => {
-    sheet = res;
-  });
-};
+    sheet = res
+  })
+}
 
-const showSearch = $ref(false);
-const insertDiag = $ref(false);
+const showSearch = $ref(false)
+const insertDiag = $ref(false)
 watchEffect(() => {
   if (showSearch) {
-    searchResults = [];
+    searchResults = []
     setTimeout(() => {
-      searchInput.focus();
-    }, 300);
+      searchInput.focus()
+    }, 300)
   } else {
-    insertDiag = false;
+    insertDiag = false
   }
-});
-const searchInput = $ref(null);
-const searchUrl = $ref('');
-const searchTargetCode = $ref('');
-const searchTargetName = $ref('');
-const searchContent = $ref('');
-const currentSRPage = $ref(1);
+})
+const searchInput = $ref(null)
+const searchUrl = $ref('')
+const searchTargetCode = $ref('')
+const searchTargetName = $ref('')
+const searchContent = $ref('')
+const currentSRPage = $ref(1)
 const lastPage = () => {
-  currentSRPage -= 1;
-  fetchSearchData();
-};
+  currentSRPage -= 1
+  fetchSearchData()
+}
 const nextPage = () => {
-  currentSRPage += 1;
-  fetchSearchData();
-};
+  currentSRPage += 1
+  fetchSearchData()
+}
 const fetchSearchData = () => {
   const param = {
     method: searchMethod,
@@ -327,34 +327,34 @@ const fetchSearchData = () => {
     page: currentSRPage,
     ybType: sheet.ybType,
     treatType: sheet.treatType,
-  };
+  }
   sheetSearch(param).then((res) => {
-    searchResults = res;
-  });
-};
+    searchResults = res
+  })
+}
 const executeSearch = () => {
-  if (searchContent.length < 2 && searchContent !== '-') return;
-  currentSRPage = 1;
+  if (searchContent.length < 2 && searchContent !== '-') return
+  currentSRPage = 1
   if (searchContent === '-') {
-    searchResults = [{ code: '-', name: '-' }];
+    searchResults = [{ code: '-', name: '-' }]
   } else {
-    fetchSearchData();
+    fetchSearchData()
   }
-};
+}
 
-const showDismissCount = $ref(false);
-const dismissCountdata = $ref([]);
+const showDismissCount = $ref(false)
+const dismissCountdata = $ref([])
 const disCountParams = reactive({
   month: formatMonth(new Date()),
   type: 1,
   dept: null,
-});
+})
 const fetchDismissCount = () => {
-  disCountParams.month = formatMonth(disCountParams.month);
+  disCountParams.month = formatMonth(disCountParams.month)
   analyzeDismissCount(disCountParams).then((res) => {
-    dismissCountdata = res;
-  });
-};
+    dismissCountdata = res
+  })
+}
 const exportDismissCount = () => {
   if (dismissCountdata.length === 0) {
     ElMessage({
@@ -362,19 +362,19 @@ const exportDismissCount = () => {
       type: 'warning',
       duration: 2000,
       showClose: true,
-    });
-    return;
+    })
+    return
   }
-  let name = '';
-  let title = {};
+  let name = ''
+  let title = {}
   if (disCountParams.type === 1) {
     title = {
       deptName: '科室',
       dismissCount: '出院人数',
       signedCount: '已签收',
       unsignCount: '未签收',
-    };
-    name = '科室出院人数统计';
+    }
+    name = '科室出院人数统计'
   } else {
     title = {
       patNo: '住院号',
@@ -395,31 +395,31 @@ const exportDismissCount = () => {
       zzys: '主治医师',
       zyys: '住院医师',
       fdcrb: '法定传染病',
-    };
-    name = disCountParams.type === 2 ? '出院明细统计' : '死亡患者统计';
+    }
+    name = disCountParams.type === 2 ? '出院明细统计' : '死亡患者统计'
   }
-  const fileName = `【${disCountParams.month}】${name}`;
-  Export(dismissCountdata, title, fileName);
-};
+  const fileName = `【${disCountParams.month}】${name}`
+  Export(dismissCountdata, title, fileName)
+}
 const handleCommand = (val) => {
   switch (val) {
     case 'dismissCount':
-      showDismissCount = true;
-      break;
+      showDismissCount = true
+      break
     case 'exportLateData':
-      exportLateDataExel();
-      break;
+      exportLateDataExel()
+      break
     case 'print1':
-      beforePrint(1);
-      break;
+      beforePrint(1)
+      break
     case 'print2':
-      beforePrint(2);
-      break;
+      beforePrint(2)
+      break
     case 'unSign':
-      unArchiveBa();
-      break;
+      unArchiveBa()
+      break
   }
-};
+}
 
 const exportLateDataExel = () => {
   if (!isLateDataMode) {
@@ -428,8 +428,8 @@ const exportLateDataExel = () => {
       type: 'warning',
       duration: 2500,
       showClose: true,
-    });
-    return;
+    })
+    return
   }
   if (overview.length === 0) {
     ElMessage({
@@ -437,10 +437,10 @@ const exportLateDataExel = () => {
       type: 'warning',
       duration: 2000,
       showClose: true,
-    });
-    return;
+    })
+    return
   }
-  const title = {
+  const fields = {
     name: '姓名',
     genderName: '性别',
     bah: '住院号',
@@ -452,30 +452,30 @@ const exportLateDataExel = () => {
     doctorName: '管床医生',
     lateDays: '迟交天数',
     signDate: '签收日期',
-  };
-  Export(overview, title, '迟交病案');
-};
+  }
+  Export(overview, fields, '迟交病案')
+}
 
-const searchMethod = $ref('alpha');
-const searchResults = $ref([]);
+const searchMethod = $ref('alpha')
+const searchResults = $ref([])
 const showSearchData = (flag) => {
   if (flag === 'advanceSearchDoctor') {
-    searchUrl = 'employee';
-    searchTargetCode = 'advanceSearch';
-    searchTargetName = 'doctor';
+    searchUrl = 'employee'
+    searchTargetCode = 'advanceSearch'
+    searchTargetName = 'doctor'
   } else if (flag === 'advanceSearchDiag') {
-    searchUrl = 'normalDiag';
-    searchTargetCode = 'advanceSearch';
-    searchTargetName = 'icd';
+    searchUrl = 'normalDiag'
+    searchTargetCode = 'advanceSearch'
+    searchTargetName = 'icd'
   } else {
-    searchUrl = 'surgery';
-    searchTargetCode = 'advanceSearch';
-    searchTargetName = 'surgery';
+    searchUrl = 'surgery'
+    searchTargetCode = 'advanceSearch'
+    searchTargetName = 'surgery'
   }
-  showSearch = true;
-};
+  showSearch = true
+}
 
-const showAdvanceSearch = $ref(false);
+const showAdvanceSearch = $ref(false)
 const advanceSearch = reactive({
   blfxChkbox: [],
   medType: '',
@@ -486,38 +486,38 @@ const advanceSearch = reactive({
   surgeryCode: '',
   surgeryName: '',
   sex: null,
-});
+})
 const doAdvanceSearch = () => {
-  advanceSearch.start = formatDate(dateRange[0]);
-  advanceSearch.end = formatDate(dateRange[1]);
-  console.log(advanceSearch);
+  advanceSearch.start = formatDate(dateRange[0])
+  advanceSearch.end = formatDate(dateRange[1])
+  console.log(advanceSearch)
   if (!advanceSearch.doctorName) {
-    advanceSearch.doctorCode = '';
+    advanceSearch.doctorCode = ''
   }
   executeAdvanceSearch(advanceSearch).then((res) => {
-    overview = res;
-    showAdvanceSearch = false;
-  });
-};
+    overview = res
+    showAdvanceSearch = false
+  })
+}
 
 const handleSelectSearch = (item) => {
   switch (searchTargetName) {
     case 'doctor':
-      advanceSearch.doctorCode = item.code;
-      advanceSearch.doctorName = item.name;
-      break;
+      advanceSearch.doctorCode = item.code
+      advanceSearch.doctorName = item.name
+      break
     case 'icd':
-      advanceSearch.icdCode = item.code;
-      advanceSearch.icdName = item.name;
-      break;
+      advanceSearch.icdCode = item.code
+      advanceSearch.icdName = item.name
+      break
     case 'surgery':
-      advanceSearch.surgeryCode = item.code;
-      advanceSearch.surgeryName = item.name;
-      break;
+      advanceSearch.surgeryCode = item.code
+      advanceSearch.surgeryName = item.name
+      break
   }
-  searchContent = '';
-  showSearch = false;
-};
+  searchContent = ''
+  showSearch = false
+}
 
 const nullPatient = () => {
   if (!sheet.bah) {
@@ -526,52 +526,52 @@ const nullPatient = () => {
       type: 'warning',
       duration: 2500,
       showClose: true,
-    });
-    return true;
+    })
+    return true
   }
-  return false;
-};
+  return false
+}
 
-const showMessageDrawer = $ref(false);
+const showMessageDrawer = $ref(false)
 const beforePrint = (flag) => {
-  if (nullPatient()) return;
+  if (nullPatient()) return
   const param = {
     sheet: sheet,
-  };
+  }
   executePrintVerify(param)
     .then(() => {
-      execPrint(flag);
+      execPrint(flag)
     })
     .catch((e) => {
-      forceVerifies = e.data.force;
-      adviceVerifies = e.data.advice;
-      showMessageDrawer = true;
+      forceVerifies = e.data.force
+      adviceVerifies = e.data.advice
+      showMessageDrawer = true
       if (e.data.force.length === 0) {
-        execPrint(flag);
+        execPrint(flag)
       }
-    });
-};
+    })
+}
 const execPrint = (flag) => {
-  LODOP = getLodop();
-  const prntStyle = `<style>*{font-size:10pt} table,th,td {border: 1px solid black;border-collapse: collapse;} td,th {height: 24px;padding-left: 4px;}</style>`;
-  const prntContent = flag === 1 ? document.getElementById('headpage').innerHTML : document.getElementById('tailpage').innerHTML;
-  let pagePrint = prntStyle + '<body>' + prntContent + '</body>';
-  LODOP.PRINT_INIT('casefrontsheet');
-  LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '');
-  LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true); // 整宽不变形
-  LODOP.ADD_PRINT_HTM('2mm', '0.5mm', '209.5mm', '295mm', pagePrint);
-  LODOP.SET_PRINT_STYLE('ItemType', 3);
-  LODOP.PREVIEW();
-};
+  LODOP = getLodop()
+  const prntStyle = `<style>*{font-size:10pt} table,th,td {border: 1px solid black;border-collapse: collapse;} td,th {height: 24px;padding-left: 4px;}</style>`
+  const prntContent = flag === 1 ? document.getElementById('headpage').innerHTML : document.getElementById('tailpage').innerHTML
+  let pagePrint = prntStyle + '<body>' + prntContent + '</body>'
+  LODOP.PRINT_INIT('casefrontsheet')
+  LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
+  LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true) // 整宽不变形
+  LODOP.ADD_PRINT_HTM('2mm', '0.5mm', '209.5mm', '295mm', pagePrint)
+  LODOP.SET_PRINT_STYLE('ItemType', 3)
+  LODOP.PREVIEW()
+}
 
 const archiveBa = () => {
   if (nullPatient()) {
-    return;
+    return
   }
   const param = {
     opType: 2,
     sheet: sheet,
-  };
+  }
   executeSaveVerify(param)
     .then((res) => {
       ElMessage({
@@ -579,17 +579,17 @@ const archiveBa = () => {
         type: 'success',
         duration: 2500,
         showClose: true,
-      });
+      })
     })
     .catch((e) => {
-      forceVerifies = e.data;
-      showMessageDrawer = true;
-    });
-};
+      forceVerifies = e.data
+      showMessageDrawer = true
+    })
+}
 
 const unArchiveBa = () => {
   if (nullPatient()) {
-    return;
+    return
   }
 
   ElMessageBox.confirm('是否确认解除签收患者【' + sheet.name + '】的病案首页?', '提示', {
@@ -601,22 +601,22 @@ const unArchiveBa = () => {
       const param = {
         opType: 3,
         sheet: sheet,
-      };
+      }
       executeUnArchiveBa(param).then((res) => {
         ElMessage({
           message: res,
           type: 'success',
           duration: 2500,
           showClose: true,
-        });
-      });
+        })
+      })
     })
-    .catch(() => {});
-};
+    .catch(() => {})
+}
 
-const forceVerifies = $ref([]);
-const adviceVerifies = $ref([]);
-const currentMessageIndex = $ref(null);
+const forceVerifies = $ref([])
+const adviceVerifies = $ref([])
+const currentMessageIndex = $ref(null)
 const messageColor = (id) => {
   return currentMessageIndex === id
     ? {
@@ -626,33 +626,33 @@ const messageColor = (id) => {
     : {
         background: '#eea7a752',
         color: '#ff2b2b',
-      };
-};
+      }
+}
 
-const currentDismissCountPage = $ref(1);
+const currentDismissCountPage = $ref(1)
 const handleCurrentDismissCountPageChange = (val) => {
-  currentDismissCountPage = val;
-};
+  currentDismissCountPage = val
+}
 
 onActivated(() => {
-  initLodop();
-});
+  initLodop()
+})
 
 onMounted(() => {
   getAllDictionary().then((res) => {
-    res.getOperations = operations;
-    res.getYesOrNo = yesOrNo;
-    res.getHaveOrNot = haveOrNot;
-    res.getAutopsies = autopsies;
-    dics = res;
+    res.getOperations = operations
+    res.getYesOrNo = yesOrNo
+    res.getHaveOrNot = haveOrNot
+    res.getAutopsies = autopsies
+    dics = res
     getAllWards().then((res1) => {
-      userWards = res1;
-      const t = getOneMonthOffset();
-      dateRange[0] = t.start;
-      dateRange[1] = t.end;
-    });
-  });
-});
+      userWards = res1
+      const t = getOneMonthOffset()
+      dateRange[0] = t.start
+      dateRange[1] = t.end
+    })
+  })
+})
 </script>
 
 <style scoped>