diff --git a/src/api/launch.js b/src/api/launch.js index c9c5ac4..cadd6a5 100644 --- a/src/api/launch.js +++ b/src/api/launch.js @@ -83,6 +83,13 @@ export function mockRejectLaunch(id, data = {}) { }); } +export function getLawApproveCallbackSample(id) { + return request({ + url: `/contract/launch/${id}/callback/law/approve/sample`, + method: "get", + }); +} + export function saveLaunchSealInfo(id, data) { return request({ url: `/contract/launch/${id}/seal/save`, diff --git a/src/views/contract/launch/components/ContractPartyPlaceholderModal.vue b/src/views/contract/launch/components/ContractPartyPlaceholderModal.vue index 6da348c..ec03783 100644 --- a/src/views/contract/launch/components/ContractPartyPlaceholderModal.vue +++ b/src/views/contract/launch/components/ContractPartyPlaceholderModal.vue @@ -424,6 +424,26 @@ +
+
已签署文件
+
+
+ {{ detailState.signedFileName || "已签署文件" }} +
+
+ 当前合同的签署完成版本 +
+
+ + + 下载 + + +
+ 编辑 提交法务 审批记录 + 回调data 测试通过 在线签订 - 下载签署文件 + 下载签署文件 上传已签署版本 测试签署完成 测试采集 @@ -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: "测试操作:模拟审批通过",