| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterials; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | |
| | | public class WmsInOutStockRecordAppService : CMSPluginAppService, IWmsInOutStockRecordAppService |
| | | { |
| | | private readonly IWmsInOutStockRecordRepository wmsInOutStockRecordRepository; |
| | | private readonly IWmsMaterialRepository _wmsMaterialRepository; |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="WmsInOutStockRecordAppService"/> class. |
| | | /// </summary> |
| | | /// <param name="WmsInOutStockRecordRepository">The task job repository.</param> |
| | | public WmsInOutStockRecordAppService(IWmsInOutStockRecordRepository _WmsInOutStockRecordRepository) |
| | | public WmsInOutStockRecordAppService(IWmsInOutStockRecordRepository _WmsInOutStockRecordRepository, IWmsMaterialRepository wmsMaterialRepository) |
| | | { |
| | | wmsInOutStockRecordRepository = _WmsInOutStockRecordRepository; |
| | | _wmsMaterialRepository = wmsMaterialRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | //{ |
| | | // throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.MaterialId]); |
| | | //} |
| | | // 校验物料是否存在 |
| | | |
| | | var maxSort = await wmsInOutStockRecordRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.OrderNo, "单据编号", 50); |
| | | Check.NotNullOrWhiteSpace(input.MaterialNo, "物料件号", 50); |
| | | Check.NotNull(input.StockType, "操作类型"); |
| | | Check.NotNull(input.ContainerNo, "托盘号"); |
| | | Check.NotNull(input.SourcePlace, "起始库位"); |
| | | Check.NotNull(input.ToPlace, "目标库位"); |
| | | Check.NotNull(input.TaskNo, "任务号"); |
| | | Check.NotNullOrWhiteSpace(input.MaterialId, "物料ID", 50); |
| | | Check.NotNullOrWhiteSpace(input.TaskNo, "任务号", 50); |
| | | |
| | |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: '任务号', |
| | | prop: 'taskNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请输入任务号', |
| | | rules: [{ required: true, message: '任务号不能为空', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '单据编号', |
| | | prop: 'orderNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请输入单据编号', |
| | | rules: [{ required: true, message: '单据编号不能为空', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '操作类型', |
| | | prop: 'stockType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请输入操作类型', |
| | | rules: [{ required: true, message: '操作类型不能为空', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '容器编号', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请输入容器编号', |
| | | }, |
| | | { |
| | | label: '物料名称', |
| | |
| | | rules: [{ required: true, message: '物料件号不能为空', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '操作类型', |
| | | prop: 'stockType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | placeholder: '请输入操作类型', |
| | | rules: [{ required: true, message: '操作类型不能为空', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '容器编号', |
| | | prop: 'containerNo', |
| | | label: '起始库位', |
| | | prop: 'sourcePlace', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请输入容器编号', |
| | | rules: [{ required: true, message: '起始库位不能为空', trigger: 'blur' }], |
| | | placeholder: '请输入起始库位', |
| | | }, |
| | | { |
| | | label: '目标库位', |
| | | prop: 'toPlace', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | rules: [{ required: true, message: '目标库位不能为空', trigger: 'blur' }], |
| | | placeholder: '请输入目标库位', |
| | | }, |
| | | { |
| | | label: '机型', |
| | |
| | | //disabled: disabled, |
| | | placeholder: '请输入物料ID', |
| | | rules: [{ required: true, message: '物料ID不能为空', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '任务号', |
| | | prop: 'taskNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请输入任务号', |
| | | rules: [{ required: true, message: '任务号不能为空', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '起始库位', |
| | | prop: 'sourcePlace', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请输入起始库位', |
| | | }, |
| | | { |
| | | label: '目标库位', |
| | | prop: 'toPlace', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请输入目标库位', |
| | | }, |
| | | ]) |
| | | /** |
| | |
| | | divided: true, |
| | | icon: 'o', |
| | | }, |
| | | { |
| | | label: '向上添加', |
| | | fn: (c: CurrentType, pageNum: number) => { |
| | | current.value = null |
| | | sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = '添加' |
| | | dialogConfig.isAdd = false |
| | | }, |
| | | divided: true, |
| | | icon: 'up', |
| | | }, |
| | | { |
| | | label: '向下添加', |
| | | fn: (c: CurrentType, pageNum: number) => { |
| | | current.value = null |
| | | sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = '添加' |
| | | dialogConfig.isAdd = false |
| | | }, |
| | | divided: true, |
| | | icon: 'down', |
| | | }, |
| | | { |
| | | label: '创建副本', |
| | | fn: async ({ row }: CurrentType) => { |
| | | await wmsPlace.cloneData([row.id]) |
| | | ElMessage.success('创建副本成功') |
| | | tableRef.value?.getList() |
| | | }, |
| | | divided: true, |
| | | icon: 'copy', |
| | | }, |
| | | // { |
| | | // label: '向上添加', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = '添加' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'up', |
| | | // }, |
| | | // { |
| | | // label: '向下添加', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = '添加' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'down', |
| | | // }, |
| | | // { |
| | | // label: '创建副本', |
| | | // fn: async ({ row }: CurrentType) => { |
| | | // await wmsPlace.cloneData([row.id]) |
| | | // ElMessage.success('创建副本成功') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: '删除', |
| | | fn: async (c: CurrentType) => { |
| | |
| | | prop: 'sonTaskType', |
| | | el: 'select', |
| | | //disabled: disabled, |
| | | rules: [ |
| | | { required: true, message: '子任务类型不能为空', trigger: 'blur' }, |
| | | ], |
| | | placeholder: '请输入子任务类型', |
| | | }, |
| | | { |