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

案件

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