diff --git a/.env b/.env index 104e2c6..79153fd 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ VITE_APP_TITLE=金融产品设计及数字化营销沙盘 VITE_PORT=9520 # VITE_PROXY=http://192.168.31.125:8080 VITE_PUBLIC_PATH=./ -VITE_BASE_API=http://192.168.31.217:9000 +VITE_BASE_API=http://192.168.31.51:9000 # VITE_BASE_API=http://121.37.12.51 # VITE_BASE_API=https://www.occupationlab.com VITE_I18N_LOCALE=zh-cn diff --git a/src/api/model.ts b/src/api/model.ts index 79a2a50..3d8300d 100644 --- a/src/api/model.ts +++ b/src/api/model.ts @@ -209,5 +209,5 @@ export const collectionAfterLoanDetails = async (params: Record): P export const collectionAfterLoanSave = async (data: Record): Promise => (await axios.post(`/product/collectionAfterLoan/saveOrUpdate`, data)).data; export const collectionAfterLoanDel = async (data: Record): Promise => (await axios.post(`/product/collectionAfterLoan/delete`, data)).data; -export const isTheStrategyRelatedToTheProduct = async (params: Record): Promise => - (await axios.post(`${host}/product/managerOfRiskControl/bankRiskControlAllocation/isTheStrategyRelatedToTheProduct`, {}, { params })).data; +export const isTheStrategyRelatedToTheProduct = async (data: Record): Promise => + (await axios.post(`/product/managerOfRiskControl/bankRiskControlAllocation/isTheStrategyRelatedToTheProduct`, data)).data; diff --git a/src/components/Panel/index.vue b/src/components/Panel/index.vue index c0c7a43..0eae03c 100644 --- a/src/components/Panel/index.vue +++ b/src/components/Panel/index.vue @@ -237,7 +237,7 @@ import 'mavon-editor/dist/css/index.css'; import '@vueup/vue-quill/dist/vue-quill.snow.css'; import { useDraggable } from '@vueuse/core'; import { logout } from '@/store/useCurrentUser'; -import { getIds, getNow } from '@/utils/common'; +import { getNow } from '@/utils/common'; const router = useRouter(); const route = useRoute(); @@ -818,7 +818,6 @@ onUnmounted(() => { clearInterval(counterTimer.value); clearInterval(heartBeatTimer.value); console.log('onUnmounted'); - // next(); }); diff --git a/src/layout/components/AppSidebar/Menu.vue b/src/layout/components/AppSidebar/Menu.vue index 23d7cff..7c559bf 100644 --- a/src/layout/components/AppSidebar/Menu.vue +++ b/src/layout/components/AppSidebar/Menu.vue @@ -147,7 +147,7 @@ const toPage = (path: string) => { router.push(path); }; // 获取产品数量 -const getNum = async (status?: number, type?: number) => { +const getStat = async (status?: number, type?: number) => { const { data } = await statistics({ checkpointId: levelId, projectId, @@ -161,11 +161,12 @@ const getNum = async (status?: number, type?: number) => { num1.value = data || ''; } }; + onMounted(() => { const status = role.value === '41' ? 299 : role.value === '42' ? 295 : role.value === '43' ? 296 : ''; // (1-配置风控 2-待审批,3-审批通过,4-审批不通过,5-审批打回 if (status) { - getNum(status, role.value === '41' ? 0 : ''); - role.value === '41' && getNum(status, 1); + getStat(status, role.value === '41' ? 0 : ''); + role.value === '41' && getStat(status, 1); } }); diff --git a/src/layout/index.vue b/src/layout/index.vue index e1b144b..a2a26e3 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -20,10 +20,10 @@ import { defineComponent, computed } from 'vue'; import { useRoute } from 'vue-router'; import Settings from '@/settings'; -import { AppSidebar, AppHeader, AppMain } from './components'; -import useResizeHandler from './composables/useResizeHandler'; import Panel from '@/components/Panel/index.vue'; import Back from '@/components/Back.vue'; +import { AppSidebar, AppHeader, AppMain } from './components'; +import useResizeHandler from './composables/useResizeHandler'; export default defineComponent({ name: 'Layout', diff --git a/src/permission.ts b/src/permission.ts index d0b1920..4fbcce3 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -2,7 +2,6 @@ import NProgress from 'nprogress'; // progress bar import 'nprogress/nprogress.css'; // progress bar style import { RouteLocationNormalized } from 'vue-router'; import getPageTitle from '@/utils/getPageTitle'; -import { getAccessToken } from '@/utils/auth'; // get token from cookie import router from './router'; NProgress.configure({ showSpinner: false }); // NProgress Configuration diff --git a/src/store/useCurrentUser.ts b/src/store/useCurrentUser.ts index 4672906..daa74e7 100644 --- a/src/store/useCurrentUser.ts +++ b/src/store/useCurrentUser.ts @@ -1,4 +1,4 @@ -import { reactive, readonly } from 'vue'; +import { reactive } from 'vue'; import { RouteRecordRaw } from 'vue-router'; import { removeAccessToken, removeParam } from '@/utils/auth'; import Cookies from 'js-cookie'; diff --git a/src/views/product/afterLoan/1029/Detail.vue b/src/views/product/afterLoan/1029/Detail.vue index d769904..6654538 100644 --- a/src/views/product/afterLoan/1029/Detail.vue +++ b/src/views/product/afterLoan/1029/Detail.vue @@ -111,7 +111,7 @@ diff --git a/src/views/product/afterLoan/1030/Detail.vue b/src/views/product/afterLoan/1030/Detail.vue index befa82d..fb3d809 100644 --- a/src/views/product/afterLoan/1030/Detail.vue +++ b/src/views/product/afterLoan/1030/Detail.vue @@ -90,7 +90,7 @@ diff --git a/src/views/product/afterLoan/1031/Detail.vue b/src/views/product/afterLoan/1031/Detail.vue index 79564bd..1ffc1c5 100644 --- a/src/views/product/afterLoan/1031/Detail.vue +++ b/src/views/product/afterLoan/1031/Detail.vue @@ -210,7 +210,7 @@ diff --git a/src/views/product/afterLoan/1032/Detail.vue b/src/views/product/afterLoan/1032/Detail.vue index 4a99c5e..3af1916 100644 --- a/src/views/product/afterLoan/1032/Detail.vue +++ b/src/views/product/afterLoan/1032/Detail.vue @@ -69,7 +69,7 @@ diff --git a/src/views/product/afterLoan/1033/Detail.vue b/src/views/product/afterLoan/1033/Detail.vue index 88688e9..60389df 100644 --- a/src/views/product/afterLoan/1033/Detail.vue +++ b/src/views/product/afterLoan/1033/Detail.vue @@ -93,7 +93,7 @@ import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue'; import { Plus } from '@element-plus/icons-vue'; import { ElMessage } from 'element-plus'; -import { collectionAfterLoanDetails, collectionAfterLoanSave } from '@/api/model'; +import { collectionAfterLoanDetails, collectionAfterLoanSave, isTheStrategyRelatedToTheProduct } from '@/api/model'; import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; import { handleId, getIds } from '@/utils/common'; import Cookies from 'js-cookie'; @@ -112,6 +112,7 @@ const info = ref[]>([]); const curRow = ref>({}); const selectDia = ref(false); const syncVisible = ref(false); +const bankIds = ref[]>([]); // 配置项 const getConfig = async () => { const { process } = await getProcessInformationBasedOnRoles(1033); @@ -184,30 +185,48 @@ const addRecord = async (data: Record) => { }; // 提交 const submit = async (synchronizeUpdate?: number) => { - let param = JSON.parse(JSON.stringify(form.value)); - param.map((e) => { - e.appCollection = +e.appCollection; - e.automaticOutboundCall = +e.automaticOutboundCall; - e.shortMessageCollection = +e.shortMessageCollection; - e.manualCollection = +e.manualCollection; - }); + try { + let param = JSON.parse(JSON.stringify(form.value)); + param.map((e) => { + e.appCollection = +e.appCollection; + e.automaticOutboundCall = +e.automaticOutboundCall; + e.shortMessageCollection = +e.shortMessageCollection; + e.manualCollection = +e.manualCollection; + }); - const recordParam = JSON.parse(JSON.stringify(param)); - param.map((e) => { - delete e.recordChildren; - }); - await collectionAfterLoanSave({ - ...getIds(), - strategyId: strategyId.value, - strategyName: strategyName.value, - synchronizeUpdate, - collectionAfterLoanList: param, - }); - addRecord(recordParam); + const recordParam = JSON.parse(JSON.stringify(param)); + param.map((e) => { + delete e.recordChildren; + }); + await collectionAfterLoanSave({ + ...getIds(), + strategyId: strategyId.value, + strategyName: strategyName.value, + synchronizeUpdate, + collectionAfterLoanList: param, + bankIds: bankIds.value, + }); + addRecord(recordParam); + } catch (e) {} }; -const confirmSubmit = () => { +const confirmSubmit = async () => { if (!strategyName.value) return ElMessage.error('请输入策略名称!'); - syncVisible.value = true; + + // 编辑需要判断是否有绑定产品 + if (strategyId.value) { + const res = await isTheStrategyRelatedToTheProduct({ + tacticsId: strategyId.value, + strategyType: 18, + }); + if (res.isRelated) { + bankIds.value = res.bankIds; + syncVisible.value = true; + } else { + submit(); + } + } else { + submit(); + } }; diff --git a/src/views/product/interestRate/772/Detail.vue b/src/views/product/interestRate/772/Detail.vue index 44c90f8..650c677 100644 --- a/src/views/product/interestRate/772/Detail.vue +++ b/src/views/product/interestRate/772/Detail.vue @@ -102,7 +102,7 @@ diff --git a/src/views/product/interestRate/935/Detail.vue b/src/views/product/interestRate/935/Detail.vue index 7047dda..c2d1c78 100644 --- a/src/views/product/interestRate/935/Detail.vue +++ b/src/views/product/interestRate/935/Detail.vue @@ -102,7 +102,7 @@ diff --git a/src/views/product/interestRate/936/Detail.vue b/src/views/product/interestRate/936/Detail.vue index d0cac21..e31f472 100644 --- a/src/views/product/interestRate/936/Detail.vue +++ b/src/views/product/interestRate/936/Detail.vue @@ -111,10 +111,9 @@ diff --git a/src/views/product/strategy/150/Detail.vue b/src/views/product/strategy/150/Detail.vue index c030fa8..ae31172 100644 --- a/src/views/product/strategy/150/Detail.vue +++ b/src/views/product/strategy/150/Detail.vue @@ -151,7 +151,7 @@ diff --git a/src/views/product/strategy/151/Detail.vue b/src/views/product/strategy/151/Detail.vue index fc15c45..2dcd736 100644 --- a/src/views/product/strategy/151/Detail.vue +++ b/src/views/product/strategy/151/Detail.vue @@ -142,7 +142,7 @@ diff --git a/src/views/product/strategy/152/Detail.vue b/src/views/product/strategy/152/Detail.vue index f554e0c..43ffe69 100644 --- a/src/views/product/strategy/152/Detail.vue +++ b/src/views/product/strategy/152/Detail.vue @@ -187,10 +187,9 @@ diff --git a/src/views/product/strategy/153/Detail.vue b/src/views/product/strategy/153/Detail.vue index 55f55e8..ad30248 100644 --- a/src/views/product/strategy/153/Detail.vue +++ b/src/views/product/strategy/153/Detail.vue @@ -158,10 +158,9 @@ diff --git a/src/views/product/strategy/154/Detail.vue b/src/views/product/strategy/154/Detail.vue index adad2f3..74d211b 100644 --- a/src/views/product/strategy/154/Detail.vue +++ b/src/views/product/strategy/154/Detail.vue @@ -302,9 +302,8 @@ diff --git a/src/views/product/strategy/155/Detail.vue b/src/views/product/strategy/155/Detail.vue index 991987d..466a010 100644 --- a/src/views/product/strategy/155/Detail.vue +++ b/src/views/product/strategy/155/Detail.vue @@ -150,7 +150,7 @@ diff --git a/src/views/product/strategy/156/Detail.vue b/src/views/product/strategy/156/Detail.vue index 1fe18e1..78428e8 100644 --- a/src/views/product/strategy/156/Detail.vue +++ b/src/views/product/strategy/156/Detail.vue @@ -91,7 +91,7 @@ diff --git a/src/views/product/strategy/512/Detail.vue b/src/views/product/strategy/512/Detail.vue index f099a0c..31cd4da 100644 --- a/src/views/product/strategy/512/Detail.vue +++ b/src/views/product/strategy/512/Detail.vue @@ -72,7 +72,7 @@ diff --git a/src/views/product/strategy/512/Index.vue b/src/views/product/strategy/512/Index.vue index f586961..c639105 100644 --- a/src/views/product/strategy/512/Index.vue +++ b/src/views/product/strategy/512/Index.vue @@ -73,7 +73,7 @@ class="px-3 py-2 justify-end"> []) => { }; // 批量删除 const delAll = async () => { - handleDelete(multipleSelection.value.map((e) => e.strategyId)); + handleDelete(multipleSelection.value.map((e) => e.id)); }; // 新增 const toAdd = () => { diff --git a/src/views/product/strategy/513/Detail.vue b/src/views/product/strategy/513/Detail.vue index 4f70508..830dc1f 100644 --- a/src/views/product/strategy/513/Detail.vue +++ b/src/views/product/strategy/513/Detail.vue @@ -15,7 +15,7 @@ diff --git a/src/views/product/strategy/513/Index.vue b/src/views/product/strategy/513/Index.vue index 0c142a7..2694f0c 100644 --- a/src/views/product/strategy/513/Index.vue +++ b/src/views/product/strategy/513/Index.vue @@ -73,7 +73,7 @@ class="px-3 py-2 justify-end"> []) => { }; // 批量删除 const delAll = async () => { - handleDelete(multipleSelection.value.map((e) => e.strategyId)); + handleDelete(multipleSelection.value.map((e) => e.id)); }; // 新增 const toAdd = () => {