diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 33c30ce9..0f62cf6d 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -2063,7 +2063,7 @@ namespace AMESCoreStudio.Web.Controllers try { #region 選單 - await WipDataSelectAll(model.wipAtt.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO); + await WipDataSelectAll(model.wipInfo.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO); GetCheckboxApproveLogo(model.wipLabel != null ? model.wipLabel.ApproveLogo : null); GetCheckboxCompanyLogo(model.wipLabel != null ? model.wipLabel.CompanyLogo : null); GetCheckboxPrintMode(model.wipLabel != null ? model.wipLabel.PrintMode : null); @@ -2753,7 +2753,7 @@ namespace AMESCoreStudio.Web.Controllers /// PCS005 Query /// /// 生產單位 - /// 工單號碼 + /// 工單號碼 /// 料號 /// public async Task PCS005QueryAsync(string unitno, string wipNo, string itemNo, int page = 0, int limit = 10) @@ -2840,14 +2840,14 @@ namespace AMESCoreStudio.Web.Controllers result_dy.Add(new { item.wipID, - item.wipNO, - item.itemNO, + item.wipNo, + item.itemNo, item.lineID, item.lineDesc, item.unitName, item.planQTY, item.createDate, - result_StatusType.Where(w => w.StatusNo == (string)item.statusNO).FirstOrDefault().StatusDesc, + result_StatusType.Where(w => w.StatusNo == (string)item.statusNo).FirstOrDefault().StatusDesc, OnOff = result_LineInfo.Count() != 0 ? "ON" : "OFF", ActiveStop = result_Log.StatusNO }); @@ -2893,7 +2893,6 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task PCS006OnOffAsync(int LineID, int wipID) { - IResultModel result; await _pcsApi.PutLineInfoToWipNO(LineID, wipID); var _msg = "修改成功!"; return Json(_msg); @@ -4491,17 +4490,17 @@ namespace AMESCoreStudio.Web.Controllers return View(); } - //[HttpPost] - //public async Task PCS031Asnyc(PCS031ViewModel model) - //{ - + [HttpPost] + public async Task PCS031Asnyc(string wipNo) + { - //} + return View(); + } [HttpPost] - public async Task PCS031QueryAsnyc(string wipNo) + public async Task PCS031Query(string wipNo) { - var result = new ResultModel(); + var result = new ResultModel(); var result_Wip = await _pcsApi.GetWipInfoByWipNO(wipNo.Trim().ToUpper()); if (result_Wip.Count == 0) @@ -4517,16 +4516,18 @@ namespace AMESCoreStudio.Web.Controllers else { var FlowRule = result_Wip.FirstOrDefault().FlowRuleID; - var result_RuleStation = await _pcsApi.GetRuleStationByFlow(FlowRule); - } - - if (result.Data.Count() != 0) - { - return Json(new Table() { code = 0, msg = "", data = result.Data, count = 0 }); + var result_RuleStation = await _basApi.GetRuleStationsByFlow(FlowRule, 0); + result_RuleStation = result_RuleStation.Where(w => w.StationType == "M").OrderBy(o => o.Sequence).ToList(); + var Stations = new List(); + for (int i = 0; i < result_RuleStation.Count; i++) + { + RuleStations.Add(new SelectListItem(result_RuleStation[i].Sequence + "-" + result_RuleStation[i].StationDesc, result_RuleStation[i].RuleStationID.ToString())); + } + result.Data = RuleStations; } - return Json(result); } + #endregion [HttpPost] public JsonResult TestFunc(string number) diff --git a/AMESCoreStudio.Web/ViewModels/PCS/PCS031ViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/PCS031ViewModel.cs new file mode 100644 index 00000000..844a0609 --- /dev/null +++ b/AMESCoreStudio.Web/ViewModels/PCS/PCS031ViewModel.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.Models.BAS; +using AMESCoreStudio.WebApi.DTO.AMES; + +namespace AMESCoreStudio.Web.ViewModels.PCS +{ + public class PCS031ViewModel + { + /// + /// 工單號碼 + /// + public string WipNO { get; set; } + + /// + /// 工單ID + /// + public int WipID { get; set; } + + /// + /// 經過作業站 + /// + public int GoByRuleStation { get; set; } + + /// + /// 退回目的地作業站 + /// + public int RetrueRuleStation { get; set; } + } +} diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index b131cca8..e5cd4f0a 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -106,14 +106,13 @@
- +
-
@@ -121,7 +120,6 @@
-
@@ -190,12 +188,10 @@
-
-
@@ -218,12 +214,10 @@
-
-
@@ -562,7 +556,6 @@
-
@@ -628,21 +621,18 @@
-
-
-
@@ -696,7 +686,7 @@
- +
@@ -725,14 +715,14 @@
- +
-
+
@@ -742,7 +732,7 @@
- +
@@ -776,7 +766,7 @@
- +
@@ -799,7 +789,7 @@
- +
@@ -814,7 +804,7 @@
- +
@@ -893,7 +883,7 @@
- +
@@ -1333,7 +1323,7 @@ { url: "@Url.Action("GetMaterialFlowRuleJson", "PCS")", dataType: 'json', - data: { "itemno": $("#wipAtt_ItemNO").val(),"unit_no": $("#unit").val()}, + data: { "itemno": $("#wipAtt_ItemNO").val(), "unit_no": $("#wipInfo_UnitNO").val()}, type: 'post', success: function (result) { @@ -1359,7 +1349,7 @@ { url: "@Url.Action("GetUnitLineJson", "BAS")", dataType: 'json', - data: { "unit_no": $("#unit").val()}, + data: { "unit_no": $("#wipInfo_UnitNO").val()}, type: 'post', success: function (result) { @@ -1383,6 +1373,7 @@ //UserName function getUserName(val) { + if (val.value.length != 0) { $.ajax( { url: "@Url.Action("getUserName", "SYS")", @@ -1397,7 +1388,8 @@ { alert(result); } - }); + }); + } }; // RuleStation 備註 @@ -1406,7 +1398,7 @@ { url: "@Url.Action("getMaterialFlowRuleRemark", "PCS")", dataType: 'json', - data: { "itemno": $("#wipAtt_ItemNO").val(), "unit_no": $("#unit").val(), "flowID": NewID }, + data: { "itemno": $("#wipAtt_ItemNO").val(), "unit_no": $("#wipInfo_UnitNO").val(), "flowID": NewID }, type: 'post', success: function (result) { diff --git a/AMESCoreStudio.Web/Views/PCS/PCS004.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS004.cshtml index f618e9dd..d798d680 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS004.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS004.cshtml @@ -96,13 +96,13 @@ var tableCols = [[ { - field: 'wipNO', + field: 'wipNo', width: 200, title: '工單號碼', sort: true }, { - field: 'itemNO', + field: 'itemNo', title: '料號', width: 200, sort: true diff --git a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml index a228ffb3..d561a4e1 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml @@ -2,13 +2,15 @@ ViewData["Title"] = "工單資料查詢"; Layout = "~/Views/Shared/_AMESLayout.cshtml"; } +@using Microsoft.AspNetCore.Mvc.Localization +@inject IHtmlLocalizer sharedLocalizer
@@ -83,13 +85,13 @@ }); var tableCols = [[ { - field: 'wipNO', + field: 'wipNo', width: 100, title: '工單號碼', sort: true }, { - field: 'itemNO', + field: 'itemNo', title: '料號', width: 150, sort: true @@ -126,8 +128,9 @@ templet: '
{{ layui.util.toDateString(d.wipScheduleDate, "yyyy/MM/dd") }}
' }, { - field: 'a', - title: '開工日' + field: 'workDate', + title: '開工日', + sort: true }, { field: 'wipDueDate', diff --git a/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml index b6a73560..620b02a4 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml @@ -171,13 +171,13 @@ hide: true }, { - field: 'wipNO', + field: 'wipNo', width: 200, title: '工單號碼', sort: true }, { - field: 'itemNO', + field: 'itemNo', title: '料號', width: 200, sort: true diff --git a/AMESCoreStudio.Web/Views/PCS/PCS031.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS031.cshtml new file mode 100644 index 00000000..2b4c383e --- /dev/null +++ b/AMESCoreStudio.Web/Views/PCS/PCS031.cshtml @@ -0,0 +1,124 @@ +@{ + ViewData["Title"] = "SOP文件查詢"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + + + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ + @Html.ValidationMessage("error") +
+
+ +
+
+
+
+
+ + +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + +} + diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs index 21babf79..3cc17d79 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs @@ -173,38 +173,38 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES join q3 in _context.LineInfoes on q1.LineID equals q3.LineID join q4 in _context.FactoryUnits on q1.UnitNO equals q4.UnitNo join q5 in _context.FactoryInfos on q1.Werks equals q5.FactoryID.ToString() - //join q6 in _context.MaterialItems on q2.ItemNO equals q6.ItemNo - select new + select new WipQueryDto { - q1.WipID, - q1.WipNO, - q1.PlanQTY, - q1.UnitNO, - q1.LineID, - q1.StatusNO, - q1.WipScheduleDate, - q1.WipDueDate, - q5.FactoryNameCh, - q1.Description, - q1.CreateDate, - q2.ItemNO, - q3.LineDesc, - q4.UnitName + wipID = q1.WipID, + wipNo = q1.WipNO, + planQTY = q1.PlanQTY, + unitNo = q1.UnitNO, + lineID = q1.LineID, + statusNo = q1.StatusNO, + wipScheduleDate = q1.WipScheduleDate, + wipDueDate = q1.WipDueDate, + factoryNameCh = q5.FactoryNameCh, + description = q1.Description, + CreateDate = q1.CreateDate, + itemNo = q2.ItemNO, + lineDesc = q3.LineDesc, + unitName = q4.UnitName }; + if (!string.IsNullOrWhiteSpace(value.unitno)) { - q = q.Where(w => w.UnitNO == value.unitno); + q = q.Where(w => w.unitNo == value.unitno); } if (!string.IsNullOrWhiteSpace(value.wipno)) { - q = q.Where(w => w.WipNO == value.wipno); + q = q.Where(w => w.wipNo == value.wipno); } if (value.lineid != 0) { - q = q.Where(w => w.LineID == value.lineid); + q = q.Where(w => w.lineID == value.lineid); } if (value.date_str != null) @@ -219,7 +219,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (value.itemno != null) { - q = q.Where(w => w.ItemNO == value.itemno); + q = q.Where(w => w.itemNo == value.itemno); } // 紀錄筆數 @@ -231,7 +231,18 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES q = q.Skip((page - 1) * limit).Take(limit); } - result.Data = await q.ToListAsync(); + var qq = await q.ToListAsync(); + + // 塞入開工日 + foreach (var item in qq) + { + var workDate = _context.WipStations.Where(w => w.WipID == item.wipID) + .OrderBy(s => s.CreateDate) + .FirstOrDefault(); + item.workDate = workDate == null ? "" : workDate.CreateDate.ToString("yyyy/MM/dd"); + } + + result.Data = qq; if (result == null) { @@ -451,7 +462,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var wipBarcodeOther = await _context.WipBarcodeOthers.Where(w => w.WipNO == id).ToListAsync(); _context.WipBarcodeOthers.RemoveRange(wipBarcodeOther); - var wipBoard = await _context.WipBoards.Where(w => w.WipNo == id).ToListAsync(); + var wipBoard = await _context.WipBoards.Where(w => w.WipNo == id).ToListAsync(); _context.WipBoards.RemoveRange(wipBoard); var wipSystem = await _context.WipSystems.Where(w => w.WipNo == id).ToListAsync(); diff --git a/AMESCoreStudio.WebApi/DTO/AMES/WipQueryDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/WipQueryDto.cs new file mode 100644 index 00000000..dbd56037 --- /dev/null +++ b/AMESCoreStudio.WebApi/DTO/AMES/WipQueryDto.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace AMESCoreStudio.WebApi.DTO.AMES +{ + /// + /// WipQuery Select Dto + /// + public class WipQueryDto + { + /// + /// 工單ID + /// + public int wipID { get; set; } + + /// + /// 工單號碼 + /// + public string wipNo { get; set; } + + /// + /// 工單數量 + /// + public int planQTY { get; set; } = 0; + + /// + /// 生產單位 + /// + public string unitNo { get; set; } + + /// + /// 生產單位Name + /// + public string unitName { get; set; } + + /// + /// 線別ID + /// + public int? lineID { get; set; } = 0; + + /// + /// 線別Name + /// + public string lineDesc { get; set; } + + /// + /// 料號 + /// + public string itemNo { get; set; } + + /// + /// 工單狀態 + /// + public string statusNo { get; set; } + + /// + /// 預計開工日期 + /// + public DateTime wipScheduleDate { get; set; } + + /// + /// 預計完工日期 + /// + public DateTime wipDueDate { get; set; } + + /// + /// 廠商中文廠名 + /// + public string factoryNameCh { get; set; } + + /// + /// 工單描述 + /// + public string description { get; set; } + + /// + /// 工單建立日期 + /// + public DateTime CreateDate { get; set; } + + /// + /// 開工日 + /// + public string workDate { get; set; } + + /// + /// 檢驗日 + /// + public string fqcDate { get; set; } + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs index f570b31d..fc82da9f 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs @@ -66,7 +66,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("BI_RATIO")] [DataMember] [Display(Name = "燒機比率")] - public decimal BiRatio { get; set; } + public decimal BiRatio { get; set; } = 0; /// /// 燒機溫度