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 |  109 +++++++++++++++++++++++++-----------------------------
 1 files changed, 50 insertions(+), 59 deletions(-)

diff --git a/src/views/erp/purchase/order/data.ts b/src/views/erp/purchase/order/data.ts
index 761cbad..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',
     },
     {
@@ -87,23 +100,13 @@
       formItemClass: 'col-span-2',
     },
     {
-      fieldName: 'fileUrl',
+      fieldName: 'blobIds',
       label: '闄勪欢',
       component: 'FileUpload',
       componentProps: {
-        maxNumber: 1,
-        maxSize: 10,
-        accept: [
-          'pdf',
-          'doc',
-          'docx',
-          'xls',
-          'xlsx',
-          'txt',
-          'jpg',
-          'jpeg',
-          'png',
-        ],
+        valueKey: 'id',
+        maxNumber: 10,
+        multiple: true,
         showDescription: formType !== 'detail',
         disabled: formType === 'detail',
       },
@@ -142,11 +145,11 @@
     },
     {
       fieldName: 'totalPrice',
-      label: '浼樻儬鍚庨噾棰�',
+      label: '浼樻儬鍚庡惈绋庨噾棰�',
       component: 'InputNumber',
       componentProps: {
         class: '!w-full',
-        placeholder: '浼樻儬鍚庨噾棰�',
+        placeholder: '浼樻儬鍚庡惈绋庨噾棰�',
         precision: 2,
         formatter: erpPriceInputFormatter,
         disabled: true,
@@ -172,23 +175,13 @@
 export function useFormItemColumns(
   disabled: boolean,
 ): VxeTableGridOptions['columns'] {
-  return [
+  const columns: VxeTableGridOptions['columns'] = [
     { type: 'seq', title: '搴忓彿', minWidth: 50, fixed: 'left' },
     {
       field: 'productId',
       title: '浜у搧鍚嶇О',
       minWidth: 200,
       slots: { default: 'productId' },
-    },
-    {
-      field: 'stockCount',
-      title: '搴撳瓨',
-      minWidth: 80,
-    },
-    {
-      field: 'productBarCode',
-      title: '鏉$爜',
-      minWidth: 120,
     },
     {
       field: 'productUnitName',
@@ -217,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',
@@ -237,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',
@@ -258,6 +251,8 @@
       visible: !disabled,
     },
   ];
+  // 鏌ョ湅瀹℃壒鏄庣粏锛堝彧璇伙級鏃跺彇娑堝浐瀹氬垪锛岄伩鍏嶇獎寮圭獥閲屾尋鎺変骇鍝佸悕绉般�佸崟浣嶃�佸娉ㄧ瓑鍒�
+  return disabled ? withoutFixedColumns(columns) : columns;
 }
 
 /** 鍒楄〃鐨勬悳绱㈣〃鍗� */
@@ -320,7 +315,9 @@
       label: '鐘舵��',
       component: 'Select',
       componentProps: {
-        options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'),
+        options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number').filter(
+          (opt) => opt.label !== '鑽夌' && opt.label !== '瀹℃壒涓嶉�氳繃',
+        ),
         placeholder: '璇烽�夋嫨鐘舵��',
         allowClear: true,
       },
@@ -345,20 +342,6 @@
           { label: '鍏ㄩ儴鍏ュ簱', value: 2 },
         ],
         placeholder: '璇烽�夋嫨鍏ュ簱鐘舵��',
-        allowClear: true,
-      },
-    },
-    {
-      fieldName: 'returnStatus',
-      label: '閫�璐х姸鎬�',
-      component: 'Select',
-      componentProps: {
-        options: [
-          { label: '鏈��璐�', value: 0 },
-          { label: '閮ㄥ垎閫�璐�', value: 1 },
-          { label: '鍏ㄩ儴閫�璐�', value: 2 },
-        ],
-        placeholder: '璇烽�夋嫨閫�璐х姸鎬�',
         allowClear: true,
       },
     },
@@ -421,7 +404,7 @@
     },
     {
       field: 'totalProductPrice',
-      title: '閲戦鍚堣',
+      title: '涓嶅惈绋庨噾棰濆悎璁�',
       formatter: 'formatAmount2',
       minWidth: 120,
     },
@@ -441,14 +424,22 @@
       field: 'status',
       title: '鐘舵��',
       minWidth: 120,
+      fixed: 'right',
       cellRender: {
         name: 'CellDict',
         props: { type: DICT_TYPE.ERP_AUDIT_STATUS },
       },
     },
     {
+      field: 'inStatus',
+      title: '鍏ュ簱鐘舵��',
+      minWidth: 100,
+      fixed: 'right',
+      slots: { default: 'inStatus' },
+    },
+    {
       title: '鎿嶄綔',
-      width: 260,
+      width: 340,
       fixed: 'right',
       slots: { default: 'actions' },
     },

--
Gitblit v1.9.3