From 4923681d933b455972166552dfb7538cd18f5808 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期二, 01 四月 2025 18:49:21 +0800 Subject: [PATCH] fix: bug --- src/views/Home/BatchChange.vue | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/views/Home/BatchChange.vue b/src/views/Home/BatchChange.vue index 2fa1b22..0fe1fc9 100644 --- a/src/views/Home/BatchChange.vue +++ b/src/views/Home/BatchChange.vue @@ -21,6 +21,7 @@ type="date" value-format="YYYY-MM-DD" placeholder="璇烽�夋嫨鏃ユ湡" + :disabled-date="disabledDate" ></ProFormDatePicker> </ProFormItemV2> </ProFormColItem> @@ -119,6 +120,8 @@ import { FormInstance } from 'element-plus'; import { useQuery, useQueryClient } from '@tanstack/vue-query'; import { paginateList } from '@/utils'; +import dayjs from 'dayjs'; +import _ from 'lodash'; defineOptions({ name: 'BatchChange', @@ -172,6 +175,7 @@ const id = route.params.id as string; const insurerName = route.query.insurerName as string; const insureBillNo = route.query.insureBillNo as string; +const effectEndTime = route.query.effectEndTime as string; const BaseState = { loading: true, form: { @@ -183,6 +187,12 @@ }; const state = reactive({ ...BaseState }); + +const disabledDate = computed(() => { + return (time: Date) => { + return dayjs(time).isBefore(dayjs(), 'day') || dayjs(time).isAfter(dayjs(effectEndTime), 'day'); + }; +}); const urlDisabled = computed(() => { return state.form.addOrReduceUrl.length > 0 || state.form.replaceUrl.length > 0; @@ -283,12 +293,16 @@ Message.errorMessage('璇峰厛涓婁紶浜哄憳鍚嶅崟'); return; } + let _addInsStaffList = _.uniqBy(state.staffList, 'idNumber'); let params: API.InsureBatchBillInput = { insurancePolicyId: id, effectTime: state.form.time, - addInsStaffList: state.staffList.filter((x) => x.changeFlag.includes('澧炲姞')), - updateInsStaffList: state.staffList.filter((x) => x.changeFlag.includes('鏇挎崲')), - delInsStaffList: state.staffList.filter((x) => x.changeFlag.includes('鍒犻櫎')), + addInsStaffList: _addInsStaffList.filter((x) => x.changeFlag.includes('澧炲姞')), + updateInsStaffList: _.uniqBy( + _addInsStaffList.filter((x) => x.changeFlag.includes('鏇挎崲')), + 'orginIdNumber' + ), + delInsStaffList: _addInsStaffList.filter((x) => x.changeFlag.includes('鍒犻櫎')), }; let res = await insureBatchBillServices.addOrUpdateInsureBatchBill(params); if (res) { -- Gitblit v1.9.1