diff --git a/src/views/mes/utils/constants.ts b/src/views/mes/utils/constants.ts index c70c65827..93c645820 100644 --- a/src/views/mes/utils/constants.ts +++ b/src/views/mes/utils/constants.ts @@ -437,7 +437,8 @@ export const MesAutoCodeRuleCode = { QC_RQC_CODE: 'QC_RQC_CODE', // 退货检验单编码 WM_WAREHOUSE_CODE: 'WM_WAREHOUSE_CODE', // 仓库编码 WM_LOCATION_CODE: 'WM_LOCATION_CODE', // 库区编码 - WM_AREA_CODE: 'WM_AREA_CODE' // 库位编码 + WM_AREA_CODE: 'WM_AREA_CODE', // 库位编码 + WM_PRODUCT_SALES_CODE: 'WM_PRODUCT_SALES_CODE' // 销售出库单编码 } as const /** 获取物料/产品标识的标签 */ diff --git a/src/views/mes/wm/productsales/ProductSalesDetailForm.vue b/src/views/mes/wm/productsales/ProductSalesDetailForm.vue index 0a2079398..c391598c4 100644 --- a/src/views/mes/wm/productsales/ProductSalesDetailForm.vue +++ b/src/views/mes/wm/productsales/ProductSalesDetailForm.vue @@ -11,6 +11,13 @@ + + + @@ -54,6 +61,7 @@ import WmWarehouseSelect from '@/views/mes/wm/warehouse/components/WmWarehouseSe import WmWarehouseLocationSelect from '@/views/mes/wm/warehouse/components/WmWarehouseLocationSelect.vue' import WmWarehouseAreaSelect from '@/views/mes/wm/warehouse/components/WmWarehouseAreaSelect.vue' import WmBatchSelect from '@/views/mes/wm/batch/components/WmBatchSelect.vue' +import WmMaterialStockSelect from '@/views/mes/wm/materialstock/components/WmMaterialStockSelect.vue' defineOptions({ name: 'ProductSalesDetailForm' }) @@ -78,6 +86,7 @@ const formData = ref({ salesId: undefined as number | undefined, itemId: undefined as number | undefined, quantity: undefined as number | undefined, + materialStockId: undefined as number | undefined, warehouseId: undefined as number | undefined, locationId: undefined as number | undefined, areaId: undefined as number | undefined, @@ -118,6 +127,18 @@ const handleBatchChange = (batch: any) => { formData.value.batchCode = batch?.code } +/** 库存选中回调,自动填充仓库/库区/库位/批次 */ +// TODO @AI:参考下别的模块 handleStockChange;有不同的逻辑;对齐下; +const handleStockChange = (stock: any) => { + if (stock) { + formData.value.warehouseId = stock.warehouseId + formData.value.locationId = stock.locationId + formData.value.areaId = stock.areaId + formData.value.batchId = stock.batchId + formData.value.batchCode = stock.batchCode + } +} + /** 提交表单 */ const submitForm = async () => { // 校验表单 @@ -153,6 +174,7 @@ const resetForm = () => { salesId: undefined, itemId: undefined, quantity: undefined, + materialStockId: undefined, warehouseId: undefined, locationId: undefined, areaId: undefined, diff --git a/src/views/mes/wm/productsales/ProductSalesForm.vue b/src/views/mes/wm/productsales/ProductSalesForm.vue index 4dcdc5d42..5e06459a6 100644 --- a/src/views/mes/wm/productsales/ProductSalesForm.vue +++ b/src/views/mes/wm/productsales/ProductSalesForm.vue @@ -16,9 +16,7 @@ :disabled="isHeaderReadonly" > @@ -32,6 +30,7 @@ /> + @@ -39,8 +38,6 @@ - - + + + + + @@ -100,6 +106,7 @@ + 运输信息 @@ -125,7 +132,11 @@