|
@@ -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>
|