From baddb052ccd4a91ef1881ba663e6a4e55b05f4fb Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 15:51:55 +0800
Subject: [PATCH] feat(hrm): 社保公积金方案表单加「适用部门」与默认缴费基数,修比例输入精度
---
src/views/erp/purchase/order/data.ts | 53 ++++++++++++++++++++++++++++++++++-------------------
1 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/src/views/erp/purchase/order/data.ts b/src/views/erp/purchase/order/data.ts
index 0aa5868..f343476 100644
--- a/src/views/erp/purchase/order/data.ts
+++ b/src/views/erp/purchase/order/data.ts
@@ -9,10 +9,10 @@
import { z } from '#/adapter/form';
import { getAccountSimpleList } from '#/api/erp/finance/account';
-import { getSupplierSimpleList } from '#/api/erp/purchase/supplier';
+import { getSupplierSimpleList } from '#/api/srm/supplier';
import { getSimpleUserList } from '#/api/system/user';
import { MdmItemSelect } from '#/views/basicData/mdm/components';
-import { getRangePickerDefaultProps } from '#/utils';
+import { getRangePickerDefaultProps, withoutFixedColumns } from '#/utils';
/** 琛ㄥ崟绫诲瀷 */
export type FormType = 'create' | 'detail' | 'edit';
@@ -45,7 +45,7 @@
placeholder: '閫夋嫨璁㈠崟鏃堕棿',
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
- valueFormat: 'x',
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
@@ -65,14 +65,27 @@
},
{
component: 'InputNumber',
- componentProps: {
+ componentProps: (values) => ({
class: '!w-full',
placeholder: '璇疯緭鍏ユ敮浠樿閲�',
precision: 2,
min: 0,
- },
+ max: values.totalPrice ?? undefined,
+ }),
fieldName: 'depositPrice',
label: '鏀粯璁㈤噾',
+ dependencies: {
+ triggerFields: ['totalPrice'],
+ rules(values) {
+ if (values.totalPrice != null) {
+ return z
+ .number()
+ .min(0, '璁㈤噾涓嶈兘灏忎簬0')
+ .max(values.totalPrice, '璁㈤噾涓嶈兘澶т簬浼樻儬鍚庡惈绋庨噾棰�');
+ }
+ return z.number().min(0, '璁㈤噾涓嶈兘灏忎簬0');
+ },
+ },
rules: 'required',
},
{
@@ -132,11 +145,11 @@
},
{
fieldName: 'totalPrice',
- label: '浼樻儬鍚庨噾棰�',
+ label: '浼樻儬鍚庡惈绋庨噾棰�',
component: 'InputNumber',
componentProps: {
class: '!w-full',
- placeholder: '浼樻儬鍚庨噾棰�',
+ placeholder: '浼樻儬鍚庡惈绋庨噾棰�',
precision: 2,
formatter: erpPriceInputFormatter,
disabled: true,
@@ -162,7 +175,7 @@
export function useFormItemColumns(
disabled: boolean,
): VxeTableGridOptions['columns'] {
- return [
+ const columns: VxeTableGridOptions['columns'] = [
{ type: 'seq', title: '搴忓彿', minWidth: 50, fixed: 'left' },
{
field: 'productId',
@@ -197,17 +210,10 @@
},
{
field: 'productPrice',
- title: '浜у搧鍗曚环',
+ title: '鍚◣鍗曚环(鍏�)',
minWidth: 120,
fixed: 'right',
slots: { default: 'productPrice' },
- },
- {
- field: 'totalProductPrice',
- title: '閲戦',
- minWidth: 120,
- fixed: 'right',
- formatter: 'formatAmount2',
},
{
field: 'taxPercent',
@@ -217,15 +223,22 @@
slots: { default: 'taxPercent' },
},
{
+ field: 'totalProductPrice',
+ title: '涓嶅惈绋庨噾棰�(鍏�)',
+ minWidth: 120,
+ fixed: 'right',
+ formatter: 'formatAmount2',
+ },
+ {
field: 'taxPrice',
- title: '绋庨',
+ title: '绋庨(鍏�)',
minWidth: 120,
fixed: 'right',
formatter: 'formatAmount2',
},
{
field: 'totalPrice',
- title: '绋庨鍚堣',
+ title: '鍚◣鍚堣(鍏�)',
minWidth: 120,
fixed: 'right',
formatter: 'formatAmount2',
@@ -238,6 +251,8 @@
visible: !disabled,
},
];
+ // 鏌ョ湅瀹℃壒鏄庣粏锛堝彧璇伙級鏃跺彇娑堝浐瀹氬垪锛岄伩鍏嶇獎寮圭獥閲屾尋鎺変骇鍝佸悕绉般�佸崟浣嶃�佸娉ㄧ瓑鍒�
+ return disabled ? withoutFixedColumns(columns) : columns;
}
/** 鍒楄〃鐨勬悳绱㈣〃鍗� */
@@ -389,7 +404,7 @@
},
{
field: 'totalProductPrice',
- title: '閲戦鍚堣',
+ title: '涓嶅惈绋庨噾棰濆悎璁�',
formatter: 'formatAmount2',
minWidth: 120,
},
--
Gitblit v1.9.3