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

修复管理

parent 8a263ea4
...@@ -140,3 +140,11 @@ export const getRepairApply = (params) => { ...@@ -140,3 +140,11 @@ export const getRepairApply = (params) => {
export const getRepairApplyTotal = (params) => { export const getRepairApplyTotal = (params) => {
return request.get('/RepairApply/flowStatusTotal', 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 @@ ...@@ -29,7 +29,7 @@
esc-closable esc-closable
> >
<div class="w-full px-3 h-full overflow-auto flex-col flex mytable"> <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> </div>
<template #footer> <template #footer>
<el-button type="default" @click="showModal = false">取消</el-button> <el-button type="default" @click="showModal = false">取消</el-button>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import { reactive, ref } 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 { ElMessageBox, ElMessage, ElButton } from 'element-plus';
import { getTenantPage } from '@/api/tenant'; import { getTenantPage } from '@/api/tenant';
import { useDict } from '@/hooks/useDict'; import { useDict } from '@/hooks/useDict';
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
import { getPlatformPage } from '@/api/platform'; import { getPlatformPage } from '@/api/platform';
import { VxeTextEllipsis, VxeTooltip } from 'vxe-pc-ui'; import { VxeTextEllipsis, VxeTooltip } from 'vxe-pc-ui';
import { useAuthStore } from '@/stores/modules/auth'; 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 downloadfile = inject('download');
const { authButtonListGet } = useAuthStore(); // 获取用户权限列表 const { authButtonListGet } = useAuthStore(); // 获取用户权限列表
...@@ -114,15 +114,24 @@ ...@@ -114,15 +114,24 @@
currentRow.value = row currentRow.value = row
showModal.value = true; showModal.value = true;
}; };
const query = () => caseLRef.value?.search();
const download = (row) => { const download = (row) => {
downloadfile('/RepairApply/download', {id: row.id}, '修复列表.xls'); downloadfile('/RepairApply/download', {id: row.id}, '修复列表.xls');
} }
const submitForm = async (type) => { const submitForm = async (type) => {
const ids = currentRow.value.id const ids = currentRow.value.id
await RepairRecordStatusByIds({ if (currentRow.value.downloadStatus === 'pending') {
id: ids, await downLoadApplyStatusById({
flowStatus: type, id: ids,
}); downLoadApplyStatus: type
})
} else {
await RepairRecordStatusByIds({
id: ids,
flowStatus: type,
});
}
ElMessage.success({ ElMessage.success({
message: '审核成功', message: '审核成功',
...@@ -132,6 +141,25 @@ ...@@ -132,6 +141,25 @@
query(); 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({ const config = reactive({
columns: [ columns: [
...@@ -227,6 +255,24 @@ ...@@ -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', field: 'code',
title: '操作', title: '操作',
...@@ -242,13 +288,33 @@ ...@@ -242,13 +288,33 @@
</> </>
); );
} else if (activeName.value === 'pass') { } else if (activeName.value === 'pass') {
return ( if (row.downloadStatus === 'pass') {
<> return (
<ElButton type="primary" onClick={() => download(row)}> <>
下载 <ElButton type="primary" onClick={() => download(row)}>
</ElButton> 下载
</> </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 @@ ...@@ -257,7 +323,6 @@
onCheckboxChange: onCheckboxChange, onCheckboxChange: onCheckboxChange,
onCheckboxAll: onCheckboxAll, onCheckboxAll: onCheckboxAll,
}); });
const query = () => caseLRef.value?.search();
onMounted(() => { onMounted(() => {
query(); query();
......
...@@ -938,6 +938,12 @@ ...@@ -938,6 +938,12 @@
); );
}; };
const split = () => { const split = () => {
if(!recordData.value || recordData.value.length === 0) {
return ElMessage.warning({
message: '要先跟进后才可以申请分期',
plain: true,
});
}
splitDrawerRef.value.openModal( splitDrawerRef.value.openModal(
JSON.parse(JSON.stringify(detail.value)), JSON.parse(JSON.stringify(detail.value)),
JSON.parse(JSON.stringify(caseDetailConfig.data)) 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