瀏覽代碼

Merge branch 'master' of https://172.16.32.165/lighter/vue-intergration-platform

xiaochan 1 月之前
父節點
當前提交
64fe3c56bb
共有 2 個文件被更改,包括 47 次插入5 次删除
  1. 1 1
      src/auto-imports.d.ts
  2. 46 4
      src/components/medical-insurance/charge-list/Charge.vue

+ 1 - 1
src/auto-imports.d.ts

@@ -65,6 +65,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 46 - 4
src/components/medical-insurance/charge-list/Charge.vue

@@ -8,6 +8,7 @@ import {
   selectPatOverviews,
 } from "@/api/inpatient/charge-list";
 import { getLodop } from "@/utils/c-lodop";
+import {formatDate, getDateRangeFormatDate} from "@/utils/date";
 
 const props = defineProps({
   patNo: {
@@ -44,6 +45,7 @@ const fetchOverview = () => {
     return;
   }
   selectPatOverviews(currentPatNo.value).then(res => {
+    dateRange.value = []
     patList.value = res;
   });
 };
@@ -52,10 +54,33 @@ const ajustDisdate = disdate => {
   return disdate ? disdate : '<span style="color: green">● 在院</span>';
 };
 
-const fetchBriefPatInfo = row => {
-  selectBriefPatInfo(row).then(res => {
+const showDateRange = ref(false)
+const dateRange = ref([])
+const currentRow = ref({})
+function openDateRange(row) {
+  if (dateRange.value.length === 0 || row.patNo !== currentRow.value.patNo || row.times !== currentRow.value.times) {
+    dateRange.value[0] = row.admdate
+    dateRange.value[1] = row.disdate ? row.disdate : new Date()
+  }
+  currentRow.value = row
+  showDateRange.value = true;
+}
+
+function cancelDateRange() {
+  showDateRange.value = false
+}
+
+function confirmDateRange() {
+  currentRow.value.begndate = formatDate(dateRange.value[0])
+  currentRow.value.enddate = formatDate(dateRange.value[1])
+  fetchBriefPatInfo()
+}
+
+const fetchBriefPatInfo = () => {
+  selectBriefPatInfo(currentRow.value).then(res => {
     briefPatInfo.value = res;
-    selectChargeList(row).then(rslt => {
+    showDateRange.value = false
+    selectChargeList(currentRow.value).then(rslt => {
       chargeListMap.value = rslt.chargeList;
       sumsMap.value = rslt.sumsMap;
     });
@@ -147,7 +172,7 @@ defineExpose({
         stripe
         highlight-current-row
         style="width: calc(100% - 10px)"
-        @row-click="fetchBriefPatInfo"
+        @row-click="openDateRange"
       >
         <el-table-column prop="times" label="次数" width="35"></el-table-column>
         <el-table-column prop="name" label="姓名" width="70"></el-table-column>
@@ -172,5 +197,22 @@ defineExpose({
         :charge-list-map="chargeListMap"
       />
     </div>
+
+    <el-dialog
+        v-model="showDateRange"
+        width="300px"
+        title="请选择时间范围"
+        :close-on-press-escape="false"
+        :close-on-click-modal="false"
+        :show-close="false"
+    >
+      <el-date-picker size="default" v-model="dateRange" type="daterange" style="width: 270px" />
+      <template #footer>
+        <div style="margin-top: 50px">
+          <el-button size="default" @click="cancelDateRange">取消</el-button>
+          <el-button size="default" type="primary" @click="confirmDateRange">确定</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>