From a1a6727a25b09663628273f788877376556bdb23 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 7 Mar 2022 19:08:44 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E6=9B=B4=E6=96=B0=E6=A2=9D=E7=A2=BC?= =?UTF-8?q?=E6=AD=B7=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 42 +++++-- .../ViewModels/PCS/PCS009ViewModel.cs | 6 + AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml | 8 +- AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 8 +- AMESCoreStudio.Web/Views/PCS/PCS009.cshtml | 65 ++++++++-- AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml | 116 +++++++++++------- .../Models/AMES/BarcodeStation.cs | 8 ++ 7 files changed, 183 insertions(+), 70 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index bcf5425a..b1e54581 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -27,10 +27,11 @@ namespace AMESCoreStudio.Web.Controllers public readonly IPCS _pcsApi; public readonly IBAS _basApi; public readonly IPPS _ppsApi; + public readonly IFQC _fqcApi; public readonly IFileServerProvider _fileServerProvider; private readonly IWebHostEnvironment _env; - public PCSController(ILogger logger, ISYS sysApi, IPCS pcsApi, IBAS basApi, IPPS ppsApi + public PCSController(ILogger logger, ISYS sysApi, IPCS pcsApi, IBAS basApi, IPPS ppsApi, IFQC fqcApi , IFileServerProvider fileServerProvider, IWebHostEnvironment env) { _logger = logger; @@ -38,6 +39,7 @@ namespace AMESCoreStudio.Web.Controllers _pcsApi = pcsApi; _basApi = basApi; _ppsApi = ppsApi; + _fqcApi = fqcApi; _fileServerProvider = fileServerProvider; _env = env; } @@ -1873,12 +1875,28 @@ namespace AMESCoreStudio.Web.Controllers return View(); } + /// + /// PCS009 Query By 包裝箱號 + /// + /// 包裝箱號 + /// + public async Task PCS009QueryAsync(string boxNo) + { + var result = await _fqcApi.GetBarcodeInfoesByBoxNo(boxNo); + + if (result.Count != 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } - public async Task PCS009R() + public async Task PCS009R(PCS009ViewModel model) { var result = new PCS009RViewModel(); - var result_barcodeinfo = _pcsApi.GetBarcodeInfoesByNo("WO0002A10001").InvokeAsync().Result.FirstOrDefault(); + var result_barcodeinfo = _pcsApi.GetBarcodeInfoesByNo(model.BarCodeNo).InvokeAsync().Result.FirstOrDefault(); if (result_barcodeinfo == null) { @@ -1903,7 +1921,7 @@ namespace AMESCoreStudio.Web.Controllers { WipNo = wipinfo.WipNO, ItemNo = wipinfo.GetWipAtt.WipNO, - UnitNo = wipinfo.UnitNO + "[" + wipinfo.GetFactoryUnit.UnitName + "]", + UnitNo = wipinfo.GetFactoryUnit.UnitCode + "[" + wipinfo.GetFactoryUnit.UnitName + "]", Line = wipinfo.GetLineInfo.LineDesc, ECN = wipinfo.GetWipAtt.ECN, ECO = wipinfo.GetWipAtt.EAN, @@ -1920,7 +1938,7 @@ namespace AMESCoreStudio.Web.Controllers { result.BarCodeLogs.Add(new BarCodeLog { - Station = barcodestation.RuleStationID.ToString(), + Station = barcodestation.GetRuleStation.StationDesc, RuleStation = barcodestation.RuleStatus, SysType = barcodestation.Systype, User = barcodestation.CreateUserID.ToString(), @@ -1934,9 +1952,9 @@ namespace AMESCoreStudio.Web.Controllers { result.BarCodeKPs.Add(new BarCodeKP { - Station = barcodeitem.RuleStationID.ToString(), + Station = barcodeitem.S.StationDesc, KPPartNo = barcodeitem.PartNo, - KPItemNo = barcodeitem.ItemNo, + KPItemNo = barcodeitem.KpItemNo, InputDate = barcodeitem.CreateDate.ToString() }); } @@ -1947,11 +1965,11 @@ namespace AMESCoreStudio.Web.Controllers { result.KPChanges.Add(new KPChange { - KPPartNo = barcodeitemchange.PartNoOld, - KPItemNo = barcodeitemchange.ItemNo, - ChangeType = barcodeitemchange.ChangeType, - Date = barcodeitemchange.CreateDate.ToString(), - User = barcodeitemchange.CreateUserID.ToString() + KPPartNo = barcodeitemchange.PartNoOld, + KPItemNo = barcodeitemchange.ItemNo, + ChangeType = barcodeitemchange.ChangeType, + Date = barcodeitemchange.CreateDate.ToString(), + User = barcodeitemchange.CreateUserID.ToString() }); } diff --git a/AMESCoreStudio.Web/ViewModels/PCS/PCS009ViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/PCS009ViewModel.cs index 376c9072..05fe5318 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/PCS009ViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/PCS009ViewModel.cs @@ -10,6 +10,12 @@ namespace AMESCoreStudio.Web.ViewModels.PCS { public class PCS009ViewModel { + + public PCS009ViewModel() + { + + } + /// /// 內部條碼 /// diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index a8903640..c30cd6c6 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -259,12 +259,12 @@ @foreach (var index in Model.ruleStations) { - + @index.UnitNoName - - + + @index.FlowRuleName - + @index.StationDesc diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 76136955..c1ecde94 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -264,12 +264,12 @@ @foreach (var index in Model.ruleStations) { - + @index.UnitNoName - - + + @index.FlowRuleName - + @index.StationDesc diff --git a/AMESCoreStudio.Web/Views/PCS/PCS009.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS009.cshtml index 4f19ec6f..b17642aa 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS009.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS009.cshtml @@ -29,7 +29,7 @@
-
+
@ViewBag.Title
@@ -41,7 +41,7 @@
- +
@@ -49,7 +49,7 @@
- +
@@ -57,7 +57,7 @@
- +
@@ -65,13 +65,14 @@
- +
- + + @**@
@@ -87,9 +88,57 @@ layui.use(['form', 'layer', 'laydate'], function () { var form = layui.form; }); + + //通过行tool檢視,lay-event="detail" + function detail(obj) { + if (obj.data.barcodeNo) { + + hg.open('檢視工單資料', '/PCS/PCS009R?BarCodeNo=' + obj.data.barcodeNo, '', '', true); + } + } + function result() { - hg.open('條碼生產歷程', '/PCS/PCS009R', '', '', true); - }; + var BarCodeNo = $("#BarCodeNo").val(); + var PartNo = $("#PartNo").val(); + var ExtraBarCodeNo = $("#ExtraBarCodeNo").val(); + var BoxNo = $("#BoxNo").val(); + if (BoxNo != '') { + var tableCols = [[ + { + field: 'barcodeNo', + width: 150, + title: '內部條碼', + sort: true + }, + { + field: 'extraBarcodeNo', + title: '客戶條碼', + width: 200, + sort: true + }, + { + field: 'right', + width: 100, + title: '操作', + fixed: 'right', + templet: function (d) { + return '檢視' + /* < a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay - event="edit" > 修改 '*/ + } + }] + ]; + + var table = hg.table.datatable('query', 'query查詢', '/PCS/PCS009Query?boxNo=' + BoxNo, {}, tableCols, '', false, 'full-100'); + hg.msghide("重新載入資料.."); + table; + } + else { + var query = "?BarCodeNo=" + BarCodeNo + "&PartNo=" + PartNo + "&ExtraBarCodeNo=" + ExtraBarCodeNo; + hg.open('條碼生產歷程', '/PCS/PCS009R' + query, '', '', true); + } + + + }; } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml index e94a3305..1f181fab 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS009R.cshtml @@ -25,7 +25,7 @@
- +
@@ -35,7 +35,7 @@
- +
@@ -45,7 +45,7 @@
- +
@@ -86,49 +86,81 @@
工單資料
- @* - - - - - - - - - +
- 生產單位 - - 流程名稱 - - 站別描述 - - 站別順序 - - 站別類型 -
- @foreach (var index in Model.ruleStations) + @foreach (var index in Model.WinInfos) { - - + + + + + + + + + + + + + + + + + + + + + + + } -
- @index.UnitNoName - - @index.FlowRuleName - - @index.StationDesc + 工單號碼: + + @index.WipNo - @index.Sequence + 料號: - @index.StationType + @index.ItemNo + + 94/96/97BOM版本: + + +
+ 生產單位: + + @index.UnitNo + + 線別: + + @index.Line + + ECN: + + @index.ECN +
+ 建置日期: + + @index.CreateDate + + DATE CODE: + + @index.DateCode + + 客戶料號: + + @index.CustomerItemNo +
+ Remarks: + + @index.Remarks
*@ +
@@ -158,12 +190,12 @@ @foreach (var index in Model.BarCodeLogs) { - + @index.Station - - + + @index.RuleStation - + @index.SysType @@ -203,12 +235,12 @@ @foreach (var index in Model.BarCodeKPs) { - + @index.Station - - + + @index.KPPartNo - + @index.KPItemNo diff --git a/AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs b/AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs index c1c6c714..4026c187 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/BarcodeStation.cs @@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; +using AMESCoreStudio.WebApi.Models.BAS; #nullable disable @@ -111,5 +112,12 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] [Display(Name = "建立時間")] public DateTime CreateDate { get; set; } = DateTime.Now; + + /// + /// 工單-基本資料 + /// + [ForeignKey("RuleStationID")] + [DataMember] + public virtual RuleStation GetRuleStation { get; set; } } }