| | |
| | | import { generateAutoCode } from '#/api/mes/md/autocode/record'; |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | import { WmMaterialStockSelect } from '#/views/wls/materialstock/components'; |
| | | import { |
| | | WmWarehouseAreaSelect, |
| | | WmWarehouseLocationSelect, |
| | | WmWarehouseSelect, |
| | | } from '#/views/wls/warehouse/components'; |
| | | import { WmWarehouseSelect } from '#/views/wls/warehouse/components'; |
| | | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'finish' | 'update'; |
| | |
| | | title: '仓库', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'locationName', |
| | | title: '库区', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'areaName', |
| | | title: '库位', |
| | | minWidth: 120, |
| | | }, |
| | | ...(editable |
| | | ? [ |
| | | { |
| | |
| | | label: '库存物资', |
| | | component: markRaw(WmMaterialStockSelect), |
| | | componentProps: { |
| | | // 选择库存物资后,自动回填物料、批次号、仓库位置和最大可出库数量 |
| | | // 选择库存物资后,自动回填物料、批次号、仓库和最大可出库数量 |
| | | onChange: async (stock?: MesWmMaterialStockApi.MaterialStock) => { |
| | | await formApi?.setValues({ |
| | | areaId: stock?.areaId, |
| | | batchCode: stock?.batchCode, |
| | | itemId: stock?.itemId, |
| | | locationId: stock?.locationId, |
| | | quantityMax: stock?.quantity, |
| | | warehouseId: stock?.warehouseId, |
| | | }); |
| | |
| | | component: markRaw(WmWarehouseSelect), |
| | | componentProps: { |
| | | disabled: true, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'locationId', |
| | | label: '库区', |
| | | component: markRaw(WmWarehouseLocationSelect), |
| | | componentProps: { |
| | | disabled: true, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['warehouseId'], |
| | | componentProps: (values) => ({ |
| | | disabled: true, |
| | | warehouseId: values.warehouseId, |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'areaId', |
| | | label: '库位', |
| | | component: markRaw(WmWarehouseAreaSelect), |
| | | componentProps: { |
| | | disabled: true, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['locationId'], |
| | | componentProps: (values) => ({ |
| | | disabled: true, |
| | | locationId: values.locationId, |
| | | }), |
| | | }, |
| | | }, |
| | | { |