From 27e7433ccf8adae78c7adb2bf7b578a7ae64174e Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期四, 23 十月 2025 13:24:29 +0800
Subject: [PATCH] fix: bug
---
src/views/Home/Home.vue | 362 ++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 326 insertions(+), 36 deletions(-)
diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue
index b78a7ca..761c9e1 100644
--- a/src/views/Home/Home.vue
+++ b/src/views/Home/Home.vue
@@ -18,7 +18,7 @@
<QueryFilterItem>
<FieldRadio
v-model="extraParamState.insurancePeriod"
- :value-enum="insuranceTypeText"
+ :value-enum="insuranceTypeTextForFilter"
buttonStyle
showAllBtn
@change="getList()"
@@ -27,7 +27,7 @@
<QueryFilterItem>
<FieldRadio
v-model="extraParamState.auditStatus"
- :value-enum="InsurancePolicyAuditStatusEnumText"
+ :value-enum="InsurancePolicyAuditStatusEnumTextForFilter"
buttonStyle
showAllBtn
@change="getList()"
@@ -53,10 +53,18 @@
</QueryFilterItem>
</template>
<template #btn>
+ <el-button
+ @click="handleDownloadOccupationType()"
+ type="primary"
+ style="margin-right: 10px"
+ link
+ v-if="isSjbAccount"
+ >鑱屼笟绫诲瀷瀵圭収琛�</el-button
+ >
<el-button @click="handleDownload()" type="primary" style="margin-right: 10px" link
>妯℃澘涓嬭浇</el-button
>
- <el-button @click="handleUpload()" type="primary" style="margin-right: 10px"
+ <el-button @click="handleOpenInstructions()" type="primary" style="margin-right: 10px"
>瀵煎叆鎶曚繚浜哄憳</el-button
>
<!-- <el-button
@@ -87,7 +95,7 @@
class="box-item"
effect="dark"
:content="row.auditRemark"
- placement="top-start"
+ placement="top"
v-if="row.auditStatus === InsurancePolicyAuditStatusEnum.Reject && row.auditRemark"
popper-class="max-width-popper"
>
@@ -104,6 +112,9 @@
</AppContainer>
<UploadInsurePersonDialog v-bind="dialogProps" />
<UploadStampFileDialog v-bind="dialogStampFileProps" />
+ <InsureInstructionsDialog v-bind="dialogInstructionsProps" />
+ <InsureLineModeSelectDialog v-bind="dialogLineModeSelectProps" />
+ <DisbursementDialog v-bind="dialogDisbursementProps" />
</LoadingLayout>
</template>
@@ -122,13 +133,22 @@
SearchInput,
FieldRadio,
XLSXUtils,
+ useDialog,
} from '@bole-core/components';
import * as insuranceOrderServices from '@/services/api/InsuranceOrder';
+import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import { Message, OrderInputType, downloadFileByUrl } from '@bole-core/core';
-import { columns } from './constants';
+import { columns, InsureLineMode } from './constants';
import UploadInsurePersonDialog from './components/UploadInsurePersonDialog.vue';
import UploadStampFileDialog from './components/UploadStampFileDialog.vue';
-import { format, downloadFile, setOSSLink, toThousand, convertApi2FormUrl } from '@/utils';
+import {
+ format,
+ downloadFile,
+ setOSSLink,
+ toThousand,
+ convertApi2FormUrl,
+ convertFormUrl2Api,
+} from '@/utils';
import { ModelValueType } from 'element-plus';
import {
InsuranceOrderTempPath,
@@ -137,11 +157,22 @@
InsurancePolicyStatusEnum,
AppType,
InsurancePolicyAuditStatusEnumText,
+ InsurancePolicyAuditStatusEnumTextForFilter,
InsurancePolicyAuditStatusEnum,
InsurancePolicyProductIdNumberEnum,
+ InsurancePolicyListPayStatusEnum,
+ InsurancePolicyListPayStatusEnumText,
+ InsuranceOccupationTypeTempPath,
+ InsurancePeriodEnum,
+ insuranceTypeTextForFilter,
} from '@/constants';
import dayjs from 'dayjs';
import _ from 'lodash';
+import InsureInstructionsDialog from './components/InsureInstructionsDialog.vue';
+import InsureLineModeSelectDialog from './components/InsureLineModeSelectDialog.vue';
+import DisbursementDialog from './components/DisbursementDialog.vue';
+import { useInsureProductSchemeAllList, useUserInsureProductSetting } from '@/hooks';
+// import { Recorder } from '@/utils/record';
defineOptions({
name: 'Home',
@@ -179,9 +210,16 @@
onClick: (role) => handleUploadStampFile(role),
},
extraProps: {
- hide: (row: API.GetInsurancePageOutput) =>
- row.auditStatus !== InsurancePolicyAuditStatusEnum.Pass ||
- row.status !== InsurancePolicyStatusEnum.WaitEffect,
+ hide: (row: API.GetInsurancePageOutput) => {
+ if (row.productOnline) {
+ return (
+ row.auditStatus !== InsurancePolicyAuditStatusEnum.WaitAdd &&
+ row.auditStatus !== InsurancePolicyAuditStatusEnum.WaitAudit
+ );
+ } else {
+ return row.status !== InsurancePolicyStatusEnum.WaitEffect;
+ }
+ },
},
},
{
@@ -193,9 +231,47 @@
onClick: (role) => handleDownloadInsureFile(role),
},
extraProps: {
- hide: (row: API.GetInsurancePageOutput) => !row.insureBillUrl,
+ hide: (row: API.GetInsurancePageOutput) => row.productOnline || !row.insureBillUrl,
},
},
+ // {
+ // data: {
+ // enCode: 'payBtn',
+ // name: '鏀粯',
+ // },
+ // emits: {
+ // onClick: (role) => handlePay(role),
+ // },
+ // extraProps: {
+ // hide: (row: API.GetInsurancePageOutput) =>
+ // row.payStatus != InsurancePolicyListPayStatusEnum.WaitPay,
+ // },
+ // },
+ {
+ data: {
+ enCode: 'stampFilesBtn',
+ name: '淇濆崟涓嬭浇',
+ },
+ emits: {
+ onClick: (role) => handleGoStampFiles(role),
+ },
+ extraProps: {
+ hide: (row: API.GetInsurancePageOutput) => !(row.productOnline && row.anyPayComplete),
+ },
+ },
+ {
+ data: {
+ enCode: 'downloadInvoiceBtn',
+ name: '鍙戠エ涓嬭浇',
+ },
+ emits: {
+ onClick: (role) => handleGoDownloadInvoice(role),
+ },
+ extraProps: {
+ hide: (row: API.GetInsurancePageOutput) => !(row.productOnline && row.anyPayComplete),
+ },
+ },
+
// {
// data: {
// enCode: 'standarEndoBtn',
@@ -205,6 +281,31 @@
// onClick: (role) => handleStandarEndo(role),
// },
// },
+ {
+ data: {
+ enCode: 'submitAuditBtn',
+ name: '鎻愪氦瀹℃牳',
+ },
+ emits: {
+ onClick: (role) => handleSubmitAuditBtn(role),
+ },
+ extraProps: {
+ hide: (row: API.GetInsurancePageOutput) =>
+ row.auditStatus != InsurancePolicyAuditStatusEnum.WaitAdd,
+ },
+ },
+ {
+ data: {
+ enCode: 'applyTradeBySelfBtn',
+ name: '鍑鸿处鐢宠',
+ },
+ emits: {
+ onClick: (role) => handleParkBountyApplyTradeBySelf(role),
+ },
+ extraProps: {
+ hide: (row: API.GetInsurancePageOutput) => row.productOnline,
+ },
+ },
]).filter(Boolean);
const BaseState = {
@@ -212,11 +313,22 @@
};
const state = reactive({ ...BaseState });
+// const recorder = ref(new Recorder());
onMounted(async () => {
await getList();
state.loading = false;
+ // handleOpenInstructions();
+
+ // setTimeout(() => {
+ // // recorder.value.init();
+ // recorder.value.replaySession('9cb24e5a-0423-4dcd-abd5-fa7a4117cadc');
+ // }, 3000);
});
+
+// onUnmounted(() => {
+// recorder.value.stopRecordingAndSave();
+// });
const {
getDataSource: getList,
@@ -259,6 +371,7 @@
formatter: (row: API.GetInsurancePageOutput) =>
row.amount == null ? '' : toThousand(row.amount),
},
+ payStatus: { type: 'enum', valueEnum: InsurancePolicyListPayStatusEnumText },
},
}
);
@@ -287,15 +400,18 @@
url: [] as UploadUserFile[],
productIdNumber: '',
productSchemeIdNumber: '',
+ effectStartTime: dayjs().add(1, 'day').format('YYYY-MM-DD'),
+ effectEndTime: '',
+ isOnLineInsurance: false,
},
closeAfterConfirm: false,
});
async function checkInrancesSerialNumStatus() {
try {
- let params: API.APIimportInsStaffToListParams = {
+ let params: API.APIcheckInrancesSerialNumStatusParams = {
serialNum: editForm.serialNum,
- url: editForm.url?.[0]?.path,
+ // url: editForm.url?.[0]?.path,
};
let res = await insuranceOrderServices.checkInrancesSerialNumStatus(params);
if (res === InsurancePolicyStatusEnum.Effecting) {
@@ -303,49 +419,123 @@
} else if (res === InsurancePolicyStatusEnum.OutTimeEffect) {
await Message.tipMessage('璇ユ壒娆′繚鍗曞凡澶辨晥锛岃淇敼鎵规鍙峰悗閲嶆柊瀵煎叆');
} else if (res === InsurancePolicyStatusEnum.WaitEffect) {
- await Message.tipMessage('瀛樺湪鐩稿悓鐨勬壒娆″彿锛屾槸鍚﹁鐩栵紵');
- importInsStaffToList();
+ if (isSjbAccount.value) {
+ await Message.tipMessage('瀛樺湪鐩稿悓鐨勬壒娆″彿锛岃淇敼鎵规鍙峰悗閲嶆柊瀵煎叆');
+ } else {
+ await Message.tipMessage('瀛樺湪鐩稿悓鐨勬壒娆″彿锛屾槸鍚﹁鐩栵紵');
+ importInsStaffToList();
+ }
} else {
importInsStaffToList();
}
} catch (error) {}
}
+const { isSjbAccount, getInsureProductIdByIdNumber } = useUserInsureProductSetting();
+
+const { getInsureProductSchemeByIdNumber } = useInsureProductSchemeAllList({
+ insureProductId: computed(() => getInsureProductIdByIdNumber(editForm.productIdNumber)),
+});
+
async function importInsStaffToList() {
try {
- let params: API.APIimportInsStaffToListParams = {
+ let params: API.ImportInsStaffToListFrontInput = {
serialNum: editForm.serialNum,
url: editForm.url?.[0]?.path,
productIdNumber: editForm.productIdNumber,
productSchemeIdNumber: editForm.productSchemeIdNumber,
+ effectStartTime: editForm.effectStartTime,
};
- let res = await insuranceOrderServices.importInsStaffToList(params);
- if (res.length > 0) {
- await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵');
- XLSXUtils.exportToXLSX({
- workbookDataList: res,
- fileName: '閿欒浜哄憳鍚嶅崟',
- workbookHeaderMap: {
- name: '闆囧憳濮撳悕',
- sex: '鎬у埆',
- certType: '璇佷欢绫诲瀷',
- certNo: '璇佷欢鍙风爜',
- jobName: '闆囧憳宸ョ',
- useEmploer: '鐢ㄥ伐鍗曚綅',
- address: '鐢ㄥ伐鍦扮偣',
- note: '澶囨敞',
- },
- });
+ const currentInsureProductScheme = getInsureProductSchemeByIdNumber(
+ editForm.productSchemeIdNumber
+ );
+ if (currentInsureProductScheme?.period === InsurancePeriodEnum['1-29D']) {
+ params.effectEndTime = editForm.effectEndTime;
}
- dialogState.dialogVisible = false;
- getList(paginationState.pageIndex);
+ let res = await insuranceOrderServices.importInsStaffToList(params, {
+ timeout: 60 * 1000 * 10,
+ customErrorHandler(error) {
+ if (error?.response?.data?.error?.code === '10001') {
+ Message.tipMessage(error.response.data?.error?.message, {
+ showCancelButton: false,
+ });
+ return true;
+ }
+ return false;
+ },
+ });
+ if (res) {
+ // await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵');
+ try {
+ if (res.errorList.length > 0) {
+ await Message.tipMessage(
+ `鎬绘姇淇濅汉鏁�${res.importAllCount}浜猴紝鎶曚繚鎴愬姛${res.successCount}浜猴紝鎶曚繚澶辫触${res.errorList.length}浜烘槸鍚﹀鍑烘姇淇濆け璐ヤ汉鍛樻竻鍗曪紵`,
+ {
+ confirmButtonText: '瀵煎嚭',
+ }
+ );
+ XLSXUtils.exportToXLSX({
+ workbookDataList: res.errorList,
+ fileName: '閿欒浜哄憳鍚嶅崟',
+ workbookHeaderMap: {
+ name: '闆囧憳濮撳悕',
+ sex: '鎬у埆',
+ certType: '璇佷欢绫诲瀷',
+ certNo: '璇佷欢鍙风爜',
+ jobName: '闆囧憳宸ョ',
+ useEmploer: '鐢ㄥ伐鍗曚綅',
+ address: '鐢ㄥ伐鍦扮偣',
+ note: '澶囨敞',
+ },
+ });
+ } else {
+ await Message.tipMessage(
+ `鎬绘姇淇濅汉鏁�${res.importAllCount}浜猴紝鎶曚繚鎴愬姛${res.successCount}浜篳,
+ {
+ showCancelButton: false,
+ }
+ );
+ }
+ } catch (error) {}
+ dialogState.dialogVisible = false;
+ getList(paginationState.pageIndex);
+ }
} catch (error) {}
}
-function handleUpload() {
+const { dialogProps: dialogLineModeSelectProps, dialogState: dialogLineModeSelectState } =
+ useDialog({
+ onConfirm: handleLineModeSelect,
+ });
+
+async function handleLineModeSelect(mode: InsureLineMode) {
+ if (mode === InsureLineMode.OnLine) {
+ dialogInstructionsState.dialogVisible = true;
+ } else {
+ handleUpload();
+ }
+}
+
+const { dialogProps: dialogInstructionsProps, dialogState: dialogInstructionsState } = useDialog({
+ onConfirm: () => {
+ return handleUpload(true);
+ },
+});
+
+function handleOpenInstructions() {
+ if (isSjbAccount.value) {
+ // dialogInstructionsState.dialogVisible = true;
+ dialogLineModeSelectState.dialogVisible = true;
+ } else {
+ handleUpload();
+ }
+}
+
+async function handleUpload(isOnLineInsurance = false) {
handleAdd({
serialNum: `${dayjs().format('YYYYMMDD')}${_.random(0, 9999).toString().padStart(4, '0')}`,
url: [] as UploadUserFile[],
+ isOnLineInsurance,
});
}
@@ -383,6 +573,10 @@
downloadFile(res.data, `鍦ㄤ繚浜哄憳瀵煎嚭`, 'xlsx');
}
} catch (error) {}
+}
+
+function handleDownloadOccupationType() {
+ downloadFileByUrl(InsuranceOccupationTypeTempPath, '鑱屼笟绫诲瀷瀵圭収琛�');
}
function handleDownload() {
@@ -426,7 +620,7 @@
try {
let params: API.UploadInsuranceStampFilesInput = {
insurancePolicyId: stampFileForm.id,
- listFiles: stampFileForm.url?.map((x) => x.path) ?? [],
+ listFiles: convertFormUrl2Api(stampFileForm.url),
};
let res = await insuranceOrderServices.uploadInsuranceStampFiles(params);
if (res) {
@@ -488,4 +682,100 @@
// }
} catch (error) {}
}
+
+async function handleGoStampFiles(row: API.GetInsurancePageOutput) {
+ try {
+ router.push({
+ name: 'InsurancePolicyStampFiles',
+ params: {
+ id: row.id,
+ },
+ });
+ } catch (error) {}
+}
+
+function handlePay(row: API.GetInsurancePageOutput) {
+ router.push({
+ name: 'InsurePayDetail',
+ params: {
+ id: row.id,
+ },
+ });
+}
+
+async function handleGoDownloadInvoice(row: API.GetInsurancePageOutput) {
+ try {
+ await insuranceOrderServices.getInvoiceId(
+ { id: row.id },
+ {
+ timeout: 60 * 1000 * 30,
+ }
+ );
+ router.push({
+ name: 'InsureDownloadInvoice',
+ params: {
+ id: row.id,
+ },
+ });
+ } catch (error) {}
+}
+
+async function handleSubmitAuditBtn(row: API.GetInsurancePageOutput) {
+ try {
+ let params: API.InsurancePolicyAuditInput = {
+ insurancePolicyId: row.id,
+ };
+ let res = await insuranceOrderServices.insurancePolicyAddAudit(params);
+ if (res) {
+ Message.successMessage('涓婁紶鎴愬姛');
+ getList(paginationState.pageIndex);
+ }
+ } catch (error) {}
+}
+
+function handleParkBountyApplyTradeBySelf(row: API.GetInsurancePageOutput) {
+ handleDisbursementAdd({
+ remianAmount: row.remianAmount,
+ });
+}
+
+const {
+ dialogProps: dialogDisbursementProps,
+ handleAdd: handleDisbursementAdd,
+ editForm: editDisbursementForm,
+} = useFormDialog({
+ onConfirm: parkBountyApplyTradeBySelf,
+ defaultFormParams: {
+ payRemark: '',
+ tradeAmount: 0,
+ remianAmount: 0,
+ payFileUrl: [] as UploadUserFile[],
+
+ incomeCompanyName: '',
+ insureBillNo: '',
+ incomeBankAccount: '',
+ incomeBankCardNumber: '',
+ incomeBankName: '',
+ },
+});
+
+async function parkBountyApplyTradeBySelf() {
+ try {
+ let params: API.CreateParkBountyTradeInput = {
+ tradeAmount: editDisbursementForm.tradeAmount,
+ payFileUrl: editDisbursementForm.payFileUrl.map((item) => item.url).join('|'),
+ payRemark: editDisbursementForm.payRemark,
+ incomeCompanyName: editDisbursementForm.incomeCompanyName,
+ insureBillNo: editDisbursementForm.insureBillNo,
+ incomeBankAccount: editDisbursementForm.incomeBankAccount,
+ incomeBankCardNumber: editDisbursementForm.incomeBankCardNumber,
+ incomeBankName: editDisbursementForm.incomeBankName,
+ };
+ let res = await parkBountyApplyServices.parkBountyApplyTradeBySelf(params);
+ if (res) {
+ Message.successMessage('鎿嶄綔鎴愬姛');
+ getList(paginationState.pageIndex);
+ }
+ } catch (error) {}
+}
</script>
--
Gitblit v1.9.1