wupengfei
2025-03-24 80dd2bebbe3d204cc7833a4793aba67bba356b1d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<template>
  <LoadingLayout :loading="state.loading">
    <AppScrollContainer>
      <ChunkCell title="1">
        <template #title>
          <div class="batch-change-title">
            <el-text style="margin-right: 20px">{{ `保单号:${'958585860689'}` }}</el-text>
            <el-text>{{ `投保人:${'人力无忧'}` }}</el-text>
          </div>
        </template>
        <ProForm :model="state.form" ref="formRef" label-width="120px">
          <ProFormCol>
            <ProFormColItem :span="8">
              <ProFormItemV2
                label="期望生效日期:"
                prop="time"
                :check-rules="[{ message: '请选择日期' }]"
              >
                <ProFormDatePicker
                  v-model="state.form.time"
                  type="date"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择日期"
                ></ProFormDatePicker>
              </ProFormItemV2>
            </ProFormColItem>
          </ProFormCol>
          <ProFormCol>
            <ProFormColItem :span="8">
              <ProFormItemV2 label="" prop="url" label-width="0">
                <ProFormUpload
                  v-model:file-url="state.form.url"
                  :limit="1"
                  :limitFileSize="10"
                  accept="xlsx,xls"
                  :showTip="false"
                >
                  <template #default>
                    <el-button type="primary">加减人</el-button>
                    <el-button link type="primary" @click.stop="DownloadAddOrReducePersonTemplate"
                      >下载模板</el-button
                    >
                  </template>
                </ProFormUpload>
              </ProFormItemV2>
            </ProFormColItem>
          </ProFormCol>
          <ProFormCol>
            <ProFormColItem :span="8">
              <ProFormItemV2 label="" prop="url" label-width="0">
                <ProFormUpload
                  v-model:file-url="state.form.url"
                  :limit="1"
                  :limitFileSize="10"
                  accept="xlsx,xls"
                  :showTip="false"
                >
                  <template #default>
                    <el-button type="primary">替换人</el-button>
                    <el-button link type="primary" @click.stop="downloadReplacePersonTemplate"
                      >下载模板</el-button
                    >
                  </template>
                </ProFormUpload>
              </ProFormItemV2>
            </ProFormColItem>
          </ProFormCol>
        </ProForm>
      </ChunkCell>
      <ChunkCell title="批改人员详情">
        <template #titleRight>
          <el-button type="primary" @click="handleClear">清空数据</el-button>
        </template>
        <ProTableV2
          v-bind="proTableProps"
          :columns="column"
          :show-operation-column="false"
          :auto-height="false"
          ref="proTable"
          :tableProps="{
            maxHeight: '400px',
          }"
        >
        </ProTableV2>
        <div class="chuck-add-or-edit-actions">
          <el-button class="chuck-add-or-edit-actions btn" type="primary" @click="handleSubmit"
            >提交</el-button
          >
        </div>
      </ChunkCell>
    </AppScrollContainer>
  </LoadingLayout>
</template>
 
<script setup lang="ts">
import {
  LoadingLayout,
  AppScrollContainer,
  ProForm,
  ProFormItemV2,
  ChunkCell,
  ProFormCol,
  ProFormColItem,
  ProFormDatePicker,
  useTable,
  ProTableV2,
  ProFormUpload,
  UploadUserFile,
} from '@bole-core/components';
import * as insuranceOrderServices from '@/services/api/InsuranceOrder';
import { downloadFileByUrl, OrderInputType } from '@bole-core/core';
import { InsuranceAddOrReduceTempPath, InsuranceChangeTempPath } from '@/constants';
 
defineOptions({
  name: 'BatchChange',
});
 
const column: API.CustomModuleColumnDto[] = [
  {
    id: '1',
    enCode: 'name',
    name: '批改类型',
  },
  {
    id: '2',
    enCode: 'name',
    name: '姓名',
  },
  {
    id: '3',
    enCode: 'name',
    name: '身份证号',
  },
  {
    id: '4',
    enCode: 'idNumber',
    name: '雇员工种',
  },
  {
    id: '5',
    enCode: 'idNumber',
    name: '性别',
  },
  {
    id: '6',
    enCode: 'idNumber',
    name: '年龄',
  },
  {
    id: '7',
    enCode: 'idNumber',
    name: '出生日期',
  },
  {
    id: '8',
    enCode: 'idNumber',
    name: '手机号码',
  },
];
 
const route = useRoute();
const id = route.params.id as string;
const BaseState = {
  loading: true,
  form: {
    time: '',
    url: [] as UploadUserFile[],
  },
};
 
const state = reactive({ ...BaseState });
 
const {
  getDataSource: getBatchRefundInfoDetail,
  proTableProps,
  paginationState,
  extraParamState,
  reset,
} = useTable(
  async ({ pageIndex, pageSize }, extraParamState) => {
    try {
      let params: API.QueryInsuranceOrderPageInput = {
        pageModel: {
          rows: pageSize,
          page: pageIndex,
          orderInput: extraParamState.orderInput,
        },
        condition: extraParamState.keyWord,
        // insurePolicyOperateHistoryId: id,
      };
      let res = await insuranceOrderServices.getInsuranceOrderPage(params, {
        showLoading: !state.loading,
      });
      return res;
    } catch (error) {}
  },
  {
    defaultExtraParams: {
      keyWord: '',
      orderInput: [{ property: 'id', order: OrderInputType.Asc }],
    },
    columnsRenderProps: {},
  }
);
 
function handleClear() {}
function handleSubmit() {}
function DownloadAddOrReducePersonTemplate() {
  downloadFileByUrl(InsuranceAddOrReduceTempPath, '加减人模板');
}
function downloadReplacePersonTemplate() {
  downloadFileByUrl(InsuranceChangeTempPath, '替换人模板');
}
 
onMounted(async () => {
  await getBatchRefundInfoDetail();
  state.loading = false;
});
</script>
 
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
 
.chuck-add-or-edit-actions {
  &.btn {
    margin-bottom: 20px;
  }
}
</style>