wupengfei
2025-04-01 4923681d933b455972166552dfb7538cd18f5808
src/views/Home/BatchChange.vue
@@ -121,6 +121,7 @@
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import { paginateList } from '@/utils';
import dayjs from 'dayjs';
import _ from 'lodash';
defineOptions({
  name: 'BatchChange',
@@ -292,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) {