工作站设置:去掉库区/库位表单项
客户未启用库区/库位管理,需求里也没有维护入口,工作站表单只保留仓库选择,
库区/库位由后端按仓库默认值自动兜底。
Co-Authored-By: Claude Code <noreply@anthropic.com>
| | |
| | | import { z } from '#/adapter/form'; |
| | | import { generateAutoCode } from '#/api/mes/md/autocode/record'; |
| | | import { getWarehouseSimpleList } from '#/api/mes/wm/warehouse'; |
| | | import { getWarehouseAreaSimpleList } from '#/api/mes/wm/warehouse/area'; |
| | | import { getWarehouseLocationSimpleList } from '#/api/mes/wm/warehouse/location'; |
| | | |
| | | import { MdWorkshopSelect } from './components'; |
| | | |
| | |
| | | allowClear: true, |
| | | api: getWarehouseSimpleList, |
| | | labelField: 'name', |
| | | onChange: async () => { |
| | | await formApi?.setFieldValue('locationId', undefined); |
| | | await formApi?.setFieldValue('areaId', undefined); |
| | | }, |
| | | placeholder: '请选择仓库', |
| | | valueField: 'id', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'locationId', |
| | | label: '库区', |
| | | component: 'Select', |
| | | dependencies: { |
| | | triggerFields: ['warehouseId'], |
| | | disabled: (values) => !values.warehouseId, |
| | | async componentProps(values) { |
| | | const list = values.warehouseId |
| | | ? await getWarehouseLocationSimpleList(values.warehouseId) |
| | | : []; |
| | | return { |
| | | allowClear: true, |
| | | onChange: async () => { |
| | | await formApi?.setFieldValue('areaId', undefined); |
| | | }, |
| | | fieldNames: { label: 'name', value: 'id' }, |
| | | options: list, |
| | | placeholder: '请选择库区', |
| | | }; |
| | | }, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'areaId', |
| | | label: '库位', |
| | | component: 'Select', |
| | | dependencies: { |
| | | triggerFields: ['locationId'], |
| | | disabled: (values) => !values.locationId, |
| | | async componentProps(values) { |
| | | const list = values.locationId |
| | | ? await getWarehouseAreaSimpleList(values.locationId) |
| | | : []; |
| | | return { |
| | | allowClear: true, |
| | | fieldNames: { label: 'name', value: 'id' }, |
| | | options: list, |
| | | placeholder: '请选择库位', |
| | | }; |
| | | }, |
| | | }, |
| | | }, |
| | | { |