From 4b3fd35893972bb05fd7ab89dc624ab805093ff3 Mon Sep 17 00:00:00 2001 From: zs <zhousong@weben-smart.com> Date: 周日, 18 5月 2025 19:47:46 +0800 Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo --- PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs | 460 +++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeld.ts | 275 ++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.module.scss | 253 ++ HIAWms/server/src/CMS.Plugin.HIAWms.Application/Implements/WmsTaskAppService.cs | 73 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssemblyQueryDrawer.ts | 44 HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/QueryTaskTypeInput.cs | 25 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeldQueryDrawer.ts | 44 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/index.ts | 14 HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs | 38 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx | 61 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/PipeAccessoryWeld.module.scss | 7 HIAWms/server/src/CMS.Plugin.HIAWms/Controller/WmsTaskController.cs | 17 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickQueryDrawer.ts | 35 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx | 71 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/type/type.d.ts | 45 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/PipeAccessoryWeld.tsx | 80 Weben_CMS专用代码生成器/Code/Templete/AppService/IAppService模板.txt | 14 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/Config.ts | 27 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/File.ts | 31 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.module.scss | 253 ++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPick.ts | 41 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.tsx | 80 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.tsx | 80 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/enum.ts | 15 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs | 26 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssemblyDrawer.ts | 44 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/type/type.d.ts | 45 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssemblyQueryDrawer.ts | 35 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/PipeAccessoryWeld.tsx | 360 +++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickQueryDrawer.tsx | 181 + PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs | 53 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs | 98 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx | 360 +++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/type/type.d.ts | 45 HIAWms/server/src/CMS.Plugin.HIAWms/CMS.Plugin.HIAWms.csproj | 2 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickDrawer.ts | 34 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeldDrawer.ts | 34 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx | 61 PipeLineLems/pipelinelems_web/src/images/pipe-assembly-drawing-example.png | 0 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/File.ts | 31 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx | 61 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/File.ts | 31 HIAWms/hiawms_web/components.d.ts | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts | 41 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssemblyQueryDrawer.tsx | 181 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.module.scss | 7 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/Config.ts | 27 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss | 3 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkPlanAppService.cs | 17 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssemblyDrawer.ts | 34 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickDrawer.ts | 44 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx | 71 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeldQueryDrawer.ts | 35 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/enum.ts | 15 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/PipeAccessoryWeld.module.scss | 253 ++ HIAWms/hiawms_web/.vscode/settings.json | 7 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts | 275 ++ PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/CompleteAssemblyProcessInput.cs | 29 PipeLineLems/pipelinelems_web/src/images/pipe-Weld-drawing-example.png | 0 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx | 71 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssemblyDrawer.tsx | 190 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeldDrawer.ts | 44 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.module.scss | 7 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/StartProductionInput.cs | 28 PipeLineLems/pipelinelems_web/src/config/menu.ts | 42 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/config/PipeAccessoryWeld.json | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickDrawer.tsx | 190 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/config/PipeAccessoryPick.json | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts | 79 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeldDrawer.tsx | 190 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPick.ts | 275 ++ PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts | 32 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeld.ts | 79 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick.ts | 87 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickQueryDrawer.ts | 44 HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Services/IWmsTaskAppService.cs | 9 管子线LMESDemo.cmsproj | 0 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/enum.ts | 15 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts | 27 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeldQueryDrawer.tsx | 181 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.tsx | 367 +++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/index.ts | 14 HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/WmsTaskDto.cs | 5 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeld.ts | 41 Weben_CMS专用代码生成器/Code/Templete/AppService/AppService模板.txt | 51 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/index.ts | 14 Weben_CMS专用代码生成器/Code/Templete/Controller模板.txt | 24 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/config/PipeAccessoryAssembly.json | 3 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs | 146 + 94 files changed, 6,860 insertions(+), 42 deletions(-) diff --git a/HIAWms/hiawms_web/.vscode/settings.json b/HIAWms/hiawms_web/.vscode/settings.json index 9e26dfe..728a996 100644 --- a/HIAWms/hiawms_web/.vscode/settings.json +++ b/HIAWms/hiawms_web/.vscode/settings.json @@ -1 +1,6 @@ -{} \ No newline at end of file +{ + "i18n-ally.localesPaths": [ + "public/language", + "src/libs/Language/i18n" + ] +} \ No newline at end of file diff --git a/HIAWms/hiawms_web/components.d.ts b/HIAWms/hiawms_web/components.d.ts index 135cdd6..988c7da 100644 --- a/HIAWms/hiawms_web/components.d.ts +++ b/HIAWms/hiawms_web/components.d.ts @@ -21,6 +21,8 @@ Dialog: typeof import('./src/components/Dialog/index.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] + ElCollapse: typeof import('element-plus/es')['ElCollapse'] + ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] @@ -42,6 +44,7 @@ ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadio: typeof import('element-plus/es')['ElRadio'] ElSelect: typeof import('element-plus/es')['ElSelect'] + ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/QueryTaskTypeInput.cs b/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/QueryTaskTypeInput.cs index 15b99a7..dbb143e 100644 --- a/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/QueryTaskTypeInput.cs +++ b/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/QueryTaskTypeInput.cs @@ -12,6 +12,31 @@ /// </summary> public class QueryTaskTypeInput { + /// <summary> + /// 浠诲姟绫诲瀷 + /// </summary> public TaskTypeEnum TaskType { get; set; } + + /// <summary> + /// 鍏ュ簱鍙f湁璐� + /// </summary> + public bool InStockHasGood { get; set; } + + /// <summary> + /// 鍑哄簱鍙f湁璐� + /// </summary> + public bool OutStockHasGood { get; set; } + + } + + /// <summary> + /// 涓嬪彂瀹屾垚鐨勪换鍔″叆鍙�. + /// </summary> + public class ExcecuteTaskInput + { + /// <summary> + /// 浠诲姟鍙� + /// </summary> + public string TaskNo { get; set;} } } diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/WmsTaskDto.cs b/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/WmsTaskDto.cs index 36eb5c1..91a608e 100644 --- a/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/WmsTaskDto.cs +++ b/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsTask/WmsTaskDto.cs @@ -29,6 +29,7 @@ { get { + if (TaskType == 0) return ""; return GetEnumDescriptionUtil.GetEnumDescription(TaskType); } } @@ -49,6 +50,7 @@ { get { + if (TaskStatus == 0) return ""; return GetEnumDescriptionUtil.GetEnumDescription(TaskStatus); } } @@ -95,6 +97,7 @@ { get { + if (Dodevicetype == 0) return ""; return GetEnumDescriptionUtil.GetEnumDescription(Dodevicetype); } } @@ -111,6 +114,7 @@ { get { + if (TaskDodeviceStatus == 0) return ""; return GetEnumDescriptionUtil.GetEnumDescription(TaskDodeviceStatus); } } @@ -132,6 +136,7 @@ { get { + if (SonTaskType == 0 || !SonTaskType.HasValue) return ""; return GetEnumDescriptionUtil.GetEnumDescription(SonTaskType); } } diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Services/IWmsTaskAppService.cs b/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Services/IWmsTaskAppService.cs index 7f6670c..b86ef51 100644 --- a/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Services/IWmsTaskAppService.cs +++ b/HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Services/IWmsTaskAppService.cs @@ -49,7 +49,7 @@ /// </summary> /// <param name="input"></param> /// <returns></returns> - Task FinishTaskAsync(WmsTaskStatusDto input); + Task<WmsTaskDto> FinishTaskAsync(WmsTaskStatusDto input); /// <summary> /// 鍙栨秷浠诲姟 @@ -71,4 +71,11 @@ /// <param name="input"></param> /// <returns></returns> Task<WmsTaskDto> GetToExecuteTaskAsync(QueryTaskTypeInput input); + + /// <summary> + /// 鏇存柊浠诲姟涓烘墽琛屼腑 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<WmsTaskDto> StartExecuteTaskAsync(ExcecuteTaskInput input); } diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms.Application/Implements/WmsTaskAppService.cs b/HIAWms/server/src/CMS.Plugin.HIAWms.Application/Implements/WmsTaskAppService.cs index 7ede721..fdb8c6f 100644 --- a/HIAWms/server/src/CMS.Plugin.HIAWms.Application/Implements/WmsTaskAppService.cs +++ b/HIAWms/server/src/CMS.Plugin.HIAWms.Application/Implements/WmsTaskAppService.cs @@ -526,8 +526,12 @@ /// <param name="input"></param> /// <returns></returns> /// <exception cref="UserFriendlyException"></exception> - public async Task FinishTaskAsync(WmsTaskStatusDto input) + public async Task<WmsTaskDto> FinishTaskAsync(WmsTaskStatusDto input) { + if (string.IsNullOrEmpty(input.TaskNo)) + { + throw new UserFriendlyException("浠诲姟鍙蜂笉鑳戒负绌�"); + } using var scope = _serviceProvider.CreateScope(); var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); using var uow = unitOfWorkManager.Begin(requiresNew: true); @@ -640,6 +644,8 @@ await uow.SaveChangesAsync(); await uow.CompleteAsync(); + + return ObjectMapper.Map<WmsTask, WmsTaskDto>(task); } /// <summary> @@ -650,7 +656,10 @@ /// <exception cref="UserFriendlyException"></exception> public async Task CancelTaskAysnc(WmsTaskStatusDto input) { - + if (string.IsNullOrEmpty(input.TaskNo)) + { + throw new UserFriendlyException("浠诲姟鍙蜂笉鑳戒负绌�"); + } using var scope = _serviceProvider.CreateScope(); var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); using var uow = unitOfWorkManager.Begin(requiresNew: true); @@ -705,7 +714,13 @@ /// <exception cref="UserFriendlyException"></exception> public async Task ChangeTaskToPlaceAsync(ChangeTaskToPlaceInput input) { - var task = await wmsTaskRepository.FindByNameAsync(input.TaskNo); + + if (string.IsNullOrEmpty(input.TaskNo)) + { + throw new UserFriendlyException("浠诲姟鍙蜂笉鑳戒负绌�"); + } + + var task = await wmsTaskRepository.FindByNameAsync(input.TaskNo); if (task == null) { throw new UserFriendlyException("浠诲姟淇℃伅涓嶅瓨鍦�"); @@ -722,13 +737,13 @@ throw new UserFriendlyException("鐩爣搴撲綅淇℃伅涓嶅瓨鍦�"); } - if(toPlaceInfo.IsDisabled) + if (toPlaceInfo.IsDisabled) { throw new UserFriendlyException("鐩爣搴撲綅宸茶绂佺敤"); } var toplaceStock = await _wmsMaterialStockRepository.GetStockListAsync(new WmsMaterialStock { PlaceNo = input.ToPlace }); - if (toplaceStock != null && toplaceStock.Count>0) + if (toplaceStock != null && toplaceStock.Count > 0) { var model = toplaceStock.FirstOrDefault(); if (model.MaterialModel != input.MutableParam1) @@ -755,14 +770,56 @@ var whereConditions = DynamicGetQueryParams(queryInput); var NoStartTaskList = await wmsTaskRepository.GetTaskListAsync(whereConditions); - if(NoStartTaskList.Count<=0) return null; - var executeTask = NoStartTaskList.FirstOrDefault(x=>x.TaskType == input.TaskType); - if(executeTask == null) + + if (NoStartTaskList.Count <= 0) return null; + + var executeTaskList = NoStartTaskList.WhereIf(input.TaskType > 0, x => x.TaskType == input.TaskType).OrderBy(x => x.TaskType).ThenBy(x => x.TaskLevel).ToList(); + + var executeTask = executeTaskList.FirstOrDefault(); + if (input.OutStockHasGood) + { + executeTask = NoStartTaskList.OrderByDescending(x => x.TaskType == TaskTypeEnum.RUKU).ThenBy(x => x.TaskLevel).FirstOrDefault(); + } + + if (executeTask == null) { return ObjectMapper.Map<WmsTask, WmsTaskDto>(NoStartTaskList.FirstOrDefault()); } + if (executeTask.TaskType == TaskTypeEnum.CHUKU && input.OutStockHasGood) + { + return null; + } + + if(executeTask.TaskType == TaskTypeEnum.RUKU && !input.InStockHasGood) + { + return null; + } + return ObjectMapper.Map<WmsTask, WmsTaskDto>(executeTask); } + + + /// <summary> + /// 鏇存柊浠诲姟涓烘墽琛屼腑 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public async Task<WmsTaskDto> StartExecuteTaskAsync(ExcecuteTaskInput input) + { + if (string.IsNullOrEmpty(input.TaskNo)) + { + throw new UserFriendlyException("浠诲姟鍙蜂笉鑳戒负绌�"); + } + var task = await wmsTaskRepository.FindByNameAsync(input.TaskNo); + if(task == null) + { + return null; + } + task.TaskStatus = WmsTaskStatus.ZHIXINGZHONG; + task.TaskDodeviceStatus = TaskDodeviceStatus.SrmProgress; + await wmsTaskRepository.UpdateAsync(task); + return ObjectMapper.Map<WmsTask, WmsTaskDto>(task); + } } diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms/CMS.Plugin.HIAWms.csproj b/HIAWms/server/src/CMS.Plugin.HIAWms/CMS.Plugin.HIAWms.csproj index 69a13a5..5879009 100644 --- a/HIAWms/server/src/CMS.Plugin.HIAWms/CMS.Plugin.HIAWms.csproj +++ b/HIAWms/server/src/CMS.Plugin.HIAWms/CMS.Plugin.HIAWms.csproj @@ -11,7 +11,7 @@ </PropertyGroup> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))"> - <CMSRootPath>D:\syc\CMS Editor</CMSRootPath> + <CMSRootPath>E:\syc_cms\CMS Editor</CMSRootPath> <OutputPath>$(CMSRootPath)\plugins\cms.plugin.hiawms</OutputPath> </PropertyGroup> diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs b/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs index 50523df..db6a442 100644 --- a/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs +++ b/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs @@ -1,5 +1,6 @@ 锘縰sing CMS.Extensions.Abp.AspNetCore.Mvc.Filters; using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto; +using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterialStocks; using CMS.Plugin.HIAWms.Application.Contracts.Services; using CmsQueryExtensions.Entitys; using Microsoft.AspNetCore.Mvc; @@ -20,10 +21,12 @@ public class LMesOperateController : ControllerBase { private readonly ILMesOperateAppService _mesOperateAppService; + private readonly IWmsMaterialStockAppService _wmsmaterialstockAppService; - public LMesOperateController(ILMesOperateAppService mesOperateAppService) + public LMesOperateController(ILMesOperateAppService mesOperateAppService, IWmsMaterialStockAppService wmsmaterialstockAppService) { _mesOperateAppService = mesOperateAppService; + _wmsmaterialstockAppService = wmsmaterialstockAppService; } /// <summary> @@ -57,5 +60,38 @@ } } + + + /// <summary> + /// LMes缁勭洏 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + [Route("LMes鈥嬧�婸alletizing鈥嬧��")] + public async Task<CmsApiResponse<WmsMaterialStockDto>> LMes鈥嬧�婸alletizing鈥嬧�婣sync(WmsMaterialStockCreateDto input) + { + try + { + var list = await _wmsmaterialstockAppService.CreateAsync(input); + return new CmsApiResponse<WmsMaterialStockDto>() + { + Data = list, + Code = 200, + Message = "LMes缁勭洏鎴愬姛" + }; + } + catch (Exception ex) + { + //throw; //涓嶈鎶涘嚭寮傚父锛屽惁鍒欏鏂逛細鎺ユ敹澶辫触鍛� + return new CmsApiResponse<WmsMaterialStockDto>() + { + Data = null, + Code = 500, + Message = ex.Message + }; + } + + } } } diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/WmsTaskController.cs b/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/WmsTaskController.cs index e67e967..38201ac 100644 --- a/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/WmsTaskController.cs +++ b/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/WmsTaskController.cs @@ -192,9 +192,9 @@ /// <returns></returns> [HttpPost] [Route("FinishTask")] - public async Task FinishTaskAsync(WmsTaskStatusDto input) + public async Task<WmsTaskDto> FinishTaskAsync(WmsTaskStatusDto input) { - await _wmsTaskAppService.FinishTaskAsync(input); + return await _wmsTaskAppService.FinishTaskAsync(input); } /// <summary> @@ -227,10 +227,21 @@ /// <param name="input"></param> /// <returns></returns> [HttpPost] - [Route("ToExecuteTask")] + [Route("GetExecuteTask")] public async Task<WmsTaskDto> GetToExecuteTaskAsync(QueryTaskTypeInput input) { return await _wmsTaskAppService.GetToExecuteTaskAsync(input); } + /// <summary> + /// 鏇存柊浠诲姟涓烘墽琛屼腑 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + [Route("ToExecuteTask")] + public async Task<WmsTaskDto> StartExecuteTaskAsync(ExcecuteTaskInput input) + { + return await _wmsTaskAppService.StartExecuteTaskAsync(input); + } } } diff --git a/PipeLineLems/pipelinelems_web/src/config/menu.ts b/PipeLineLems/pipelinelems_web/src/config/menu.ts index 286eb63..f52b44f 100644 --- a/PipeLineLems/pipelinelems_web/src/config/menu.ts +++ b/PipeLineLems/pipelinelems_web/src/config/menu.ts @@ -7,6 +7,27 @@ "notPage": false }, { + "name": "绠¢檮浠剁剨鎺�", + "path": "/information-base/PipeAccessoryWeld", + "patchName": "PipeAccessoryWeld", + "icon": "p", + "notPage": false + }, + { + "name": "鍒嗘嫞", + "path": "/information-base/PipeAccessoryPick", + "patchName": "PipeAccessoryPick", + "icon": "p", + "notPage": false + }, + { + "name": "绠¢檮浠惰閰�", + "path": "/information-base/PipeAccessoryAssembly", + "patchName": "PipeAccessoryAssembly", + "icon": "p", + "notPage": false + }, + { "name": "宸ュ崟绠$悊(鏂�)", "path": "/information-base/OrderManagement-main", "patchName": "OrderManagement-main", @@ -50,6 +71,27 @@ "icon": "p", "notPage": false }, + "PipeAccessoryWeld": { + "name": "绠¢檮浠剁剨鎺�", + "path": "/information-base/PipeAccessoryWeld", + "patchName": "PipeAccessoryWeld", + "icon": "p", + "notPage": false + }, + "PipeAccessoryPick": { + "name": "鍒嗘嫞", + "path": "/information-base/PipeAccessoryPick", + "patchName": "PipeAccessoryPick", + "icon": "p", + "notPage": false + }, + "PipeAccessoryAssembly": { + "name": "绠¢檮浠惰閰�", + "path": "/information-base/PipeAccessoryAssembly", + "patchName": "PipeAccessoryAssembly", + "icon": "p", + "notPage": false + }, "OrderManagement-main": { "name": "宸ュ崟绠$悊(鏂�)", "path": "/information-base/OrderManagement-main", diff --git a/PipeLineLems/pipelinelems_web/src/images/pipe-Weld-drawing-example.png b/PipeLineLems/pipelinelems_web/src/images/pipe-Weld-drawing-example.png new file mode 100644 index 0000000..098bc13 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/images/pipe-Weld-drawing-example.png Binary files differ diff --git a/PipeLineLems/pipelinelems_web/src/images/pipe-assembly-drawing-example.png b/PipeLineLems/pipelinelems_web/src/images/pipe-assembly-drawing-example.png new file mode 100644 index 0000000..4f57200 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/images/pipe-assembly-drawing-example.png Binary files differ diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/File.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/File.ts new file mode 100644 index 0000000..9162fef --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/File.ts @@ -0,0 +1,31 @@ +import { importFileToService, exportFileToClient } from '@/api/file' +import { ElMessage } from 'element-plus' +import { downloadFile } from '@/utils' +import dayjs from 'dayjs' + +export const useFile = () => { + /** + * 瀵煎叆鏂囦欢 + * @param url + */ + const importFile = async (url: string, file: File) => { + const formData = new FormData() + formData.append('file', file) + await importFileToService(url, formData) + ElMessage('瀵煎叆鎴愬姛') + } + /** + * 瀵煎嚭鏂囦欢 + * @param url + */ + const exportFile = async (url: string, params: any, name: string) => { + const res = await exportFileToClient(url, params) + downloadFile(res, `${name}_${dayjs().format('YYYYMMDDHHMMss')}.xlsx`) + ElMessage.success('瀵煎嚭鎴愬姛') + } + + return { + importFile, + exportFile, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts new file mode 100644 index 0000000..1c9df89 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts @@ -0,0 +1,275 @@ +import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainer } from '../Models/PipeAccessoryAssembly' +import { ElMessage } from 'element-plus' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { useFile } from './File' + +interface CurrentType { + row: any + index: number +} +export const useWmsMaterialContainer = (props: any, ctx?: any) => { + const wmsMaterialContainer = injectModel<WmsMaterialContainer>('wmsMaterialContainer') + const { exportFile } = useFile() + /** + * 澶撮儴閰嶇疆 + */ + const headers = ref({}) + /** + * 鍔ㄦ�佸垪閰嶇疆 + */ + const wmsMaterialContainerColumns = ref<Record<string, any>>([]) + /** + * 鎼滅储鍊� + */ + const search = ref('') + + /** + * 鎺掑簭 + */ + const sort = ref(0) + /** + * 閫夋嫨椤� + */ + const selection = ref([]) + /** + * 褰撳墠閫変腑鐨勮 + */ + const current = ref<any>(null) + /** + * 鏁版嵁婧� + */ + const dataSource: Ref<any[]> = ref([]) + + /** + * 琛ㄦ牸 + */ + const tableRef = ref() + const dialogConfig = reactive({ + visible: false, + title: '', + isAdd: false, + }) + const dialogConfigForQuery = reactive({ + visible: false, + title: '', + isAdd: false, + }) + + + const dialogSettingConfig = reactive({ + visible: false, + title: '', + }) + + /** + * 鍒嗛〉鏁版嵁 + */ + const paginationParams = ref({}) + + /** + * 鎵撳紑璇︽儏 + * @param row + */ + const openDetail = (row: any) => { + current.value = row + dialogConfig.visible = true + dialogConfig.title = row.name + dialogConfig.isAdd = false + sort.value = row.sort + } + + const contextMenu = [ + { + label: '灞曞紑璇︽儏', + fn: (c: CurrentType) => { + current.value = null + sort.value = c.row.sort + nextTick(() => openDetail(c.row)) + }, + 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 wmsMaterialContainer.cloneData([row.id]) + // ElMessage.success('鍒涘缓鍓湰鎴愬姛') + // tableRef.value?.getList() + // }, + // divided: true, + // icon: 'copy', + // }, + { + label: '鍒犻櫎', + fn: async (c: CurrentType) => { + const names = selection.value.map((item: { materialId: string }) => item.materialId) + ConfirmBox( + `鏄惁鍒犻櫎${names.length ? names.join(',') : c.row.materialId}` + ).then(async () => { + const ids = selection.value.map((item: { id: string }) => item.id) + await wmsMaterialContainer.deleteWmsMaterialContainers(ids.length ? ids : [c.row.id]) + ElMessage.success('鍒犻櫎鎴愬姛') + tableRef.value.getList() + }) + }, + icon: 'close', + }, + ] + + const onCheck = (records: any) => { + selection.value = records + } + + const onAddWmsMaterialContainer = () => { + const params = tableRef.value?.getPaginationParams() + current.value = null + dialogConfig.visible = true + dialogConfig.isAdd = true + dialogConfig.title = '娣诲姞' + sort.value = params.totalCount + 1 + } + + //鐐瑰嚮鎸夐挳銆愰珮绾ф煡璇€�� + const onAdvancedQuery = () => { + const params = tableRef.value?.getPaginationParams() + current.value = null + dialogConfigForQuery.visible = true + dialogConfigForQuery.isAdd = true + dialogConfigForQuery.title = '楂樼骇鏌ヨ' + } + + const onConfirmWmsMaterialContainer = async () => { + dialogConfig.visible = false + if (dialogConfig.isAdd) { + tableRef.value?.scrollToRow({ + skip: true, + }) + } else { + await tableRef.value?.getList() + } + } + /** + * 琛岀偣鍑绘椂鏇存柊current + */ + const onRowClick = ({ row }: any) => { + if (dialogConfig.visible && current.value) { + current.value = row + } + } + /** + * 瀵煎嚭 + */ + const onExport = (data={}) => { + //const params = tableRef.value?.getParams() + exportFile('/api/v1/HIAWms/wmsMaterialContainer/export', data, 'wmsMaterialContainer') + } + + /** + * 鍏抽敭瀛楁悳绱� + */ + const onSearch = () => { + tableRef.value?.getList({ + Filter: search.value, + }) + } + + /** + * 閲嶇疆琛ㄦ牸鏁版嵁 + */ + const reloadList = () => { + tableRef.value?.getList() + } + /** + * 涓婁紶鎴愬姛 + */ + const onSuccess = () => { + tableRef.value?.getList() + ElMessage.success('瀵煎叆鎴愬姛') + } + /** + * 澶辫触 + * @param err + */ + const onError = (err: any) => { + try { + const message = JSON.parse(err.message) + ElMessage.error(message.msg) + } catch (error) { + ElMessage.error('瀵煎叆澶辫触') + } + } + /** + * 涓婁紶閽╁瓙 + */ + const onBeforeUpload = (file: File) => { + const format = ['xlsx', 'xls', 'csv'] + if (!format.includes(file.name.split('.')[1])) { + ElMessage.error('瀵煎叆鏂囦欢鏍煎紡涓嶆纭紝璇峰鍏�.xlsx/.xls涓�.csv鏍煎紡鐨勬枃浠�') + return false + } + return true + } + + onMounted(() => { + headers.value = { + Authorization: `Bearer ${sessionStorage.getItem('Token')}`, + 'X-Project': sessionStorage.getItem('X-Project'), + } + }) + + ctx.expose({ + reloadList, + }) + + return { + dataSource, + contextMenu, + dialogConfig, + dialogConfigForQuery, + dialogSettingConfig, + tableRef, + current, + search, + sort, + wmsMaterialContainerColumns, + paginationParams, + headers, + onBeforeUpload, + onError, + onSuccess, + openDetail, + onSearch, + onExport, + onRowClick, + onConfirmWmsMaterialContainer, + onCheck, + onAddWmsMaterialContainer, + onAdvancedQuery + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssemblyDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssemblyDrawer.tsx new file mode 100644 index 0000000..61c6f7a --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssemblyDrawer.tsx @@ -0,0 +1,190 @@ +import { + ref, + onMounted, + reactive, + computed, + Ref, + watch, + SetupContext, + h, +} from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryAssemblyDrawer' +import { ElMessage } from 'element-plus' +import isEqual from 'lodash/isEqual' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { cloneDeep } from 'lodash' + +export const useWmsMaterialContainerDrawer = (props: any, ctx?: any) => { + const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( + 'wmsMaterialContainerDrawer' + ) + /** + * 鐢ㄦ潵瀵规瘮鐨勫垵濮嬪寲鏁版嵁 + */ + const initiateData: Ref<Record<string, any>> = ref({}) + const formData = ref<Record<string, any>>({}) + // ref + const formRef = ref() + + const disabled = ref(false) + + const current = computed(() => { + return props.row || null + }) + + const datePicker = (attrs) => { + return ( + <el-date-picker + type="date" + format="YYYY-MM-DD HH:mm:ss" + formatValue="YYYY-MM-DD HH:mm:ss" + {...attrs} + ></el-date-picker> + ) + } + + const dateTimePicker = (attrs) => { + return ( + <el-date-picker + type="datetime" + format="YYYY-MM-DD HH:mm:ss" + {...attrs} + ></el-date-picker> + ) + } + + const visible = computed({ + get() { + return props.modelValue + }, + set(val) { + ctx.emit('update:modelValue', val) + }, + }) + /** + * 娣诲姞鐨刦orm瀛楁 + */ + const formItems = reactive([ + { + label: '鎵樼洏缂栧彿', + prop: 'containerNo', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ユ墭鐩樼紪鍙�', + rules: [{ required: true, message: '鎵樼洏缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }], + }, + { + label: '鐗╂枡ID', + prop: 'materialId', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ墿鏂橧D', + rules: [{ required: true, message: '鐗╂枡ID涓嶈兘涓虹┖', trigger: 'blur' }], + }, + ]) + /** + * 鏍¢獙鏄惁鏈夋暟鎹彉鍖� + */ + const checkIsEqualObject = () => { + const data = { + formData: formData.value, + } + const check = isEqual(initiateData.value, data) + return check + } + + const onClose = (done: () => void) => { + if (visible.value) { + if (checkIsEqualObject()) { + visible.value = false + done && done() + } else { + ConfirmBox('鏄惁淇濆瓨璁剧疆锛�') + .then(() => { + onConfirm() + }) + .catch(() => { + visible.value = false + done && done() + }) + } + } + } + /** + * 淇濆瓨 + */ + const onConfirm = async () => { + await formRef.value?.validate() + const data = { + containerNo: formData.value.containerNo, + materialId: formData.value.materialId, + } + if (!current.value) { + await wmsMaterialContainerDrawer.addWmsMaterialContainer(data) + } else { + const id = current.value.id + await wmsMaterialContainerDrawer.updateWmsMaterialContainer(id, data) + } + ElMessage.success('淇濆瓨鎴愬姛') + ctx.emit('confirm') + } + + const updateCheckData = () => { + initiateData.value = { + formData: { + ...formData.value, + }, + } + } + const updateFormItemOptions = (propName: string, enumData: any[]) => { + const item = formItems.find((item) => item.prop === propName) + if (item && enumData) { + item.options = enumData.map((item) => ({ + label: item.description, + value: item.value, + })) + } + } + /** + * 閫氱敤鏌ヨ鏋氫妇 + */ + const commonQueryEnumForFrom = async () => {} + commonQueryEnumForFrom() + /** + * 寮圭獥鎵撳紑鑾峰彇璇︽儏 + */ + const onOpen = async () => { + if (current.value) { + const res = + await wmsMaterialContainerDrawer.getWmsMaterialContainerDetail( + current.value + ) + + formData.value = { + containerNo: res.containerNo, + materialId: res.materialId, + id: res.id, + } + disabled.value = true + updateCheckData() + } else { + formData.value = {} + + disabled.value = false + updateCheckData() + } + } + + watch(() => current.value, onOpen) + + return { + formItems, + formData, + visible, + formRef, + onOpen, + onClose, + onConfirm, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssemblyQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssemblyQueryDrawer.tsx new file mode 100644 index 0000000..2689188 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssemblyQueryDrawer.tsx @@ -0,0 +1,181 @@ +import { + ref, + onMounted, + reactive, + computed, + Ref, + watch, + SetupContext, + h, +} from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryAssemblyDrawer' +import { ElMessage } from 'element-plus' +import isEqual from 'lodash/isEqual' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { cloneDeep } from 'lodash' + +export const useWmsMaterialContainerQueryDrawer = (props: any, ctx?: any) => { + const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( + 'WmsMaterialContainerDrawer' + ) + /** + * 鐢ㄦ潵瀵规瘮鐨勫垵濮嬪寲鏁版嵁 + */ + const initiateData: Ref<Record<string, any>> = ref({}) + const formData = ref<Record<string, any>>({}) + // ref + const formRef = ref() + + const disabled = ref(false) + + const current = computed(() => { + return props.row || null + }) + + const inputNumber = (attrs) => { + return ( + <el-input-number + min="1" + step="1" + precision="0" + {...attrs} + ></el-input-number> + ) + } + + const datePickerRange = (attrs) => { + return ( + <el-date-picker + type="daterange" + value-format="YYYY-MM-DD HH:mm:ss" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + {...attrs} + ></el-date-picker> + ) + } + + const dateTimePickerRange = (attrs) => { + return ( + <el-date-picker + type="datetimerange" + value-format="YYYY-MM-DD HH:mm:ss" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + {...attrs} + ></el-date-picker> + ) + } + + const visible = computed({ + get() { + return props.modelValue + }, + set(val) { + ctx.emit('update:modelValue', val) + }, + }) + /** + * 娣诲姞鐨刦orm瀛楁 + */ + const formItems = reactive([ + { + label: '鎵樼洏缂栧彿', + prop: 'containerNo', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ユ墭鐩樼紪鍙�', + }, + { + label: '鐗╂枡ID', + prop: 'materialId', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ墿鏂橧D', + }, + ]) + /** + * 鏍¢獙鏄惁鏈夋暟鎹彉鍖� + */ + const checkIsEqualObject = () => { + const data = { + formData: formData.value, + } + const check = isEqual(initiateData.value, data) + return check + } + const commonGetFormData = () => { + const data = { + containerNo: formData.value.containerNo || '', + materialId: formData.value.materialId || '', + } + return data + } + const onClose = (done: () => void) => { + if (visible.value) { + visible.value = false + const data = commonGetFormData() + ctx.emit('close', data) + } + } + /** + * 纭鏌ヨ + */ + const onConfirmQuery = async () => { + const data = commonGetFormData() + ctx.emit('confirmQuery', data) + } + /** + * 閲嶇疆鏌ヨ + */ + const onReset = async () => { + formData.value = {} + formData.value.ContainerNo = '' + formData.value.MaterialId = '' + //鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢 + ctx.emit('restQuery') + } + + const updateCheckData = () => { + initiateData.value = { + formData: { + ...formData.value, + }, + } + } + const updateFormItemOptions = (propName: string, enumData: any[]) => { + const item = formItems.find((item) => item.prop === propName) + if (item && enumData) { + item.options = enumData.map((item) => ({ + label: item.description, + value: item.value, + })) + } + } + /** + * 閫氱敤鏌ヨ鏋氫妇 + */ + const commonQueryEnumForFrom = async () => {} + commonQueryEnumForFrom() + /** + * 寮圭獥鎵撳紑鑾峰彇璇︽儏 + */ + const onOpen = async () => { + disabled.value = false + updateCheckData() + } + + watch(() => current.value, onOpen) + + return { + formItems, + formData, + visible, + formRef, + onOpen, + onClose, + onConfirmQuery, + onReset, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts new file mode 100644 index 0000000..9bcfa04 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts @@ -0,0 +1,41 @@ +import { Base } from '@/libs/Base/Base' +import { + deleteWmsMaterialContainers, + addWmsMaterialContainer, + cloneData, +} from './Service/PipeAccessoryAssembly' + +export class WmsMaterialContainer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + }) + } + onMounted() {} + /** + * 鍒犻櫎 + * @param id + * @returns + */ + async deleteWmsMaterialContainers(ids: string[]) { + return deleteWmsMaterialContainers(ids) + } + + /** + * 娣诲姞鏁版嵁 + * @param data + * @returns + */ + addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + + /** + * 鍏嬮殕 + * @param ids + * @returns + */ + cloneData(ids: string[]) { + return cloneData(ids) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssemblyDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssemblyDrawer.ts new file mode 100644 index 0000000..f1a806f --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssemblyDrawer.ts @@ -0,0 +1,44 @@ +import { Base } from '@/libs/Base/Base' +import { + addWmsMaterialContainer, + getWmsMaterialContainer, + updateWmsMaterialContainer, + getWmsEnumData, +} from './Service/PipeAccessoryAssemblyDrawer' +import { useGlobalState } from '@/libs/Store/Store' + +export class WmsMaterialContainerDrawer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + wmsMaterialContainer: {}, + }) + } + + /** + * 娣诲姞 + * @param data + */ + async addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + /** + * 鏇存柊 + * @param data + */ + async updateWmsMaterialContainer(id: string, data: Record<string, any>) { + return updateWmsMaterialContainer(id, data) + } + + /** + * 鑾峰彇璇︽儏 + */ + async getWmsMaterialContainerDetail(current: any, id?: string) { + return getWmsMaterialContainer(id || current?.id) + } + + // 鑾峰彇鏋氫妇鍊� + async getWmsEnumData(data: Record<string, any>) { + return getWmsEnumData(data) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssemblyQueryDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssemblyQueryDrawer.ts new file mode 100644 index 0000000..5714cba --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssemblyQueryDrawer.ts @@ -0,0 +1,44 @@ +import { Base } from '@/libs/Base/Base' +import { + addWmsMaterialContainer, + getWmsMaterialContainer, + updateWmsMaterialContainer, + getWmsEnumData, +} from './Service/PipeAccessoryAssemblyQueryDrawer' +import { useGlobalState } from '@/libs/Store/Store' + +export class WmsMaterialContainerQueryDrawer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + wmsMaterialContainer: {}, + }) + } + + /** + * 娣诲姞 + * @param data + */ + async addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + /** + * 鏇存柊 + * @param data + */ + async updateWmsMaterialContainer(id: string, data: Record<string, any>) { + return updateWmsMaterialContainer(id, data) + } + + /** + * 鑾峰彇璇︽儏 + */ + async getWmsMaterialContainerDetail(current: any, id?: string) { + return getWmsMaterialContainer(id || current?.id) + } + + // 鑾峰彇鏋氫妇鍊� + async getWmsEnumData(data: Record<string, any>) { + return getWmsEnumData(data) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts new file mode 100644 index 0000000..92614a8 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts @@ -0,0 +1,79 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鎵归噺鍒犻櫎 + * @returns + */ +export const deleteWmsMaterialContainers = (ids: string[]) => { + return request({ + data: ids, + url: '/api/v1/HIAWms/wmsMaterialContainer', + method: 'delete', + }) +} + +/** + * 鍏嬮殕 + * @returns + */ +export const cloneData = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer/clone', data) +} + +/** + * 鐗╂枡鍨嬪彿鍒楄〃 + * @returns + */ +export const getMaterialModelList = () => { + return request.get(`/api/v1/hiawms/wmsenum/ModelList`) +} + +/** + * 搴撲綅鍙峰垪琛� + * @returns + */ +export const getPlaceNoForStockList = (data: any) => { + return request.get(`/api/v1/hiawms/wmsenum/placelist?placeType=${data}`) +} + +/** + * 鍏ュ簱 + * @returns + */ +export const instock = (data: any) => { + return request.post('/api/v1/HIAWms/wmsinsstock/bindinstock', data) +} + + +/** + * 鏍规嵁 绠℃缂栫爜銆佸伐搴� 鏌ヨ 浣滀笟璁″垝 + * @returns + */ +export const findSingleWorkPlanByFilter = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlan/FindSingleByFilter', data) +} + +/** + * 鏍规嵁 浠诲姟缂栧彿杩涜寮�宸� + * @returns + */ +export const startProduction = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/startProduction', data) +} + +/** + * 鏍规嵁 浠诲姟缂栧彿杩涜瀹屽伐 + * @returns + */ +export const finishProduction = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/finishProduction', data) +} \ No newline at end of file diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssemblyDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssemblyDrawer.ts new file mode 100644 index 0000000..fae0103 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssemblyDrawer.ts @@ -0,0 +1,34 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鑾峰彇璇︽儏 + * @returns + */ +export const getWmsMaterialContainer = (id: string) => { + return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) +} + +/** + * 鏇存柊 + * @returns + */ +export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { + return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) +} + +/** + * 鑾峰彇鏋氫妇 + * @returns + */ +export const getWmsEnumData = (data: any) => { + return request.post('/api/v1/HIAWms/WmsEnum', data) +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssemblyQueryDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssemblyQueryDrawer.ts new file mode 100644 index 0000000..8f2a1a3 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssemblyQueryDrawer.ts @@ -0,0 +1,35 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鑾峰彇璇︽儏 + * @returns + */ +export const getWmsMaterialContainer = (id: string) => { + return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) +} + +/** + * 鏇存柊 + * @returns + */ +export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { + return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) +} + +/** + * 鑾峰彇鏋氫妇 + * @returns + */ +export const getWmsEnumData = (data: any) => { + return request.post('/api/v1/HIAWms/WmsEnum', data) +} + diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss new file mode 100644 index 0000000..177adca --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss @@ -0,0 +1,3 @@ +.drawer { + width: 800px; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx new file mode 100644 index 0000000..d594ce8 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx @@ -0,0 +1,61 @@ +import { SetupContext, defineComponent } from 'vue' +import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' +import styles from './WmsMaterialContainerDrawer.module.scss' +import { useWmsMaterialContainerDrawer } from '../../../../Controllers/PipeAccessoryAssemblyDrawer.tsx' +import DyForm from '@/components/DyForm/DyForm' + +// @ts-ignore +export default defineComponent<{ + [key: string]: any +}>({ + name: '寮圭獥', + props: { + modelValue: { + type: Boolean, + default: false, + }, + title: { + type: String, + default: '', + }, + row: { + type: Object, + }, + sort: { + type: Number, + default: 0, + }, + }, + emits: ['update:modelValue', 'close', 'submit', 'confirm'], + setup(props: Record<string, any>, ctx: SetupContext) { + const { + onClose, + onConfirm, + onOpen, + formRef, + visible, + formItems, + formData, + } = useWmsMaterialContainerDrawer(props, ctx) + return () => ( + <BaseDrawer + class={styles.drawer} + size="800px" + title={props.title || '娣诲姞'} + v-model={visible.value} + close-on-click-modal={true} + onConfirm={onConfirm} + onOpen={onOpen} + before-close={onClose} + onClose={onClose} + > + <DyForm + ref={formRef} + formData={formData.value} + labelWidth="106px" + formItemProps={formItems} + ></DyForm> + </BaseDrawer> + ) + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss new file mode 100644 index 0000000..177adca --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss @@ -0,0 +1,3 @@ +.drawer { + width: 800px; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx new file mode 100644 index 0000000..72fed0c --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx @@ -0,0 +1,71 @@ +/* + * 鐗╂枡鍩虹淇℃伅鏌ヨ寮瑰嚭妗� +*/ +import { SetupContext, defineComponent } from 'vue' +import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' +import styles from './WmsMaterialContainerQueryDrawer.module.scss' +import { useWmsMaterialContainerQueryDrawer } from '../../../../Controllers/PipeAccessoryAssemblyQueryDrawer.tsx' +import DyForm from '@/components/DyForm/DyForm' + +// @ts-ignore +export default defineComponent<{ + [key: string]: any +}>({ + name: '寮圭獥', + props: { + //鏋氫妇绫诲瀷瀛楀吀 + enumListDict:{ + type: Array as () => Array<{ key: string; value: object }>, // 瀹氫箟鏁扮粍鍏冪礌绫诲瀷 + default: () => [] // 榛樿鍊� + }, + modelValue: { + type: Boolean, + default: false, + }, + title: { + type: String, + default: '', + }, + row: { + type: Object, + }, + sort: { + type: Number, + default: 0, + }, + }, + emits: ['update:modelValue', 'close', 'submit', 'confirmquery1'], + setup(props: Record<string, any>, ctx: SetupContext) { + const { + onClose, + onConfirmQuery, + onOpen, + onReset, + formRef, + visible, + formItems, + formData, + } = useWmsMaterialContainerQueryDrawer(props, ctx) + return () => ( + <BaseQueryDrawer + class={styles.drawer} + size="800px" + title={props.title || '楂樼骇鏌ヨ'} + v-model={visible.value} + close-on-click-modal={true} + onReset={onReset} + onConfirmQueryForBase={onConfirmQuery} + onOpen={onOpen} + before-close={onClose} + onClose={onClose} + > + <DyForm + ref={formRef} + formData={formData.value} + labelWidth="106px" + formItemProps={formItems} + ></DyForm> + </BaseQueryDrawer> + ) + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts new file mode 100644 index 0000000..5e6ddfc --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts @@ -0,0 +1,27 @@ +export const columns = [ + { + type: 'seq', + width: 60, + title: '搴忓彿', + }, + { + field: 'containerNo', + title: '鎵樼洏缂栧彿', +}, +{ + field: 'materialId', + title: '鐗╂枡ID', +}, +{ + field: 'sort', + title: '', +}, +{ + field: 'creationTime', + title: '鏄惁绂佺敤', +}, +{ + field: 'deletionTime', + title: '', +}, +] diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.module.scss new file mode 100644 index 0000000..f0789b7 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.module.scss @@ -0,0 +1,253 @@ +.pipeAccessoryAssemblyContent { + width: 100%; + height: 100%; + // height: 100% !important; + // overflow-y: auto !important; /* 鍐呭瓒呭嚭鏃舵樉绀烘粴鍔ㄦ潯 */ + // padding-bottom: 20px; /* 閬垮厤鍐呭琚簳閮ㄩ伄鎸� */ + + .pipeAccessoryAssemblyList { + width: 100%; + height: calc(100% - 70px); + } + .headerContent { + display: flex; + justify-content: space-between; + align-items: center; + height: 43px; + } + .header { + margin-bottom: 12px; + display: flex; + justify-content: flex-end; + align-items: center; + } + + .h5Form { + display: flex; + flex-direction: column; + gap: 20px; // 琛ㄥ崟椤逛箣闂寸殑闂磋窛 + + .el-form-item { + margin-bottom: 0; // 绉婚櫎榛樿鐨勫簳閮ㄨ竟璺� + width: 100% !important; // 鍗犳弧鐖跺鍣ㄥ搴� + } + + .el-form-item__label { + display: block; + text-align: left; + margin-bottom: 8px; + font-weight: 500; + } + } +} + +.tagBox { + width: auto; + min-width: 80px; + height: 24px; + background: #ffffff; + border-radius: 19px 19px 19px 19px; + opacity: 1; + border: 1px dashed #bcc4cc; + width: 50px; + height: 20px; + font-size: 14px; + font-family: PingFang SC, PingFang SC; + font-weight: 400; + color: #5a84ff; + display: flex; + justify-content: center; + align-items: center; + // cursor: pointer; +} + +.group { + display: flex; + justify-content: space-between; + align-items: center; +} + +.groupTable { + width: 100%; +} + +.overBox { + width: 100%; + height: calc(100% - 20px); + overflow: auto; + :global(.cs-collapse-item__header) { + background-color: #f1f1f1; + padding: 0 20px; + height: 35px; + font-size: 16px; + font-family: PingFang SC, PingFang SC; + font-weight: 500; + } + :global(.cs-collapse-item__content) { + padding-bottom: 0px; + } +} +.groupHeader { + width: 100%; + height: 30px; + background: #ccc; +} + +.hideBlock { + display: none; +} +.queryForm { + padding: 10px; + background: #f5f7fa; + margin-bottom: 0px; + border-radius: 4px; + + .el-form-item { + margin-right: 20px; + margin-bottom: 0; + + // 缁熶竴杈撳叆妗嗗拰閫夋嫨妗嗙殑瀹藉害 + .el-input, .el-select { + width: 200px; // 璁剧疆缁熶竴鐨勫搴� + } + + // 閫夋嫨妗嗗唴閮ㄨ緭鍏ユ鏍峰紡 + .el-select .el-input__wrapper { + height: 32px; // 涓庤緭鍏ユ楂樺害涓�鑷� + padding: 1px 11px; // 涓庤緭鍏ユ鍐呰竟璺濅竴鑷� + } + + // 鏃ユ湡閫夋嫨鍣ㄥ搴� + .el-date-editor { + width: 220px; + } + } +} + +// 濡傛灉闇�瑕佹洿绮剧‘鐨勬帶鍒讹紝鍙互鍗曠嫭璁剧疆 +.formItem { + width: 200px; + + &.el-input, &.el-select { + width: 100%; + } +} + + + +.newPageContent { + display: flex; + flex-wrap: wrap; + gap: 20px; + padding: 20px; + background-color: white; + + .info-block { + background-color: #f9f9f9; + border: 1px solid #eaeaea; + border-radius: 5px; + padding: 20px; + width: calc(33.33% - 20px); + + .block-title { + font-size: 20px; + font-weight: bold; + margin-bottom: 15px; + } + + .info-tags { + display: flex; + flex-wrap: wrap; + gap: 10px; + + .info-tag { + display: flex; + align-items: center; + gap: 5px; + + .tag-label { + font-weight: bold; + } + } + } + + .action-buttons { + display: flex; + gap: 10px; + margin-top: 20px; + } + + .equipment-image { + width: 100%; + height: auto; + margin-top: 20px; + } + + .status-normal { + color: green; + } + } + + .process-table { + width: 100%; + margin-top: 20px; + + .el-table { + border: 1px solid #eaeaea; + border-radius: 5px; + } + } +} + + +.modelRrow { + display: flex; /* 寮规�у竷灞� */ + gap: 20px; /* 鎺т欢闂磋窛 */ + align-items: center; /* 鍨傜洿灞呬腑 */ + margin-bottom: 12px; /* 搴曢儴闂磋窛 */ + width: 100%; + + .el-form-item { + flex: 1 !important; /* 鍧囧垎绌洪棿 */ + margin-bottom: 0; + max-width: none; // 绉婚櫎鏈�澶у搴﹂檺鍒� + } + + .el-select { + width: 100%; // 纭繚Select鍗犳弧鐖跺鍣ㄥ搴� + + // 绉婚櫎鍙兘褰卞搷瀹藉害鐨勫唴閮ㄦ牱寮� + .el-input__wrapper { + width: 100%; + } + } + + // 鍝嶅簲寮忚璁� + @media (max-width: 1200px) { + .model-row { + flex-wrap: wrap; + + .el-form-item { + flex: 1 0 calc(50% - 10px); // 鍦ㄤ腑绛夊睆骞曚笂姣忚鏄剧ず2涓� + margin-bottom: 10px; + } + } + } + + @media (max-width: 768px) { + .model-row { + flex-direction: column; + + .el-form-item { + width: 100%; // 鍦ㄥ皬灞忓箷涓婃瘡琛屾樉绀�1涓� + } + } + } +} + +.action-buttons { + display: flex; + gap: 10px; + margin-top: 20px; +} + diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx new file mode 100644 index 0000000..b27033c --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx @@ -0,0 +1,360 @@ +import { defineComponent, onMounted, ref } from 'vue' +import type { Ref } from 'vue' +import styles from './PipeAccessoryAssembly.module.scss' +import pipeImage from '@/images/pipe-assembly-drawing-example.png' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { + ElInput, + ElForm, + ElFormItem, + ElButton, + ElSelect, + ElOption, + ElMessage, + ElCol, +} from 'element-plus' +import { + getPlaceNoForStockList, + getMaterialModelList, + instock, + findSingleWorkPlanByFilter, + startProduction, + finishProduction +} from '@/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly' +import { Message } from '@element-plus/icons-vue/dist/types' + +export default defineComponent({ + name: 'PipeAccessoryAssembly', + setup() { + // 鏌ヨ琛ㄥ崟鏁版嵁 +const queryForm = ref({ + pipeSpecCode: '', + processRouteNumber: '', + taskCode: '', + length: '', + projectNumber: '', + shipNumber: '', + material: '', + outerDiameter: '', + thickness: '', + plannedStartTime: '', + plannedEndTime: '', + workstationCode: '', + processName: '', + equipmentCode: '' +}) + + // 鏁版嵁婧� + const modelOptions = ref<Array<{ value: string; label: string }>>([]) + const placeNoOptions = ref<Array<{ value: string; label: string }>>([]) + + onMounted(() => { + // 缁勪欢鎸傝浇鍚庤幏鍙栧瀷鍙峰垪琛ㄥ拰搴撲綅鍙峰垪琛� + getModelList() + getPlaceNoList() + }) + + // 缁勭洏鎿嶄綔 + const handlePalletize = () => { + console.log('缁勭洏鎿嶄綔', queryForm.value) + // 杩欓噷娣诲姞缁勭洏閫昏緫 + } + + // 缁勭洏鍏ュ簱鎿嶄綔 + const handlePalletizeStorage = () => { + console.log('缁勭洏鍏ュ簱鎿嶄綔', queryForm.value) + instock(queryForm.value), resetQueryForm() + ElMessage.success({ + message: '缁勭洏鍏ュ簱鎴愬姛', + type: 'success', + }) + // 杩欓噷娣诲姞缁勭洏鍏ュ簱閫昏緫 + } + + const resetQueryForm = () => { + queryForm.value.materialModel = '' + queryForm.value.placeNo = '' + queryForm.value.materialBatch = '' + queryForm.value.stockNumber = '' + } + + const getModelList = async () => { + const models = await getMaterialModelList() + modelOptions.value = models.map((item: string) => ({ + value: item.materialModel, + label: item.materialModelDesc, + })) + } + + const getPlaceNoList = async () => { + const placeNos = await getPlaceNoForStockList(2) + console.log('搴撲綅鍙峰垪琛�:', placeNos) + placeNoOptions.value = placeNos.map((item: string) => ({ + value: item.placeNo, + label: item.placeNoDesc, + })) + } + const handleChange =async (value) => { + console.log('杈撳叆鍐呭纭:', value); // 澶卞幓鐒︾偣鎴栧洖杞︽椂瑙﹀彂 + // 鍦ㄦ澶勬坊鍔犱笟鍔¢�昏緫锛堝鏍¢獙銆佹彁浜ょ瓑锛� + const param={ + pipeSpecCode:value, + pipeSpecCode_FilterMode:2,//绮惧噯鏌ヨ + processName:'瑁呴厤宸ュ簭', + processName_FilterMode:2,//绮惧噯鏌ヨ + } + const workPlan = await findSingleWorkPlanByFilter(param); + console.log('杩斿洖:'+workPlan); + if(workPlan==''){ + ElMessage.error('娌℃湁鎵惧埌鏁版嵁'); + queryForm.value ={ pipeSpecCode: '', + processRouteNumber: '', + taskCode: '', + length: '', + projectNumber: '', + shipNumber: '', + material: '', + outerDiameter: '', + thickness: '', + plannedStartTime: '', + plannedEndTime: '', + workstationCode: '', + processName: '', + equipmentCode: ''} + }else{ + queryForm.value=workPlan; + } + }; + + // 寮�宸ヤ簨浠跺鐞� + const startWork = () => { + console.log('鎵ц寮�宸ユ搷浣�'); + if(queryForm.value.pipeSpecCode==''){ + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�'); + return + } + ConfirmBox( + `纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}寮�宸ュ悧` + ).then(async () => { + //鎮ㄧ殑涓氬姟閫昏緫 + const param={ + taskCode:queryForm.value.taskCode, + }; + const ret = await startProduction(param); + console.log('杩斿洖:'+ret); + if(ret.code="200"){ + ElMessage.success('寮�宸ユ垚鍔�'); + }else{ + ElMessage.error('寮�宸ュけ璐�:'+ret.message); + } + }) + } + // 瀹屽伐浜嬩欢澶勭悊 + const finishWork = () => { + console.log('鎵ц寮�宸ユ搷浣�'); + if(queryForm.value.pipeSpecCode==''){ + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�'); + return + } + ConfirmBox( + `纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}瀹屽伐鍚梎 + ).then(async () => { + //鎮ㄧ殑涓氬姟閫昏緫 + const param={ + pipeSpecCode:queryForm.value.pipeSpecCode, + processName:queryForm.value.processName, + }; + const ret = await finishProduction(param); + console.log('杩斿洖:'+ret); + if(ret.code="200"){ + ElMessage.success('瀹屽伐鎴愬姛'); + }else{ + ElMessage.error('瀹屽伐澶辫触:'+ret.message); + } + }) + } + const tableData = ref([ + { sequence: 1, flangeA: 'RF-200-1.6MPa', flangeB: 'WN-200-1.6MPa' }, + { sequence: 2, flangeA: 'WN-250-2.5MPa', flangeB: 'SO-250-2.5MPa' }, + { sequence: 3, flangeA: 'PL-300-1.0MPa', flangeB: 'RF-300-1.0MPa' }, + { sequence: 4, flangeA: 'SO-150-2.0MPa', flangeB: 'WN-150-2.0MPa' }, + { sequence: 5, flangeA: 'RF-400-1.6MPa', flangeB: 'PL-400-1.6MPa' }, + { sequence: 6, flangeA: 'WN-200-4.0MPa', flangeB: 'SO-200-4.0MPa' }, + { sequence: 7, flangeA: 'SO-300-1.6MPa', flangeB: 'RF-300-1.6MPa' }, + { sequence: 8, flangeA: 'PL-250-1.0MPa', flangeB: 'WN-250-1.0MPa' }, + { sequence: 9, flangeA: 'RF-150-2.5MPa', flangeB: 'SO-150-2.5MPa' }, + { sequence: 10, flangeA: 'WN-400-2.0MPa', flangeB: 'PL-400-2.0MPa' } + ]); + + + return () => { + return ( + <div + class={styles.PipeAccessoryAssemblyContent} + style="overflow-y: auto !important; height: 100%;" + > + <ElFormItem label="绠℃缂栫爜 "> + <ElInput + v-model={queryForm.value.pipeSpecCode} + clearable + class={styles.formInput} + onInput={handleChange} + /> + </ElFormItem> + <div class={styles.actionButtons}> + <ElButton type="warning" onClick={startWork}>寮�宸�</ElButton> + <ElButton type="warning" onClick={finishWork}>瀹屽伐</ElButton> + {/* <ElButton type="warning">鏆傚仠</ElButton> + <ElButton type="warning">鑷姩</ElButton> + <ElButton type="warning">璐ㄦ</ElButton> */} + </div> + + <h2 class={styles.blockTitle}>褰撳墠浠诲姟</h2> + <ElForm label-position="left" > + + <ElFormItem label="鐗╂枡娴佸悜 "> + <ElInput + v-model={queryForm.value.processRouteNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="浠诲姟缂栧彿 "> + <ElInput + v-model={queryForm.value.taskCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="绠℃闀垮害 "> + <ElInput + v-model={queryForm.value.length} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="椤圭洰 鍙�"> + <ElInput + v-model={queryForm.value.projectNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="鑸� 鍙�"> + <ElInput + v-model={queryForm.value.shipNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="鏉� 璐�"> + <ElInput + v-model={queryForm.value.material} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="澶� 寰�"> + <ElInput + v-model={queryForm.value.outerDiameter} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="澹� 鍘�"> + <ElInput + v-model={queryForm.value.thickness} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁″垝寮�濮嬫椂闂�"> + <ElInput + v-model={queryForm.value.plannedStartTime} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁″垝瀹屾垚鏃堕棿"> + <ElInput + v-model={queryForm.value.plannedEndTime} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + </ElForm> + + <h2 class={styles.blockTitle}>褰撳墠宸ヤ綅/璁惧淇℃伅</h2> + <ElForm label-position="left" > + <ElFormItem label="宸ヤ綅浠g爜 "> + <ElInput + v-model={queryForm.value.workstationCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="宸ュ簭鍚嶇О "> + <ElInput + v-model={queryForm.value.processName} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁惧浠g爜 "> + <ElInput + v-model={queryForm.value.equipmentCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + {/* <ElFormItem label="璁惧鐘舵��"> + <ElInput + v-model={queryForm.value.materialBatch} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> */} + {/* <ElFormItem label="鎿嶄綔浜�"> + <ElInput + v-model={queryForm.value.materialBatch} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> */} + </ElForm> + + {/* <div class="info-block"> + <h2 class="block-title">宸ヨ壓淇℃伅</h2> + <el-table stripe v-model:dataSource={tableData}> + <el-table-column prop="sequence" label="搴�"></el-table-column> + <el-table-column prop="flangeA" label="娉曞叞A"></el-table-column> + <el-table-column prop="flangeB" label="娉曞叞B"></el-table-column> + </el-table> + </div> */} + <h2 class="block-title">鍥剧焊</h2> + <img + src={pipeImage} + alt="璁惧鍥剧墖" + style="height:1250px;" + class="equipment-image" + ></img> + </div> + ) + } + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.module.scss new file mode 100644 index 0000000..b250814 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.module.scss @@ -0,0 +1,7 @@ +.PipeAccessoryAssembly { + background-color: #fff; + border-radius: 5px 5px 0 0; + width: 100%; + height: 100%; + border: 1px solid #dbdbdb; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.tsx new file mode 100644 index 0000000..0d03f55 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.tsx @@ -0,0 +1,80 @@ +import { + Component, + DefineComponent, + defineComponent, + markRaw, + ref, + SetupContext, + onMounted, +} from 'vue' +import styles from './PipeAccessoryAssembly.module.scss' +import Tab from '@/components/Tab/Tab' +import { useProvideModels } from '@/libs/Provider/app' +import { usePermission } from '@/libs/Permission/Permission' +import { permissionCodes } from '../enum' +import { ModuleType, TabItem } from '../type/Type' +import { getEntityNames } from '@/hooks/hook' +import TabPane from '@/components/Tab/TabPane' + +const Models: ModuleType = import.meta.glob('./config/*.json', { + eager: true, +}) + +const entityNames = getEntityNames(Models) + +const nameToLabelMap = [{ name: 'PipeAccessoryAssembly', label: '绠¢檮浠惰閰�' }] + +export default defineComponent({ + name: 'PipeAccessoryAssembly', + + setup(props, ctx: SetupContext) { + useProvideModels() + usePermission(props, permissionCodes) + + const rf = ref<{ + [key: string]: any + }>({}) + + const tabData = ref<TabItem[]>([]) + + const onTabChange = (v: string) => { + rf.value?.[v]?.reloadList() + } + + const initTableData = async () => { + for (const i in entityNames) { + const name = entityNames[i] + const module = await import(`./Pages/${name}/${name}.tsx`) + const PipeAccessoryAssembly = markRaw(module.default) + const foundLabel = + nameToLabelMap.find((item) => item.name === name)?.label || name + tabData.value.push({ + label: foundLabel, + name, + component: PipeAccessoryAssembly, + }) + } + } + + initTableData() + + return () => { + return ( + <div class={styles.PipeAccessoryAssembly}> + <Tab data={tabData.value} type="list" onTab={onTabChange}> + {tabData.value.map((widgetInfo) => { + const Widget: any = widgetInfo.component + return ( + <TabPane label={widgetInfo.label} name={widgetInfo.name}> + <Widget + ref={(r: any) => (rf.value['PipeAccessoryAssembly'] = r)} + ></Widget> + </TabPane> + ) + })} + </Tab> + </div> + ) + } + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/config/PipeAccessoryAssembly.json b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/config/PipeAccessoryAssembly.json new file mode 100644 index 0000000..5280937 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/config/PipeAccessoryAssembly.json @@ -0,0 +1,3 @@ +{ + "name": "PipeAccessoryAssembly" +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/enum.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/enum.ts new file mode 100644 index 0000000..780463e --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/enum.ts @@ -0,0 +1,15 @@ +export interface TabType { + label: string + name: string + columns?: any[] + data?: any[] + isFooter: boolean + [key: string]: any +} + +export const permissionCodes = { + 'PipeAccessoryAssembly-list': '鍒楄〃-鍒楄〃', + 'PipeAccessoryAssembly-add': '鍒楄〃-娣诲姞', + 'PipeAccessoryAssembly-import': '鍒楄〃-瀵煎叆', + 'PipeAccessoryAssembly-output': '鍒楄〃-杈撳嚭', +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/index.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/index.ts new file mode 100644 index 0000000..546c227 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/index.ts @@ -0,0 +1,14 @@ +import PipeAccessoryAssembly from './Views/PipeAccessoryAssembly' +import Setting from '@/components/Setting/Setting' +import { provider } from '@/provider/index' +import p from '../../assets/svg/p.svg' + +export default { + is: 'PipeAccessoryAssembly', + name: '绠¢檮浠惰閰�', + category: 'run', + icon: p, + authorizationRequired: false, + canvasView: provider(PipeAccessoryAssembly), + settingsView: Setting, +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/type/type.d.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/type/type.d.ts new file mode 100644 index 0000000..aa8d450 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/type/type.d.ts @@ -0,0 +1,45 @@ +import { Component } from 'vue' + +export interface DataItemType { + id?: string + name?: string + code?: string + description?: string + label?: string + value?: string | number +} + +export interface WmsMaterialContainerBaseType { + id?: string + name?: string + code?: string + value?: number + description?: string + options?: Array<DataItemType> + abilityValue?: number | string + data?: DataItemType + defaultValue?: string | number + flow: string +} + +export interface FlowDefinitionType { + id?: string + name?: string + code?: string + description?: string +} + +export type ModuleType = Record< + string, + { + default: Record<string, string> + name: string + } +> + +export interface TabItem { + name: string + label: string + component: Component + hidden?: boolean +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/File.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/File.ts new file mode 100644 index 0000000..9162fef --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/File.ts @@ -0,0 +1,31 @@ +import { importFileToService, exportFileToClient } from '@/api/file' +import { ElMessage } from 'element-plus' +import { downloadFile } from '@/utils' +import dayjs from 'dayjs' + +export const useFile = () => { + /** + * 瀵煎叆鏂囦欢 + * @param url + */ + const importFile = async (url: string, file: File) => { + const formData = new FormData() + formData.append('file', file) + await importFileToService(url, formData) + ElMessage('瀵煎叆鎴愬姛') + } + /** + * 瀵煎嚭鏂囦欢 + * @param url + */ + const exportFile = async (url: string, params: any, name: string) => { + const res = await exportFileToClient(url, params) + downloadFile(res, `${name}_${dayjs().format('YYYYMMDDHHMMss')}.xlsx`) + ElMessage.success('瀵煎嚭鎴愬姛') + } + + return { + importFile, + exportFile, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPick.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPick.ts new file mode 100644 index 0000000..62b7f91 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPick.ts @@ -0,0 +1,275 @@ +import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainer } from '../Models/PipeAccessoryPick' +import { ElMessage } from 'element-plus' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { useFile } from './File' + +interface CurrentType { + row: any + index: number +} +export const useWmsMaterialContainer = (props: any, ctx?: any) => { + const wmsMaterialContainer = injectModel<WmsMaterialContainer>('wmsMaterialContainer') + const { exportFile } = useFile() + /** + * 澶撮儴閰嶇疆 + */ + const headers = ref({}) + /** + * 鍔ㄦ�佸垪閰嶇疆 + */ + const wmsMaterialContainerColumns = ref<Record<string, any>>([]) + /** + * 鎼滅储鍊� + */ + const search = ref('') + + /** + * 鎺掑簭 + */ + const sort = ref(0) + /** + * 閫夋嫨椤� + */ + const selection = ref([]) + /** + * 褰撳墠閫変腑鐨勮 + */ + const current = ref<any>(null) + /** + * 鏁版嵁婧� + */ + const dataSource: Ref<any[]> = ref([]) + + /** + * 琛ㄦ牸 + */ + const tableRef = ref() + const dialogConfig = reactive({ + visible: false, + title: '', + isAdd: false, + }) + const dialogConfigForQuery = reactive({ + visible: false, + title: '', + isAdd: false, + }) + + + const dialogSettingConfig = reactive({ + visible: false, + title: '', + }) + + /** + * 鍒嗛〉鏁版嵁 + */ + const paginationParams = ref({}) + + /** + * 鎵撳紑璇︽儏 + * @param row + */ + const openDetail = (row: any) => { + current.value = row + dialogConfig.visible = true + dialogConfig.title = row.name + dialogConfig.isAdd = false + sort.value = row.sort + } + + const contextMenu = [ + { + label: '灞曞紑璇︽儏', + fn: (c: CurrentType) => { + current.value = null + sort.value = c.row.sort + nextTick(() => openDetail(c.row)) + }, + 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 wmsMaterialContainer.cloneData([row.id]) + // ElMessage.success('鍒涘缓鍓湰鎴愬姛') + // tableRef.value?.getList() + // }, + // divided: true, + // icon: 'copy', + // }, + { + label: '鍒犻櫎', + fn: async (c: CurrentType) => { + const names = selection.value.map((item: { materialId: string }) => item.materialId) + ConfirmBox( + `鏄惁鍒犻櫎${names.length ? names.join(',') : c.row.materialId}` + ).then(async () => { + const ids = selection.value.map((item: { id: string }) => item.id) + await wmsMaterialContainer.deleteWmsMaterialContainers(ids.length ? ids : [c.row.id]) + ElMessage.success('鍒犻櫎鎴愬姛') + tableRef.value.getList() + }) + }, + icon: 'close', + }, + ] + + const onCheck = (records: any) => { + selection.value = records + } + + const onAddWmsMaterialContainer = () => { + const params = tableRef.value?.getPaginationParams() + current.value = null + dialogConfig.visible = true + dialogConfig.isAdd = true + dialogConfig.title = '娣诲姞' + sort.value = params.totalCount + 1 + } + + //鐐瑰嚮鎸夐挳銆愰珮绾ф煡璇€�� + const onAdvancedQuery = () => { + const params = tableRef.value?.getPaginationParams() + current.value = null + dialogConfigForQuery.visible = true + dialogConfigForQuery.isAdd = true + dialogConfigForQuery.title = '楂樼骇鏌ヨ' + } + + const onConfirmWmsMaterialContainer = async () => { + dialogConfig.visible = false + if (dialogConfig.isAdd) { + tableRef.value?.scrollToRow({ + skip: true, + }) + } else { + await tableRef.value?.getList() + } + } + /** + * 琛岀偣鍑绘椂鏇存柊current + */ + const onRowClick = ({ row }: any) => { + if (dialogConfig.visible && current.value) { + current.value = row + } + } + /** + * 瀵煎嚭 + */ + const onExport = (data={}) => { + //const params = tableRef.value?.getParams() + exportFile('/api/v1/HIAWms/wmsMaterialContainer/export', data, 'wmsMaterialContainer') + } + + /** + * 鍏抽敭瀛楁悳绱� + */ + const onSearch = () => { + tableRef.value?.getList({ + Filter: search.value, + }) + } + + /** + * 閲嶇疆琛ㄦ牸鏁版嵁 + */ + const reloadList = () => { + tableRef.value?.getList() + } + /** + * 涓婁紶鎴愬姛 + */ + const onSuccess = () => { + tableRef.value?.getList() + ElMessage.success('瀵煎叆鎴愬姛') + } + /** + * 澶辫触 + * @param err + */ + const onError = (err: any) => { + try { + const message = JSON.parse(err.message) + ElMessage.error(message.msg) + } catch (error) { + ElMessage.error('瀵煎叆澶辫触') + } + } + /** + * 涓婁紶閽╁瓙 + */ + const onBeforeUpload = (file: File) => { + const format = ['xlsx', 'xls', 'csv'] + if (!format.includes(file.name.split('.')[1])) { + ElMessage.error('瀵煎叆鏂囦欢鏍煎紡涓嶆纭紝璇峰鍏�.xlsx/.xls涓�.csv鏍煎紡鐨勬枃浠�') + return false + } + return true + } + + onMounted(() => { + headers.value = { + Authorization: `Bearer ${sessionStorage.getItem('Token')}`, + 'X-Project': sessionStorage.getItem('X-Project'), + } + }) + + ctx.expose({ + reloadList, + }) + + return { + dataSource, + contextMenu, + dialogConfig, + dialogConfigForQuery, + dialogSettingConfig, + tableRef, + current, + search, + sort, + wmsMaterialContainerColumns, + paginationParams, + headers, + onBeforeUpload, + onError, + onSuccess, + openDetail, + onSearch, + onExport, + onRowClick, + onConfirmWmsMaterialContainer, + onCheck, + onAddWmsMaterialContainer, + onAdvancedQuery + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickDrawer.tsx new file mode 100644 index 0000000..d807a74 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickDrawer.tsx @@ -0,0 +1,190 @@ +import { + ref, + onMounted, + reactive, + computed, + Ref, + watch, + SetupContext, + h, +} from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryPickDrawer' +import { ElMessage } from 'element-plus' +import isEqual from 'lodash/isEqual' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { cloneDeep } from 'lodash' + +export const useWmsMaterialContainerDrawer = (props: any, ctx?: any) => { + const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( + 'wmsMaterialContainerDrawer' + ) + /** + * 鐢ㄦ潵瀵规瘮鐨勫垵濮嬪寲鏁版嵁 + */ + const initiateData: Ref<Record<string, any>> = ref({}) + const formData = ref<Record<string, any>>({}) + // ref + const formRef = ref() + + const disabled = ref(false) + + const current = computed(() => { + return props.row || null + }) + + const datePicker = (attrs) => { + return ( + <el-date-picker + type="date" + format="YYYY-MM-DD HH:mm:ss" + formatValue="YYYY-MM-DD HH:mm:ss" + {...attrs} + ></el-date-picker> + ) + } + + const dateTimePicker = (attrs) => { + return ( + <el-date-picker + type="datetime" + format="YYYY-MM-DD HH:mm:ss" + {...attrs} + ></el-date-picker> + ) + } + + const visible = computed({ + get() { + return props.modelValue + }, + set(val) { + ctx.emit('update:modelValue', val) + }, + }) + /** + * 娣诲姞鐨刦orm瀛楁 + */ + const formItems = reactive([ + { + label: '鎵樼洏缂栧彿', + prop: 'containerNo', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ユ墭鐩樼紪鍙�', + rules: [{ required: true, message: '鎵樼洏缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }], + }, + { + label: '鐗╂枡ID', + prop: 'materialId', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ墿鏂橧D', + rules: [{ required: true, message: '鐗╂枡ID涓嶈兘涓虹┖', trigger: 'blur' }], + }, + ]) + /** + * 鏍¢獙鏄惁鏈夋暟鎹彉鍖� + */ + const checkIsEqualObject = () => { + const data = { + formData: formData.value, + } + const check = isEqual(initiateData.value, data) + return check + } + + const onClose = (done: () => void) => { + if (visible.value) { + if (checkIsEqualObject()) { + visible.value = false + done && done() + } else { + ConfirmBox('鏄惁淇濆瓨璁剧疆锛�') + .then(() => { + onConfirm() + }) + .catch(() => { + visible.value = false + done && done() + }) + } + } + } + /** + * 淇濆瓨 + */ + const onConfirm = async () => { + await formRef.value?.validate() + const data = { + containerNo: formData.value.containerNo, + materialId: formData.value.materialId, + } + if (!current.value) { + await wmsMaterialContainerDrawer.addWmsMaterialContainer(data) + } else { + const id = current.value.id + await wmsMaterialContainerDrawer.updateWmsMaterialContainer(id, data) + } + ElMessage.success('淇濆瓨鎴愬姛') + ctx.emit('confirm') + } + + const updateCheckData = () => { + initiateData.value = { + formData: { + ...formData.value, + }, + } + } + const updateFormItemOptions = (propName: string, enumData: any[]) => { + const item = formItems.find((item) => item.prop === propName) + if (item && enumData) { + item.options = enumData.map((item) => ({ + label: item.description, + value: item.value, + })) + } + } + /** + * 閫氱敤鏌ヨ鏋氫妇 + */ + const commonQueryEnumForFrom = async () => {} + commonQueryEnumForFrom() + /** + * 寮圭獥鎵撳紑鑾峰彇璇︽儏 + */ + const onOpen = async () => { + if (current.value) { + const res = + await wmsMaterialContainerDrawer.getWmsMaterialContainerDetail( + current.value + ) + + formData.value = { + containerNo: res.containerNo, + materialId: res.materialId, + id: res.id, + } + disabled.value = true + updateCheckData() + } else { + formData.value = {} + + disabled.value = false + updateCheckData() + } + } + + watch(() => current.value, onOpen) + + return { + formItems, + formData, + visible, + formRef, + onOpen, + onClose, + onConfirm, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickQueryDrawer.tsx new file mode 100644 index 0000000..b7179ed --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickQueryDrawer.tsx @@ -0,0 +1,181 @@ +import { + ref, + onMounted, + reactive, + computed, + Ref, + watch, + SetupContext, + h, +} from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryPickDrawer' +import { ElMessage } from 'element-plus' +import isEqual from 'lodash/isEqual' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { cloneDeep } from 'lodash' + +export const useWmsMaterialContainerQueryDrawer = (props: any, ctx?: any) => { + const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( + 'WmsMaterialContainerDrawer' + ) + /** + * 鐢ㄦ潵瀵规瘮鐨勫垵濮嬪寲鏁版嵁 + */ + const initiateData: Ref<Record<string, any>> = ref({}) + const formData = ref<Record<string, any>>({}) + // ref + const formRef = ref() + + const disabled = ref(false) + + const current = computed(() => { + return props.row || null + }) + + const inputNumber = (attrs) => { + return ( + <el-input-number + min="1" + step="1" + precision="0" + {...attrs} + ></el-input-number> + ) + } + + const datePickerRange = (attrs) => { + return ( + <el-date-picker + type="daterange" + value-format="YYYY-MM-DD HH:mm:ss" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + {...attrs} + ></el-date-picker> + ) + } + + const dateTimePickerRange = (attrs) => { + return ( + <el-date-picker + type="datetimerange" + value-format="YYYY-MM-DD HH:mm:ss" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + {...attrs} + ></el-date-picker> + ) + } + + const visible = computed({ + get() { + return props.modelValue + }, + set(val) { + ctx.emit('update:modelValue', val) + }, + }) + /** + * 娣诲姞鐨刦orm瀛楁 + */ + const formItems = reactive([ + { + label: '鎵樼洏缂栧彿', + prop: 'containerNo', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ユ墭鐩樼紪鍙�', + }, + { + label: '鐗╂枡ID', + prop: 'materialId', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ墿鏂橧D', + }, + ]) + /** + * 鏍¢獙鏄惁鏈夋暟鎹彉鍖� + */ + const checkIsEqualObject = () => { + const data = { + formData: formData.value, + } + const check = isEqual(initiateData.value, data) + return check + } + const commonGetFormData = () => { + const data = { + containerNo: formData.value.containerNo || '', + materialId: formData.value.materialId || '', + } + return data + } + const onClose = (done: () => void) => { + if (visible.value) { + visible.value = false + const data = commonGetFormData() + ctx.emit('close', data) + } + } + /** + * 纭鏌ヨ + */ + const onConfirmQuery = async () => { + const data = commonGetFormData() + ctx.emit('confirmQuery', data) + } + /** + * 閲嶇疆鏌ヨ + */ + const onReset = async () => { + formData.value = {} + formData.value.ContainerNo = '' + formData.value.MaterialId = '' + //鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢 + ctx.emit('restQuery') + } + + const updateCheckData = () => { + initiateData.value = { + formData: { + ...formData.value, + }, + } + } + const updateFormItemOptions = (propName: string, enumData: any[]) => { + const item = formItems.find((item) => item.prop === propName) + if (item && enumData) { + item.options = enumData.map((item) => ({ + label: item.description, + value: item.value, + })) + } + } + /** + * 閫氱敤鏌ヨ鏋氫妇 + */ + const commonQueryEnumForFrom = async () => {} + commonQueryEnumForFrom() + /** + * 寮圭獥鎵撳紑鑾峰彇璇︽儏 + */ + const onOpen = async () => { + disabled.value = false + updateCheckData() + } + + watch(() => current.value, onOpen) + + return { + formItems, + formData, + visible, + formRef, + onOpen, + onClose, + onConfirmQuery, + onReset, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPick.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPick.ts new file mode 100644 index 0000000..33fee96 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPick.ts @@ -0,0 +1,41 @@ +import { Base } from '@/libs/Base/Base' +import { + deleteWmsMaterialContainers, + addWmsMaterialContainer, + cloneData, +} from './Service/PipeAccessoryPick' + +export class WmsMaterialContainer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + }) + } + onMounted() {} + /** + * 鍒犻櫎 + * @param id + * @returns + */ + async deleteWmsMaterialContainers(ids: string[]) { + return deleteWmsMaterialContainers(ids) + } + + /** + * 娣诲姞鏁版嵁 + * @param data + * @returns + */ + addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + + /** + * 鍏嬮殕 + * @param ids + * @returns + */ + cloneData(ids: string[]) { + return cloneData(ids) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickDrawer.ts new file mode 100644 index 0000000..456f2b2 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickDrawer.ts @@ -0,0 +1,44 @@ +import { Base } from '@/libs/Base/Base' +import { + addWmsMaterialContainer, + getWmsMaterialContainer, + updateWmsMaterialContainer, + getWmsEnumData, +} from './Service/PipeAccessoryPickDrawer' +import { useGlobalState } from '@/libs/Store/Store' + +export class WmsMaterialContainerDrawer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + wmsMaterialContainer: {}, + }) + } + + /** + * 娣诲姞 + * @param data + */ + async addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + /** + * 鏇存柊 + * @param data + */ + async updateWmsMaterialContainer(id: string, data: Record<string, any>) { + return updateWmsMaterialContainer(id, data) + } + + /** + * 鑾峰彇璇︽儏 + */ + async getWmsMaterialContainerDetail(current: any, id?: string) { + return getWmsMaterialContainer(id || current?.id) + } + + // 鑾峰彇鏋氫妇鍊� + async getWmsEnumData(data: Record<string, any>) { + return getWmsEnumData(data) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickQueryDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickQueryDrawer.ts new file mode 100644 index 0000000..3374aa6 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickQueryDrawer.ts @@ -0,0 +1,44 @@ +import { Base } from '@/libs/Base/Base' +import { + addWmsMaterialContainer, + getWmsMaterialContainer, + updateWmsMaterialContainer, + getWmsEnumData, +} from './Service/PipeAccessoryPickQueryDrawer' +import { useGlobalState } from '@/libs/Store/Store' + +export class WmsMaterialContainerQueryDrawer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + wmsMaterialContainer: {}, + }) + } + + /** + * 娣诲姞 + * @param data + */ + async addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + /** + * 鏇存柊 + * @param data + */ + async updateWmsMaterialContainer(id: string, data: Record<string, any>) { + return updateWmsMaterialContainer(id, data) + } + + /** + * 鑾峰彇璇︽儏 + */ + async getWmsMaterialContainerDetail(current: any, id?: string) { + return getWmsMaterialContainer(id || current?.id) + } + + // 鑾峰彇鏋氫妇鍊� + async getWmsEnumData(data: Record<string, any>) { + return getWmsEnumData(data) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick.ts new file mode 100644 index 0000000..23b4619 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick.ts @@ -0,0 +1,87 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鎵归噺鍒犻櫎 + * @returns + */ +export const deleteWmsMaterialContainers = (ids: string[]) => { + return request({ + data: ids, + url: '/api/v1/HIAWms/wmsMaterialContainer', + method: 'delete', + }) +} + +/** + * 鍏嬮殕 + * @returns + */ +export const cloneData = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer/clone', data) +} + +/** + * 鐗╂枡鍨嬪彿鍒楄〃 + * @returns + */ +export const getMaterialModelList = () => { + return request.get(`/api/v1/hiawms/wmsenum/ModelList`) +} + +/** + * 搴撲綅鍙峰垪琛� + * @returns + */ +export const getPlaceNoForStockList = (data: any) => { + return request.get(`/api/v1/hiawms/wmsenum/placelist?placeType=${data}`) +} + +/** + * 鍏ュ簱 + * @returns + */ +export const instock = (data: any) => { + return request.post('/api/v1/HIAWms/wmsinsstock/bindinstock', data) +} + + +/** + * 鏍规嵁 绠℃缂栫爜銆佸伐搴� 鏌ヨ 浣滀笟璁″垝 + * @returns + */ +export const findSingleWorkPlanByFilter = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlan/FindSingleByFilter', data) +} + +/** + * 鏍规嵁 浠诲姟缂栧彿杩涜寮�宸� + * @returns + */ +export const startProduction = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/startProduction', data) +} + +/** + * 鏍规嵁 浠诲姟缂栧彿杩涜瀹屽伐 + * @returns + */ +export const finishProduction = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/finishProduction', data) +} + +/** + * 鏍规嵁 浠诲姟缂栧彿杩涜瀹屽伐 + * @returns + */ +export const pick = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/pick', data) +} \ No newline at end of file diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickDrawer.ts new file mode 100644 index 0000000..fae0103 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickDrawer.ts @@ -0,0 +1,34 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鑾峰彇璇︽儏 + * @returns + */ +export const getWmsMaterialContainer = (id: string) => { + return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) +} + +/** + * 鏇存柊 + * @returns + */ +export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { + return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) +} + +/** + * 鑾峰彇鏋氫妇 + * @returns + */ +export const getWmsEnumData = (data: any) => { + return request.post('/api/v1/HIAWms/WmsEnum', data) +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickQueryDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickQueryDrawer.ts new file mode 100644 index 0000000..8f2a1a3 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickQueryDrawer.ts @@ -0,0 +1,35 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鑾峰彇璇︽儏 + * @returns + */ +export const getWmsMaterialContainer = (id: string) => { + return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) +} + +/** + * 鏇存柊 + * @returns + */ +export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { + return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) +} + +/** + * 鑾峰彇鏋氫妇 + * @returns + */ +export const getWmsEnumData = (data: any) => { + return request.post('/api/v1/HIAWms/WmsEnum', data) +} + diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss new file mode 100644 index 0000000..177adca --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss @@ -0,0 +1,3 @@ +.drawer { + width: 800px; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx new file mode 100644 index 0000000..b450041 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx @@ -0,0 +1,61 @@ +import { SetupContext, defineComponent } from 'vue' +import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' +import styles from './WmsMaterialContainerDrawer.module.scss' +import { useWmsMaterialContainerDrawer } from '../../../../Controllers/PipeAccessoryPickDrawer.tsx' +import DyForm from '@/components/DyForm/DyForm' + +// @ts-ignore +export default defineComponent<{ + [key: string]: any +}>({ + name: '寮圭獥', + props: { + modelValue: { + type: Boolean, + default: false, + }, + title: { + type: String, + default: '', + }, + row: { + type: Object, + }, + sort: { + type: Number, + default: 0, + }, + }, + emits: ['update:modelValue', 'close', 'submit', 'confirm'], + setup(props: Record<string, any>, ctx: SetupContext) { + const { + onClose, + onConfirm, + onOpen, + formRef, + visible, + formItems, + formData, + } = useWmsMaterialContainerDrawer(props, ctx) + return () => ( + <BaseDrawer + class={styles.drawer} + size="800px" + title={props.title || '娣诲姞'} + v-model={visible.value} + close-on-click-modal={true} + onConfirm={onConfirm} + onOpen={onOpen} + before-close={onClose} + onClose={onClose} + > + <DyForm + ref={formRef} + formData={formData.value} + labelWidth="106px" + formItemProps={formItems} + ></DyForm> + </BaseDrawer> + ) + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss new file mode 100644 index 0000000..177adca --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss @@ -0,0 +1,3 @@ +.drawer { + width: 800px; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx new file mode 100644 index 0000000..ced4098 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx @@ -0,0 +1,71 @@ +/* + * 鐗╂枡鍩虹淇℃伅鏌ヨ寮瑰嚭妗� +*/ +import { SetupContext, defineComponent } from 'vue' +import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' +import styles from './WmsMaterialContainerQueryDrawer.module.scss' +import { useWmsMaterialContainerQueryDrawer } from '../../../../Controllers/PipeAccessoryPickQueryDrawer.tsx' +import DyForm from '@/components/DyForm/DyForm' + +// @ts-ignore +export default defineComponent<{ + [key: string]: any +}>({ + name: '寮圭獥', + props: { + //鏋氫妇绫诲瀷瀛楀吀 + enumListDict:{ + type: Array as () => Array<{ key: string; value: object }>, // 瀹氫箟鏁扮粍鍏冪礌绫诲瀷 + default: () => [] // 榛樿鍊� + }, + modelValue: { + type: Boolean, + default: false, + }, + title: { + type: String, + default: '', + }, + row: { + type: Object, + }, + sort: { + type: Number, + default: 0, + }, + }, + emits: ['update:modelValue', 'close', 'submit', 'confirmquery1'], + setup(props: Record<string, any>, ctx: SetupContext) { + const { + onClose, + onConfirmQuery, + onOpen, + onReset, + formRef, + visible, + formItems, + formData, + } = useWmsMaterialContainerQueryDrawer(props, ctx) + return () => ( + <BaseQueryDrawer + class={styles.drawer} + size="800px" + title={props.title || '楂樼骇鏌ヨ'} + v-model={visible.value} + close-on-click-modal={true} + onReset={onReset} + onConfirmQueryForBase={onConfirmQuery} + onOpen={onOpen} + before-close={onClose} + onClose={onClose} + > + <DyForm + ref={formRef} + formData={formData.value} + labelWidth="106px" + formItemProps={formItems} + ></DyForm> + </BaseQueryDrawer> + ) + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/Config.ts new file mode 100644 index 0000000..5e6ddfc --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/Config.ts @@ -0,0 +1,27 @@ +export const columns = [ + { + type: 'seq', + width: 60, + title: '搴忓彿', + }, + { + field: 'containerNo', + title: '鎵樼洏缂栧彿', +}, +{ + field: 'materialId', + title: '鐗╂枡ID', +}, +{ + field: 'sort', + title: '', +}, +{ + field: 'creationTime', + title: '鏄惁绂佺敤', +}, +{ + field: 'deletionTime', + title: '', +}, +] diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.module.scss new file mode 100644 index 0000000..597d57e --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.module.scss @@ -0,0 +1,253 @@ +.pipeAccessoryPickContent { + width: 100%; + height: 100%; + // height: 100% !important; + // overflow-y: auto !important; /* 鍐呭瓒呭嚭鏃舵樉绀烘粴鍔ㄦ潯 */ + // padding-bottom: 20px; /* 閬垮厤鍐呭琚簳閮ㄩ伄鎸� */ + + .pipeAccessoryPickList { + width: 100%; + height: calc(100% - 70px); + } + .headerContent { + display: flex; + justify-content: space-between; + align-items: center; + height: 43px; + } + .header { + margin-bottom: 12px; + display: flex; + justify-content: flex-end; + align-items: center; + } + + .h5Form { + display: flex; + flex-direction: column; + gap: 20px; // 琛ㄥ崟椤逛箣闂寸殑闂磋窛 + + .el-form-item { + margin-bottom: 0; // 绉婚櫎榛樿鐨勫簳閮ㄨ竟璺� + width: 100% !important; // 鍗犳弧鐖跺鍣ㄥ搴� + } + + .el-form-item__label { + display: block; + text-align: left; + margin-bottom: 8px; + font-weight: 500; + } + } +} + +.tagBox { + width: auto; + min-width: 80px; + height: 24px; + background: #ffffff; + border-radius: 19px 19px 19px 19px; + opacity: 1; + border: 1px dashed #bcc4cc; + width: 50px; + height: 20px; + font-size: 14px; + font-family: PingFang SC, PingFang SC; + font-weight: 400; + color: #5a84ff; + display: flex; + justify-content: center; + align-items: center; + // cursor: pointer; +} + +.group { + display: flex; + justify-content: space-between; + align-items: center; +} + +.groupTable { + width: 100%; +} + +.overBox { + width: 100%; + height: calc(100% - 20px); + overflow: auto; + :global(.cs-collapse-item__header) { + background-color: #f1f1f1; + padding: 0 20px; + height: 35px; + font-size: 16px; + font-family: PingFang SC, PingFang SC; + font-weight: 500; + } + :global(.cs-collapse-item__content) { + padding-bottom: 0px; + } +} +.groupHeader { + width: 100%; + height: 30px; + background: #ccc; +} + +.hideBlock { + display: none; +} +.queryForm { + padding: 10px; + background: #f5f7fa; + margin-bottom: 0px; + border-radius: 4px; + + .el-form-item { + margin-right: 20px; + margin-bottom: 0; + + // 缁熶竴杈撳叆妗嗗拰閫夋嫨妗嗙殑瀹藉害 + .el-input, .el-select { + width: 200px; // 璁剧疆缁熶竴鐨勫搴� + } + + // 閫夋嫨妗嗗唴閮ㄨ緭鍏ユ鏍峰紡 + .el-select .el-input__wrapper { + height: 32px; // 涓庤緭鍏ユ楂樺害涓�鑷� + padding: 1px 11px; // 涓庤緭鍏ユ鍐呰竟璺濅竴鑷� + } + + // 鏃ユ湡閫夋嫨鍣ㄥ搴� + .el-date-editor { + width: 220px; + } + } +} + +// 濡傛灉闇�瑕佹洿绮剧‘鐨勬帶鍒讹紝鍙互鍗曠嫭璁剧疆 +.formItem { + width: 200px; + + &.el-input, &.el-select { + width: 100%; + } +} + + + +.newPageContent { + display: flex; + flex-wrap: wrap; + gap: 20px; + padding: 20px; + background-color: white; + + .info-block { + background-color: #f9f9f9; + border: 1px solid #eaeaea; + border-radius: 5px; + padding: 20px; + width: calc(33.33% - 20px); + + .block-title { + font-size: 20px; + font-weight: bold; + margin-bottom: 15px; + } + + .info-tags { + display: flex; + flex-wrap: wrap; + gap: 10px; + + .info-tag { + display: flex; + align-items: center; + gap: 5px; + + .tag-label { + font-weight: bold; + } + } + } + + .action-buttons { + display: flex; + gap: 10px; + margin-top: 20px; + } + + .equipment-image { + width: 100%; + height: auto; + margin-top: 20px; + } + + .status-normal { + color: green; + } + } + + .process-table { + width: 100%; + margin-top: 20px; + + .el-table { + border: 1px solid #eaeaea; + border-radius: 5px; + } + } +} + + +.modelRrow { + display: flex; /* 寮规�у竷灞� */ + gap: 20px; /* 鎺т欢闂磋窛 */ + align-items: center; /* 鍨傜洿灞呬腑 */ + margin-bottom: 12px; /* 搴曢儴闂磋窛 */ + width: 100%; + + .el-form-item { + flex: 1 !important; /* 鍧囧垎绌洪棿 */ + margin-bottom: 0; + max-width: none; // 绉婚櫎鏈�澶у搴﹂檺鍒� + } + + .el-select { + width: 100%; // 纭繚Select鍗犳弧鐖跺鍣ㄥ搴� + + // 绉婚櫎鍙兘褰卞搷瀹藉害鐨勫唴閮ㄦ牱寮� + .el-input__wrapper { + width: 100%; + } + } + + // 鍝嶅簲寮忚璁� + @media (max-width: 1200px) { + .model-row { + flex-wrap: wrap; + + .el-form-item { + flex: 1 0 calc(50% - 10px); // 鍦ㄤ腑绛夊睆骞曚笂姣忚鏄剧ず2涓� + margin-bottom: 10px; + } + } + } + + @media (max-width: 768px) { + .model-row { + flex-direction: column; + + .el-form-item { + width: 100%; // 鍦ㄥ皬灞忓箷涓婃瘡琛屾樉绀�1涓� + } + } + } +} + +.action-buttons { + display: flex; + gap: 10px; + margin-top: 20px; +} + diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.tsx new file mode 100644 index 0000000..7261c72 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.tsx @@ -0,0 +1,367 @@ +import { defineComponent, onMounted, ref } from 'vue' +import type { Ref } from 'vue' +import styles from './PipeAccessoryPick.module.scss' + +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { + ElInput, + ElForm, + ElFormItem, + ElButton, + ElSelect, + ElOption, + ElMessage, + ElCol, +} from 'element-plus' +import { + getPlaceNoForStockList, + getMaterialModelList, + instock, + findSingleWorkPlanByFilter, + pick, + finishProduction +} from '@/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick' +import { Message } from '@element-plus/icons-vue/dist/types' + +export default defineComponent({ + name: 'PipeAccessoryPick', + setup() { + // 鏌ヨ琛ㄥ崟鏁版嵁 +const queryForm = ref({ + pipeSpecCode: '', + continerNo:'', + processRouteNumber: '', + taskCode: '', + length: '', + projectNumber: '', + shipNumber: '', + material: '', + outerDiameter: '', + thickness: '', + plannedStartTime: '', + plannedEndTime: '', + workstationCode: '', + processName: '', + equipmentCode: '' +}) + + // 鏁版嵁婧� + const modelOptions = ref<Array<{ value: string; label: string }>>([]) + const placeNoOptions = ref<Array<{ value: string; label: string }>>([]) + + onMounted(() => { + // 缁勪欢鎸傝浇鍚庤幏鍙栧瀷鍙峰垪琛ㄥ拰搴撲綅鍙峰垪琛� + getModelList() + getPlaceNoList() + }) + + // 缁勭洏鎿嶄綔 + const handlePalletize = () => { + console.log('缁勭洏鎿嶄綔', queryForm.value) + // 杩欓噷娣诲姞缁勭洏閫昏緫 + } + + // 缁勭洏鍏ュ簱鎿嶄綔 + const handlePalletizeStorage = () => { + console.log('缁勭洏鍏ュ簱鎿嶄綔', queryForm.value) + instock(queryForm.value), resetQueryForm() + ElMessage.success({ + message: '缁勭洏鍏ュ簱鎴愬姛', + type: 'success', + }) + // 杩欓噷娣诲姞缁勭洏鍏ュ簱閫昏緫 + } + + const resetQueryForm = () => { + queryForm.value.materialModel = '' + queryForm.value.placeNo = '' + queryForm.value.materialBatch = '' + queryForm.value.stockNumber = '' + } + + const getModelList = async () => { + const models = await getMaterialModelList() + modelOptions.value = models.map((item: string) => ({ + value: item.materialModel, + label: item.materialModelDesc, + })) + } + + const getPlaceNoList = async () => { + const placeNos = await getPlaceNoForStockList(2) + console.log('搴撲綅鍙峰垪琛�:', placeNos) + placeNoOptions.value = placeNos.map((item: string) => ({ + value: item.placeNo, + label: item.placeNoDesc, + })) + } + const handleChange =async (value) => { + console.log('杈撳叆鍐呭纭:', value); // 澶卞幓鐒︾偣鎴栧洖杞︽椂瑙﹀彂 + // 鍦ㄦ澶勬坊鍔犱笟鍔¢�昏緫锛堝鏍¢獙銆佹彁浜ょ瓑锛� + const param={ + pipeSpecCode:value, + pipeSpecCode_FilterMode:2,//绮惧噯鏌ヨ + processName:'瑁呴厤宸ュ簭', + processName_FilterMode:2,//绮惧噯鏌ヨ + } + const workPlan = await findSingleWorkPlanByFilter(param); + console.log('杩斿洖:'+workPlan); + if(workPlan==''){ + ElMessage.error('娌℃湁鎵惧埌鏁版嵁'); + queryForm.value ={ pipeSpecCode: '', + continerNo:'', + processRouteNumber: '', + taskCode: '', + length: '', + projectNumber: '', + shipNumber: '', + material: '', + outerDiameter: '', + thickness: '', + plannedStartTime: '', + plannedEndTime: '', + workstationCode: '', + processName: '', + equipmentCode: ''} + }else{ + queryForm.value=workPlan; + } + }; + + // 鍒嗘嫞浜嬩欢澶勭悊 + const startWork = () => { + console.log('鎵ц寮�宸ユ搷浣�'); + if(queryForm.value.pipeSpecCode==''){ + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�'); + return + } + if(queryForm.value.continerNo==''){ + ElMessage.error('璇疯緭鍏ユ墭鐩樺彿'); + return + } + ConfirmBox( + `纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}鍒嗘嫞鍚梎 + ).then(async () => { + //鎮ㄧ殑涓氬姟閫昏緫 + const param={ + pipeSpecCode:queryForm.value.pipeSpecCode, + continerNo:queryForm.value.continerNo, + }; + const ret = await pick(param); + console.log('杩斿洖:'+ret); + if(ret.code="200"){ + ElMessage.success('鍒嗘嫞鎴愬姛'); + }else{ + ElMessage.error('鍒嗘嫞澶辫触:'+ret.message); + } + }) + } + // 瀹屽伐浜嬩欢澶勭悊 + const finishWork = () => { + console.log('鎵ц寮�宸ユ搷浣�'); + if(queryForm.value.pipeSpecCode==''){ + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�'); + return + } + ConfirmBox( + `纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}瀹屽伐鍚梎 + ).then(async () => { + //鎮ㄧ殑涓氬姟閫昏緫 + const param={ + pipeSpecCode:queryForm.value.pipeSpecCode, + processName:queryForm.value.processName, + }; + const ret = await finishProduction(param); + console.log('杩斿洖:'+ret); + if(ret.code="200"){ + ElMessage.success('瀹屽伐鎴愬姛'); + }else{ + ElMessage.error('瀹屽伐澶辫触:'+ret.message); + } + }) + } + const tableData = ref([ + { sequence: 1, flangeA: 'RF-200-1.6MPa', flangeB: 'WN-200-1.6MPa' }, + { sequence: 2, flangeA: 'WN-250-2.5MPa', flangeB: 'SO-250-2.5MPa' }, + { sequence: 3, flangeA: 'PL-300-1.0MPa', flangeB: 'RF-300-1.0MPa' }, + { sequence: 4, flangeA: 'SO-150-2.0MPa', flangeB: 'WN-150-2.0MPa' }, + { sequence: 5, flangeA: 'RF-400-1.6MPa', flangeB: 'PL-400-1.6MPa' }, + { sequence: 6, flangeA: 'WN-200-4.0MPa', flangeB: 'SO-200-4.0MPa' }, + { sequence: 7, flangeA: 'SO-300-1.6MPa', flangeB: 'RF-300-1.6MPa' }, + { sequence: 8, flangeA: 'PL-250-1.0MPa', flangeB: 'WN-250-1.0MPa' }, + { sequence: 9, flangeA: 'RF-150-2.5MPa', flangeB: 'SO-150-2.5MPa' }, + { sequence: 10, flangeA: 'WN-400-2.0MPa', flangeB: 'PL-400-2.0MPa' } + ]); + + + return () => { + return ( + <div + class={styles.PipeAccessoryPickContent} + style="overflow-y: auto !important; height: 100%;" + > + <ElFormItem label="绠℃缂栫爜 "> + <ElInput + v-model={queryForm.value.pipeSpecCode} + clearable + class={styles.formInput} + onInput={handleChange} + /> + </ElFormItem> + <ElFormItem label="鎵樼洏鍙� "> + <ElInput + v-model={queryForm.value.continerNo} + clearable + class={styles.formInput} + /> + </ElFormItem> + <div class={styles.actionButtons}> + <ElButton type="warning" onClick={startWork}>鍒嗘嫞</ElButton> + {/* <ElButton type="warning" onClick={finishWork}>瀹屽伐</ElButton> */} + {/* <ElButton type="warning">鏆傚仠</ElButton> + <ElButton type="warning">鑷姩</ElButton> + <ElButton type="warning">璐ㄦ</ElButton> */} + </div> + + <h2 class={styles.blockTitle}>褰撳墠浠诲姟</h2> + <ElForm label-position="left" > + + <ElFormItem label="鐗╂枡娴佸悜 "> + <ElInput + v-model={queryForm.value.processRouteNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="浠诲姟缂栧彿 "> + <ElInput + v-model={queryForm.value.taskCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="绠℃闀垮害 "> + <ElInput + v-model={queryForm.value.length} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="椤圭洰 鍙�"> + <ElInput + v-model={queryForm.value.projectNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="鑸� 鍙�"> + <ElInput + v-model={queryForm.value.shipNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="鏉� 璐�"> + <ElInput + v-model={queryForm.value.material} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="澶� 寰�"> + <ElInput + v-model={queryForm.value.outerDiameter} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="澹� 鍘�"> + <ElInput + v-model={queryForm.value.thickness} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁″垝寮�濮嬫椂闂�"> + <ElInput + v-model={queryForm.value.plannedStartTime} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁″垝瀹屾垚鏃堕棿"> + <ElInput + v-model={queryForm.value.plannedEndTime} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + </ElForm> + + <h2 class={styles.blockTitle}>褰撳墠宸ヤ綅/璁惧淇℃伅</h2> + <ElForm label-position="left" > + <ElFormItem label="宸ヤ綅浠g爜 "> + <ElInput + v-model={queryForm.value.workstationCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="宸ュ簭鍚嶇О "> + <ElInput + v-model={queryForm.value.processName} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁惧浠g爜 "> + <ElInput + v-model={queryForm.value.equipmentCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + {/* <ElFormItem label="璁惧鐘舵��"> + <ElInput + v-model={queryForm.value.materialBatch} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> */} + {/* <ElFormItem label="鎿嶄綔浜�"> + <ElInput + v-model={queryForm.value.materialBatch} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> */} + </ElForm> + + {/* <div class="info-block"> + <h2 class="block-title">宸ヨ壓淇℃伅</h2> + <el-table stripe v-model:dataSource={tableData}> + <el-table-column prop="sequence" label="搴�"></el-table-column> + <el-table-column prop="flangeA" label="娉曞叞A"></el-table-column> + <el-table-column prop="flangeB" label="娉曞叞B"></el-table-column> + </el-table> + </div> */} + </div> + ) + } + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.module.scss new file mode 100644 index 0000000..7c8d5b3 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.module.scss @@ -0,0 +1,7 @@ +.PipeAccessoryPick { + background-color: #fff; + border-radius: 5px 5px 0 0; + width: 100%; + height: 100%; + border: 1px solid #dbdbdb; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.tsx new file mode 100644 index 0000000..83ef666 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.tsx @@ -0,0 +1,80 @@ +import { + Component, + DefineComponent, + defineComponent, + markRaw, + ref, + SetupContext, + onMounted, +} from 'vue' +import styles from './PipeAccessoryPick.module.scss' +import Tab from '@/components/Tab/Tab' +import { useProvideModels } from '@/libs/Provider/app' +import { usePermission } from '@/libs/Permission/Permission' +import { permissionCodes } from '../enum' +import { ModuleType, TabItem } from '../type/Type' +import { getEntityNames } from '@/hooks/hook' +import TabPane from '@/components/Tab/TabPane' + +const Models: ModuleType = import.meta.glob('./config/*.json', { + eager: true, +}) + +const entityNames = getEntityNames(Models) + +const nameToLabelMap = [{ name: 'PipeAccessoryPick', label: '鍒嗘嫞' }] + +export default defineComponent({ + name: 'PipeAccessoryPick', + + setup(props, ctx: SetupContext) { + useProvideModels() + usePermission(props, permissionCodes) + + const rf = ref<{ + [key: string]: any + }>({}) + + const tabData = ref<TabItem[]>([]) + + const onTabChange = (v: string) => { + rf.value?.[v]?.reloadList() + } + + const initTableData = async () => { + for (const i in entityNames) { + const name = entityNames[i] + const module = await import(`./Pages/${name}/${name}.tsx`) + const PipeAccessoryPick = markRaw(module.default) + const foundLabel = + nameToLabelMap.find((item) => item.name === name)?.label || name + tabData.value.push({ + label: foundLabel, + name, + component: PipeAccessoryPick, + }) + } + } + + initTableData() + + return () => { + return ( + <div class={styles.PipeAccessoryPick}> + <Tab data={tabData.value} type="list" onTab={onTabChange}> + {tabData.value.map((widgetInfo) => { + const Widget: any = widgetInfo.component + return ( + <TabPane label={widgetInfo.label} name={widgetInfo.name}> + <Widget + ref={(r: any) => (rf.value['PipeAccessoryPick'] = r)} + ></Widget> + </TabPane> + ) + })} + </Tab> + </div> + ) + } + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/config/PipeAccessoryPick.json b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/config/PipeAccessoryPick.json new file mode 100644 index 0000000..153a75e --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/config/PipeAccessoryPick.json @@ -0,0 +1,3 @@ +{ + "name": "PipeAccessoryPick" +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/enum.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/enum.ts new file mode 100644 index 0000000..52c35ae --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/enum.ts @@ -0,0 +1,15 @@ +export interface TabType { + label: string + name: string + columns?: any[] + data?: any[] + isFooter: boolean + [key: string]: any +} + +export const permissionCodes = { + 'PipeAccessoryPick-list': '鍒楄〃-鍒楄〃', + 'PipeAccessoryPick-add': '鍒楄〃-娣诲姞', + 'PipeAccessoryPick-import': '鍒楄〃-瀵煎叆', + 'PipeAccessoryPick-output': '鍒楄〃-杈撳嚭', +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/index.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/index.ts new file mode 100644 index 0000000..0554855 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/index.ts @@ -0,0 +1,14 @@ +import PipeAccessoryPick from './Views/PipeAccessoryPick' +import Setting from '@/components/Setting/Setting' +import { provider } from '@/provider/index' +import p from '../../assets/svg/p.svg' + +export default { + is: 'PipeAccessoryPick', + name: '鍒嗘嫞', + category: 'run', + icon: p, + authorizationRequired: false, + canvasView: provider(PipeAccessoryPick), + settingsView: Setting, +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/type/type.d.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/type/type.d.ts new file mode 100644 index 0000000..aa8d450 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/type/type.d.ts @@ -0,0 +1,45 @@ +import { Component } from 'vue' + +export interface DataItemType { + id?: string + name?: string + code?: string + description?: string + label?: string + value?: string | number +} + +export interface WmsMaterialContainerBaseType { + id?: string + name?: string + code?: string + value?: number + description?: string + options?: Array<DataItemType> + abilityValue?: number | string + data?: DataItemType + defaultValue?: string | number + flow: string +} + +export interface FlowDefinitionType { + id?: string + name?: string + code?: string + description?: string +} + +export type ModuleType = Record< + string, + { + default: Record<string, string> + name: string + } +> + +export interface TabItem { + name: string + label: string + component: Component + hidden?: boolean +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/File.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/File.ts new file mode 100644 index 0000000..9162fef --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/File.ts @@ -0,0 +1,31 @@ +import { importFileToService, exportFileToClient } from '@/api/file' +import { ElMessage } from 'element-plus' +import { downloadFile } from '@/utils' +import dayjs from 'dayjs' + +export const useFile = () => { + /** + * 瀵煎叆鏂囦欢 + * @param url + */ + const importFile = async (url: string, file: File) => { + const formData = new FormData() + formData.append('file', file) + await importFileToService(url, formData) + ElMessage('瀵煎叆鎴愬姛') + } + /** + * 瀵煎嚭鏂囦欢 + * @param url + */ + const exportFile = async (url: string, params: any, name: string) => { + const res = await exportFileToClient(url, params) + downloadFile(res, `${name}_${dayjs().format('YYYYMMDDHHMMss')}.xlsx`) + ElMessage.success('瀵煎嚭鎴愬姛') + } + + return { + importFile, + exportFile, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeld.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeld.ts new file mode 100644 index 0000000..889b4dc --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeld.ts @@ -0,0 +1,275 @@ +import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainer } from '../Models/PipeAccessoryWeld' +import { ElMessage } from 'element-plus' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { useFile } from './File' + +interface CurrentType { + row: any + index: number +} +export const useWmsMaterialContainer = (props: any, ctx?: any) => { + const wmsMaterialContainer = injectModel<WmsMaterialContainer>('wmsMaterialContainer') + const { exportFile } = useFile() + /** + * 澶撮儴閰嶇疆 + */ + const headers = ref({}) + /** + * 鍔ㄦ�佸垪閰嶇疆 + */ + const wmsMaterialContainerColumns = ref<Record<string, any>>([]) + /** + * 鎼滅储鍊� + */ + const search = ref('') + + /** + * 鎺掑簭 + */ + const sort = ref(0) + /** + * 閫夋嫨椤� + */ + const selection = ref([]) + /** + * 褰撳墠閫変腑鐨勮 + */ + const current = ref<any>(null) + /** + * 鏁版嵁婧� + */ + const dataSource: Ref<any[]> = ref([]) + + /** + * 琛ㄦ牸 + */ + const tableRef = ref() + const dialogConfig = reactive({ + visible: false, + title: '', + isAdd: false, + }) + const dialogConfigForQuery = reactive({ + visible: false, + title: '', + isAdd: false, + }) + + + const dialogSettingConfig = reactive({ + visible: false, + title: '', + }) + + /** + * 鍒嗛〉鏁版嵁 + */ + const paginationParams = ref({}) + + /** + * 鎵撳紑璇︽儏 + * @param row + */ + const openDetail = (row: any) => { + current.value = row + dialogConfig.visible = true + dialogConfig.title = row.name + dialogConfig.isAdd = false + sort.value = row.sort + } + + const contextMenu = [ + { + label: '灞曞紑璇︽儏', + fn: (c: CurrentType) => { + current.value = null + sort.value = c.row.sort + nextTick(() => openDetail(c.row)) + }, + 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 wmsMaterialContainer.cloneData([row.id]) + // ElMessage.success('鍒涘缓鍓湰鎴愬姛') + // tableRef.value?.getList() + // }, + // divided: true, + // icon: 'copy', + // }, + { + label: '鍒犻櫎', + fn: async (c: CurrentType) => { + const names = selection.value.map((item: { materialId: string }) => item.materialId) + ConfirmBox( + `鏄惁鍒犻櫎${names.length ? names.join(',') : c.row.materialId}` + ).then(async () => { + const ids = selection.value.map((item: { id: string }) => item.id) + await wmsMaterialContainer.deleteWmsMaterialContainers(ids.length ? ids : [c.row.id]) + ElMessage.success('鍒犻櫎鎴愬姛') + tableRef.value.getList() + }) + }, + icon: 'close', + }, + ] + + const onCheck = (records: any) => { + selection.value = records + } + + const onAddWmsMaterialContainer = () => { + const params = tableRef.value?.getPaginationParams() + current.value = null + dialogConfig.visible = true + dialogConfig.isAdd = true + dialogConfig.title = '娣诲姞' + sort.value = params.totalCount + 1 + } + + //鐐瑰嚮鎸夐挳銆愰珮绾ф煡璇€�� + const onAdvancedQuery = () => { + const params = tableRef.value?.getPaginationParams() + current.value = null + dialogConfigForQuery.visible = true + dialogConfigForQuery.isAdd = true + dialogConfigForQuery.title = '楂樼骇鏌ヨ' + } + + const onConfirmWmsMaterialContainer = async () => { + dialogConfig.visible = false + if (dialogConfig.isAdd) { + tableRef.value?.scrollToRow({ + skip: true, + }) + } else { + await tableRef.value?.getList() + } + } + /** + * 琛岀偣鍑绘椂鏇存柊current + */ + const onRowClick = ({ row }: any) => { + if (dialogConfig.visible && current.value) { + current.value = row + } + } + /** + * 瀵煎嚭 + */ + const onExport = (data={}) => { + //const params = tableRef.value?.getParams() + exportFile('/api/v1/HIAWms/wmsMaterialContainer/export', data, 'wmsMaterialContainer') + } + + /** + * 鍏抽敭瀛楁悳绱� + */ + const onSearch = () => { + tableRef.value?.getList({ + Filter: search.value, + }) + } + + /** + * 閲嶇疆琛ㄦ牸鏁版嵁 + */ + const reloadList = () => { + tableRef.value?.getList() + } + /** + * 涓婁紶鎴愬姛 + */ + const onSuccess = () => { + tableRef.value?.getList() + ElMessage.success('瀵煎叆鎴愬姛') + } + /** + * 澶辫触 + * @param err + */ + const onError = (err: any) => { + try { + const message = JSON.parse(err.message) + ElMessage.error(message.msg) + } catch (error) { + ElMessage.error('瀵煎叆澶辫触') + } + } + /** + * 涓婁紶閽╁瓙 + */ + const onBeforeUpload = (file: File) => { + const format = ['xlsx', 'xls', 'csv'] + if (!format.includes(file.name.split('.')[1])) { + ElMessage.error('瀵煎叆鏂囦欢鏍煎紡涓嶆纭紝璇峰鍏�.xlsx/.xls涓�.csv鏍煎紡鐨勬枃浠�') + return false + } + return true + } + + onMounted(() => { + headers.value = { + Authorization: `Bearer ${sessionStorage.getItem('Token')}`, + 'X-Project': sessionStorage.getItem('X-Project'), + } + }) + + ctx.expose({ + reloadList, + }) + + return { + dataSource, + contextMenu, + dialogConfig, + dialogConfigForQuery, + dialogSettingConfig, + tableRef, + current, + search, + sort, + wmsMaterialContainerColumns, + paginationParams, + headers, + onBeforeUpload, + onError, + onSuccess, + openDetail, + onSearch, + onExport, + onRowClick, + onConfirmWmsMaterialContainer, + onCheck, + onAddWmsMaterialContainer, + onAdvancedQuery + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeldDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeldDrawer.tsx new file mode 100644 index 0000000..5e7c825 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeldDrawer.tsx @@ -0,0 +1,190 @@ +import { + ref, + onMounted, + reactive, + computed, + Ref, + watch, + SetupContext, + h, +} from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryWeldDrawer' +import { ElMessage } from 'element-plus' +import isEqual from 'lodash/isEqual' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { cloneDeep } from 'lodash' + +export const useWmsMaterialContainerDrawer = (props: any, ctx?: any) => { + const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( + 'wmsMaterialContainerDrawer' + ) + /** + * 鐢ㄦ潵瀵规瘮鐨勫垵濮嬪寲鏁版嵁 + */ + const initiateData: Ref<Record<string, any>> = ref({}) + const formData = ref<Record<string, any>>({}) + // ref + const formRef = ref() + + const disabled = ref(false) + + const current = computed(() => { + return props.row || null + }) + + const datePicker = (attrs) => { + return ( + <el-date-picker + type="date" + format="YYYY-MM-DD HH:mm:ss" + formatValue="YYYY-MM-DD HH:mm:ss" + {...attrs} + ></el-date-picker> + ) + } + + const dateTimePicker = (attrs) => { + return ( + <el-date-picker + type="datetime" + format="YYYY-MM-DD HH:mm:ss" + {...attrs} + ></el-date-picker> + ) + } + + const visible = computed({ + get() { + return props.modelValue + }, + set(val) { + ctx.emit('update:modelValue', val) + }, + }) + /** + * 娣诲姞鐨刦orm瀛楁 + */ + const formItems = reactive([ + { + label: '鎵樼洏缂栧彿', + prop: 'containerNo', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ユ墭鐩樼紪鍙�', + rules: [{ required: true, message: '鎵樼洏缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }], + }, + { + label: '鐗╂枡ID', + prop: 'materialId', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ墿鏂橧D', + rules: [{ required: true, message: '鐗╂枡ID涓嶈兘涓虹┖', trigger: 'blur' }], + }, + ]) + /** + * 鏍¢獙鏄惁鏈夋暟鎹彉鍖� + */ + const checkIsEqualObject = () => { + const data = { + formData: formData.value, + } + const check = isEqual(initiateData.value, data) + return check + } + + const onClose = (done: () => void) => { + if (visible.value) { + if (checkIsEqualObject()) { + visible.value = false + done && done() + } else { + ConfirmBox('鏄惁淇濆瓨璁剧疆锛�') + .then(() => { + onConfirm() + }) + .catch(() => { + visible.value = false + done && done() + }) + } + } + } + /** + * 淇濆瓨 + */ + const onConfirm = async () => { + await formRef.value?.validate() + const data = { + containerNo: formData.value.containerNo, + materialId: formData.value.materialId, + } + if (!current.value) { + await wmsMaterialContainerDrawer.addWmsMaterialContainer(data) + } else { + const id = current.value.id + await wmsMaterialContainerDrawer.updateWmsMaterialContainer(id, data) + } + ElMessage.success('淇濆瓨鎴愬姛') + ctx.emit('confirm') + } + + const updateCheckData = () => { + initiateData.value = { + formData: { + ...formData.value, + }, + } + } + const updateFormItemOptions = (propName: string, enumData: any[]) => { + const item = formItems.find((item) => item.prop === propName) + if (item && enumData) { + item.options = enumData.map((item) => ({ + label: item.description, + value: item.value, + })) + } + } + /** + * 閫氱敤鏌ヨ鏋氫妇 + */ + const commonQueryEnumForFrom = async () => {} + commonQueryEnumForFrom() + /** + * 寮圭獥鎵撳紑鑾峰彇璇︽儏 + */ + const onOpen = async () => { + if (current.value) { + const res = + await wmsMaterialContainerDrawer.getWmsMaterialContainerDetail( + current.value + ) + + formData.value = { + containerNo: res.containerNo, + materialId: res.materialId, + id: res.id, + } + disabled.value = true + updateCheckData() + } else { + formData.value = {} + + disabled.value = false + updateCheckData() + } + } + + watch(() => current.value, onOpen) + + return { + formItems, + formData, + visible, + formRef, + onOpen, + onClose, + onConfirm, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeldQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeldQueryDrawer.tsx new file mode 100644 index 0000000..7cca403 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Controllers/PipeAccessoryWeldQueryDrawer.tsx @@ -0,0 +1,181 @@ +import { + ref, + onMounted, + reactive, + computed, + Ref, + watch, + SetupContext, + h, +} from 'vue' +import { injectModel } from '@/libs/Provider/Provider' +import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryWeldDrawer' +import { ElMessage } from 'element-plus' +import isEqual from 'lodash/isEqual' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { cloneDeep } from 'lodash' + +export const useWmsMaterialContainerQueryDrawer = (props: any, ctx?: any) => { + const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( + 'WmsMaterialContainerDrawer' + ) + /** + * 鐢ㄦ潵瀵规瘮鐨勫垵濮嬪寲鏁版嵁 + */ + const initiateData: Ref<Record<string, any>> = ref({}) + const formData = ref<Record<string, any>>({}) + // ref + const formRef = ref() + + const disabled = ref(false) + + const current = computed(() => { + return props.row || null + }) + + const inputNumber = (attrs) => { + return ( + <el-input-number + min="1" + step="1" + precision="0" + {...attrs} + ></el-input-number> + ) + } + + const datePickerRange = (attrs) => { + return ( + <el-date-picker + type="daterange" + value-format="YYYY-MM-DD HH:mm:ss" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + {...attrs} + ></el-date-picker> + ) + } + + const dateTimePickerRange = (attrs) => { + return ( + <el-date-picker + type="datetimerange" + value-format="YYYY-MM-DD HH:mm:ss" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + {...attrs} + ></el-date-picker> + ) + } + + const visible = computed({ + get() { + return props.modelValue + }, + set(val) { + ctx.emit('update:modelValue', val) + }, + }) + /** + * 娣诲姞鐨刦orm瀛楁 + */ + const formItems = reactive([ + { + label: '鎵樼洏缂栧彿', + prop: 'containerNo', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ユ墭鐩樼紪鍙�', + }, + { + label: '鐗╂枡ID', + prop: 'materialId', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ墿鏂橧D', + }, + ]) + /** + * 鏍¢獙鏄惁鏈夋暟鎹彉鍖� + */ + const checkIsEqualObject = () => { + const data = { + formData: formData.value, + } + const check = isEqual(initiateData.value, data) + return check + } + const commonGetFormData = () => { + const data = { + containerNo: formData.value.containerNo || '', + materialId: formData.value.materialId || '', + } + return data + } + const onClose = (done: () => void) => { + if (visible.value) { + visible.value = false + const data = commonGetFormData() + ctx.emit('close', data) + } + } + /** + * 纭鏌ヨ + */ + const onConfirmQuery = async () => { + const data = commonGetFormData() + ctx.emit('confirmQuery', data) + } + /** + * 閲嶇疆鏌ヨ + */ + const onReset = async () => { + formData.value = {} + formData.value.ContainerNo = '' + formData.value.MaterialId = '' + //鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢 + ctx.emit('restQuery') + } + + const updateCheckData = () => { + initiateData.value = { + formData: { + ...formData.value, + }, + } + } + const updateFormItemOptions = (propName: string, enumData: any[]) => { + const item = formItems.find((item) => item.prop === propName) + if (item && enumData) { + item.options = enumData.map((item) => ({ + label: item.description, + value: item.value, + })) + } + } + /** + * 閫氱敤鏌ヨ鏋氫妇 + */ + const commonQueryEnumForFrom = async () => {} + commonQueryEnumForFrom() + /** + * 寮圭獥鎵撳紑鑾峰彇璇︽儏 + */ + const onOpen = async () => { + disabled.value = false + updateCheckData() + } + + watch(() => current.value, onOpen) + + return { + formItems, + formData, + visible, + formRef, + onOpen, + onClose, + onConfirmQuery, + onReset, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeld.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeld.ts new file mode 100644 index 0000000..870e78c --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeld.ts @@ -0,0 +1,41 @@ +import { Base } from '@/libs/Base/Base' +import { + deleteWmsMaterialContainers, + addWmsMaterialContainer, + cloneData, +} from './Service/PipeAccessoryWeld' + +export class WmsMaterialContainer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + }) + } + onMounted() {} + /** + * 鍒犻櫎 + * @param id + * @returns + */ + async deleteWmsMaterialContainers(ids: string[]) { + return deleteWmsMaterialContainers(ids) + } + + /** + * 娣诲姞鏁版嵁 + * @param data + * @returns + */ + addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + + /** + * 鍏嬮殕 + * @param ids + * @returns + */ + cloneData(ids: string[]) { + return cloneData(ids) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeldDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeldDrawer.ts new file mode 100644 index 0000000..15a646a --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeldDrawer.ts @@ -0,0 +1,44 @@ +import { Base } from '@/libs/Base/Base' +import { + addWmsMaterialContainer, + getWmsMaterialContainer, + updateWmsMaterialContainer, + getWmsEnumData, +} from './Service/PipeAccessoryWeldDrawer' +import { useGlobalState } from '@/libs/Store/Store' + +export class WmsMaterialContainerDrawer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + wmsMaterialContainer: {}, + }) + } + + /** + * 娣诲姞 + * @param data + */ + async addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + /** + * 鏇存柊 + * @param data + */ + async updateWmsMaterialContainer(id: string, data: Record<string, any>) { + return updateWmsMaterialContainer(id, data) + } + + /** + * 鑾峰彇璇︽儏 + */ + async getWmsMaterialContainerDetail(current: any, id?: string) { + return getWmsMaterialContainer(id || current?.id) + } + + // 鑾峰彇鏋氫妇鍊� + async getWmsEnumData(data: Record<string, any>) { + return getWmsEnumData(data) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeldQueryDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeldQueryDrawer.ts new file mode 100644 index 0000000..ae26d8f --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/PipeAccessoryWeldQueryDrawer.ts @@ -0,0 +1,44 @@ +import { Base } from '@/libs/Base/Base' +import { + addWmsMaterialContainer, + getWmsMaterialContainer, + updateWmsMaterialContainer, + getWmsEnumData, +} from './Service/PipeAccessoryWeldQueryDrawer' +import { useGlobalState } from '@/libs/Store/Store' + +export class WmsMaterialContainerQueryDrawer extends Base<{ [key: string]: any }> { + constructor() { + super({ + data: [], + wmsMaterialContainer: {}, + }) + } + + /** + * 娣诲姞 + * @param data + */ + async addWmsMaterialContainer(data: Record<string, any>) { + return addWmsMaterialContainer(data) + } + /** + * 鏇存柊 + * @param data + */ + async updateWmsMaterialContainer(id: string, data: Record<string, any>) { + return updateWmsMaterialContainer(id, data) + } + + /** + * 鑾峰彇璇︽儏 + */ + async getWmsMaterialContainerDetail(current: any, id?: string) { + return getWmsMaterialContainer(id || current?.id) + } + + // 鑾峰彇鏋氫妇鍊� + async getWmsEnumData(data: Record<string, any>) { + return getWmsEnumData(data) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeld.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeld.ts new file mode 100644 index 0000000..92614a8 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeld.ts @@ -0,0 +1,79 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鎵归噺鍒犻櫎 + * @returns + */ +export const deleteWmsMaterialContainers = (ids: string[]) => { + return request({ + data: ids, + url: '/api/v1/HIAWms/wmsMaterialContainer', + method: 'delete', + }) +} + +/** + * 鍏嬮殕 + * @returns + */ +export const cloneData = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer/clone', data) +} + +/** + * 鐗╂枡鍨嬪彿鍒楄〃 + * @returns + */ +export const getMaterialModelList = () => { + return request.get(`/api/v1/hiawms/wmsenum/ModelList`) +} + +/** + * 搴撲綅鍙峰垪琛� + * @returns + */ +export const getPlaceNoForStockList = (data: any) => { + return request.get(`/api/v1/hiawms/wmsenum/placelist?placeType=${data}`) +} + +/** + * 鍏ュ簱 + * @returns + */ +export const instock = (data: any) => { + return request.post('/api/v1/HIAWms/wmsinsstock/bindinstock', data) +} + + +/** + * 鏍规嵁 绠℃缂栫爜銆佸伐搴� 鏌ヨ 浣滀笟璁″垝 + * @returns + */ +export const findSingleWorkPlanByFilter = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlan/FindSingleByFilter', data) +} + +/** + * 鏍规嵁 浠诲姟缂栧彿杩涜寮�宸� + * @returns + */ +export const startProduction = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/startProduction', data) +} + +/** + * 鏍规嵁 浠诲姟缂栧彿杩涜瀹屽伐 + * @returns + */ +export const finishProduction = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/finishProduction', data) +} \ No newline at end of file diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeldDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeldDrawer.ts new file mode 100644 index 0000000..fae0103 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeldDrawer.ts @@ -0,0 +1,34 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鑾峰彇璇︽儏 + * @returns + */ +export const getWmsMaterialContainer = (id: string) => { + return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) +} + +/** + * 鏇存柊 + * @returns + */ +export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { + return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) +} + +/** + * 鑾峰彇鏋氫妇 + * @returns + */ +export const getWmsEnumData = (data: any) => { + return request.post('/api/v1/HIAWms/WmsEnum', data) +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeldQueryDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeldQueryDrawer.ts new file mode 100644 index 0000000..8f2a1a3 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeldQueryDrawer.ts @@ -0,0 +1,35 @@ +import { Base } from '@/libs/Base/Base' +const request = Base.request + +/** + * 娣诲姞 + * @returns + */ +export const addWmsMaterialContainer = (data: any) => { + return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) +} + +/** + * 鑾峰彇璇︽儏 + * @returns + */ +export const getWmsMaterialContainer = (id: string) => { + return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) +} + +/** + * 鏇存柊 + * @returns + */ +export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { + return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) +} + +/** + * 鑾峰彇鏋氫妇 + * @returns + */ +export const getWmsEnumData = (data: any) => { + return request.post('/api/v1/HIAWms/WmsEnum', data) +} + diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss new file mode 100644 index 0000000..177adca --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss @@ -0,0 +1,3 @@ +.drawer { + width: 800px; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx new file mode 100644 index 0000000..713568e --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx @@ -0,0 +1,61 @@ +import { SetupContext, defineComponent } from 'vue' +import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' +import styles from './WmsMaterialContainerDrawer.module.scss' +import { useWmsMaterialContainerDrawer } from '../../../../Controllers/PipeAccessoryWeldDrawer.tsx' +import DyForm from '@/components/DyForm/DyForm' + +// @ts-ignore +export default defineComponent<{ + [key: string]: any +}>({ + name: '寮圭獥', + props: { + modelValue: { + type: Boolean, + default: false, + }, + title: { + type: String, + default: '', + }, + row: { + type: Object, + }, + sort: { + type: Number, + default: 0, + }, + }, + emits: ['update:modelValue', 'close', 'submit', 'confirm'], + setup(props: Record<string, any>, ctx: SetupContext) { + const { + onClose, + onConfirm, + onOpen, + formRef, + visible, + formItems, + formData, + } = useWmsMaterialContainerDrawer(props, ctx) + return () => ( + <BaseDrawer + class={styles.drawer} + size="800px" + title={props.title || '娣诲姞'} + v-model={visible.value} + close-on-click-modal={true} + onConfirm={onConfirm} + onOpen={onOpen} + before-close={onClose} + onClose={onClose} + > + <DyForm + ref={formRef} + formData={formData.value} + labelWidth="106px" + formItemProps={formItems} + ></DyForm> + </BaseDrawer> + ) + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss new file mode 100644 index 0000000..177adca --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss @@ -0,0 +1,3 @@ +.drawer { + width: 800px; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx new file mode 100644 index 0000000..61faabf --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx @@ -0,0 +1,71 @@ +/* + * 鐗╂枡鍩虹淇℃伅鏌ヨ寮瑰嚭妗� +*/ +import { SetupContext, defineComponent } from 'vue' +import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' +import styles from './WmsMaterialContainerQueryDrawer.module.scss' +import { useWmsMaterialContainerQueryDrawer } from '../../../../Controllers/PipeAccessoryWeldQueryDrawer.tsx' +import DyForm from '@/components/DyForm/DyForm' + +// @ts-ignore +export default defineComponent<{ + [key: string]: any +}>({ + name: '寮圭獥', + props: { + //鏋氫妇绫诲瀷瀛楀吀 + enumListDict:{ + type: Array as () => Array<{ key: string; value: object }>, // 瀹氫箟鏁扮粍鍏冪礌绫诲瀷 + default: () => [] // 榛樿鍊� + }, + modelValue: { + type: Boolean, + default: false, + }, + title: { + type: String, + default: '', + }, + row: { + type: Object, + }, + sort: { + type: Number, + default: 0, + }, + }, + emits: ['update:modelValue', 'close', 'submit', 'confirmquery1'], + setup(props: Record<string, any>, ctx: SetupContext) { + const { + onClose, + onConfirmQuery, + onOpen, + onReset, + formRef, + visible, + formItems, + formData, + } = useWmsMaterialContainerQueryDrawer(props, ctx) + return () => ( + <BaseQueryDrawer + class={styles.drawer} + size="800px" + title={props.title || '楂樼骇鏌ヨ'} + v-model={visible.value} + close-on-click-modal={true} + onReset={onReset} + onConfirmQueryForBase={onConfirmQuery} + onOpen={onOpen} + before-close={onClose} + onClose={onClose} + > + <DyForm + ref={formRef} + formData={formData.value} + labelWidth="106px" + formItemProps={formItems} + ></DyForm> + </BaseQueryDrawer> + ) + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/Config.ts new file mode 100644 index 0000000..5e6ddfc --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/Config.ts @@ -0,0 +1,27 @@ +export const columns = [ + { + type: 'seq', + width: 60, + title: '搴忓彿', + }, + { + field: 'containerNo', + title: '鎵樼洏缂栧彿', +}, +{ + field: 'materialId', + title: '鐗╂枡ID', +}, +{ + field: 'sort', + title: '', +}, +{ + field: 'creationTime', + title: '鏄惁绂佺敤', +}, +{ + field: 'deletionTime', + title: '', +}, +] diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/PipeAccessoryWeld.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/PipeAccessoryWeld.module.scss new file mode 100644 index 0000000..9fb101e --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/PipeAccessoryWeld.module.scss @@ -0,0 +1,253 @@ +.pipeAccessoryWeldContent { + width: 100%; + height: 100%; + // height: 100% !important; + // overflow-y: auto !important; /* 鍐呭瓒呭嚭鏃舵樉绀烘粴鍔ㄦ潯 */ + // padding-bottom: 20px; /* 閬垮厤鍐呭琚簳閮ㄩ伄鎸� */ + + .pipeAccessoryWeldList { + width: 100%; + height: calc(100% - 70px); + } + .headerContent { + display: flex; + justify-content: space-between; + align-items: center; + height: 43px; + } + .header { + margin-bottom: 12px; + display: flex; + justify-content: flex-end; + align-items: center; + } + + .h5Form { + display: flex; + flex-direction: column; + gap: 20px; // 琛ㄥ崟椤逛箣闂寸殑闂磋窛 + + .el-form-item { + margin-bottom: 0; // 绉婚櫎榛樿鐨勫簳閮ㄨ竟璺� + width: 100% !important; // 鍗犳弧鐖跺鍣ㄥ搴� + } + + .el-form-item__label { + display: block; + text-align: left; + margin-bottom: 8px; + font-weight: 500; + } + } +} + +.tagBox { + width: auto; + min-width: 80px; + height: 24px; + background: #ffffff; + border-radius: 19px 19px 19px 19px; + opacity: 1; + border: 1px dashed #bcc4cc; + width: 50px; + height: 20px; + font-size: 14px; + font-family: PingFang SC, PingFang SC; + font-weight: 400; + color: #5a84ff; + display: flex; + justify-content: center; + align-items: center; + // cursor: pointer; +} + +.group { + display: flex; + justify-content: space-between; + align-items: center; +} + +.groupTable { + width: 100%; +} + +.overBox { + width: 100%; + height: calc(100% - 20px); + overflow: auto; + :global(.cs-collapse-item__header) { + background-color: #f1f1f1; + padding: 0 20px; + height: 35px; + font-size: 16px; + font-family: PingFang SC, PingFang SC; + font-weight: 500; + } + :global(.cs-collapse-item__content) { + padding-bottom: 0px; + } +} +.groupHeader { + width: 100%; + height: 30px; + background: #ccc; +} + +.hideBlock { + display: none; +} +.queryForm { + padding: 10px; + background: #f5f7fa; + margin-bottom: 0px; + border-radius: 4px; + + .el-form-item { + margin-right: 20px; + margin-bottom: 0; + + // 缁熶竴杈撳叆妗嗗拰閫夋嫨妗嗙殑瀹藉害 + .el-input, .el-select { + width: 200px; // 璁剧疆缁熶竴鐨勫搴� + } + + // 閫夋嫨妗嗗唴閮ㄨ緭鍏ユ鏍峰紡 + .el-select .el-input__wrapper { + height: 32px; // 涓庤緭鍏ユ楂樺害涓�鑷� + padding: 1px 11px; // 涓庤緭鍏ユ鍐呰竟璺濅竴鑷� + } + + // 鏃ユ湡閫夋嫨鍣ㄥ搴� + .el-date-editor { + width: 220px; + } + } +} + +// 濡傛灉闇�瑕佹洿绮剧‘鐨勬帶鍒讹紝鍙互鍗曠嫭璁剧疆 +.formItem { + width: 200px; + + &.el-input, &.el-select { + width: 100%; + } +} + + + +.newPageContent { + display: flex; + flex-wrap: wrap; + gap: 20px; + padding: 20px; + background-color: white; + + .info-block { + background-color: #f9f9f9; + border: 1px solid #eaeaea; + border-radius: 5px; + padding: 20px; + width: calc(33.33% - 20px); + + .block-title { + font-size: 20px; + font-weight: bold; + margin-bottom: 15px; + } + + .info-tags { + display: flex; + flex-wrap: wrap; + gap: 10px; + + .info-tag { + display: flex; + align-items: center; + gap: 5px; + + .tag-label { + font-weight: bold; + } + } + } + + .action-buttons { + display: flex; + gap: 10px; + margin-top: 20px; + } + + .equipment-image { + width: 100%; + height: auto; + margin-top: 20px; + } + + .status-normal { + color: green; + } + } + + .process-table { + width: 100%; + margin-top: 20px; + + .el-table { + border: 1px solid #eaeaea; + border-radius: 5px; + } + } +} + + +.modelRrow { + display: flex; /* 寮规�у竷灞� */ + gap: 20px; /* 鎺т欢闂磋窛 */ + align-items: center; /* 鍨傜洿灞呬腑 */ + margin-bottom: 12px; /* 搴曢儴闂磋窛 */ + width: 100%; + + .el-form-item { + flex: 1 !important; /* 鍧囧垎绌洪棿 */ + margin-bottom: 0; + max-width: none; // 绉婚櫎鏈�澶у搴﹂檺鍒� + } + + .el-select { + width: 100%; // 纭繚Select鍗犳弧鐖跺鍣ㄥ搴� + + // 绉婚櫎鍙兘褰卞搷瀹藉害鐨勫唴閮ㄦ牱寮� + .el-input__wrapper { + width: 100%; + } + } + + // 鍝嶅簲寮忚璁� + @media (max-width: 1200px) { + .model-row { + flex-wrap: wrap; + + .el-form-item { + flex: 1 0 calc(50% - 10px); // 鍦ㄤ腑绛夊睆骞曚笂姣忚鏄剧ず2涓� + margin-bottom: 10px; + } + } + } + + @media (max-width: 768px) { + .model-row { + flex-direction: column; + + .el-form-item { + width: 100%; // 鍦ㄥ皬灞忓箷涓婃瘡琛屾樉绀�1涓� + } + } + } +} + +.action-buttons { + display: flex; + gap: 10px; + margin-top: 20px; +} + diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/PipeAccessoryWeld.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/PipeAccessoryWeld.tsx new file mode 100644 index 0000000..2135fad --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/Pages/PipeAccessoryWeld/PipeAccessoryWeld.tsx @@ -0,0 +1,360 @@ +import { defineComponent, onMounted, ref } from 'vue' +import type { Ref } from 'vue' +import styles from './PipeAccessoryWeld.module.scss' +import pipeImage from '@/images/pipe-Weld-drawing-example.png' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { + ElInput, + ElForm, + ElFormItem, + ElButton, + ElSelect, + ElOption, + ElMessage, + ElCol, +} from 'element-plus' +import { + getPlaceNoForStockList, + getMaterialModelList, + instock, + findSingleWorkPlanByFilter, + startProduction, + finishProduction +} from '@/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeld' +import { Message } from '@element-plus/icons-vue/dist/types' + +export default defineComponent({ + name: 'PipeAccessoryWeld', + setup() { + // 鏌ヨ琛ㄥ崟鏁版嵁 +const queryForm = ref({ + pipeSpecCode: '', + processRouteNumber: '', + taskCode: '', + length: '', + projectNumber: '', + shipNumber: '', + material: '', + outerDiameter: '', + thickness: '', + plannedStartTime: '', + plannedEndTime: '', + workstationCode: '', + processName: '', + equipmentCode: '' +}) + + // 鏁版嵁婧� + const modelOptions = ref<Array<{ value: string; label: string }>>([]) + const placeNoOptions = ref<Array<{ value: string; label: string }>>([]) + + onMounted(() => { + // 缁勪欢鎸傝浇鍚庤幏鍙栧瀷鍙峰垪琛ㄥ拰搴撲綅鍙峰垪琛� + getModelList() + getPlaceNoList() + }) + + // 缁勭洏鎿嶄綔 + const handlePalletize = () => { + console.log('缁勭洏鎿嶄綔', queryForm.value) + // 杩欓噷娣诲姞缁勭洏閫昏緫 + } + + // 缁勭洏鍏ュ簱鎿嶄綔 + const handlePalletizeStorage = () => { + console.log('缁勭洏鍏ュ簱鎿嶄綔', queryForm.value) + instock(queryForm.value), resetQueryForm() + ElMessage.success({ + message: '缁勭洏鍏ュ簱鎴愬姛', + type: 'success', + }) + // 杩欓噷娣诲姞缁勭洏鍏ュ簱閫昏緫 + } + + const resetQueryForm = () => { + queryForm.value.materialModel = '' + queryForm.value.placeNo = '' + queryForm.value.materialBatch = '' + queryForm.value.stockNumber = '' + } + + const getModelList = async () => { + const models = await getMaterialModelList() + modelOptions.value = models.map((item: string) => ({ + value: item.materialModel, + label: item.materialModelDesc, + })) + } + + const getPlaceNoList = async () => { + const placeNos = await getPlaceNoForStockList(2) + console.log('搴撲綅鍙峰垪琛�:', placeNos) + placeNoOptions.value = placeNos.map((item: string) => ({ + value: item.placeNo, + label: item.placeNoDesc, + })) + } + const handleChange =async (value) => { + console.log('杈撳叆鍐呭纭:', value); // 澶卞幓鐒︾偣鎴栧洖杞︽椂瑙﹀彂 + // 鍦ㄦ澶勬坊鍔犱笟鍔¢�昏緫锛堝鏍¢獙銆佹彁浜ょ瓑锛� + const param={ + pipeSpecCode:value, + pipeSpecCode_FilterMode:2,//绮惧噯鏌ヨ + processName:'鐒婃帴宸ュ簭', + processName_FilterMode:2,//绮惧噯鏌ヨ + } + const workPlan = await findSingleWorkPlanByFilter(param); + console.log('杩斿洖:'+workPlan); + if(workPlan==''){ + ElMessage.error('娌℃湁鎵惧埌鏁版嵁'); + queryForm.value ={ pipeSpecCode: '', + processRouteNumber: '', + taskCode: '', + length: '', + projectNumber: '', + shipNumber: '', + material: '', + outerDiameter: '', + thickness: '', + plannedStartTime: '', + plannedEndTime: '', + workstationCode: '', + processName: '', + equipmentCode: ''} + }else{ + queryForm.value=workPlan; + } + }; + + // 寮�宸ヤ簨浠跺鐞� + const startWork = () => { + console.log('鎵ц寮�宸ユ搷浣�'); + if(queryForm.value.pipeSpecCode==''){ + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�'); + return + } + ConfirmBox( + `纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}寮�宸ュ悧` + ).then(async () => { + //鎮ㄧ殑涓氬姟閫昏緫 + const param={ + taskCode:queryForm.value.taskCode, + }; + const ret = await startProduction(param); + console.log('杩斿洖:'+ret); + if(ret.code="200"){ + ElMessage.success('寮�宸ユ垚鍔�'); + }else{ + ElMessage.error('寮�宸ュけ璐�:'+ret.message); + } + }) + } + // 瀹屽伐浜嬩欢澶勭悊 + const finishWork = () => { + console.log('鎵ц寮�宸ユ搷浣�'); + if(queryForm.value.pipeSpecCode==''){ + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�'); + return + } + ConfirmBox( + `纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}瀹屽伐鍚梎 + ).then(async () => { + //鎮ㄧ殑涓氬姟閫昏緫 + const param={ + pipeSpecCode:queryForm.value.pipeSpecCode, + processName:queryForm.value.processName, + }; + const ret = await finishProduction(param); + console.log('杩斿洖:'+ret); + if(ret.code="200"){ + ElMessage.success('瀹屽伐鎴愬姛'); + }else{ + ElMessage.error('瀹屽伐澶辫触:'+ret.message); + } + }) + } + const tableData = ref([ + { sequence: 1, flangeA: 'RF-200-1.6MPa', flangeB: 'WN-200-1.6MPa' }, + { sequence: 2, flangeA: 'WN-250-2.5MPa', flangeB: 'SO-250-2.5MPa' }, + { sequence: 3, flangeA: 'PL-300-1.0MPa', flangeB: 'RF-300-1.0MPa' }, + { sequence: 4, flangeA: 'SO-150-2.0MPa', flangeB: 'WN-150-2.0MPa' }, + { sequence: 5, flangeA: 'RF-400-1.6MPa', flangeB: 'PL-400-1.6MPa' }, + { sequence: 6, flangeA: 'WN-200-4.0MPa', flangeB: 'SO-200-4.0MPa' }, + { sequence: 7, flangeA: 'SO-300-1.6MPa', flangeB: 'RF-300-1.6MPa' }, + { sequence: 8, flangeA: 'PL-250-1.0MPa', flangeB: 'WN-250-1.0MPa' }, + { sequence: 9, flangeA: 'RF-150-2.5MPa', flangeB: 'SO-150-2.5MPa' }, + { sequence: 10, flangeA: 'WN-400-2.0MPa', flangeB: 'PL-400-2.0MPa' } + ]); + + + return () => { + return ( + <div + class={styles.PipeAccessoryWeldContent} + style="overflow-y: auto !important; height: 100%;" + > + <ElFormItem label="绠℃缂栫爜 "> + <ElInput + v-model={queryForm.value.pipeSpecCode} + clearable + class={styles.formInput} + onInput={handleChange} + /> + </ElFormItem> + <div class={styles.actionButtons}> + <ElButton type="warning" onClick={startWork}>寮�宸�</ElButton> + <ElButton type="warning" onClick={finishWork}>瀹屽伐</ElButton> + {/* <ElButton type="warning">鏆傚仠</ElButton> + <ElButton type="warning">鑷姩</ElButton> + <ElButton type="warning">璐ㄦ</ElButton> */} + </div> + + <h2 class={styles.blockTitle}>褰撳墠浠诲姟</h2> + <ElForm label-position="left" > + + <ElFormItem label="鐗╂枡娴佸悜 "> + <ElInput + v-model={queryForm.value.processRouteNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="浠诲姟缂栧彿 "> + <ElInput + v-model={queryForm.value.taskCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="绠℃闀垮害 "> + <ElInput + v-model={queryForm.value.length} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="椤圭洰 鍙�"> + <ElInput + v-model={queryForm.value.projectNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="鑸� 鍙�"> + <ElInput + v-model={queryForm.value.shipNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="鏉� 璐�"> + <ElInput + v-model={queryForm.value.material} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="澶� 寰�"> + <ElInput + v-model={queryForm.value.outerDiameter} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="澹� 鍘�"> + <ElInput + v-model={queryForm.value.thickness} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁″垝寮�濮嬫椂闂�"> + <ElInput + v-model={queryForm.value.plannedStartTime} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁″垝瀹屾垚鏃堕棿"> + <ElInput + v-model={queryForm.value.plannedEndTime} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + </ElForm> + + <h2 class={styles.blockTitle}>褰撳墠宸ヤ綅/璁惧淇℃伅</h2> + <ElForm label-position="left" > + <ElFormItem label="宸ヤ綅浠g爜 "> + <ElInput + v-model={queryForm.value.workstationCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="宸ュ簭鍚嶇О "> + <ElInput + v-model={queryForm.value.processName} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁惧浠g爜 "> + <ElInput + v-model={queryForm.value.equipmentCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + {/* <ElFormItem label="璁惧鐘舵��"> + <ElInput + v-model={queryForm.value.materialBatch} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> */} + {/* <ElFormItem label="鎿嶄綔浜�"> + <ElInput + v-model={queryForm.value.materialBatch} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> */} + </ElForm> + + {/* <div class="info-block"> + <h2 class="block-title">宸ヨ壓淇℃伅</h2> + <el-table stripe v-model:dataSource={tableData}> + <el-table-column prop="sequence" label="搴�"></el-table-column> + <el-table-column prop="flangeA" label="娉曞叞A"></el-table-column> + <el-table-column prop="flangeB" label="娉曞叞B"></el-table-column> + </el-table> + </div> */} + <h2 class="block-title">鍥剧焊</h2> + <img + src={pipeImage} + alt="璁惧鍥剧墖" + style="height:1250px;" + class="equipment-image" + ></img> + </div> + ) + } + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/PipeAccessoryWeld.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/PipeAccessoryWeld.module.scss new file mode 100644 index 0000000..6eea6eb --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/PipeAccessoryWeld.module.scss @@ -0,0 +1,7 @@ +.PipeAccessoryWeld { + background-color: #fff; + border-radius: 5px 5px 0 0; + width: 100%; + height: 100%; + border: 1px solid #dbdbdb; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/PipeAccessoryWeld.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/PipeAccessoryWeld.tsx new file mode 100644 index 0000000..cb45e4e --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/PipeAccessoryWeld.tsx @@ -0,0 +1,80 @@ +import { + Component, + DefineComponent, + defineComponent, + markRaw, + ref, + SetupContext, + onMounted, +} from 'vue' +import styles from './PipeAccessoryWeld.module.scss' +import Tab from '@/components/Tab/Tab' +import { useProvideModels } from '@/libs/Provider/app' +import { usePermission } from '@/libs/Permission/Permission' +import { permissionCodes } from '../enum' +import { ModuleType, TabItem } from '../type/Type' +import { getEntityNames } from '@/hooks/hook' +import TabPane from '@/components/Tab/TabPane' + +const Models: ModuleType = import.meta.glob('./config/*.json', { + eager: true, +}) + +const entityNames = getEntityNames(Models) + +const nameToLabelMap = [{ name: 'PipeAccessoryWeld', label: '绠¢檮浠剁剨鎺�' }] + +export default defineComponent({ + name: 'PipeAccessoryWeld', + + setup(props, ctx: SetupContext) { + useProvideModels() + usePermission(props, permissionCodes) + + const rf = ref<{ + [key: string]: any + }>({}) + + const tabData = ref<TabItem[]>([]) + + const onTabChange = (v: string) => { + rf.value?.[v]?.reloadList() + } + + const initTableData = async () => { + for (const i in entityNames) { + const name = entityNames[i] + const module = await import(`./Pages/${name}/${name}.tsx`) + const PipeAccessoryWeld = markRaw(module.default) + const foundLabel = + nameToLabelMap.find((item) => item.name === name)?.label || name + tabData.value.push({ + label: foundLabel, + name, + component: PipeAccessoryWeld, + }) + } + } + + initTableData() + + return () => { + return ( + <div class={styles.PipeAccessoryWeld}> + <Tab data={tabData.value} type="list" onTab={onTabChange}> + {tabData.value.map((widgetInfo) => { + const Widget: any = widgetInfo.component + return ( + <TabPane label={widgetInfo.label} name={widgetInfo.name}> + <Widget + ref={(r: any) => (rf.value['PipeAccessoryWeld'] = r)} + ></Widget> + </TabPane> + ) + })} + </Tab> + </div> + ) + } + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/config/PipeAccessoryWeld.json b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/config/PipeAccessoryWeld.json new file mode 100644 index 0000000..3443780 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/Views/config/PipeAccessoryWeld.json @@ -0,0 +1,3 @@ +{ + "name": "PipeAccessoryWeld" +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/enum.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/enum.ts new file mode 100644 index 0000000..d3a0c5f --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/enum.ts @@ -0,0 +1,15 @@ +export interface TabType { + label: string + name: string + columns?: any[] + data?: any[] + isFooter: boolean + [key: string]: any +} + +export const permissionCodes = { + 'PipeAccessoryWeld-list': '鍒楄〃-鍒楄〃', + 'PipeAccessoryWeld-add': '鍒楄〃-娣诲姞', + 'PipeAccessoryWeld-import': '鍒楄〃-瀵煎叆', + 'PipeAccessoryWeld-output': '鍒楄〃-杈撳嚭', +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/index.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/index.ts new file mode 100644 index 0000000..5914271 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/index.ts @@ -0,0 +1,14 @@ +import PipeAccessoryWeld from './Views/PipeAccessoryWeld' +import Setting from '@/components/Setting/Setting' +import { provider } from '@/provider/index' +import p from '../../assets/svg/p.svg' + +export default { + is: 'PipeAccessoryWeld', + name: '绠¢檮浠剁剨鎺�', + category: 'run', + icon: p, + authorizationRequired: false, + canvasView: provider(PipeAccessoryWeld), + settingsView: Setting, +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/type/type.d.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/type/type.d.ts new file mode 100644 index 0000000..aa8d450 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryWeld/type/type.d.ts @@ -0,0 +1,45 @@ +import { Component } from 'vue' + +export interface DataItemType { + id?: string + name?: string + code?: string + description?: string + label?: string + value?: string | number +} + +export interface WmsMaterialContainerBaseType { + id?: string + name?: string + code?: string + value?: number + description?: string + options?: Array<DataItemType> + abilityValue?: number | string + data?: DataItemType + defaultValue?: string | number + flow: string +} + +export interface FlowDefinitionType { + id?: string + name?: string + code?: string + description?: string +} + +export type ModuleType = Record< + string, + { + default: Record<string, string> + name: string + } +> + +export interface TabItem { + name: string + label: string + component: Component + hidden?: boolean +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts index e051aae..de41e2e 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts @@ -10,6 +10,21 @@ width:160, }, { + field: 'pipeSpecCode', + title: '绠℃缂栫爜', + width:160, +}, +{ + field: 'pipeSectionName', + title: '绠℃鍚嶇О', + width:160, +}, +{ + field: 'processName', + title: '宸ュ簭鍚嶇О', + width:160, +}, +{ field: 'workPlanStatusDesc', title: '璁″垝鐘舵��', width:160, @@ -119,11 +134,7 @@ title: '椤圭洰鍙�', width:160, }, -{ - field: 'processName', - title: '宸ュ簭鍚嶇О', - width:160, -}, + { field: 'pipeFittingCode', title: '绠′欢缂栫爜', @@ -134,16 +145,7 @@ title: '椤哄簭鍙�', width:160, }, -{ - field: 'pipeSpecCode', - title: '绠℃缂栫爜', - width:160, -}, -{ - field: 'pipeSectionName', - title: '绠℃鍚嶇О', - width:160, -}, + { field: 'outerDiameter', title: '澶栧緞(mm)', diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/CompleteAssemblyProcessInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/CompleteAssemblyProcessInput.cs new file mode 100644 index 0000000..f0f5d8b --- /dev/null +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/CompleteAssemblyProcessInput.cs @@ -0,0 +1,29 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan +{ + /// <summary> + /// 瑁呴厤宸ュ簭瀹屽伐 杈撳叆鍙傛暟妯″瀷 + /// </summary> + [Serializable] + public class CompleteAssemblyProcessInput + { + + /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string PipeSpecCode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string ProcessName { get; set; } + + + + } +} \ No newline at end of file diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/StartProductionInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/StartProductionInput.cs new file mode 100644 index 0000000..eb74166 --- /dev/null +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/StartProductionInput.cs @@ -0,0 +1,28 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan +{ + /// <summary> + /// 寮�宸ヨ緭鍏ュ弬鏁版ā鍨� + /// </summary> + [Serializable] + public class StartProductionInput + { + + /// <summary> + /// 浠诲姟缂栫爜 + /// </summary> + public string TaskCode { get; set; } + + ///// <summary> + ///// 宸ュ簭鍚嶇О + ///// </summary> + //public string ProcessName { get; set; } + + + } +} \ No newline at end of file diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkPlanAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkPlanAppService.cs index 1910392..4e92385 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkPlanAppService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkPlanAppService.cs @@ -1,3 +1,4 @@ +using Ao.Stock.Mirror; using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; using CMS.Plugin.PipeLineLems.Domain.WorkPlan; using CmsQueryExtensions.Entitys; @@ -69,4 +70,20 @@ /// <returns></returns> /// <exception cref="UserFriendlyException"></exception> Task<WorkPlan> GetSingleByFilterAsync(Expression<Func<WorkPlan, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default); + + + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇浣滀笟璁″垝琛ㄥ垪琛� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<List<WorkPlanDto>> FindListByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default); + + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜浣滀笟璁″垝琛� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<WorkPlanDto> FindSingleByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default); + } diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs index 06bd5f4..884a9c5 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs @@ -49,6 +49,14 @@ /// <returns></returns> public async Task<MesOrderResponse> CommonPick(IServiceProvider _serviceProvider, PickInput input, MyCurrentUser myCurrentUser) { + if (string.IsNullOrEmpty(input.PipeSpecCode)) + { + throw new UserFriendlyException("璇疯緭鍏ョ娈电紪鐮�"); + }; + if (string.IsNullOrEmpty(input.ContinerNo)) + { + throw new UserFriendlyException("璇疯緭鍏ユ墭鐩樺彿"); + }; //1銆佽褰曞垎鎷h褰曡〃 //2銆佹洿鏂颁綔涓氳鍒掕〃鐨勭姸鎬� =宸插垎鎷� //3銆佸啓鍏� 鍒嗘嫞鍙橀噺 @@ -61,6 +69,7 @@ var traceProvider = _serviceProvider.GetRequiredService<ITraceProvider>(); var materialProvider = _serviceProvider.GetRequiredService<IMaterialProvider>(); var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); //Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?> // { @@ -103,6 +112,9 @@ var firstWorkPlans = await workPlanAppService.GetListByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode); var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode); + + var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == firstWorkPlan.DataIdentifier); + var rawPipe_DataIdentifier = await materialProvider.FindByNameAsync("鍘熸枡绠℃爣璇�"); var rawPipe_MaterialMode = await materialProvider.FindByNameAsync("鍘熸枡绠″瀷鍙�"); var rawPipe_Batch = await materialProvider.FindByNameAsync("鍘熸枡绠℃壒娆�"); @@ -141,7 +153,7 @@ Quantity = 1, MaterialId = rawPipe_Batch.MaterialId, MaterialDetailId = rawPipe_Batch.MaterialDetails.First().Id, - Value = "111",//鎵规鏆傛椂鍐欐 + Value = callMaterialOrder.MaterialBatch,//鎵规鏆傛椂鍐欐 }); } @@ -154,7 +166,30 @@ string _value = ""; if (item.Name == "鍒嗘嫞鏂瑰悜") { - _value = "鐭瑁呴厤"; + _value = "鐭鍒嗘嫞"; + } + if (item.Name == "鍒嗘嫞鎵樼洏鍙�") + { + _value = input.ContinerNo; + } + if (item.Name == "鍒嗘嫞浜�") + { + _value = myCurrentUser.UserAccount; + } + //item.Key + TraceParamModel traceParamModel = new TraceParamModel() + { + Key = item.Key, + Value = _value + }; + traceModel.Params.Add(traceParamModel); + }; + foreach (var item in workSection.FormulaParameters) + { + string _value = ""; + if (item.Name == "鍒嗘嫞鏂瑰悜") + { + _value = "鐭鍒嗘嫞"; } if (item.Name == "鍒嗘嫞鎵樼洏鍙�") { @@ -566,6 +601,427 @@ } /// <summary> + ///瑁呴厤/鐒婃帴寮�宸� + /// </summary> + /// <param name="input"></param> + /// <param name="_serviceProvider"></param> + /// <param name="myCurrentUser"></param> + /// <returns></returns> + /// <exception cref="UserFriendlyException"></exception> + public async Task<MesOrderResponse> StartProduction(StartProductionInput input, IServiceProvider _serviceProvider, MyCurrentUser myCurrentUser) + { + if (string.IsNullOrEmpty(input.TaskCode.ToString())) + { + throw new UserFriendlyException("浠诲姟缂栫爜涓嶈兘涓虹┖"); + } + + string processName = ""; + + VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); + var callMaterialOrderRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRepository>(); + var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var callMaterialOrderRecordRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRecordRepository>(); + var orderManager = _serviceProvider.GetRequiredService<IOrderManager>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); + + // 鏌ユ壘鏁版嵁 + + var workPlan = await workPlanRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode); + if (workPlan == null) + { + throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); + } + if (workPlan.ProcessName == "瑁呴厤宸ュ簭") + { + processName = "瑁呴厤"; + } + else if (workPlan.ProcessName == "鐒婃帴宸ュ簭") + { + processName = "鐒婃帴"; + } + + // 楠岃瘉鐘舵�� + if (workPlan.WorkPlanStatus != Domain.Shared.Enums.WorkPlanStatusEnum.鏆傚仠涓� && workPlan.WorkPlanStatus != Domain.Shared.Enums.WorkPlanStatusEnum.鏈敓浜�) + { + //鏆傛椂娉ㄩ噴 + //throw new UserFriendlyException($"浠诲姟缂栫爜 '{input.TaskCode}' 鐨勫綍鐘舵�佷负 '{workPlan.WorkPlanStatus}'锛屼笉鍏佽寮�宸�"); + } + + var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == workPlan.DataIdentifier); + #region 浜嬪姟 + + using var scope = _serviceProvider.CreateScope(); + var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); + using var uow = unitOfWorkManager.Begin(requiresNew: true); + + try + { + #region 鏁版嵁澶勭悊 + + //1銆佹洿鏂颁綔涓氳鍒掕〃涓� 鐢熶骇涓� + //2銆佺粰PLC鍙戝伐鑹哄弬鏁版寚浠�,骞跺啓鍏� plc涓� 浜у搧id + //if (workPlan.ProcessName == "瑁呴厤宸ュ簭") + //{ + // workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; + //} + //else if (workPlan.ProcessName == "鐒婃帴宸ュ簭") + //{ + // workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; + //} + workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; + + await workPlanRepository.UpdateAsync(workPlan); + + Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?> + { + { $"{processName}_ProductID", workPlan.PipeSpecCode }, + { $"{processName}绠℃缂栫爜", workPlan.PipeSpecCode }, + { $"{processName}绠℃鍚嶇О", workPlan.PipeSectionName }, + { $"{processName}鍘熸枡绠℃壒娆�", callMaterialOrder.MaterialBatch }, + { $"{processName}鍘熸枡绠″瀷鍙�", callMaterialOrder.MaterialMode }, + { $"{processName}鍘熸枡绠℃爣璇�", callMaterialOrder.DataIdentifier }, + { $"{processName}椤圭洰鍙�", workPlan.ProjectNumber }, + { $"{processName}鑸瑰彿", workPlan.ShipNumber }, + + //閲囬泦鏁版嵁妯℃嫙鍐欏叆 + { $"{processName}鍘嬪姏", "10.0 MPa" }, + { $"{processName}閫熷害", "18mm/s"}, + + { $"{processName}浜�", myCurrentUser.UserAccount}, + { $"{processName}闂撮殭","15mm"}, + { $"{processName}浣嶇疆", "10,23,24"}, + }; + _variableService.WriteValueAsync(keyValuePairs); + + + #endregion + + await uow.CompleteAsync(); + + // 杩斿洖缁撴灉 + var response = new MesOrderResponse + { + Code = "200", + Message = "澶勭悊鎴愬姛", + Time = DateTime.UtcNow + }; + return response; + } + catch (Exception) + { + await uow.RollbackAsync(); + throw; + } + finally + { + + } + + + + #endregion + } + + + + /// <summary> + /// 瑁呴厤宸ュ簭瀹屽伐 + /// </summary> + /// <param name="_serviceProvider"></param> + /// <param name="input"></param> + /// <param name="myCurrentUser"></param> + /// <returns></returns> + public async Task<MesOrderResponse> CompleteAssemblyProcess(IServiceProvider _serviceProvider, CompleteAssemblyProcessInput input, MyCurrentUser myCurrentUser) + { + //1銆佽褰曞垎鎷h褰曡〃 + //2銆佹洿鏂颁綔涓氳鍒掕〃鐨勭姸鎬� =宸插垎鎷� + //3銆佸啓鍏� 鍒嗘嫞鍙橀噺 + //4銆佸啓鍏ヨ拷婧姤琛� + //5銆佺墿鏂欑粍鐩� + + if (string.IsNullOrEmpty(input.PipeSpecCode)) + { + throw new UserFriendlyException($"绠℃缂栫爜涓嶈兘涓虹┖"); + } + + + VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); + var _workSectionManager = _serviceProvider.GetRequiredService<IWorkSectionManager>(); + var _workStationManager = _serviceProvider.GetRequiredService<IWorkStationManager>(); + var traceProvider = _serviceProvider.GetRequiredService<ITraceProvider>(); + var materialProvider = _serviceProvider.GetRequiredService<IMaterialProvider>(); + var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); + + string processName = ""; + //鐗╂枡鍙傛暟鍒楄〃 + var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode && x.ProcessName == input.ProcessName); + if (firstWorkPlan == null) + { + throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); + } + if (firstWorkPlan.ProcessName == "瑁呴厤宸ュ簭") + { + processName = "瑁呴厤"; + } + else if (firstWorkPlan.ProcessName == "鐒婃帴宸ュ簭") + { + processName = "鐒婃帴"; + } + + await CompleteHandleOutStoreFinish(_serviceProvider, processName, true); + + //鏍规嵁宸ュ簭鍚嶈幏鍙栧伐搴忓璞� + var workSection = await _workSectionManager.GetByNameAsync($"{processName}宸ュ簭"); + var workStation = await _workStationManager.GetByNameAsync($"{processName}宸ヤ綅"); + //鍐欏叆杩芥函鎶ヨ〃 + var finishTime = DateTime.Now; + TraceModel traceModel = new TraceModel() + { + SerialNumber = input.PipeSpecCode, + WorkSectionId = workSection.Id, + WorkSectionName = workSection.Name, + WorkStationName = workStation.Name, + + FinishTime = finishTime, + IsQualified = true, + UnqualifiedReason = "", + ProductModel = "", + ProductName = "", + + }; + traceModel.Params = new List<TraceParamModel>(); + foreach (var item in workSection.ProcessParameters) + { + var value = "ssss"; + traceModel.Params.Add(new TraceParamModel() + { + Key = item.Key, + Value = value.SafeString() + }); + } + + #region 浜嬪姟 + + using var scope = _serviceProvider.CreateScope(); + var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); + using var uow = unitOfWorkManager.Begin(requiresNew: true); + + try + { + #region 鏁版嵁澶勭悊 + + + + firstWorkPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; + await workPlanRepository.UpdateAsync(firstWorkPlan); + + var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == firstWorkPlan.DataIdentifier); + + var rawPipe_DataIdentifier = await materialProvider.FindByNameAsync("鍘熸枡绠℃爣璇�"); + var rawPipe_MaterialMode = await materialProvider.FindByNameAsync("鍘熸枡绠″瀷鍙�"); + var rawPipe_Batch = await materialProvider.FindByNameAsync("鍘熸枡绠℃壒娆�"); + var rawPipe_ProjectNumber = await materialProvider.FindByNameAsync("椤圭洰鍙�"); + var rawPipe_ShipNumber = await materialProvider.FindByNameAsync("鑸瑰彿"); + List<TraceMaterialModel> _MaterialParams = new List<TraceMaterialModel>(); + foreach (var item in workSection.MaterialParameters) + { + if (item.Name == "鍘熸枡绠″瀷鍙�") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_MaterialMode.MaterialId, + MaterialDetailId = rawPipe_MaterialMode.MaterialDetails.First().Id, + Value = firstWorkPlan.MaterialMode + + }); + } + if (item.Name == "鍘熸枡绠℃爣璇�") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_DataIdentifier.MaterialId, + MaterialDetailId = rawPipe_DataIdentifier.MaterialDetails.First().Id, + Value = firstWorkPlan.DataIdentifier, + + }); + } + if (item.Name == "鍘熸枡绠℃壒娆�") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_Batch.MaterialId, + MaterialDetailId = rawPipe_Batch.MaterialDetails.First().Id, + Value = callMaterialOrder.MaterialBatch,//鎵规鏆傛椂鍐欐 + + }); + } + if (item.Name == "椤圭洰鍙�") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_ProjectNumber.MaterialId, + MaterialDetailId = rawPipe_ProjectNumber.MaterialDetails.First().Id, + Value = firstWorkPlan.ProjectNumber, + + }); + } + if (item.Name == "鑸瑰彿") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_ShipNumber.MaterialId, + MaterialDetailId = rawPipe_ShipNumber.MaterialDetails.First().Id, + Value = firstWorkPlan.ShipNumber, + + }); + } + }; + + //閰嶇疆杩囩▼鍙傛暟(閲囬泦鍙傛暟銆侀厤鏂瑰弬鏁�) + traceModel.Params = new List<TraceParamModel>(); + foreach (var item in workSection.ProcessParameters) + { + string _value = ""; + + //閲囬泦鍙傛暟 + if (item.Name == $"{processName}鍘嬪姏") + { + var _getValue = await _variableService.ReadValueAsync($"{processName}鍘嬪姏"); + _value = _getValue.Content.Value.SafeString().ToString(); + } + if (item.Name == $"{processName}浣嶇疆") + { + var _getValue = await _variableService.ReadValueAsync($"{processName}浣嶇疆"); + _value = _getValue.Content.Value.SafeString().ToString(); + } + if (item.Name == $"{processName}閫熷害") + { + var _getValue = await _variableService.ReadValueAsync($"{processName}閫熷害"); + _value = _getValue.Content.Value.SafeString().ToString(); + } + + if (item.Name == $"{processName}闂撮殭") + { + _value = "15mm"; + } + if (item.Name == $"{processName}浜�") + { + _value = myCurrentUser.UserAccount; + } + //item.Key + TraceParamModel traceParamModel = new TraceParamModel() + { + Key = item.Key, + Value = _value + }; + traceModel.Params.Add(traceParamModel); + }; + foreach (var item in workSection.FormulaParameters) + { + string _value = ""; + + //閲囬泦鍙傛暟 + if (item.Name == $"{processName}鍘嬪姏") + { + var _getValue = await _variableService.ReadValueAsync($"{processName}鍘嬪姏"); + _value = _getValue.Content.Value.SafeString().ToString(); + } + if (item.Name == $"{processName}浣嶇疆") + { + var _getValue = await _variableService.ReadValueAsync($"{processName}浣嶇疆"); + _value = _getValue.Content.Value.SafeString().ToString(); + } + if (item.Name == $"{processName}閫熷害") + { + var _getValue = await _variableService.ReadValueAsync($"{processName}閫熷害"); + _value = _getValue.Content.Value.SafeString().ToString(); + } + + if (item.Name == $"{processName}闂撮殭") + { + _value = "15mm"; + } + if (item.Name == $"{processName}浜�") + { + _value = myCurrentUser.UserAccount; + } + //item.Key + TraceParamModel traceParamModel = new TraceParamModel() + { + Key = item.Key, + Value = _value + }; + traceModel.Params.Add(traceParamModel); + }; + + traceModel.MaterialParams = _MaterialParams; + + await traceProvider.CreateTraceAsync(traceModel); + + var response = new MesOrderResponse + { + Code = "200", + Data = "", + Message = "澶勭悊鎴愬姛", + Time = DateTime.UtcNow + }; + return response; + + #endregion + + await uow.CompleteAsync(); + } + catch (Exception) + { + await uow.RollbackAsync(); + throw; + } + finally + { + + } + + + + #endregion + + } + + + /// <summary> + /// 鍏叡澶勭悊 鍝嶅簲鍑虹珯瀹屾垚淇″彿 + /// </summary> + /// <param name="_serviceProvider"></param> + /// <param name="input"></param> + /// <param name="myCurrentUser"></param> + /// <returns></returns> + public async Task CompleteHandleOutStoreFinish(IServiceProvider _serviceProvider, string processName, bool isOutResult) + { + + VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); + + Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?> + { + { $"{processName}鍑虹珯瀹屾垚",isOutResult}, + { $"{processName}鍑虹珯缁撴灉",isOutResult? "鎴愬姛":""}, + }; + await _variableService.WriteValueAsync(keyValuePairs); + + } + + /// <summary> /// 鐢熸垚闅忔満鐨刉msTaskNo /// </summary> /// <returns>闅忔満鐢熸垚鐨勪换鍔$紪鍙�</returns> diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs index ce8adc5..01ffc44 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs @@ -12,6 +12,7 @@ using Volo.Abp.ObjectMapping; using Volo.Abp.Users; using CmsQueryExtensions.Entitys; +using System.Collections.Generic; namespace CMS.Plugin.PipeLineLems.Application.Implements; @@ -543,4 +544,56 @@ { return await _workPlanRepository.GetSingleByFilterAsync(whereConditions, is鈥婱ultipleThrowException); } + + + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇浣滀笟璁″垝琛ㄥ垪琛� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public virtual async Task<List<WorkPlanDto>> FindListByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default) + { + Check.NotNull(input, nameof(input)); + + if (input.Sorting.IsNullOrWhiteSpace()) + { + input.Sorting = nameof(WorkPlan.Sort); + } + + #region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� + + //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� + var whereConditions = DynamicGetQueryParams(input); + + #endregion + + var list = await _workPlanRepository.GetListByFilterAsync(whereConditions?.data); + + return new List<WorkPlanDto>(ObjectMapper.Map<List<WorkPlan>, List<WorkPlanDto>>(list)); + } + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜浣滀笟璁″垝琛� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public virtual async Task<WorkPlanDto> FindSingleByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default) + { + Check.NotNull(input, nameof(input)); + + if (input.Sorting.IsNullOrWhiteSpace()) + { + input.Sorting = nameof(WorkPlan.Sort); + } + + #region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� + + //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� + var whereConditions = DynamicGetQueryParams(input); + + #endregion + + var dataObj = await _workPlanRepository.GetSingleByFilterAsync(whereConditions?.data); + + return (ObjectMapper.Map<WorkPlan, WorkPlanDto>(dataObj)); + } } diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs index 7e797c8..16f075a 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs @@ -11,6 +11,8 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; using CmsQueryExtensions.Entitys; +using CMS.Plugin.PipeLineLems.Domain.WorkPlan; +using System.Linq.Expressions; namespace CMS.Plugin.PipeLineLems.Controller { @@ -63,6 +65,30 @@ } /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇浣滀笟璁″垝琛ㄥ垪琛� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + [Route("FindListByFilter")] + public virtual async Task<List<WorkPlanDto>> FindListByFilterAsync(GetWorkPlanInput input) + { + return await _workPlanAppService.FindListByFilterAsync(input); + } + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜浣滀笟璁″垝琛� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + [Route("FindSingleByFilter")] + public virtual async Task<WorkPlanDto> FindSingleByFilterAsync(GetWorkPlanInput input) + { + + return await _workPlanAppService.FindSingleByFilterAsync(input); + } + + /// <summary> /// 鍒涘缓浣滀笟璁″垝琛� /// </summary> /// <param name="input">鍒涘缓鍙傛暟</param> diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs index 0ad0a16..c2ecf7d 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs @@ -60,12 +60,23 @@ [Route("Pick")] public virtual async Task<MesOrderResponse> Pick([FromBody] PickInput input) { - MyCurrentUser myCurrentUser = new MyCurrentUser() + try { - UserAccount = _currentUser.UserAccount, - UserId = _currentUser.UserId - }; - return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser); + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = _currentUser.UserAccount, + UserId = _currentUser.UserId + }; + return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser); + } + catch (Exception ex) + { + return new MesOrderResponse() + { + Code = "400", + Message = ex.Message + }; + } } @@ -79,14 +90,81 @@ [Route("CallMaterial")] public virtual async Task<MesOrderResponse> CallMaterial([FromBody] CallMaterialByDataIdentifierInput input) { - MyCurrentUser myCurrentUser = new MyCurrentUser() + try { - UserAccount = _currentUser.UserAccount, - UserId = _currentUser.UserId - }; - return await sharedService.CallMaterial(input, _serviceProvider, myCurrentUser); + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = _currentUser.UserAccount, + UserId = _currentUser.UserId + }; + return await sharedService.CallMaterial(input, _serviceProvider, myCurrentUser); + } + catch (Exception ex) + { + return new MesOrderResponse() + { + Code = "400", + Message = ex.Message + }; + } } + /// <summary> + /// 寮�宸� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [Authorize] + [HttpPost] + [Route("StartProduction")] + public virtual async Task<MesOrderResponse> StartProduction([FromBody] StartProductionInput input) + { + try + { + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = _currentUser.UserAccount, + UserId = _currentUser.UserId + }; + return await sharedService.StartProduction(input, _serviceProvider, myCurrentUser); + } + catch (Exception ex) + { + return new MesOrderResponse() + { + Code = "400", + Message = ex.Message + }; + } + } + /// <summary> + /// 瀹屽伐 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [Authorize] + [HttpPost] + [Route("FinishProduction")] + public virtual async Task<MesOrderResponse> FinishProduction([FromBody] CompleteAssemblyProcessInput input) + { + try + { + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = _currentUser.UserAccount, + UserId = _currentUser.UserId + }; + return await sharedService.CompleteAssemblyProcess(_serviceProvider, input, myCurrentUser); + } + catch (Exception ex) + { + return new MesOrderResponse() + { + Code = "400", + Message = ex.Message + }; + } + } } } diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs index 3d83626..a15f5b9 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs @@ -22,6 +22,8 @@ using System.Collections.Generic; using CMS.Framework.AspNetCore.Users; using NPOI.SS.Formula.Functions; +using CMS.Plugin.PipeLineLems.Application.Implements; +using CmsQueryExtensions.Entitys; namespace CMS.Plugin.PipeLineLems.ProjectService { @@ -90,6 +92,9 @@ { "璇锋眰鐢熸垚鎵撶爜浜у搧鐮佷俊鍙�", "璇锋眰鐢熸垚鎵撶爜浜у搧鐮佷俊鍙�(鎻忚堪)" }, { "璇锋眰鐢熸垚鍒囧壊浜у搧鐮佷俊鍙�", "璇锋眰鐢熸垚鍒囧壊浜у搧鐮佷俊鍙�(鎻忚堪)" }, { "鍒囧壊杩涚珯淇″彿", "鍒囧壊杩涚珯淇″彿(鎻忚堪)" }, + + { "瑁呴厤瀹屽伐淇″彿", "瑁呴厤瀹屽伐淇″彿(鎻忚堪)" }, + { "鐒婃帴瀹屽伐淇″彿", "鐒婃帴瀹屽伐淇″彿(鎻忚堪)" }, }; // 鍒涘缓閫氶亾鐩戝惉 @@ -253,6 +258,43 @@ _ = Task.Run(async () => { await HanlderForCutByCreateProductWhenFlaseAsync(); + }); + } + } + + + if (changed.Name == "瑁呴厤瀹屽伐淇″彿") + { + if (changed.New?.Value.SafeString().ToBool() == true) + { + _ = Task.Run(async () => + { + await HanlderFor瑁呴厤瀹屽伐淇″彿Async(); + }); + } + else + { + _ = Task.Run(async () => + { + await HanlderFor瀹屽伐淇″彿WhenFalseAsync("瑁呴厤"); + }); + } + } + + if (changed.Name == "鐒婃帴瀹屽伐淇″彿") + { + if (changed.New?.Value.SafeString().ToBool() == true) + { + _ = Task.Run(async () => + { + await HanlderFor鐒婃帴瀹屽伐淇″彿Async(); + }); + } + else + { + _ = Task.Run(async () => + { + await HanlderFor瀹屽伐淇″彿WhenFalseAsync("鐒婃帴"); }); } } @@ -778,5 +820,109 @@ }; var ret = _variableService.WriteValueAsync(keyValuePairs_productID); } + + + + /// <summary> + /// 瑁呴厤瀹屽伐淇″彿=true鏃� + /// </summary> + /// <returns></returns> + private async Task HanlderFor瑁呴厤瀹屽伐淇″彿Async() + { + + var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); + + var pipeSpecCode = await _variableService.ReadValueAsync("瑁呴厤绠℃缂栫爜"); + + if (string.IsNullOrEmpty(pipeSpecCode?.Content?.Value.SafeString().ToString())) + { + + } + else + { + + + + var myPipeSpecCode = pipeSpecCode.Content.Value.SafeString().ToString(); + CallMaterialOrder callMaterialOrder = null; + try + { + var sharedService = _serviceProvider.GetRequiredService<SharedService>(); + var userName = await _variableService.ReadValueAsync("瑁呴厤浜�"); + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = userName.Content.Value.SafeString().ToString() + }; + sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName="瑁呴厤宸ュ簭" }, myCurrentUser); + + } + catch (Exception) + { + + } + } + } + + /// <summary> + /// 鐒婃帴瀹屽伐淇″彿=true鏃� + /// </summary> + /// <returns></returns> + private async Task HanlderFor鐒婃帴瀹屽伐淇″彿Async() + { + + var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); + + var pipeSpecCode = await _variableService.ReadValueAsync("鐒婃帴绠℃缂栫爜"); + + if (string.IsNullOrEmpty(pipeSpecCode?.Content?.Value.SafeString().ToString())) + { + + } + else + { + + + + var myPipeSpecCode = pipeSpecCode.Content.Value.SafeString().ToString(); + CallMaterialOrder callMaterialOrder = null; + try + { + var sharedService = _serviceProvider.GetRequiredService<SharedService>(); + var userName = await _variableService.ReadValueAsync("鐒婃帴浜�"); + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = userName.Content.Value.SafeString().ToString() + }; + sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "鐒婃帴宸ュ簭" }, myCurrentUser); + + } + catch (Exception) + { + + } + } + } + + /// <summary> + /// 瀹屽伐淇″彿=false鏃� + /// </summary> + /// <returns></returns> + private async Task HanlderFor瀹屽伐淇″彿WhenFalseAsync(string processName) + { + try + { + var sharedService = _serviceProvider.GetRequiredService<SharedService>(); + await sharedService.CompleteHandleOutStoreFinish(_serviceProvider, processName, false); + } + catch (Exception) + { + + + } + } } } diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/AppService\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/AppService\346\250\241\346\235\277.txt" index 2a60352..03b02e3 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/AppService\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/AppService\346\250\241\346\235\277.txt" @@ -441,4 +441,55 @@ { return await _$EntityInstanceName$Repository.GetSingleByFilterAsync(whereConditions, is鈥婱ultipleThrowException); } + + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇$ChinaComment$鍒楄〃 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public virtual async Task<List<$EntityName$Dto>> FindListByFilterAsync(Get$EntityName$Input input, CancellationToken cancellationToken = default) + { + Check.NotNull(input, nameof(input)); + + if (input.Sorting.IsNullOrWhiteSpace()) + { + input.Sorting = nameof($EntityName$.Sort); + } + + #region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� + + //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� + var whereConditions = DynamicGetQueryParams(input); + + #endregion + + var list = await _$EntityInstanceName$Repository.GetListByFilterAsync(whereConditions?.data); + + return new List<$EntityName$Dto>(ObjectMapper.Map<List<$EntityName$>, List<$EntityName$Dto>>(list)); + } + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜$ChinaComment$ + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public virtual async Task<$EntityName$Dto> FindSingleByFilterAsync(Get$EntityName$Input input, CancellationToken cancellationToken = default) + { + Check.NotNull(input, nameof(input)); + + if (input.Sorting.IsNullOrWhiteSpace()) + { + input.Sorting = nameof($EntityName$.Sort); + } + + #region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� + + //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� + var whereConditions = DynamicGetQueryParams(input); + + #endregion + + var dataObj = await _$EntityInstanceName$Repository.GetSingleByFilterAsync(whereConditions?.data); + + return (ObjectMapper.Map<$EntityName$, $EntityName$Dto>(dataObj)); + } } diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/IAppService\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/IAppService\346\250\241\346\235\277.txt" index 6ed0b79..972c752 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/IAppService\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/IAppService\346\250\241\346\235\277.txt" @@ -82,4 +82,18 @@ /// <returns></returns> /// <exception cref="UserFriendlyException"></exception> Task<$EntityName$> GetSingleByFilterAsync(Expression<Func<$EntityName$, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default); + + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇$ChinaComment$鍒楄〃 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<List<$EntityName$Dto>> FindListByFilterAsync(Get$EntityName$Input input, CancellationToken cancellationToken = default); + + /// <summary> + /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜$ChinaComment$ + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<$EntityName$Dto> FindSingleByFilterAsync(Get$EntityName$Input input, CancellationToken cancellationToken = default); } diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Controller\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Controller\346\250\241\346\235\277.txt" index 59f98c4..86e5ec5 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Controller\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Controller\346\250\241\346\235\277.txt" @@ -62,6 +62,30 @@ return _$EntityInstanceName$AppService.GetListAsync(input); } + /// <summary> + /// 根据条件获取$ChinaComment$ + /// </summary> + /// <param name="input">查询参数</param> + /// <returns></returns> + [HttpPost] + [Route("FindListByFilter")] + public virtual async Task<List<$EntityName$Dto>> FindListByFilterAsync([FromBody]Get$EntityName$Input input) + { + return await _$EntityInstanceName$AppService.FindListByFilterAsync(input); + } + /// <summary> + /// 根据条件获取单个$ChinaComment$ + /// </summary> + /// <param name="input">查询参数</param> + /// <returns></returns> + [HttpPost] + [Route("FindSingleByFilter")] + public virtual async Task<$EntityName$Dto> FindSingleByFilterAsync([FromBody]Get$EntityName$Input input) + { + + return await _$EntityInstanceName$AppService.FindSingleByFilterAsync(input); + } + /// <summary> /// 创建$ChinaComment$ /// </summary> diff --git "a/\347\256\241\345\255\220\347\272\277LMESDemo.cmsproj" "b/\347\256\241\345\255\220\347\272\277LMESDemo.cmsproj" index eb04755..335cc93 100644 --- "a/\347\256\241\345\255\220\347\272\277LMESDemo.cmsproj" +++ "b/\347\256\241\345\255\220\347\272\277LMESDemo.cmsproj" Binary files differ -- Gitblit v1.9.3