From e9ee3946edc433282d548057db2a692605a90135 Mon Sep 17 00:00:00 2001 From: hwj Date: Tue, 7 Jul 2026 14:19:19 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E5=87=BA=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E6=8D=AE-=E5=87=BA=E5=BA=93=E7=94=A8=E9=80=94=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/stock/out/components/StockOutItemForm.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/views/erp/stock/out/components/StockOutItemForm.vue b/src/views/erp/stock/out/components/StockOutItemForm.vue index e7c369c2..4be62c0b 100644 --- a/src/views/erp/stock/out/components/StockOutItemForm.vue +++ b/src/views/erp/stock/out/components/StockOutItemForm.vue @@ -526,6 +526,16 @@ const resolveStockOutCategoryType = (outType?: string) => { const activeCategoryType = computed(() => resolveStockOutCategoryType(props.outType)) const isProductMaterialStockOut = computed(() => Boolean(activeCategoryType.value)) const isProductStockOut = computed(() => activeCategoryType.value === 1) +const getDefaultOutUsageType = () => { + if (isProductStockOut.value) return '4' + if (activeCategoryType.value === 2) return '5' + return undefined +} +const setDefaultOutUsageType = (row: any) => { + const defaultOutUsageType = getDefaultOutUsageType() + if (!defaultOutUsageType || row.outUsageType !== undefined && row.outUsageType !== null && row.outUsageType !== '') return + row.outUsageType = defaultOutUsageType +} const isPurchaseUnitStockOut = computed(() => activeCategoryType.value === 2 || activeCategoryType.value === 3) const isSparePartStockOut = computed(() => activeCategoryType.value === 3) const showOutboundPurposeColumn = computed(() => isProductMaterialStockOut.value) @@ -782,7 +792,7 @@ const handleAdd = () => { lockedStockCount: undefined, count: isProductMaterialStockOut.value ? undefined : 1, outMode: isProductStockOut.value ? 1 : undefined, - outUsageType: undefined, + outUsageType: getDefaultOutUsageType(), pallets: [], palletCode: undefined, repairId: undefined, @@ -886,6 +896,7 @@ const normalizeRow = (row: any) => { if (row.outUsageType !== undefined && row.outUsageType !== null) { row.outUsageType = String(row.outUsageType) } + setDefaultOutUsageType(row) row.inputCount = row.inputCount ?? row.count if (isProductStockOut.value) { row.outMode = Number(row.outMode || 1)