From a7dc7b230fcc6abc6ee5a7bfadb90789b03d2ca8 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期一, 07 九月 2026 16:45:37 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro2.0' into dev_pro2.0
---
src/views/wls/returnissue/data.ts | 90 +++++++++++++++++++++++++++------------------
1 files changed, 54 insertions(+), 36 deletions(-)
diff --git a/src/views/wls/returnissue/data.ts b/src/views/wls/returnissue/data.ts
index d25a934..691b573 100644
--- a/src/views/wls/returnissue/data.ts
+++ b/src/views/wls/returnissue/data.ts
@@ -1,6 +1,7 @@
锘縤mport type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MesWmMaterialStockApi } from '#/api/mes/wm/materialstock';
+import type { MesWmProductIssueLineApi } from '#/api/mes/wm/productissue/line';
import type { MesWmReturnIssueApi } from '#/api/mes/wm/returnissue';
import type { MesWmReturnIssueDetailApi } from '#/api/mes/wm/returnissue/detail';
import type { MesWmReturnIssueLineApi } from '#/api/mes/wm/returnissue/line';
@@ -18,9 +19,9 @@
import { z } from '#/adapter/form';
import { generateAutoCode } from '#/api/mes/md/autocode/record';
-import { MdItemSelect } from '#/views/mes/md/item/components';
import { MdWorkstationSelect } from '#/views/mes/md/workstation/components';
import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components';
+import { WmProductIssueLineSelect } from '#/views/wls/productissue/components';
import { WmMaterialStockSelect } from '#/views/wls/materialstock/components';
import {
WmWarehouseAreaSelect,
@@ -129,7 +130,7 @@
format: 'YYYY-MM-DD HH:mm:ss',
placeholder: '璇烽�夋嫨閫�鏂欐棩鏈�',
showTime: true,
- valueFormat: 'x',
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
{
@@ -317,24 +318,29 @@
}
/** 閫�鏂欏崟琛屾柊澧�/淇敼鐨勮〃鍗� */
-export function useLineFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
+export function useLineFormSchema(
+ formApi?: VbenFormApi,
+ workOrderId?: number,
+): VbenFormSchema[] {
return [
{
- fieldName: 'materialStockId',
- label: '搴撳瓨璁板綍',
- component: markRaw(WmMaterialStockSelect),
+ fieldName: 'issueLineId',
+ label: '棰嗘枡璁板綍',
+ component: markRaw(WmProductIssueLineSelect),
componentProps: {
- // 閫夋嫨搴撳瓨璁板綍鍚庯紝鑷姩鍥炲~鐗╂枡/鎵规/鏁伴噺
- onChange: async (stock?: MesWmMaterialStockApi.MaterialStock) => {
+ workOrderId,
+ onChange: async (line?: MesWmProductIssueLineApi.ProductIssueLine) => {
await formApi?.setValues({
- batchCode: stock?.batchCode,
- batchId: stock?.batchId,
- itemId: stock?.itemId,
- quantity: stock?.quantity,
- quantityMax: stock?.quantity,
+ batchCode: line?.batchCode,
+ batchId: line?.batchId,
+ itemId: line?.itemId,
+ materialDisplayName: line
+ ? [line.itemName, line.specification].filter(Boolean).join(' | ')
+ : undefined,
+ quantity: line?.quantity,
+ quantityMax: line?.quantity,
});
},
- virtualFilter: 'only',
},
rules: 'selectRequired',
},
@@ -376,10 +382,19 @@
},
{
fieldName: 'itemId',
+ component: 'Input',
+ dependencies: {
+ triggerFields: [''],
+ show: () => false,
+ },
+ },
+ {
+ fieldName: 'materialDisplayName',
label: '鐗╂枡',
- component: markRaw(MdItemSelect),
+ component: 'Input',
componentProps: {
disabled: true,
+ placeholder: '閫夋嫨棰嗘枡璁板綍鍚庤嚜鍔ㄥ甫鍑�',
},
},
{
@@ -388,7 +403,7 @@
component: 'Input',
componentProps: {
disabled: true,
- placeholder: '閫夋嫨搴撳瓨鍚庤嚜鍔ㄥ甫鍑�',
+ placeholder: '閫夋嫨棰嗘枡璁板綍鍚庤嚜鍔ㄥ甫鍑�',
},
},
{
@@ -460,28 +475,37 @@
},
{
fieldName: 'itemId',
+ component: 'Input',
+ dependencies: {
+ triggerFields: [''],
+ show: () => false,
+ },
+ },
+ {
+ fieldName: 'materialDisplayName',
label: '鐗╂枡',
- component: markRaw(MdItemSelect),
+ component: 'Input',
componentProps: {
disabled: true,
+ placeholder: '閫夋嫨搴撳瓨鍚庤嚜鍔ㄥ甫鍑�',
},
- rules: 'selectRequired',
},
{
fieldName: 'materialStockId',
label: '搴撳瓨璁板綍',
component: markRaw(WmMaterialStockSelect),
componentProps: {
- // 閫夋嫨搴撳瓨璁板綍鍚庯紝鑷姩鍥炲~浠撳簱/搴撳尯/搴撲綅/鎵规/鏁伴噺
+ // 閫夋嫨搴撳瓨璁板綍鍚庯紝鑷姩鍥炲~鐗╂枡/鎵规/鏁伴噺锛堜笉鍐嶅甫鍏ヤ粨搴撲俊鎭級
onChange: async (stock?: MesWmMaterialStockApi.MaterialStock) => {
await formApi?.setValues({
- areaId: stock?.areaId,
batchCode: stock?.batchCode,
batchId: stock?.batchId,
- locationId: stock?.locationId,
+ itemId: stock?.itemId,
+ materialDisplayName: stock
+ ? [stock.itemName, stock.specification].filter(Boolean).join(' | ')
+ : undefined,
quantity: stock?.quantity,
quantityMax: stock?.quantity,
- warehouseId: stock?.warehouseId,
});
},
virtualFilter: 'only',
@@ -519,38 +543,32 @@
},
{
fieldName: 'warehouseId',
- label: '鍏ュ簱浠撳簱',
+ label: '涓婃灦鐩爣浠撳簱',
component: markRaw(WmWarehouseSelect),
- componentProps: {
- disabled: true,
- },
+ // componentProps: {
+ // excludeCodes: ['WIP_VIRTUAL_WAREHOUSE'],
+ // },
},
{
fieldName: 'locationId',
- label: '搴撳尯',
+ label: '涓婃灦鐩爣搴撳尯',
component: markRaw(WmWarehouseLocationSelect),
- componentProps: {
- disabled: true,
- },
dependencies: {
triggerFields: ['warehouseId'],
componentProps: (values) => ({
- disabled: true,
+ disabled: !values.warehouseId,
warehouseId: values.warehouseId,
}),
},
},
{
fieldName: 'areaId',
- label: '搴撲綅',
+ label: '涓婃灦鐩爣搴撲綅',
component: markRaw(WmWarehouseAreaSelect),
- componentProps: {
- disabled: true,
- },
dependencies: {
triggerFields: ['locationId'],
componentProps: (values) => ({
- disabled: true,
+ disabled: !values.locationId,
locationId: values.locationId,
}),
},
--
Gitblit v1.9.3