新增公司盖章与骑缝章配置
This commit is contained in:
@@ -115,6 +115,8 @@ export interface OnboardingElectronicSignDocument {
|
|||||||
originalDocxFileId?: number;
|
originalDocxFileId?: number;
|
||||||
signedPdfFileId?: number;
|
signedPdfFileId?: number;
|
||||||
employeeSignedPreviewed: boolean;
|
employeeSignedPreviewed: boolean;
|
||||||
|
companySealEnabled: boolean;
|
||||||
|
acrossPageSealEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 员工已签、企业未盖章文件的契约锁只读预览。 */
|
/** 员工已签、企业未盖章文件的契约锁只读预览。 */
|
||||||
@@ -245,6 +247,8 @@ export interface OnboardingContractVersion {
|
|||||||
effectiveDate?: string;
|
effectiveDate?: string;
|
||||||
expiryDate?: string;
|
expiryDate?: string;
|
||||||
versionStatus: string;
|
versionStatus: string;
|
||||||
|
companySealEnabled?: boolean | null;
|
||||||
|
acrossPageSealEnabled?: boolean | null;
|
||||||
remark?: string;
|
remark?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -782,6 +786,18 @@ export const onboardingTaskApi = {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setVersionSeals(params: {
|
||||||
|
id: number;
|
||||||
|
companySealEnabled?: boolean;
|
||||||
|
acrossPageSealEnabled?: boolean;
|
||||||
|
}) {
|
||||||
|
return moduleRequest("/biz/onboarding/contract-template/").post(
|
||||||
|
"version/set-seals",
|
||||||
|
params,
|
||||||
|
{ loading: false }
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
deleteVersion(id: number) {
|
deleteVersion(id: number) {
|
||||||
return moduleRequest("/biz/onboarding/contract-template/").post(
|
return moduleRequest("/biz/onboarding/contract-template/").post(
|
||||||
"version/delete",
|
"version/delete",
|
||||||
|
|||||||
@@ -174,7 +174,7 @@
|
|||||||
<el-drawer
|
<el-drawer
|
||||||
v-model="drawerVisible"
|
v-model="drawerVisible"
|
||||||
:title="`签署材料模板管理 · ${selectedTemplate?.templateName || ''}`"
|
:title="`签署材料模板管理 · ${selectedTemplate?.templateName || ''}`"
|
||||||
size="1150px"
|
size="min(1500px, 96vw)"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<div v-if="selectedTemplate" class="drawer-content-box">
|
<div v-if="selectedTemplate" class="drawer-content-box">
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
上传新版本 DOCX
|
上传新版本 DOCX
|
||||||
</el-button>
|
</el-button>
|
||||||
<span class="pane-tip-text">
|
<span class="pane-tip-text">
|
||||||
支持多版本迭代。启用某个版本后,该版本的 DOCX 将用于生成新入职员工的签署材料。
|
支持多版本迭代。启用版本后用于生成新入职员工的签署材料;盖章开关的修改仅影响后续新建任务。
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -230,6 +230,31 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="公司盖章" width="100" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-switch
|
||||||
|
:model-value="scope.row.companySealEnabled === true"
|
||||||
|
:loading="sealUpdating[scope.row.id] === 'companySealEnabled'"
|
||||||
|
:disabled="!canEditVersionSeals || !!sealUpdating[scope.row.id]"
|
||||||
|
:title="versionSealDisabledReason"
|
||||||
|
aria-label="公司盖章"
|
||||||
|
@change="value => changeVersionSeal(scope.row, 'companySealEnabled', value)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="骑缝章" width="100" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-switch
|
||||||
|
:model-value="scope.row.acrossPageSealEnabled === true"
|
||||||
|
:loading="sealUpdating[scope.row.id] === 'acrossPageSealEnabled'"
|
||||||
|
:disabled="!canEditVersionSeals || !!sealUpdating[scope.row.id]"
|
||||||
|
:title="versionSealDisabledReason"
|
||||||
|
aria-label="骑缝章"
|
||||||
|
@change="value => changeVersionSeal(scope.row, 'acrossPageSealEnabled', value)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="生效时间" width="175" align="center">
|
<el-table-column label="生效时间" width="175" align="center">
|
||||||
<template #default="scope">{{ formatVersionTime(scope.row.effectiveDate) }}</template>
|
<template #default="scope">{{ formatVersionTime(scope.row.effectiveDate) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -315,6 +340,7 @@
|
|||||||
v-model="versionVisible"
|
v-model="versionVisible"
|
||||||
title="上传新版本 DOCX"
|
title="上传新版本 DOCX"
|
||||||
width="600px"
|
width="600px"
|
||||||
|
top="5vh"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
append-to-body
|
append-to-body
|
||||||
>
|
>
|
||||||
@@ -370,6 +396,19 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="公司盖章">
|
||||||
|
<el-switch v-model="versionForm.companySealEnabled" aria-label="公司盖章" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="骑缝章">
|
||||||
|
<el-switch v-model="versionForm.acrossPageSealEnabled" aria-label="骑缝章" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-alert
|
||||||
|
title="所有材料均需员工签字。公司盖章和骑缝章可在版本列表调整,修改仅影响后续新建任务,已有任务和签约保持原配置。"
|
||||||
|
type="info"
|
||||||
|
:closable="false"
|
||||||
|
style="margin-bottom: 16px"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-form-item label="版本备注">
|
<el-form-item label="版本备注">
|
||||||
<el-input v-model="versionForm.remark" type="textarea" :rows="2" placeholder="本次版本修订说明" />
|
<el-input v-model="versionForm.remark" type="textarea" :rows="2" placeholder="本次版本修订说明" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -563,7 +602,7 @@ import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
|||||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||||
import { copyToClipboard } from "@/utils";
|
import { copyToClipboard } from "@/utils";
|
||||||
|
|
||||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingContractManageAll");
|
const { canManage, disabledReason, hasAction } = useOnboardingPermission("onboardingContractManageAll");
|
||||||
|
|
||||||
const templateTable = ref<ProTableInstance>();
|
const templateTable = ref<ProTableInstance>();
|
||||||
const selectedTemplate = ref<OnboardingContractTemplate>();
|
const selectedTemplate = ref<OnboardingContractTemplate>();
|
||||||
@@ -655,6 +694,16 @@ async function onSearchDepartmentChange(departmentId?: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const versions = ref<OnboardingContractVersion[]>([]);
|
const versions = ref<OnboardingContractVersion[]>([]);
|
||||||
|
type VersionSealField = "companySealEnabled" | "acrossPageSealEnabled";
|
||||||
|
const sealUpdating = reactive<Record<number, VersionSealField | undefined>>({});
|
||||||
|
const canEditVersionSeals = computed(() =>
|
||||||
|
canManage(selectedTemplate.value) && hasAction("onboardingContractEdit")
|
||||||
|
);
|
||||||
|
const versionSealDisabledReason = computed(() =>
|
||||||
|
!hasAction("onboardingContractEdit")
|
||||||
|
? "没有编辑签署材料模板的权限"
|
||||||
|
: disabledReason(selectedTemplate.value)
|
||||||
|
);
|
||||||
const versionVisible = ref(false);
|
const versionVisible = ref(false);
|
||||||
const variablesVisible = ref(false);
|
const variablesVisible = ref(false);
|
||||||
const variables = ref<OnboardingTemplateVariable[]>([]);
|
const variables = ref<OnboardingTemplateVariable[]>([]);
|
||||||
@@ -690,11 +739,18 @@ const emptyTemplate = (): Partial<OnboardingContractTemplate> => ({
|
|||||||
description: ""
|
description: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
const emptyVersion = (): Partial<OnboardingContractVersion> => ({
|
type OnboardingVersionForm = Partial<OnboardingContractVersion> & {
|
||||||
|
companySealEnabled: boolean;
|
||||||
|
acrossPageSealEnabled: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
const emptyVersion = (): OnboardingVersionForm => ({
|
||||||
versionNo: "",
|
versionNo: "",
|
||||||
sourceDocxFileId: undefined,
|
sourceDocxFileId: undefined,
|
||||||
effectiveDate: undefined,
|
effectiveDate: undefined,
|
||||||
expiryDate: undefined,
|
expiryDate: undefined,
|
||||||
|
companySealEnabled: true,
|
||||||
|
acrossPageSealEnabled: true,
|
||||||
remark: ""
|
remark: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -712,7 +768,7 @@ const emptyVariable = (): Partial<OnboardingTemplateVariable> => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const templateForm = reactive<Partial<OnboardingContractTemplate>>(emptyTemplate());
|
const templateForm = reactive<Partial<OnboardingContractTemplate>>(emptyTemplate());
|
||||||
const versionForm = reactive<Partial<OnboardingContractVersion>>(emptyVersion());
|
const versionForm = reactive<OnboardingVersionForm>(emptyVersion());
|
||||||
const variableForm = reactive<Partial<OnboardingTemplateVariable>>(emptyVariable());
|
const variableForm = reactive<Partial<OnboardingTemplateVariable>>(emptyVariable());
|
||||||
|
|
||||||
const templateColumns: ColumnProps<OnboardingContractTemplate>[] = [
|
const templateColumns: ColumnProps<OnboardingContractTemplate>[] = [
|
||||||
@@ -938,6 +994,27 @@ async function changeVersionStatus(row: OnboardingContractVersion, status: strin
|
|||||||
ElMessage.success(`版本状态已更新为:${versionText(status)}`);
|
ElMessage.success(`版本状态已更新为:${versionText(status)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function changeVersionSeal(
|
||||||
|
row: OnboardingContractVersion,
|
||||||
|
field: VersionSealField,
|
||||||
|
enabled: string | number | boolean
|
||||||
|
) {
|
||||||
|
if (typeof enabled !== "boolean" || !canEditVersionSeals.value || sealUpdating[row.id]) return;
|
||||||
|
|
||||||
|
sealUpdating[row.id] = field;
|
||||||
|
try {
|
||||||
|
// 只提交当前开关;另一个开关和历史任务快照均保持不变。
|
||||||
|
await onboardingTaskApi.setVersionSeals({ id: row.id, [field]: enabled });
|
||||||
|
const currentRow = versions.value.find(item => item.id === row.id);
|
||||||
|
if (currentRow) currentRow[field] = enabled;
|
||||||
|
ElMessage.success(`${field === "companySealEnabled" ? "公司盖章" : "骑缝章"}已${enabled ? "开启" : "关闭"},仅对后续新建任务生效`);
|
||||||
|
} catch {
|
||||||
|
// 请求层统一显示错误;保存失败时保留原开关状态。
|
||||||
|
} finally {
|
||||||
|
delete sealUpdating[row.id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function removeVersion(row: OnboardingContractVersion) {
|
async function removeVersion(row: OnboardingContractVersion) {
|
||||||
const confirmed = await isMessageBoxConfirmed(
|
const confirmed = await isMessageBoxConfirmed(
|
||||||
ElMessageBox.confirm(`确认删除签署材料版本“${row.versionNo}”?此操作不可撤销。`, "删除确认", { type: "warning" })
|
ElMessageBox.confirm(`确认删除签署材料版本“${row.versionNo}”?此操作不可撤销。`, "删除确认", { type: "warning" })
|
||||||
|
|||||||
@@ -1310,6 +1310,11 @@
|
|||||||
<div class="font-bold">
|
<div class="font-bold">
|
||||||
{{ documentItem.documentSort }}. {{ documentItem.documentName }}
|
{{ documentItem.documentSort }}. {{ documentItem.documentName }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="document-state-text">
|
||||||
|
<el-tag size="small" effect="plain">员工签字</el-tag>
|
||||||
|
<el-tag v-if="documentItem.companySealEnabled" size="small" type="success" effect="plain">公司盖章</el-tag>
|
||||||
|
<el-tag v-if="documentItem.acrossPageSealEnabled" size="small" type="warning" effect="plain">骑缝章</el-tag>
|
||||||
|
</div>
|
||||||
<div class="text-secondary document-state-text">
|
<div class="text-secondary document-state-text">
|
||||||
{{ documentItem.providerDocumentId ? '已上传契约锁' : '发起时自动生成并上传' }}
|
{{ documentItem.providerDocumentId ? '已上传契约锁' : '发起时自动生成并上传' }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user