增加授权委托书

This commit is contained in:
2026-06-03 13:28:07 +08:00
parent c2d8551de0
commit baba1eb0e9
@@ -373,6 +373,32 @@
</div>
</div>
<div v-if="requiresAuthAttachment" class="upload-block">
<div class="upload-label">授权委托书附件</div>
<a-upload-dragger
:file-list="authAttachmentUploadList"
:before-upload="handleAuthAttachmentUpload"
@remove="handleRemoveAuthAttachment"
:disabled="isViewMode"
:show-upload-list="{ showRemoveIcon: !isViewMode }"
multiple
>
<div class="other-upload-text">当前签订方式需要上传授权委托书附件</div>
</a-upload-dragger>
<div v-if="detailState.authAttachmentList?.length" class="download-list">
<a-space wrap>
<a-button
v-for="item in detailState.authAttachmentList"
:key="item.uid || item.filePath"
size="small"
@click="downloadFile(item.filePath, item.name || item.fileName)"
>
下载 {{ item.name || item.fileName }}
</a-button>
</a-space>
</div>
</div>
<div class="upload-block">
<div class="upload-label">其他附件</div>
<a-upload-dragger
@@ -449,6 +475,20 @@
style="width: 100%"
/>
</a-form-item>
<a-form-item
v-if="detailState.valuationMode === '2'"
class="tight-item"
label="预估金额"
required
>
<a-input-number
v-model:value="detailState.estimatedAmount"
:min="0"
:precision="2"
:controls="false"
style="width: 100%"
/>
</a-form-item>
<a-form-item class="tight-item" label="币种">
<a-input
:value="
@@ -528,6 +568,17 @@
placeholder="起草人所在主体机构编码;当前默认取登录组织ID,多个用逗号分隔"
/>
</a-form-item>
<a-form-item
v-if="detailState.isPublicTender"
class="tight-item"
label="关联招标号"
required
>
<a-input
v-model:value="detailState.biddingNo"
placeholder="公开招标时必填"
/>
</a-form-item>
<a-form-item class="tight-item" label="开票时间">
<a-date-picker
v-model:value="detailState.invoiceDate"
@@ -545,6 +596,13 @@
</div>
<div class="boolean-grid">
<div class="boolean-row">
<span>是否需修订条款</span>
<a-radio-group v-model:value="detailState.needAmendments">
<a-radio :value="true"></a-radio>
<a-radio :value="false"></a-radio>
</a-radio-group>
</div>
<div class="boolean-row">
<span>是否涉及港澳台</span>
<a-radio-group
@@ -977,6 +1035,7 @@ function normalizeBooleanValue(value) {
function pickBooleanSource(source = {}, key) {
const mapping = {
needAmendments: [source.needAmendments, source.isNeedAmendments],
isInvolveHongKongMacaoTaiwan: [
source.isInvolveHongKongMacaoTaiwan,
source.isSgat,
@@ -1041,6 +1100,11 @@ function splitFilesByCategory(source = {}) {
: sourceFiles
.filter((item) => item.fileCategory === "gist")
.map(normalizeFileItem),
authAttachmentList: source.authAttachmentList?.length
? source.authAttachmentList.map(normalizeFileItem)
: sourceFiles
.filter((item) => item.fileCategory === "auth")
.map(normalizeFileItem),
};
}
@@ -1286,6 +1350,7 @@ function createContractFormData() {
contractType: "",
contractTypeCode: "",
contractAmount: null,
estimatedAmount: null,
effectiveStart: "",
effectiveEnd: "",
contractPeriodType: "0",
@@ -1312,6 +1377,7 @@ function createContractFormData() {
bodySummary: "",
invoiceDate: "",
receiveDate: "",
biddingNo: "",
contractBodyFileName: "",
contractBodyFilePath: "",
@@ -1320,6 +1386,7 @@ function createContractFormData() {
contractBodyArrayBuffer: null,
otherAttachmentList: [],
contractGistFileList: [],
authAttachmentList: [],
// 正文模板字段值统一放这里,后续新增模板字段时尽量只改 templateFieldList
templateFieldValues: {},
partyState: {
@@ -1335,6 +1402,7 @@ function createContractFormData() {
isIncludedInCurrentYearBudget: false,
isShared: false,
isMajorContract: false,
needAmendments: false,
extraAmounts: {
depositEnabled: false,
deposit: 0,
@@ -1386,6 +1454,8 @@ function copyContractFormData(data = {}) {
form.otherAttachmentList = fileState.otherAttachmentList;
} else if (key === "contractGistFileList") {
form.contractGistFileList = fileState.contractGistFileList;
} else if (key === "authAttachmentList") {
form.authAttachmentList = fileState.authAttachmentList;
} else if (
[
"contractBodyFileName",
@@ -1410,6 +1480,7 @@ function copyContractFormData(data = {}) {
source.signingSubjectCode ?? source.orgId ?? form.signingSubjectCode;
} else if (
[
"needAmendments",
"isInvolveHongKongMacaoTaiwan",
"isPublicTender",
"isForeignRelatedSubject",
@@ -1442,6 +1513,7 @@ const templateName = ref("");
const detailState = ref(createContractFormData());
const otherAttachmentList = ref([]);
const gistAttachmentList = ref([]);
const authAttachmentUploadList = ref([]);
const bodyConfigModalRef = ref(null);
const counterpartyRoleKeys = ref([]);
@@ -1515,6 +1587,10 @@ const contractBodyHint = computed(() =>
: "当前为模板创建,点击维护模板信息和正文预览",
);
const requiresAuthAttachment = computed(() =>
["GZBSQRQZ", "HTZYZBSQRQZ"].includes(detailState.value.sealType),
);
function syncUploadLists() {
otherAttachmentList.value = (detailState.value.otherAttachmentList || []).map(
(item, index) => ({
@@ -1532,6 +1608,14 @@ function syncUploadLists() {
status: item.status || "done",
}),
);
authAttachmentUploadList.value = (detailState.value.authAttachmentList || []).map(
(item, index) => ({
uid: item.uid || `auth_${index + 1}`,
name: item.name || item.fileName,
size: item.size ?? item.fileSize,
status: item.status || "done",
}),
);
}
function syncCounterpartyState() {
@@ -1754,6 +1838,10 @@ function handleGistAttachmentUpload(file) {
return uploadAttachmentFile(file, "gist");
}
function handleAuthAttachmentUpload(file) {
return uploadAttachmentFile(file, "auth");
}
function uploadAttachmentFile(file, category) {
const formData = new FormData();
formData.append("file", file);
@@ -1774,6 +1862,9 @@ function uploadAttachmentFile(file, category) {
if (category === "gist") {
detailState.value.contractGistFileList.push(item);
gistAttachmentList.value.push(item);
} else if (category === "auth") {
detailState.value.authAttachmentList.push(item);
authAttachmentUploadList.value.push(item);
} else {
detailState.value.otherAttachmentList.push(item);
otherAttachmentList.value.push(item);
@@ -1803,6 +1894,16 @@ function handleRemoveGistAttachment(file) {
);
}
function handleRemoveAuthAttachment(file) {
detailState.value.authAttachmentList =
detailState.value.authAttachmentList.filter(
(item) => item.uid !== file.uid && item.name !== file.name,
);
authAttachmentUploadList.value = authAttachmentUploadList.value.filter(
(item) => item.uid !== file.uid && item.name !== file.name,
);
}
async function downloadFile(filePath, fileName = "附件") {
if (!filePath) {
message.warning("文件路径为空,无法下载");
@@ -1901,6 +2002,13 @@ function validateState() {
)
return "请填写期限说明";
if (!detailState.value.valuationMode) return "请选择计价方式";
if (
detailState.value.valuationMode === "2" &&
(detailState.value.estimatedAmount === null ||
detailState.value.estimatedAmount === undefined ||
detailState.value.estimatedAmount === "")
)
return "请填写预估金额";
if (!detailState.value.currencyName) return "请选择币种";
if (!detailState.value.sealType) return "请选择签订方式";
if (!detailState.value.textSource) return "请选择文本来源";
@@ -1910,8 +2018,15 @@ function validateState() {
if (!detailState.value.isElectron) return "请选择签署方式";
if (!detailState.value.contractTypeCode) return "请选择合同属性中的合同类型";
if (!detailState.value.executorAccount?.trim()) return "请填写合同执行人";
if (detailState.value.isPublicTender && !detailState.value.biddingNo?.trim())
return "请填写关联招标号";
if (!detailState.value.contractBodyFileName?.trim())
return "请先配置合同正文";
if (
requiresAuthAttachment.value &&
!(detailState.value.authAttachmentList || []).length
)
return "请上传授权委托书附件";
for (const plan of detailState.value.performancePlans || []) {
if (!plan.planMatter?.trim()) return "请填写履行计划的履行事项";
if (!plan.planWhere?.trim()) return "请填写履行计划的履约条件";
@@ -1936,6 +2051,12 @@ function handleSave() {
detailState.value.contractAmount === ""
? null
: Number(detailState.value.contractAmount);
detailState.value.estimatedAmount =
detailState.value.estimatedAmount === null ||
detailState.value.estimatedAmount === undefined ||
detailState.value.estimatedAmount === ""
? null
: Number(detailState.value.estimatedAmount);
const record = buildLaunchRecord();
emit("save", {
@@ -2016,6 +2137,15 @@ function buildLaunchRecord() {
fileSize: item.size ?? item.fileSize ?? 0,
});
});
(detailState.value.authAttachmentList || []).forEach((item) => {
fileList.push({
fileCategory: "auth",
fileName: item.name || item.fileName,
filePath: item.filePath || "",
fileType: item.fileType || "",
fileSize: item.size ?? item.fileSize ?? 0,
});
});
(detailState.value.otherAttachmentList || []).forEach((item) => {
fileList.push({
fileCategory: "other",
@@ -2048,6 +2178,11 @@ function buildLaunchRecord() {
primaryContent: detailState.value.primaryContent,
amountExplain: detailState.value.amountExplain,
valuationMode: detailState.value.valuationMode,
needAmendments: detailState.value.needAmendments ? "1" : "0",
estimatedAmount:
detailState.value.valuationMode === "2"
? detailState.value.estimatedAmount
: null,
sealType: detailState.value.sealType,
textSource:
detailState.value.textSource ||
@@ -2069,6 +2204,7 @@ function buildLaunchRecord() {
isShare: detailState.value.isShared ? "1" : "0",
contractNature: detailState.value.isForeignRelatedSubject ? "1" : "0",
isSgat: detailState.value.isInvolveHongKongMacaoTaiwan ? "1" : "0",
biddingNo: detailState.value.isPublicTender ? detailState.value.biddingNo || "" : "",
contractGistRemark: detailState.value.contractGistRemark || "",
bodySummary: detailState.value.bodySummary || detailState.value.primaryContent || "",
contractTextFileName: detailState.value.contractBodyFileName || "",