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

资产分配

parent d93d2ff5
......@@ -15,6 +15,10 @@ export const getLoanpage = (params) => {
export const distributeLoan = (tenantId, data) => {
return request.post(`/LoanDistribute/distribute?tenantId=${tenantId}`, data);
};
// 手动调整分配CPE,确认
export const confirm = (data) => {
return request.post(`/LoanDistribute/confirm`, data);
};
// 系统自动分配; 分配到CPE
export const distributeCpe = (data) => {
return request.post(`/LoanDistribute/distributeCpe?type=${data.type}`, data);
......
......@@ -18,9 +18,15 @@
</div>
<template v-if="radio === 0 || radio === 1">
<div class="mainContent">
<div class="tree-wrapper">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" />
<div class="flex items-center my-3">
<span class="mr-2">
{{radio === 0 ? '调解中心' : '分配到调解中心的cpe'}}
</span>
<el-select v-model="currentTenant" placeholder="请选择调解中心" style="width: 210px" @change="handleNodeClick">
<el-option :label="item.name" :value="item.id" v-for="(item,index) in data" :key="index" />
</el-select>
</div>
<!-- <el-transfer
v-model="value1"
:data="data1"
......@@ -30,7 +36,7 @@
/> -->
</div>
</template>
<div class="top" v-if="radio === 0 || (radio === 1 && currentTenant.id)">
<div class="top" v-if="radio === 0 || (radio === 1 && currentTenant)">
<div class="number-box">
<div class="number-left">
<div class="icon-wrapper">
......@@ -65,7 +71,7 @@
</div>
</div>
</div>
<template v-if="radio === 1 && currentTenant.id">
<template v-if="radio === 1 && currentTenant">
<p class="my-2">分配方案</p>
<div class="idea-box">
<div class="left-idea">
......@@ -99,8 +105,11 @@
</div>
</div>
<template #footer>
<el-button type="primary" @click="saveFrom" :disabled="!currentTenant" v-if="radio === 1"
>保存</el-button
>
<el-button type="default" @click="showModal = false">取消</el-button>
<el-button type="primary" @click="submitForm" :disabled="!currentTenant.id"
<el-button type="primary" @click="submitForm" :disabled="!currentTenant || (radio === 1 && !SaveBol)"
>确认提交</el-button
>
</template>
......@@ -114,6 +123,7 @@
import {
getLoanDistribute,
distributeLoan,
confirm,
distributeCpe,
changeDistributeCpe,
} from '@/api/allcation';
......@@ -125,25 +135,25 @@
const data = ref([]);
const mytransfer = ref();
const tabledata = ref([]);
const SaveBol = ref(false);
const showModal = ref(false);
const currentInfo = ref({});
const currentTenant = ref({});
const currentTenant = ref();
const statisis = ref({});
const currentAllBtn = ref();
const editRowIndex = ref(-1);
const pageParams = ref({});
const radio = ref(null);
const step = ref(0);
const searchParam = ref();
const onHide = () => {
currentInfo.value = {};
};
const getStatisis = (params, id) => {
const p = JSON.parse(JSON.stringify(params));
if (id) {
p['tenentId'] = id;
p['tenantId'] = id;
}
delete p['current']
delete p['size']
getLoanDistribute(p).then((res) => {
if (res.success) {
statisis.value = res.result;
......@@ -165,24 +175,12 @@
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,
borrowerName: pageParams.value.borrowerName,
borrowerIdCard: pageParams.value.idCard,
borrowerPhone: pageParams.value.borrowerPhone,
commissionAmount: pageParams.value.commissionAmount,
remainingAmount: pageParams.value.remainingAmount,
tenantId: currentTenant.value,
}).then((res) => {
if (res.success) {
tabledata.value = res.result;
......@@ -191,24 +189,22 @@
};
const changeRadio = () => {
radio.value === 0 && getStatisis(pageParams.value);
currentTenant.value = {};
currentTenant.value = null;
};
const openModal = (info, param) => {
const openModal = (param) => {
showModal.value = true;
currentInfo.value = info;
console.log('currentInfo.value', currentInfo.value);
pageParams.value = param;
currentAllBtn.value = null
getTree();
step.value = 0;
currentTenant.value = {};
SaveBol.value = false
currentTenant.value = null;
editRowIndex.value = -1;
};
const backform = () => {
step.value = 0;
};
const submitForm = () => {
if (step.value || radio.value === 0) {
if (step.value) {
const saveFrom = () => {
if (currentAllBtn.value === 'CASE') {
const sum = tabledata.value.reduce((pre, cur) => pre + cur.caseNum, 0);
if (Number(sum) !== Number(statisis.value.unCaseNum))
......@@ -227,6 +223,25 @@
changeDistributeCpe({
records: tabledata.value,
distributeType: currentAllBtn.value,
}).then((res) => {
if (res.success) {
ElMessage.success({
message: '保存成功',
plain: true,
});
SaveBol.value = true
}
});
}
const submitForm = () => {
if (radio.value === 1){
if (!SaveBol.value) ElMessage.warning({
message: '要先保存',
plain: true,
});
confirm({
records: tabledata.value,
distributeType: currentAllBtn.value,
}).then((res) => {
if (res.success) {
ElMessage.success({
......@@ -237,26 +252,15 @@
emits('success');
}
});
} 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,
} else if (radio.value === 0){
// chooseIdea('BORROWER');
distributeLoan(currentTenant.value, {
borrowerName: pageParams.value.borrowerName,
borrowerIdCard: pageParams.value.idCard,
borrowerPhone: pageParams.value.borrowerPhone,
commissionAmount: pageParams.value.commissionAmount,
remainingAmount: pageParams.value.remainingAmount,
tenantId: currentTenant.value,
}).then((res) => {
if (res.success) {
ElMessage.success({
......@@ -268,18 +272,13 @@
}
});
}
} else {
// chooseIdea('BORROWER');
step.value = 1;
}
};
const handleNodeClick = (data) => {
console.log('data11111', data);
currentTenant.value = data;
const handleNodeClick = () => {
const item = data.value.find(v => v.id === currentTenant.value)
if (radio.value === 0) {
} else {
getStatisis(pageParams.value, data.id);
tabledata.value = data.users.map((v) => ({
getStatisis(pageParams.value, currentTenant.value);
tabledata.value = item.users.map((v) => ({
cpe: v,
borrowerNum: null,
caseNum: null,
......@@ -483,11 +482,6 @@
}
.mainContent {
display: flex;
.tree-wrapper {
border: 1px solid #ebeef5;
width: 290px;
height: 318px;
}
:deep(.el-transfer-panel .el-transfer-panel__header) {
border-top-left-radius: 0;
background: #fff;
......
......@@ -22,7 +22,6 @@
<template #left_buttons>
<el-button
type="primary"
:disabled="!selectdList || selectdList.length !== 1"
@click="allocation"
>分配
</el-button>
......@@ -239,7 +238,6 @@
const allocation = (row) => {
allocationModalRef.value.openModal(
JSON.parse(JSON.stringify(selectdList.value[0])),
JSON.parse(JSON.stringify(curParam.value))
);
};
......
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