法务回调审批样例

This commit is contained in:
2026-06-09 09:20:30 +08:00
parent 974f6c7a5b
commit 99187a7c8d
3 changed files with 103 additions and 5 deletions
+76 -5
View File
@@ -110,9 +110,10 @@
<a v-if="canEdit(row)" @click="handleEdit(row)">编辑</a>
<a v-if="canSubmit(row)" @click="handleSubmit(row)">提交法务</a>
<a v-if="canViewApprove(row)" @click="handleViewApprove(row)">审批记录</a>
<a v-if="canViewLawCallback(row)" @click="handleViewLawCallback(row)">回调data</a>
<a v-if="canMockApprove(row)" @click="handleMockApprove(row)">测试通过</a>
<a v-if="canOnlineSign(row)" @click="handleOnlineSign(row)">在线签订</a>
<a v-if="row.status === 'completed' && row.signedFilePath" @click="handleDownloadSigned(row)">下载签署文件</a>
<a v-if="canDownloadSigned(row)" @click="handleDownloadSigned(row)">下载签署文件</a>
<a v-if="canUploadSigned(row)" @click="handleUploadSigned(row)">上传已签署版本</a>
<a v-if="canMockFinishSign(row)" @click="handleMockFinishSign(row)">测试签署完成</a>
<a v-if="canCollect(row)" @click="handleMockCollect(row)">测试采集</a>
@@ -166,6 +167,7 @@ import {
createLaunchDraft,
deleteLaunchRecord,
getLaunchDetail,
getLawApproveCallbackSample,
mockApproveLaunch,
mockCollectLaunch,
mockRejectLaunch,
@@ -325,12 +327,12 @@ function canMockReject(row) {
}
function canOnlineSign(row) {
// 签署中也可以再次调起签署(续签/补签),已完成则不能再签
return ["pending_sign", "signing"].includes(row.status);
// 在线签订只对电子合同开放;纸质/线下签署走“上传已签署版本”兜底。
return String(row.isElectron || "1") === "1" && ["pending_sign", "signing"].includes(row.status);
}
function canMockFinishSign(row) {
return ["pending_sign", "signing"].includes(row.status);
return String(row.isElectron || "1") === "1" && ["pending_sign", "signing"].includes(row.status);
}
function canUploadSigned(row) {
@@ -346,7 +348,15 @@ function canArchive(row) {
}
function canViewApprove(row) {
return ["reviewing", "pending_sign", "signing", "pending_collect", "pending_archive", "completed"].includes(row.status);
return Boolean(row.lawContractId) && ["reviewing", "rejected", "pending_sign", "signing", "pending_collect", "pending_archive", "completed"].includes(row.status);
}
function canViewLawCallback(row) {
return ["reviewing", "rejected", "pending_sign", "signing", "pending_collect", "pending_archive", "completed"].includes(row.status);
}
function canDownloadSigned(row) {
return Boolean(row.signedFilePath);
}
function canTerminate(row) {
@@ -533,6 +543,67 @@ function handleViewApprove(row) {
});
}
function buildLawCallbackModalContent(sample) {
const approvedJson = JSON.stringify({ data: sample?.approvedData || {} }, null, 2);
const rejectedJson = JSON.stringify({ data: sample?.rejectedData || {} }, null, 2);
return h("div", { style: { display: "flex", flexDirection: "column", gap: "12px" } }, [
h("div", [
h("div", { style: { marginBottom: "6px", fontWeight: 600 } }, "回调地址"),
h("div", { style: { color: "#666", wordBreak: "break-all" } }, `${sample?.callbackMethod || "POST"} ${sample?.callbackUrl || "/contract/launch/callback/law/approve"}`),
]),
h("div", [
h("div", { style: { marginBottom: "6px", fontWeight: 600 } }, "审批通过 data"),
h("pre", {
style: {
margin: 0,
maxHeight: "260px",
overflow: "auto",
padding: "12px",
borderRadius: "8px",
background: "#f6f8fa",
fontSize: "12px",
lineHeight: "1.6",
whiteSpace: "pre-wrap",
wordBreak: "break-word",
},
}, approvedJson),
]),
h("div", [
h("div", { style: { marginBottom: "6px", fontWeight: 600 } }, "审批驳回 data"),
h("pre", {
style: {
margin: 0,
maxHeight: "220px",
overflow: "auto",
padding: "12px",
borderRadius: "8px",
background: "#f6f8fa",
fontSize: "12px",
lineHeight: "1.6",
whiteSpace: "pre-wrap",
wordBreak: "break-word",
},
}, rejectedJson),
]),
]);
}
function handleViewLawCallback(row) {
getLawApproveCallbackSample(row.id).then((res) => {
if (!isSuccessResponse(res) || !getDataResult(res)) {
message.error(getResponseMessage(res, "获取法务回调样例失败"));
return;
}
const sample = getDataResult(res);
Modal.info({
title: `法务回调 data 结构:${row.contractName}`,
width: 900,
okText: "知道了",
content: buildLawCallbackModalContent(sample),
});
});
}
function handleMockApprove(row) {
Modal.confirm({
title: "测试操作模拟审批通过",