diff --git a/.env b/.env index a32b763..5257186 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ # title -VITE_GLOB_APP_TITLE = 未病局管理系统 +VITE_GLOB_APP_TITLE = 员工文件管理系统 # 本地运行端口号 VITE_PORT = 8848 diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 5a678b3..0af05ae 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -62,7 +62,7 @@ interface LoginProps { //默认值 const props = reactive({ - sysName: "未病局管理系统", + sysName: "员工文件管理系统", sysVersion: "", sysLogo: "", sysTenantOption: TenantEnum.CLOSE, diff --git a/src/views/onboarding/fill/index.vue b/src/views/onboarding/fill/index.vue index 5cd7826..e853397 100644 --- a/src/views/onboarding/fill/index.vue +++ b/src/views/onboarding/fill/index.vue @@ -598,11 +598,9 @@ type="primary" plain icon="Download" - :loading="isContractOpening(c.id)" - :disabled="isContractOpening(c.id)" @click="previewAndDownloadContract(c)" > - 下载 / 查阅合同原文 + 下载并查看合同 >({}); -const openingContracts = reactive>({}); const task = ref(null); const contracts = ref([]); @@ -1014,47 +1011,19 @@ async function isMessageBoxConfirmed(confirmPromise: Promise) { } } -async function previewAndDownloadContract(c: any) { - if (isContractOpening(c.id)) { - return; - } +function previewAndDownloadContract(c: any) { + const url = onboardingPublicApi.contractSourceUrl({ + token: token.value, + taskContractId: c.id + }); - // 必须在用户点击的同步阶段创建窗口,否则手机浏览器会拦截异步完成后的 window.open。 - const previewWindow = window.open("about:blank", "_blank"); - openingContracts[String(c.id)] = true; - try { - if (previewWindow) { - previewWindow.document.title = "合同生成中"; - previewWindow.document.body.innerHTML = ` -
- 正在生成合同文件,请稍候… -
`; - } - if (canEdit.value) { - await saveCurrentEmployeeInfo(); - } - const url = onboardingPublicApi.contractSourceUrl({ - token: token.value, - taskContractId: c.id - }); - if (previewWindow && !previewWindow.closed) { - previewWindow.location.replace(url); - } else { - // 微信等内置浏览器拦截新窗口时,退回当前页直接发起下载。 - window.location.assign(url); - } - } catch (err: any) { - previewWindow?.close(); - ElMessage.error(err?.message || "合同生成失败,请稍后重试"); - } finally { - openingContracts[String(c.id)] = false; + // 下载必须直接发生在用户点击事件中,避免手机浏览器拦截异步打开或二次跳转。 + const downloadWindow = window.open(url, "_blank"); + if (!downloadWindow) { + window.location.assign(url); } } -function isContractOpening(taskContractId: number) { - return Boolean(openingContracts[String(taskContractId)]); -} - async function submitAll() { const unconfirmed = contracts.value.filter(c => !c.isAgreed); if (unconfirmed.length) {