111
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# title
|
# title
|
||||||
VITE_GLOB_APP_TITLE = 未病局管理系统
|
VITE_GLOB_APP_TITLE = 员工文件管理系统
|
||||||
|
|
||||||
# 本地运行端口号
|
# 本地运行端口号
|
||||||
VITE_PORT = 8848
|
VITE_PORT = 8848
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ interface LoginProps {
|
|||||||
|
|
||||||
//默认值
|
//默认值
|
||||||
const props = reactive<LoginProps>({
|
const props = reactive<LoginProps>({
|
||||||
sysName: "未病局管理系统",
|
sysName: "员工文件管理系统",
|
||||||
sysVersion: "",
|
sysVersion: "",
|
||||||
sysLogo: "",
|
sysLogo: "",
|
||||||
sysTenantOption: TenantEnum.CLOSE,
|
sysTenantOption: TenantEnum.CLOSE,
|
||||||
|
|||||||
@@ -598,11 +598,9 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
icon="Download"
|
icon="Download"
|
||||||
:loading="isContractOpening(c.id)"
|
|
||||||
:disabled="isContractOpening(c.id)"
|
|
||||||
@click="previewAndDownloadContract(c)"
|
@click="previewAndDownloadContract(c)"
|
||||||
>
|
>
|
||||||
下载 / 查阅合同原文
|
下载并查看合同
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
@@ -664,7 +662,6 @@ const submitting = ref(false);
|
|||||||
const error = ref("");
|
const error = ref("");
|
||||||
const currentStep = ref(0);
|
const currentStep = ref(0);
|
||||||
const uploadingMaterials = reactive<Record<string, boolean>>({});
|
const uploadingMaterials = reactive<Record<string, boolean>>({});
|
||||||
const openingContracts = reactive<Record<string, boolean>>({});
|
|
||||||
|
|
||||||
const task = ref<OnboardingTask | null>(null);
|
const task = ref<OnboardingTask | null>(null);
|
||||||
const contracts = ref<any[]>([]);
|
const contracts = ref<any[]>([]);
|
||||||
@@ -1014,45 +1011,17 @@ async function isMessageBoxConfirmed(confirmPromise: Promise<unknown>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function previewAndDownloadContract(c: any) {
|
function previewAndDownloadContract(c: any) {
|
||||||
if (isContractOpening(c.id)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 必须在用户点击的同步阶段创建窗口,否则手机浏览器会拦截异步完成后的 window.open。
|
|
||||||
const previewWindow = window.open("about:blank", "_blank");
|
|
||||||
openingContracts[String(c.id)] = true;
|
|
||||||
try {
|
|
||||||
if (previewWindow) {
|
|
||||||
previewWindow.document.title = "合同生成中";
|
|
||||||
previewWindow.document.body.innerHTML = `
|
|
||||||
<div style="padding:40px 20px;text-align:center;font-family:sans-serif;color:#475569;">
|
|
||||||
正在生成合同文件,请稍候…
|
|
||||||
</div>`;
|
|
||||||
}
|
|
||||||
if (canEdit.value) {
|
|
||||||
await saveCurrentEmployeeInfo();
|
|
||||||
}
|
|
||||||
const url = onboardingPublicApi.contractSourceUrl({
|
const url = onboardingPublicApi.contractSourceUrl({
|
||||||
token: token.value,
|
token: token.value,
|
||||||
taskContractId: c.id
|
taskContractId: c.id
|
||||||
});
|
});
|
||||||
if (previewWindow && !previewWindow.closed) {
|
|
||||||
previewWindow.location.replace(url);
|
// 下载必须直接发生在用户点击事件中,避免手机浏览器拦截异步打开或二次跳转。
|
||||||
} else {
|
const downloadWindow = window.open(url, "_blank");
|
||||||
// 微信等内置浏览器拦截新窗口时,退回当前页直接发起下载。
|
if (!downloadWindow) {
|
||||||
window.location.assign(url);
|
window.location.assign(url);
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
|
||||||
previewWindow?.close();
|
|
||||||
ElMessage.error(err?.message || "合同生成失败,请稍后重试");
|
|
||||||
} finally {
|
|
||||||
openingContracts[String(c.id)] = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isContractOpening(taskContractId: number) {
|
|
||||||
return Boolean(openingContracts[String(taskContractId)]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submitAll() {
|
async function submitAll() {
|
||||||
|
|||||||
Reference in New Issue
Block a user