From 32c69839e3658c81e1ac7bf66ef207215c22a4a9 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期三, 02 四月 2025 11:03:46 +0800 Subject: [PATCH] feat: init --- /dev/null | 29 --- src/constants/oss.ts | 2 src/views/Login/Login.vue | 2 src/components/DataBoardCard/DataBoardCard.vue | 44 +++++ src/components/DataBoardCard/DataBoardCardPrice.vue | 48 ++++++ src/components/DataBoardCard/DataBoardCardContentItem.vue | 45 +++++ src/constants/index.ts | 1 src/views/Home/Home.vue | 298 +----------------------------------- 8 files changed, 151 insertions(+), 318 deletions(-) diff --git a/src/components/DataBoardCard/DataBoardCard.vue b/src/components/DataBoardCard/DataBoardCard.vue new file mode 100644 index 0000000..d337f37 --- /dev/null +++ b/src/components/DataBoardCard/DataBoardCard.vue @@ -0,0 +1,44 @@ +<template> + <div class="data-board-card-wrapper"> + <div class="data-board-card-title">{{ title }}</div> + <div class="data-board-card-content"> + <slot></slot> + </div> + </div> +</template> + +<script setup lang="ts"> +defineOptions({ + name: 'DataBoardCard', +}); + +type Props = { + title?: string; +}; + +const props = withDefaults(defineProps<Props>(), {}); +</script> + +<style lang="scss" scoped> +@use '@/style/common.scss' as *; + +.data-board-card-wrapper { + display: flex; + padding: 16px; + border: 1px solid var(--el-border-color-light); + border-radius: 4px; + background-color: #ffffff; + flex-direction: column; + + .data-board-card-title { + margin-bottom: 12px; + font-size: 16px; + color: getCssVar('text-color', 'primary'); + } + + .data-board-card-content { + flex: 1; + min-height: 0; + } +} +</style> diff --git a/src/components/DataBoardCard/DataBoardCardContentItem.vue b/src/components/DataBoardCard/DataBoardCardContentItem.vue new file mode 100644 index 0000000..00dee0e --- /dev/null +++ b/src/components/DataBoardCard/DataBoardCardContentItem.vue @@ -0,0 +1,45 @@ +<template> + <div class="data-board-card-content-item"> + <div class="data-board-card-content-item-label">{{ label }}</div> + <div class="data-board-card-content-item-content"><slot></slot></div> + </div> +</template> + +<script setup lang="ts"> +defineOptions({ + name: 'DataBoardCardContentItem', +}); + +type Props = { + label?: string; +}; + +const props = withDefaults(defineProps<Props>(), {}); +</script> + +<style lang="scss" scoped> +@use '@/style/common.scss' as *; + +.data-board-card-content-item { + display: flex; + align-items: center; + margin-bottom: 12px; + font-size: 14px; + + &:last-child { + margin-bottom: 0; + } + + .data-board-card-content-item-label { + width: 80px; + color: getCssVar('text-color', 'regular'); + } + + .data-board-card-content-item-content { + flex: 1; + min-width: 0; + @include utils-ellipsis; + color: getCssVar('text-color', 'primary'); + } +} +</style> diff --git a/src/components/DataBoardCard/DataBoardCardPrice.vue b/src/components/DataBoardCard/DataBoardCardPrice.vue new file mode 100644 index 0000000..8ea0630 --- /dev/null +++ b/src/components/DataBoardCard/DataBoardCardPrice.vue @@ -0,0 +1,48 @@ +<template> + <div class="data-board-card-price"> + <div class="data-board-card-value">{{ displayValue }}</div> + <div class="data-board-card-unit">{{ unit }}</div> + </div> +</template> + +<script setup lang="ts"> +import { toThousand } from '@/utils'; + +defineOptions({ + name: 'DataBoardCardPrice', +}); + +type Props = { + value?: number; + useThousand?: boolean; + unit?: string; +}; + +const props = withDefaults(defineProps<Props>(), { + useThousand: true, + unit: '鍏�', +}); + +const displayValue = computed(() => (props.useThousand ? toThousand(props.value) : props.value)); +</script> + +<style lang="scss" scoped> +@use '@/style/common.scss' as *; + +.data-board-card-price { + display: flex; + align-items: flex-end; + + .data-board-card-value { + margin-right: 4px; + font-size: 20px; + font-weight: bold; + color: getCssVar('text-color', 'primary'); + } + + .data-board-card-unit { + font-size: 14px; + color: getCssVar('text-color', 'primary'); + } +} +</style> diff --git a/src/constants/index.ts b/src/constants/index.ts index 5fa069c..fa61beb 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -8,5 +8,4 @@ export * from './theme'; export * from './menu'; export * from './role'; -export * from './insuranceClaim'; export * from './app'; diff --git a/src/constants/insuranceClaim.ts b/src/constants/insuranceClaim.ts deleted file mode 100644 index 1212565..0000000 --- a/src/constants/insuranceClaim.ts +++ /dev/null @@ -1,74 +0,0 @@ -export enum InsuranceClaimAttachmentBusinessTypeEnum { - /** - * 浼よ�呰韩浠借瘉鍥剧墖 - */ - InjuredIdCardImg = 10, - /** - * 鍙椾激鍦哄湴鍥剧墖 - */ - InjurySiteImg = 20, - /** - * 浼よ�呮墜鎸佽韩浠借瘉鍥剧墖 - */ - InjuredHandheldIdCardImg = 30, - /** - * 鍙椾激閮ㄤ綅鍥剧墖 - */ - InjuredAreaImg = 40, - /** - * 鐥呬緥鍥剧墖 - */ - CasesImg = 50, -} - -export const InsuredInstitutionEnum = { - 骞冲畨: '骞冲畨', - 浜轰繚: '浜轰繚', - 澶繚: '澶繚', - 鍥藉: '鍥藉', - 澶у湴: '澶у湴', - R淇�: 'R淇�', - 鍏朵粬: '鍏朵粬', -}; - -export const InsuranceSchemeEnum = { - '30涓�3绫�': '30涓�3绫�', - '30涓�4绫�': '30涓�4绫�', - '50涓�3绫�': '50涓�3绫�', - '50涓�4绫�': '50涓�4绫�', - '80涓�3绫�': '80涓�3绫�', - '80涓�4绫�': '80涓�4绫�', - '100涓�3绫�': '100涓�3绫�', - '100涓�4绫�': '100涓�4绫�', -}; - -export const AccidentTypeEnum = { - 鐨浼�: '鐨浼�', - 楠ㄦ姌: '楠ㄦ姌', - 姝讳骸: '姝讳骸', -}; - -export enum InsuranceClaimResultEnum { - /**鏈粨妗� */ - PendingCase = 10, - /**缁撴 */ - CloseCase = 20, - /**鎾ゆ */ - WithdrawCase = 30, -} - -export const InsuranceClaimResultEnumText = { - [InsuranceClaimResultEnum.PendingCase]: '鏈粨妗�', - [InsuranceClaimResultEnum.CloseCase]: '缁撴', - [InsuranceClaimResultEnum.WithdrawCase]: '鎾ゆ', -}; - -export const OnJobFlagEnumText = { - 澧炲憳: '澧炲憳', - 鍑忓憳: '鍑忓憳', -}; - -export const insuranceTypeText = { - 鏈堜繚: '鏈堜繚', - 骞翠繚: '骞翠繚', -}; diff --git a/src/constants/oss.ts b/src/constants/oss.ts index 91a3a78..55ea9a2 100644 --- a/src/constants/oss.ts +++ b/src/constants/oss.ts @@ -4,7 +4,7 @@ export const OSSBaseURL = VITE_OSS_URL; -const _basicPath = '12333/YeXing/'; +const _basicPath = '12333/Government/'; export const OssHRSIE = _basicPath + 'HRSIE/'; diff --git a/src/views/Export/ExportManage.vue b/src/views/Export/ExportManage.vue deleted file mode 100644 index 0af8666..0000000 --- a/src/views/Export/ExportManage.vue +++ /dev/null @@ -1,229 +0,0 @@ -<template> - <LoadingLayout :loading="state.loading"> - <AppContainer> - <ProTableQueryFilterBar - @on-reset="reset" - @on-search="getList" - > - <template #query> - <QueryFilterItem> - <FieldSelect - v-model="extraParamState.importChannel" - placeholder="鐞嗚禂娓犻亾" - :value-enum="insuranceClaimChannelListForSelect" - clearable - @change="getList()" - /> - </QueryFilterItem> - <QueryFilterItem> - <FieldDatePicker - v-model="extraParamState.creationDate" - type="daterange" - range-separator="~" - start-placeholder="璧峰鏃ユ湡" - end-placeholder="缁撴潫鏃ユ湡" - clearable - @change="getList()" - tooltipContent="瀵煎叆鏃ユ湡" - ></FieldDatePicker> - </QueryFilterItem> - - <!-- <QueryFilterItem> - <FieldDatePicker - v-model="extraParamState.creationTime" - type="date" - placeholder="瀵煎叆鏃ユ湡" - clearable - @change="getList()" - tooltipContent="瀵煎叆鏃ユ湡" - ></FieldDatePicker> - </QueryFilterItem> --> - </template> - <template #btn> - <el-button - v-if="checkSubModuleItemShow('pageButton', 'exportBtn')" - @click="handleExport()" - icon="Download" - type="primary" - >瀵煎嚭</el-button - > - </template> - </ProTableQueryFilterBar> - <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns"> - </ProTableV2> - </AppContainer> - <BatchUploadOrderDialog v-bind="dialogBatchUploadOrderProps"></BatchUploadOrderDialog> - </LoadingLayout> -</template> - -<script setup lang="ts"> -import { - ProTableQueryFilterBar, - OperationBtnType, - ProTableV2, - SearchInput, - LoadingLayout, - AppContainer, - QueryFilterItem, - useTable, - useFormDialog, - FieldDatePicker, - FieldSelect, - FieldRadio, - UploadUserFile, -} from '@bole-core/components'; -import { useAccess, useInsuranceClaimChannelList } from '@/hooks'; -import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; -import { Message, OrderInputType } from '@bole-core/core'; -import { downloadFile, downloadFileByUrl, format, setOSSLink } from '@/utils'; -import { ModelValueType } from 'element-plus'; -import { OnJobFlagEnumText, insuranceTypeText } from '@/constants'; -import BatchUploadOrderDialog from './components/BatchUploadOrderDialog.vue'; - -defineOptions({ - name: 'ExportManage', -}); - -const operationBtnMap: Record<string, OperationBtnType> = { - // checkBtn: { emits: { onClick: (role) => goDetail(role) } }, - policyDownloadBtn: { - emits: { onClick: (role) => handleDownload(role) }, - extraProps: { - hide: (row: API.InsuranceOrderListOutput) => !( row.orderBillFile), - }, - }, -}; - -const { checkSubModuleItemShow, column, operationBtns } = useAccess({ - operationBtnMap, -}); - -const { insuranceClaimChannelListForSelect } = useInsuranceClaimChannelList(); - -const BaseState = { - loading: true, -}; - -const state = reactive({ ...BaseState }); - -onMounted(async () => { - await getList(); - state.loading = false; -}); - -const { - getDataSource: getList, - proTableProps, - paginationState, - extraParamState, - reset, -} = useTable( - async ({ pageIndex, pageSize }, extraParamState) => { - try { - let params = createParams(pageIndex, pageSize); - let res = await insuranceOrderServices.getInsuranceOrderPage(params, { - showLoading: !state.loading, - }); - return res; - } catch (error) {} - }, - { - defaultExtraParams: { - orderInput: [{ property: 'id', order: OrderInputType.Desc }], - // creationTime: '', - importChannel: '', - condition: '', - onJobFlag: '', - insuranceType: '', - creationDate: [] as unknown as ModelValueType, - }, - columnsRenderProps: { - createTime: { - type: 'date', - format: 'YYYY/MM/DD', - }, - insuranceBeginTime: { - type: 'date', - format: 'YYYY/MM/DD', - }, - insuranceEndTime: { - type: 'date', - format: 'YYYY/MM/DD', - }, - }, - } -); - -function createParams(pageIndex: number, pageSize: number) { - let params: API.QueryInsuranceOrderPageInput = { - pageModel: { - rows: pageSize, - page: pageIndex, - orderInput: extraParamState.orderInput, - }, - importChannel: extraParamState.importChannel, - beginCreationTime: format(extraParamState.creationDate?.[0] ?? '', 'YYYY-MM-DD 00:00:00'), - endCreationTime: format(extraParamState.creationDate?.[1] ?? '', 'YYYY-MM-DD 23:59:59'), - insuranceType: extraParamState.insuranceType, - onJobFlag: extraParamState.onJobFlag, - condition: extraParamState.condition, - }; - return params; -} -async function handleExport() { - try { - if (paginationState.total === 0) { - Message.warnMessage('娌℃湁鏁版嵁鍙互瀵煎嚭鍝'); - return; - } - let params = createParams(paginationState.pageIndex, paginationState.pageSize); - let res = await insuranceOrderServices.exportInsuranceOrderList(params, { - responseType: 'blob', - getResponse: true, - }); - if (res) { - downloadFile(res.data, `淇濆崟瀵煎嚭`, 'xlsx'); - } - } catch (error) {} -} - -// const router = useRouter(); -// function goDetail(row: API.InsuranceOrderListOutput) { -// router.push({ -// name: 'InsuranceClaimDetail', -// params: { -// id: row.id, -// }, -// }); -// } - -const { - dialogProps: dialogBatchUploadOrderProps, - handleAdd: handleBatchUploadOrderAdd, - editForm: batchUploadOrderForm, -} = useFormDialog({ - onConfirm: addInsuranceOrderBillFile, - defaultFormParams: { - orderNo: '', - url: [] as UploadUserFile[], - }, -}); - -async function addInsuranceOrderBillFile() { - try { - let params: API.AddInsuranceOrderBillFile = { - orderNo: batchUploadOrderForm.orderNo, - orderBillFile: batchUploadOrderForm.url?.[0].path ?? '', - }; - let res = await insuranceOrderServices.addInsuranceOrderBillFile(params); - if (res) { - Message.successMessage('鎿嶄綔鎴愬姛'); - getList(paginationState.pageIndex); - } - } catch (error) {} -} - -function handleDownload(row?: API.InsuranceOrderListOutput) { - downloadFileByUrl(setOSSLink(row.orderBillFile)); -} -</script> diff --git a/src/views/Export/components/BatchUploadOrderDialog.vue b/src/views/Export/components/BatchUploadOrderDialog.vue deleted file mode 100644 index ca907ff..0000000 --- a/src/views/Export/components/BatchUploadOrderDialog.vue +++ /dev/null @@ -1,109 +0,0 @@ -<template> - <ProDialog - title="鎵归噺涓婁紶淇濆崟" - v-model="innerVisible" - destroy-on-close - draggable - bodyNoPaddingBottom - @close="onDialogClose" - > - <ProForm :model="form" ref="dialogForm" label-width="120px"> - <ProFormItemV2 label="淇濆崟鍙凤細" prop="orderNo" :check-rules="[{ message: '璇疯緭鍏ヤ繚鍗曞彿' }]"> - <ProFormText - placeholder="璇疯緭鍏ヤ繚鍗曞彿" - v-model.trim="form.orderNo" - :maxlength="30" - ></ProFormText> - </ProFormItemV2> - <ProFormItemV2 - label="涓婁紶淇濆崟锛�" - prop="url" - :check-rules="[{ message: '璇蜂笂浼犱繚鍗�', type: 'upload' }]" - > - <ProFormUpload - v-model:file-url="form.url" - :limit="1" - :limitFileSize="10" - accept="pdf,doc,docx" - > - </ProFormUpload> - </ProFormItemV2> - </ProForm> - <template #footer> - <span class="dialog-footer"> - <el-button type="primary" @click="handleConfirm">纭� 瀹�</el-button> - </span> - </template> - </ProDialog> -</template> - -<script setup lang="ts"> -import { - ProDialog, - UploadUserFile, - ProForm, - ProFormItemV2, - ProFormText, - ProFormUpload, -} from '@bole-core/components'; -import { FormInstance } from 'element-plus'; - -defineOptions({ - name: 'BatchUploadOrderDialog', -}); - -type Props = { - modelValue: boolean; - form?: { - orderNo: string; - url: UploadUserFile[]; - }; -}; - -const props = withDefaults(defineProps<Props>(), { - modelValue: false, -}); - -const emit = defineEmits<{ - (e: 'update:modelValue', value: boolean): void; - (e: 'update:form', value: Props['form']): void; - (e: 'onConfirm'): void; - (e: 'onCancel'): void; -}>(); - -const innerVisible = computed({ - get() { - return props.modelValue; - }, - set(val) { - emit('update:modelValue', val); - }, -}); - -const innerForm = computed({ - get() { - return props.form; - }, - set(val) { - emit('update:form', val); - }, -}); - -const dialogForm = ref<FormInstance>(); - -function onDialogClose() { - if (!dialogForm.value) return; - dialogForm.value.resetFields(); -} - -function handleConfirm() { - if (!dialogForm.value) return; - dialogForm.value.validate((valid) => { - if (valid) { - emit('onConfirm'); - } else { - return; - } - }); -} -</script> diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue index 5b201e5..743c705 100644 --- a/src/views/Home/Home.vue +++ b/src/views/Home/Home.vue @@ -1,308 +1,34 @@ <template> - <LoadingLayout :loading="state.loading"> + <LoadingLayout :loading="isLoading"> <AppContainer> - <div class="home-top-view"> - <ProForm :mode="form"> - <ProFormItemV2 label="鎶ユ骞翠唤:"> - <ProFormDatePicker - v-model="form.year" - type="year" - format="YYYY" - value-format="YYYY" - placeholder="鎶ユ骞翠唤" - :disabled-date="disabledYear" - ></ProFormDatePicker> - </ProFormItemV2> - <ProFormItemV2 label="鎶ユ鏈堜唤:"> - <ProFormDatePicker - v-model="form.month" - type="month" - format="M" - value-format="M" - placeholder="鎶ユ鏈堜唤" - ></ProFormDatePicker> - </ProFormItemV2> - <ProFormItemV2 label="鐞嗚禂娓犻亾:"> - <ProFormSelect - v-model="form.claimChannel" - placeholder="鐞嗚禂娓犻亾" - :value-enum="insuranceClaimChannelListForSelect" - clearable - style="width: 100%" - /> - </ProFormItemV2> - <ProFormItemV2 label="鎶ユ鏁伴噺:"> - <div class="home-top-view-count">{{ claimCount ?? 0 }}浜�</div> - </ProFormItemV2> - </ProForm> - <Chart /> - </div> - <ProTableQueryFilterBar @on-reset="reset"> - <template #query> - <QueryFilterItem> - <FieldSelect - v-model="extraParamState.claimChannel" - placeholder="鐞嗚禂娓犻亾" - :value-enum="insuranceClaimChannelListForSelect" - clearable - @change="getList()" - /> - </QueryFilterItem> - <QueryFilterItem> - <FieldSelect - v-model="extraParamState.claimResult" - placeholder="鐞嗚禂缁撴灉" - :value-enum="InsuranceClaimResultEnumText" - clearable - @change="getList()" - /> - </QueryFilterItem> - <QueryFilterItem> - <SearchInput - v-model="extraParamState.idNumber" - style="width: 260px" - placeholder="韬唤璇佸彿鐮�" - :showSearchBtn="false" - > - </SearchInput> - </QueryFilterItem> - <QueryFilterItem> - <SearchInput - v-model="extraParamState.laborContractEnterprise" - style="width: 260px" - placeholder="鍔冲姩鍚堝悓鍏徃" - :showSearchBtn="false" - > - </SearchInput> - </QueryFilterItem> - <QueryFilterItem> - <SearchInput - v-model="extraParamState.workEnterprise" - style="width: 260px" - placeholder="鐢ㄥ伐浼佷笟" - @on-click-search="getList" - > - </SearchInput> - </QueryFilterItem> - </template> - <template #btn> - <el-button @click="handleExport()" icon="Download" type="primary">瀵煎嚭</el-button> - <el-button @click="handleExportPic()" icon="Download" type="primary">瀵煎嚭鍥剧墖</el-button> - </template> - </ProTableQueryFilterBar> - <ProTableV2 v-bind="proTableProps" :columns="HomeColumns" :operationBtns="operationBtns"> - </ProTableV2> + <ChunkCell title="寰呭鐞�"> </ChunkCell> + <ChunkCell title="鏁版嵁鐪嬫澘"> </ChunkCell> </AppContainer> </LoadingLayout> </template> <script setup lang="ts"> import { - ProTableQueryFilterBar, - OperationBtnType, - ProTableV2, - SearchInput, - LoadingLayout, - AppContainer, - QueryFilterItem, - useTable, - defineOperationBtns, - FieldSelect, ProForm, ProFormItemV2, ProFormSelect, - ProFormDatePicker, + ProFormText, + ProFormCol, + ProFormColItem, + ProFormInputNumber, + ProFormTextArea, + ProFormRadio, + ChunkCell, + AppScrollContainer, } from '@bole-core/components'; -import { useInsuranceClaimChannelList, useGlobalEventContext } from '@/hooks'; -import * as insuranceClaimServices from '@/services/api/InsuranceClaim'; -import { Message, OrderInputType, downloadWithZip } from '@bole-core/core'; -import { HomeColumns } from './constants'; -import { downloadFile, setOSSLink, toThousand } from '@/utils'; -import dayjs from 'dayjs'; -import { useQuery } from '@tanstack/vue-query'; -import { useInsuranceClaimCount } from './hooks'; -import Chart from './components/Chart.vue'; -import { InsuranceClaimResultEnumText, InsuranceClaimResultEnum } from '@/constants'; defineOptions({ name: 'Home', }); -const operationBtns = defineOperationBtns([ - { - data: { - enCode: 'checkBtn', - name: '璇︽儏', - }, - emits: { - onClick: (role) => goDetail(role), - }, - }, -]); - -const { insuranceClaimChannelListForSelect } = useInsuranceClaimChannelList(); - -const eventContext = useGlobalEventContext(); - -const BaseState = { - loading: true, -}; - -const state = reactive({ ...BaseState }); - -eventContext.addEvent('updateInsuranceClaim', () => { - getList(paginationState.pageIndex); -}); - -onMounted(async () => { - await getList(); - state.loading = false; -}); - -const { - getDataSource: getList, - proTableProps, - paginationState, - extraParamState, - reset, -} = useTable( - async ({ pageIndex, pageSize }, extraParamState) => { - try { - let params = createParams(pageIndex, pageSize); - let res = await insuranceClaimServices.getInsuranceClaimPage(params, { - showLoading: !state.loading, - }); - return res; - } catch (error) {} - }, - { - defaultExtraParams: { - orderInput: [{ property: 'createTime', order: OrderInputType.Desc }], - claimChannel: '', - laborContractEnterprise: '', - workEnterprise: '', - idNumber: '', - claimResult: '' as any as InsuranceClaimResultEnum, - }, - columnsRenderProps: { - insuranceBeginTime: { - type: 'date', - format: 'YYYY/MM/DD', - }, - insuranceEndTime: { - type: 'date', - format: 'YYYY/MM/DD', - }, - reportedTime: { - type: 'date', - format: 'YYYY/MM/DD HH:mm:ss', - }, - accidentTime: { - type: 'date', - format: 'YYYY/MM/DD HH:mm:ss', - }, - lastModificationTime: { - type: 'date', - format: 'YYYY-MM-DD HH:mm:ss', - }, - disabilityRatio: { - formatter: (row: API.InsuranceClaimListOutput) => - row.disabilityRatio == null ? '' : row.disabilityRatio + '%', - }, - downPaymentAmount: { - type: 'money', - formatter: (row: API.InsuranceClaimListOutput) => - row.downPaymentAmount == null ? '' : toThousand(row.downPaymentAmount), - }, - claimResultTime: { type: 'date', format: 'YYYY-MM-DD' }, - claimResult: { type: 'enum', valueEnum: InsuranceClaimResultEnumText }, - }, - } -); - -function createParams(pageIndex: number, pageSize: number) { - let params: API.QueryInsuranceClaimPageInput = { - pageModel: { - rows: pageSize, - page: pageIndex, - orderInput: extraParamState.orderInput, - }, - claimChannel: extraParamState.claimChannel, - laborContractEnterprise: extraParamState.laborContractEnterprise, - workEnterprise: extraParamState.workEnterprise, - idNumber: extraParamState.idNumber, - claimResult: extraParamState.claimResult, - }; - return params; -} - -const router = useRouter(); -function goDetail(row: API.InsuranceClaimListOutput) { - router.push({ - name: 'InsuranceClaimDetail', - params: { - id: row.insuranceOrderId, - }, - query: { - backRouteName: 'Home', - insuranceClaimId: row.id, - }, - }); -} - -async function handleExport() { - try { - if (paginationState.total === 0) { - Message.warnMessage('娌℃湁鏁版嵁鍙互瀵煎嚭鍝'); - return; - } - let params = createParams(paginationState.pageIndex, paginationState.pageSize); - let res = await insuranceClaimServices.exportInsuranceClaimList(params, { - responseType: 'blob', - getResponse: true, - }); - if (res) { - downloadFile(res.data, `鐞嗚禂瀵煎嚭`, 'xlsx'); - } - } catch (error) {} -} - -async function handleExportPic() { - try { - if (paginationState.total === 0) { - Message.warnMessage('娌℃湁鏁版嵁鍙互瀵煎嚭鍝'); - return; - } - let params = createParams(paginationState.pageIndex, paginationState.pageSize); - let res = await insuranceClaimServices.getInsuranceClaimAttachmentUrlList(params); - if (res) { - if (res.length && res.length > 0) { - downloadWithZip( - res.map((item) => ({ data: setOSSLink(item) })), - '鐞嗚禂鍥剧墖瀵煎嚭' - ); - } else { - Message.errorMessage('鎶ユ鏁版嵁涓湭涓婁紶鍥剧墖锛�'); - } - } - } catch (error) {} -} - -const { form, claimCount, disabledYear } = useInsuranceClaimCount(); +const isLoading = ref(false); </script> <style lang="scss" scoped> @use '@/style/common.scss' as *; - -.home-top-view { - display: flex; - padding: 20px boleGetCssVar('proTable', 'filter-bar-horizontal-padding') 0; - border-bottom: 1px var(--el-border-color) var(--el-border-style); - background-color: #ffffff; - - .home-top-view-count { - font-size: 30px; - font-weight: bold; - } -} </style> diff --git a/src/views/Home/components/Chart.vue b/src/views/Home/components/Chart.vue deleted file mode 100644 index e6ea8b4..0000000 --- a/src/views/Home/components/Chart.vue +++ /dev/null @@ -1,121 +0,0 @@ -<template> - <div class="chart-wrapper"> - <v-chart :option="option" :loading="isLoading" autoresize /> - </div> -</template> - -<script setup lang="ts"> -import * as echarts from 'echarts/core'; -import vChart from 'vue-echarts'; -import { BarChart, LineChart } from 'echarts/charts'; -import { - TitleComponent, - TooltipComponent, - GridComponent, - // 鏁版嵁闆嗙粍浠� - DatasetComponent, - // 鍐呯疆鏁版嵁杞崲鍣ㄧ粍浠� (filter, sort) - TransformComponent, -} from 'echarts/components'; -import { LabelLayout, UniversalTransition } from 'echarts/features'; -import { CanvasRenderer } from 'echarts/renderers'; -import type { - // 绯诲垪绫诲瀷鐨勫畾涔夊悗缂�閮戒负 SeriesOption - BarSeriesOption, - LineSeriesOption, -} from 'echarts/charts'; -import type { - // 缁勪欢绫诲瀷鐨勫畾涔夊悗缂�閮戒负 ComponentOption - TitleComponentOption, - TooltipComponentOption, - GridComponentOption, - DatasetComponentOption, -} from 'echarts/components'; -import type { ComposeOption } from 'echarts/core'; -import { useInsuranceClaimYearMonthCountCount } from '../hooks'; -import dayjs from 'dayjs'; - -// 閫氳繃 ComposeOption 鏉ョ粍鍚堝嚭涓�涓彧鏈夊繀椤荤粍浠跺拰鍥捐〃鐨� Option 绫诲瀷 -type ECOption = ComposeOption< - | BarSeriesOption - | LineSeriesOption - | TitleComponentOption - | TooltipComponentOption - | GridComponentOption - | DatasetComponentOption ->; - -// 娉ㄥ唽蹇呴』鐨勭粍浠� -echarts.use([ - TitleComponent, - TooltipComponent, - GridComponent, - DatasetComponent, - TransformComponent, - BarChart, - LineChart, - LabelLayout, - UniversalTransition, - CanvasRenderer, -]); - -defineOptions({ - name: 'Chart', -}); - -const { claimYearMonthCountList, isLoading } = useInsuranceClaimYearMonthCountCount({ - year: dayjs().year(), -}); -console.log('claimYearMonthCountList: ', claimYearMonthCountList); - -const option = computed<ECOption>(() => ({ - xAxis: { - data: claimYearMonthCountList.value.map((item) => `${item.year}骞�${item.month}鏈坄), - axisLabel: { - rotate: 45, - }, - }, - yAxis: { - minInterval: 1, - }, - grid: { - left: '5%', - right: '5%', - top: '5%', - }, - tooltip: { - trigger: 'item', - formatter: '{b}: {c}浜�', - }, - series: [ - { - data: claimYearMonthCountList.value.map((x) => x.count), - type: 'line', - label: { - show: true, - }, - // areaStyle: { - // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - // { - // offset: 0, - // color: 'rgba(58,77,233,0.8)', - // }, - // { - // offset: 1, - // color: 'rgba(58,77,233,0.3)', - // }, - // ]), - // }, - }, - ], -})); -</script> - -<style lang="scss" scoped> -@use '@/style/common.scss' as *; - -.chart-wrapper { - flex: 1; - min-width: 0; -} -</style> diff --git a/src/views/Home/constants/index.ts b/src/views/Home/constants/index.ts deleted file mode 100644 index 0c64887..0000000 --- a/src/views/Home/constants/index.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { defineColumns } from '@bole-core/components'; - -export const HomeColumns = defineColumns([ - { - id: '1', - enCode: 'idNumber', - name: '韬唤璇佸彿鐮�', - width: 200, - }, - { - id: '2', - enCode: 'name', - name: '濮撳悕', - }, - { - id: '3', - enCode: 'reportedTime', - name: '鎶ユ鏃堕棿', - width: 160, - }, - { - id: '4', - enCode: 'insuranceBeginTime', - name: '璧蜂繚鏃ユ湡', - width: 160, - }, - { - id: '5', - enCode: 'insuranceEndTime', - name: '缁堜繚鏃ユ湡', - width: 160, - }, - { - id: '6', - enCode: 'accidentType', - name: '浜嬫晠绫诲瀷', - width: 160, - }, - { - id: '7', - enCode: 'accidentTime', - name: '浜嬫晠鍙戠敓鏃堕棿', - width: 160, - }, - { - id: '8', - enCode: 'disabilityRatio', - name: '浼ゆ畫姣斾緥', - width: 160, - }, - { - id: '11', - enCode: 'claimResult', - name: '鐞嗚禂缁撴灉', - width: 160, - }, - { - id: '12', - enCode: 'downPaymentAmount', - name: '涓嬫閲戦', - width: 160, - }, - { - id: '13', - enCode: 'claimResultTime', - name: '缁�/鎾ゆ鏃ユ湡', - width: 160, - }, - { - id: '21', - enCode: 'lastModificationTime', - name: '鏈�鍚庢洿鏂版棩鏈�', - width: 160, - }, - { - id: '9', - enCode: 'claimChannel', - name: '鐞嗚禂娓犻亾', - width: 160, - }, -]); diff --git a/src/views/Home/hooks/index.ts b/src/views/Home/hooks/index.ts deleted file mode 100644 index 7456354..0000000 --- a/src/views/Home/hooks/index.ts +++ /dev/null @@ -1,71 +0,0 @@ -import * as insuranceClaimServices from '@/services/api/InsuranceClaim'; -import dayjs from 'dayjs'; -import { useQuery } from '@tanstack/vue-query'; - -export function useInsuranceClaimCount() { - const form = reactive({ - year: dayjs().year() + '', - month: dayjs().month() + 1 + '', - claimChannel: '', - }); - - const { data: claimCount } = useQuery({ - queryKey: ['insuranceClaimServices/getInsuranceClaimCount', form], - queryFn: async () => { - let res = await insuranceClaimServices.getInsuranceClaimCount( - { - year: form.year ? Number(form.year) : null, - month: form.month ? Number(form.month) : null, - claimChannel: form.claimChannel, - }, - { - showLoading: false, - } - ); - return res; - }, - keepPreviousData: true, - }); - - function disabledYear(time: Date) { - return dayjs(time).isAfter(dayjs(), 'year'); - } - - return { - form, - claimCount, - disabledYear, - }; -} - -type InsuranceClaimYearMonthCountCountOptions = { - year: MaybeRef<number | string>; -}; - -export function useInsuranceClaimYearMonthCountCount({ - year, -}: InsuranceClaimYearMonthCountCountOptions) { - const { data: claimYearMonthCountList, isLoading } = useQuery({ - queryKey: ['insuranceClaimServices/getInsuranceClaimYearMonthCountList', year], - queryFn: async () => { - let res = await insuranceClaimServices.getInsuranceClaimYearMonthCountList( - { - year: Number(unref(year)), - }, - { - showLoading: false, - } - ); - return res; - }, - select(data) { - return data.reverse(); - }, - placeholderData: () => [] as API.InsuranceClaimYearMonthCountListOutput[], - }); - - return { - claimYearMonthCountList, - isLoading, - }; -} diff --git a/src/views/InsuranceClaim/InsuranceClaimDetail.vue b/src/views/InsuranceClaim/InsuranceClaimDetail.vue deleted file mode 100644 index 22dae18..0000000 --- a/src/views/InsuranceClaim/InsuranceClaimDetail.vue +++ /dev/null @@ -1,494 +0,0 @@ -<template> - <LoadingLayout :loading="isLoading"> - <AppScrollContainer> - <ChunkCell title="鎶ユ淇℃伅"> - <ProForm :model="form" ref="formRef" label-width="180px" is-read> - <ProFormCol> - <ProFormColItem :span="6"> - <ProFormItemV2 - label="韬唤璇佸彿鐮�:" - prop="idNumber" - :check-rules="[{ message: '璇疯緭鍏ヨ韩浠借瘉鍙风爜', type: 'idCard' }]" - > - <ProFormText v-model.trim="form.idNumber" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙风爜" /> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 - label="鎶ユ鏃堕棿:" - prop="reportedTime" - :check-rules="[{ message: '璇烽�夋嫨鎶ユ鏃堕棿' }]" - > - <ProFormDatePicker - v-model="form.reportedTime" - type="datetime" - format="YYYY-MM-DD HH:mm:ss" - placeholder="璇烽�夋嫨鎶ユ鏃堕棿" - :disabled-date="disabledReportedDate" - @change="handleReportedTimeChange" - ></ProFormDatePicker> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 - label="鑱旂郴鐢佃瘽:" - prop="contactNumber" - :check-rules="[{ message: '璇疯緭鍏ヨ仈绯荤數璇�', type: 'phone' }]" - > - <ProFormText v-model.trim="form.contactNumber" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" /> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 - label="澶囩敤鑱旂郴鐢佃瘽:" - prop="bakContactNumber" - :check-rules="[{ message: '璇疯緭鍏ュ鐢ㄨ仈绯荤數璇�', type: 'phone', required: false }]" - > - <ProFormText - v-model.trim="form.bakContactNumber" - placeholder="璇疯緭鍏ュ鐢ㄨ仈绯荤數璇�" - /> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 label="濮撳悕:" prop="name" :check-rules="[{ message: '璇疯緭鍏ュ鍚�' }]"> - <ProFormText v-model.trim="form.name" placeholder="璇疯緭鍏ュ鍚�" /> - </ProFormItemV2> - </ProFormColItem> - </ProFormCol> - </ProForm> - </ChunkCell> - <ChunkCell title="淇濆崟淇℃伅"> - <ProForm :model="form" ref="insuranceBaseFormRef" label-width="180px" is-read> - <ProFormCol> - <ProFormColItem :span="6"> - <ProFormItemV2 - label="鍙備繚鏈烘瀯:" - prop="insuredInstitution" - :check-rules="[{ message: '璇烽�夋嫨鍙備繚鏈烘瀯' }]" - > - <ProFormSelect - placeholder="璇烽�夋嫨鍙備繚鏈烘瀯" - :value-enum="InsuredInstitutionEnum" - clearable - v-model="form.insuredInstitution" - ></ProFormSelect> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 - label="鎶曚繚鏂规:" - prop="insuranceScheme" - :check-rules="[{ message: '璇烽�夋嫨鎶曚繚鏂规' }]" - > - <ProFormSelect - placeholder="璇烽�夋嫨鎶曚繚鏂规" - :value-enum="InsuranceSchemeEnum" - clearable - v-model="form.insuranceScheme" - ></ProFormSelect> - </ProFormItemV2> - </ProFormColItem> - </ProFormCol> - <ProFormCol> - <ProFormColItem :span="6"> - <ProFormItemV2 label="璧蜂繚鏃ユ湡:" prop="insuranceBeginTime" mode="read"> - <ProFormDatePicker - v-model="form.insuranceBeginTime" - type="date" - value-format="YYYY-MM-DD" - placeholder="璇烽�夋嫨璧蜂繚鏃ユ湡" - ></ProFormDatePicker> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 label="鍔冲姩鍚堝悓鍗曚綅:" prop="laborContractEnterprise" mode="read"> - <ProFormText - v-model.trim="form.laborContractEnterprise" - placeholder="璇疯緭鍏ュ姵鍔ㄥ悎鍚屽崟浣�" - /> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 label="宸ョ:" prop="workType" mode="read"> - <ProFormText v-model.trim="form.workType" placeholder="璇疯緭鍏ュ伐绉�" /> - </ProFormItemV2> - </ProFormColItem> - </ProFormCol> - <ProFormCol> - <ProFormColItem :span="6"> - <ProFormItemV2 label="缁堜繚鏃ユ湡:" prop="insuranceEndTime" mode="read"> - <ProFormDatePicker - v-model="form.insuranceEndTime" - type="date" - value-format="YYYY-MM-DD" - placeholder="璇烽�夋嫨缁堜繚鏃ユ湡" - ></ProFormDatePicker> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 label="瀹為檯宸ヤ綔鍗曚綅:" prop="workEnterprise" mode="read"> - <ProFormText v-model.trim="form.workEnterprise" placeholder="璇疯緭鍏ュ疄闄呭伐浣滃崟浣�" /> - </ProFormItemV2> - </ProFormColItem> - </ProFormCol> - </ProForm> - </ChunkCell> - <ChunkCell title="淇濆崟淇℃伅"> - <ProForm :model="form" ref="insuranceFormRef" label-width="180px" is-read> - <ProFormCol> - <ProFormColItem :span="6"> - <ProFormItemV2 - label="浜嬫晠绫诲瀷:" - prop="accidentType" - :check-rules="[{ message: '璇烽�夋嫨浜嬫晠绫诲瀷' }]" - > - <ProFormSelect - placeholder="璇烽�夋嫨浜嬫晠绫诲瀷" - :value-enum="AccidentTypeEnum" - clearable - v-model="form.accidentType" - ></ProFormSelect> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 - label="浜嬫晠鍙戠敓鏃堕棿:" - prop="accidentTime" - :check-rules="[{ message: '璇烽�夋嫨浜嬫晠鍙戠敓鏃堕棿' }]" - > - <ProFormDatePicker - v-model="form.accidentTime" - type="datetime" - format="YYYY-MM-DD HH:mm:ss" - placeholder="璇烽�夋嫨浜嬫晠鍙戠敓鏃堕棿" - ></ProFormDatePicker> - </ProFormItemV2> - </ProFormColItem> - </ProFormCol> - <ProFormCol> - <ProFormColItem :span="6"> - <ProFormItemV2 label="浼ゆ畫姣斾緥:" prop="disabilityRatio"> - <ProFormInputNumber - v-model="form.disabilityRatio" - :controls="false" - :min="0" - :max="100" - unit="%" - ></ProFormInputNumber> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="18"> - <ProFormItemV2 - label="浜嬪彂鍦扮偣:" - prop="accidentAddress" - :check-rules="[{ message: '璇疯緭鍏ヤ簨鍙戝湴鐐�' }]" - > - <ProFormText v-model.trim="form.accidentAddress" placeholder="璇疯緭鍏ヤ簨鍙戝湴鐐�" /> - </ProFormItemV2> - </ProFormColItem> - </ProFormCol> - <ProFormCol> - <ProFormColItem :span="24"> - <ProFormItemV2 - label="浜嬫晠缁忚繃:" - prop="accidentProcess" - :check-rules="[{ message: '璇疯緭鍏ヤ簨鏁呯粡杩�' }]" - > - <ProFormTextArea - v-model="form.accidentProcess" - :rows="10" - placeholder="璇疯緭鍏ヤ簨鏁呯粡杩�" - ></ProFormTextArea> - </ProFormItemV2> - </ProFormColItem> - </ProFormCol> - <div class="attachments-wrapper"> - <div class="attachments"> - <ProFormItemV2 label="浼よ�呰韩浠借瘉鐓х墖锛堟鍙嶏級:"> - <div class="id-imgUrl-wrapper"> - <ProFormItemV2 prop="attachmentFrontIdCards" class="pro-form-item-label-hidden"> - <ProFormImageUpload - v-model:file-url="form.attachmentFrontIdCards" - :limitFileSize="10" - btnText="韬唤璇佷汉鍍忛潰" - :showTip="false" - > - </ProFormImageUpload> - </ProFormItemV2> - <ProFormItemV2 prop="attachmentBackIdCards" class="pro-form-item-label-hidden"> - <ProFormImageUpload - v-model:file-url="form.attachmentBackIdCards" - :limitFileSize="10" - btnText="韬唤璇佸浗寰介潰" - :showTip="false" - > - </ProFormImageUpload> - </ProFormItemV2> - </div> - </ProFormItemV2> - <ProFormItemV2 prop="attachmentSites" label="鍙椾激鍦哄湴:"> - <ProFormImageUpload - v-model:file-url="form.attachmentSites" - :limitFileSize="10" - :showTip="false" - > - </ProFormImageUpload> - </ProFormItemV2> - <ProFormItemV2 prop="attachmentHandheldIdCards" label="浼よ�呮墜鎸佽韩浠借瘉鐓�:"> - <ProFormImageUpload - v-model:file-url="form.attachmentHandheldIdCards" - :limitFileSize="10" - :showTip="false" - > - </ProFormImageUpload> - </ProFormItemV2> - <ProFormItemV2 prop="attachmentAreas" label="鍙椾激閮ㄤ綅:"> - <ProFormImageUpload - v-model:file-url="form.attachmentAreas" - :limitFileSize="10" - :showTip="false" - :limitFileCount="0" - > - </ProFormImageUpload> - </ProFormItemV2> - <ProFormItemV2 prop="attachmentCases" label="鐥呬緥鐓х墖:"> - <ProFormImageUpload - v-model:file-url="form.attachmentCases" - :limitFileSize="10" - :showTip="false" - :limitFileCount="0" - > - </ProFormImageUpload> - </ProFormItemV2> - </div> - </div> - <ProFormItemV2> - <el-button type="primary" icon="Download" @click="handleExportPic">涓嬭浇鍥剧墖</el-button> - </ProFormItemV2> - </ProForm> - </ChunkCell> - <ChunkCell title="鐞嗚禂缁撴灉"> - <ProForm :model="form" ref="claimFormRef" label-width="180px"> - <ProFormCol> - <ProFormColItem :span="6"> - <ProFormItemV2 label="鐞嗚禂缁撴灉:" prop="claimResult"> - <ProFormSelect - placeholder="璇烽�夋嫨鐞嗚禂缁撴灉" - :value-enum="InsuranceClaimResultEnumText" - clearable - v-model="form.claimResult" - ></ProFormSelect> - </ProFormItemV2> - </ProFormColItem> - <ProFormColItem :span="6"> - <ProFormItemV2 label="缁�/鎾ゆ鏃堕棿:" prop="claimResultTime"> - <ProFormDatePicker - v-model="form.claimResultTime" - type="date" - format="YYYY-MM-DD" - value-format="YYYY-MM-DD" - placeholder="璇烽�夋嫨缁�/鎾ゆ鏃堕棿" - ></ProFormDatePicker> - </ProFormItemV2> - </ProFormColItem> - </ProFormCol> - <ProFormItemV2 label="涓嬫閲戦:" prop="downPaymentAmount"> - <ProFormInputNumber - v-model="form.downPaymentAmount" - :controls="false" - :min="0" - unit="鍏�" - :precision="2" - ></ProFormInputNumber> - </ProFormItemV2> - <div class="chuck-add-or-edit-actions"> - <el-button @click="handleBack">鍏抽棴</el-button> - <el-button type="primary" @click="handleSubmit">淇濆瓨</el-button> - </div> - </ProForm> - </ChunkCell> - </AppScrollContainer> - </LoadingLayout> -</template> - -<script setup lang="ts"> -import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; -import * as insuranceClaimServices from '@/services/api/InsuranceClaim'; -import { useQuery } from '@tanstack/vue-query'; -import { - ChunkCell, - AppScrollContainer, - LoadingLayout, - UploadUserFile, - ProForm, - ProFormCol, - ProFormColItem, - ProFormText, - ProFormDatePicker, - ProFormSelect, - ProFormImageUpload, - ProFormTextArea, - ProFormItemV2, - ProFormMixinsItemContainer, - ProFormInputNumber, -} from '@bole-core/components'; -import { FormInstance } from 'element-plus'; -import { validateFormList, format, setOSSLink } from '@/utils'; -import { disabledReportedDate, convertFormToattAchments } from './utils'; -import { - InsuredInstitutionEnum, - InsuranceSchemeEnum, - AccidentTypeEnum, - InsuranceClaimAttachmentBusinessTypeEnum, - InsuranceClaimResultEnumText, -} from '@/constants'; -import { useRouteView, useGlobalEventContext } from '@/hooks'; -import { Message, downloadWithZip } from '@bole-core/core'; -import { useInsuranceClaimDetail } from './hooks'; - -defineOptions({ - name: 'InsuranceClaimDetail', -}); - -const route = useRoute(); -const insuranceOrderId = route.params.id as string; -const backRouteName = (route.query.backRouteName as string) ?? 'ExportManage'; -const insuranceClaimId = (route.query.insuranceClaimId as string) ?? ''; -const { closeViewPush } = useRouteView(); - -const eventContext = useGlobalEventContext(); - -const { form, isLoading, claimDetail } = useInsuranceClaimDetail({ - insuranceOrderId, - insuranceClaimId, -}); - -function handleReportedTimeChange() { - if (form.accidentTime === '') { - form.accidentTime = form.reportedTime; - } -} - -const formRef = ref<FormInstance>(); -const insuranceBaseFormRef = ref<FormInstance>(); -const insuranceFormRef = ref<FormInstance>(); -const claimFormRef = ref<FormInstance>(); - -async function handleSubmit() { - try { - const valid = await validateFormList([ - // formRef.value, - // insuranceBaseFormRef.value, - // insuranceFormRef.value, - claimFormRef.value, - ]); - if (valid) { - updateInsuranceClaim(); - } - } catch (error) {} -} - -async function updateInsuranceClaim() { - try { - let params: API.UpdateInsuranceClaimInput = { - id: insuranceClaimId, - channel: form.channel, - name: form.name, - idNumber: form.idNumber, - workType: form.workType, - laborContractEnterprise: form.laborContractEnterprise, - workEnterprise: form.workEnterprise, - insuranceBeginTime: format(form.insuranceBeginTime), - insuranceEndTime: format(form.insuranceEndTime), - insuredInstitution: form.insuredInstitution, - insuranceScheme: form.insuranceScheme, - onJobFlag: form.onJobFlag, - gender: form.gender, - age: form.age, - premiumAmount: form.premiumAmount, - incDecAmount: form.incDecAmount, - insuranceOrderId: insuranceOrderId, - reportedTime: format(form.reportedTime, 'YYYY-MM-DD HH:mm:ss'), - contactNumber: form.contactNumber, - bakContactNumber: form.bakContactNumber, - accidentType: form.accidentType, - accidentTime: format(form.accidentTime, 'YYYY-MM-DD HH:mm:ss'), - // disabilityRatio: form.disabilityRatio, - accidentAddress: form.accidentAddress, - accidentProcess: form.accidentProcess, - claimResult: form.claimResult, - claimResultTime: form.claimResultTime, - attachments: [ - ...convertFormToattAchments( - form.attachmentFrontIdCards, - InsuranceClaimAttachmentBusinessTypeEnum.InjuredIdCardImg - ), - ...convertFormToattAchments( - form.attachmentBackIdCards, - InsuranceClaimAttachmentBusinessTypeEnum.InjuredIdCardImg - ), - ...convertFormToattAchments( - form.attachmentSites, - InsuranceClaimAttachmentBusinessTypeEnum.InjurySiteImg - ), - ...convertFormToattAchments( - form.attachmentHandheldIdCards, - InsuranceClaimAttachmentBusinessTypeEnum.InjuredHandheldIdCardImg - ), - ...convertFormToattAchments( - form.attachmentAreas, - InsuranceClaimAttachmentBusinessTypeEnum.InjuredAreaImg - ), - ...convertFormToattAchments( - form.attachmentCases, - InsuranceClaimAttachmentBusinessTypeEnum.CasesImg - ), - ], - }; - if (form.downPaymentAmount) params.downPaymentAmount = form.downPaymentAmount; - if (form.disabilityRatio) params.disabilityRatio = form.disabilityRatio; - let res = await insuranceClaimServices.updateInsuranceClaim(params); - if (res) { - Message.successMessage('鎿嶄綔鎴愬姛'); - eventContext.emit('updateInsuranceClaim'); - handleBack(); - } - } catch (error) {} -} - -function handleBack() { - closeViewPush(route, { - name: backRouteName, - }); -} - -function handleExportPic() { - if (claimDetail.value.attachments.length > 0) { - downloadWithZip( - claimDetail.value.attachments.map((item) => ({ data: setOSSLink(item.url) })), - '鐞嗚禂鍥剧墖瀵煎嚭' - ); - } else { - Message.errorMessage('鏃犲彲瀵煎嚭鐨勫浘鐗�'); - } -} -</script> - -<style lang="scss" scoped> -@use '@/style/common.scss' as *; - -.attachments-wrapper { - display: flex; - - .attachments { - flex: 1; - min-width: 0; - } -} - -.id-imgUrl-wrapper { - display: flex; - gap: 40px; -} -</style> diff --git a/src/views/InsuranceClaim/hooks/index.ts b/src/views/InsuranceClaim/hooks/index.ts deleted file mode 100644 index a29ad5e..0000000 --- a/src/views/InsuranceClaim/hooks/index.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; -import * as insuranceClaimServices from '@/services/api/InsuranceClaim'; -import { useQuery } from '@tanstack/vue-query'; -import { InsuranceClaimAttachmentBusinessTypeEnum, InsuranceClaimResultEnum } from '@/constants'; -import { convertAttAchmentsToForm } from '../utils'; -import { UploadUserFile } from '@bole-core/components'; - -type UseInsuranceClaimDetailOptions = { - insuranceOrderId?: MaybeRef<string>; - insuranceClaimId?: MaybeRef<string>; -}; - -export function useInsuranceClaimDetail({ - insuranceOrderId, - insuranceClaimId, -}: UseInsuranceClaimDetailOptions) { - const DefaultAccidentProcess = `浜嬫晠缁忚繃: -娌荤枟鍖婚櫌:浜岀骇鍙婁互涓婂叕绔嬪尰闄� -璇婃柇缁撴灉(涓庤瘖鏂瘉鏄庝竴鑷�) -棰勪及璐圭敤:`; - - const form = reactive({ - name: '', - idNumber: '', - workType: '', - laborContractEnterprise: '', - workEnterprise: '', - insuranceBeginTime: '', - insuranceEndTime: '', - insuredInstitution: '', - insuranceScheme: '', - reportedTime: '', - contactNumber: '', - bakContactNumber: '', - accidentType: '', - accidentTime: '', - disabilityRatio: 0, - accidentAddress: '', - accidentProcess: DefaultAccidentProcess, - attachmentFrontIdCards: [] as UploadUserFile[], - attachmentBackIdCards: [] as UploadUserFile[], - attachmentSites: [] as UploadUserFile[], - attachmentHandheldIdCards: [] as UploadUserFile[], - attachmentAreas: [] as UploadUserFile[], - attachmentCases: [] as UploadUserFile[], - - channel: '', - onJobFlag: '', - gender: '', - age: 0, - premiumAmount: 0, - incDecAmount: 0, - - claimResult: '' as any as InsuranceClaimResultEnum, - claimResultTime: '', - downPaymentAmount: 0, - }); - - const { isLoading, data: claimDetail } = useQuery({ - queryKey: ['insuranceClaimServices/getInsuranceClaimDetail', insuranceClaimId], - queryFn: async () => { - return await insuranceClaimServices.getInsuranceClaimDetail( - { - id: unref(insuranceClaimId), - }, - { - showLoading: false, - } - ); - }, - // placeholderData: () => null as API.InsuranceClaimDetailOutput, - onSuccess(data) { - if (data) { - form.name = data.name; - form.idNumber = data.idNumber; - form.insuredInstitution = data.insuredInstitution; - form.insuranceScheme = data.insuranceScheme; - form.reportedTime = data.reportedTime; - form.contactNumber = data.contactNumber; - form.bakContactNumber = data.bakContactNumber; - form.accidentType = data.accidentType; - form.accidentTime = data.accidentTime; - form.disabilityRatio = data.disabilityRatio ?? 0; - form.accidentAddress = data.accidentAddress; - form.accidentProcess = data.accidentProcess ?? DefaultAccidentProcess; - - form.insuranceBeginTime = data.insuranceBeginTime; - form.insuranceEndTime = data.insuranceEndTime; - form.laborContractEnterprise = data.laborContractEnterprise; - form.workEnterprise = data.workEnterprise; - form.workType = data.workType; - - form.channel = data.channel; - form.onJobFlag = data.onJobFlag; - form.gender = data.gender; - form.age = data.age; - form.premiumAmount = data.premiumAmount; - form.incDecAmount = data.incDecAmount; - - form.claimResult = data.claimResult ?? ('' as any as InsuranceClaimResultEnum); - form.claimResultTime = data.claimResultTime ?? ''; - form.downPaymentAmount = data.downPaymentAmount ?? 0; - - const attachmentIdCard = convertAttAchmentsToForm( - data.attachments, - InsuranceClaimAttachmentBusinessTypeEnum.InjuredIdCardImg - ); - form.attachmentFrontIdCards = attachmentIdCard[0] ? [attachmentIdCard[0]] : []; - form.attachmentBackIdCards = attachmentIdCard[1] ? [attachmentIdCard[1]] : []; - form.attachmentSites = convertAttAchmentsToForm( - data.attachments, - InsuranceClaimAttachmentBusinessTypeEnum.InjurySiteImg - ); - form.attachmentHandheldIdCards = convertAttAchmentsToForm( - data.attachments, - InsuranceClaimAttachmentBusinessTypeEnum.InjuredHandheldIdCardImg - ); - form.attachmentAreas = convertAttAchmentsToForm( - data.attachments, - InsuranceClaimAttachmentBusinessTypeEnum.InjuredAreaImg - ); - form.attachmentCases = convertAttAchmentsToForm( - data.attachments, - InsuranceClaimAttachmentBusinessTypeEnum.CasesImg - ); - } - }, - enabled: computed(() => !!unref(insuranceClaimId)), - }); - - const isClaimDetailEdit = computed(() => !!claimDetail.value); - - // const { isLoading } = useQuery({ - // queryKey: ['insuranceOrderServices/getInsuranceOrderDetail', insuranceOrderId], - // queryFn: async () => { - // return await insuranceOrderServices.getInsuranceOrderDetail( - // { id: unref(insuranceOrderId) }, - // { - // showLoading: false, - // } - // ); - // }, - // placeholderData: () => ({} as API.InsuranceOrderListOutput), - // onSuccess(data) { - // form.name = data.name; - // form.insuranceBeginTime = data.insuranceBeginTime; - // form.insuranceEndTime = data.insuranceEndTime; - // form.laborContractEnterprise = data.laborContractEnterprise; - // form.workEnterprise = data.workEnterprise; - // form.workType = data.workType; - // form.channel = data.channel; - // form.onJobFlag = data.onJobFlag; - // form.gender = data.gender; - // form.age = data.age; - // form.premiumAmount = data.premiumAmount; - // form.incDecAmount = data.incDecAmount; - // }, - // enabled: computed(() => claimDetail.value === null), - // }); - - return { - form, - // isClaimLoading, - claimDetail, - isLoading, - isClaimDetailEdit, - }; -} diff --git a/src/views/InsuranceClaim/utils/index.ts b/src/views/InsuranceClaim/utils/index.ts deleted file mode 100644 index df1cb3d..0000000 --- a/src/views/InsuranceClaim/utils/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import dayjs from 'dayjs'; -import { UploadUserFile } from '@bole-core/components'; -import { InsuranceClaimAttachmentBusinessTypeEnum } from '@/constants'; -import { convertApi2FormUrl } from '@/utils'; - -export function disabledReportedDate(time: Date) { - return !dayjs(time).isBefore(dayjs()); -} - -export function convertFormToattAchments( - files: UploadUserFile[], - businessType: InsuranceClaimAttachmentBusinessTypeEnum -) { - return files.map((x) => ({ - fileName: x.name, - url: x.path, - businessType: businessType, - })); -} - -export function convertAttAchmentsToForm( - attachments: API.InsuranceClaimAttachmentOutput[], - businessType: InsuranceClaimAttachmentBusinessTypeEnum -) { - const filterAttachments = attachments.filter((x) => x.businessType === businessType); - return filterAttachments.length > 0 - ? filterAttachments.map((x) => convertApi2FormUrl(x.url)) - : []; -} diff --git a/src/views/Login/Login.vue b/src/views/Login/Login.vue index 027f83e..7f317c5 100644 --- a/src/views/Login/Login.vue +++ b/src/views/Login/Login.vue @@ -138,7 +138,7 @@ import closeEye from '@/assets/svgIcons/close_eye.svg?component'; import openEye from '@/assets/svgIcons/close_eye.svg?component'; // import { useSettingStoreHook } from '@/store/modules/settings'; -import { getAppSetting } from '@config/config'; +import Config from '@config/config'; // const boleSetting = useSettingStoreHook(); const ctx = useProvideContext(); -- Gitblit v1.9.1