|
|
@@ -89,6 +89,7 @@
|
|
|
:multiple="true"
|
|
|
:custom-request="(options: any) => annexCustomRequest(item.id, options)"
|
|
|
:before-upload="beforeAnnexUpload"
|
|
|
+ @remove="(file: any) => handleAnnexRemove(item.id, file)"
|
|
|
@update:file-list="(list: any) => setAnnexFileList(item.id, list)"
|
|
|
>
|
|
|
<template #itemRender="{ originNode, file }">
|
|
|
@@ -311,7 +312,7 @@ const tailFormOptionsBase: IDynamicFormOptions = {
|
|
|
name: 'inheritorSign',
|
|
|
type: 'sign',
|
|
|
additionalProps: {
|
|
|
- upload: signUploadCo,
|
|
|
+ uploadCo: signUploadCo,
|
|
|
} as SignProps,
|
|
|
},
|
|
|
],
|
|
|
@@ -478,6 +479,40 @@ function promptAnnexDesc(initialDesc: string, title: string) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+async function handleAnnexRemove(itemId: number, file: any): Promise<boolean> {
|
|
|
+ if (file?.status !== 'done')
|
|
|
+ return true;
|
|
|
+ const res = file?.response ?? {};
|
|
|
+ const annexId = Number(res.id ?? file.uid);
|
|
|
+ if (!annexId) {
|
|
|
+ message.warning('附件信息不完整,无法删除');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确认删除',
|
|
|
+ content: '确定要删除该佐证材料吗?',
|
|
|
+ okText: '删除',
|
|
|
+ okType: 'danger',
|
|
|
+ cancelText: '取消',
|
|
|
+ async onOk() {
|
|
|
+ try {
|
|
|
+ await AssessmentContentApi.delAnnex(annexId);
|
|
|
+ await loadAnnexListByItem(itemId);
|
|
|
+ message.success('删除成功');
|
|
|
+ resolve(true);
|
|
|
+ } catch (err) {
|
|
|
+ message.error(err instanceof Error ? err.message : String(err));
|
|
|
+ resolve(false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ resolve(false);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
async function editAnnexDesc(itemId: number, file: any, isAfterUpload = false) {
|
|
|
const formId = props.currentForm.id;
|
|
|
if (!formId)
|