From 18340ebdeb405be3ba01eb4d1600d9b26cee7ccd Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期一, 14 九月 2026 16:56:13 +0800
Subject: [PATCH] fix(erp): 查看审批明细时明细表格取消固定列

---
 src/views/erp/purchase/order/data.ts |   46 +++++++++++++++++++++++++---------------------
 1 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/src/views/erp/purchase/order/data.ts b/src/views/erp/purchase/order/data.ts
index d13eb84..0676202 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,10 +100,13 @@
       formItemClass: 'col-span-2',
     },
     {
-      fieldName: 'fileUrl',
+      fieldName: 'blobIds',
       label: '闄勪欢',
       component: 'FileUpload',
       componentProps: {
+        valueKey: 'id',
+        maxNumber: 10,
+        multiple: true,
         showDescription: formType !== 'detail',
         disabled: formType === 'detail',
       },
@@ -159,7 +175,7 @@
 export function useFormItemColumns(
   disabled: boolean,
 ): VxeTableGridOptions['columns'] {
-  return [
+  const columns: VxeTableGridOptions['columns'] = [
     { type: 'seq', title: '搴忓彿', minWidth: 50, fixed: 'left' },
     {
       field: 'productId',
@@ -235,6 +251,8 @@
       visible: !disabled,
     },
   ];
+  // 鏌ョ湅瀹℃壒鏄庣粏锛堝彧璇伙級鏃跺彇娑堝浐瀹氬垪锛岄伩鍏嶇獎寮圭獥閲屾尋鎺変骇鍝佸悕绉般�佸崟浣嶃�佸娉ㄧ瓑鍒�
+  return disabled ? withoutFixedColumns(columns) : columns;
 }
 
 /** 鍒楄〃鐨勬悳绱㈣〃鍗� */
@@ -324,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,
       },
     },

--
Gitblit v1.9.3