style:模具出库-仓库字段回显

main
黄伟杰 3 weeks ago
parent 2f590e2604
commit f9759dbed9

@ -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
}

Loading…
Cancel
Save