Commit d1f4abc8 authored by 沈翠玲's avatar 沈翠玲

资产分配

parent a717b181
...@@ -24,7 +24,7 @@ VITE_GLOB_API_URL = ...@@ -24,7 +24,7 @@ VITE_GLOB_API_URL =
VITE_GLOB_API_URL_PREFIX = /api VITE_GLOB_API_URL_PREFIX = /api
# websocket地址 # websocket地址
VITE_APP_SOCKET_URL = ws://192.168.31.128:8080 VITE_APP_SOCKET_URL = ws://8.152.205.9:8080
# 文件上传地址 # 文件上传地址
VITE_GLOB_UPLOAD_URL= VITE_GLOB_UPLOAD_URL=
......
...@@ -3,3 +3,27 @@ import request from '@/utils/http/index'; ...@@ -3,3 +3,27 @@ import request from '@/utils/http/index';
export const getLoanDistribute = (params) => { export const getLoanDistribute = (params) => {
return request.get('/LoanDistribute/totalLoan', params); return request.get('/LoanDistribute/totalLoan', params);
}; };
// 案件管理统计
export const getLoantotal = (params) => {
return request.get('/LoanDistribute/total', params);
};
// 资产列表
export const getLoanpage = (params) => {
return request.get('/LoanDistribute/page', params);
};
// 分配到调节中心
export const distributeLoan = (tenantId, data) => {
return request.post(`/LoanDistribute/distribute?tenantId=${tenantId}`, data);
};
// 系统自动分配; 分配到CPE
export const distributeCpe = (data) => {
return request.post(`/LoanDistribute/distributeCpe?type=${data.type}`, data);
};
// 手动调整分配CPE
export const changeDistributeCpe = (data) => {
return request.post(`/LoanDistribute/changeDistributeCpe`, data);
};
// 撤回案件
export const backDistribute = (ids) => {
return request.get('/LoanDistribute/back', { ids });
};
import request from '@/utils/http/index';
export const saveManageOrg = (data) => {
return request.post('/ManageOrg/save', data);
};
export const getManageOrgPage = (params) => {
return request.get('/ManageOrg/page', params);
};
export const deleteManageOrgs = (ids) => {
return request.get('/ManageOrg/batchDeleteByIds', { ids });
};
import request from '@/utils/http/index';
export const savePlatform = (data) => {
return request.post('/LoanPlatform/save', data);
};
export const getPlatformPage = (params) => {
return request.get('/LoanPlatform/page', params);
};
export const deletePlatforms = (ids) => {
return request.get('/LoanPlatform/batchDeleteByIds', { ids });
};
This source diff could not be displayed because it is too large. You can view the blob instead.
<template> <template>
<vxe-modal <vxe-modal
v-model="showModal" v-model="showModal"
title="案件分" title="案件分"
@hide="onHide" @hide="onHide"
height="582" height="582"
width="1003" width="1003"
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
</div> </div>
</div> </div>
<div class="number-right"> <div class="number-right">
<p>待分派案人人数</p> <p>待分配客户数量</p>
<p>{{ currentAccount.people }}</p> <p>{{ statisis.unCustomerNum }}</p>
</div> </div>
</div> </div>
<div class="number-box"> <div class="number-box">
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
</div> </div>
</div> </div>
<div class="number-right"> <div class="number-right">
<p>待分案件数量</p> <p>待分案件数量</p>
<p>{{ currentAccount.case }}</p> <p>{{ statisis.unCaseNum }}</p>
</div> </div>
</div> </div>
<div class="number-box"> <div class="number-box">
...@@ -39,15 +39,15 @@ ...@@ -39,15 +39,15 @@
</div> </div>
</div> </div>
<div class="number-right"> <div class="number-right">
<p>待分金额</p> <p>待分金额</p>
<p>{{ currentAccount.money }}</p> <p>{{ statisis.unAmount }}</p>
</div> </div>
</div> </div>
</div> </div>
<div class="Content"> <div class="Content">
<template v-if="!step"> <template v-if="!step">
<div style="margin-top: 10px; margin-bottom: 10px"> <div style="margin-top: 10px; margin-bottom: 10px">
<el-radio-group v-model="radio"> <el-radio-group v-model="radio" @change="changeRadio">
<el-radio :value="0">分配到调解中心</el-radio> <el-radio :value="0">分配到调解中心</el-radio>
<el-radio :value="1">分配到CPE</el-radio> <el-radio :value="1">分配到CPE</el-radio>
</el-radio-group> </el-radio-group>
...@@ -56,37 +56,27 @@ ...@@ -56,37 +56,27 @@
<div class="tree-wrapper"> <div class="tree-wrapper">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" /> <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" />
</div> </div>
<el-transfer <!-- <el-transfer
v-model="value1" v-model="value1"
:data="data1" :data="data1"
:titles="['CPE', '已选CPE']" :titles="['CPE', '已选CPE']"
ref="mytransfer" ref="mytransfer"
@left-check-change="leftChange" @left-check-change="leftChange"
/> /> -->
</div> </div>
</template> </template>
<template v-else> <template v-else>
<p>方案</p> <p>方案</p>
<div class="idea-box"> <div class="idea-box">
<div class="left-idea"> <div class="left-idea">
<div class="idea-btn"> <div class="idea-btn">
<el-button <el-button
type="primary" type="primary"
:plain="currentAllBtn === 1 ? false : true" :plain="currentAllBtn === item.value ? false : true"
@click="chooseIdea(1)" v-for="(item, index) in options"
>以案人数均分</el-button :key="index"
> @click="chooseIdea(item.value)"
<el-button >{{ item.label }}</el-button
type="primary"
:plain="currentAllBtn === 2 ? false : true"
@click="chooseIdea(2)"
>以案件数均分</el-button
>
<el-button
type="primary"
:plain="currentAllBtn === 3 ? false : true"
@click="chooseIdea(3)"
>以委案金额均分</el-button
> >
</div> </div>
<div class="reset-btn"> <div class="reset-btn">
...@@ -120,31 +110,92 @@ ...@@ -120,31 +110,92 @@
<script setup lang="jsx" name="allocationModal"> <script setup lang="jsx" name="allocationModal">
import { UserFilled } from '@element-plus/icons-vue'; import { UserFilled } from '@element-plus/icons-vue';
import { RefreshRight } from '@element-plus/icons-vue'; import { RefreshRight } from '@element-plus/icons-vue';
import { ElInputNumber } from 'element-plus'; import { ElInputNumber, ElMessage } from 'element-plus';
import {
getLoanDistribute,
distributeLoan,
distributeCpe,
changeDistributeCpe,
} from '@/api/allcation';
import { getTenantPage } from '@/api/tenant';
import { computed } from 'vue'; import { computed } from 'vue';
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
const emits = defineEmits(['success']);
const data = ref([]); const data = ref([]);
const mytransfer = ref(); const mytransfer = ref();
const tabledata = ref([]); const tabledata = ref([]);
const showModal = ref(false); const showModal = ref(false);
const currentAccount = ref({ people: 0, case: 0, money: 0 }); const currentInfo = ref({});
const currentAllBtn = ref(1); const currentTenant = ref({});
const statisis = ref({});
const currentAllBtn = ref('BORROWER');
const editRowIndex = ref(-1); const editRowIndex = ref(-1);
const radio = ref(0); const radio = ref(0);
const step = ref(0); const step = ref(0);
const onHide = () => { const onHide = () => {
currentAccount.value = { people: 0, case: 0, money: 0 }; currentInfo.value = {};
};
const getStatisis = (params) => {
getLoanDistribute(params).then((res) => {
if (res.success) {
statisis.value = res.result;
}
});
};
const getTree = () => {
getTenantPage({
current: 1,
size: 999999999,
}).then((res) => {
if (res.success) {
data.value = res.result.content;
}
});
}; };
const openModal = (account) => { const chooseIdea = (type) => {
editRowIndex.value = -1;
currentAllBtn.value = type;
distributeCpe({
type: currentAllBtn.value,
caseId: currentInfo.value.caseId,
payOrg: currentInfo.value.payOrg,
manageOrg: currentInfo.value.manageOrg.orgName,
product: currentInfo.value.product,
borrowerName: currentInfo.value.borrower.name,
borrowerIdCard: currentInfo.value.borrower.idCard,
borrowerPhone: currentInfo.value.borrower.phone,
commissionAmount: currentInfo.value.commissionAmount,
sumRepayAmount: currentInfo.value.sumRepayAmount,
sumReductionAmount: currentInfo.value.sumReductionAmount,
remainingAmount: currentInfo.value.remainingAmount,
principalBalance: currentInfo.value.principalBalance,
remaininginterest: currentInfo.value.remaininginterest,
commission: currentInfo.value.commission,
followStatus: currentInfo.value.followStatus,
phoneResultStatus: currentInfo.value.phoneResultStatus,
caseStatus: currentInfo.value.caseStatus,
tenantId: currentTenant.value.id,
}).then((res) => {
if (res.success) {
tabledata.value = res.result;
}
});
};
const changeRadio = () => {
// radio.value === 1 && chooseIdea('BORROWER')
};
const openModal = (info, param) => {
showModal.value = true; showModal.value = true;
currentAccount.value = { people: 333, case: 44, money: 1111 }; currentInfo.value = info;
console.log('currentInfo.value', currentInfo.value);
getStatisis(param);
getTree();
step.value = 0; step.value = 0;
radio.value = 0; radio.value = 0;
currentAllBtn.value = 1;
editRowIndex.value = -1; editRowIndex.value = -1;
}; };
const backform = () => { const backform = () => {
...@@ -152,82 +203,89 @@ ...@@ -152,82 +203,89 @@
}; };
const submitForm = () => { const submitForm = () => {
if (step.value || radio.value === 0) { if (step.value || radio.value === 0) {
if (step.value) {
if (currentAllBtn.value === 'CASE') {
const sum = tabledata.value.reduce((pre, cur) => pre + cur.caseNum, 0);
if (Number(sum) !== Number(statisis.value.unCaseNum))
return ElMessage.warning({
message: '总数与待分配案件数不一致',
plain: true,
});
} else if (currentAllBtn.value === 'BORROWER') {
const sum = tabledata.value.reduce((pre, cur) => pre + cur.borrowerNum, 0);
if (Number(sum) !== Number(statisis.value.unCustomerNum))
return ElMessage.warning({
message: '总数与待分配案人数不一致',
plain: true,
});
}
changeDistributeCpe({
records: tabledata.value,
distributeType: currentAllBtn.value,
}).then((res) => {});
} else {
distributeLoan(currentTenant.value.id, {
caseId: currentInfo.value.caseId,
payOrg: currentInfo.value.payOrg,
manageOrg: currentInfo.value.manageOrg.orgName,
product: currentInfo.value.product,
borrowerName: currentInfo.value.borrower.name,
borrowerIdCard: currentInfo.value.borrower.idCard,
borrowerPhone: currentInfo.value.borrower.phone,
commissionAmount: currentInfo.value.commissionAmount,
sumRepayAmount: currentInfo.value.sumRepayAmount,
sumReductionAmount: currentInfo.value.sumReductionAmount,
remainingAmount: currentInfo.value.remainingAmount,
principalBalance: currentInfo.value.principalBalance,
remaininginterest: currentInfo.value.remaininginterest,
commission: currentInfo.value.commission,
followStatus: currentInfo.value.followStatus,
phoneResultStatus: currentInfo.value.phoneResultStatus,
caseStatus: currentInfo.value.caseStatus,
tenantId: currentTenant.value.id,
}).then((res) => {
if (res.success) {
ElMessage.success({
message: '分配成功',
plain: true,
});
showModal.value = false;
emits('success');
}
});
}
} else { } else {
chooseIdea('BORROWER');
step.value = 1; step.value = 1;
} }
}; };
const handleNodeClick = (data) => { const handleNodeClick = (data) => {
console.log(data); console.log('data11111', data);
}; currentTenant.value = data;
const chooseIdea = (type) => {
editRowIndex.value = -1;
currentAllBtn.value = type;
}; };
const resetAllocation = () => { const resetAllocation = () => {
editRowIndex.value = -1; chooseIdea(currentAllBtn.value);
}; };
const changeNum = (type, row, index) => { const changeNum = (type, row, index) => {
editRowIndex.value = index; // editRowIndex.value = index;
console.log('changeNum', type, row, index); console.log('changeNum', type, row, index);
}; };
const leftChange = (value, direction) => { const leftChange = (value, direction) => {
console.log(value, direction); //这个就是它包含的所有的属性以及事件,如果需要别的操作直接执行,也可以查询到 console.log(value, direction); //这个就是它包含的所有的属性以及事件,如果需要别的操作直接执行,也可以查询到
}; };
data.value = [ const options = [
{
label: 'Level one 1',
children: [
{
label: 'Level two 1-1',
children: [
{
label: 'Level three 1-1-1',
},
],
},
],
},
{ {
label: 'Level one 2', label: '以案人数均分',
children: [ value: 'BORROWER',
{
label: 'Level two 2-1',
children: [
{
label: 'Level three 2-1-1',
}, },
],
},
{
label: 'Level two 2-2',
children: [
{ {
label: 'Level three 2-2-1', label: '以案件数均分',
value: 'CASE',
}, },
],
},
],
},
{
label: 'Level one 3',
children: [
{ {
label: 'Level two 3-1', label: '以委案金额均分',
children: [ value: 'AMOUNT',
{
label: 'Level three 3-1-1',
},
],
},
{
label: 'Level two 3-2',
children: [
{
label: 'Level three 3-2-1',
},
],
},
],
}, },
]; ];
const config = computed(() => { const config = computed(() => {
...@@ -237,82 +295,76 @@ ...@@ -237,82 +295,76 @@
columns: [ columns: [
{ type: 'seq', width: 50, title: '序号' }, { type: 'seq', width: 50, title: '序号' },
{ {
field: 'code', field: 'cpe.username',
title: 'CPE', title: 'CPE',
}, },
{ {
field: 'code', field: 'borrowerNum',
title: '分案人数', title: '分案人数',
slots: { slots: {
default: ({ row, rowIndex }) => { default: ({ row, rowIndex }) => {
if (currentAllBtn.value === 1) { if (currentAllBtn.value === 'BORROWER') {
return ( return (
<> <>
<ElInputNumber <ElInputNumber
v-model={row.num} v-model={row.borrowerNum}
onChange={() => changeNum(1, row, rowIndex)} onChange={() => changeNum(1, row, rowIndex)}
disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex} disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex}
/> />
</> </>
); );
} else { } else {
return <>{row.num}</>; return <>{row.borrowerNum}</>;
} }
}, },
}, },
}, },
{ {
field: 'code', field: 'caseNum',
title: '分案件数', title: '分案件数',
slots: { slots: {
default: ({ row, rowIndex }) => { default: ({ row, rowIndex }) => {
if (currentAllBtn.value === 2) { if (currentAllBtn.value === 'CASE') {
return ( return (
<> <>
<ElInputNumber <ElInputNumber
v-model={row.num} v-model={row.caseNum}
onChange={() => changeNum(2, row, rowIndex)} onChange={() => changeNum(2, row, rowIndex)}
disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex} disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex}
/> />
</> </>
); );
} else { } else {
return <>{row.num}</>; return <>{row.caseNum}</>;
} }
}, },
}, },
}, },
{ {
field: 'code', field: 'amount',
title: '分委案金额', title: '分委案金额',
slots: { // slots: {
default: ({ row, rowIndex }) => { // default: ({ row, rowIndex }) => {
if (currentAllBtn.value === 3) { // // if (currentAllBtn.value === 3) {
return ( // // return (
<> // // <>
<ElInputNumber // // <ElInputNumber
v-model={row.num} // // v-model={row.num}
onChange={() => changeNum(3, row, rowIndex)} // // onChange={() => changeNum(3, row, rowIndex)}
disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex} // // disabled={editRowIndex.value > -1 && editRowIndex.value !== rowIndex}
/> // // />
</> // // </>
); // // );
} else { // // } else {
return <>{row.num}</>; // return <>{row.num}</>;
} // // }
}, // },
}, // },
}, },
], ],
}; };
}); });
tabledata.value = [
{ name: 'admin', code: 'admin', role: 'superadmin', num: 1 },
{ name: 'account1', code: 'account1', role: 'user', num: 1 },
{ name: 'account2', code: 'account2', role: 'user', num: 1 },
{ name: 'account3', code: 'account3', role: 'user', num: 1 },
];
const generateData = () => { const generateData = () => {
const data = []; const data = [];
for (let i = 1; i <= 15; i++) { for (let i = 1; i <= 15; i++) {
...@@ -328,7 +380,7 @@ ...@@ -328,7 +380,7 @@
const value1 = ref([]); const value1 = ref([]);
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'label', label: 'name',
}; };
defineExpose({ defineExpose({
openModal, openModal,
......
<template> <template>
<div class="table-box"> <div class="table-box">
<div> <div>
<ProTable <ProTable :config="config" ref="caseLRef" :api="getLoanpage" :paramCallback="paramCallback">
:config="config"
ref="caseLRef"
:api="getLoanDistribute"
:paramCallback="paramCallback"
>
<template #table_top> <template #table_top>
<div class="flex"> <div class="flex">
<div class="mr-2" <div class="mr-2"
>未分配案件数:<span class="text-blue-500 mr-1">{{ statisis.unCaseNum }}</span >未分配案件数:<span class="text-blue-500 mr-1">{{ statisis.caseNum }}</span
></div ></div
> >
<div class="mr-2" <div class="mr-2"
>未分配CPE数:<span class="text-blue-500 mr-1">{{ statisis.unCustomerNum }}</span >未分配CPE数:<span class="text-blue-500 mr-1">{{ statisis.cpeNum }}</span
></div ></div
> >
<div class="mr-2" <div class="mr-2"
>未分配总金额数:<span class="text-blue-500 mr-1">{{ statisis.unAmount }}</span >未分配总金额数:<span class="text-blue-500 mr-1">{{ statisis.amount }}</span
></div ></div
> >
</div> </div>
...@@ -27,11 +22,14 @@ ...@@ -27,11 +22,14 @@
<template #left_buttons> <template #left_buttons>
<el-button <el-button
type="primary" type="primary"
:disabled="!selectdList || selectdList.length !== 1"
@click="allocation" @click="allocation"
:disabled="!selectdList || selectdList.length < 1"
>分配 >分配
</el-button> </el-button>
<el-button type="primary" :disabled="!selectdList || selectdList.length < 1" <el-button
type="primary"
:disabled="!selectdList || selectdList.length < 1"
@click="backCase"
>撤回 >撤回
</el-button> </el-button>
<el-button type="primary" :disabled="!selectdList || selectdList.length < 1" <el-button type="primary" :disabled="!selectdList || selectdList.length < 1"
...@@ -40,113 +38,173 @@ ...@@ -40,113 +38,173 @@
</template> </template>
</ProTable> </ProTable>
</div> </div>
<allocationModal ref="allocationModalRef" /> <allocationModal ref="allocationModalRef" @success="query" />
</div> </div>
</template> </template>
<script setup name="case-allocation"> <script setup name="case-allocation" lang="jsx">
import allocationModal from './components/allocationModal.vue'; import allocationModal from './components/allocationModal.vue';
import { getLoanDistribute } from '@/api/allcation'; import { getLoantotal, getLoanpage, backDistribute } from '@/api/allcation';
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import citydata from '../../../assets/citydata';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const allocationModalRef = ref(); const allocationModalRef = ref();
const caseLRef = ref(); const caseLRef = ref();
const selectdList = ref([]); const selectdList = ref([]);
const curParam = ref({});
const onCheckboxChange = (row) => { const onCheckboxChange = (row) => {
selectdList.value = row.records; selectdList.value = row.records;
}; };
const statisis = ref({}); const statisis = ref({});
const getStatisis = (params) => { const getStatisis = (params) => {
getLoanDistribute(params).then((res) => { getLoantotal(params).then((res) => {
if (res.success) { if (res.success) {
statisis.value = res.result; statisis.value = res.result;
} }
}); });
}; };
const backCase = async () => {
await ElMessageBox.confirm('是否确认撤回选中案件?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
const ids = selectdList.value.map((v) => v.id).join(',');
await backDistribute(ids);
ElMessage({
type: 'success',
message: '撤回成功!',
plain: true,
});
query();
};
const paramCallback = (param) => { const paramCallback = (param) => {
const obj = JSON.parse(JSON.stringify(param)); const obj = JSON.parse(JSON.stringify(param));
getStatisis(); if (obj.arealist && obj.arealist.length > 0) {
obj['province'] = obj.arealist[0];
obj['city'] = obj.arealist.length > 1 ? obj.arealist[1] : null;
obj['district'] = obj.arealist.length > 2 ? obj.arealist[2] : null;
delete obj['arealist'];
}
curParam.value = obj;
getStatisis(obj);
return obj; return obj;
}; };
const distributeStatusOpt = [
{ label: '未分配', value: 'undistributed' },
{ label: '分配到调解中心', value: 'tenant' },
{ label: '分配到CPE', value: 'CPE' },
];
console.log('citydatacitydata', citydata);
const config = reactive({ const config = reactive({
columns: [ columns: [
{ type: 'checkbox', title: '', width: '40px' }, { type: 'checkbox', title: '', width: '40px' },
{ field: 'name', title: '案件ID/案件号', search: { el: 'input' } }, { field: 'caseId', title: '案件ID/案件号', search: { el: 'input' } },
{ {
field: 'code', field: 'arealist',
enum: citydata,
title: '所属区域', title: '所属区域',
search: { el: 'input', props: { clearable: true } }, fieldNames: { label: 'label', value: 'value' },
search: { el: 'cascader', props: { clearable: true } },
slots: {
default: ({ row }) => {
return (
<div>
{row.manageOrg.province}
{row.manageOrg.city ? '-' + row.manageOrg.city : ''}
{row.manageOrg.district ? '-' + row.manageOrg.district : ''}
</div>
);
},
},
}, },
{ {
field: 'code', field: 'payOrg',
title: '借款机构', title: '借款机构',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', props: { clearable: true } },
}, },
{ {
field: 'role', field: 'distributeStatus',
title: '分配状态', title: '分配状态',
search: { el: 'input', props: { clearable: true } }, enum: distributeStatusOpt,
search: { el: 'select', props: { filterable: true }, span: 1 },
fieldNames: { label: 'label', value: 'value' },
slots: {
default: ({ row }) => {
return (
<>
{row.distributeStatus
? distributeStatusOpt.find((v) => v.value === row.distributeStatus).label
: ''}
</>
);
},
},
}, },
{ {
field: 'role', field: 'tenant.name',
title: '调解中心', title: '调解中心',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', props: { clearable: true } },
}, },
{ {
field: 'role', field: 'manageOrg.orgName',
title: '资管公司', title: '资管公司',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', props: { clearable: true } },
}, },
{ {
field: 'role', field: 'cpe.name',
title: 'CPE', title: 'CPE',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', props: { clearable: true }, key: 'cpeName' },
}, },
{ {
field: 'role', field: 'tenantTime',
title: '分配中心日期', title: '分配中心日期',
search: { el: 'date-picker', props: { type: 'date', valueFormat: 'YYYY-MM-DD' } }, search: { el: 'date-picker', props: { type: 'date', valueFormat: 'YYYY-MM-DD' } },
}, },
{ {
field: 'role', field: 'commissionAmount',
title: '债权总额', title: '债权总额',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', props: { clearable: true } },
}, },
{ {
field: 'role', field: 'cpeDate',
title: '分配CPE日期', title: '分配CPE日期',
search: { el: 'date-picker', props: { type: 'date', valueFormat: 'YYYY-MM-DD' } }, search: { el: 'date-picker', props: { type: 'date', valueFormat: 'YYYY-MM-DD' } },
}, },
{ {
field: 'role', field: 'borrower.name',
title: '借款人姓名', title: '借款人姓名',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', key: 'borrowerName', props: { clearable: true } },
}, },
{ {
field: 'role', field: 'sumRepayAmount',
title: '已还总额', title: '已还总额',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', props: { clearable: true } },
}, },
{ {
field: 'role', field: 'borrower.idCard',
title: '身份证', title: '身份证',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', props: { clearable: true }, key: 'idCard' },
}, },
{ {
field: 'role', field: 'borrower.phone',
key: 'borrowerPhone',
title: '手机', title: '手机',
search: { el: 'input', props: { clearable: true } }, search: { el: 'input', props: { clearable: true } },
}, },
{ {
field: 'role', field: 'principalBalance',
title: '剩余本金', title: '剩余本金',
}, },
{ {
field: 'role', field: 'remaininginterest',
title: '剩余利息', title: '剩余利息',
}, },
{ {
field: 'role', field: 'commission',
title: '违约金', title: '违约金',
}, },
], ],
...@@ -154,7 +212,10 @@ ...@@ -154,7 +212,10 @@
}); });
const allocation = (row) => { const allocation = (row) => {
allocationModalRef.value.openModal(JSON.parse(JSON.stringify(row))); allocationModalRef.value.openModal(
JSON.parse(JSON.stringify(selectdList.value[0])),
JSON.parse(JSON.stringify(curParam.value))
);
}; };
const query = () => caseLRef.value?.search(); const query = () => caseLRef.value?.search();
......
<template>
<vxe-modal
v-model="showModal"
@hide="onHide"
title="分配成员"
width="900px"
show-maximize
show-footer
esc-closable
>
<div class="mb-1">
<el-button type="primary" @click="userModalRef?.openModal">新增成员</el-button>
<el-button type="danger" @click="handleRemove">删除成员</el-button>
</div>
<vxe-table ref="xTable" :data="tableData">
<vxe-column type="checkbox" width="50" />
<vxe-column field="username" title="用户账号" minWidth="120" />
<vxe-column field="nickName" title="昵称" minWidth="120" />
<vxe-column field="status" title="状态" width="120">
<template #default="{ row }">
<el-tag :type="row.status == 'enable' ? 'primary' : 'danger'">{{
row.status == 'enable' ? '启用' : '禁用'
}}</el-tag>
</template>
</vxe-column>
</vxe-table>
<template #footer>
<el-button type="default" @click="showModal = false">取消</el-button>
<el-button :loading="loading" type="primary" @click="submitForm">提交</el-button>
</template>
</vxe-modal>
<UserModal ref="userModalRef" @confirm="hanldeConfirm" />
</template>
<script setup name="AllocationUserModal">
import { ref } from 'vue';
import { ElMessage } from 'element-plus';
import { saveTenant } from '@/api/tenant';
import UserModal from '@/components/CommonModal/UserModal/index.vue';
const emits = defineEmits(['success']);
const xTable = ref(null);
const showModal = ref(false);
const userModalRef = ref(null);
const loading = ref(false);
const tableData = ref([]);
const currentRole = ref(null);
const submitForm = async () => {
try {
loading.value = true;
const params = {
...currentRole.value,
users: tableData.value.map((v) => ({ id: v.id })),
};
await saveTenant(params);
emits('success');
ElMessage({
type: 'success',
message: '设置成功!',
plain: true,
});
showModal.value = false;
} catch {}
loading.value = false;
};
const onHide = () => {
currentRole.value = null;
tableData.value = [];
};
const openModal = (role) => {
currentRole.value = role;
tableData.value = role.users;
showModal.value = true;
};
const hanldeConfirm = (rows) => {
tableData.value.unshift(...rows.filter((row) => !tableData.value.find((v) => v.id == row.id)));
};
const handleRemove = () => {
const checkedList = xTable.value.getCheckboxRecords();
if (!checkedList.length) {
return ElMessage({
type: 'warning',
message: '请选择有效数据!',
plain: true,
});
}
tableData.value = tableData.value.filter((row) => !checkedList.find((v) => v.id == row.id));
};
defineExpose({
openModal,
});
</script>
<template>
<vxe-modal
v-model="showModal"
:title="modalTitle"
@hide="onHide"
width="500px"
show-maximize
show-footer
esc-closable
>
<el-form ref="formRef" :model="form" :rules="rules" inline label-width="110px">
<el-row :gutter="10">
<el-col :span="24">
<el-form-item class="w-full" label="公司名称" prop="orgName">
<el-input v-model="form.orgName" placeholder="请输入公司名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="所属区域" prop="orgName">
<el-cascader v-model="form.arealist" class="w-full" :options="citydata" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="负责人手机" prop="offenderPhone">
<el-input v-model="form.offenderPhone" placeholder="负责人手机" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="负责人" prop="offender">
<el-input v-model="form.offender" placeholder="负责人" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="是否共案处理" prop="mergerCase">
<el-radio-group v-model="form.mergerCase">
<el-radio value="Y"></el-radio>
<el-radio value="N"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio value="enable">启用</el-radio>
<el-radio value="disable">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button type="default" @click="showModal = false">取消</el-button>
<el-button :loading="loading" type="primary" @click="submitForm">提交</el-button>
</template>
</vxe-modal>
</template>
<script setup name="tenantFormModal">
import { ref, computed } from 'vue';
import { ElMessage } from 'element-plus';
import { saveManageOrg } from '@/api/manageOrg';
import citydata from '../../../../assets/citydata';
const emits = defineEmits(['success']);
const currentTenant = ref(null);
const showModal = ref(false);
const formRef = ref(null);
const isEdit = computed(() => !!currentTenant.value);
const modalTitle = computed(() => (isEdit.value ? '编辑公司' : '新增公司'));
const form = ref({
arealist: [],
orgName: '',
offenderPhone: '',
offender: '',
mergerCase: 'N',
status: 'enable',
});
const rules = ref({
orgName: { required: true, message: '请输入公司名称', trigger: 'blur' },
offenderPhone: { required: true, message: '请输入负责人手机', trigger: 'blur' },
offender: { required: true, message: '请输入负责人', trigger: 'blur' },
});
const loading = ref(false);
const submitForm = async () => {
try {
await formRef.value.validate();
loading.value = true;
const params = JSON.parse(JSON.stringify(form.value));
if (params.arealist && params.arealist.length > 0) {
params['province'] = params.arealist[0];
params['city'] = params.arealist.length > 1 ? params.arealist[1] : null;
params['district'] = params.arealist.length > 2 ? params.arealist[2] : null;
delete params['arealist'];
}
await saveManageOrg(params);
emits('success');
ElMessage({
type: 'success',
message: isEdit.value ? '修改成功!' : '添加成功!',
plain: true,
});
showModal.value = false;
} catch {}
loading.value = false;
};
const onHide = () => {
form.value = {
arealist: [],
orgName: '',
offenderPhone: '',
offender: '',
mergerCase: 'N',
status: 'enable',
};
formRef.value.clearValidate();
currentTenant.value = null;
};
const openModal = (role) => {
role && (form.value = role);
form.value.arealist = role ? [role.province, role.city, role.district] : [];
console.log('role', role, form.value.arealist);
currentTenant.value = role;
showModal.value = true;
};
defineExpose({
openModal,
});
</script>
<template>
<div class="table-box">
<ProTable
ref="proTable"
:config="config"
:api="getManageOrgPage"
:paramCallback="paramCallback"
>
<template #left_buttons>
<el-button type="primary" :icon="Plus" @click="ManageOrgModalRef?.openModal()"
>新增</el-button
>
<el-button type="danger" :icon="Delete" @click="onDelete">删除</el-button>
</template>
</ProTable>
<ManageOrgFormModal ref="ManageOrgModalRef" @success="query" />
<AllocationUserModal ref="allocationUserModalRef" @success="query" />
</div>
</template>
<script setup lang="jsx" name="ManageOrg">
import { ref, reactive, onMounted } from 'vue';
import { Plus, Delete, Edit, Setting } from '@element-plus/icons-vue';
import { getManageOrgPage, deleteManageOrgs } from '@/api/manageOrg';
import ManageOrgFormModal from './components/ManageOrgFormModal.vue';
import AllocationUserModal from './components/AllocationUserModal.vue';
import { ElMessageBox, ElMessage, ElButton, ElTag } from 'element-plus';
import citydata from '../../../assets/citydata';
const proTable = ref(null);
const ManageOrgModalRef = ref(null);
const allocationUserModalRef = ref(null);
const config = reactive({
columns: [
{ type: 'checkbox', width: 50 },
{ field: 'id', title: '资管公司ID' },
{ field: 'orgName', title: '公司名称', search: { el: 'input' } },
{
field: 'arealist',
enum: citydata,
title: '所属区域',
fieldNames: { label: 'label', value: 'value' },
search: { el: 'cascader', props: { clearable: true } },
slots: {
default: ({ row }) => {
return (
<div>
{row.province}
{row.city ? '-' + row.city : ''}
{row.district ? '-' + row.district : ''}
</div>
);
},
},
},
{
field: 'maxStagesNum',
title: '是否共案处理',
slots: {
default: ({ row }) => {
return <ElTag>{row.mergerCase == 'Y' ? '是' : '否'}</ElTag>;
},
},
},
{ field: 'offender', title: '负责人', search: { el: 'input' } },
{ field: 'offenderPhone', title: '负责人手机', search: { el: 'input' } },
{
field: 'status',
title: '状态',
width: 80,
slots: {
default: ({ row }) => {
return (
<ElTag type={row.status == 'enable' ? 'primary' : 'danger'}>
{row.status == 'enable' ? '启用' : '禁用'}
</ElTag>
);
},
},
},
{ field: 'createBy', title: '创建人' },
{ field: 'createTime', title: '创建时间' },
{
width: 200,
title: '操作',
slots: {
default: ({ row }) => (
<>
<ElButton type="primary" link icon={Edit} onClick={() => handleEdit(row)}>
编辑
</ElButton>
{/* <ElButton
type="primary"
link
icon={Setting}
onClick={() =>
allocationUserModalRef.value.openModal(JSON.parse(JSON.stringify(row)))
}
>
设置成员
</ElButton> */}
</>
),
},
},
],
});
const paramCallback = (param) => {
const obj = JSON.parse(JSON.stringify(param));
if (obj.arealist && obj.arealist.length > 0) {
obj['province'] = obj.arealist[0];
obj['city'] = obj.arealist.length > 1 ? obj.arealist[1] : null;
obj['district'] = obj.arealist.length > 2 ? obj.arealist[2] : null;
delete obj['arealist'];
}
return obj;
};
const query = () => proTable.value?.search();
const handleEdit = (row) => ManageOrgModalRef.value.openModal(JSON.parse(JSON.stringify(row)));
const onDelete = async () => {
const list = proTable.value.element.getCheckboxRecords();
if (list.length > 0) {
await ElMessageBox.confirm('是否确认删除选中的数据?', '删除提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
const ids = list.map((v) => v.id).join(',');
await deleteManageOrgs(ids);
ElMessage.success({
message: '删除成功',
plain: true,
});
query();
}
};
onMounted(() => {
query();
});
</script>
<template>
<vxe-modal
v-model="showModal"
@hide="onHide"
title="分配成员"
width="900px"
show-maximize
show-footer
esc-closable
>
<div class="mb-1">
<el-button type="primary" @click="userModalRef?.openModal">新增成员</el-button>
<el-button type="danger" @click="handleRemove">删除成员</el-button>
</div>
<vxe-table ref="xTable" :data="tableData">
<vxe-column type="checkbox" width="50" />
<vxe-column field="username" title="用户账号" minWidth="120" />
<vxe-column field="nickName" title="昵称" minWidth="120" />
<vxe-column field="status" title="状态" width="120">
<template #default="{ row }">
<el-tag :type="row.status == 'enable' ? 'primary' : 'danger'">{{
row.status == 'enable' ? '启用' : '禁用'
}}</el-tag>
</template>
</vxe-column>
</vxe-table>
<template #footer>
<el-button type="default" @click="showModal = false">取消</el-button>
<el-button :loading="loading" type="primary" @click="submitForm">提交</el-button>
</template>
</vxe-modal>
<UserModal ref="userModalRef" @confirm="hanldeConfirm" />
</template>
<script setup name="AllocationUserModal">
import { ref } from 'vue';
import { ElMessage } from 'element-plus';
import { saveTenant } from '@/api/tenant';
import UserModal from '@/components/CommonModal/UserModal/index.vue';
const emits = defineEmits(['success']);
const xTable = ref(null);
const showModal = ref(false);
const userModalRef = ref(null);
const loading = ref(false);
const tableData = ref([]);
const currentRole = ref(null);
const submitForm = async () => {
try {
loading.value = true;
const params = {
...currentRole.value,
users: tableData.value.map((v) => ({ id: v.id })),
};
await saveTenant(params);
emits('success');
ElMessage({
type: 'success',
message: '设置成功!',
plain: true,
});
showModal.value = false;
} catch {}
loading.value = false;
};
const onHide = () => {
currentRole.value = null;
tableData.value = [];
};
const openModal = (role) => {
currentRole.value = role;
tableData.value = role.users;
showModal.value = true;
};
const hanldeConfirm = (rows) => {
tableData.value.unshift(...rows.filter((row) => !tableData.value.find((v) => v.id == row.id)));
};
const handleRemove = () => {
const checkedList = xTable.value.getCheckboxRecords();
if (!checkedList.length) {
return ElMessage({
type: 'warning',
message: '请选择有效数据!',
plain: true,
});
}
tableData.value = tableData.value.filter((row) => !checkedList.find((v) => v.id == row.id));
};
defineExpose({
openModal,
});
</script>
<template>
<vxe-modal
v-model="showModal"
:title="modalTitle"
@hide="onHide"
width="500px"
show-maximize
show-footer
esc-closable
>
<el-form ref="formRef" :model="form" :rules="rules" inline label-width="110px">
<el-row :gutter="10">
<el-col :span="24">
<el-form-item class="w-full" label="平台名称" prop="name">
<el-input v-model="form.name" placeholder="请输入平台名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="最大分期数" prop="maxStagesNum">
<el-input v-model="form.maxStagesNum" placeholder="最大分期数" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="最低分期金额" prop="minAmount">
<el-input v-model="form.minAmount" placeholder="最低分期金额" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio value="enable">启用</el-radio>
<el-radio value="disable">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button type="default" @click="showModal = false">取消</el-button>
<el-button :loading="loading" type="primary" @click="submitForm">提交</el-button>
</template>
</vxe-modal>
</template>
<script setup name="tenantFormModal">
import { ref, computed } from 'vue';
import { ElMessage } from 'element-plus';
import { savePlatform } from '@/api/platform';
const emits = defineEmits(['success']);
const currentTenant = ref(null);
const showModal = ref(false);
const formRef = ref(null);
const isEdit = computed(() => !!currentTenant.value);
const modalTitle = computed(() => (isEdit.value ? '编辑平台' : '新增平台'));
const form = ref({
name: '',
maxStagesNum: '',
minAmount: '',
status: 'enable',
});
const rules = ref({
name: { required: true, message: '请输入平台名称', trigger: 'blur' },
maxStagesNum: { required: true, message: '请输入最大分期数', trigger: 'blur' },
minAmount: { required: true, message: '请输入最低分期金额', trigger: 'blur' },
});
const loading = ref(false);
const submitForm = async () => {
try {
await formRef.value.validate();
loading.value = true;
await savePlatform(form.value);
emits('success');
ElMessage({
type: 'success',
message: isEdit.value ? '修改成功!' : '添加成功!',
plain: true,
});
showModal.value = false;
} catch {}
loading.value = false;
};
const onHide = () => {
form.value = {
name: '',
maxStagesNum: '',
minAmount: '',
status: 'enable',
};
formRef.value.clearValidate();
currentTenant.value = null;
};
const openModal = (role) => {
role && (form.value = role);
currentTenant.value = role;
showModal.value = true;
};
defineExpose({
openModal,
});
</script>
<template>
<div class="table-box">
<ProTable ref="proTable" :config="config" :api="getPlatformPage">
<template #left_buttons>
<el-button type="primary" :icon="Plus" @click="platformModalRef?.openModal()"
>新增</el-button
>
<el-button type="danger" :icon="Delete" @click="onDelete">删除</el-button>
</template>
</ProTable>
<platformFormModal ref="platformModalRef" @success="query" />
<AllocationUserModal ref="allocationUserModalRef" @success="query" />
</div>
</template>
<script setup lang="jsx" name="platformManage">
import { ref, reactive, onMounted } from 'vue';
import { Plus, Delete, Edit, Setting } from '@element-plus/icons-vue';
import { getPlatformPage, deletePlatforms } from '@/api/platform';
import platformFormModal from './components/platformFormModal.vue';
import AllocationUserModal from './components/AllocationUserModal.vue';
import { ElMessageBox, ElMessage, ElButton, ElTag } from 'element-plus';
const proTable = ref(null);
const platformModalRef = ref(null);
const allocationUserModalRef = ref(null);
const config = reactive({
columns: [
{ type: 'checkbox', width: 50 },
{ field: 'id', title: '借款平台ID' },
{ field: 'name', title: '平台名称', search: { el: 'input' } },
{ field: 'maxStagesNum', title: '分期最大期数', search: { el: 'input' } },
{ field: 'minAmount', title: '分期最低金额' },
{
field: 'status',
title: '状态',
width: 80,
slots: {
default: ({ row }) => {
return (
<ElTag type={row.status == 'enable' ? 'primary' : 'danger'}>
{row.status == 'enable' ? '启用' : '禁用'}
</ElTag>
);
},
},
},
{
width: 200,
title: '操作',
slots: {
default: ({ row }) => (
<>
<ElButton type="primary" link icon={Edit} onClick={() => handleEdit(row)}>
编辑
</ElButton>
{/* <ElButton
type="primary"
link
icon={Setting}
onClick={() =>
allocationUserModalRef.value.openModal(JSON.parse(JSON.stringify(row)))
}
>
设置成员
</ElButton> */}
</>
),
},
},
],
});
const query = () => proTable.value?.search();
const handleEdit = (row) => platformModalRef.value.openModal(JSON.parse(JSON.stringify(row)));
const onDelete = async () => {
const list = proTable.value.element.getCheckboxRecords();
if (list.length > 0) {
await ElMessageBox.confirm('是否确认删除选中的数据?', '删除提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
const ids = list.map((v) => v.id).join(',');
await deletePlatforms(ids);
ElMessage.success({
message: '删除成功',
plain: true,
});
query();
}
};
onMounted(() => {
query();
});
</script>
...@@ -56,6 +56,7 @@ export default defineConfig(({ command, mode }) => { ...@@ -56,6 +56,7 @@ export default defineConfig(({ command, mode }) => {
proxy: { proxy: {
'/api': { '/api': {
target: 'http://192.168.31.128:8080', target: 'http://192.168.31.128:8080',
// target: 'http://8.152.205.9:8080',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment