签订日期
This commit is contained in:
@@ -266,6 +266,21 @@ function getResponseMessage(res, fallback = "操作失败") {
|
||||
return res?.message || res?.msg || fallback;
|
||||
}
|
||||
|
||||
function sliceDateValue(value) {
|
||||
return value ? String(value).slice(0, 10) : "";
|
||||
}
|
||||
|
||||
function todayString() {
|
||||
const now = new Date();
|
||||
const month = String(now.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(now.getDate()).padStart(2, "0");
|
||||
return `${now.getFullYear()}-${month}-${day}`;
|
||||
}
|
||||
|
||||
function formatDateTimeValue(value) {
|
||||
return value ? `${value} 00:00:00` : null;
|
||||
}
|
||||
|
||||
function connectToolbar() {
|
||||
const table = tableRef.value;
|
||||
const toolbar = toolbarRef.value;
|
||||
@@ -563,8 +578,11 @@ function handleMockFinishSign(row) {
|
||||
content: `模拟合同【${row.contractName}】签署完成,状态将变为「待采集」。`,
|
||||
okText: "确认模拟",
|
||||
cancelText: "取消",
|
||||
onOk: () =>
|
||||
finishLaunchSeal(row.id, {
|
||||
onOk: () => {
|
||||
const signDate = sliceDateValue(row.signDate) || todayString();
|
||||
const sealDate = sliceDateValue(row.sealDate) || signDate;
|
||||
const activeDate = sliceDateValue(row.activeDate) || sliceDateValue(row.effectiveStart) || signDate;
|
||||
return finishLaunchSeal(row.id, {
|
||||
sealContractId: row.sealContractId || `TEST-SEAL-${row.id}`,
|
||||
sealContractStatus: 2000,
|
||||
signedFileName: `${row.contractName || "合同"}-测试已签署.pdf`,
|
||||
@@ -572,6 +590,9 @@ function handleMockFinishSign(row) {
|
||||
signedFileType: "pdf",
|
||||
signedFileSize: row.contractTextFileSize || null,
|
||||
signedOfflineReason: "测试按钮模拟签署完成,真实签章接入后可删除此按钮",
|
||||
signDate: formatDateTimeValue(signDate),
|
||||
sealDate: formatDateTimeValue(sealDate),
|
||||
activeDate: formatDateTimeValue(activeDate),
|
||||
}).then((res) => {
|
||||
if (!isSuccessResponse(res)) {
|
||||
message.error(getResponseMessage(res, "测试签署完成失败"));
|
||||
@@ -579,7 +600,8 @@ function handleMockFinishSign(row) {
|
||||
}
|
||||
message.success("测试签署完成,合同已流转到待采集");
|
||||
getList();
|
||||
}),
|
||||
});
|
||||
},
|
||||
icon: null,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user