Commit 806fa99e authored by 沈翠玲's avatar 沈翠玲

案件

parent 26ceefb6
......@@ -67,6 +67,10 @@ export const flowStatusByIds = (params) => {
export const savebyStages = (data) => {
return request.post('/byStages/save', data);
};
// 分期审批修改金额
export const changeAmount = (data) => {
return request.post('/byStages/changeAmount', data);
};
// 分期申请列表
export const getByStagesPage = (params) => {
return request.get('/byStages/page', params);
......
......@@ -50,6 +50,7 @@
<el-form-item class="w-full" label="分期申请时间:" prop="code">
<el-date-picker
v-model="form.applyDate"
disabled
class="w-full"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
......@@ -59,7 +60,7 @@
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="还款期数:" prop="name">
<el-select v-model="form.totalPeriod" placeholder="请选择" @change="changePeriod">
<el-select v-model="form.totalPeriod" disabled placeholder="请选择" @change="changePeriod">
<el-option
v-for="item in options"
:key="item.value"
......@@ -74,6 +75,7 @@
<el-form-item class="w-full" label="首期还款日:" prop="code">
<el-date-picker
@change="changePeriod"
disabled
class="w-full"
v-model="form.firstApplyDate"
format="YYYY-MM-DD"
......@@ -86,6 +88,7 @@
<el-form-item class="w-full" label="分期生效时间:" prop="code">
<el-date-picker
v-model="form.effectiveTime"
disabled
class="w-full"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
......@@ -98,6 +101,8 @@
<el-upload
:action="url"
:headers="{timeout:180000}"
v-model:file-list="form.images"
disabled
list-type="picture-card"
ref="mypictureRef"
class="mypicture"
......@@ -139,7 +144,8 @@
<template #footer>
<div style="flex: auto">
<el-button @click="showModal = false">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
<el-button type="primary" @click="submitForm('fail')">不通过</el-button>
<el-button type="primary" @click="submitForm('pass')">通过</el-button>
</div>
</template>
<el-dialog v-model="dialogVisible">
......@@ -152,7 +158,7 @@
import { computed } from 'vue';
import { reactive, ref } from 'vue';
import { ElInputNumber, ElMessage } from 'element-plus';
import { savebyStages } from '@/api/property';
import { changeAmount } from '@/api/property';
import { getByIdPlatforms } from '@/api/platform';
import { getAppEnvConfig } from '@/utils/env';
import Decimal from 'decimal.js';
......@@ -228,10 +234,10 @@
editFirst.value = !editFirst.value;
};
const handleFileSuccess1 = (response, file, fileList) => {
form.images.push({
url: response.message,
name: file.name,
});
if (file.uid) {
const item = form.images.find((v) => v.uid === file.uid);
item.url = envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + response.message;
}
};
const handleRemove1 = (uploadFile, uploadFiles) => {
const index = form.images.findIndex((v) => v.name === uploadFile.name);
......@@ -311,7 +317,6 @@
if (selectdList.value.length > 0) {
getPlatforms(selectdList.value[0].loanPlatform.id);
}
changePeriod();
};
const onCheckboxAll = (flag) => {
if (flag.checked) {
......@@ -336,7 +341,7 @@
const config = reactive({
checkboxConfig: {
checkMethod: ({ row }) => {
return props.mergerCase !== 'Y';
return false;
},
},
minHeight: 200,
......@@ -378,8 +383,6 @@
showOverflow: 'tooltip',
},
],
onCheckboxChange: onCheckboxChange,
onCheckboxAll: onCheckboxAll,
toolbarConfig: { enabled: false },
});
const splitconfig = computed(() => {
......@@ -435,7 +438,8 @@
dialogImageUrl.value = uploadFile.url;
dialogVisible.value = true;
};
const openModal = (detail, caselist) => {
const openModal = (detail) => {
const caselist = detail.loans
showModal.value = true;
editFirst.value = false;
currentDetail.value = detail;
......@@ -444,6 +448,12 @@
form.images = [];
mypictureRef.value?.clearFiles()
form.remainingAmount = 0;
form.images = detail.images
? detail.images.map((v) => ({
name: v.slice(v.lastIndexOf('/') + 1, v.length),
url: envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/' + v,
}))
: [];
caselist.forEach((item) => {
const remainingAmount = Decimal(Number(item.remainingAmount) || 0).sub(
Decimal(Number(item.sumReductionAmount) || 0)
......@@ -451,6 +461,7 @@
form.totalRepayAmount = Decimal(form.totalRepayAmount).add(Decimal(remainingAmount));
form.remainingAmount = Decimal(form.remainingAmount).add(Decimal(remainingAmount));
});
splitdata.value = detail.byStagesRecords;
tabledata.value = caselist;
setTimeout(() => {
if (ProTableRef.value.element) {
......@@ -462,10 +473,10 @@
}
}
}, 500);
changePeriod();
};
const emits = defineEmits(['success']);
const submitForm = () => {
const submitForm = (type) => {
let images = JSON.parse(JSON.stringify(form.images.map((v) => v.url)));
if (editFirst.value)
return ElMessage.warning({
message: '修改分期数值后要确认',
......@@ -477,19 +488,21 @@
message: '分期金额要大于借款平台的分期最低金额',
plain: true,
});
images = images.map((v) => {
return v.replace(envs.VITE_GLOB_API_URL_PREFIX + '/sys/static/', '');
});
const params = {
...currentDetail.value,
...form,
images: form.images.map((v) => v.url)?.length > 0 ? form.images.map((v) => v.url) : null,
images: images.length > 0 ? images : null,
byStagesRecords: splitdata.value,
loans: selectdList.value,
flowStatus: 'pending',
id: null,
flowStatus: type
};
savebyStages(params).then((res) => {
changeAmount(params).then((res) => {
if (res.success) {
ElMessage.success({
message: '保存成功',
message: '审批成功',
plain: true,
});
showModal.value = false;
......
......@@ -129,11 +129,16 @@
<el-button type="primary" @click="submitForm('pass')">通过</el-button>
</template>
</vxe-modal>
<splitDrawer
ref="splitDrawerRef"
@success="query"
></splitDrawer>
<el-image-viewer :url-list="srcList" v-if="RefImage" @close="RefImage = false" />
</div>
</template>
<script setup name="systemLog" lang="jsx">
import splitDrawer from './components/splitDrawer.vue';
import { computed } from 'vue';
import { reactive, ref } from 'vue';
import { getByStagesPage, byStagesflowStatusByIds } from '@/api/property';
......@@ -154,6 +159,7 @@
console.log('row', row);
selectdList.value = row.records;
};
const splitDrawerRef = ref();
const onCheckboxAll = (flag) => {
if (flag.checked) {
selectdList.value = flag.records;
......@@ -192,7 +198,14 @@
toolbarConfig: { enabled: false },
});
const changeStatus = async () => {
showModal.value = true;
if (selectdList.value.length > 1) {
showModal.value = true;
} else {
splitDrawerRef.value.openModal(
JSON.parse(JSON.stringify(selectdList.value[0]))
);
}
};
const submitForm = async (type) => {
const ids = selectdList.value.map((v) => v.id).join(',');
......
......@@ -933,6 +933,17 @@
title: '累计还款金额',
showOverflow: 'tooltip',
},
{
field: 'repayStatus',
title: '还款状态',
showOverflow: 'tooltip',
width: 80,
slots: {
default: ({ row }) => {
return <div>{row.repayStatus == 'over' ? '已还款' : '待还款'}</div>;
},
},
},
{
field: 'remainingAmount',
title: '剩余待还金额',
......
......@@ -137,6 +137,17 @@
showOverflow: 'tooltip',
width: 80,
},
{
field: 'repayStatus',
title: '还款状态',
showOverflow: 'tooltip',
width: 80,
slots: {
default: ({ row }) => {
return <div>{row.repayStatus == 'over' ? '已还款' : '待还款'}</div>;
},
},
},
{
field: 'commissionAmount',
title: '委案金额',
......
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