Commit 69669c30 authored by 沈翠玲's avatar 沈翠玲

修复管理

parent 8a263ea4
......@@ -140,3 +140,11 @@ export const getRepairApply = (params) => {
export const getRepairApplyTotal = (params) => {
return request.get('/RepairApply/flowStatusTotal', params);
};
// 修复下载审批
export const applyDownloadById = (params) => {
return request.get('/RepairApply/applyDownloadById', params);
};
// 修复下载申请
export const downLoadApplyStatusById = (params) => {
return request.get('/RepairApply/downLoadApplyStatusById', params);
};
\ No newline at end of file
......@@ -29,7 +29,7 @@
esc-closable
>
<div class="w-full px-3 h-full overflow-auto flex-col flex mytable">
是否审批通过申请人{{currentRow?.applyUser?.username}}于{{currentRow?.applyTime}}时提交的申请?
是否审批通过申请人{{currentRow?.applyUser?.username}}于{{currentRow?.applyTime}}时提交的{{currentRow?.downloadStatus === 'pending' ? '下载' : ''}}申请?
</div>
<template #footer>
<el-button type="default" @click="showModal = false">取消</el-button>
......@@ -44,7 +44,7 @@
import { computed } from 'vue';
import { onMounted } from 'vue';
import { reactive, ref } from 'vue';
import { getRepairApply,getRepairApplyTotal, RepairRecordStatusByIds } from '@/api/property';
import { getRepairApply,getRepairApplyTotal, RepairRecordStatusByIds, applyDownloadById, downLoadApplyStatusById } from '@/api/property';
import { ElMessageBox, ElMessage, ElButton } from 'element-plus';
import { getTenantPage } from '@/api/tenant';
import { useDict } from '@/hooks/useDict';
......@@ -53,7 +53,7 @@
import { getPlatformPage } from '@/api/platform';
import { VxeTextEllipsis, VxeTooltip } from 'vxe-pc-ui';
import { useAuthStore } from '@/stores/modules/auth';
const { PhoneResultStatus, ReduceType, FlowStatus, FollowStatus, CaseStatus } = useDict("PhoneResultStatus","ReduceType", "FlowStatus", "FollowStatus", "CaseStatus");
const { PhoneResultStatus, ReduceType, FlowStatus, FollowStatus, CaseStatus, DownLoadApplyStatus } = useDict("PhoneResultStatus","ReduceType", "FlowStatus", "FollowStatus", "CaseStatus", "DownLoadApplyStatus");
const downloadfile = inject('download');
const { authButtonListGet } = useAuthStore(); // 获取用户权限列表
......@@ -114,15 +114,24 @@
currentRow.value = row
showModal.value = true;
};
const query = () => caseLRef.value?.search();
const download = (row) => {
downloadfile('/RepairApply/download', {id: row.id}, '修复列表.xls');
}
const submitForm = async (type) => {
const ids = currentRow.value.id
await RepairRecordStatusByIds({
id: ids,
flowStatus: type,
});
if (currentRow.value.downloadStatus === 'pending') {
await downLoadApplyStatusById({
id: ids,
downLoadApplyStatus: type
})
} else {
await RepairRecordStatusByIds({
id: ids,
flowStatus: type,
});
}
ElMessage.success({
message: '审核成功',
......@@ -132,6 +141,25 @@
query();
};
const applyDownload = async (row) => {
await ElMessageBox.confirm(`是否申请修复申请标题为${row.title},申请人为${row.applyUser.username},申请时间为${row.applyTime}的下载权限?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
applyDownloadById({
id: row.id
})
ElMessage({
type: 'success',
message: '申请成功!',
plain: true,
});
setTimeout(() => {
query();
}, 500)
}
const config = reactive({
columns: [
......@@ -227,6 +255,24 @@
},
},
},
{
field: 'downloadStatus',
showOverflow: 'tooltip',
title: '下载审批状态',
width: 95,
enum: DownLoadApplyStatus,
// search: { el: 'select', props: { filterable: true }, labelWidth: 105 },
fieldNames: { label: 'label', value: 'value' },
slots: {
default: ({ row }) => {
return (
<>
{row.downloadStatus ? DownLoadApplyStatus.value?.find((v) => v.value === row.downloadStatus)?.label : ''}
</>
);
},
},
},
{
field: 'code',
title: '操作',
......@@ -242,13 +288,33 @@
</>
);
} else if (activeName.value === 'pass') {
return (
<>
<ElButton type="primary" onClick={() => download(row)}>
下载
</ElButton>
</>
);
if (row.downloadStatus === 'pass') {
return (
<>
<ElButton type="primary" onClick={() => download(row)}>
下载
</ElButton>
</>
);
} else {
if (row.downloadStatus === 'pending' && authButtonListGet.includes('allcation_for_tenant')) {
return (
<>
<ElButton type="primary" onClick={() => changeStatus(row)}>
下载审批
</ElButton>
</>
);
} else {
return (
<>
<ElButton type="primary" onClick={() => applyDownload(row)}>
下载申请
</ElButton>
</>
);
}
}
}
},
},
......@@ -257,7 +323,6 @@
onCheckboxChange: onCheckboxChange,
onCheckboxAll: onCheckboxAll,
});
const query = () => caseLRef.value?.search();
onMounted(() => {
query();
......
......@@ -938,6 +938,12 @@
);
};
const split = () => {
if(!recordData.value || recordData.value.length === 0) {
return ElMessage.warning({
message: '要先跟进后才可以申请分期',
plain: true,
});
}
splitDrawerRef.value.openModal(
JSON.parse(JSON.stringify(detail.value)),
JSON.parse(JSON.stringify(caseDetailConfig.data))
......
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