Compare commits
2
Commits
0db1848b10
...
446e83eed1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
446e83eed1 | ||
|
|
4371eca6c4 |
@@ -59,6 +59,7 @@ async function requestContractPreview(
|
||||
|
||||
export interface OnboardingTask {
|
||||
id: number;
|
||||
createUserId?: number | string;
|
||||
taskNo: string;
|
||||
companyId: number;
|
||||
companyName?: string;
|
||||
@@ -190,6 +191,7 @@ export interface OnboardingPositionOption {
|
||||
}
|
||||
|
||||
export interface OnboardingCompany extends OnboardingCompanyOption {
|
||||
createUserId?: number | string;
|
||||
companyCode: string;
|
||||
legalName: string;
|
||||
unifiedSocialCreditCode?: string;
|
||||
@@ -203,6 +205,7 @@ export interface OnboardingCompany extends OnboardingCompanyOption {
|
||||
}
|
||||
|
||||
export interface OnboardingDepartment extends OnboardingDepartmentOption {
|
||||
createUserId?: number | string;
|
||||
companyId: number;
|
||||
companyName?: string;
|
||||
departmentCode: string;
|
||||
@@ -213,6 +216,7 @@ export interface OnboardingDepartment extends OnboardingDepartmentOption {
|
||||
}
|
||||
|
||||
export interface OnboardingPosition extends OnboardingPositionOption {
|
||||
createUserId?: number | string;
|
||||
companyId: number;
|
||||
companyName?: string;
|
||||
departmentId?: number;
|
||||
@@ -226,6 +230,7 @@ export interface OnboardingPosition extends OnboardingPositionOption {
|
||||
|
||||
export interface OnboardingContractTemplate {
|
||||
id: number;
|
||||
createUserId?: number | string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
departmentId?: number;
|
||||
@@ -287,6 +292,7 @@ export interface OnboardingTaskContractVariableGroup {
|
||||
|
||||
export interface OnboardingEmployee {
|
||||
id: number;
|
||||
createUserId?: number | string;
|
||||
employeeNo?: string;
|
||||
employeeName: string;
|
||||
companyId: number;
|
||||
@@ -307,8 +313,24 @@ export interface OnboardingEmployee {
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/** 不受快捷维度筛选影响的正式员工统计。 */
|
||||
export interface OnboardingEmployeeStatistics {
|
||||
total: number;
|
||||
fullTime: number;
|
||||
partTime: number;
|
||||
probation: number;
|
||||
socialPurchased: number;
|
||||
expiringContract: number;
|
||||
}
|
||||
|
||||
/** 附带统计的正式员工档案分页结果。 */
|
||||
export interface OnboardingEmployeePage extends ResPage<OnboardingEmployee> {
|
||||
statistics: OnboardingEmployeeStatistics;
|
||||
}
|
||||
|
||||
export interface OnboardingFormField {
|
||||
id: number;
|
||||
createUserId?: number | string;
|
||||
fieldCode: string;
|
||||
fieldName: string;
|
||||
dataType: string;
|
||||
@@ -320,6 +342,7 @@ export interface OnboardingFormField {
|
||||
|
||||
export interface OnboardingMaterialType {
|
||||
id: number;
|
||||
createUserId?: number | string;
|
||||
materialCode: string;
|
||||
materialName: string;
|
||||
allowedExtensions?: string;
|
||||
@@ -350,6 +373,7 @@ export interface OnboardingTemplateMaterialConfig {
|
||||
|
||||
export interface OnboardingTemplate {
|
||||
id: number;
|
||||
createUserId?: number | string;
|
||||
templateCode: string;
|
||||
templateName: string;
|
||||
companyId: number;
|
||||
@@ -815,9 +839,10 @@ export const onboardingTaskApi = {
|
||||
},
|
||||
|
||||
employeePage(params: Record<string, unknown>) {
|
||||
return moduleRequest("/biz/onboarding/employee/").get<
|
||||
ResPage<OnboardingEmployee>
|
||||
>("page", params);
|
||||
return moduleRequest("/biz/onboarding/employee/").get<OnboardingEmployeePage>(
|
||||
"page",
|
||||
params
|
||||
);
|
||||
},
|
||||
|
||||
employeeExport(params: Record<string, unknown>) {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* @see https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||
*/
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
import type { Directive, DirectiveBinding } from "vue";
|
||||
|
||||
/**
|
||||
@@ -32,6 +33,8 @@ const auth: Directive = {
|
||||
const { value, arg } = binding;
|
||||
// 获取authStore
|
||||
const authStore = useAuthStore();
|
||||
const userStore = useUserStore();
|
||||
if ((userStore.userInfoGet?.roleCodeList || []).includes("superAdmin")) return;
|
||||
// 获取用户权限按钮列表
|
||||
const currentPageRoles = authStore.authButtonListGet ?? [];
|
||||
// 如果传入的值是数组,并且数组的长度大于0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { computed } from "vue";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
|
||||
export interface OnboardingOwnedRecord {
|
||||
createUserId?: number | string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 入职业务页面统一权限判断:按钮权限控制功能入口,创建人/管理全部权限控制数据操作范围。
|
||||
*/
|
||||
export function useOnboardingPermission(manageAllCode: string) {
|
||||
const authStore = useAuthStore();
|
||||
const userStore = useUserStore();
|
||||
|
||||
const isSuperAdmin = computed(() =>
|
||||
(userStore.userInfoGet?.roleCodeList || []).includes("superAdmin")
|
||||
);
|
||||
const canManageAll = computed(
|
||||
() =>
|
||||
isSuperAdmin.value ||
|
||||
authStore.authButtonListGet.includes(manageAllCode)
|
||||
);
|
||||
|
||||
const hasAction = (code: string) =>
|
||||
isSuperAdmin.value || authStore.authButtonListGet.includes(code);
|
||||
|
||||
const canManage = (record?: OnboardingOwnedRecord | null) => {
|
||||
if (canManageAll.value) return true;
|
||||
if (record?.createUserId == null || userStore.userInfoGet?.id == null)
|
||||
return false;
|
||||
return String(record.createUserId) === String(userStore.userInfoGet.id);
|
||||
};
|
||||
|
||||
const disabledReason = (record?: OnboardingOwnedRecord | null) =>
|
||||
canManage(record) ? "" : "只能操作本人创建的数据";
|
||||
|
||||
return {
|
||||
isSuperAdmin,
|
||||
canManageAll,
|
||||
hasAction,
|
||||
canManage,
|
||||
disabledReason
|
||||
};
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
:request-api="onboardingTaskApi.templatePage"
|
||||
>
|
||||
<template #tableHeader>
|
||||
<el-button type="primary" icon="Plus" @click="openTemplateCreate">
|
||||
<el-button v-auth="'onboardingContractAdd'" type="primary" icon="Plus" @click="openTemplateCreate">
|
||||
新增签署材料模板
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -50,11 +50,27 @@
|
||||
版本与配置
|
||||
</el-button>
|
||||
|
||||
<el-button link type="primary" icon="Edit" @click="openTemplateEdit(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingContractEdit'"
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openTemplateEdit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
<el-button link type="danger" icon="Delete" @click="removeTemplate(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingContractDelete'"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="removeTemplate(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -184,7 +200,14 @@
|
||||
<el-tab-pane label="版本与DOCX模板" name="versions">
|
||||
<div class="tab-pane-content">
|
||||
<div class="pane-action-bar">
|
||||
<el-button type="primary" icon="Upload" @click="openVersionCreate">
|
||||
<el-button
|
||||
v-auth="'onboardingContractVersionAdd'"
|
||||
type="primary"
|
||||
icon="Upload"
|
||||
:disabled="!canManage(selectedTemplate)"
|
||||
:title="disabledReason(selectedTemplate)"
|
||||
@click="openVersionCreate"
|
||||
>
|
||||
上传新版本 DOCX
|
||||
</el-button>
|
||||
<span class="pane-tip-text">
|
||||
@@ -233,29 +256,38 @@
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingContractVersionStatus'"
|
||||
v-if="scope.row.versionStatus !== 'enabled'"
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
:disabled="!canManage(selectedTemplate)"
|
||||
:title="disabledReason(selectedTemplate)"
|
||||
@click="changeVersionStatus(scope.row, 'enabled')"
|
||||
>
|
||||
启用
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingContractVersionStatus'"
|
||||
v-else
|
||||
link
|
||||
type="warning"
|
||||
icon="Close"
|
||||
:disabled="!canManage(selectedTemplate)"
|
||||
:title="disabledReason(selectedTemplate)"
|
||||
@click="changeVersionStatus(scope.row, 'disabled')"
|
||||
>
|
||||
停用
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingContractVersionDelete'"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(selectedTemplate)"
|
||||
:title="disabledReason(selectedTemplate)"
|
||||
@click="removeVersion(scope.row)"
|
||||
>
|
||||
删除
|
||||
@@ -405,7 +437,15 @@
|
||||
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="openVariableEdit(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingContractVariableEdit'"
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="!canManage(selectedTemplate)"
|
||||
:title="disabledReason(selectedTemplate)"
|
||||
@click="openVariableEdit(scope.row)"
|
||||
>
|
||||
检查调整
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -501,6 +541,9 @@ import {
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import type { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingContractManageAll");
|
||||
|
||||
const templateTable = ref<ProTableInstance>();
|
||||
const selectedTemplate = ref<OnboardingContractTemplate>();
|
||||
|
||||
@@ -1,20 +1,53 @@
|
||||
<template>
|
||||
<div class="table-box">
|
||||
<ProTable ref="proTable" title="员工档案" :columns="columns" :request-api="onboardingTaskApi.employeePage">
|
||||
<ProTable ref="proTable" title="员工档案" :columns="columns" :request-api="getTableData">
|
||||
<template #tableHeader>
|
||||
<el-button type="primary" plain icon="Download" :loading="exporting" @click="exportEmployees">
|
||||
导出当前筛选结果
|
||||
</el-button>
|
||||
<div class="employee-table-toolbar">
|
||||
<el-button v-auth="'onboardingEmployeeExport'" type="primary" plain icon="Download" :loading="exporting" @click="exportEmployees">
|
||||
导出当前筛选结果
|
||||
</el-button>
|
||||
<div class="employee-metric-filters">
|
||||
<el-tooltip
|
||||
v-for="item in metricFilters"
|
||||
:key="item.key"
|
||||
:content="item.tooltip"
|
||||
placement="top"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="metric-filter"
|
||||
:class="[`tone-${item.tone}`, { 'is-active': activeMetricKey === item.key }]"
|
||||
:aria-pressed="activeMetricKey === item.key"
|
||||
@click="toggleMetricFilter(item.key)"
|
||||
>
|
||||
<el-icon><component :is="item.icon" /></el-icon>
|
||||
<span class="metric-filter-label">{{ item.label }}</span>
|
||||
<strong class="metric-filter-count">{{ item.count }}</strong>
|
||||
</button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #operation="scope">
|
||||
<el-button link type="primary" icon="UserFilled" @click="showDetail(scope.row)">查看档案</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="openHrEdit(scope.row)">编辑人事信息</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEmployeeHrEdit'"
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openHrEdit(scope.row)"
|
||||
>编辑人事信息</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEmployeeRegularize'"
|
||||
v-if="canRegularize(scope.row)"
|
||||
link
|
||||
type="success"
|
||||
icon="CircleCheck"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openRegularization(scope.row)"
|
||||
>
|
||||
办理转正
|
||||
@@ -372,19 +405,33 @@
|
||||
</el-tabs>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button v-if="detail?.employee" type="primary" plain @click="openHrEdit(detail.employee)">编辑人事信息</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEmployeeHrEdit'"
|
||||
v-if="detail?.employee"
|
||||
type="primary"
|
||||
plain
|
||||
:disabled="!canManage(detail.employee)"
|
||||
:title="disabledReason(detail.employee)"
|
||||
@click="openHrEdit(detail.employee)"
|
||||
>编辑人事信息</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEmployeeRegularize'"
|
||||
v-if="detail?.employee && canRegularize(detail.employee)"
|
||||
type="success"
|
||||
plain
|
||||
:disabled="!canManage(detail.employee)"
|
||||
:title="disabledReason(detail.employee)"
|
||||
@click="openRegularization(detail.employee)"
|
||||
>
|
||||
办理转正
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEmployeeRegularizationRevoke'"
|
||||
v-if="detail?.employee?.regularizationStatus === 'regular'"
|
||||
type="danger"
|
||||
plain
|
||||
:disabled="!canManage(detail.employee)"
|
||||
:title="disabledReason(detail.employee)"
|
||||
@click="revokeRegularization(detail.employee)"
|
||||
>
|
||||
撤销转正
|
||||
@@ -498,7 +545,17 @@
|
||||
|
||||
<script setup lang="ts" name="onboardingEmployee">
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from "vue";
|
||||
import { Document, Download, UserFilled } from "@element-plus/icons-vue";
|
||||
import {
|
||||
Briefcase,
|
||||
Clock,
|
||||
Connection,
|
||||
Document,
|
||||
Download,
|
||||
FirstAidKit,
|
||||
User,
|
||||
UserFilled,
|
||||
WarningFilled
|
||||
} from "@element-plus/icons-vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import type { UploadFile, UploadRequestOptions, UploadUserFile } from "element-plus";
|
||||
import {
|
||||
@@ -510,8 +567,140 @@ import {
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import type { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { getMessageBoxPromptResult, isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingEmployeeManageAll");
|
||||
|
||||
const proTable = ref<ProTableInstance>();
|
||||
|
||||
// 统计数量
|
||||
const statistics = reactive({
|
||||
total: 0,
|
||||
fullTime: 0,
|
||||
partTime: 0,
|
||||
probation: 0,
|
||||
socialPurchased: 0,
|
||||
expiringContract: 0
|
||||
});
|
||||
|
||||
const activeMetricKey = ref<string>("total");
|
||||
|
||||
const metricFilters = computed(() => [
|
||||
{
|
||||
key: "total",
|
||||
label: "在册总数",
|
||||
count: statistics.total,
|
||||
icon: User,
|
||||
tone: "blue",
|
||||
tooltip: activeMetricKey.value === "total" ? "当前显示全部在册员工" : "点击查看全部在册员工"
|
||||
},
|
||||
{
|
||||
key: "full_time",
|
||||
label: "正式员工",
|
||||
count: statistics.fullTime,
|
||||
icon: Briefcase,
|
||||
tone: "green",
|
||||
tooltip: activeMetricKey.value === "full_time" ? "再次点击取消筛选" : "点击筛选正式员工"
|
||||
},
|
||||
{
|
||||
key: "part_time",
|
||||
label: "兼职员工",
|
||||
count: statistics.partTime,
|
||||
icon: Connection,
|
||||
tone: "purple",
|
||||
tooltip: activeMetricKey.value === "part_time" ? "再次点击取消筛选" : "点击筛选兼职员工"
|
||||
},
|
||||
{
|
||||
key: "probation",
|
||||
label: "试用期待转正",
|
||||
count: statistics.probation,
|
||||
icon: Clock,
|
||||
tone: "orange",
|
||||
tooltip: activeMetricKey.value === "probation" ? "再次点击取消筛选" : "点击筛选试用期待转正员工"
|
||||
},
|
||||
{
|
||||
key: "social_purchased",
|
||||
label: "社保已缴纳",
|
||||
count: statistics.socialPurchased,
|
||||
icon: FirstAidKit,
|
||||
tone: "teal",
|
||||
tooltip: activeMetricKey.value === "social_purchased" ? "再次点击取消筛选" : "点击筛选社保已缴纳员工"
|
||||
},
|
||||
{
|
||||
key: "expiring_contract",
|
||||
label: "合同即将到期",
|
||||
count: statistics.expiringContract,
|
||||
icon: WarningFilled,
|
||||
tone: "red",
|
||||
tooltip: activeMetricKey.value === "expiring_contract" ? "再次点击取消筛选" : "点击筛选合同30天内到期或已到期员工"
|
||||
}
|
||||
]);
|
||||
|
||||
/** 点击统计项筛选员工,再次点击同一项取消筛选并返回全部。 */
|
||||
function toggleMetricFilter(key: string) {
|
||||
if (!proTable.value?.searchParam) return;
|
||||
|
||||
const isAlreadyActive = activeMetricKey.value === key;
|
||||
|
||||
// 清空快捷维度相关筛选
|
||||
proTable.value.searchParam.employmentType = undefined;
|
||||
proTable.value.searchParam.regularizationStatus = undefined;
|
||||
proTable.value.searchParam.socialInsuranceStatus = undefined;
|
||||
proTable.value.searchParam.contractExpiringSoon = undefined;
|
||||
|
||||
if (isAlreadyActive || key === "total") {
|
||||
activeMetricKey.value = "total";
|
||||
} else {
|
||||
activeMetricKey.value = key;
|
||||
if (key === "full_time") {
|
||||
proTable.value.searchParam.employmentType = "full_time";
|
||||
} else if (key === "part_time") {
|
||||
proTable.value.searchParam.employmentType = "part_time";
|
||||
} else if (key === "probation") {
|
||||
proTable.value.searchParam.regularizationStatus = "probation";
|
||||
} else if (key === "social_purchased") {
|
||||
proTable.value.searchParam.socialInsuranceStatus = "purchased";
|
||||
} else if (key === "expiring_contract") {
|
||||
proTable.value.searchParam.contractExpiringSoon = true;
|
||||
}
|
||||
}
|
||||
|
||||
proTable.value.search();
|
||||
}
|
||||
|
||||
/** 列表查询及统计数据刷新 */
|
||||
async function getTableData(params: any) {
|
||||
const res = await onboardingTaskApi.employeePage(params);
|
||||
|
||||
// 同步高亮选中的统计徽章
|
||||
if (params.contractExpiringSoon === true || params.contractExpiringSoon === "true") {
|
||||
activeMetricKey.value = "expiring_contract";
|
||||
} else if (params.regularizationStatus === "probation" && !params.employmentType && !params.socialInsuranceStatus) {
|
||||
activeMetricKey.value = "probation";
|
||||
} else if (params.socialInsuranceStatus === "purchased" && !params.employmentType && !params.regularizationStatus) {
|
||||
activeMetricKey.value = "social_purchased";
|
||||
} else if (params.employmentType === "full_time" && !params.regularizationStatus && !params.socialInsuranceStatus) {
|
||||
activeMetricKey.value = "full_time";
|
||||
} else if (params.employmentType === "part_time" && !params.regularizationStatus && !params.socialInsuranceStatus) {
|
||||
activeMetricKey.value = "part_time";
|
||||
} else if (!params.employmentType && !params.regularizationStatus && !params.socialInsuranceStatus && !params.contractExpiringSoon) {
|
||||
activeMetricKey.value = "total";
|
||||
} else {
|
||||
activeMetricKey.value = "";
|
||||
}
|
||||
|
||||
const stats = res.data?.statistics;
|
||||
if (stats) {
|
||||
statistics.total = stats.total ?? 0;
|
||||
statistics.fullTime = stats.fullTime ?? 0;
|
||||
statistics.partTime = stats.partTime ?? 0;
|
||||
statistics.probation = stats.probation ?? 0;
|
||||
statistics.socialPurchased = stats.socialPurchased ?? 0;
|
||||
statistics.expiringContract = stats.expiringContract ?? 0;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
const detailVisible = ref(false);
|
||||
const activeTab = ref("basic");
|
||||
const detail = ref<any>();
|
||||
@@ -1649,4 +1838,110 @@ onBeforeUnmount(clearMaterialPreviews);
|
||||
color: var(--el-color-primary);
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
|
||||
/* 员工统计与快捷筛选工具栏 */
|
||||
.employee-table-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.employee-metric-filters {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.metric-filter {
|
||||
--metric-color: #64748b;
|
||||
--metric-bg: #f8fafc;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
height: 32px;
|
||||
padding: 0 10px;
|
||||
color: var(--el-text-color-regular);
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.metric-filter:hover {
|
||||
color: var(--metric-color);
|
||||
border-color: var(--metric-color);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.metric-filter.is-active {
|
||||
color: var(--metric-color);
|
||||
background: var(--metric-bg);
|
||||
border-color: var(--metric-color);
|
||||
box-shadow: inset 0 0 0 1px var(--metric-color);
|
||||
}
|
||||
|
||||
.metric-filter.tone-blue {
|
||||
--metric-color: #2563eb;
|
||||
--metric-bg: #eff6ff;
|
||||
}
|
||||
|
||||
.metric-filter.tone-green {
|
||||
--metric-color: #059669;
|
||||
--metric-bg: #ecfdf5;
|
||||
}
|
||||
|
||||
.metric-filter.tone-purple {
|
||||
--metric-color: #7c3aed;
|
||||
--metric-bg: #f5f3ff;
|
||||
}
|
||||
|
||||
.metric-filter.tone-orange {
|
||||
--metric-color: #d97706;
|
||||
--metric-bg: #fffbeb;
|
||||
}
|
||||
|
||||
.metric-filter.tone-teal {
|
||||
--metric-color: #0d9488;
|
||||
--metric-bg: #f0fdfa;
|
||||
}
|
||||
|
||||
.metric-filter.tone-red {
|
||||
--metric-color: #dc2626;
|
||||
--metric-bg: #fef2f2;
|
||||
}
|
||||
|
||||
.metric-filter .el-icon {
|
||||
color: var(--metric-color);
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.metric-filter-label {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.metric-filter-count {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 20px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
color: var(--metric-color);
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
background: var(--metric-bg);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.metric-filter.is-active .metric-filter-count {
|
||||
color: #fff;
|
||||
background: var(--metric-color);
|
||||
}
|
||||
</style>
|
||||
@@ -57,7 +57,7 @@
|
||||
<el-button type="primary" icon="Search" @click="loadTemplates">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
<div class="toolbar-spacer" />
|
||||
<el-button type="primary" icon="Plus" @click="openCreate">新增入职模板</el-button>
|
||||
<el-button v-auth="'onboardingEntryConfigAdd'" type="primary" icon="Plus" @click="openCreate">新增入职模板</el-button>
|
||||
</div>
|
||||
|
||||
<el-alert title="入职模板统一管理公司、岗位、签署材料文件与员工上传材料;员工入职档案自动采用标准《入职登记表》。" type="info" :closable="false" show-icon
|
||||
@@ -90,8 +90,22 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="openEdit(scope.row)">编辑</el-button>
|
||||
<el-button link type="danger" @click="removeTemplate(scope.row)">删除</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEntryConfigEdit'"
|
||||
link
|
||||
type="primary"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openEdit(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEntryConfigDelete'"
|
||||
link
|
||||
type="danger"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="removeTemplate(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -293,6 +307,9 @@ import {
|
||||
onboardingTaskApi
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingEntryConfigManageAll");
|
||||
|
||||
const loading = ref(false);
|
||||
const saving = ref(false);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-button type="primary" icon="Search" @click="loadData">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
<div class="spacer"></div>
|
||||
<el-button type="primary" icon="Plus" @click="openCreate">新增自定义变量</el-button>
|
||||
<el-button v-auth="'onboardingEntryConfigAdd'" type="primary" icon="Plus" @click="openCreate">新增自定义变量</el-button>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
@@ -80,12 +80,23 @@
|
||||
<el-table-column label="操作" width="160" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;">
|
||||
<el-button link type="primary" icon="Edit" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEntryConfigEdit'"
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="!canManage(row)"
|
||||
:title="disabledReason(row)"
|
||||
@click="openEdit(row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingEntryConfigDelete'"
|
||||
v-if="!row.isBuiltIn"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(row)"
|
||||
:title="disabledReason(row)"
|
||||
@click="remove(row)"
|
||||
>
|
||||
删除
|
||||
@@ -171,6 +182,9 @@ 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";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingEntryConfigManageAll");
|
||||
|
||||
const loading = ref(false);
|
||||
const saving = ref(false);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<el-tab-pane label="上传资料类型" name="materials">
|
||||
<div class="tab-card-wrapper material-tab-wrapper">
|
||||
<div class="toolbar">
|
||||
<el-button type="primary" icon="Plus" @click="openMaterialCreate">
|
||||
<el-button v-auth="'onboardingEntryConfigAdd'" type="primary" icon="Plus" @click="openMaterialCreate">
|
||||
新增资料类型
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -35,11 +35,27 @@
|
||||
|
||||
<el-table-column label="操作" width="150" fixed="right" align="center">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="openMaterialEdit(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingEntryConfigEdit'"
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openMaterialEdit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
<el-button link type="danger" icon="Delete" @click="removeMaterial(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingEntryConfigDelete'"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="removeMaterial(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -57,7 +73,7 @@
|
||||
|
||||
<!-- 资料类型弹窗 -->
|
||||
<el-dialog v-model="materialVisible" :title="materialForm.id ? '编辑资料类型' : '新增资料类型'" width="560px" destroy-on-close>
|
||||
<el-form :model="materialForm" label-width="110px">
|
||||
<el-form :model="materialForm" label-width="120px" class="material-form">
|
||||
<el-form-item label="资料编码" required>
|
||||
<el-input v-model="materialForm.materialCode" />
|
||||
</el-form-item>
|
||||
@@ -72,10 +88,12 @@
|
||||
|
||||
<el-form-item label="最大文件数">
|
||||
<el-input-number v-model="materialForm.maxFileCount" :min="1" :max="10" />
|
||||
<span class="unit-suffix">个</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单文件大小(MB)">
|
||||
<el-form-item label="单文件大小">
|
||||
<el-input-number v-model="materialForm.maxFileSizeMb" :min="1" :max="100" />
|
||||
<span class="unit-suffix">MB</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态">
|
||||
@@ -104,6 +122,9 @@ import {
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import OnboardingTemplatePanel from "./components/OnboardingTemplatePanel.vue";
|
||||
import VariableDefinitionPanel from "./components/VariableDefinitionPanel.vue";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingEntryConfigManageAll");
|
||||
|
||||
const activeTab = ref("variables");
|
||||
const materialTypes = ref<OnboardingMaterialType[]>([]);
|
||||
@@ -225,4 +246,14 @@ onMounted(() => {
|
||||
.toolbar {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
.material-form :deep(.el-form-item__label) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.unit-suffix {
|
||||
margin-left: 10px;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:search-col="5"
|
||||
>
|
||||
<template #tableHeader>
|
||||
<el-button type="primary" icon="Plus" @click="openCompanyCreate">
|
||||
<el-button v-auth="'onboardingSetupAdd'" type="primary" icon="Plus" @click="openCompanyCreate">
|
||||
新增入职公司
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -33,11 +33,27 @@
|
||||
</template>
|
||||
|
||||
<template #operation="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="openCompanyEdit(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingSetupEdit'"
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openCompanyEdit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
<el-button link type="danger" icon="Delete" @click="removeCompany(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingSetupDelete'"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="removeCompany(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -56,7 +72,7 @@
|
||||
:search-col="5"
|
||||
>
|
||||
<template #tableHeader>
|
||||
<el-button type="primary" icon="Plus" @click="openDepartmentCreate">
|
||||
<el-button v-auth="'onboardingSetupAdd'" type="primary" icon="Plus" @click="openDepartmentCreate">
|
||||
新增入职部门
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -74,11 +90,27 @@
|
||||
</template>
|
||||
|
||||
<template #operation="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="openDepartmentEdit(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingSetupEdit'"
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openDepartmentEdit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
<el-button link type="danger" icon="Delete" @click="removeDepartment(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingSetupDelete'"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="removeDepartment(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -97,7 +129,7 @@
|
||||
:search-col="5"
|
||||
>
|
||||
<template #tableHeader>
|
||||
<el-button type="primary" icon="Plus" @click="openPositionCreate">
|
||||
<el-button v-auth="'onboardingSetupAdd'" type="primary" icon="Plus" @click="openPositionCreate">
|
||||
新增入职岗位
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -122,11 +154,27 @@
|
||||
</template>
|
||||
|
||||
<template #operation="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="openPositionEdit(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingSetupEdit'"
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openPositionEdit(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
<el-button link type="danger" icon="Delete" @click="removePosition(scope.row)">
|
||||
<el-button
|
||||
v-auth="'onboardingSetupDelete'"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="removePosition(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -151,6 +199,7 @@
|
||||
:model="companyForm"
|
||||
:rules="companyRules"
|
||||
label-width="140px"
|
||||
class="setup-form"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
@@ -177,6 +226,7 @@
|
||||
placeholder="18位统一社会信用代码"
|
||||
maxlength="18"
|
||||
clearable
|
||||
@input="val => companyForm.unifiedSocialCreditCode = (val || '').toUpperCase()"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -377,6 +427,9 @@ import {
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import type { ColumnProps, ProTableInstance, EnumProps } from "@/components/ProTable/interface";
|
||||
import { isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingSetupManageAll");
|
||||
|
||||
const activeTab = ref("company");
|
||||
|
||||
@@ -446,7 +499,7 @@ const companyRules = reactive<FormRules>({
|
||||
{ required: true, message: "请输入公司编码", trigger: "blur" },
|
||||
{
|
||||
pattern: /^[a-zA-Z0-9_-]{2,50}$/,
|
||||
message: "公司编码格式不正确,支持2-50位字母、数字、下划线或短横线",
|
||||
message: "支持2-50位字母、数字、下划线或短横线",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
@@ -461,8 +514,8 @@ const companyRules = reactive<FormRules>({
|
||||
unifiedSocialCreditCode: [
|
||||
{ required: true, message: "请输入统一社会信用代码", trigger: "blur" },
|
||||
{
|
||||
pattern: /^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/i,
|
||||
message: "统一社会信用代码格式不正确,请输入18位标准社会信用代码",
|
||||
pattern: /^[0-9A-Za-z]{18}$/,
|
||||
message: "请输入18位统一社会信用代码",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
@@ -470,7 +523,7 @@ const companyRules = reactive<FormRules>({
|
||||
{ required: true, message: "请输入法定代表人姓名", trigger: "blur" },
|
||||
{
|
||||
pattern: /^[\u4e00-\u9fa5a-zA-Z·.\s]{2,20}$/,
|
||||
message: "法定代表人姓名格式不正确,请输入2-20位中英文姓名",
|
||||
message: "请输入2-20位中英文姓名",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
@@ -478,7 +531,7 @@ const companyRules = reactive<FormRules>({
|
||||
{ required: true, message: "请输入企业联系电话", trigger: "blur" },
|
||||
{
|
||||
pattern: /^(1[3-9]\d{9}|(0\d{2,3}-?)?\d{7,8}|400(-?\d{3,4}){2})$/,
|
||||
message: "联系电话格式不正确,请输入有效的手机号或固话号码",
|
||||
message: "请输入有效的手机号或固话号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
@@ -492,14 +545,14 @@ const companyRules = reactive<FormRules>({
|
||||
qiyuesuoCategoryId: [
|
||||
{
|
||||
pattern: /^\d*$/,
|
||||
message: "契约锁业务分类 Id 必须为纯数字",
|
||||
message: "业务分类 Id 必须为纯数字",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
qiyuesuoSealId: [
|
||||
{
|
||||
pattern: /^\d*$/,
|
||||
message: "契约锁企业印章 Id 必须为纯数字",
|
||||
message: "企业印章 Id 必须为纯数字",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
@@ -909,4 +962,13 @@ onMounted(loadCompanies);
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.setup-form :deep(.el-form-item) {
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
.setup-form :deep(.el-form-item__error) {
|
||||
padding-top: 3px;
|
||||
line-height: 1.25;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
>
|
||||
<template #tableHeader>
|
||||
<div class="task-table-toolbar">
|
||||
<el-button type="primary" icon="Plus" @click="openCreate">
|
||||
<el-button v-auth="'onboardingTaskCreate'" type="primary" icon="Plus" @click="openCreate">
|
||||
发起入职任务
|
||||
</el-button>
|
||||
<div class="task-metric-filters">
|
||||
@@ -63,59 +63,77 @@
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskVariableEdit'"
|
||||
v-if="['pending_fill', 'rejected'].includes(scope.row.taskStatus)"
|
||||
link
|
||||
type="primary"
|
||||
icon="Setting"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openContractVariables(scope.row)"
|
||||
>
|
||||
签署材料参数
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskCopy'"
|
||||
link
|
||||
type="success"
|
||||
icon="CopyDocument"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="openCopyTask(scope.row)"
|
||||
>
|
||||
复制任务
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskLink'"
|
||||
v-if="['pending_fill', 'rejected'].includes(scope.row.taskStatus)"
|
||||
link
|
||||
type="warning"
|
||||
icon="CopyDocument"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="copyOrShareTaskLink(scope.row)"
|
||||
>
|
||||
复制链接
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskAudit'"
|
||||
v-if="scope.row.taskStatus === 'reviewing'"
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="approve(scope.row)"
|
||||
>
|
||||
通过
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskAudit'"
|
||||
v-if="scope.row.taskStatus === 'reviewing'"
|
||||
link
|
||||
type="danger"
|
||||
icon="Close"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="reject(scope.row)"
|
||||
>
|
||||
退回
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskArchive'"
|
||||
v-if="scope.row.taskStatus === 'approved'"
|
||||
link
|
||||
type="info"
|
||||
icon="FolderChecked"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="archive(scope.row)"
|
||||
>
|
||||
归档
|
||||
@@ -132,20 +150,26 @@
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskRevoke'"
|
||||
v-if="['pending_fill', 'reviewing', 'rejected'].includes(scope.row.taskStatus)"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="revoke(scope.row)"
|
||||
>
|
||||
撤销
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskDelete'"
|
||||
v-if="scope.row.taskStatus === 'revoked'"
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(scope.row)"
|
||||
:title="disabledReason(scope.row)"
|
||||
@click="removeTask(scope.row)"
|
||||
>
|
||||
删除
|
||||
@@ -813,19 +837,23 @@
|
||||
|
||||
<div v-if="detail.task.taskStatus === 'reviewing'" class="review-btn-group">
|
||||
<el-button
|
||||
v-auth="'onboardingTaskMaterialReview'"
|
||||
size="small"
|
||||
type="success"
|
||||
plain
|
||||
:disabled="item.reviewStatus === 'passed'"
|
||||
:disabled="item.reviewStatus === 'passed' || !canManage(detail.task)"
|
||||
:title="disabledReason(detail.task)"
|
||||
@click="reviewMaterial(item.id, 'passed')"
|
||||
>
|
||||
合格
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskMaterialReview'"
|
||||
size="small"
|
||||
type="danger"
|
||||
plain
|
||||
:disabled="item.reviewStatus === 'need_supplement'"
|
||||
:disabled="item.reviewStatus === 'need_supplement' || !canManage(detail.task)"
|
||||
:title="disabledReason(detail.task)"
|
||||
@click="reviewMaterial(item.id, 'need_supplement')"
|
||||
>
|
||||
需补充
|
||||
@@ -854,11 +882,14 @@
|
||||
</div>
|
||||
<div class="contract-right">
|
||||
<el-button
|
||||
v-auth="'onboardingTaskContractGenerate'"
|
||||
v-if="!item.generatedDocxFileId"
|
||||
type="primary"
|
||||
plain
|
||||
size="small"
|
||||
icon="DocumentChecked"
|
||||
:disabled="!canManage(detail.task)"
|
||||
:title="disabledReason(detail.task)"
|
||||
@click="generate(item.id)"
|
||||
>
|
||||
生成DOCX签署材料
|
||||
@@ -911,25 +942,34 @@
|
||||
<div v-if="detail" class="drawer-footer-actions">
|
||||
<div class="drawer-footer-right">
|
||||
<el-button
|
||||
v-auth="'onboardingTaskAudit'"
|
||||
v-if="detail.task.taskStatus === 'reviewing'"
|
||||
type="danger"
|
||||
icon="Close"
|
||||
:disabled="!canManage(detail.task)"
|
||||
:title="disabledReason(detail.task)"
|
||||
@click="reject(detail.task)"
|
||||
>
|
||||
退回修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskAudit'"
|
||||
v-if="detail.task.taskStatus === 'reviewing'"
|
||||
type="success"
|
||||
icon="Check"
|
||||
:disabled="!canManage(detail.task)"
|
||||
:title="disabledReason(detail.task)"
|
||||
@click="approve(detail.task)"
|
||||
>
|
||||
审核通过并建档
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskArchive'"
|
||||
v-if="detail.task.taskStatus === 'approved'"
|
||||
type="info"
|
||||
icon="FolderChecked"
|
||||
:disabled="!canManage(detail.task)"
|
||||
:title="disabledReason(detail.task)"
|
||||
@click="archive(detail.task)"
|
||||
>
|
||||
归档该任务
|
||||
@@ -943,9 +983,12 @@
|
||||
电子签约
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskDelete'"
|
||||
v-if="detail.task.taskStatus === 'revoked'"
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="!canManage(detail.task)"
|
||||
:title="disabledReason(detail.task)"
|
||||
@click="removeTask(detail.task)"
|
||||
>
|
||||
删除该任务
|
||||
@@ -1014,9 +1057,12 @@
|
||||
</div>
|
||||
|
||||
<el-button
|
||||
v-auth="'onboardingTaskVariableEdit'"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="Check"
|
||||
:disabled="!canManage(contractVariableTask)"
|
||||
:title="disabledReason(contractVariableTask)"
|
||||
@click="saveContractVariables(group)"
|
||||
>
|
||||
保存《{{ group.contractName }}》参数
|
||||
@@ -1096,7 +1142,15 @@
|
||||
<template #footer>
|
||||
<div class="dialog-footer-flex">
|
||||
<el-button @click="contractVariablesVisible = false">关闭</el-button>
|
||||
<el-button type="primary" icon="Check" :loading="savingAllVars" @click="saveAllContractVariables">
|
||||
<el-button
|
||||
v-auth="'onboardingTaskVariableEdit'"
|
||||
type="primary"
|
||||
icon="Check"
|
||||
:loading="savingAllVars"
|
||||
:disabled="!canManage(contractVariableTask)"
|
||||
:title="disabledReason(contractVariableTask)"
|
||||
@click="saveAllContractVariables"
|
||||
>
|
||||
一键保存全部签署材料参数
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -1277,7 +1331,14 @@
|
||||
: '链接尚未生成或已过期,点击下方按钮自动刷新' }}
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="primary" plain @click="copyElectronicSignLink">
|
||||
<el-button
|
||||
v-auth="'onboardingTaskElectronicSign'"
|
||||
type="primary"
|
||||
plain
|
||||
:disabled="!canManage(electronicSignTask)"
|
||||
:title="disabledReason(electronicSignTask)"
|
||||
@click="copyElectronicSignLink"
|
||||
>
|
||||
获取并复制链接
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -1329,10 +1390,12 @@
|
||||
<div class="electronic-sign-footer">
|
||||
<div>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskElectronicSign'"
|
||||
v-if="electronicSignDetail?.hasProcess && canInvalidElectronicSign"
|
||||
type="danger"
|
||||
plain
|
||||
:disabled="electronicSignLoading"
|
||||
:disabled="electronicSignLoading || !canManage(electronicSignTask)"
|
||||
:title="disabledReason(electronicSignTask)"
|
||||
@click="invalidElectronicSign"
|
||||
>
|
||||
作废流程
|
||||
@@ -1341,27 +1404,34 @@
|
||||
<div>
|
||||
<el-button @click="electronicSignVisible = false">关闭</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskElectronicSign'"
|
||||
v-if="electronicSignDetail?.hasProcess && electronicSignDetail.signStatus === 'pending_employee_sign'"
|
||||
:disabled="electronicSignLoading"
|
||||
:disabled="electronicSignLoading || !canManage(electronicSignTask)"
|
||||
:title="disabledReason(electronicSignTask)"
|
||||
@click="noticeElectronicSign"
|
||||
>
|
||||
催签
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskElectronicSign'"
|
||||
v-if="electronicSignDetail?.hasProcess && electronicSignDetail.providerContractId"
|
||||
:loading="electronicSignLoading"
|
||||
:disabled="!canManage(electronicSignTask)"
|
||||
:title="disabledReason(electronicSignTask)"
|
||||
@click="syncElectronicSign"
|
||||
>
|
||||
同步状态
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskElectronicSign'"
|
||||
v-if="
|
||||
electronicSignDetail?.hasProcess
|
||||
&& electronicSignDetail.signStatus === 'pending_company_seal'
|
||||
"
|
||||
type="primary"
|
||||
:loading="electronicSignLoading"
|
||||
:disabled="!allEmployeeSignedDocumentsPreviewed"
|
||||
:disabled="!allEmployeeSignedDocumentsPreviewed || !canManage(electronicSignTask)"
|
||||
:title="disabledReason(electronicSignTask)"
|
||||
@click="confirmCompanySeal"
|
||||
>
|
||||
确认企业盖章
|
||||
@@ -1374,20 +1444,24 @@
|
||||
下载完整归档
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskElectronicSign'"
|
||||
v-if="electronicSignDetail?.canReinitiate"
|
||||
type="warning"
|
||||
plain
|
||||
:loading="electronicSignLoading"
|
||||
:disabled="!electronicSignDetail.documents.length"
|
||||
:disabled="!electronicSignDetail.documents.length || !canManage(electronicSignTask)"
|
||||
:title="disabledReason(electronicSignTask)"
|
||||
@click="reinitiateElectronicSign"
|
||||
>
|
||||
重新发起签约
|
||||
</el-button>
|
||||
<el-button
|
||||
v-auth="'onboardingTaskElectronicSign'"
|
||||
v-if="electronicSignDetail?.canInitiate"
|
||||
type="primary"
|
||||
:loading="electronicSignLoading"
|
||||
:disabled="!electronicSignDetail.documents.length"
|
||||
:disabled="!electronicSignDetail.documents.length || !canManage(electronicSignTask)"
|
||||
:title="disabledReason(electronicSignTask)"
|
||||
@click="initiateElectronicSign"
|
||||
>
|
||||
{{ electronicSignDetail.hasProcess ? '继续/重试发起' : '确认发起电子签' }}
|
||||
@@ -1434,6 +1508,9 @@ import {
|
||||
} from "@/api/modules/biz/onboarding";
|
||||
import type { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { getMessageBoxPromptResult, isMessageBoxConfirmed } from "@/utils/messageBox";
|
||||
import { useOnboardingPermission } from "@/utils/onboardingPermission";
|
||||
|
||||
const { canManage, disabledReason } = useOnboardingPermission("onboardingTaskManageAll");
|
||||
|
||||
const proTable = ref<ProTableInstance>();
|
||||
|
||||
|
||||
@@ -68,6 +68,11 @@ function onOpen(props: FormProps.Base<Button.ButtonInfo>) {
|
||||
if (props.record.id) {
|
||||
//如果传了id,就去请求api获取record
|
||||
buttonApi.detail({ id: props.record.id }).then(res => {
|
||||
if (!res.data) {
|
||||
ElMessage.error("按钮详情不存在或按钮ID无效,请刷新列表后重试");
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
buttonProps.record = res.data;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user