From b9b476d4b4f1bf9e08b58249fb42f7b07aa3a0fa Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 26 八月 2026 15:08:07 +0800
Subject: [PATCH] feat(mes): 添加工艺参数模板功能支持
---
src/views/erp/purchase/order/data.ts | 95 ++++++++++++++++++++++-------------------------
1 files changed, 44 insertions(+), 51 deletions(-)
diff --git a/src/views/erp/purchase/order/data.ts b/src/views/erp/purchase/order/data.ts
index 361ba18..4fe1ace 100644
--- a/src/views/erp/purchase/order/data.ts
+++ b/src/views/erp/purchase/order/data.ts
@@ -1,15 +1,17 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import { markRaw } from 'vue';
+
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { erpPriceInputFormatter } from '@vben/utils';
import { z } from '#/adapter/form';
import { getAccountSimpleList } from '#/api/erp/finance/account';
-import { getProductSimpleList } from '#/api/erp/product/product';
-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';
/** 琛ㄥ崟绫诲瀷 */
@@ -43,7 +45,7 @@
placeholder: '閫夋嫨璁㈠崟鏃堕棿',
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
- valueFormat: 'x',
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
@@ -63,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',
},
{
@@ -85,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',
},
@@ -179,16 +184,6 @@
slots: { default: 'productId' },
},
{
- field: 'stockCount',
- title: '搴撳瓨',
- minWidth: 80,
- },
- {
- field: 'productBarCode',
- title: '鏉$爜',
- minWidth: 120,
- },
- {
field: 'productUnitName',
title: '鍗曚綅',
minWidth: 80,
@@ -198,6 +193,13 @@
title: '澶囨敞',
minWidth: 150,
slots: { default: 'remark' },
+ },
+ {
+ field: 'qcCheckFlag',
+ title: '鏄惁璐ㄦ',
+ minWidth: 80,
+ fixed: 'right',
+ slots: { default: 'qcCheckFlag' },
},
{
field: 'count',
@@ -266,14 +268,9 @@
{
fieldName: 'productId',
label: '浜у搧',
- component: 'ApiSelect',
+ component: markRaw(MdmItemSelect),
componentProps: {
placeholder: '璇烽�夋嫨浜у搧',
- allowClear: true,
- showSearch: true,
- api: getProductSimpleList,
- labelField: 'name',
- valueField: 'id',
},
},
{
@@ -316,7 +313,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,
},
@@ -341,20 +340,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,
},
},
@@ -437,14 +422,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