诚发五金:入库/调整/移库/调拨/盘点表单去掉库区库位选择,改由后端默认库区库位兜底
- 采购入库、杂项入库、产品入库、委外入库、退货入库、采购退货:上架明细只选仓库
- 库存调整、库存移库、转移调拨:去掉库区/库位输入
- 盘点结果:去掉库区/库位字段与列表列,仅选择仓库;盘点清单列也去掉库区/库位
- materialstock 调整/移库接口参数 locationId/areaId 改为可选
Co-Authored-By: Claude Code <noreply@anthropic.com>
| | |
| | | export interface MaterialStockAdjustInParams { |
| | | itemId: number; // 物料ID |
| | | warehouseId: number; // 仓库ID |
| | | locationId: number; // 库区ID |
| | | areaId: number; // 库位ID |
| | | locationId?: number; // 库区ID(不传则落到仓库默认库区) |
| | | areaId?: number; // 库位ID(不传则落到仓库默认库位) |
| | | batchId?: number; // 批次ID(选择已有批次时传入) |
| | | batchCode?: string; // 批次号(新建批次时传入) |
| | | produceDate?: string; // 生产日期(新建批次时传入) |
| | |
| | | export interface MaterialStockAdjustOutParams { |
| | | itemId: number; // 物料ID |
| | | warehouseId: number; // 仓库ID |
| | | locationId: number; // 库区ID |
| | | areaId: number; // 库位ID |
| | | locationId?: number; // 库区ID(不传则落到仓库默认库区) |
| | | areaId?: number; // 库位ID(不传则落到仓库默认库位) |
| | | batchId?: number; // 批次ID |
| | | batchCode?: string; // 批次号 |
| | | vendorId?: number; // 供应商ID |
| | |
| | | export interface MaterialStockMoveParams { |
| | | materialStockId: number; // 库存记录ID |
| | | toWarehouseId: number; // 目标仓库ID |
| | | toLocationId: number; // 目标库区ID |
| | | toAreaId: number; // 目标库位ID |
| | | toLocationId?: number; // 目标库区ID(不传则落到目标仓库默认库区) |
| | | toAreaId?: number; // 目标库位ID(不传则落到目标仓库默认库位) |
| | | quantity: number; // 移库数量 |
| | | remark?: string; // 备注 |
| | | } |
| | |
| | | export interface MaterialStockAdjustParams { |
| | | itemId: number; // 物料ID |
| | | warehouseId: number; // 仓库ID |
| | | locationId: number; // 库区ID |
| | | areaId: number; // 库位ID |
| | | locationId?: number; // 库区ID(不传则落到仓库默认库区) |
| | | areaId?: number; // 库位ID(不传则落到仓库默认库位) |
| | | batchId?: number; // 批次ID |
| | | batchCode?: string; // 批次号 |
| | | vendorId?: number; // 供应商ID |
| | |
| | | WmArrivalNoticeLineSelect, |
| | | WmArrivalNoticeSelect, |
| | | } from '#/views/wls/arrivalnotice/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', |
| | |
| | | import { z } from '#/adapter/form'; |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { moveMaterialStock } from '#/api/mes/wm/materialstock'; |
| | | import { |
| | | WmWarehouseAreaSelect, |
| | | WmWarehouseLocationSelect, |
| | | WmWarehouseSelect, |
| | | } from '#/views/wls/warehouse/components'; |
| | | import { WmWarehouseSelect } from '#/views/wls/warehouse/components'; |
| | | |
| | | defineOptions({ name: 'WmStockMoveModal' }); |
| | | |
| | |
| | | componentProps: { disabled: true }, |
| | | }, |
| | | { |
| | | fieldName: 'locationName', |
| | | label: '当前库区', |
| | | component: 'Input', |
| | | componentProps: { disabled: true }, |
| | | }, |
| | | { |
| | | fieldName: 'areaName', |
| | | label: '当前库位', |
| | | component: 'Input', |
| | | componentProps: { disabled: true }, |
| | | }, |
| | | { |
| | | fieldName: 'quantity', |
| | | label: '当前数量', |
| | | component: 'InputNumber', |
| | |
| | | component: markRaw(WmWarehouseSelect), |
| | | componentProps: { |
| | | placeholder: '请选择目标仓库', |
| | | onChange: async () => { |
| | | await formApi.setFieldValue('toLocationId', undefined); |
| | | await formApi.setFieldValue('toAreaId', undefined); |
| | | }, |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | | { |
| | | fieldName: 'toLocationId', |
| | | label: '目标库区', |
| | | component: markRaw(WmWarehouseLocationSelect), |
| | | componentProps: { placeholder: '请选择目标库区' }, |
| | | dependencies: { |
| | | triggerFields: ['toWarehouseId'], |
| | | componentProps: (values) => ({ |
| | | warehouseId: values.toWarehouseId, |
| | | placeholder: '请选择目标库区', |
| | | onChange: async () => { |
| | | await formApi.setFieldValue('toAreaId', undefined); |
| | | }, |
| | | }), |
| | | trigger: (values, api) => { |
| | | if (values.toLocationId !== undefined) { |
| | | void api.setFieldValue('toLocationId', undefined); |
| | | void api.setFieldValue('toAreaId', undefined); |
| | | } |
| | | }, |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | | { |
| | | fieldName: 'toAreaId', |
| | | label: '目标库位', |
| | | component: markRaw(WmWarehouseAreaSelect), |
| | | componentProps: { placeholder: '请选择目标库位' }, |
| | | dependencies: { |
| | | triggerFields: ['toLocationId'], |
| | | componentProps: (values) => ({ |
| | | locationId: values.toLocationId, |
| | | placeholder: '请选择目标库位', |
| | | }), |
| | | trigger: (values, api) => { |
| | | if (values.toAreaId !== undefined) { |
| | | void api.setFieldValue('toAreaId', undefined); |
| | | } |
| | | }, |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | |
| | | return; |
| | | } |
| | | |
| | | if (row.warehouseId === values.toWarehouseId && row.locationId === values.toLocationId && row.areaId === values.toAreaId) { |
| | | message.error('目标库位与当前库位相同,不允许移库'); |
| | | if (row.warehouseId === values.toWarehouseId) { |
| | | message.error('目标仓库与当前仓库相同,请选择其他仓库'); |
| | | return; |
| | | } |
| | | |
| | |
| | | materialStockId: row.id, |
| | | quantity: moveQuantity, |
| | | remark: values.remark, |
| | | toAreaId: values.toAreaId, |
| | | toLocationId: values.toLocationId, |
| | | toWarehouseId: values.toWarehouseId, |
| | | }); |
| | | message.success('移库成功'); |
| | |
| | | } |
| | | |
| | | await formApi.setValues({ |
| | | areaName: data.areaName, |
| | | batchCode: data.batchCode, |
| | | itemCode: data.itemCode, |
| | | itemName: data.itemName, |
| | | locationName: data.locationName, |
| | | quantity: data.quantity, |
| | | warehouseName: data.warehouseName, |
| | | }); |
| | |
| | | import { MdmItemSelect } from '#/views/basicData/mdm/components'; |
| | | import { SrmSupplierSelect } from '#/views/srm/supplier/components'; |
| | | import BatchConfigDisplay from './batch-config-display.vue'; |
| | | import { |
| | | WmWarehouseAreaSelect, |
| | | WmWarehouseLocationSelect, |
| | | WmWarehouseSelect, |
| | | } from '#/views/wls/warehouse/components'; |
| | | import { WmWarehouseSelect } from '#/views/wls/warehouse/components'; |
| | | |
| | | const emit = defineEmits<{ |
| | | success: []; |
| | |
| | | // 操作类型:1=入库,2=出库 |
| | | const operateType = ref<1 | 2>(1); |
| | | const selectedItem = ref<MdmItemApi.Item | null>(null); |
| | | const selectedWarehouse = ref<any>(null); |
| | | const selectedLocation = ref<any>(null); |
| | | |
| | | // 是否启用批次管理 |
| | | const batchEnabled = ref(false); |
| | |
| | | await formApi.setFieldValue('manualBatchEntry', false); |
| | | } |
| | | |
| | | /** 仓库选择变化 */ |
| | | async function handleWarehouseChange(item: any) { |
| | | selectedWarehouse.value = item; |
| | | await formApi.setFieldValue('locationId', undefined); |
| | | await formApi.setFieldValue('areaId', undefined); |
| | | } |
| | | |
| | | /** 库区选择变化 */ |
| | | async function handleLocationChange(item: any) { |
| | | selectedLocation.value = item; |
| | | await formApi.setFieldValue('areaId', undefined); |
| | | } |
| | | |
| | | /** 手动填写批次号变化 */ |
| | | async function handleManualBatchEntryChange(value: boolean) { |
| | | manualBatchEntry.value = value; |
| | |
| | | component: markRaw(WmWarehouseSelect), |
| | | componentProps: { |
| | | placeholder: '请选择仓库', |
| | | onChange: handleWarehouseChange, |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | | { |
| | | fieldName: 'locationId', |
| | | label: '库区', |
| | | component: markRaw(WmWarehouseLocationSelect), |
| | | componentProps: { |
| | | placeholder: '请选择库区', |
| | | warehouseId: selectedWarehouse.value?.id, |
| | | onChange: handleLocationChange, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['warehouseId'], |
| | | componentProps: (values: any) => ({ |
| | | placeholder: '请选择库区', |
| | | warehouseId: values.warehouseId, |
| | | onChange: handleLocationChange, |
| | | }), |
| | | trigger: (values: any, formApi: any) => { |
| | | if (values.locationId !== undefined) { |
| | | void formApi.setFieldValue('locationId', undefined); |
| | | void formApi.setFieldValue('areaId', undefined); |
| | | } |
| | | }, |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | | { |
| | | fieldName: 'areaId', |
| | | label: '库位', |
| | | component: markRaw(WmWarehouseAreaSelect), |
| | | componentProps: { |
| | | placeholder: '请选择库位', |
| | | locationId: selectedLocation.value?.id, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['locationId'], |
| | | componentProps: (values: any) => ({ |
| | | placeholder: '请选择库位', |
| | | locationId: values.locationId, |
| | | }), |
| | | trigger: (values: any, formApi: any) => { |
| | | if (values.areaId !== undefined) { |
| | | void formApi.setFieldValue('areaId', undefined); |
| | | } |
| | | }, |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | |
| | | onOpenChange: async (isOpen: boolean) => { |
| | | if (!isOpen) { |
| | | selectedItem.value = null; |
| | | selectedWarehouse.value = null; |
| | | selectedLocation.value = null; |
| | | batchEnabled.value = false; |
| | | operateType.value = 1; |
| | | modalTitle.value = '库存调整'; |
| | |
| | | await formApi.setValues({ |
| | | itemId: data.itemId, |
| | | warehouseId: data.warehouseId, |
| | | locationId: data.locationId, |
| | | areaId: data.areaId, |
| | | }); |
| | | if (data.itemId) { |
| | | const itemDetail = await getItem(data.itemId); |
| | |
| | | const params: MaterialStockAdjustInParams = { |
| | | itemId: values.itemId, |
| | | warehouseId: values.warehouseId, |
| | | locationId: values.locationId, |
| | | areaId: values.areaId, |
| | | batchCode: values.batchCode, |
| | | produceDate: values.produceDate, |
| | | expireDate: values.expireDate, |
| | |
| | | const params: MaterialStockAdjustOutParams = { |
| | | itemId: values.itemId, |
| | | warehouseId: values.warehouseId, |
| | | locationId: values.locationId, |
| | | areaId: values.areaId, |
| | | batchCode: values.batchCode, |
| | | vendorId: values.vendorId, |
| | | quantity: values.quantity, |
| | |
| | | import { generateAutoCode } from '#/api/mes/md/autocode/record'; |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | import { MdItemSelect } from '#/views/mes/md/item/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: 100, |
| | | }, |
| | | { |
| | | field: 'locationName', |
| | | title: '库区', |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'areaName', |
| | | title: '库位', |
| | | minWidth: 100, |
| | | }, |
| | | ...(editable |
| | | ? [ |
| | | { |
| | |
| | | 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: 'remark', |
| | |
| | | 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', |
| | |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components'; |
| | | 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' | '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', |
| | |
| | | import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components'; |
| | | import { WmProductIssueLineSelect } from '#/views/wls/productissue/components'; |
| | | 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' | 'stock' | 'update'; |
| | |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'locationName', |
| | | title: '库区名称', |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'areaName', |
| | | title: '库位名称', |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | | title: '数量', |
| | | width: 100, |
| | |
| | | // componentProps: { |
| | | // excludeCodes: ['WIP_VIRTUAL_WAREHOUSE'], |
| | | // }, |
| | | }, |
| | | { |
| | | fieldName: 'locationId', |
| | | label: '上架目标库区', |
| | | component: markRaw(WmWarehouseLocationSelect), |
| | | dependencies: { |
| | | triggerFields: ['warehouseId'], |
| | | componentProps: (values) => ({ |
| | | disabled: !values.warehouseId, |
| | | warehouseId: values.warehouseId, |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'areaId', |
| | | label: '上架目标库位', |
| | | component: markRaw(WmWarehouseAreaSelect), |
| | | dependencies: { |
| | | triggerFields: ['locationId'], |
| | | componentProps: (values) => ({ |
| | | disabled: !values.locationId, |
| | | locationId: values.locationId, |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'batchCode', |
| | |
| | | import { ErpSaleOrderSelect } from '#/views/erp/sale/order/components'; |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { WmBatchSelect } from '#/views/wls/batch/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: 'batchCode', |
| | |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | import { MdItemSelect } from '#/views/mes/md/item/components'; |
| | | import { StockTakingPlanSelect } from '#/views/wls/stocktaking/plan/components'; |
| | | import { |
| | | WmWarehouseAreaSelect, |
| | | WmWarehouseLocationSelect, |
| | | WmWarehouseSelect, |
| | | } from '#/views/wls/warehouse/components'; |
| | | import { WmWarehouseSelect } from '#/views/wls/warehouse/components'; |
| | | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'execute' | 'submit' | 'update'; |
| | |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'locationName', |
| | | title: '库区', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'areaName', |
| | | title: '库位', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'status', |
| | | title: '状态', |
| | | minWidth: 100, |
| | |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'locationName', |
| | | title: '库区', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'areaName', |
| | | title: '库位', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | | title: '数量', |
| | | minWidth: 120, |
| | |
| | | onChange: async (lineId?: number) => { |
| | | const line = taskLines.find((item) => item.id === lineId); |
| | | await formApi?.setValues({ |
| | | areaId: line?.areaId, |
| | | batchCode: line?.batchCode, |
| | | batchId: line?.batchId, |
| | | itemId: line?.itemId, |
| | | locationId: line?.locationId, |
| | | materialStockId: line?.materialStockId, |
| | | warehouseId: line?.warehouseId, |
| | | }); |
| | | }, |
| | | options: taskLines.map((line) => ({ |
| | | label: `${line.itemCode} - ${line.itemName} (${line.warehouseName}${ |
| | | line.locationName ? ` / ${line.locationName}` : '' |
| | | }${line.areaName ? ` / ${line.areaName}` : ''})`, |
| | | label: `${line.itemCode} - ${line.itemName} (${line.warehouseName})`, |
| | | value: line.id, |
| | | })), |
| | | placeholder: '请选择盘点清单(可选)', |
| | |
| | | label: '仓库', |
| | | component: markRaw(WmWarehouseSelect), |
| | | componentProps: { |
| | | // 仓库变化时清空库区和库位 |
| | | onChange: () => |
| | | formApi?.setValues({ |
| | | areaId: undefined, |
| | | locationId: undefined, |
| | | }), |
| | | placeholder: '请选择仓库', |
| | | }, |
| | | rules: 'selectRequired', |
| | |
| | | dependencies: { |
| | | triggerFields: ['lineId'], |
| | | disabled: (values) => values.lineId !== null, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'locationId', |
| | | label: '库区', |
| | | component: markRaw(WmWarehouseLocationSelect), |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['warehouseId', 'lineId'], |
| | | show: (values) => !!values.warehouseId, |
| | | // 选中盘点清单后,库区由清单带出且禁止改动 |
| | | disabled: (values) => values.lineId !== null, |
| | | componentProps: (values) => ({ |
| | | onChange: () => formApi?.setFieldValue('areaId', undefined), |
| | | placeholder: '请选择库区', |
| | | warehouseId: values.warehouseId, |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'areaId', |
| | | label: '库位', |
| | | component: markRaw(WmWarehouseAreaSelect), |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['locationId', 'lineId'], |
| | | show: (values) => !!values.locationId, |
| | | // 选中盘点清单后,库位由清单带出且禁止改动 |
| | | disabled: (values) => values.lineId !== null, |
| | | componentProps: (values) => ({ |
| | | locationId: values.locationId, |
| | | placeholder: '请选择库位', |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'toLocationName', |
| | | title: '移入库区', |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'toAreaName', |
| | | title: '移入库位', |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | | title: '数量', |
| | | width: 100, |
| | |
| | | placeholder: '请选择移入仓库', |
| | | }, |
| | | rules: 'selectRequired', |
| | | }, |
| | | { |
| | | fieldName: 'toLocationId', |
| | | label: '移入库区', |
| | | component: markRaw(WmWarehouseLocationSelect), |
| | | componentProps: { |
| | | placeholder: '请选择移入库区', |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['toWarehouseId'], |
| | | componentProps: (values) => ({ |
| | | placeholder: '请选择移入库区', |
| | | warehouseId: values.toWarehouseId, |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'toAreaId', |
| | | label: '移入库位', |
| | | component: markRaw(WmWarehouseAreaSelect), |
| | | componentProps: { |
| | | placeholder: '请选择移入库位', |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['toLocationId'], |
| | | componentProps: (values) => ({ |
| | | locationId: values.toLocationId, |
| | | placeholder: '请选择移入库位', |
| | | }), |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'quantity', |