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/data.ts | 252 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 252 insertions(+), 0 deletions(-)
diff --git a/src/views/aftersales/problem/data.ts b/src/views/aftersales/problem/data.ts
new file mode 100644
index 0000000..f6000f9
--- /dev/null
+++ b/src/views/aftersales/problem/data.ts
@@ -0,0 +1,252 @@
+import type { VbenFormSchema } from '#/adapter/form';
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { AftersalesProblemApi } from '#/api/aftersales/problem';
+
+/** 琛ㄥ崟绫诲瀷 */
+export type ProblemFormType = 'create' | 'update' | 'detail';
+
+/** 闂绫诲瀷閫夐」锛堝榻� AfterSaleIssueTypeEnum锛� */
+export const ISSUE_TYPE_OPTIONS = [
+ { label: '涓�鑸棶棰�', value: 1 },
+ { label: '缁翠慨闂', value: 2 },
+ { label: '閫�璐ч棶棰�', value: 3 },
+];
+
+/** 涓ラ噸绋嬪害閫夐」 */
+export const SEVERITY_LEVEL_OPTIONS = [
+ { label: '杞诲井', value: 0 },
+ { label: '涓�鑸�', value: 1 },
+ { label: '涓ラ噸', value: 2 },
+ { label: '鑷村懡', value: 3 },
+];
+
+/** 鏍瑰洜鍒嗙被閫夐」锛堝榻� AfterSaleRootCauseCategoryEnum锛� */
+export const ROOT_CAUSE_CATEGORY_OPTIONS = [
+ { label: '璁捐缂洪櫡', value: 1 },
+ { label: '鐗╂枡缂洪櫡', value: 2 },
+ { label: '宸ヨ壓缂洪櫡', value: 3 },
+ { label: '瑁呴厤缂洪櫡', value: 4 },
+ { label: '杩愯緭鎹熷潖', value: 5 },
+ { label: '鍖呰缂洪櫡', value: 6 },
+ { label: '浣跨敤涓嶅綋', value: 7 },
+ { label: '杞欢缂洪櫡', value: 8 },
+ { label: '鍏朵粬', value: 9 },
+];
+
+/** 闂鐘舵�侀�夐」锛堝榻� AfterSaleProblemStatusEnum锛� */
+export const PROBLEM_STATUS_OPTIONS = [
+ { label: '鑽夌', value: 0 },
+ { label: '宸插彂甯�', value: 1 },
+ { label: '宸插仠鐢�', value: 2 },
+];
+
+/** 闂搴撹〃鍗� */
+export function useProblemFormSchema(
+ formType: ProblemFormType,
+): VbenFormSchema[] {
+ const readonly = formType === 'detail';
+ return [
+ {
+ fieldName: 'id',
+ component: 'Input',
+ dependencies: { triggerFields: [''], show: () => false },
+ },
+ {
+ fieldName: 'title',
+ label: '闂鏍囬',
+ component: 'Input',
+ componentProps: { placeholder: '璇疯緭鍏ラ棶棰樻爣棰�' },
+ rules: 'required',
+ },
+ {
+ fieldName: 'issueType',
+ label: '闂绫诲瀷',
+ component: 'Select',
+ componentProps: {
+ options: ISSUE_TYPE_OPTIONS,
+ placeholder: '璇烽�夋嫨闂绫诲瀷',
+ disabled: readonly,
+ },
+ },
+ {
+ fieldName: 'issueCategory',
+ label: '闂鍒嗙被',
+ component: 'Input',
+ componentProps: {
+ placeholder: '濡傚姛鑳芥晠闅溿�佸瑙傜己闄�',
+ disabled: readonly,
+ },
+ },
+ {
+ fieldName: 'severityLevel',
+ label: '涓ラ噸绋嬪害',
+ component: 'Select',
+ componentProps: {
+ options: SEVERITY_LEVEL_OPTIONS,
+ placeholder: '璇烽�夋嫨',
+ disabled: readonly,
+ },
+ },
+ {
+ fieldName: 'rootCauseCategory',
+ label: '鏍瑰洜鍒嗙被',
+ component: 'Select',
+ componentProps: {
+ options: ROOT_CAUSE_CATEGORY_OPTIONS,
+ placeholder: '璇烽�夋嫨鏍瑰洜鍒嗙被',
+ disabled: readonly,
+ },
+ },
+ {
+ fieldName: 'itemCode',
+ label: '鐗╂枡缂栫爜',
+ component: 'Input',
+ componentProps: { placeholder: '鏉ユ簮浜庡伐鍗曟槑缁�', disabled: readonly },
+ },
+ {
+ fieldName: 'itemName',
+ label: '鐗╂枡鍚嶇О',
+ component: 'Input',
+ componentProps: { placeholder: '鏉ユ簮浜庡伐鍗曟槑缁�', disabled: readonly },
+ },
+ {
+ fieldName: 'batchCode',
+ label: '鎵规鍙�',
+ component: 'Input',
+ componentProps: { placeholder: '鏉ユ簮浜庡伐鍗曟槑缁�', disabled: readonly },
+ },
+ {
+ fieldName: 'description',
+ label: '闂鎻忚堪',
+ component: 'Textarea',
+ formItemClass: 'col-span-2',
+ componentProps: {
+ rows: 3,
+ placeholder: '闂鐜拌薄涓庤儗鏅�',
+ disabled: readonly,
+ },
+ },
+ {
+ fieldName: 'rootCause',
+ label: '鏍瑰洜鍒嗘瀽',
+ component: 'Textarea',
+ formItemClass: 'col-span-2',
+ componentProps: {
+ rows: 3,
+ placeholder: '缂洪櫡浜х敓鐨勬牴鏈師鍥�',
+ disabled: readonly,
+ },
+ },
+ {
+ fieldName: 'solution',
+ label: '瑙e喅鏂规',
+ component: 'Textarea',
+ formItemClass: 'col-span-2',
+ componentProps: {
+ rows: 3,
+ placeholder: '澶勭悊鎺柦/SOP锛屼緵鍚庣画宸ュ崟鍙傝��',
+ disabled: readonly,
+ },
+ },
+ {
+ fieldName: 'remark',
+ label: '澶囨敞',
+ component: 'Textarea',
+ formItemClass: 'col-span-2',
+ componentProps: { rows: 2, placeholder: '澶囨敞', disabled: readonly },
+ },
+ {
+ fieldName: 'blobIds',
+ label: '闄勪欢',
+ component: 'FileUpload',
+ componentProps: {
+ valueKey: 'id',
+ maxNumber: 10,
+ multiple: true,
+ disabled: readonly,
+ },
+ formItemClass: 'col-span-2',
+ },
+ ];
+}
+
+/** 闂搴撴悳绱㈣〃鍗� */
+export function useProblemSearchFormSchema(): VbenFormSchema[] {
+ return [
+ {
+ fieldName: 'keyword',
+ label: '鍏抽敭瀛�',
+ component: 'Input',
+ componentProps: {
+ allowClear: true,
+ placeholder: '鍗曞彿/鏍囬/鎻忚堪/鏂规',
+ },
+ },
+ {
+ fieldName: 'itemCode',
+ label: '鐗╂枡缂栫爜',
+ component: 'Input',
+ componentProps: {
+ allowClear: true,
+ placeholder: '璇疯緭鍏ョ墿鏂欑紪鐮�',
+ },
+ },
+ {
+ fieldName: 'issueCategory',
+ label: '闂鍒嗙被',
+ component: 'Input',
+ componentProps: {
+ allowClear: true,
+ placeholder: '璇疯緭鍏ラ棶棰樺垎绫�',
+ },
+ },
+ {
+ fieldName: 'issueType',
+ label: '闂绫诲瀷',
+ component: 'Select',
+ componentProps: {
+ allowClear: true,
+ options: ISSUE_TYPE_OPTIONS,
+ placeholder: '璇烽�夋嫨',
+ },
+ },
+ {
+ fieldName: 'rootCauseCategory',
+ label: '鏍瑰洜鍒嗙被',
+ component: 'Select',
+ componentProps: {
+ allowClear: true,
+ options: ROOT_CAUSE_CATEGORY_OPTIONS,
+ placeholder: '璇烽�夋嫨',
+ },
+ },
+ {
+ fieldName: 'status',
+ label: '鐘舵��',
+ component: 'Select',
+ componentProps: {
+ allowClear: true,
+ options: PROBLEM_STATUS_OPTIONS,
+ placeholder: '璇烽�夋嫨鐘舵��',
+ },
+ },
+ ];
+}
+
+/** 闂搴撳垪琛ㄥ瓧娈� */
+export function useProblemGridColumns(): VxeTableGridOptions<AftersalesProblemApi.Problem>['columns'] {
+ return [
+ { field: 'no', title: '闂鍗曞彿', minWidth: 170, slots: { default: 'no' } },
+ { field: 'title', title: '闂鏍囬', minWidth: 180 },
+ { field: 'sourceTicketNo', title: '鏉ユ簮宸ュ崟', minWidth: 150 },
+ { field: 'itemName', title: '鐗╂枡鍚嶇О', minWidth: 120 },
+ { field: 'itemCode', title: '鐗╂枡缂栫爜', minWidth: 120 },
+ { field: 'issueType', title: '闂绫诲瀷', width: 100, slots: { default: 'issueType' } },
+ { field: 'severityLevel', title: '涓ラ噸绋嬪害', width: 100, slots: { default: 'severityLevel' } },
+ { field: 'rootCauseCategory', title: '鏍瑰洜鍒嗙被', width: 100, slots: { default: 'rootCauseCategory' } },
+ { field: 'status', title: '鐘舵��', width: 90, slots: { default: 'status' } },
+ { field: 'ownerUserName', title: '娌夋穩浜�', minWidth: 100 },
+ { field: 'updateTime', title: '鏇存柊鏃堕棿', width: 170, formatter: 'formatDate' },
+ { title: '鎿嶄綔', width: 220, fixed: 'right', slots: { default: 'actions' } },
+ ];
+}
--
Gitblit v1.9.3