From dab13c9a8b0b850d47c59b6a4bd725aefa2298fd Mon Sep 17 00:00:00 2001
From: tuqin <tuqin@tuqin.cn>
Date: 星期二, 13 十月 2026 18:33:41 +0800
Subject: [PATCH] feat(hrm): 员工合同「下载合同模板」新增退休返聘合同
---
src/views/aftersales/problem/index.vue | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 214 insertions(+), 0 deletions(-)
diff --git a/src/views/aftersales/problem/index.vue b/src/views/aftersales/problem/index.vue
new file mode 100644
index 0000000..372c34e
--- /dev/null
+++ b/src/views/aftersales/problem/index.vue
@@ -0,0 +1,214 @@
+<script lang="ts" setup>
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { AftersalesProblemApi } from '#/api/aftersales/problem';
+
+import { Page, useVbenModal } from '@vben/common-ui';
+
+import { Button, message, Tag } from 'ant-design-vue';
+
+import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import {
+ deleteProblem,
+ disableProblem,
+ getProblemPage,
+ publishProblem,
+} from '#/api/aftersales/problem';
+
+import {
+ PROBLEM_STATUS_OPTIONS,
+ ROOT_CAUSE_CATEGORY_OPTIONS,
+ useProblemGridColumns,
+ useProblemSearchFormSchema,
+} from './data';
+import ProblemForm from './modules/form.vue';
+
+const statusLabelMap = Object.fromEntries(
+ PROBLEM_STATUS_OPTIONS.map((o) => [o.value, o.label]),
+);
+const rootCauseLabelMap = Object.fromEntries(
+ ROOT_CAUSE_CATEGORY_OPTIONS.map((o) => [o.value, o.label]),
+);
+
+const [FormModal, formModalApi] = useVbenModal({
+ connectedComponent: ProblemForm,
+ destroyOnClose: true,
+});
+
+function handleRefresh() {
+ gridApi.query();
+}
+
+function handleCreate() {
+ formModalApi.setData({ formType: 'create' }).open();
+}
+
+function handleDetail(row: AftersalesProblemApi.Problem) {
+ formModalApi.setData({ formType: 'detail', id: row.id }).open();
+}
+
+function handleEdit(row: AftersalesProblemApi.Problem) {
+ formModalApi.setData({ formType: 'update', id: row.id }).open();
+}
+
+async function handleDelete(row: AftersalesProblemApi.Problem) {
+ await deleteProblem(row.id!);
+ message.success('鍒犻櫎鎴愬姛');
+ handleRefresh();
+}
+
+async function handlePublish(row: AftersalesProblemApi.Problem) {
+ await publishProblem(row.id!);
+ message.success('鍙戝竷鎴愬姛');
+ handleRefresh();
+}
+
+async function handleDisable(row: AftersalesProblemApi.Problem) {
+ await disableProblem(row.id!);
+ message.success('鍋滅敤鎴愬姛');
+ handleRefresh();
+}
+
+const [Grid, gridApi] = useVbenVxeGrid({
+ formOptions: {
+ schema: useProblemSearchFormSchema(),
+ },
+ gridOptions: {
+ columns: useProblemGridColumns(),
+ height: 'auto',
+ keepSource: true,
+ proxyConfig: {
+ ajax: {
+ query: async ({ page }, formValues) => {
+ return await getProblemPage({
+ pageNo: page.currentPage,
+ pageSize: page.pageSize,
+ ...formValues,
+ });
+ },
+ },
+ },
+ rowConfig: {
+ keyField: 'id',
+ isHover: true,
+ },
+ toolbarConfig: {
+ refresh: true,
+ search: true,
+ },
+ } as VxeTableGridOptions<AftersalesProblemApi.Problem>,
+});
+</script>
+
+<template>
+ <Page auto-content-height>
+ <FormModal @success="handleRefresh" />
+
+ <Grid table-title="鍞悗闂搴撳垪琛�">
+ <template #toolbar-tools>
+ <TableAction
+ :actions="[
+ {
+ label: '鏂板闂',
+ type: 'primary',
+ icon: ACTION_ICON.ADD,
+ auth: ['aftersales:problem:create'],
+ onClick: handleCreate,
+ },
+ ]"
+ />
+ </template>
+
+ <template #no="{ row }">
+ <Button type="link" @click="handleDetail(row)">
+ {{ row.no }}
+ </Button>
+ </template>
+
+ <template #issueType="{ row }">
+ <Tag v-if="row.issueType === 1" color="blue">涓�鑸棶棰�</Tag>
+ <Tag v-else-if="row.issueType === 2" color="orange">缁翠慨闂</Tag>
+ <Tag v-else-if="row.issueType === 3" color="red">閫�璐ч棶棰�</Tag>
+ <span v-else>-</span>
+ </template>
+
+ <template #severityLevel="{ row }">
+ <Tag v-if="row.severityLevel === 0" color="green">杞诲井</Tag>
+ <Tag v-else-if="row.severityLevel === 1" color="blue">涓�鑸�</Tag>
+ <Tag v-else-if="row.severityLevel === 2" color="orange">涓ラ噸</Tag>
+ <Tag v-else-if="row.severityLevel === 3" color="red">鑷村懡</Tag>
+ <span v-else>-</span>
+ </template>
+
+ <template #rootCauseCategory="{ row }">
+ <span>{{ rootCauseLabelMap[row.rootCauseCategory!] || '-' }}</span>
+ </template>
+
+ <template #status="{ row }">
+ <Tag
+ :color="
+ row.status === 1
+ ? 'green'
+ : row.status === 0
+ ? 'default'
+ : 'orange'
+ "
+ >
+ {{ statusLabelMap[row.status!] || '-' }}
+ </Tag>
+ </template>
+
+ <template #actions="{ row }">
+ <TableAction
+ :actions="[
+ {
+ label: '鏌ョ湅',
+ type: 'link',
+ icon: ACTION_ICON.VIEW,
+ onClick: handleDetail.bind(null, row),
+ },
+ {
+ label: '缂栬緫',
+ type: 'link',
+ icon: ACTION_ICON.EDIT,
+ auth: ['aftersales:problem:update'],
+ ifShow: row.status === 0,
+ onClick: handleEdit.bind(null, row),
+ },
+ {
+ label: '鍙戝竷',
+ type: 'link',
+ auth: ['aftersales:problem:publish'],
+ ifShow: row.status === 0 || row.status === 2,
+ popConfirm: {
+ title: '纭鍙戝竷璇ラ棶棰橈紵',
+ confirm: handlePublish.bind(null, row),
+ },
+ },
+ {
+ label: '鍋滅敤',
+ type: 'link',
+ auth: ['aftersales:problem:disable'],
+ ifShow: row.status === 1,
+ popConfirm: {
+ title: '纭鍋滅敤璇ラ棶棰橈紵',
+ confirm: handleDisable.bind(null, row),
+ },
+ },
+ {
+ label: '鍒犻櫎',
+ type: 'link',
+ danger: true,
+ icon: ACTION_ICON.DELETE,
+ auth: ['aftersales:problem:delete'],
+ ifShow: row.status === 0,
+ popConfirm: {
+ title: `纭鍒犻櫎闂銆�${row.no}銆戯紵`,
+ confirm: handleDelete.bind(null, row),
+ },
+ },
+ ]"
+ />
+ </template>
+ </Grid>
+ </Page>
+</template>
--
Gitblit v1.9.3