| | |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { MdVendorSelect } from '#/views/mes/md/vendor/components'; |
| | | import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components'; |
| | | import { |
| | | WmWarehouseAreaSelect, |
| | | WmWarehouseLocationSelect, |
| | | WmWarehouseSelect, |
| | | } from '#/views/wls/warehouse/components'; |
| | | import { WmWarehouseSelect } from '#/views/wls/warehouse/components'; |
| | | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'finish' | 'stock' | 'update'; |
| | |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'locationName', |
| | | title: '库区名称', |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'areaName', |
| | | title: '库位名称', |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | | title: '数量', |
| | | width: 100, |
| | |
| | | label: '入库仓库', |
| | | component: markRaw(WmWarehouseSelect), |
| | | componentProps: { |
| | | // 切换仓库后清空库区和库位 |
| | | onChange: async () => { |
| | | await formApi?.setValues({ |
| | | areaId: undefined, |
| | | locationId: undefined, |
| | | }); |
| | | }, |
| | | placeholder: '请选择仓库', |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | | { |
| | | fieldName: 'locationId', |
| | | label: '库区', |
| | | component: markRaw(WmWarehouseLocationSelect), |
| | | componentProps: { |
| | | placeholder: '请选择库区', |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['warehouseId'], |
| | | componentProps: (values) => ({ |
| | | // 切换库区后清空库位 |
| | | onChange: async () => { |
| | | await formApi?.setFieldValue('areaId', undefined); |
| | | }, |
| | | placeholder: '请选择库区', |
| | | warehouseId: values.warehouseId, |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'areaId', |
| | | label: '库位', |
| | | component: markRaw(WmWarehouseAreaSelect), |
| | | componentProps: { |
| | | placeholder: '请选择库位', |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['locationId'], |
| | | componentProps: (values) => ({ |
| | | locationId: values.locationId, |
| | | placeholder: '请选择库位', |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'quantity', |