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

修复管理

parent 647a7c43
......@@ -126,9 +126,17 @@ export const importExcel = (params) => {
};
// 修复记录批量审批
export const RepairRecordStatusByIds = (params) => {
return request.get('/RepairRecord/flowStatusByIds', params);
return request.get('/RepairApply/flowStatusById', params);
};
// 发起修复
export const sendRepairRecord = (params) => {
return request.get('/RepairRecord/sendRepairRecord', params);
};
// 修复审批列表
export const getRepairApply = (params) => {
return request.get('/RepairApply/page', params);
};
// 修复统计
export const getRepairApplyTotal = (params) => {
return request.get('/RepairApply/flowStatusTotal', params);
};
......@@ -17,18 +17,7 @@
</el-tab-pane>
</el-tabs>
</div>
<ProTable :config="config" ref="caseLRef" :api="getRepairRecord" :paramCallback="paramCallback" :selectdList="selectdList">
<template #left_buttons>
<!-- <el-button type="primary">下载申请 </el-button> -->
<el-button
type="primary"
@click="changeStatus"
:disabled="!selectdList || !selectdList.length"
>审批
</el-button>
<!-- <el-button type="primary">下载 </el-button>
<el-button type="primary">批量修复上传 </el-button> -->
</template>
<ProTable :config="config" ref="caseLRef" :api="getRepairApply" :paramCallback="paramCallback">
</ProTable>
<vxe-modal
resize
......@@ -40,7 +29,7 @@
esc-closable
>
<div class="w-full px-3 h-full overflow-auto flex-col flex mytable">
是否审批通过选中的数据
是否审批通过申请人{{currentRow?.applyUser?.username}}于{{currentRow?.applyTime}}时提交的申请
</div>
<template #footer>
<el-button type="default" @click="showModal = false">取消</el-button>
......@@ -55,14 +44,16 @@
import { computed } from 'vue';
import { onMounted } from 'vue';
import { reactive, ref } from 'vue';
import { getRepairRecord,getRepairRecordTotal, RepairRecordStatusByIds } from '@/api/property';
import { getRepairApply,getRepairApplyTotal, RepairRecordStatusByIds } from '@/api/property';
import { ElMessageBox, ElMessage, ElButton } from 'element-plus';
import { getTenantPage } from '@/api/tenant';
import { useDict } from '@/hooks/useDict';
import { inject } from 'vue';
import citydata from '../../../assets/citydata';
import { getPlatformPage } from '@/api/platform';
import { VxeTextEllipsis, VxeTooltip } from 'vxe-pc-ui';
const { PhoneResultStatus, ReduceType, FlowStatus, FollowStatus, CaseStatus } = useDict("PhoneResultStatus","ReduceType", "FlowStatus", "FollowStatus", "CaseStatus");
const downloadfile = inject('download');
const tabledata = ref([]);
const showModal = ref(false);
......@@ -70,6 +61,7 @@
const activeName = ref('pending');
const caseLRef = ref();
const selectdList = ref([]);
const currentRow = ref();
const onCheckboxChange = (row) => {
console.log('row', row);
selectdList.value = row.records;
......@@ -89,32 +81,14 @@
const paramCallback = (param) => {
const obj = JSON.parse(JSON.stringify(param));
obj['flowStatus'] = activeName.value;
if (obj.arealist && obj.arealist.length > 0) {
const domicileProvince = []
const domicileCity = []
const area = []
obj.arealist.forEach(item => {
domicileProvince.push(item[0])
if (item.length > 1) {
domicileCity.push(item[1])
}
if (item.length > 2) {
area.push(item[2])
}
})
obj['domicileProvince'] = domicileProvince
obj['domicileCity'] = domicileCity
obj['area'] = area
delete obj['arealist'];
}
if (obj['importTime']) {
if (obj['importTime'][0]) obj['importTimeBegin'] = obj['importTime'][0];
if (obj['importTime'][1]) obj['importTimeEnd'] = obj['importTime'][1];
delete obj['importTime'];
if (obj['applyTime']) {
if (obj['applyTime'][0]) obj['applyTimeBegin'] = obj['applyTime'][0];
if (obj['applyTime'][1]) obj['applyTimeEnd'] = obj['applyTime'][1];
delete obj['applyTime'];
}
setTimeout(() => {
const arr = JSON.parse(JSON.stringify(FlowStatus.value))
getRepairRecordTotal({...obj, flowStatus: null}).then(res => {
getRepairApplyTotal({...obj, flowStatus: null}).then(res => {
if (res.success) {
arr.forEach(item => {
const tt = res.result.find(v => v.flowStatus === item.value)
......@@ -134,13 +108,17 @@
}, 500)
return obj;
};
const changeStatus = async () => {
const changeStatus = async (row) => {
currentRow.value = row
showModal.value = true;
};
const download = (row) => {
downloadfile('/RepairApply/download', {id: row.id}, '修复列表.xls');
}
const submitForm = async (type) => {
const ids = selectdList.value.map((v) => v.id).join(',');
const ids = currentRow.value.id
await RepairRecordStatusByIds({
ids: ids,
id: ids,
flowStatus: type,
});
......@@ -155,10 +133,9 @@
const config = reactive({
columns: [
{ type: 'checkbox', width: 60, fixed: 'left' },
{
field: 'borrower.name',
title: '借款人姓名',
field: 'title',
title: '修复申请标题',
showOverflow: 'tooltip',
width: 120,
// search: {
......@@ -169,123 +146,22 @@
// },
},
{
field: 'borrower.idCard',
title: '借款人身份证',
field: 'applyUser.username',
title: '申请人',
showOverflow: 'tooltip',
width: 140,
// search: {
// el: 'input',
// props: { clearable: true },
// key: 'borrowerIdCard',
// labelWidth: 105,
// },
},
{
field: 'loanPlatform.name',
showOverflow: 'tooltip',
visible: false,
enum: () => getPlatformPage({ current: 1, size: 999999999, status: 'enable' }),
search: { el: 'select', props: { filterable: true }, key: 'loanPlatform', labelWidth: 105 },
fieldNames: { label: 'name', value: 'id' },
title: '借款平台',
width: 100,
},
{
field: 'commissionAmount',
title: '委案金额',
visible: false,
showOverflow: 'tooltip',
width: 80,
search: { render: ({ searchParam }) => {
return (
<div class="flex">
<el-input vModel_trim={searchParam.commissionAmountBegin} placeholder="" />
<span class="mr-1 ml-1">-</span>
<el-input vModel_trim={searchParam.commissionAmountEnd} placeholder="" />
</div>
);
}, props: { clearable: true }, labelWidth: 105 },
},
{
field: 'borrower.age',
title: '年龄',
showOverflow: 'tooltip',
width: 80,
search: { render: ({ searchParam }) => {
return (
<div class="flex">
<el-input vModel_trim={searchParam.ageBegin} placeholder="" />
<span class="mr-1 ml-1">-</span>
<el-input vModel_trim={searchParam.ageEnd} placeholder="" />
</div>
);
}, props: { clearable: true }, labelWidth: 105 },
},
{
field: 'arealist',
enum: citydata,
title: '所属区域',
showOverflow: 'tooltip',
width: 160,
fieldNames: { label: 'label', value: 'value' },
search: { el: 'cascader', props: { clearable: true, checkStrictly: true, multiple: true, 'collapse-tags': true }, labelWidth: 105 },
slots: {
default: ({ row }) => {
return (
<VxeTooltip
content={
row.borrower.domicileProvince +
(row.borrower.domicileCity ? '-' + row.borrower.domicileCity : '') +
(row.borrower.area ? '-' + row.borrower.area : '')
}
>
<VxeTextEllipsis
content={
row.borrower.domicileProvince +
(row.borrower.domicileCity ? '-' + row.borrower.domicileCity : '') +
(row.borrower.area ? '-' + row.borrower.area : '')
}
></VxeTextEllipsis>
</VxeTooltip>
);
},
},
},
{
field: 'importTime',
title: '时间',
showOverflow: 'tooltip',
width: 130,
visible: false,
search: {
el: 'date-picker',
props: { type: 'daterange', valueFormat: 'YYYY-MM-DD' },
labelWidth: 105,
},
},
{
field: 'oldPhone',
title: '修复前联系方式',
showOverflow: 'tooltip',
// width: 140,
search: {
el: 'input',
props: { clearable: true },
key: 'oldPhone',
key: 'applyUser',
labelWidth: 105,
},
},
{
field: 'newPhone',
title: '修复后联系方式',
field: 'repairUser.username',
title: '审核人',
showOverflow: 'tooltip',
// width: 140,
search: {
el: 'input',
props: { clearable: true },
key: 'newPhone',
labelWidth: 105,
},
width: 140
},
{
showOverflow: 'tooltip',
......@@ -303,8 +179,8 @@
width: 100,
},
{
field: 'kinship',
title: '与债权人关系',
field: 'repairNum',
title: '修复申请人数',
showOverflow: 'tooltip',
// width: 140,
// search: {
......@@ -315,18 +191,21 @@
// },
},
{
field: 'repairStatus',
title: '是否修复',
field: 'applyTime',
title: '申请时间',
showOverflow: 'tooltip',
slots: {
default: ({ row }) => {
return (
<>
{row.repairStatus === 'Y' ? '是' : '否'}
</>
);
width: 140,
search: {
el: 'date-picker',
props: { type: 'daterange', valueFormat: 'YYYY-MM-DD' },
labelWidth: 105,
},
},
{
field: 'repairTime',
title: '审核时间',
showOverflow: 'tooltip',
width: 140,
},
{
field: 'flowStatus',
......@@ -346,6 +225,32 @@
},
},
},
{
field: 'code',
title: '操作',
width: 120,
slots: {
default: ({ row, rowIndex }) => {
if (activeName.value === 'pending') {
return (
<>
<ElButton type="primary" onClick={() => changeStatus(row)}>
审批
</ElButton>
</>
);
} else if (activeName.value === 'pass') {
return (
<>
<ElButton type="primary" onClick={() => download(row)}>
下载
</ElButton>
</>
);
}
},
},
}
],
onCheckboxChange: onCheckboxChange,
onCheckboxAll: onCheckboxAll,
......
<template>
<div class="table-box">
<div class="table-inner">
<ProTable :config="config" ref="caseLRef" :paramCallback="paramCallback" :api="getRepairRecord">
<ProTable :config="config" ref="caseLRef" :paramCallback="paramCallback" :selectdList="selectdList" :api="getRepairRecord">
<template #left_buttons>
<div class="flex items-center justify-center h-8">
<div class="flex rounded w-full h-11 items-center pl-2 btn-grp mb-1">
<el-dropdown @command="(command) => dataValue = command">
<span class="el-dropdown-link">
{{dataValue}}
<el-icon class="el-icon--right">
<arrow-down />
</el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item v-for="item in dataOptions" :key="item.value" :command="item.value">{{item.label}}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button
type="primary"
@click="repair"
>发起修复</el-button
>
<el-button
v-permission="'repair_admin_export'"
type="primary"
@click="admindownload"
class="mb-2 mr-2"
>导出</el-button
class="mr-3"
>导出全部</el-button
>
<el-button
<!-- <el-button
v-permission="'repair_te_export'"
type="primary"
class="mb-2 mr-2"
@click="download"
>导出</el-button
>
> -->
<el-upload
class="avatar-uploader"
ref="uploadRef"
......@@ -31,7 +49,7 @@
:auto-upload="true"
:on-progress="uploadVideoProcess"
>
<el-button type="primary" plain :icon="Upload">批量修复上传</el-button>
<el-button type="primary" class="mt-2" plain :icon="Upload">批量修复上传</el-button>
</el-upload>
</div>
</template>
......@@ -46,11 +64,12 @@
import { reactive, ref } from 'vue';
import { getRepairRecord, importExcel } from '@/api/property';
import { Upload } from '@element-plus/icons-vue';
import { ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getTenantPage } from '@/api/tenant';
import citydata from '../../../assets/citydata';
import { getPlatformPage } from '@/api/platform';
import { VxeTextEllipsis, VxeTooltip } from 'vxe-pc-ui';
import { sendRepairRecord } from '@/api/property';
const uploadRef = ref();
......@@ -58,9 +77,23 @@
import { onMounted } from 'vue';
import { inject } from 'vue';
const downloadfile = inject('download');
const selectdList = ref([]);
const router = useRouter();
const pageParams = ref({});
const envs = getAppEnvConfig();
import { useDict } from '@/hooks/useDict';
const dataValue = ref('对查询结果操作');
const dataOptions = [
{
label: '对查询结果操作',
value: '对查询结果操作',
},
{
label: '对选中项操作',
value: '对选中项操作',
}
];
const { PhoneResultStatus, ReduceType, FlowStatus, FollowStatus, AuditStatus, CaseStatus } = useDict("PhoneResultStatus","ReduceType", "FlowStatus", "FollowStatus","AuditStatus", "CaseStatus");
const onCellClick = (row) => {
router.push({
......@@ -68,6 +101,16 @@
query: { id: row.id }, //这里不能直接写成 query: JSON.stringify(item)
});
};
const onCheckboxChange = (row) => {
selectdList.value = row.records;
};
const onCheckboxAll = (flag) => {
if (flag.checked) {
selectdList.value = flag.records;
} else {
selectdList.value = [];
}
};
const paramCallback = (param) => {
console.log('objobj', param)
const obj = JSON.parse(JSON.stringify(param));
......@@ -94,6 +137,7 @@
if (obj['importTime'][1]) obj['importTimeEnd'] = obj['importTime'][1];
delete obj['importTime'];
}
pageParams.value = obj
return obj;
};
const upload = reactive({
......@@ -143,9 +187,43 @@
const handleRemove = () => {
form.path = '';
};
const repair = async (row) => {
const list = selectdList.value;
if (dataValue.value === '对选中项操作' && (!selectdList.value || !selectdList.value.length)) {
return ElMessage.warning({
message: '请先选择操作对象!',
plain: true,
});
}
if (dataValue.value !== '对选中项操作') {
const param = {...pageParams.value}
delete param['current'];
delete param['size'];
await ElMessageBox.confirm('是否批量发起修复?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
await sendRepairRecord(param);
} else {
const ids = list.map((v) => v.id).join(',');
await ElMessageBox.confirm('是否批量发起修复?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
await sendRepairRecord({recordIds: ids});
}
ElMessage({
type: 'success',
message: '修复申请发起成功!',
plain: true,
});
query();
};
const config = reactive({
columns: [
{ type: 'checkbox', title: '', width: 60, fixed: 'left' },
{
field: 'borrower.name',
title: '借款人姓名',
......@@ -344,26 +422,10 @@
// key: 'newPhone',
// labelWidth: 105,
// },
},
{
field: 'flowStatus',
showOverflow: 'tooltip',
title: '审核状态',
width: 95,
enum: FlowStatus,
search: { el: 'select', props: { filterable: true }, labelWidth: 105 },
fieldNames: { label: 'label', value: 'value' },
slots: {
default: ({ row }) => {
return (
<>
{row.flowStatus ? FlowStatus.value?.find((v) => v.value === row.flowStatus)?.label : ''}
</>
);
},
},
},
}
],
onCheckboxChange: onCheckboxChange,
onCheckboxAll: onCheckboxAll
});
......
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