From 6d8f7a338d4c8ef463da661534a9b7c29acd6cc1 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 24 Sep 2024 10:37:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=90=8E=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=88=97=E8=A1=A8=E5=92=8C=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Panel/index.vue | 2 +- src/views/product/bank/Add.vue | 58 ++++++++++++------------ src/views/product/bank/CardList.vue | 37 ++++++++------- src/views/product/bank/Config.vue | 2 +- src/views/product/bank/Info.vue | 27 ++++++----- src/views/product/bank/List.vue | 6 ++- src/views/product/fund/Add.vue | 6 ++- src/views/product/fund/CardList.vue | 28 ++++++------ src/views/product/fund/Info.vue | 8 ++-- src/views/product/fund/List.vue | 16 ++++--- src/views/product/insurance/Add.vue | 8 ++-- src/views/product/insurance/CardList.vue | 30 ++++++------ src/views/product/insurance/Info.vue | 5 +- src/views/product/insurance/List.vue | 16 ++++--- src/views/report/Index.vue | 4 +- 15 files changed, 138 insertions(+), 115 deletions(-) diff --git a/src/components/Panel/index.vue b/src/components/Panel/index.vue index 770c637..cc11121 100644 --- a/src/components/Panel/index.vue +++ b/src/components/Panel/index.vue @@ -474,7 +474,7 @@ let handleCache = () => { }; // 查看实验报告 const toReport = () => { - router.push('/report'); + router.replace('/report'); }; // 重新开始 let reload = async () => { diff --git a/src/views/product/bank/Add.vue b/src/views/product/bank/Add.vue index fd588c1..6985eca 100644 --- a/src/views/product/bank/Add.vue +++ b/src/views/product/bank/Add.vue @@ -371,37 +371,39 @@ const getConfig = async () => { }; // 详情 const getDetail = async () => { - if (!route.query.show) curTab.value = 'tab1'; - userName.value = await getUsername(); - - info.value = null; - if (id.value) { - try { - // 只返回name的详情 - const { data } = await findById(id.value); - info.value = data; - - // 只返回id的详情 - const res = await elementDetail(id.value); - if (res) { - const e = res.data.bankProducts; - e.currentWorkingLife = e.currentWorkingLife.split(',').map((n) => +n); - e.educationalRequirements = e.educationalRequirements.split(',').map((n) => +n); - e.modeRepayment = e.modeRepayment.split(',').map((n) => +n); - e.whetherToSupportEarlyRepayment = !!e.whetherToSupportEarlyRepayment; - e.bankGuaranteeTypeIds = []; - if (e.bankGuaranteeAllocationList) { - e.bankGuaranteeAllocationList.map((n) => { - n.guaranteeTypeId && e.bankGuaranteeTypeIds.push(n.guaranteeTypeId); - }); - } - for (const i in e) { - if (e.hasOwnProperty(i)) { - form[i] = e[i]; + if (!Cookies.get('sand-submit')) { + if (!route.query.show) curTab.value = 'tab1'; + userName.value = await getUsername(); + + info.value = null; + if (id.value) { + try { + // 只返回name的详情 + const { data } = await findById(id.value); + info.value = data; + + // 只返回id的详情 + const res = await elementDetail(id.value); + if (res) { + const e = res.data.bankProducts; + e.currentWorkingLife = e.currentWorkingLife.split(',').map((n) => +n); + e.educationalRequirements = e.educationalRequirements.split(',').map((n) => +n); + e.modeRepayment = e.modeRepayment.split(',').map((n) => +n); + e.whetherToSupportEarlyRepayment = !!e.whetherToSupportEarlyRepayment; + e.bankGuaranteeTypeIds = []; + if (e.bankGuaranteeAllocationList) { + e.bankGuaranteeAllocationList.map((n) => { + n.guaranteeTypeId && e.bankGuaranteeTypeIds.push(n.guaranteeTypeId); + }); + } + for (const i in e) { + if (e.hasOwnProperty(i)) { + form[i] = e[i]; + } } } + } finally { } - } finally { } } }; diff --git a/src/views/product/bank/CardList.vue b/src/views/product/bank/CardList.vue index 8e8cd15..7c0e3fc 100644 --- a/src/views/product/bank/CardList.vue +++ b/src/views/product/bank/CardList.vue @@ -46,6 +46,7 @@ import { bankingProductsList, batchDeletion } from '@/api/bank'; import { useRouter, useRoute } from 'vue-router'; import { getStatus } from '@/store/useProduct'; import { getIds } from '@/utils/common'; +import Cookies from 'js-cookie'; import Config from './Config.vue'; import Detail from './Detail.vue'; import Add from './Add.vue'; @@ -63,23 +64,25 @@ const id = computed(() => +route.query.id); const actionKey = ref(1); // 列表 const getList = async (refresh?: number) => { - loading.value = true; - try { - const { data } = await bankingProductsList({ - ...getIds(), - pageNum: 1, - pageSize: 1000, - productType: productType.value, - roleId: route.query.role, - keyWord: route.query.name ?? '', - createDateSort: route.query.createDateSort ?? '', - guarantyStyleId: route.query.guarantyStyleId ?? '', - status: route.query.status ?? '', - }); - list.value = data.message.records; - ((route.path !== '/product/bank/add' && list.value.length && !id.value) || refresh) && switchProduct(list.value[0], refresh); - } finally { - loading.value = false; + if (!Cookies.get('sand-submit')) { + loading.value = true; + try { + const { data } = await bankingProductsList({ + ...getIds(), + pageNum: 1, + pageSize: 1000, + productType: productType.value, + roleId: route.query.role, + keyWord: route.query.name ?? '', + createDateSort: route.query.createDateSort ?? '', + guarantyStyleId: route.query.guarantyStyleId ?? '', + status: route.query.status ?? '', + }); + list.value = data.message.records; + ((route.path !== '/product/bank/add' && list.value.length && !id.value) || refresh) && switchProduct(list.value[0], refresh); + } finally { + loading.value = false; + } } }; onMounted(getList); diff --git a/src/views/product/bank/Config.vue b/src/views/product/bank/Config.vue index 782cc84..2cdb849 100644 --- a/src/views/product/bank/Config.vue +++ b/src/views/product/bank/Config.vue @@ -844,7 +844,7 @@ const getConfig = async () => { }; // 详情 const getDetail = async () => { - if (id.value) { + if (id.value && !Cookies.get('sand-submit')) { try { // 查询产品要素详情 const { data } = await findById(id.value); diff --git a/src/views/product/bank/Info.vue b/src/views/product/bank/Info.vue index 186ebac..05bf4f8 100644 --- a/src/views/product/bank/Info.vue +++ b/src/views/product/bank/Info.vue @@ -155,6 +155,7 @@ import { findById, approvalRecord } from '@/api/bank'; import { useRoute } from 'vue-router'; import { getStatus } from '@/store/useProduct'; import { getUsername } from '@/utils/common'; +import Cookies from 'js-cookie'; const emit = defineEmits(['updateAudits']); const route = useRoute(); @@ -205,20 +206,22 @@ const loadComponent = async (componentName: string) => { // 详情 const getDetail = async () => { - userName.value = await getUsername(); + if (!Cookies.get('sand-submit')) { + userName.value = await getUsername(); - if (id.value) { - try { - const { data } = await findById(id.value); - info.value = data; - if (info.value.riskControlDetails) riskInfo.value = data.riskControlDetails; + if (id.value) { + try { + const { data } = await findById(id.value); + info.value = data; + if (info.value.riskControlDetails) riskInfo.value = data.riskControlDetails; - const res = await approvalRecord({ - id: id.value, - }); - approvals.value = res.list; - emit('updateAudits', res.list.length); - } catch (e) {} + const res = await approvalRecord({ + id: id.value, + }); + approvals.value = res.list; + emit('updateAudits', res.list.length); + } catch (e) {} + } } }; watch( diff --git a/src/views/product/bank/List.vue b/src/views/product/bank/List.vue index dcb632f..699c72e 100644 --- a/src/views/product/bank/List.vue +++ b/src/views/product/bank/List.vue @@ -143,8 +143,10 @@ const initList = async () => { getList(); }; onMounted(() => { - getGuarantee(); - getList(); + if (!Cookies.get('sand-submit')) { + getGuarantee(); + getList(); + } }); watch([params, () => route.query], initList); diff --git a/src/views/product/fund/Add.vue b/src/views/product/fund/Add.vue index 6cb39bf..88e6af9 100644 --- a/src/views/product/fund/Add.vue +++ b/src/views/product/fund/Add.vue @@ -207,7 +207,7 @@ diff --git a/src/views/product/fund/CardList.vue b/src/views/product/fund/CardList.vue index 67261db..db2c1b5 100644 --- a/src/views/product/fund/CardList.vue +++ b/src/views/product/fund/CardList.vue @@ -55,19 +55,21 @@ const loading = ref(false); const id = computed(() => +route.query.id); // 列表 const getList = async (refresh?: number) => { - loading.value = true; - try { - const { data } = await fundProductList({ - ...getIds(), - pageNum: 1, - pageSize: 1000, - fundName: route.query.name ?? '', - createDateSort: route.query.createDateSort ?? '', - }); - list.value = data.data.records; - refresh && list.value.length && switchProduct(list.value[0].id); - } finally { - loading.value = false; + if (!Cookies.get('sand-submit')) { + loading.value = true; + try { + const { data } = await fundProductList({ + ...getIds(), + pageNum: 1, + pageSize: 1000, + fundName: route.query.name ?? '', + createDateSort: route.query.createDateSort ?? '', + }); + list.value = data.data.records; + refresh && list.value.length && switchProduct(list.value[0].id); + } finally { + loading.value = false; + } } }; onMounted(() => { diff --git a/src/views/product/fund/Info.vue b/src/views/product/fund/Info.vue index 0cd241e..4ecbe17 100644 --- a/src/views/product/fund/Info.vue +++ b/src/views/product/fund/Info.vue @@ -50,18 +50,18 @@