diff --git a/src/views/product/bank/CardList.vue b/src/views/product/bank/CardList.vue index ecc76fa..ff88e1d 100644 --- a/src/views/product/bank/CardList.vue +++ b/src/views/product/bank/CardList.vue @@ -21,7 +21,7 @@
  • + @click="switchProduct(item)"> @@ -94,7 +94,7 @@ const getList = async (refresh?: number) => { keyWord: name, }); list.value = data.message.records; - ((route.path !== '/product/bank/add' && list.value.length && !id.value) || refresh) && switchProduct(refresh ? '/product/bank/detail' : route.path, list.value[0].id); + ((route.path !== '/product/bank/add' && list.value.length && !id.value) || refresh) && switchProduct(list.value[0], refresh); } finally { loading.value = false; } @@ -105,16 +105,18 @@ onMounted(() => { watch( route, - (route: any) => { - action.value = route.params.action; + (val) => { + action.value = val.params.action; }, { immediate: true, }, ); // 产品切换 -const switchProduct = (path: string, bankId?: number) => { - router.push(`${path}?type=${route.query.type || ''}&i=${route.query.i}&role=${route.query.role}&id=${bankId}&name=${name}`); +const switchProduct = (row: any, refresh?: number) => { + // 产品经理配置要素:add;风控经理:config;专家委员会:approve。这3个权限都没有的话,跳详情 + const path = `/product/bank/${refresh ? 'detail' : row.showElementsOrNot ? 'add' : row.showRiskControlOrNot ? 'config' : row.showApprovalOrNot ? 'approve' : 'detail'}`; + router.push(`${path}?type=${route.query.type || ''}&i=${route.query.i}&role=${route.query.role}&id=${row.id}&name=${name}`); }; // 新增 const toAdd = () => { @@ -124,8 +126,8 @@ const toAdd = () => { const toList = () => { router.push(`/product/bank?type=${route.query.type || ''}&i=${route.query.i}&role=${route.query.role}`); }; -const handleDelete = async (id: number) => { - await batchDeletion([id]); +const handleDelete = async (bankId: number) => { + await batchDeletion([bankId]); getList(); ElMessage.success('删除成功!'); }; diff --git a/src/views/product/bank/Config.vue b/src/views/product/bank/Config.vue index 77ffb9f..a4b5739 100644 --- a/src/views/product/bank/Config.vue +++ b/src/views/product/bank/Config.vue @@ -4,7 +4,6 @@ @tab-click="tabChange"> - { - let val = ''; + let val = ''; if (params.roleId == 42 && productTypes.value.length === 1) { val = productTypes.value[0]; } else if (params.roleId == 41) { @@ -222,7 +222,14 @@ const toDetail = async (path: string, id: number) => { }; // 卡片模式 const toCardList = () => { - router.push(`/product/bank/detail?type=${params.productType}&i=${route.query.i}&role=${route.query.role}&name=${params.keyWord}`); + // 列表没有产品:跳转到add + let path = `/product/bank/add`; + if (list.value.length) { + // 如果有产品,则获取第一个产品的以下权限: 产品经理配置要素:add;风控经理:config;专家委员会:approve。这3个权限都没有的话,跳详情 + const row = list.value[0]; + path = `/product/bank/${row.showElementsOrNot ? 'add' : row.showRiskControlOrNot ? 'config' : row.showApprovalOrNot ? 'approve' : 'detail'}`; + } + router.push(`${path}?type=${params.productType}&i=${route.query.i}&role=${route.query.role}&name=${params.keyWord}`); }; const handleDelete = async (id: number) => { diff --git a/src/views/product/fund/CardList.vue b/src/views/product/fund/CardList.vue index 18387c5..b42d356 100644 --- a/src/views/product/fund/CardList.vue +++ b/src/views/product/fund/CardList.vue @@ -58,6 +58,7 @@ import Cookies from 'js-cookie'; const router = useRouter(); const route = useRoute(); const action = ref(''); +const name = route.query.name ?? ''; const projectId = +Cookies.get('sand-projectId'); const levelId = +Cookies.get('sand-level'); @@ -65,12 +66,12 @@ const list = ref>([]); const loading = ref(false); const id = computed(() => +route.query.id); // 列表 -const getList = async (first: any) => { +const getList = async (refresh?: number) => { loading.value = true; try { - const { data } = await fundProductList({ pageNum: 1, pageSize: 1000, checkPointId: levelId, projectId }); + const { data } = await fundProductList({ pageNum: 1, pageSize: 1000, checkPointId: levelId, projectId, fundName: name }); list.value = data.data.records; - first && list.value.length && switchProduct(list.value[0].id); + refresh && list.value.length && switchProduct(list.value[0].id); } finally { loading.value = false; } @@ -81,16 +82,16 @@ onMounted(() => { watch( route, - (route: any) => { - action.value = route.params.action; + (val) => { + action.value = val.params.action; }, { immediate: true, }, ); // 产品切换 -const switchProduct = (id: number) => { - router.push(`/product/fund/detail?id=` + id); +const switchProduct = (fundId: number) => { + router.push(`/product/fund/detail?id=` + fundId); }; // 新增 const toAdd = () => { @@ -100,8 +101,8 @@ const toAdd = () => { const toList = () => { router.push(`/product/fund`); }; -const handleDelete = async (id: number) => { - await batchDeletion([id]); +const handleDelete = async (fundId: number) => { + await batchDeletion([fundId]); getList(1); ElMessage.success('删除成功!'); }; diff --git a/src/views/product/fund/List.vue b/src/views/product/fund/List.vue index bd6946c..0336c3d 100644 --- a/src/views/product/fund/List.vue +++ b/src/views/product/fund/List.vue @@ -135,16 +135,11 @@ const toAdd = () => { }; // 产品详情 const toDetail = async (path: string, id: number) => { - router.push({ - path, - query: { - id, - }, - }); + router.push(`${path}?id=${id}&name=${params.fundName}`); }; // 卡片模式 const toCardList = () => { - router.push('/product/fund/detail'); + router.push(`/product/fund/${list.value.length ? `detail?id=${list.value[0].id}&name=${params.fundName}` : `add?name=${params.fundName}`}`); }; const handleDelete = async (id: number) => { diff --git a/src/views/product/insurance/List.vue b/src/views/product/insurance/List.vue index ec7bfd0..5a79df6 100644 --- a/src/views/product/insurance/List.vue +++ b/src/views/product/insurance/List.vue @@ -176,7 +176,7 @@ const toDetail = async (path: string, id: number) => { }; // 卡片模式 const toCardList = () => { - router.push(`/product/insurance/detail?name=${params.insuranceName}`); + router.push(`/product/insurance/${list.value.length ? `detail?id=${list.value[0].insuranceId}&name=${params.insuranceName}` : `add?name=${params.insuranceName}`}`); }; const handleDelete = async (id: number) => { diff --git a/src/views/product/strategy/156.vue b/src/views/product/strategy/156.vue index 3e63f1e..d71dc66 100644 --- a/src/views/product/strategy/156.vue +++ b/src/views/product/strategy/156.vue @@ -48,6 +48,14 @@ +