diff --git a/src/views/mes/moldget/MoldGetForm.vue b/src/views/mes/moldget/MoldGetForm.vue index 5f3aefda..370c14df 100644 --- a/src/views/mes/moldget/MoldGetForm.vue +++ b/src/views/mes/moldget/MoldGetForm.vue @@ -150,6 +150,9 @@ const formRules = reactive({ ], outType: [ { required: true, message: t('MoldManagement.MoldGet.validatorOutTypeRequired'), trigger: 'blur' } + ], + warehouseId: [ + { required: true, message: t('MoldManagement.MoldGet.validatorItemWarehouseRequired'), trigger: 'change' } ] }) const disabled = computed(() => formType.value === 'detail') @@ -175,7 +178,12 @@ const open = async (type: string, id?: number) => { if (id) { formLoading.value = true try { - formData.value = await StockOutApi.getStockOut(id) + const data = await StockOutApi.getStockOut(id) + const itemWarehouseId = (data as any)?.items?.[0]?.warehouseId + formData.value = { + ...(data as any), + warehouseId: itemWarehouseId ?? (data as any)?.warehouseId + } } finally { formLoading.value = false }