提示优化
This commit is contained in:
@@ -500,6 +500,7 @@ import {
|
||||
type OnboardingTemplateVariable
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import type { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
|
||||
const templateTable = ref<ProTableInstance>();
|
||||
const selectedTemplate = ref<OnboardingContractTemplate>();
|
||||
@@ -811,7 +812,11 @@ async function saveTemplate() {
|
||||
}
|
||||
|
||||
async function removeTemplate(row: OnboardingContractTemplate) {
|
||||
await ElMessageBox.confirm(`确认删除签署材料模板“${row.templateName}”?`, "删除确认", { type: "warning" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(`确认删除签署材料模板“${row.templateName}”?`, "删除确认", { type: "warning" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.deleteTemplate([row.id]);
|
||||
templateTable.value?.refresh();
|
||||
ElMessage.success("删除成功");
|
||||
@@ -860,7 +865,11 @@ async function changeVersionStatus(row: OnboardingContractVersion, status: strin
|
||||
}
|
||||
|
||||
async function removeVersion(row: OnboardingContractVersion) {
|
||||
await ElMessageBox.confirm(`确认删除签署材料版本“${row.versionNo}”?此操作不可撤销。`, "删除确认", { type: "warning" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(`确认删除签署材料版本“${row.versionNo}”?此操作不可撤销。`, "删除确认", { type: "warning" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.deleteVersion(row.id);
|
||||
await loadVersions();
|
||||
ElMessage.success("版本删除成功");
|
||||
|
||||
@@ -287,6 +287,7 @@ import {
|
||||
OnboardingTemplate,
|
||||
onboardingTaskApi
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
|
||||
const loading = ref(false);
|
||||
const saving = ref(false);
|
||||
@@ -617,7 +618,11 @@ async function save() {
|
||||
}
|
||||
|
||||
async function removeTemplate(row: OnboardingTemplate) {
|
||||
await ElMessageBox.confirm(`确认删除入职模板“${row.templateName}”吗?`, "删除确认", { type: "warning" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(`确认删除入职模板“${row.templateName}”吗?`, "删除确认", { type: "warning" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.deleteOnboardingTemplate([row.id!]);
|
||||
ElMessage.success("删除成功");
|
||||
query.pageNum = 1;
|
||||
|
||||
@@ -168,6 +168,7 @@
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { ElMessage, ElMessageBox, FormInstance, FormRules } from "element-plus";
|
||||
import { onboardingTaskApi } from "@/api/modules/biz/onboarding";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
|
||||
const loading = ref(false);
|
||||
const saving = ref(false);
|
||||
@@ -293,7 +294,11 @@ async function save() {
|
||||
}
|
||||
|
||||
async function remove(row: any) {
|
||||
await ElMessageBox.confirm(`确认删除自定义变量“${row.variableCode}”?`, "删除确认", { type: "warning" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(`确认删除自定义变量“${row.variableCode}”?`, "删除确认", { type: "warning" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.deleteVariableDefinitions([row.id]);
|
||||
ElMessage.success("删除成功");
|
||||
loadData();
|
||||
|
||||
@@ -101,6 +101,7 @@ import {
|
||||
OnboardingMaterialType,
|
||||
onboardingTaskApi
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import OnboardingTemplatePanel from "./components/OnboardingTemplatePanel.vue";
|
||||
import VariableDefinitionPanel from "./components/VariableDefinitionPanel.vue";
|
||||
|
||||
@@ -152,7 +153,11 @@ async function saveMaterial() {
|
||||
}
|
||||
|
||||
async function removeMaterial(row: OnboardingMaterialType) {
|
||||
await ElMessageBox.confirm(`确认删除资料类型“${row.materialName}”吗?`, "删除确认", { type: "warning" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(`确认删除资料类型“${row.materialName}”吗?`, "删除确认", { type: "warning" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.deleteMaterialTypes([row.id!]);
|
||||
ElMessage.success("删除成功");
|
||||
await loadMaterials();
|
||||
|
||||
@@ -334,6 +334,7 @@ import {
|
||||
type OnboardingPosition
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import type { ColumnProps, ProTableInstance, EnumProps } from "@/components/ProTable/interface";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
|
||||
const activeTab = ref("company");
|
||||
|
||||
@@ -672,20 +673,32 @@ async function save() {
|
||||
}
|
||||
|
||||
async function removeCompany(row: OnboardingCompany) {
|
||||
await ElMessageBox.confirm(`确认删除公司“${row.companyName}”?`, "删除确认", { type: "warning" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(`确认删除公司“${row.companyName}”?`, "删除确认", { type: "warning" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.deleteCompany([row.id]);
|
||||
companyTable.value?.refresh();
|
||||
await loadCompanies();
|
||||
}
|
||||
|
||||
async function removeDepartment(row: OnboardingDepartment) {
|
||||
await ElMessageBox.confirm(`确认删除部门“${row.departmentName}”?`, "删除确认", { type: "warning" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(`确认删除部门“${row.departmentName}”?`, "删除确认", { type: "warning" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.deleteDepartment([row.id]);
|
||||
departmentTable.value?.refresh();
|
||||
}
|
||||
|
||||
async function removePosition(row: OnboardingPosition) {
|
||||
await ElMessageBox.confirm(`确认删除岗位“${row.positionName}”?`, "删除确认", { type: "warning" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(`确认删除岗位“${row.positionName}”?`, "删除确认", { type: "warning" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.deletePosition([row.id]);
|
||||
positionTable.value?.refresh();
|
||||
}
|
||||
|
||||
@@ -1022,6 +1022,7 @@ import {
|
||||
type OnboardingTaskContractVariableGroup
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import type { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { getMessageBoxPromptResult, isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
|
||||
const proTable = ref<ProTableInstance>();
|
||||
|
||||
@@ -1885,6 +1886,10 @@ async function copyOrShareTaskLink(row: OnboardingTask) {
|
||||
positionName: row.positionName || "岗位"
|
||||
};
|
||||
|
||||
// get-link 可能已经为过期链接自动续期,立即同步列表中的展示时间。
|
||||
row.linkExpireAt = data.expiresAt;
|
||||
proTable.value?.refresh();
|
||||
|
||||
copyText(linkUrl, "专属入职链接已复制到剪贴板!");
|
||||
shareVisible.value = true;
|
||||
} catch (err: any) {
|
||||
@@ -1984,11 +1989,14 @@ function buildContractVariableSaveValues(group: OnboardingTaskContractVariableGr
|
||||
}
|
||||
|
||||
async function approve(row: OnboardingTask) {
|
||||
await ElMessageBox.confirm(
|
||||
"确认审核通过?系统将自动创建正式员工档案并锁定签署材料快照。",
|
||||
"审核通过确认",
|
||||
{ type: "success", confirmButtonText: "审核通过", cancelButtonText: "取消" }
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(
|
||||
"确认审核通过?系统将自动创建正式员工档案并锁定签署材料快照。",
|
||||
"审核通过确认",
|
||||
{ type: "success", confirmButtonText: "审核通过", cancelButtonText: "取消" }
|
||||
)
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.approve({ taskId: row.id });
|
||||
ElMessage.success("审核通过,已成功建档!");
|
||||
@@ -1997,11 +2005,15 @@ async function approve(row: OnboardingTask) {
|
||||
}
|
||||
|
||||
async function reject(row: OnboardingTask) {
|
||||
const { value } = await ElMessageBox.prompt(
|
||||
"请输入退回补充说明(将展示给候选人查看):",
|
||||
"退回入职任务",
|
||||
{ inputPattern: /\S+/, inputErrorMessage: "退回原因不能为空", confirmButtonText: "确认退回", type: "warning" }
|
||||
const result = await getMessageBoxPromptResult(
|
||||
ElMessageBox.prompt(
|
||||
"请输入退回补充说明(将展示给候选人查看):",
|
||||
"退回入职任务",
|
||||
{ inputPattern: /\S+/, inputErrorMessage: "退回原因不能为空", confirmButtonText: "确认退回", type: "warning" }
|
||||
)
|
||||
);
|
||||
if (!result) return;
|
||||
const { value } = result;
|
||||
|
||||
await onboardingTaskApi.reject({ taskId: row.id, auditOpinion: value });
|
||||
ElMessage.warning("已退回修改,候选人可重新补录");
|
||||
@@ -2043,10 +2055,13 @@ onBeforeUnmount(clearMaterialPreviews);
|
||||
async function reviewMaterial(taskMaterialId: number, reviewStatus: string) {
|
||||
let reviewRemark = "";
|
||||
if (reviewStatus === "need_supplement") {
|
||||
const result = await ElMessageBox.prompt("请输入该材料退回补充说明:", "材料不合格退回", {
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: "请填写说明"
|
||||
});
|
||||
const result = await getMessageBoxPromptResult(
|
||||
ElMessageBox.prompt("请输入该材料退回补充说明:", "材料不合格退回", {
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: "请填写说明"
|
||||
})
|
||||
);
|
||||
if (!result) return;
|
||||
reviewRemark = result.value;
|
||||
}
|
||||
|
||||
@@ -2059,7 +2074,11 @@ async function reviewMaterial(taskMaterialId: number, reviewStatus: string) {
|
||||
}
|
||||
|
||||
async function archive(row: OnboardingTask) {
|
||||
await ElMessageBox.confirm("确认归档该入职任务?", "归档任务", { type: "info" });
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm("确认归档该入职任务?", "归档任务", { type: "info" })
|
||||
);
|
||||
if (!confirmed) return;
|
||||
|
||||
await onboardingTaskApi.archive({ taskId: row.id });
|
||||
ElMessage.success("任务已归档");
|
||||
detailVisible.value = false;
|
||||
@@ -2067,11 +2086,14 @@ async function archive(row: OnboardingTask) {
|
||||
}
|
||||
|
||||
async function revoke(row: OnboardingTask) {
|
||||
await ElMessageBox.confirm(
|
||||
"撤销后候选人填写链接将立即失效,确定继续撤销吗?",
|
||||
"撤销任务",
|
||||
{ type: "error", confirmButtonText: "确定撤销", cancelButtonText: "取消" }
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(
|
||||
"撤销后候选人填写链接将立即失效,确定继续撤销吗?",
|
||||
"撤销任务",
|
||||
{ type: "error", confirmButtonText: "确定撤销", cancelButtonText: "取消" }
|
||||
)
|
||||
);
|
||||
if (!confirmed) return;
|
||||
await onboardingTaskApi.revoke({ taskId: row.id });
|
||||
ElMessage.success("任务已撤销");
|
||||
detailVisible.value = false;
|
||||
@@ -2079,11 +2101,14 @@ async function revoke(row: OnboardingTask) {
|
||||
}
|
||||
|
||||
async function removeTask(row: OnboardingTask) {
|
||||
await ElMessageBox.confirm(
|
||||
`确认永久删除已撤销的入职任务【${row.taskNo}】吗?此操作将清理该任务全部数据,且不可恢复。`,
|
||||
"删除任务确认",
|
||||
{ type: "error", confirmButtonText: "确定删除", cancelButtonText: "取消" }
|
||||
const confirmed = await isMessageBoxConfirmed(
|
||||
ElMessageBox.confirm(
|
||||
`确认永久删除已撤销的入职任务【${row.taskNo}】吗?此操作将清理该任务全部数据,且不可恢复。`,
|
||||
"删除任务确认",
|
||||
{ type: "error", confirmButtonText: "确定删除", cancelButtonText: "取消" }
|
||||
)
|
||||
);
|
||||
if (!confirmed) return;
|
||||
await onboardingTaskApi.deleteTask(row.id);
|
||||
ElMessage.success("入职任务已删除");
|
||||
detailVisible.value = false;
|
||||
|
||||
Reference in New Issue
Block a user