| | |
| | | :limitFileSize="10" |
| | | accept="xlsx,xls" |
| | | :showTip="false" |
| | | :on-success="handleUploadAddOrReduce" |
| | | > |
| | | <template #default> |
| | | <el-button type="primary">加减人</el-button> |
| | |
| | | :limitFileSize="10" |
| | | accept="xlsx,xls" |
| | | :showTip="false" |
| | | :on-success="handleUploadReplace" |
| | | > |
| | | <template #default> |
| | | <el-button type="primary">替换人</el-button> |
| | |
| | | UploadUserFile, |
| | | } from '@bole-core/components'; |
| | | import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; |
| | | import { downloadFileByUrl, OrderInputType } from '@bole-core/core'; |
| | | import * as insureBatchBillServices from '@/services/api/InsureBatchBill'; |
| | | import { downloadFileByUrl, Message, OrderInputType } from '@bole-core/core'; |
| | | import { InsuranceAddOrReduceTempPath, InsuranceChangeTempPath } from '@/constants'; |
| | | import { useRouteView } from '@/hooks'; |
| | | import { FormInstance } from 'element-plus'; |
| | | |
| | | defineOptions({ |
| | | name: 'BatchChange', |
| | |
| | | ]; |
| | | |
| | | const route = useRoute(); |
| | | const { closeViewPush } = useRouteView(); |
| | | const id = route.params.id as string; |
| | | const BaseState = { |
| | | loading: true, |
| | |
| | | } |
| | | ); |
| | | |
| | | async function handleUploadAddOrReduce(response: UploadUserFile) { |
| | | try { |
| | | let params: API.ImportBatchAddOrSubOrderInput = { |
| | | url: response.path, |
| | | insurePolicyId: id, |
| | | }; |
| | | let res = await insureBatchBillServices.importBatchAddOrSubOrderData(params); |
| | | } catch (error) {} |
| | | } |
| | | async function handleUploadReplace(response: UploadUserFile) { |
| | | try { |
| | | let params: API.ImportBatchAddOrSubOrderInput = { |
| | | url: response.path, |
| | | insurePolicyId: id, |
| | | }; |
| | | let res = await insureBatchBillServices.importBatchUpdateOrderData(params); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function handleClear() {} |
| | | function handleSubmit() {} |
| | | |
| | | const formRef = ref<FormInstance>(); |
| | | function handleSubmit() { |
| | | if (!formRef.value) return; |
| | | formRef.value.validate((valid) => { |
| | | if (valid) { |
| | | addOrUpdateInsureBatchBill(); |
| | | } else { |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | async function addOrUpdateInsureBatchBill() { |
| | | try { |
| | | let params = {}; |
| | | let res = await insureBatchBillServices.addOrUpdateInsureBatchBill(params); |
| | | if (res) { |
| | | Message.successMessage('提交成功'); |
| | | handleBack(); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function DownloadAddOrReducePersonTemplate() { |
| | | downloadFileByUrl(InsuranceAddOrReduceTempPath, '加减人模板'); |
| | | } |
| | |
| | | downloadFileByUrl(InsuranceChangeTempPath, '替换人模板'); |
| | | } |
| | | |
| | | function handleBack() { |
| | | closeViewPush(route, { |
| | | name: 'Home', |
| | | }); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await getBatchRefundInfoDetail(); |
| | | state.loading = false; |