From 1deae1d89a7039ef0b943be291f6c1b9aaa5ad2c Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期一, 17 八月 2026 10:30:33 +0800
Subject: [PATCH] feat(mes): 生产报工新增「可报工数量」展示 - `src/api/mes/pro/task/index.ts`: `MesProTaskApi.Task` 接口新增 `reportableQuantity` (可报工数量) 字段定义 - `src/views/mes/pro/feedback/data.ts`: - 生产报工弹框表单中新增「可报工数量」字段展示,设置为不可编辑,且仅在新建/编辑模式下显示 - 在生产任务选择弹框 (`ProTaskSelect`) 的 `onChange` 事件中,自动从选中的任务对象中提取并带入 `reportableQuantity` - 完善了表单联动的重置逻辑,确保更换工单等操作时正确清空此字段
---
src/views/wls/materialstock/data.ts | 96 ++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 89 insertions(+), 7 deletions(-)
diff --git a/src/views/wls/materialstock/data.ts b/src/views/wls/materialstock/data.ts
index c6f0ceb..8cc4eb3 100644
--- a/src/views/wls/materialstock/data.ts
+++ b/src/views/wls/materialstock/data.ts
@@ -8,7 +8,6 @@
import { DICT_TYPE } from '@vben/constants';
import { MdItemSelect } from '#/views/mes/md/item/components';
-import { MdVendorSelect } from '#/views/mes/md/vendor/components';
import {
WmWarehouseAreaSelect,
@@ -84,6 +83,7 @@
newFrozen: boolean,
row: MesWmMaterialStockApi.MaterialStock,
) => Promise<boolean | undefined>,
+ onMove?: (row: MesWmMaterialStockApi.MaterialStock) => void,
): VxeTableGridOptions<MesWmMaterialStockApi.MaterialStock>['columns'] {
const { hasAccessByCodes } = useAccess();
return [
@@ -106,6 +106,41 @@
field: 'quantity',
title: '鍦ㄥ簱鏁伴噺',
width: 100,
+ },
+ {
+ field: 'frozenQuantity',
+ title: '鍐荤粨鏁伴噺',
+ width: 100,
+ formatter: ({ cellValue }: { cellValue: number }) =>
+ (cellValue || 0).toFixed(2),
+ },
+ {
+ field: 'reservedQuantity',
+ title: '鍗犵敤閲�',
+ width: 100,
+ formatter: ({ cellValue }: { cellValue: number }) =>
+ (cellValue || 0).toFixed(2),
+ },
+ {
+ field: 'inTransitQuantity',
+ title: '鍦ㄩ�旈噺',
+ width: 100,
+ formatter: ({ cellValue }: { cellValue: number }) =>
+ (cellValue || 0).toFixed(2),
+ },
+ {
+ field: 'availableQuantity',
+ title: '鍙敤閲�',
+ width: 100,
+ cellRender: {
+ name: 'CellText',
+ props: {
+ class: ({ row }: { row: MesWmMaterialStockApi.MaterialStock }) =>
+ (row.availableQuantity || 0) < 0 ? 'text-red-500 font-bold' : '',
+ formatter: ({ row }: { row: MesWmMaterialStockApi.MaterialStock }) =>
+ ((row.availableQuantity || 0) as number).toFixed(2),
+ },
+ },
},
{
field: 'unitMeasureName',
@@ -155,6 +190,16 @@
},
},
},
+ ...(onMove
+ ? [
+ {
+ title: '鎿嶄綔',
+ width: 80,
+ fixed: 'right' as const,
+ slots: { default: 'actions' } as const,
+ },
+ ]
+ : []),
];
}
@@ -162,19 +207,21 @@
export function useSelectGridFormSchema(): VbenFormSchema[] {
return [
{
- fieldName: 'itemId',
+ fieldName: 'itemName',
label: '鐗╂枡',
- component: markRaw(MdItemSelect),
+ component: 'Input',
componentProps: {
- placeholder: '璇烽�夋嫨鐗╂枡',
+ allowClear: true,
+ placeholder: '璇疯緭鍏ョ墿鏂欏悕绉�',
},
},
{
- fieldName: 'vendorId',
+ fieldName: 'vendorName',
label: '渚涘簲鍟�',
- component: markRaw(MdVendorSelect),
+ component: 'Input',
componentProps: {
- placeholder: '璇烽�夋嫨渚涘簲鍟�',
+ allowClear: true,
+ placeholder: '璇疯緭鍏ヤ緵搴斿晢鍚嶇О',
},
},
{
@@ -288,6 +335,41 @@
width: 100,
},
{
+ field: 'frozenQuantity',
+ title: '鍐荤粨鏁伴噺',
+ width: 100,
+ formatter: ({ cellValue }: { cellValue: number }) =>
+ (cellValue || 0).toFixed(2),
+ },
+ {
+ field: 'reservedQuantity',
+ title: '鍗犵敤閲�',
+ width: 100,
+ formatter: ({ cellValue }: { cellValue: number }) =>
+ (cellValue || 0).toFixed(2),
+ },
+ {
+ field: 'inTransitQuantity',
+ title: '鍦ㄩ�旈噺',
+ width: 100,
+ formatter: ({ cellValue }: { cellValue: number }) =>
+ (cellValue || 0).toFixed(2),
+ },
+ {
+ field: 'availableQuantity',
+ title: '鍙敤閲�',
+ width: 100,
+ cellRender: {
+ name: 'CellText',
+ props: {
+ class: ({ row }: { row: MesWmMaterialStockApi.MaterialStock }) =>
+ (row.availableQuantity || 0) < 0 ? 'text-red-500 font-bold' : '',
+ formatter: ({ row }: { row: MesWmMaterialStockApi.MaterialStock }) =>
+ ((row.availableQuantity || 0) as number).toFixed(2),
+ },
+ },
+ },
+ {
field: 'receiptTime',
title: '鍏ュ簱鏃ユ湡',
width: 180,
--
Gitblit v1.9.3