lighter 1 anno fa
parent
commit
4a2fc49e68

+ 10 - 3
src/components/ModifyAdverseEvent.vue

@@ -22,7 +22,7 @@
             <el-tag type="info">发生科室:</el-tag>
             <div></div>
             <el-select v-model="report.deptCode" placeholder="请选择" style="width: 100%">
-              <el-option v-for="item in dict.depts" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>
+              <el-option v-for="item in depts" :key="item.code" :label="item.name" :value="item.code"></el-option>
             </el-select>
           </el-col>
         </el-row>
@@ -157,7 +157,8 @@
 </template>
 
 <script>
-import { dict } from '../data/adverse-event'
+import { dict } from '@/data/adverse-event'
+import {getAllDepts} from '@/api/adverse-event'
 export default {
   name: 'ModifyAdverseEvent',
   props: {
@@ -168,13 +169,19 @@ export default {
     },
   },
   setup(props, ctx) {
+    const depts = ref([])
     const cancelModify = () => {
       ctx.emit('cancel-modify')
     }
     const confirmModify = () => {
       ctx.emit('confirm-modify', props.report)
     }
-    return { dict, cancelModify, confirmModify }
+    onMounted(() => {
+      getAllDepts().then(res => {
+        depts.value = res
+      })
+    })
+    return { depts, dict, cancelModify, confirmModify }
   },
 }
 </script>

+ 0 - 38
src/data/adverse-event.js

@@ -105,44 +105,6 @@ export const dict = {
     { name: '完善人员培训机制', id: 13 },
     { name: '排班根据病人的病情,护士的能力进行合理的排班', id: 14 },
   ],
-  depts: [
-    { deptId: '3100000', deptName: '信息中心' },
-    { deptId: '8000001', deptName: '一(1区)病室' },
-    { deptId: '8000160', deptName: 'ICU病房' },
-    { deptId: '8000012', deptName: '十二病室' },
-    { deptId: '8000061', deptName: '六一病室' },
-    { deptId: '8000013', deptName: '十三病室' },
-    { deptId: '8000014', deptName: '十四病室' },
-    { deptId: '8000017', deptName: '十七病室' },
-    { deptId: '8000002', deptName: '二病室' },
-    { deptId: '8000016', deptName: '十六(1区)病室' },
-    { deptId: '8000020', deptName: '二十病室' },
-    { deptId: '8000021', deptName: '二十一病室' },
-    { deptId: '1070000', deptName: '急诊科' },
-    { deptId: '8000+10', deptName: '加十病室' },
-    { deptId: '8000+07', deptName: '加七病室' },
-    { deptId: '8000+16', deptName: '十六(2区)病室' },
-    { deptId: '8000003', deptName: '三病室' },
-    { deptId: '8000004', deptName: '四病室' },
-    { deptId: '8000005', deptName: '五病室' },
-    { deptId: '8000006', deptName: '六病室' },
-    { deptId: '8000007', deptName: '七病室' },
-    { deptId: '8000008', deptName: '八病室' },
-    { deptId: '8000009', deptName: '九病室' },
-    { deptId: '8000010', deptName: '十病室' },
-    { deptId: '8000011', deptName: '十一病室' },
-    { deptId: '8000018', deptName: '十八病室' },
-    { deptId: '8000019', deptName: '十九病室' },
-    { deptId: '8000+06', deptName: '加六病室' },
-    { deptId: '80000+1', deptName: '一(2区)病室' },
-    { deptId: '1020510', deptName: '血液净化中心' },
-    { deptId: '2110000', deptName: '消毒供应室' },
-    { deptId: '1300000', deptName: '手术室' },
-    { deptId: '2020100', deptName: '放射科' },
-    { deptId: '2050000', deptName: '高压氧科' },
-    { deptId: '8000015', deptName: '十五病室' },
-    { deptId: '3150000', deptName: 'Ⅰ期临床试验研究室'},
-  ],
   categories: [
     {
       children: [

+ 63 - 77
src/views/hospitalization/adverse-event/FillAderverseEvent.vue

@@ -43,7 +43,7 @@
               <el-tag type="info">发生科室:</el-tag>
               <div></div>
               <el-select v-model="report.deptCode" placeholder="请选择" style="width: 100%">
-                <el-option v-for="item in dict.depts" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>
+                <el-option v-for="item in depts" :key="item.code" :label="item.name" :value="item.code"></el-option>
               </el-select>
             </el-col>
           </el-row>
@@ -174,94 +174,80 @@
   </page-layer>
 </template>
 
-<script>
+<script setup>
 import { computed, onMounted, ref } from 'vue'
 import { dict } from '@/data/adverse-event'
 import { ElMessage, ElMessageBox } from 'element-plus'
-import { getHistories, getReportDetail, submitNewReport } from '@/api/adverse-event'
+import { getAllDepts, getHistories, getReportDetail, submitNewReport } from '@/api/adverse-event'
 import store from '@/store'
 import { formatDatetime } from '@/utils/date'
 import PageLayer from "@/layout/PageLayer";
-export default {
-  components: {PageLayer},
-  setup() {
-    const windowSize = store.state.app.windowSize
-    const tableHeight = windowSize.h - 5
-    const histories = ref([])
-    const report = initReport()
-    const isModify = ref(false)
-    const fetchHistories = () => {
-      getHistories().then((res) => {
-        histories.value = res
-      })
-    }
-    const fetchReportDetail = (val) => {
-      getReportDetail(val.pid, 'nurse').then((res) => {
-        report.value = res
-        isModify.value = true
-      })
-    }
 
-    const genNewReport = () => {
-      report.value = initReport().value
-      isModify.value = false
-    }
+const windowSize = store.state.app.windowSize
+const tableHeight = windowSize.h - 5
+const depts = ref([])
+const histories = ref([])
+const report = initReport()
+const isModify = ref(false)
+const fetchHistories = () => {
+  getHistories().then((res) => {
+    histories.value = res
+  })
+}
+const fetchReportDetail = (val) => {
+  getReportDetail(val.pid, 'nurse').then((res) => {
+    report.value = res
+    isModify.value = true
+  })
+}
 
-    const beforeSubmit = () => {
-      const message = validateReport(report.value)
-      if (message) {
-        ElMessage({
-          message,
-          type: 'warning',
-          duration: 2500,
-          showClose: true,
-        })
-        return
-      }
-      ElMessageBox.confirm('确定提交此报告?', '提示', {
-        type: 'warning',
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-      })
-        .then(() => {
-          report.value.isModify = isModify.value
-          report.value.occurDatetime = formatDatetime(report.value.occurDatetime)
-          submitNewReport(report.value).then(() => {
-            ElMessage({
-              message: '提交成功。',
-              type: 'success',
-              duration: 2000,
-              showClose: true,
-            })
-            fetchHistories()
-            genNewReport()
+const genNewReport = () => {
+  report.value = initReport().value
+  isModify.value = false
+}
+
+const beforeSubmit = () => {
+  const message = validateReport(report.value)
+  if (message) {
+    ElMessage({
+      message,
+      type: 'warning',
+      duration: 2500,
+      showClose: true,
+    })
+    return
+  }
+  ElMessageBox.confirm('确定提交此报告?', '提示', {
+    type: 'warning',
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+  }).then(() => {
+        report.value.isModify = isModify.value
+        report.value.occurDatetime = formatDatetime(report.value.occurDatetime)
+        submitNewReport(report.value).then(() => {
+          ElMessage({
+            message: '提交成功。',
+            type: 'success',
+            duration: 2000,
+            showClose: true,
           })
+          fetchHistories()
+          genNewReport()
         })
-        .catch(() => {})
-    }
+      })
+      .catch(() => {})
+}
 
-    const disableSubmit = computed(() => {
-      return report.value.handled === 1
-    })
+const disableSubmit = computed(() => {
+  return report.value.handled === 1
+})
 
-    onMounted(() => {
-      fetchHistories()
-    })
-    return {
-      tableHeight,
-      dict,
-      report,
-      fetchHistories,
-      genNewReport,
-      beforeSubmit,
-      histories,
-      filterAccepted,
-      filterHandled,
-      fetchReportDetail,
-      disableSubmit,
-    }
-  },
-}
+onMounted(() => {
+  getAllDepts().then(res => {
+    depts.value = res
+    fetchHistories()
+  })
+})
 
 function initReport() {
   return ref({

+ 8 - 8
src/views/reports/DeptPeriodReport.vue

@@ -86,13 +86,14 @@
 
 <script>
 import store from '@/store'
-import { computed, reactive, ref } from 'vue'
-import { ElMessage } from 'element-plus'
-import { getAllWards, getDeptEarn, getDoctorEarn, getPatientBill } from '@/api/reports/dept-period-report'
-import { writeExcelFile, createWorkSheet } from '@/utils/excel'
-import { getOneMonthOffset, formatDate } from '@/utils/date'
-import { shortcuts } from '@/data/shortcuts'
+import {computed, reactive, ref} from 'vue'
+import {ElMessage} from 'element-plus'
+import {getAllWards, getDeptEarn, getDoctorEarn, getPatientBill} from '@/api/reports/dept-period-report'
+import {createWorkSheet, writeExcelFile} from '@/utils/excel'
+import {formatDate, getOneMonthOffset} from '@/utils/date'
+import {shortcuts} from '@/data/shortcuts'
 import PageLayer from "@/layout/PageLayer";
+
 export default {
   components: {PageLayer},
   setup() {
@@ -243,13 +244,12 @@ export default {
 
 function initRequestParam() {
   const { start, end } = getOneMonthOffset()
-  const requestParam = reactive({
+  return reactive({
     datePeriod: [start, end],
     start: start,
     end: end,
     depts: [],
   })
-  return requestParam
 }
 
 function initData() {