From a241b66efcc41e973290a6722fb7a4d79b833ea1 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 13 十月 2026 09:54:32 +0800
Subject: [PATCH] feat(bi): 为图表配置接口添加名称字段
---
src/views/erp/sale/order/data.ts | 148 ++++++++++++++++++++++++++++++-------------------
1 files changed, 90 insertions(+), 58 deletions(-)
diff --git a/src/views/erp/sale/order/data.ts b/src/views/erp/sale/order/data.ts
index 0cf418a..6e8a843 100644
--- a/src/views/erp/sale/order/data.ts
+++ b/src/views/erp/sale/order/data.ts
@@ -5,10 +5,10 @@
import { z } from '#/adapter/form';
import { getAccountSimpleList } from '#/api/erp/finance/account';
-import { getItemPage } from '#/api/mdm/item';
import { getSimpleUserList } from '#/api/system/user';
-import { getRangePickerDefaultProps } from '#/utils';
+import { getRangePickerDefaultProps, withoutFixedColumns } from '#/utils';
import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+import { MdmItemSelect } from '#/views/basicData/mdm/components';
import { markRaw } from 'vue';
@@ -36,14 +36,43 @@
},
},
{
+ fieldName: 'productionStatus',
+ label: '鐢熶骇鐘舵��',
+ component: 'Input',
+ dependencies: {
+ triggerFields: ['needProduction', 'productionStatus'],
+ show: (values) => {
+ return formType === 'detail' && values.needProduction === 1;
+ },
+ },
+ componentProps: {
+ disabled: true,
+ },
+ slots: { default: 'productionStatus' },
+ },
+ {
+ fieldName: 'productionFinishTime',
+ label: '鐢熶骇瀹屾垚鏃堕棿',
+ component: 'Input',
+ dependencies: {
+ triggerFields: ['productionStatus'],
+ show: (values) => {
+ return formType === 'detail' && values.productionStatus === 1;
+ },
+ },
+ componentProps: {
+ disabled: true,
+ },
+ },
+ {
fieldName: 'orderTime',
label: '璁㈠崟鏃堕棿',
component: 'DatePicker',
componentProps: {
placeholder: '閫夋嫨璁㈠崟鏃堕棿',
- showTime: true,
- format: 'YYYY-MM-DD HH:mm:ss',
- valueFormat: 'x',
+ showTime: false,
+ format: 'YYYY-MM-DD',
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
@@ -82,23 +111,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',
},
@@ -162,14 +181,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').optional();
+ },
+ },
rules: z.number().min(0).optional(),
},
];
@@ -179,7 +211,7 @@
export function useFormItemColumns(
disabled: boolean,
): VxeTableGridOptions['columns'] {
- return [
+ const columns: VxeTableGridOptions['columns'] = [
{ type: 'seq', title: '搴忓彿', minWidth: 50, fixed: 'left' },
{
field: 'productId',
@@ -197,11 +229,7 @@
title: '搴撳瓨',
minWidth: 80,
formatter: 'formatAmount3',
- },
- {
- field: 'productBarCode',
- title: '鏉$爜',
- minWidth: 120,
+ visible: false,
},
{
field: 'productUnitName',
@@ -212,11 +240,13 @@
field: 'productUnitName2',
title: '杈呭崟浣�1',
minWidth: 80,
+ visible: false,
},
{
field: 'productUnitName3',
title: '杈呭崟浣�2',
minWidth: 80,
+ visible: false,
},
{
field: 'needProduction',
@@ -229,6 +259,7 @@
title: '澶囨敞',
minWidth: 150,
slots: { default: 'remark' },
+ visible: false,
},
{
field: 'count',
@@ -274,12 +305,14 @@
},
{
title: '鎿嶄綔',
- width: 320,
+ width: 80,
fixed: 'right',
slots: { default: 'actions' },
visible: !disabled,
},
];
+ // 鏌ョ湅瀹℃壒鏄庣粏锛堝彧璇伙級鏃跺彇娑堝浐瀹氬垪锛岄伩鍏嶇獎寮圭獥閲屾尋鎺変骇鍝佸悕绉般�佸崟浣嶃�佸娉ㄧ瓑鍒�
+ return disabled ? withoutFixedColumns(columns) : columns;
}
/** 鍒楄〃鐨勬悳绱㈣〃鍗� */
@@ -297,17 +330,9 @@
{
fieldName: 'productId',
label: '浜у搧',
- component: 'ApiSelect',
+ component: markRaw(MdmItemSelect),
componentProps: {
placeholder: '璇烽�夋嫨浜у搧',
- allowClear: true,
- showSearch: true,
- api: async () => {
- const res = await getItemPage({ pageNo: 1, pageSize: 100, status: 0 });
- return res.list || [];
- },
- labelField: 'name',
- valueField: 'id',
},
},
{
@@ -316,6 +341,8 @@
component: 'RangePicker',
componentProps: {
...getRangePickerDefaultProps(),
+ showTime: false,
+ format: 'YYYY-MM-DD',
allowClear: true,
},
},
@@ -347,8 +374,10 @@
component: 'Select',
componentProps: {
options: [
- { label: '鏈鏍�', value: 10 },
+ { label: '鏈彁浜�', value: 0 },
+ { label: '瀹℃壒涓�', value: 15 },
{ label: '宸插鏍�', value: 20 },
+ { label: '宸查┏鍥�', value: 35 },
{ label: '宸蹭綔搴�', value: 30 },
],
placeholder: '璇烽�夋嫨鐘舵��',
@@ -371,24 +400,25 @@
componentProps: {
options: [
{ label: '鏈嚭搴�', value: 0 },
- { label: '閮ㄥ垎鍑哄簱', value: 1 },
- { label: '鍏ㄩ儴鍑哄簱', value: 2 },
+ { label: '宸查鐣�', value: 1 },
+ { label: '閮ㄥ垎鍑哄簱', value: 2 },
+ { label: '鍏ㄩ儴鍑哄簱', value: 3 },
],
placeholder: '璇烽�夋嫨鍑哄簱鐘舵��',
allowClear: true,
},
},
{
- fieldName: 'returnStatus',
- label: '閫�璐х姸鎬�',
+ fieldName: 'productionStatus',
+ label: '鐢熶骇鐘舵��',
component: 'Select',
componentProps: {
options: [
- { label: '鏈��璐�', value: 0 },
- { label: '閮ㄥ垎閫�璐�', value: 1 },
- { label: '鍏ㄩ儴閫�璐�', value: 2 },
+ { label: '鏃犻渶鐢熶骇', value: -1 },
+ { label: '鏈畬鎴�', value: 0 },
+ { label: '宸插畬鎴�', value: 1 },
],
- placeholder: '璇烽�夋嫨閫�璐х姸鎬�',
+ placeholder: '璇烽�夋嫨鐢熶骇鐘舵��',
allowClear: true,
},
},
@@ -445,18 +475,6 @@
minWidth: 120,
},
{
- field: 'outCount',
- title: '鍑哄簱鏁伴噺',
- formatter: 'formatAmount3',
- minWidth: 120,
- },
- {
- field: 'returnCount',
- title: '閫�璐ф暟閲�',
- formatter: 'formatAmount3',
- minWidth: 120,
- },
- {
field: 'totalProductPrice',
title: '閲戦鍚堣',
formatter: 'formatAmount2',
@@ -475,6 +493,20 @@
minWidth: 120,
},
{
+ field: 'outStatus',
+ title: '鍑哄簱鐘舵��',
+ minWidth: 100,
+ fixed: 'right',
+ slots: { default: 'outStatus' },
+ },
+ {
+ field: 'productionStatus',
+ title: '鐢熶骇鐘舵��',
+ minWidth: 100,
+ fixed: 'right',
+ slots: { default: 'productionStatus' },
+ },
+ {
field: 'status',
title: '鐘舵��',
minWidth: 100,
--
Gitblit v1.9.3