From f3cac4aa2db56d6017c1d1dc035bcfeaec76c3e2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 05 十一月 2026 18:31:13 +0800
Subject: [PATCH] feat(crm): 投标保证金迁移到销售管理并接入销售台账
---
src/views/hrm/resignation/data.ts | 64 +++++++++++++++++++++++++++----
1 files changed, 55 insertions(+), 9 deletions(-)
diff --git a/src/views/hrm/resignation/data.ts b/src/views/hrm/resignation/data.ts
index 6a4aef0..f96ab00 100644
--- a/src/views/hrm/resignation/data.ts
+++ b/src/views/hrm/resignation/data.ts
@@ -5,13 +5,17 @@
import { DICT_TYPE } from '#/packages/constants/src';
import { getDictOptions } from '#/packages/effects/hooks/src';
-import { getEmployeeSimpleList } from '#/api/hrm/employee';
+import { getEmployeePage, getEmployeeSimpleList } from '#/api/hrm/employee';
+import type { HrmEmployeeApi } from '#/api/hrm/employee';
/** 琛ㄥ崟绫诲瀷 */
export type FormType = 'create' | 'detail' | 'update';
/** 鏂板/淇敼绂昏亴鐢宠鐨勮〃鍗� */
-export function useFormSchema(formType: FormType): VbenFormSchema[] {
+export function useFormSchema(
+ formType: FormType,
+ onApplicantChange?: (option?: HrmEmployeeApi.Employee) => void,
+): VbenFormSchema[] {
return [
{
fieldName: 'id',
@@ -19,6 +23,47 @@
dependencies: {
triggerFields: [''],
show: () => false,
+ },
+ },
+ {
+ fieldName: 'userId',
+ label: '鐢宠浜�',
+ component: 'ApiSelect',
+ componentProps: {
+ // 閫夋嫨鍛樺伐鍚庯紝value 鍙栧叧鑱旂殑绯荤粺鐢ㄦ埛 ID锛堝悗绔寜 userId 鍏宠仈鍛樺伐妗f锛�
+ api: getEmployeePage,
+ // 鍒嗛〉鎺ュ彛涓婇檺 200锛岃秴鍑轰細鎶モ�滄瘡椤垫潯鏁版渶澶у�间负 200鈥�
+ params: { pageNo: 1, pageSize: 200 },
+ resultField: 'list',
+ labelField: 'name',
+ valueField: 'userId',
+ // 鏈叧鑱旂郴缁熻处鍙锋垨宸茬鑱岀殑鍛樺伐涓嶈兘浣滀负鐢宠浜�
+ afterFetch: (res: { list?: HrmEmployeeApi.Employee[] }) => ({
+ list: (res?.list ?? []).filter(
+ (item) => item.userId != null && item.employeeStatus !== 3,
+ ),
+ }),
+ placeholder: '璇烽�夋嫨鐢宠浜猴紙涓嶉�夐粯璁や负鏈汉锛�',
+ showSearch: true,
+ optionFilterProp: 'label',
+ // 浠呮柊澧炴椂鍙�夋嫨锛涗慨鏀规椂鐢宠浜洪攣瀹�
+ disabled: formType !== 'create',
+ onChange: (_value: unknown, option: unknown) => {
+ onApplicantChange?.(option as HrmEmployeeApi.Employee);
+ },
+ },
+ help:
+ formType === 'create'
+ ? '涓嶉�夋嫨鏃堕粯璁ょ敵璇蜂汉涓哄綋鍓嶇櫥褰曠敤鎴凤紱閫夋嫨鍚庤嚜鍔ㄥ甫鍑哄矖浣�'
+ : undefined,
+ },
+ {
+ fieldName: 'postName',
+ label: '宀椾綅',
+ component: 'Input',
+ componentProps: {
+ disabled: true,
+ placeholder: '閫夋嫨鐢宠浜哄悗鑷姩甯﹀嚭',
},
},
{
@@ -44,21 +89,22 @@
rules: 'required',
},
{
- fieldName: 'handoverUserId',
+ fieldName: 'handoverEmployeeId',
label: '浜ゆ帴浜�',
component: 'ApiSelect',
componentProps: {
api: getEmployeeSimpleList,
labelField: 'name',
valueField: 'id',
+ // 宸茬鑱屽憳宸ヤ笉鑳戒綔涓轰氦鎺ヤ汉锛岀洿鎺ユ帓闄�
+ afterFetch: (list: HrmEmployeeApi.EmployeeSimple[]) =>
+ (list ?? []).filter((item) => item.employeeStatus !== 3),
placeholder: '璇烽�夋嫨浜ゆ帴浜�',
+ showSearch: true,
+ optionFilterProp: 'label',
+ allowClear: true,
},
- },
- {
- fieldName: 'handoverEmployeeId',
- label: '浜ゆ帴鍛樺伐ID',
- component: 'InputNumber',
- componentProps: { class: '!w-full', min: 1, precision: 0, placeholder: '璇疯緭鍏ヤ氦鎺ュ憳宸D' },
+ rules: 'selectRequired',
},
{
fieldName: 'reason',
--
Gitblit v1.9.3