签订日期
This commit is contained in:
@@ -602,12 +602,28 @@
|
||||
placeholder="选填,用于应收账款提醒"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item class="tight-item" label="签订日期">
|
||||
<a-date-picker
|
||||
v-model:value="detailState.signDate"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
placeholder="签署完成前需补齐"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item class="tight-item" label="用印时间">
|
||||
<a-date-picker
|
||||
v-model:value="detailState.sealDate"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
placeholder="签署完成前需补齐"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item class="tight-item" label="合同生效日期">
|
||||
<a-date-picker
|
||||
v-model:value="detailState.activeDate"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
placeholder="合同生效日期必须在合同期限范围内"
|
||||
placeholder="必填,且必须在合同期限范围内"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item class="tight-item" label="用印数量">
|
||||
@@ -1450,6 +1466,7 @@ function createContractFormData() {
|
||||
bzjAmount: 0,
|
||||
performancePlans: [],
|
||||
signDate: "",
|
||||
sealDate: "",
|
||||
activeDate: "",
|
||||
sealQuantity: 1,
|
||||
};
|
||||
@@ -1503,7 +1520,7 @@ function copyContractFormData(data = {}) {
|
||||
? source.contractBodyArrayBuffer.slice(0)
|
||||
: null
|
||||
: null;
|
||||
} else if (key === "signDate" || key === "invoiceDate" || key === "receiveDate" || key === "activeDate") {
|
||||
} else if (key === "signDate" || key === "sealDate" || key === "invoiceDate" || key === "receiveDate" || key === "activeDate") {
|
||||
form[key] = source[key] ? String(source[key]).slice(0, 10) : form[key];
|
||||
} else if (key === "assistDept") {
|
||||
form.assistDept = source.assistDept ?? source.assistDepartmentName ?? form.assistDept;
|
||||
@@ -2032,6 +2049,15 @@ function validateState() {
|
||||
!detailState.value.periodExplain?.trim()
|
||||
)
|
||||
return "请填写期限说明";
|
||||
if (!detailState.value.activeDate) return "请选择合同生效日期";
|
||||
if (
|
||||
detailState.value.contractPeriodType === "0" &&
|
||||
detailState.value.effectiveStart &&
|
||||
detailState.value.effectiveEnd &&
|
||||
(detailState.value.activeDate < detailState.value.effectiveStart ||
|
||||
detailState.value.activeDate > detailState.value.effectiveEnd)
|
||||
)
|
||||
return "合同生效日期必须在合同期限范围内";
|
||||
if (!detailState.value.valuationMode) return "请选择计价方式";
|
||||
// 固定总价时标的额必填
|
||||
if (
|
||||
@@ -2073,12 +2099,19 @@ function validateState() {
|
||||
!(detailState.value.authAttachmentList || []).length
|
||||
)
|
||||
return "请上传授权委托书附件";
|
||||
if (!(detailState.value.performancePlans || []).length)
|
||||
return "请至少添加一条履行计划";
|
||||
for (const plan of detailState.value.performancePlans || []) {
|
||||
if (!plan.planMatter?.trim()) return "请填写履行计划的履行事项";
|
||||
if (!plan.planWhere?.trim()) return "请填写履行计划的履约条件";
|
||||
if (!plan.planTime) return "请选择履行计划的节点日期";
|
||||
if (plan.planDay === null || plan.planDay === undefined || plan.planDay === "")
|
||||
return "请填写履行计划的提醒提前天数";
|
||||
if (
|
||||
!["0", "3"].includes(detailState.value.valuationMode) &&
|
||||
(plan.planMoney === null || plan.planMoney === undefined || plan.planMoney === "")
|
||||
)
|
||||
return "请填写履行计划的款项金额";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@@ -2258,6 +2291,7 @@ function buildLaunchRecord() {
|
||||
contractTextFileType: detailState.value.contractBodyFileType || "docx",
|
||||
contractTextFileSize: detailState.value.contractBodyFileSize || null,
|
||||
signDate: formatDateTimeValue(detailState.value.signDate),
|
||||
sealDate: formatDateTimeValue(detailState.value.sealDate),
|
||||
invoiceDate: formatDateTimeValue(detailState.value.invoiceDate),
|
||||
receiveDate: formatDateTimeValue(detailState.value.receiveDate),
|
||||
activeDate: formatDateTimeValue(detailState.value.activeDate),
|
||||
|
||||
@@ -52,6 +52,33 @@
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="签订日期" required>
|
||||
<a-date-picker
|
||||
v-model:value="signDate"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
placeholder="请选择签订日期"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="用印时间" required>
|
||||
<a-date-picker
|
||||
v-model:value="sealDate"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
placeholder="请选择用印时间"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="合同生效日期" required>
|
||||
<a-date-picker
|
||||
v-model:value="activeDate"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
placeholder="请选择合同生效日期"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="不在线签署的原因" required>
|
||||
<a-textarea
|
||||
v-model:value="offlineReason"
|
||||
@@ -78,6 +105,9 @@ const visible = ref(false);
|
||||
const row = ref(null);
|
||||
const uploadFile = ref(null);
|
||||
const offlineReason = ref("");
|
||||
const signDate = ref("");
|
||||
const sealDate = ref("");
|
||||
const activeDate = ref("");
|
||||
const dragOver = ref(false);
|
||||
const submitting = ref(false);
|
||||
const fileInputRef = ref(null);
|
||||
@@ -88,11 +118,39 @@ function showModal(record) {
|
||||
row.value = record;
|
||||
uploadFile.value = null;
|
||||
offlineReason.value = "";
|
||||
signDate.value = sliceDateValue(record?.signDate) || todayString();
|
||||
sealDate.value = sliceDateValue(record?.sealDate) || signDate.value;
|
||||
activeDate.value = sliceDateValue(record?.activeDate) || sliceDateValue(record?.effectiveStart);
|
||||
dragOver.value = false;
|
||||
submitting.value = false;
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
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 sliceDateValue(value) {
|
||||
return value ? String(value).slice(0, 10) : "";
|
||||
}
|
||||
|
||||
function formatDateTimeValue(value) {
|
||||
return value ? `${value} 00:00:00` : null;
|
||||
}
|
||||
|
||||
function isActiveDateWithinTerm() {
|
||||
if (!activeDate.value) return false;
|
||||
if (row.value?.contractPeriodType !== "0") return true;
|
||||
const start = sliceDateValue(row.value?.effectiveStart);
|
||||
const end = sliceDateValue(row.value?.effectiveEnd);
|
||||
if (start && activeDate.value < start) return false;
|
||||
if (end && activeDate.value > end) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function triggerFileInput() {
|
||||
fileInputRef.value?.click();
|
||||
}
|
||||
@@ -151,6 +209,22 @@ async function handleSubmit() {
|
||||
message.warning("请填写不在线签署的原因");
|
||||
return;
|
||||
}
|
||||
if (!signDate.value) {
|
||||
message.warning("请选择签订日期");
|
||||
return;
|
||||
}
|
||||
if (!sealDate.value) {
|
||||
message.warning("请选择用印时间");
|
||||
return;
|
||||
}
|
||||
if (!activeDate.value) {
|
||||
message.warning("请选择合同生效日期");
|
||||
return;
|
||||
}
|
||||
if (!isActiveDateWithinTerm()) {
|
||||
message.warning("合同生效日期必须在合同期限范围内");
|
||||
return;
|
||||
}
|
||||
|
||||
submitting.value = true;
|
||||
try {
|
||||
@@ -175,6 +249,9 @@ async function handleSubmit() {
|
||||
signedFileType: fileType,
|
||||
signedFileSize: fileSize,
|
||||
signedOfflineReason: reason,
|
||||
signDate: formatDateTimeValue(signDate.value),
|
||||
sealDate: formatDateTimeValue(sealDate.value),
|
||||
activeDate: formatDateTimeValue(activeDate.value),
|
||||
});
|
||||
|
||||
if (String(finishRes?.code || "") !== SUCCESS_CODE) {
|
||||
|
||||
@@ -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