Ver código fonte

解决医技项目录入中没有小科室问题

xiaochan 2 anos atrás
pai
commit
6dc960b990

+ 29 - 32
src/components/med-tec-mod/YiJiXiangMuLuRu.vue

@@ -24,7 +24,8 @@
       </el-select>
       小科室:
       <el-select v-model="queryDept" filterable style="width: 120px">
-        <el-option v-for="item in xiaoKeShiList" :key="item.code" :label="item.name" :value="item.code">
+        <el-option v-for="item in xiaoKeShiList"
+                   :key="item.code" :label="item.name" :value="item.code">
           <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
           <el-divider direction="vertical"></el-divider>
           <span>{{ item.name }}</span></el-option>
@@ -106,6 +107,7 @@
       <el-divider direction="vertical"></el-divider>
       <el-switch
           v-model="xiangMuHuoYaoPinFlag"
+          @change="clearXiangMuHuoYaoPinShuJu"
           :active-value="1"
           :inactive-value="0"
           active-color="#409EFF"
@@ -198,6 +200,7 @@ import {clone} from '@/utils/clone'
 import HuoQuMuBan from './HuoQuMuBan.vue'
 import {stringIsBlank} from "@/utils/blank-utils";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
+import sleep from "@/utils/sleep";
 
 
 const props = defineProps({
@@ -223,9 +226,6 @@ const queryWard = ref('')
 
 const xiaoKeShiList = ref([])
 
-const muBanHandleCurrentChange = (val) => {
-  muBanCurrentPage.value = val
-}
 // 获取模板信息
 const getMuBanXinXiClick = (row) => {
   getMuBanXinXi(row.name, row.opIdCode).then((res) => {
@@ -250,16 +250,6 @@ const xuanZeXiangMuTable = (param) => {
 
 const chargeCode = ref([])
 
-onMounted(() => {
-  // 获取科室
-  getDept().then((res) => {
-    deptData.value = res
-  })
-  getWard().then((res) => {
-    wardData.value = res
-  })
-})
-
 const feiYongShuJu = ref([])
 
 const shangChuanXiangMu = () => {
@@ -282,6 +272,7 @@ const shangChuanXiangMu = () => {
     ledgerSn: props.patient.ledgerSn,
   };
 
+
   if (feiYongShuJu.value.length === 0) {
     return ElMessage.error('请先选择上传数据。')
   }
@@ -363,17 +354,6 @@ const xiangMuZongJia = computed(() => {
   return sum.toFixed(2)
 })
 
-watch(
-    () => props.patient,
-    () => {
-      // 这里刚好是反着的
-      queryWard.value = props.patient.admissDept
-      getBingQuDuiYingKeShiChange()
-      setTimeout(() => {
-        queryDept.value = props.patient.zkWard
-      }, 100)
-    }
-)
 // 以下是保存模板
 const baoCunMuBanDialog = ref(false)
 
@@ -423,7 +403,6 @@ const baoCunMuBan = () => {
 const getBingQuDuiYingKeShiChange = () => {
   getBingQuDuiYingKeShi(queryWard.value).then((res) => {
     xiaoKeShiList.value = res
-    queryDept.value = ''
   })
 }
 const zhiXingKeShi = ref(store.state.user.info.deptCode)
@@ -443,12 +422,10 @@ const xinZhengCurrentChange = (val) => {
   xiangMuHuoYaoPinShuJu.value.currentPage = val
 }
 
-watch(
-    () => xiangMuHuoYaoPinFlag.value,
-    () => {
-      xiangMuHuoYaoPinShuJu.value.data = []
-    }
-)
+const clearXiangMuHuoYaoPinShuJu = () => {
+  xiangMuHuoYaoPinShuJu.value.data = []
+}
+
 const renYuanList = ref([])
 
 // 搜索 医生工号
@@ -464,6 +441,26 @@ function operationRoom() {
   return dept === '1300000'
 }
 
+const updateDeptAndWard = async (ward, dept) => {
+  queryWard.value = ward
+  await getBingQuDuiYingKeShiChange()
+  queryDept.value = dept
+}
+
+onMounted(() => {
+  // 获取科室
+  getDept().then((res) => {
+    deptData.value = res
+  })
+  getWard().then((res) => {
+    wardData.value = res
+  })
+})
+
+defineExpose({
+  updateDeptAndWard
+})
+
 </script>
 
 <style></style>

+ 1 - 2
src/components/xiao-chan/xc-table-v2/XcTableV2.vue

@@ -154,8 +154,7 @@ const typeEnum = {
                             e.preventDefault();
                             selectedAll.value = !selectedAll.value
                             clickSelectedAll(selectedAll.value)
-                          }}
-      />)
+                          }}/>)
     },
     body: ({data, index}) => {
       return h(ElCheckbox, {

+ 140 - 157
src/views/med-tec-mod/YiJiFeiYongLuRu.vue

@@ -97,14 +97,16 @@
           ></huan-zhe-fei-yong>
         </el-tab-pane>
         <el-tab-pane label="费用录入" name="fylr">
-          <xiang-mu-lu-ru :patient="patient" @the-upload-is-successful="theUploadIsSuccessful"></xiang-mu-lu-ru>
+          <xiang-mu-lu-ru :patient="patient"
+                          ref="xlmrRef"
+                          @the-upload-is-successful="theUploadIsSuccessful"/>
         </el-tab-pane>
       </el-tabs>
     </el-main>
   </el-container>
 </template>
 
-<script>
+<script setup>
 import {ref} from 'vue'
 import store from '@/store'
 import {getHuanZheXinXi} from '@/api/zhu-yuan-yi-ji/yi-ji-fei-yong-lu-ru'
@@ -121,176 +123,157 @@ import {downloadExcel} from '@/utils/excel'
 import {getServerDateApi} from "@/api/public-api";
 import {userInfoStore} from "@/utils/store-public";
 
-export default {
-  components: {HuanZheFeiYong, XiangMuLuRu},
-  name: 'yiJiFeiYongLuRu',
-  setup() {
-    const dangQianShiJian = new Date()
-    const deptList = userInfoStore.value.partTimeDeptMap
+const dangQianShiJian = new Date()
+const deptList = userInfoStore.value.partTimeDeptMap
 
-    const queryTerm = ref({
-      inpatientNo: '',
-      admissTimes: 0,
-      zaiHuanChuYuan: '',
-      dateRange: [dangQianShiJian, dangQianShiJian],
-      riQiPaiXu: 'DESC',
-      chargeCode: '',
-      orderNo: 2,
-      feiYongLeiXingCode: 0,
-      dept: store.state.user.info.deptCode === '3100000' ? '' : store.state.user.info.deptCode,
-      currentPage: 1,
-      pageSize: 30,
-      total: 0,
-      tuiFeiFlag: 0,
-    })
+const xlmrRef = ref()
 
-    const total = ref(0)
+const queryTerm = ref({
+  inpatientNo: '',
+  admissTimes: 0,
+  zaiHuanChuYuan: '',
+  dateRange: [dangQianShiJian, dangQianShiJian],
+  riQiPaiXu: 'DESC',
+  chargeCode: '',
+  orderNo: 2,
+  feiYongLeiXingCode: 0,
+  dept: store.state.user.info.deptCode === '3100000' ? '' : store.state.user.info.deptCode,
+  currentPage: 1,
+  pageSize: 30,
+  total: 0,
+  tuiFeiFlag: 0,
+})
 
-    const elTabPane = ref('ylrfy')
-    const patient = ref({})
+const total = ref(0)
 
-    const tableDataHuanZheFeiYong = ref([])
+const elTabPane = ref('ylrfy')
+const patient = ref({})
 
-    const getHuanZheXinXiClick = () => {
-      if (queryTerm.value.zaiHuanChuYuan === 0) {
-        queryTerm.value.admissTimes = 0
-      }
-      if (patient.inpatientNo === queryTerm.value.inpatientNo) {
-        queryHuanZheFeiYong()
-      } else {
-        getHuanZheXinXi(queryTerm.value.inpatientNo, queryTerm.value.zaiHuanChuYuan, queryTerm.value.admissTimes)
-            .then((res) => {
-              patient.value = res
-              patient.value.feiYongLeiXingCode = queryTerm.value.feiYongLeiXingCode
-              queryTerm.value.admissTimes = res.admissTimes
-              queryHuanZheFeiYong()
-            })
-            .catch(() => {
-              patient.value = {}
-              tableDataHuanZheFeiYong.value = []
-            })
-      }
-    }
+const tableDataHuanZheFeiYong = ref([])
 
-    const queryHuanZheFeiYong = () => {
-      if (elTabPane.value !== 'ylrfy') return
-      let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
-      queryTerm.value.startTime = dateRangeS.startTime
-      queryTerm.value.endTime = dateRangeS.endTime
-      queryTerm.value.currentPage = 1
-      queryTerm.value.total = 0
-      getHuanZheFeiYong(queryTerm.value)
-          .then((res) => {
-            total.value = res.total
-            patient.value.total = total.value
-            tableDataHuanZheFeiYong.value = res
-          })
-          .catch(() => {
-            tableDataHuanZheFeiYong.value = []
-          })
-    }
+const getHuanZheXinXiClick = () => {
+  if (queryTerm.value.zaiHuanChuYuan === 0) {
+    queryTerm.value.admissTimes = 0
+  }
+  if (patient.inpatientNo === queryTerm.value.inpatientNo) {
+    queryHuanZheFeiYong()
+  } else {
+    getHuanZheXinXi(queryTerm.value.inpatientNo, queryTerm.value.zaiHuanChuYuan, queryTerm.value.admissTimes)
+        .then((res) => {
+          console.log(res)
+          console.log(xlmrRef)
+          xlmrRef.value.updateDeptAndWard(res.admissDept, res.zkWard)
+          patient.value = res
+          patient.value.feiYongLeiXingCode = queryTerm.value.feiYongLeiXingCode
+          queryTerm.value.admissTimes = res.admissTimes
+          queryHuanZheFeiYong()
+          // 第一个参数病区, 第二个参数科室 , 这里是需要反过来的
 
-    const handleHuanZheFeiYong = () => {
-      if (elTabPane.value !== 'ylrfy') return
-      let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
-      queryTerm.value.startTime = dateRangeS.startTime
-      queryTerm.value.endTime = dateRangeS.endTime
-      queryTerm.value.total = total.value
-      getHuanZheFeiYong(queryTerm.value)
-          .then((res) => {
-            res.total = total.value
-            tableDataHuanZheFeiYong.value = res
-          })
-          .catch(() => {
-            tableDataHuanZheFeiYong.value = []
-          })
-    }
+        })
+        .catch(() => {
+          patient.value = {}
+          tableDataHuanZheFeiYong.value = []
+        })
+  }
+}
 
-    // 根据项目名称来查询
-    const chargeCodeNameData = ref([])
+const queryHuanZheFeiYong = () => {
+  if (elTabPane.value !== 'ylrfy') return
+  let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
+  queryTerm.value.startTime = dateRangeS.startTime
+  queryTerm.value.endTime = dateRangeS.endTime
+  queryTerm.value.currentPage = 1
+  queryTerm.value.total = 0
+  getHuanZheFeiYong(queryTerm.value)
+      .then((res) => {
+        total.value = res.total
+        patient.value.total = total.value
+        tableDataHuanZheFeiYong.value = res
+      })
+      .catch(() => {
+        tableDataHuanZheFeiYong.value = []
+      })
+}
 
-    /**
-     * 远程搜索
-     */
-    const remoteMethodChargeCode = (val) => {
-      if (val.length >= 2) {
-        getChargeCode(val).then((res) => {
-          chargeCodeNameData.value = res
-        })
-      }
-    }
+const handleHuanZheFeiYong = () => {
+  if (elTabPane.value !== 'ylrfy') return
+  let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
+  queryTerm.value.startTime = dateRangeS.startTime
+  queryTerm.value.endTime = dateRangeS.endTime
+  queryTerm.value.total = total.value
+  getHuanZheFeiYong(queryTerm.value)
+      .then((res) => {
+        res.total = total.value
+        tableDataHuanZheFeiYong.value = res
+      })
+      .catch(() => {
+        tableDataHuanZheFeiYong.value = []
+      })
+}
+
+// 根据项目名称来查询
+const chargeCodeNameData = ref([])
+
+/**
+ * 远程搜索
+ */
+const remoteMethodChargeCode = (val) => {
+  if (val.length >= 2) {
+    getChargeCode(val).then((res) => {
+      chargeCodeNameData.value = res
+    })
+  }
+}
 
-    // 分页
-    const handleSizeChange = (val) => {
-      queryTerm.value.pageSize = val.val
-      patient.value.pageSize = val.val
-      queryHuanZheFeiYong()
-    }
+// 分页
+const handleSizeChange = (val) => {
+  queryTerm.value.pageSize = val.val
+  patient.value.pageSize = val.val
+  queryHuanZheFeiYong()
+}
 
-    const handleCurrentChange = (val) => {
-      queryTerm.value.currentPage = val.val
-      handleHuanZheFeiYong()
-    }
+const handleCurrentChange = (val) => {
+  queryTerm.value.currentPage = val.val
+  handleHuanZheFeiYong()
+}
 
-    // 导出excel 表格
-    const exportExecl = () => {
-      if (total.value > 0) {
-        ElMessageBox.prompt('导出文件名字', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          inputPattern: /\S/,
-          inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
+// 导出excel 表格
+const exportExecl = () => {
+  if (total.value > 0) {
+    ElMessageBox.prompt('导出文件名字', '提示', {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      inputPattern: /\S/,
+      inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
+    })
+        .then(({value}) => {
+          queryTerm.value.total = total.value
+          const data = {
+            param: queryTerm.value,
+            url: '/xmlr/exportExcel',
+            fileName: `${value}.xlsx`,
+          }
+          setTimeout(() => {
+            downloadExcel(data)
+          }, 500)
         })
-            .then(({value}) => {
-              queryTerm.value.total = total.value
-              const data = {
-                param: queryTerm.value,
-                url: '/xmlr/exportExcel',
-                fileName: `${value}.xlsx`,
-              }
-              setTimeout(() => {
-                downloadExcel(data)
-              }, 500)
-            })
-            .catch((e) => {
-            })
-      } else {
-        ElMessage.error('请先查询出数据')
-      }
-    }
-
-    const theUploadIsSuccessful = async () => {
-      elTabPane.value = 'ylrfy'
-      let now = await getServerDateApi()
-      queryTerm.value.dateRange = [now, now]
-      queryTerm.value.feiYongLeiXingCode = 0
-      queryTerm.value.orderNo = 2
-      queryTerm.value.tuiFeiFlag = 0
-      queryHuanZheFeiYong()
-    }
+        .catch((e) => {
+        })
+  } else {
+    ElMessage.error('请先查询出数据')
+  }
+}
 
-    return {
-      queryTerm,
-      getHuanZheXinXiClick,
-      tableDataHuanZheFeiYong,
-      patient,
-      cptSex,
-      queryHuanZheFeiYong,
-      chargeCodeNameData,
-      remoteMethodChargeCode,
-      elTabPane,
-      yiZhuTuiFeiLeiXing,
-      tuiFeiLeiXin,
-      shortcuts,
-      feiYongLeiXing,
-      handleSizeChange,
-      handleCurrentChange,
-      exportExecl,
-      deptList,
-      theUploadIsSuccessful
-    }
-  },
+const theUploadIsSuccessful = async () => {
+  elTabPane.value = 'ylrfy'
+  let now = await getServerDateApi()
+  queryTerm.value.dateRange = [now, now]
+  queryTerm.value.feiYongLeiXingCode = 0
+  queryTerm.value.orderNo = 2
+  queryTerm.value.tuiFeiFlag = 0
+  queryHuanZheFeiYong()
 }
+
 </script>
 
 <style></style>