From b2b1ba0ec2e5c45cf4f37b0fcea6e23fe36f9b47 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期四, 20 三月 2025 11:24:40 +0800 Subject: [PATCH] feat: init --- src/views/Home/Home.vue | 102 ++++++++++++-------------------------------------- 1 files changed, 25 insertions(+), 77 deletions(-) diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue index 9454328..3111cb1 100644 --- a/src/views/Home/Home.vue +++ b/src/views/Home/Home.vue @@ -24,7 +24,7 @@ @change="getList()" /> </QueryFilterItem> - <QueryFilterItem v-if="isJYB"> + <QueryFilterItem> <FieldRadio v-model="extraParamState.insuranceType" :value-enum="insuranceTypeText" @@ -37,7 +37,7 @@ <SearchInput v-model="extraParamState.keyword" style="width: 260px" - :placeholder="keywordText" + placeholder="濮撳悕/韬唤璇�/鍗曚綅/淇濆崟鍙风瓑" @on-click-search="getList" > </SearchInput> @@ -66,7 +66,6 @@ </BlFileUpload> <el-button - v-if="isJYB" @click="handleEnterpriseBatchRefund()" type="primary" style="margin-right: 10px" @@ -85,7 +84,7 @@ v-bind="proTableProps" :columns="HomeColumns" :operationBtns="operationBtns" - :show-column-check="isJYB" + :show-column-check="true" :column-selectable="columnSelectable" ref="proTable" :table-props="{ @@ -130,12 +129,10 @@ import { ModelValueType } from 'element-plus'; import { useQueryClient } from '@tanstack/vue-query'; import { - AppType, InsuranceOrderTempPath, JYBInsuranceOrderTempPath, OnJobFlagEnumText, insuranceTypeText, - isJYB, } from '@/constants'; import dayjs from 'dayjs'; import _ from 'lodash'; @@ -145,25 +142,7 @@ }); const operationBtns = defineOperationBtns([ - // { - // data: { - // enCode: 'checkBtn', - // name: '鐞嗚禂', - // }, - // emits: { - // onClick: (role) => goDetail(role), - // }, - // }, - AppType === 'rz' && { - data: { - enCode: 'uploadBtn', - name: '涓婁紶鏉愭枡', - }, - emits: { - onClick: (role) => openDialog(role), - }, - }, - isJYB && { + { data: { enCode: 'downloadBtn', name: '淇濆崟涓嬭浇', @@ -176,13 +155,6 @@ }, }, ]).filter(Boolean); - -const keywordText = computed(() => { - if (isJYB) { - return '濮撳悕/韬唤璇�/鍗曚綅/淇濆崟鍙风瓑'; - } - return '濮撳悕/韬唤璇�/鍚堝悓鍗曚綅绛�'; -}); const columnSelectable = (row: API.InsuranceOrderListOutput) => { return row.onJobFlag === '澧炲憳'; @@ -237,7 +209,7 @@ format: 'YYYY/MM/DD', }, }, - showSummary: AppType === 'rz' || isJYB, + showSummary: true, summaryPropertys: [ { property: 'table-operation', @@ -268,44 +240,25 @@ async function handleUploadSuccess(response: UploadUserFile) { try { - if (AppType === 'one') { - let res = await insuranceOrderServices.checkImportInsuranceOrderData(response.url); - if (res) { - let checkRes = await insuranceOrderServices.importInsuranceOrderData(response.url, { - getResponse: true, - responseType: 'blob', - }); - if (checkRes?.data?.size) { - Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵') - .then(() => { - downloadFile(checkRes.data, `閿欒浜哄憳鍚嶅崟`, 'xlsx'); - }) - .catch(() => { - getList(paginationState.pageIndex); - }); - } - } - } else { - let res = await insuranceOrderServices.importInsuranceOrderData(response.url, { - getResponse: true, - responseType: 'blob', - }); - if (res?.data?.size) { - await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵'); - downloadFile(res.data, `閿欒浜哄憳鍚嶅崟`, 'xlsx'); - // XLSXUtils.exportToXLSX({ - // workbookDataList: res, - // fileName: '閿欒浜哄憳鍚嶅崟', - // workbookHeaderMap: { - // ...omit(Object.fromEntries(HomeColumns.map((x) => [x.enCode, x.name])), [ - // 'channel', - // 'salesmanName', - // 'createTime', - // ]), - // erroMsg: '澶囨敞', - // }, - // }); - } + let res = await insuranceOrderServices.importInsuranceOrderData(response.url, { + getResponse: true, + responseType: 'blob', + }); + if (res?.data?.size) { + await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵'); + downloadFile(res.data, `閿欒浜哄憳鍚嶅崟`, 'xlsx'); + // XLSXUtils.exportToXLSX({ + // workbookDataList: res, + // fileName: '閿欒浜哄憳鍚嶅崟', + // workbookHeaderMap: { + // ...omit(Object.fromEntries(HomeColumns.map((x) => [x.enCode, x.name])), [ + // 'channel', + // 'salesmanName', + // 'createTime', + // ]), + // erroMsg: '澶囨敞', + // }, + // }); } queryClient.invalidateQueries({ queryKey: ['insuranceOrderServices/getInsuranceOrderListByOrderRelevance'], @@ -356,16 +309,11 @@ } function handleDownload() { - if (isJYB) { - downloadFileByUrl(JYBInsuranceOrderTempPath, '淇濆崟瀵煎叆妯℃澘'); - } else { - downloadFileByUrl(InsuranceOrderTempPath, '淇濆崟瀵煎叆妯℃澘'); - } + downloadFileByUrl(JYBInsuranceOrderTempPath, '淇濆崟瀵煎叆妯℃澘'); } function handleRowStyle(data: { row: API.InsuranceOrderListOutput; rowIndex: number }) { if ( - isJYB && dayjs(dayjs(data.row?.insuranceEndTime).format('YYYY-MM-DD')).diff(dayjs(), 'day') >= 0 && dayjs(dayjs(data.row?.insuranceEndTime).format('YYYY-MM-DD')).diff(dayjs(), 'day') < 6 ) { -- Gitblit v1.9.1