From acaec313ab0e3c9381060e36bf3ce4abc606dc9a Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期五, 28 三月 2025 14:07:11 +0800 Subject: [PATCH] feat: 接口对接 --- src/views/Home/BatchChange.vue | 157 +++++++++----- src/views/Home/components/BatchChangeRecordView.vue | 95 ++++++-- src/views/Home/components/BatchChangeRecordDetailDialog.vue | 46 +-- src/constants/insureBatchBill.ts | 59 +++++ src/services/api/InsureBatchBill.ts | 59 +++++ src/services/api/typings.d.ts | 88 ++++++++ src/views/Home/components/InsureOrderInfoView.vue | 25 + src/constants/index.ts | 1 src/views/InsuranceClaim/hooks/index.ts | 8 src/views/Home/Home.vue | 4 src/views/InsuranceClaim/components/InsuranceClaimView.vue | 49 ++- pnpm-lock.yaml | 48 --- 12 files changed, 459 insertions(+), 180 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 09294f8..2c85226 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + overrides: vue: 3.5.11 @@ -17,7 +21,7 @@ version: 1.0.3(@bole-12333/chat-kit@1.0.1)(@tiptap/core@2.1.13)(@tiptap/extension-document@2.1.13)(@tiptap/extension-image@2.1.13)(@tiptap/extension-mention@2.1.13)(@tiptap/extension-paragraph@2.1.13)(@tiptap/extension-placeholder@2.1.13)(@tiptap/extension-text@2.1.13)(@tiptap/pm@2.1.13)(@tiptap/suggestion@2.1.13)(dayjs@1.11.6)(vue@3.5.11) '@bole-core/components': specifier: latest - version: 1.3.2(@bole-core/core@1.0.2)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@tanstack/vue-query@4.37.1)(@videojs-player/vue@1.0.0)(@vueuse/core@11.1.0)(@vueuse/shared@11.1.0)(dayjs@1.11.6)(element-plus@2.9.1)(lodash@4.17.21)(mitt@3.0.0)(senin-help@1.0.5)(senin-vue@1.0.4)(video.js@7.20.3)(vue-component-type-helpers@2.1.6)(vue@3.5.11) + version: link:../BoleWebCore/packages/components '@bole-core/core': specifier: latest version: 1.0.2(@ywwlmm/openapi@0.0.3)(ali-oss@6.21.0)(axios@1.7.7)(dayjs@1.11.6)(element-plus@2.9.1)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.1)(vue-router@4.4.5)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5) @@ -2152,44 +2156,6 @@ '@tiptap/suggestion': 2.1.13(@tiptap/core@2.1.13)(@tiptap/pm@2.1.13) dayjs: 1.11.6 vue: 3.5.11(typescript@4.8.4) - dev: false - - /@bole-core/components@1.3.2(@bole-core/core@1.0.2)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@tanstack/vue-query@4.37.1)(@videojs-player/vue@1.0.0)(@vueuse/core@11.1.0)(@vueuse/shared@11.1.0)(dayjs@1.11.6)(element-plus@2.9.1)(lodash@4.17.21)(mitt@3.0.0)(senin-help@1.0.5)(senin-vue@1.0.4)(video.js@7.20.3)(vue-component-type-helpers@2.1.6)(vue@3.5.11): - resolution: {integrity: sha512-sMCgoaKtJi3nPP3MrMx5cs0IjI0Tbes3YJF1AHN3TItR549aYc+vb+mkU34MjWh7EzqTE40htPxJueAGT6tMWg==} - peerDependencies: - '@bole-core/core': '*' - '@bole-core/sass-utils': '*' - '@element-plus/icons-vue': '*' - '@tanstack/vue-query': '*' - '@videojs-player/vue': '*' - '@vueuse/core': '*' - '@vueuse/shared': '*' - dayjs: ^1.11.7 - element-plus: '*' - lodash: '*' - mitt: '*' - senin-help: '*' - senin-vue: '*' - video.js: '*' - vue: '*' - vue-component-type-helpers: ^2.1.6 - dependencies: - '@bole-core/core': 1.0.2(@ywwlmm/openapi@0.0.3)(ali-oss@6.21.0)(axios@1.7.7)(dayjs@1.11.6)(element-plus@2.9.1)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.1)(vue-router@4.4.5)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5) - '@bole-core/sass-utils': 0.0.1(element-plus@2.9.1) - '@element-plus/icons-vue': 2.3.1(vue@3.5.11) - '@tanstack/vue-query': 4.37.1(vue@3.5.11) - '@videojs-player/vue': 1.0.0(@types/video.js@7.3.49)(video.js@7.20.3)(vue@3.5.11) - '@vueuse/core': 11.1.0(vue@3.5.11) - '@vueuse/shared': 11.1.0(vue@3.5.11) - dayjs: 1.11.6 - element-plus: 2.9.1(vue@3.5.11) - lodash: 4.17.21 - mitt: 3.0.0 - senin-help: 1.0.5(@tanstack/vue-query@4.37.1)(axios@1.7.7)(dayjs@1.11.6)(element-plus@2.9.1)(file-saver@2.0.5)(lodash@4.17.21)(semver@7.6.3)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5) - senin-vue: 1.0.4(@tanstack/vue-query@4.37.1)(axios@1.7.7)(dayjs@1.11.6)(element-plus@2.9.1)(file-saver@2.0.5)(lodash@4.17.21)(mitt@3.0.0)(semver@7.6.3)(senin-help@1.0.5)(vue@3.5.11) - video.js: 7.20.3 - vue: 3.5.11(typescript@4.8.4) - vue-component-type-helpers: 2.1.6 dev: false /@bole-core/core@1.0.2(@ywwlmm/openapi@0.0.3)(ali-oss@6.21.0)(axios@1.7.7)(dayjs@1.11.6)(element-plus@2.9.1)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.1)(vue-router@4.4.5)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5): @@ -18086,7 +18052,3 @@ /zwitch@1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} dev: false - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false diff --git a/src/constants/index.ts b/src/constants/index.ts index a344919..50ae80d 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -10,3 +10,4 @@ export * from './insuranceClaim'; export * from './app'; export * from './temp'; +export * from './insureBatchBill'; diff --git a/src/constants/insureBatchBill.ts b/src/constants/insureBatchBill.ts new file mode 100644 index 0000000..16fed16 --- /dev/null +++ b/src/constants/insureBatchBill.ts @@ -0,0 +1,59 @@ +export enum BatchBillCheckStatus { + /**鎵瑰崟寰呭鏍� */ + WaitCheck = 1, + /**鎵瑰崟瀹℃牳涓� */ + Checking = 2, + /**宸茬敓鏁� */ + InValidate = 10, + /**鎵瑰崟寰呮敮浠� */ + WaitPay = 15, + /**瓒呮湡鏈敮浠� */ + ExpirePay = 20, + /**鏀粯鎴愬姛 */ + PaySuccess = 30, + /**瀹℃牳涓嶉�氳繃 */ + CheckTurnDown = -1, + /**寰呴��璐� */ + WaitForRefund = -10, + /**宸查��璐� */ + HasRefund = -11, + /**宸叉挙鍥� */ + HasReverse = -20, + /**宸插垹闄� */ + HasDeleted = -30, + /**涓嬪彂淇敼 */ + WaitForModify = -40, +} + +export const BatchBillCheckStatusText = { + [BatchBillCheckStatus.WaitCheck]: '寰呭鏍�', + [BatchBillCheckStatus.Checking]: '瀹℃牳涓�', + [BatchBillCheckStatus.InValidate]: '宸茬敓鏁�', + [BatchBillCheckStatus.WaitPay]: '寰呮敮浠�', + [BatchBillCheckStatus.ExpirePay]: '瓒呮湡鏈敮浠�', + // [BatchBillCheckStatus.PaySuccess]: '鏀粯鎴愬姛', + [BatchBillCheckStatus.CheckTurnDown]: '涓嶉�氳繃', + [BatchBillCheckStatus.WaitForRefund]: '寰呴��璐�', + [BatchBillCheckStatus.HasRefund]: '宸查��璐�', + [BatchBillCheckStatus.HasReverse]: '宸叉挙鍥�', + [BatchBillCheckStatus.HasDeleted]: '宸插垹闄�', + [BatchBillCheckStatus.WaitForModify]: '涓嬪彂淇敼', +}; + +export enum BatchChangeTypeEnum { + /**鎵瑰 */ + Add = 10, + /**鎵瑰噺 */ + Delete = 20, + /**鏇挎崲 */ + Update = 30, + /**鍔犲噺浜� */ + AddAndSub = 40, +} + +export const BatchChangeTypeEnumText = { + [BatchChangeTypeEnum.Add]: '鎵瑰', + [BatchChangeTypeEnum.Delete]: '鎵瑰噺', + [BatchChangeTypeEnum.Update]: '鏇挎崲', + [BatchChangeTypeEnum.AddAndSub]: '鍔犲噺浜�', +}; diff --git a/src/services/api/InsureBatchBill.ts b/src/services/api/InsureBatchBill.ts index 3dd1b7a..37a76df 100644 --- a/src/services/api/InsureBatchBill.ts +++ b/src/services/api/InsureBatchBill.ts @@ -80,12 +80,63 @@ ); } +/** 瀹㈡埛绔�-鎵规敼璇︽儏 GET /api/InsureBatchBill/GetInsureBatchDetail */ +export async function getInsureBatchDetail( + // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄) + params: API.APIgetInsureBatchDetailParams, + options?: API.RequestConfig +) { + return request<API.InsureBatchDetailDto>('/api/InsureBatchBill/GetInsureBatchDetail', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + /** 瀹㈡埛绔�-鎵瑰崟澧炲憳鍑忓憳淇濆崟鏁版嵁瀵煎叆 POST /api/InsureBatchBill/ImportBatchAddOrSubOrderData */ export async function importBatchAddOrSubOrderData( body: API.ImportBatchAddOrSubOrderInput, options?: API.RequestConfig ) { - return request<any>('/api/InsureBatchBill/ImportBatchAddOrSubOrderData', { + return request<API.CheckImportBatchAddOrSubOrderDataOutput>( + '/api/InsureBatchBill/ImportBatchAddOrSubOrderData', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 瀹㈡埛绔�-鎵瑰崟鏇挎崲鏁版嵁瀵煎叆 POST /api/InsureBatchBill/ImportBatchUpdateOrderData */ +export async function importBatchUpdateOrderData( + body: API.ImportBatchAddOrSubOrderInput, + options?: API.RequestConfig +) { + return request<API.CheckImportBatchUpdateOrderDataOutput>( + '/api/InsureBatchBill/ImportBatchUpdateOrderData', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + } + ); +} + +/** 瀹㈡埛绔�-妫�鏌ユ壒鍗曞鍛樺噺鍛樹繚鍗曟暟鎹鍏� POST /api/InsureBatchBill/ImportCheckBatchAddOrSubOrderData */ +export async function importCheckBatchAddOrSubOrderData( + body: API.ImportBatchAddOrSubOrderInput, + options?: API.RequestConfig +) { + return request<any>('/api/InsureBatchBill/ImportCheckBatchAddOrSubOrderData', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -95,12 +146,12 @@ }); } -/** 瀹㈡埛绔�-鎵瑰崟鏇挎崲鏁版嵁瀵煎叆 POST /api/InsureBatchBill/ImportBatchUpdateOrderData */ -export async function importBatchUpdateOrderData( +/** 瀹㈡埛绔�-妫�鏌ユ壒鍗曟浛鎹㈡暟鎹鍏� POST /api/InsureBatchBill/ImportCheckBatchUpdateOrderData */ +export async function importCheckBatchUpdateOrderData( body: API.ImportBatchAddOrSubOrderInput, options?: API.RequestConfig ) { - return request<any>('/api/InsureBatchBill/ImportBatchUpdateOrderData', { + return request<any>('/api/InsureBatchBill/ImportCheckBatchUpdateOrderData', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/src/services/api/typings.d.ts b/src/services/api/typings.d.ts index 0831b64..8166216 100644 --- a/src/services/api/typings.d.ts +++ b/src/services/api/typings.d.ts @@ -268,6 +268,10 @@ id?: string; } + interface APIgetInsureBatchDetailParams { + batchBillId?: string; + } + interface APIgetListParams { filter?: string; clientId?: string; @@ -459,6 +463,8 @@ insureBatchBillId?: string; /** 瀹℃牳鐞嗙敱 */ auditNote?: string; + /** 鎵瑰崟缂栧彿 */ + batchBillNo?: string; checkStatus?: BatchBillCheckStatus; /** 鐢熸晥鏃堕棿 */ effectTime?: string; @@ -483,6 +489,20 @@ id2?: string; sortCode2?: number; type?: number; + } + + interface CheckImportBatchAddOrSubOrderDataOutput { + /** 閿欒鏁版嵁鍒楄〃 */ + error?: ImportBatchAddOrSubOrderDataInput[]; + /** 鏂板鏁版嵁鍒楄〃 */ + addOrSub?: ImportBatchAddOrSubOrderDataInput[]; + } + + interface CheckImportBatchUpdateOrderDataOutput { + /** 閿欒鏁版嵁鍒楄〃 */ + error?: ImportBatchUpdateOrderDataInput[]; + /** 鏇挎崲鏁版嵁鍒楄〃 */ + update?: ImportBatchUpdateOrderDataInput[]; } interface CheckLoginVerificationCodeInput { @@ -968,6 +988,31 @@ roleNames: string[]; } + interface ImportBatchAddOrSubOrderDataInput { + /** 鎵规敼鏍囧織 */ + changeFlag: string; + /** 鏂规浠g爜 */ + insuranceScheme: string; + /** 濮撳悕 */ + name: string; + /** 璇佷欢绫诲瀷 */ + certType: string; + /** 璇佷欢鍙风爜 */ + idNumber: string; + /** 骞撮緞 */ + age?: number; + /** 鐢佃瘽鍙风爜 */ + phoneNumber?: string; + /** 鑱屼笟/宸ョ */ + workType: string; + /** 鎬у埆 */ + gender?: string; + /** 鍑虹敓鏃ユ湡 */ + birthDay?: string; + /** 澶囨敞 */ + remark?: string; + } + interface ImportBatchAddOrSubOrderInput { /** 瀵煎叆鍦板潃 */ url?: string; @@ -989,6 +1034,32 @@ workType?: string; birthDay?: string; remark?: string; + } + + interface ImportBatchUpdateOrderDataInput { + /** 鍘熻淇濅汉濮撳悕 */ + orginName: string; + /** 鍘熻淇濅汉璇佷欢鍙风爜 */ + orginIdNumber: string; + /** 濮撳悕 */ + name: string; + /** 璇佷欢绫诲瀷 */ + certType: string; + /** 璇佷欢鍙风爜 */ + idNumber: string; + /** 鐢佃瘽鍙风爜 */ + phoneNumber?: string; + /** 鑱屼笟/宸ョ */ + workType: string; + /** 鎬у埆 */ + gender?: string; + /** 骞撮緞 */ + age?: number; + /** 鍑虹敓鏃ユ湡 */ + birthDay?: string; + /** 澶囨敞 */ + remark?: string; + changeFlag?: string; } interface ImportInsStaffAnalysisList { @@ -1192,6 +1263,10 @@ orderRelevanceStr?: string; /** 淇濆崟鏂囦欢 */ orderBillFile?: string; + /** 鎶曚繚浜哄拰琚姇淇濅汉 */ + enterpriseName?: string; + phone?: string; + insuranceOrg?: string; } interface InsuranceOrderListOutputPageOutput { @@ -1226,6 +1301,8 @@ idNumber?: string; /** 鎬у埆 */ gender?: string; + /** 鎵嬫満鍙风爜 */ + phoneNumber?: string; /** 骞撮緞 */ age?: number; /** 鍑虹敓鏃ユ湡 */ @@ -1288,6 +1365,17 @@ delInsStaffList?: ImportBatchStaffListInput[]; } + interface InsureBatchDetailDto { + /** 鎵规敼浜哄憳璇︽儏 */ + staffList?: InsureBatchBillDetailDto[]; + /** 鐢熸晥鏃堕棿 */ + effectTime?: string; + /** 淇濆崟鍙� */ + insureBillNo?: string; + /** 鎶曚繚浜� */ + enterpriseName?: string; + } + interface IStringValueType { name?: string; properties?: Record<string, any>; diff --git a/src/views/Home/BatchChange.vue b/src/views/Home/BatchChange.vue index fb48b4d..2fa1b22 100644 --- a/src/views/Home/BatchChange.vue +++ b/src/views/Home/BatchChange.vue @@ -1,11 +1,11 @@ <template> - <LoadingLayout :loading="state.loading"> + <LoadingLayout> <AppScrollContainer> <ChunkCell title="1"> <template #title> <div class="batch-change-title"> - <el-text style="margin-right: 20px">{{ `淇濆崟鍙凤細${'958585860689'}` }}</el-text> - <el-text>{{ `鎶曚繚浜猴細${'浜哄姏鏃犲咖'}` }}</el-text> + <el-text style="margin-right: 20px">{{ `淇濆崟鍙凤細${insureBillNo ?? ''}` }}</el-text> + <el-text>{{ `鎶曚繚浜猴細${insurerName ?? ''}` }}</el-text> </div> </template> <ProForm :model="state.form" ref="formRef" label-width="120px"> @@ -29,15 +29,16 @@ <ProFormColItem :span="8"> <ProFormItemV2 label="" prop="url" label-width="0"> <ProFormUpload - v-model:file-url="state.form.url" + v-model:file-url="state.form.addOrReduceUrl" :limit="1" :limitFileSize="10" - accept="xlsx,xls" + accept="xlsx" :showTip="false" :on-success="handleUploadAddOrReduce" + :disabled="urlDisabled" > <template #default> - <el-button type="primary">鍔犲噺浜�</el-button> + <el-button type="primary" :disabled="urlDisabled">鍔犲噺浜�</el-button> <el-button link type="primary" @click.stop="DownloadAddOrReducePersonTemplate" >涓嬭浇妯℃澘</el-button > @@ -50,15 +51,16 @@ <ProFormColItem :span="8"> <ProFormItemV2 label="" prop="url" label-width="0"> <ProFormUpload - v-model:file-url="state.form.url" + v-model:file-url="state.form.replaceUrl" :limit="1" :limitFileSize="10" - accept="xlsx,xls" + accept="xlsx" :showTip="false" :on-success="handleUploadReplace" + :disabled="urlDisabled" > <template #default> - <el-button type="primary">鏇挎崲浜�</el-button> + <el-button type="primary" :disabled="urlDisabled">鏇挎崲浜�</el-button> <el-button link type="primary" @click.stop="downloadReplacePersonTemplate" >涓嬭浇妯℃澘</el-button > @@ -111,10 +113,12 @@ } from '@bole-core/components'; import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; import * as insureBatchBillServices from '@/services/api/InsureBatchBill'; -import { downloadFileByUrl, Message, OrderInputType } from '@bole-core/core'; +import { downloadFile, downloadFileByUrl, Message, OrderInputType } from '@bole-core/core'; import { InsuranceAddOrReduceTempPath, InsuranceChangeTempPath } from '@/constants'; import { useRouteView } from '@/hooks'; import { FormInstance } from 'element-plus'; +import { useQuery, useQueryClient } from '@tanstack/vue-query'; +import { paginateList } from '@/utils'; defineOptions({ name: 'BatchChange', @@ -123,7 +127,7 @@ const column: API.CustomModuleColumnDto[] = [ { id: '1', - enCode: 'name', + enCode: 'changeFlag', name: '鎵规敼绫诲瀷', }, { @@ -133,32 +137,32 @@ }, { id: '3', - enCode: 'name', + enCode: 'idNumber', name: '韬唤璇佸彿', }, { id: '4', - enCode: 'idNumber', + enCode: 'workType', name: '闆囧憳宸ョ', }, { id: '5', - enCode: 'idNumber', + enCode: 'gender', name: '鎬у埆', }, { id: '6', - enCode: 'idNumber', + enCode: 'age', name: '骞撮緞', }, { id: '7', - enCode: 'idNumber', + enCode: 'birthDay', name: '鍑虹敓鏃ユ湡', }, { id: '8', - enCode: 'idNumber', + enCode: 'phoneNumber', name: '鎵嬫満鍙风爜', }, ]; @@ -166,48 +170,36 @@ const route = useRoute(); const { closeViewPush } = useRouteView(); const id = route.params.id as string; +const insurerName = route.query.insurerName as string; +const insureBillNo = route.query.insureBillNo as string; const BaseState = { loading: true, form: { time: '', - url: [] as UploadUserFile[], + addOrReduceUrl: [] as UploadUserFile[], + replaceUrl: [] as UploadUserFile[], }, + staffList: [] as any[], }; 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: {}, - } -); +const urlDisabled = computed(() => { + return state.form.addOrReduceUrl.length > 0 || state.form.replaceUrl.length > 0; +}); + +const { getDataSource: getList, proTableProps } = useTable(({ pageIndex, pageSize }) => { + try { + return Promise.resolve({ + pageModel: { + rows: pageSize, + page: pageIndex, + totalCount: state.staffList.length, + }, + data: paginateList(state.staffList, pageIndex, pageSize), + }); + } catch (error) {} +}); async function handleUploadAddOrReduce(response: UploadUserFile) { try { @@ -215,7 +207,25 @@ url: response.path, insurePolicyId: id, }; - let res = await insureBatchBillServices.importBatchAddOrSubOrderData(params); + let checkRes = await insureBatchBillServices.importCheckBatchAddOrSubOrderData(params, { + getResponse: true, + responseType: 'blob', + }); + if (checkRes?.data?.size) { + Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵') + .then(() => { + downloadFile(checkRes.data, `閿欒浜哄憳鍚嶅崟`, 'xlsx'); + }) + .catch(() => { + // getList(paginationState.pageIndex); + }); + } else { + let res = await insureBatchBillServices.importBatchAddOrSubOrderData(params); + if (res?.addOrSub?.length) { + state.staffList = res.addOrSub; + getList(); + } + } } catch (error) {} } async function handleUploadReplace(response: UploadUserFile) { @@ -224,11 +234,36 @@ url: response.path, insurePolicyId: id, }; - let res = await insureBatchBillServices.importBatchUpdateOrderData(params); + let checkRes = await insureBatchBillServices.importCheckBatchUpdateOrderData(params, { + getResponse: true, + responseType: 'blob', + }); + if (checkRes?.data?.size) { + Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵') + .then(() => { + downloadFile(checkRes.data, `閿欒浜哄憳鍚嶅崟`, 'xlsx'); + }) + .catch(() => { + // getList(paginationState.pageIndex); + }); + } else { + let res = await insureBatchBillServices.importBatchUpdateOrderData(params); + if (res?.update?.length) { + state.staffList = res.update; + getList(); + } + } } catch (error) {} } -function handleClear() {} +function handleClear() { + if (!state.staffList.length) { + Message.errorMessage('娌℃湁鏁版嵁鍙互娓呴櫎鍝�'); + return; + } + state.staffList = [] as any[]; + getList(); +} const formRef = ref<FormInstance>(); function handleSubmit() { @@ -244,7 +279,17 @@ async function addOrUpdateInsureBatchBill() { try { - let params = {}; + if (state.staffList.length === 0) { + Message.errorMessage('璇峰厛涓婁紶浜哄憳鍚嶅崟'); + return; + } + 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('鍒犻櫎')), + }; let res = await insureBatchBillServices.addOrUpdateInsureBatchBill(params); if (res) { Message.successMessage('鎻愪氦鎴愬姛'); @@ -266,8 +311,10 @@ }); } +const queryClient = useQueryClient(); + onMounted(async () => { - await getBatchRefundInfoDetail(); + await getList(); state.loading = false; }); </script> diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue index fe04a60..29afe92 100644 --- a/src/views/Home/Home.vue +++ b/src/views/Home/Home.vue @@ -408,6 +408,10 @@ params: { id: row.id, }, + query: { + insurerName: row.insurerName ?? '', + insureBillNo: row.insureBillNo ?? '', + }, }); } </script> diff --git a/src/views/Home/components/BatchChangeRecordDetailDialog.vue b/src/views/Home/components/BatchChangeRecordDetailDialog.vue index 486371e..146a5fc 100644 --- a/src/views/Home/components/BatchChangeRecordDetailDialog.vue +++ b/src/views/Home/components/BatchChangeRecordDetailDialog.vue @@ -6,6 +6,7 @@ :columns="column" :show-operation-column="false" > + <template #changeType="{ row }"> {{ BatchChangeTypeEnumText[row.changeType] }}</template> </ProTableV2> </ProDialogTableWrapper> </ProDialog> @@ -13,8 +14,9 @@ <script setup lang="ts"> import { ProDialog, ProTableV2, ProDialogTableWrapper, useTable } from '@bole-core/components'; -import * as insuranceOrderServices from '@/services/api/InsuranceOrder'; import { OrderInputType } from '@bole-core/core'; +import { paginateList } from '@/utils'; +import { BatchChangeTypeEnumText } from '@/constants'; defineOptions({ name: 'BatchChangeRecordDetailDialog', @@ -24,6 +26,7 @@ modelValue: boolean; form?: { id: string; + staffList: API.InsureBatchBillDetailDto[]; }; }; @@ -39,57 +42,48 @@ const column: API.CustomModuleColumnDto[] = [ { id: '1', - enCode: 'name', + enCode: 'changeType', name: '鎵规敼绫诲瀷', - width: 120, }, { id: '2', enCode: 'name', name: '濮撳悕', - width: 120, }, { id: '3', - enCode: 'name', + enCode: 'idNumber', name: '韬唤璇佸彿', - width: 120, }, { id: '4', - enCode: 'name', + enCode: 'workType', name: '闆囧憳宸ョ', - width: 120, }, { id: '5', - enCode: 'name', + enCode: 'gender', name: '鎬у埆', - width: 120, }, { id: '6', - enCode: 'name', + enCode: 'age', name: '骞撮緞', - width: 120, }, { id: '7', - enCode: 'name', + enCode: 'birthDay', name: '鍑虹敓鏃ユ湡', - width: 120, }, { id: '8', - enCode: 'name', + enCode: 'phoneNumber', name: '鐢佃瘽鍙风爜', - width: 120, }, { id: '9', - enCode: 'name', + enCode: 'modifyInfo', name: '淇敼鍐呭', - width: 120, }, ]; @@ -106,7 +100,7 @@ () => props.modelValue, (val) => { if (val) { - getBatchRefundInfoDetail(); + getList(); } }, { @@ -115,7 +109,7 @@ ); const { - getDataSource: getBatchRefundInfoDetail, + getDataSource: getList, proTableProps, paginationState, extraParamState, @@ -123,17 +117,14 @@ } = useTable( async ({ pageIndex, pageSize }, extraParamState) => { try { - let params: API.QueryInsuranceOrderPageInput = { + return Promise.resolve({ pageModel: { rows: pageSize, page: pageIndex, - orderInput: extraParamState.orderInput, + totalCount: props.form.staffList.length, }, - condition: extraParamState.keyWord, - // insurePolicyOperateHistoryId: id, - }; - let res = await insuranceOrderServices.getInsuranceOrderPage(params); - return res; + data: paginateList(props.form.staffList, pageIndex, pageSize), + }); } catch (error) {} }, { @@ -141,7 +132,6 @@ keyWord: '', orderInput: [{ property: 'id', order: OrderInputType.Asc }], }, - columnsRenderProps: {}, } ); </script> diff --git a/src/views/Home/components/BatchChangeRecordView.vue b/src/views/Home/components/BatchChangeRecordView.vue index 1b37424..28f8619 100644 --- a/src/views/Home/components/BatchChangeRecordView.vue +++ b/src/views/Home/components/BatchChangeRecordView.vue @@ -10,6 +10,23 @@ maxHeight: '400px', }" > + <template #checkStatus="{ row }"> + <el-tooltip + class="box-item" + effect="dark" + :content="row.auditNote" + placement="top-start" + v-if="row.checkStatus === BatchBillCheckStatus.CheckTurnDown" + > + <div style="display: inline-flex; align-items: center"> + {{ BatchBillCheckStatusText[row.checkStatus] }} + <el-icon size="16" color="#3a71ff"><QuestionFilled /></el-icon> + </div> + </el-tooltip> + <el-text v-else> + {{ BatchBillCheckStatusText[row.checkStatus] }} + </el-text> + </template> </ProTableV2> <BatchChangeRecordDetailDialog v-bind="dialogProps"></BatchChangeRecordDetailDialog> </AppContainer> @@ -25,8 +42,14 @@ useFormDialog, } from '@bole-core/components'; import * as insureBatchBillServices from '@/services/api/InsureBatchBill'; -import { OrderInputType } from '@bole-core/core'; +import { downloadFileByUrl, OrderInputType } from '@bole-core/core'; import BatchChangeRecordDetailDialog from './BatchChangeRecordDetailDialog.vue'; +import { + BatchBillCheckStatus, + BatchBillCheckStatusText, + BatchChangeTypeEnumText, +} from '@/constants'; +import { setOSSLink } from '@/utils'; defineOptions({ name: 'BatchChangeRecordView', @@ -35,47 +58,47 @@ const column: API.CustomModuleColumnDto[] = [ { id: '1', - enCode: 'name', + enCode: 'batchBillNo', name: '鎵瑰崟鍙�', }, { id: '2', - enCode: 'name', + enCode: 'changeType', name: '鎵规敼绫诲瀷', }, { id: '3', - enCode: 'name', + enCode: 'creationTime', name: '鐢宠鏃ユ湡', }, { id: '4', - enCode: 'idNumber', + enCode: 'effectTime', name: '鎵规敼鐢熸晥鏃ユ湡', }, { id: '5', - enCode: 'idNumber', + enCode: 'insurePersonNumber', name: '鍦ㄤ繚浜烘暟', }, { id: '6', - enCode: 'idNumber', + enCode: 'orginInsurePersonNumber', name: '鍘熷湪淇濅汉鏁�', }, { id: '7', - enCode: 'idNumber', + enCode: 'addPersonNumber', name: '鏂板', }, { id: '8', - enCode: 'idNumber', + enCode: 'subPersonNumber', name: '鍑忓皯', }, { id: '9', - enCode: 'idNumber', + enCode: 'checkStatus', name: '鎵瑰崟鐘舵��', }, ]; @@ -89,9 +112,9 @@ emits: { onClick: (role) => handleDetail(role), }, - // extraProps: { - // hide: (row: API.InsureBatchBillDto) => !row.orderBillFile, - // }, + extraProps: { + hide: (row: API.InsureBatchBillDto) => row.checkStatus !== BatchBillCheckStatus.InValidate, + }, }, { data: { @@ -101,9 +124,9 @@ emits: { onClick: (role) => handleDownload(role), }, - // extraProps: { - // hide: (row: API.InsureBatchBillDto) => !row.orderBillFile, - // }, + extraProps: { + hide: (row: API.InsureBatchBillDto) => row.checkStatus !== BatchBillCheckStatus.InValidate, + }, }, ]); @@ -141,25 +164,51 @@ { defaultExtraParams: { keyWord: '', - orderInput: [{ property: 'id', order: OrderInputType.Asc }], + orderInput: [{ property: 'insureBatchBillId', order: OrderInputType.Asc }], }, - columnsRenderProps: {}, + columnsRenderProps: { + creationTime: { + type: 'date', + format: 'YYYY-MM-DD', + }, + effectTime: { + type: 'date', + format: 'YYYY-MM-DD', + }, + changeType: { + type: 'enum', + valueEnum: BatchChangeTypeEnumText, + }, + }, } ); + +async function getInsureBatchDetail(id: string) { + try { + return await insureBatchBillServices.getInsureBatchDetail({ batchBillId: id }); + } catch (error) {} +} const { dialogProps, handleEdit } = useFormDialog({ defaultFormParams: { id: '', + staffList: [] as API.InsureBatchBillDetailDto[], }, }); -function handleDetail(row: API.InsureBatchBillDto) { - handleEdit({ - id: row.insureBatchBillId, - }); +async function handleDetail(row: API.InsureBatchBillDto) { + try { + const res = await getInsureBatchDetail(row.insureBatchBillId); + handleEdit({ + id: row.insureBatchBillId, + staffList: res.staffList, + }); + } catch (error) {} } -function handleDownload(row: API.InsureBatchBillDto) {} +function handleDownload(row: API.InsureBatchBillDto) { + downloadFileByUrl(setOSSLink(row.attachmentUrl)); +} onMounted(async () => { await getBatchRefundInfoDetail(); diff --git a/src/views/Home/components/InsureOrderInfoView.vue b/src/views/Home/components/InsureOrderInfoView.vue index 18afc27..0da1dc1 100644 --- a/src/views/Home/components/InsureOrderInfoView.vue +++ b/src/views/Home/components/InsureOrderInfoView.vue @@ -35,12 +35,14 @@ <ProFormCol> <ProFormColItem :span="8"> <ProFormItemV2 label="鍙備繚鏈烘瀯:" prop="insuranceOrg"> - <ProFormRadio v-model="detail.insuranceOrg" :value-enum="InsuredInstitutionEnum" /> + <!-- <ProFormRadio v-model="detail.insuranceOrg" :value-enum="InsuredInstitutionEnum" /> --> + <ProFormText v-model.trim="detail.insuranceOrg" /> </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="8"> <ProFormItemV2 label="鎶曚繚鏂规:" prop="insuranceScheme"> - <ProFormRadio v-model="detail.insuranceScheme" :value-enum="InsuranceSchemeEnum" /> + <!-- <ProFormRadio v-model="detail.insuranceScheme" :value-enum="InsuranceSchemeEnum" /> --> + <ProFormText v-model.trim="detail.insuranceScheme" /> </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="8"> @@ -337,10 +339,17 @@ } async function handleUploadSuccess(response: UploadUserFile) { try { - // let res = await insuranceOrderServices.importInsuranceOrderData(response.url, { - // getResponse: true, - // responseType: 'blob', - // }); + let res = await insuranceOrderServices.importInsDetailStaffToList( + { + id: id, + url: response.url, + }, + { + getResponse: true, + responseType: 'blob', + } + ); + console.log('res: ', res); // if (res?.data?.size) { // await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵'); // downloadFile(res.data, `閿欒浜哄憳鍚嶅崟`, 'xlsx'); @@ -380,6 +389,10 @@ params: { id: id, }, + query: { + insurerName: detail.value?.insurerName ?? '', + insureBillNo: detail.value?.insureBillNo ?? '', + }, }); } diff --git a/src/views/InsuranceClaim/components/InsuranceClaimView.vue b/src/views/InsuranceClaim/components/InsuranceClaimView.vue index d3ff58f..6d84651 100644 --- a/src/views/InsuranceClaim/components/InsuranceClaimView.vue +++ b/src/views/InsuranceClaim/components/InsuranceClaimView.vue @@ -64,10 +64,14 @@ <ProFormColItem :span="6"> <ProFormItemV2 label="淇濆崟鍙�:" - prop="name" + prop="orderNo" :check-rules="[{ message: '璇疯緭鍏ヤ繚鍗曞彿' }]" > - <ProFormText v-model.trim="form.name" placeholder="璇疯緭鍏ヤ繚鍗曞彿" :maxlength="30" /> + <ProFormText + v-model.trim="form.orderNo" + placeholder="璇疯緭鍏ヤ繚鍗曞彿" + :maxlength="30" + /> </ProFormItemV2> </ProFormColItem> </ProFormCol> @@ -79,29 +83,39 @@ <ProFormColItem :span="6"> <ProFormItemV2 label="鍙備繚鏈烘瀯:" - prop="insuredInstitution" - :check-rules="[{ message: '璇烽�夋嫨鍙備繚鏈烘瀯' }]" + prop="insuranceOrg" + :check-rules="[{ message: '璇疯緭鍏ュ弬淇濇満鏋�' }]" > - <ProFormSelect + <!-- <ProFormSelect placeholder="璇烽�夋嫨鍙備繚鏈烘瀯" :value-enum="InsuredInstitutionEnum" clearable v-model="form.insuredInstitution" - ></ProFormSelect> + ></ProFormSelect> --> + <ProFormText + v-model.trim="form.insuranceOrg" + :maxlength="30" + placeholder="璇疯緭鍏ュ弬淇濇満鏋�" + /> </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="6"> <ProFormItemV2 label="鎶曚繚鏂规:" prop="insuranceScheme" - :check-rules="[{ message: '璇烽�夋嫨鎶曚繚鏂规' }]" + :check-rules="[{ message: '璇疯緭鍏ユ姇淇濇柟妗�' }]" > - <ProFormSelect + <!-- <ProFormSelect placeholder="璇烽�夋嫨鎶曚繚鏂规" :value-enum="InsuranceSchemeEnum" clearable v-model="form.insuranceScheme" - ></ProFormSelect> + ></ProFormSelect> --> + <ProFormText + v-model.trim="form.insuranceScheme" + :maxlength="30" + placeholder="璇疯緭鍏ユ姇淇濇柟妗�" + /> </ProFormItemV2> </ProFormColItem> </ProFormCol> @@ -118,11 +132,8 @@ </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="6"> - <ProFormItemV2 label="鎶曚繚浜�:" prop="laborContractEnterprise" mode="read"> - <ProFormText - v-model.trim="form.laborContractEnterprise" - placeholder="璇疯緭鍏ユ姇淇濅汉" - /> + <ProFormItemV2 label="鎶曚繚浜�:" prop="enterpriseName" mode="read"> + <ProFormText v-model.trim="form.enterpriseName" placeholder="璇疯緭鍏ユ姇淇濅汉" /> </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="6"> @@ -145,8 +156,8 @@ </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="6"> - <ProFormItemV2 label="琚繚浜�:" prop="workEnterprise" mode="read"> - <ProFormText v-model.trim="form.workEnterprise" placeholder="璇疯緭鍏ヨ淇濅汉" /> + <ProFormItemV2 label="琚繚浜�:" prop="enterpriseName" mode="read"> + <ProFormText v-model.trim="form.enterpriseName" placeholder="璇疯緭鍏ヨ淇濅汉" /> </ProFormItemV2> </ProFormColItem> </ProFormCol> @@ -510,11 +521,11 @@ name: form.name, idNumber: form.idNumber, workType: form.workType, - laborContractEnterprise: form.laborContractEnterprise, - workEnterprise: form.workEnterprise, + laborContractEnterprise: form.enterpriseName, + workEnterprise: form.enterpriseName, insuranceBeginTime: format(form.insuranceBeginTime), insuranceEndTime: format(form.insuranceEndTime), - insuredInstitution: form.insuredInstitution, + insuredInstitution: form.insuranceOrg, insuranceScheme: form.insuranceScheme, onJobFlag: form.onJobFlag, gender: form.gender, diff --git a/src/views/InsuranceClaim/hooks/index.ts b/src/views/InsuranceClaim/hooks/index.ts index db7dfc7..2bd62b9 100644 --- a/src/views/InsuranceClaim/hooks/index.ts +++ b/src/views/InsuranceClaim/hooks/index.ts @@ -20,11 +20,13 @@ name: '', idNumber: '', workType: '', + orderNo: '', laborContractEnterprise: '', workEnterprise: '', + enterpriseName: '', insuranceBeginTime: '', insuranceEndTime: '', - insuredInstitution: '', + insuranceOrg: '', insuranceScheme: '', contactNumber: '', bakContactNumber: '', @@ -174,15 +176,17 @@ form.idNumber = data.idNumber; form.insuranceBeginTime = data.insuranceBeginTime; form.insuranceEndTime = data.insuranceEndTime; - form.insuredInstitution = data.insuredInstitution; + form.insuranceOrg = data.insuranceOrg; form.insuranceScheme = data.insuranceScheme; form.laborContractEnterprise = data.laborContractEnterprise; + form.enterpriseName = data.enterpriseName; 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.orderNo = data.orderNo; form.premiumAmount = data.premiumAmount; form.incDecAmount = data.incDecAmount; } -- Gitblit v1.9.1