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);
};
<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