yujialong 1 year ago
parent 1e3e64e19a
commit 5b4eb3ec15
  1. 1
      src/api/bank.ts
  2. 14
      src/layout/components/AppHeader.vue
  3. 4
      src/layout/components/AppSidebar/Menu.vue
  4. 2
      src/layout/index.vue
  5. 190
      src/views/product/Add.vue
  6. 97
      src/views/product/List.vue

@ -4,7 +4,6 @@ export const queryStorageList = async (params?: Record<string, any>): Promise<an
export const queryStorage = async (id: number): Promise<any> => (await axios.get(`/backend/core/storage/${id}`)).data; export const queryStorage = async (id: number): Promise<any> => (await axios.get(`/backend/core/storage/${id}`)).data;
export const updateStorage = async (data: Record<string, any>): Promise<any> => (await axios.post('/backend/core/storage?_method=put', data)).data; export const updateStorage = async (data: Record<string, any>): Promise<any> => (await axios.post('/backend/core/storage?_method=put', data)).data;
export const primaryTypeOfGuarantee = async (): Promise<any> => (await axios.post('/product/bankGuaranteeType/primaryTypeOfGuarantee')).data;
export const typeOfGuarantee = async (): Promise<any> => (await axios.post('/product/bankGuaranteeType/typeOfGuarantee')).data; export const typeOfGuarantee = async (): Promise<any> => (await axios.post('/product/bankGuaranteeType/typeOfGuarantee')).data;
export const bankingProductsList = async (data: Record<string, any>): Promise<any> => (await axios.post('/product/product/bank/products/bankingProductsList', data)).data; export const bankingProductsList = async (data: Record<string, any>): Promise<any> => (await axios.post('/product/product/bank/products/bankingProductsList', data)).data;
export const batchDeletion = async (ids: number[]): Promise<any> => (await axios.post('/product/product/bank/products/batchDeletion', ids)).data; export const batchDeletion = async (ids: number[]): Promise<any> => (await axios.post('/product/product/bank/products/batchDeletion', ids)).data;

@ -1,6 +1,10 @@
<template> <template>
<div class="flex justify-between items-center py-6 px-5 overflow-hidden"> <div class="flex justify-between items-center w-full py-6 px-5 overflow-hidden bg-transparent">
<logo :collapse="collapse" /> <logo :collapse="collapse" />
<div>
<el-button @click="switchRole(1)">切换产品经理</el-button>
<el-button @click="switchRole(2)">切换风控经理</el-button>
</div>
<div class="inline-flex items-center"> <div class="inline-flex items-center">
<img class="mr-3 cursor-pointer" <img class="mr-3 cursor-pointer"
src="@/assets/images/2.png" src="@/assets/images/2.png"
@ -17,6 +21,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, computed } from 'vue'; import { ref, onMounted, computed } from 'vue';
import { useRouter } from 'vue-router';
import { setCookieLocale, getSessionSiteId, setSessionSiteId } from '@/utils/common'; import { setCookieLocale, getSessionSiteId, setSessionSiteId } from '@/utils/common';
import { toTree, flatTree } from '@/utils/tree'; import { toTree, flatTree } from '@/utils/tree';
// import { querySiteList } from '@/api/bank'; // import { querySiteList } from '@/api/bank';
@ -24,6 +29,7 @@ import { currentUser, perm, logout } from '@/store/useCurrentUser';
import { appState, toggleSidebar } from '@/store/useAppState'; import { appState, toggleSidebar } from '@/store/useAppState';
import Logo from './Logo.vue'; import Logo from './Logo.vue';
const router = useRouter();
const siteId = ref<number | null>(getSessionSiteId()); const siteId = ref<number | null>(getSessionSiteId());
const siteList = ref<any[]>([]); const siteList = ref<any[]>([]);
const site = computed(() => siteList.value.find((item) => item.id === siteId.value)); const site = computed(() => siteList.value.find((item) => item.id === siteId.value));
@ -33,10 +39,8 @@ const fetchSiteList = async () => {
// siteId.value = siteList.value[0]?.id; // siteId.value = siteList.value[0]?.id;
// } // }
}; };
const changeSiteId = (id: number) => { const switchRole = (type: number) => {
setSessionSiteId(id); router.push(`/product?type=0&i=1&role=${type}`);
siteId.value = id;
window.location.reload();
}; };
onMounted(() => { onMounted(() => {
// fetchSiteList(); // fetchSiteList();

@ -23,7 +23,7 @@
</li> </li>
</template> </template>
<template v-else> <template v-else>
<li> <li :class="{ active: active == 1 }">
<img class="icon" <img class="icon"
src="@/assets/images/icon1.png" src="@/assets/images/icon1.png"
alt="" /> alt="" />
@ -71,7 +71,7 @@ import { isShowMenu } from '@/store/useCurrentUser';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const active = computed(() => route.query.i); const active = computed(() => route.query.i);
const isProduct = ref<any>(true); const isProduct = computed(() => route.query.role == 1 || !route.query.role);
// //
const toPage = (path: string) => { const toPage = (path: string) => {

@ -7,7 +7,7 @@
<app-header /> <app-header />
<app-sidebar v-if="!hideNav" <app-sidebar v-if="!hideNav"
class="sidebar fixed h-full px-5 overflow-hidden transition-width duration-300 z-40" /> class="sidebar fixed h-full px-5 overflow-hidden transition-width duration-300 z-40" />
<div class="main transition-margin duration-300" <div class="main h-[calc(100vh-85px)] transition-margin duration-300 overflow-auto"
:class="{ 'md:ml-sidebar': !hideNav }"> :class="{ 'md:ml-sidebar': !hideNav }">
<app-main /> <app-main />
</div> </div>

@ -35,45 +35,72 @@
<el-form-item label="贷款对象" <el-form-item label="贷款对象"
required> required>
<div class="flex-1"> <div class="flex-1">
<p class="field-name">选择本产品的贷款对象</p> <!-- 企业 -->
<div class="flex items-center mb-2"> <template v-if="form.productType">
<el-checkbox-group class="mt-1" <div class="flex items-center">
v-model="form.age"> <span class="mr-3 text-[#333] text-sm">企业类型</span>
<el-checkbox label="年龄" /> <el-select v-model="form.productObject"
</el-checkbox-group> placeholder="请选择">
<div class="num-inputs ml-7"> <el-option v-for="(item, i) in config.find((e: any) => e.name === '企业产品-贷款对象')?.recordChildren[0]?.subject?.itemList"
<el-input placeholder="最小年龄"
v-model.number="form.minimumAge"></el-input>
<span class="split">-</span>
<el-input placeholder="最大年龄"
v-model.number="form.maximumAge"></el-input>
</div>
</div>
<div class="flex items-center mb-2">
<el-checkbox v-model="form.edu"
label="学历要求"></el-checkbox>
<el-checkbox-group v-if="form.edu"
class="mt-2 ml-5"
v-model="form.educationalRequirements">
<el-checkbox v-for="(item, i) in config[3]?.recordChildren[1]?.subject?.itemList"
:key="i" :key="i"
:label="item.itemId">{{ item.options }}</el-checkbox> :label="item.options"
</el-checkbox-group> :value="item.itemId" />
</div> </el-select>
</div>
<div class="flex items-center mt-4">
<span class="mr-3 text-[#333] text-sm">借款人年龄</span>
<div class="num-inputs ml-7">
<el-input placeholder="最小年龄"
v-model.number="form.minimumAge"></el-input>
<span class="split">-</span>
<el-input placeholder="最大年龄"
v-model.number="form.maximumAge"></el-input>
<span class="unit">周岁</span>
</div>
</div>
</template>
<!-- 个人 -->
<template v-else>
<p class="field-name">选择本产品的贷款对象</p>
<div class="flex items-center mb-2">
<el-checkbox-group class="mt-1"
v-model="form.age">
<el-checkbox label="年龄" />
</el-checkbox-group>
<div class="num-inputs ml-7">
<el-input placeholder="最小年龄"
v-model.number="form.minimumAge"></el-input>
<span class="split">-</span>
<el-input placeholder="最大年龄"
v-model.number="form.maximumAge"></el-input>
</div>
</div>
<div class="flex items-center mb-2">
<el-checkbox v-model="form.edu"
label="学历要求"></el-checkbox>
<el-checkbox-group v-if="form.edu"
class="mt-2 ml-5"
v-model="form.educationalRequirements">
<el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '个人产品-贷款对象')?.recordChildren[1]?.subject?.itemList"
:key="i"
:label="item.itemId">{{ item.options }}</el-checkbox>
</el-checkbox-group>
</div>
<div class="flex items-center mb-2"> <div class="flex items-center mb-2">
<el-checkbox v-model="form.curWL" <el-checkbox v-model="form.curWL"
label="工作年限"></el-checkbox> label="工作年限"></el-checkbox>
<el-checkbox-group v-if="form.curWL" <el-checkbox-group v-if="form.curWL"
class="mt-2 ml-5" class="mt-2 ml-5"
v-model="form.currentWorkingLife"> v-model="form.currentWorkingLife">
<el-checkbox v-for="(item, i) in config[3]?.recordChildren[2]?.subject?.itemList" <el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '个人产品-贷款对象')?.recordChildren[2]?.subject?.itemList"
:key="i" :key="i"
:label="item.itemId">{{ item.options }}</el-checkbox> :label="item.itemId">{{ item.options }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<el-checkbox v-model="form.providentFundAndSocialSecurity" <el-checkbox v-model="form.providentFundAndSocialSecurity"
label="公积金/社保"></el-checkbox> label="公积金/社保"></el-checkbox>
</template>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="贷款用途" <el-form-item label="贷款用途"
@ -81,9 +108,16 @@
<div class="flex-1"> <div class="flex-1">
<p class="field-name">选择本产品贷款资金的用途</p> <p class="field-name">选择本产品贷款资金的用途</p>
<el-radio-group v-model="form.loanPurpose"> <el-radio-group v-model="form.loanPurpose">
<el-radio v-for="(item, i) in config[4]?.recordChildren" <template v-if="form.productType">
:key="i" <el-radio v-for="(item, i) in config.find((e: any) => e.name === '企业产品-贷款用途')?.subject?.itemList"
:label="item.id">{{ item.name }}</el-radio> :key="i"
:label="item.itemId">{{ item.options }}</el-radio>
</template>
<template v-else>
<el-radio v-for="(item, i) in config.find((e: any) => e.name === '个人产品-贷款用途')?.recordChildren"
:key="i"
:label="item.id">{{ item.name }}</el-radio>
</template>
</el-radio-group> </el-radio-group>
<el-input v-if="form?.loanPurpose === 107" <el-input v-if="form?.loanPurpose === 107"
class="w-[250px] ml-5" class="w-[250px] ml-5"
@ -96,7 +130,7 @@
prop="bankGuaranteeTypeIds"> prop="bankGuaranteeTypeIds">
<div class="flex-1"> <div class="flex-1">
<p class="field-name">选择本产品的担保种类</p> <p class="field-name">选择本产品的担保种类</p>
<div v-for="(item, i) in config[5]?.recordChildren" <div v-for="(item, i) in config.find((e: any) => e.name === '担保方式')?.recordChildren"
:key="i" :key="i"
class="mb-2"> class="mb-2">
<el-checkbox-group v-model="form.bankGuaranteeTypeIds"> <el-checkbox-group v-model="form.bankGuaranteeTypeIds">
@ -159,7 +193,7 @@
<div class="flex-1"> <div class="flex-1">
<p class="field-name">选择本产品可以选择的还款方式</p> <p class="field-name">选择本产品可以选择的还款方式</p>
<el-checkbox-group v-model="form.modeRepayment"> <el-checkbox-group v-model="form.modeRepayment">
<el-checkbox v-for="(item, i) in config[9]?.subject?.itemList" <el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '还款方式')?.subject?.itemList"
:key="i" :key="i"
:label="item.itemId">{{ item.options }}</el-checkbox> :label="item.itemId">{{ item.options }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
@ -199,18 +233,19 @@ interface RuleForm {
bankGuaranteeTypeIds: any[]; bankGuaranteeTypeIds: any[];
currentWorkingLife?: any; currentWorkingLife?: any;
educationalRequirements?: any; educationalRequirements?: any;
loanCeiling?: number; loanCeiling: any;
loanPurpose?: number; loanPurpose: any;
maximumAge?: number; productObject: any;
maximumAnnualInterestRate?: number; maximumAge: any;
maximumTermOfLoan?: number; maximumAnnualInterestRate: any;
minimumAge?: number; maximumTermOfLoan: any;
minimumAprOnLoan?: number; minimumAge: any;
minimumLoan?: number; minimumAprOnLoan: any;
minimumTermOfLoan?: number; minimumLoan: any;
minimumTermOfLoan: any;
modeRepayment?: any; modeRepayment?: any;
otherPurposesOfLoan: string; otherPurposesOfLoan: string;
productObject?: number; productObject: any;
productType: number; productType: number;
providentFundAndSocialSecurity: any; providentFundAndSocialSecurity: any;
whetherToSupportEarlyRepayment?: any; whetherToSupportEarlyRepayment?: any;
@ -219,7 +254,7 @@ interface RuleForm {
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const curTab = ref<string>('tab1'); const curTab = ref<string>('tab1');
const config = ref<any>({}); const config = ref<any>([]);
const formRef = ref<FormInstance>(); const formRef = ref<FormInstance>();
const form = reactive<RuleForm>({ const form = reactive<RuleForm>({
productDefinition: '', productDefinition: '',
@ -230,6 +265,7 @@ const form = reactive<RuleForm>({
educationalRequirements: [], educationalRequirements: [],
loanCeiling: '', loanCeiling: '',
loanPurpose: '', loanPurpose: '',
productObject: '',
maximumAge: '', maximumAge: '',
maximumAnnualInterestRate: '', maximumAnnualInterestRate: '',
maximumTermOfLoan: '', maximumTermOfLoan: '',
@ -262,7 +298,7 @@ const tabChange = (tab: TabsPaneContext, event: Event) => {
}; };
// //
const getConfig = async () => { const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(41); const { process } = await getProcessInformationBasedOnRoles(form.productType === 1 ? 45 : 44);
config.value = process; config.value = process;
}; };
// //
@ -277,14 +313,18 @@ const submit = async (formEl: FormInstance | undefined) => {
param.modeRepayment = param.modeRepayment.join(); param.modeRepayment = param.modeRepayment.join();
param.providentFundAndSocialSecurity = param.providentFundAndSocialSecurity ? 13 : ''; param.providentFundAndSocialSecurity = param.providentFundAndSocialSecurity ? 13 : '';
param.whetherToSupportEarlyRepayment = param.whetherToSupportEarlyRepayment ? 58 : ''; param.whetherToSupportEarlyRepayment = param.whetherToSupportEarlyRepayment ? 58 : '';
console.log(33, form, param); //
await save(param); param.addBankProductsGuarantyStyleReqList = [];
addRecord(param); param.bankGuaranteeTypeIds.forEach((e: number) => {
param.addBankProductsGuarantyStyleReqList.push({
bankGuaranteeTypeId: (e > 22 && e < 33) || (e > 32 && e < 38) ? e : '',
pid: e > 22 && e < 33 ? 110 : e > 32 && e < 38 ? 111 : e,
});
});
const { message } = await save(param);
addRecord(param, message);
ElMessage.success('提交成功!'); ElMessage.success('提交成功!');
emit('getList', 1); emit('getList', 1);
// setTimeout(() => {
// router.push(``)
// }, 1500);
} finally { } finally {
} }
} else { } else {
@ -293,22 +333,34 @@ const submit = async (formEl: FormInstance | undefined) => {
}); });
}; };
// //
const addRecord = async (data: any) => { const addRecord = async (data: Record<string, any>, newId: number) => {
const preIds = `1,2,41,${data.productType ? 45 : 44}`; // 1id/44/45 const isEnterprise = data.productType === 1;
const preIds = `1,2,41,${data.productType ? 45 : 44},${newId}`; // 1id/44/45
const lcRule = <Record<string, any>[]>[ const lcRule = <Record<string, any>[]>[
handleId(48, 1, data.productDefinition, preIds + ',48', 3), handleId(48, 1, data.productDefinition, preIds + ',48', 3),
handleId(49, 2, data.productName, preIds + ',49', 3), handleId(49, 2, data.productName, preIds + ',49', 3),
handleId(50, 3, 1, preIds + ',50', 1), handleId(50, 3, 1, preIds + ',50', 1),
]; ];
data.age && lcRule.push(handleId(100, 41, '[' + data.minimumAge + ',' + data.maximumAge + ']' + '', preIds + ',51,100', 5));
data.edu && lcRule.push(handleId(101, 42, data.educationalRequirements, preIds + ',51,101', 1));
data.curWL && lcRule.push(handleId(102, 43, data.currentWorkingLife, preIds + ',51,102', 1));
data.providentFundAndSocialSecurity && lcRule.push(handleId(103, '', '', preIds + ',51,103', '')); //
// //
lcRule.push( if (isEnterprise) {
data.loanPurpose === 107 ? handleId(107, 11, data.otherPurposesOfLoan, preIds + ',52,107', 3) : handleId(data.loanPurpose, '', '', preIds + ',52,' + data.loanPurpose, 1), //
); lcRule.push(
handleId(62, 7, data.productObject, preIds + ',61,62', 1),
handleId(63, 8, '[' + data.minimumAge + ',' + data.maximumAge + ']' + '', preIds + ',61,63', 5),
handleId(65, 19, data.loanPurpose, preIds + ',65', 1),
);
} else {
//
data.age && lcRule.push(handleId(100, 41, '[' + data.minimumAge + ',' + data.maximumAge + ']' + '', preIds + ',51,100', 5));
data.edu && lcRule.push(handleId(101, 42, data.educationalRequirements, preIds + ',51,101', 1));
data.curWL && lcRule.push(handleId(102, 43, data.currentWorkingLife, preIds + ',51,102', 1));
data.providentFundAndSocialSecurity && lcRule.push(handleId(103, '', '', preIds + ',51,103', '')); //
lcRule.push(
data.loanPurpose === 107 ? handleId(107, 11, data.otherPurposesOfLoan, preIds + ',52,107', 3) : handleId(data.loanPurpose, '', '', preIds + ',52,' + data.loanPurpose, 1),
);
}
// //
data.bankGuaranteeTypeIds.includes(108) && lcRule.push(handleId(108, '', '', preIds + ',53,108', '')); data.bankGuaranteeTypeIds.includes(108) && lcRule.push(handleId(108, '', '', preIds + ',53,108', ''));

@ -4,16 +4,22 @@
<search v-model="params.keyWord" <search v-model="params.keyWord"
@change="initList"></search> @change="initList"></search>
<div class="filter"> <div class="filter">
<el-checkbox-group v-if="role == 2"
class="mr-5"
v-model="productTypes">
<el-checkbox :label="0">个人</el-checkbox>
<el-checkbox :label="1">企业</el-checkbox>
</el-checkbox-group>
<div class="select"> <div class="select">
<el-select v-model="params.guarantyStyleId" <el-select v-model="params.guarantyStyleId"
placeholder="担保方式" placeholder="担保方式"
size="large" size="large">
@change="initList">
<el-option label="担保方式" <el-option label="担保方式"
value="" /> value="" />
<el-option v-for="item in guarantees" <el-option v-for="item in guarantees"
:key="item.id" :key="item.id"
:label="item.guarantyStyle" :label="item.name"
:value="item.id" /> :value="item.id" />
</el-select> </el-select>
<img src="@/assets/images/7.png" <img src="@/assets/images/7.png"
@ -23,8 +29,7 @@
<div class="select"> <div class="select">
<el-select v-model="params.status" <el-select v-model="params.status"
placeholder="产品进度" placeholder="产品进度"
size="large" size="large">
@change="initList">
<el-option v-for="item in paces" <el-option v-for="item in paces"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
@ -34,7 +39,8 @@
alt="" alt=""
class="icon" /> class="icon" />
</div> </div>
<div class="add-btn" <div v-if="role == 1"
class="add-btn"
@click="toAdd"> @click="toAdd">
<img src="@/assets/images/plus.png" <img src="@/assets/images/plus.png"
alt="" alt=""
@ -55,6 +61,13 @@
label="产品名称"></el-table-column> label="产品名称"></el-table-column>
<el-table-column prop="productNumber" <el-table-column prop="productNumber"
label="产品编号"></el-table-column> label="产品编号"></el-table-column>
<el-table-column v-if="role == 2"
prop="loanCeiling"
label="贷款对象">
<template #default="{ row }">
{{ row.productType ? '企业' : '个人' }}
</template>
</el-table-column>
<el-table-column prop="guarantyStyle" <el-table-column prop="guarantyStyle"
label="担保方式"></el-table-column> label="担保方式"></el-table-column>
<el-table-column prop="loanCeiling" <el-table-column prop="loanCeiling"
@ -76,16 +89,18 @@
label="操作"> label="操作">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" <el-button type="text"
@click="handleEdit(row.id)" size="small"
size="small">配置要素</el-button> @click="toDetail(`/product/cardList/config`, row.id)">配置{{ role == 1 ? '要素' : '风控' }}</el-button>
<el-button type="text" <el-button type="text"
@click="toDetail(row.id)" @click="toDetail(`/product/cardList/detail`, row.id)"
size="small">产品详情</el-button> size="small">产品详情</el-button>
<el-popconfirm title="您确定删除吗?" <el-popconfirm v-if="role == 1"
@confirm="handleDelete(row.id)"> title="您确定删除吗?"
@confirm.stop="handleDelete(row.id)">
<template #reference> <template #reference>
<el-button type="text" <el-button type="text"
size="small">删除</el-button> size="small"
@click.stop="stop">删除</el-button>
</template> </template>
</el-popconfirm> </el-popconfirm>
</template></el-table-column> </template></el-table-column>
@ -110,7 +125,8 @@ import { useI18n } from 'vue-i18n';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { perm } from '@/store/useCurrentUser'; import { perm } from '@/store/useCurrentUser';
import { pageSizes, pageLayout, toParams, resetParams } from '@/utils/common'; import { pageSizes, pageLayout, toParams, resetParams } from '@/utils/common';
import { primaryTypeOfGuarantee, bankingProductsList, batchDeletion } from '@/api/bank'; import { getProcessInformationBasedOnRoles } from '@/api/judgment';
import { bankingProductsList, batchDeletion } from '@/api/bank';
import Search from '@/components/Search.vue'; import Search from '@/components/Search.vue';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { getStatus } from '@/store/useProduct'; import { getStatus } from '@/store/useProduct';
@ -118,15 +134,23 @@ import { getStatus } from '@/store/useProduct';
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const productTypes = ref<number[]>([0, 1]);
const params = reactive({ const params = reactive({
createDateSort: '', createDateSort: '',
guarantyStyleId: '', guarantyStyleId: '',
keyWord: '', keyWord: '',
productType: '', productType: computed(() => {
let val = <number | string>'';
if (route.query.role == 2) {
if (productTypes.value.length === 1) val = productTypes.value[0];
return val;
}
return +route.query.type;
}),
status: '', status: '',
}); });
params.productType = computed(() => +route.query.type); // params.productType = computed(() => (route.query.role == 2 ? '' : +route.query.type));
const sort = ref<any>(); const role = computed(() => route.query.role || 1); // 12
const currentPage = ref<number>(1); const currentPage = ref<number>(1);
const pageSize = ref<number>(10); const pageSize = ref<number>(10);
const total = ref<number>(0); const total = ref<number>(0);
@ -163,11 +187,12 @@ const loading = ref<boolean>(false);
// //
const getGuarantee = async () => { const getGuarantee = async () => {
try { try {
const { data } = await primaryTypeOfGuarantee(); const { process } = await getProcessInformationBasedOnRoles(44);
guarantees.value = data; guarantees.value = process[5].recordChildren;
} finally { } finally {
} }
}; };
const stop = () => {};
// //
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
@ -189,7 +214,11 @@ onMounted(() => {
getList(); getList();
}); });
watch([() => params.keyWord, () => route.query.type], initList); watch([params, () => route.query], initList);
// watch(productTypes, (val) => {
// console.log('🚀 ~ file: List.vue:207 ~ watch ~ val:', val);
// params.productType = val.length === 2 ? '' :
// });
const handleSort = ({ column, prop, order }: { column: any; prop: string; order: string }) => { const handleSort = ({ column, prop, order }: { column: any; prop: string; order: string }) => {
params.createDateSort = order === 'descending' ? 'desc' : order === 'ascending' ? 'asc' : ''; params.createDateSort = order === 'descending' ? 'desc' : order === 'ascending' ? 'asc' : '';
getList(); getList();
@ -202,9 +231,9 @@ const toAdd = () => {
}); });
}; };
// //
const toDetail = async (id: number) => { const toDetail = async (path: string, id: number) => {
router.push({ router.push({
path: `/product/cardList/detail`, path,
query: { query: {
...route.query, ...route.query,
id, id,
@ -225,38 +254,26 @@ const handleDelete = async (id: number) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.filter { .filter {
display: inline-flex; @apply inline-flex items-center;
align-items: center;
.select { .select {
position: relative; @apply relative mr-[12px];
margin-right: 12px;
.icon { .icon {
position: absolute; @apply absolute top-[12px] left-5;
top: 12px;
left: 20px;
} }
:deep(.el-select) { :deep(.el-select) {
width: 170px; @apply w-[170px];
.el-input__inner { .el-input__inner {
padding-left: 41px; @apply pl-[41px] rounded-[18px] border-[#dfe9f8];
border-radius: 18px;
border-color: #dfe9f8;
} }
} }
} }
.add-btn { .add-btn {
display: inline-flex; @apply inline-flex items-center h-[36px] px-[24px] text-sm text-white rounded-[18px] cursor-pointer;
align-items: center;
height: 36px;
padding: 0 24px;
font-size: 14px;
color: #fff;
background: linear-gradient(-36deg, #006bff, #2ab1ff); background: linear-gradient(-36deg, #006bff, #2ab1ff);
border: 1px solid #ffffff; border: 1px solid #ffffff;
border-radius: 18px;
cursor: pointer; cursor: pointer;
.icon { .icon {
margin-right: 8px; @apply mr-[8px];
} }
} }
} }

Loading…
Cancel
Save