| | |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "任 务 手 动 完 成", |
| | | icon: '', |
| | | class: '', |
| | | type: 'success', |
| | | value: 'TaskHandCompleted', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | ] |
| | | |
| | | export default buttons |
| | |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | let TaskHandCompletedBtn = this.buttons.find(x => x.value == 'TaskHandCompleted'); |
| | | if (TaskHandCompletedBtn) { |
| | | TaskHandCompletedBtn.onClick = function () { |
| | | this.$confirm("是否确认完成任务", "手动任务完成警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | center: true, |
| | | }).then(() => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("请选择数据!"); |
| | | if (rows.length > 1) return this.$error("请选择一条数据!"); |
| | | var param = rows[0].taskNum; |
| | | this.http |
| | | .post("api/Task/ManualTaskCompleted?taskNum=" + param, "数据处理中...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('任务手动完成'); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent LedShowTask(string StationCode, string PalletCode, int TaskType); |
| | | |
| | | /// <summary> |
| | | /// 任务手动完成 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | Task<WebResponseContent> ManualTaskCompleted(int taskNum); |
| | | |
| | | } |
| | | } |
| | |
| | | // return WebResponseContent.Instance.Error(ex.Message); |
| | | // } |
| | | //} |
| | | |
| | | |
| | | [HttpPost, HttpGet, Route("RecWMSTaskCompleted"), AllowAnonymous] |
| | | public WebResponseContent RecWMSTaskCompleted(int taskNum) |
| | | { |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 任务手动完成 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpGet, HttpPost, Route("ManualTaskCompleted"), AllowAnonymous] |
| | | public async Task<WebResponseContent> ManualTaskCompleted(int taskNum) |
| | | { |
| | | return await Service.ManualTaskCompleted(taskNum); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 任务手动完成 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public async Task<WebResponseContent> ManualTaskCompleted(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | string url = "http://localhost:9290"; |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | return await Task.FromResult(WebResponseContent.Instance.Error($"未找到WCSApi地址,请检查配置文件")); |
| | | } |
| | | string response = HttpHelper.Post($"{url}/api/Task/TaskCompleted?taskNum=" + taskNum,taskNum.ToString()); |
| | | |
| | | return await Task.FromResult(JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("返回错误")); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | private void DWANDYSUpdateOutboundOrderDetails(Dt_StockInfo stockInfo, Dt_OutboundOrder inboundOrder, ref List<Dt_OutboundOrderDetail> inboundOrderDetails) |
| | | { |
| | | List<Dt_OutboundOrderDetail> newOutboundOrderDetails = inboundOrderDetails; |
| | | int CompeletedNum = inboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count(); |
| | | foreach (var newOutboundOrderDetail in newOutboundOrderDetails) |
| | | { |
| | | string BatchNo = newOutboundOrderDetail.BatchNo; |
| | | //inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BatchNo == stockInfo.Details.FirstOrDefault()?.BatchNo&&x.LPNNo==stockInfo.PalletCode); |
| | | |
| | | foreach (var item in stockInfo.Details) |
| | | { |
| | | if (newOutboundOrderDetail == null) continue; |
| | |
| | | if (newOutboundOrderDetail.OverOutQuantity == newOutboundOrderDetail.OrderQuantity) |
| | | { |
| | | newOutboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); |
| | | CompeletedNum++; |
| | | } |
| | | else if (newOutboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | newOutboundOrderDetail.OrderDetailStatus = OutboundStatusEnum.出库中.ObjToInt(); |
| | | |
| | | inboundOrder.OrderStatus = OutboundStatusEnum.出库中.ObjToInt(); |
| | | } |
| | | } |
| | | } |
| | | if (newOutboundOrderDetails.All(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt())) |
| | | if (inboundOrder.Details.Count == CompeletedNum) |
| | | { |
| | | inboundOrder.OrderStatus = OutboundStatusEnum.出库完成.ObjToInt(); |
| | | } |