zhengyiming
2 天以前 1b3d015ebf23534ed2911be8e7ae552793ebfb66
src/views/ProtocolManage/EditTemplate.vue
@@ -181,11 +181,15 @@
        showDownloadBtn: false,
        formatter: (row: API.GetEnterpriseContractTemplatesQueryResultItem) => setOSSLink(row.file),
      },
      isAutoSign: {
        formatter: (row: API.GetEnterpriseContractTemplatesQueryResultItem) =>
          row.isAutoSign ? '是' : '否',
      },
    },
  }
);
const { dialogProps, handleEdit, handleAdd, editForm } = useFormDialog({
const { dialogProps, handleEdit, handleAdd, editForm, dialogState } = useFormDialog({
  onConfirm: handleAddOrEdit,
  defaultFormParams: {
    id: '',
@@ -197,7 +201,11 @@
    title: '新增模板',
    isEnterpriseUserCreated: false,
    templateEditData: '',
    enterpriseId: '',
    isAutoSign: false,
    autoSignPowerAttorneyUrl: [] as UploadUserFile[],
  },
  closeAfterConfirm: false,
});
async function openDialog(row?: API.GetEnterpriseContractTemplatesQueryResultItem) {
@@ -213,6 +221,9 @@
        access: row.access,
        isEnterpriseUserCreated: detail.isEnterpriseUserCreated,
        templateEditData: detail.templateEditData,
        isAutoSign: detail.isAutoSign ?? false,
        autoSignPowerAttorneyUrl: convertApi2FormUrlOnlyOne(detail.autoSignPowerAttorneyUrl),
        enterpriseId: enterpriseId,
      });
    } else {
      handleAdd();
@@ -231,6 +242,7 @@
      code: editForm.code,
      access: editForm.access,
      templateId: editForm.templateId,
      autoSignPowerAttorneyUrl: editForm.autoSignPowerAttorneyUrl?.[0]?.path ?? '',
      templateEditData: JSON.stringify(
        pdfToImage.map(
          (x) =>
@@ -242,6 +254,11 @@
        )
      ),
    };
    if (editForm.access === EnumElectronSignAccess.BestSign) {
      params.isAutoSign = editForm.isAutoSign;
    } else {
      params.isAutoSign = false;
    }
    if (isEdit) {
      params.id = editForm.id;
    }
@@ -249,8 +266,11 @@
    if (res) {
      Message.successMessage('操作成功');
      getList();
      dialogState.dialogVisible = false;
    }
  } catch (error) {}
  } catch (error) {
    dialogState.dialogVisible = true;
  }
}
function handleDownload(row: API.GetEnterpriseContractTemplatesQueryResultItem) {