From a32fbaa3c25ac4e1635af1a9b41d5bdcb58023c8 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 18 Nov 2022 13:19:33 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3FQC=E8=85=B3=E6=9C=AC?= =?UTF-8?q?=E5=93=81=E8=B3=AA=E6=9C=83=E8=AD=B0=E6=89=80=E6=8F=90=E5=87=BA?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=9C=B0=E6=96=B9=202022/11/16=202.=20?= =?UTF-8?q?=E9=81=8E=E7=AB=99API=E5=8A=A0=E5=85=A5=E5=87=BA=E8=B2=A8?= =?UTF-8?q?=E6=A2=9D=E7=A2=BC=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FQCController.cs | 47 +++++++++++++++---- AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml | 4 +- AMESCoreStudio.Web/Views/FQC/FQC008.cshtml | 45 ++++++++++-------- .../AMES/FqcInhouseMasterController.cs | 20 ++++++-- .../Controllers/BLL/BarCodeCheckController.cs | 9 +++- 5 files changed, 88 insertions(+), 37 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index 2f23f4fc..fb05b520 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -1146,21 +1146,25 @@ namespace AMESCoreStudio.Web.Controllers var result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); var fqcItem = result.Data.FirstOrDefault(); - // 抽驗數量 大於 本批次送驗量 - if (fqcItem.QcQty > fqcItem.InhouseQty) + // Fail數量 小於0 才要判斷抽樣數量 + if (fqcItem.FailQty <= 0) { - if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.InhouseQty) + // 抽驗數量 大於 本批次送驗量 + if (fqcItem.QcQty > fqcItem.InhouseQty) + { + if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.InhouseQty) + { + var _msg = "抽樣數量不足,無法判定"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + } + //當抽驗數量 小於 抽樣數量就離開 + else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty) { var _msg = "抽樣數量不足,無法判定"; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } } - //當抽驗數量 小於 抽樣數量就離開 - else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty) - { - var _msg = "抽樣數量不足,無法判定"; - return RedirectToAction("Refresh", "Home", new { msg = _msg }); - } // 判斷狀態選擇 if (fqcItem.FailQty >= fqcItem.ReQty) @@ -1168,6 +1172,29 @@ namespace AMESCoreStudio.Web.Controllers else model.QaResult = "P"; + // 抓取判定Major & Minor + // 抓全部檢驗工項 + var result_QcItem = await _fqcApi.GetQcItemQuery(0, 0, 0); + // 取綁定工單檢驗工項資料 + var result_WipFQC = await _fqcApi.GetWipFqcItemByWipNo(fqcItem.WipNo); + var qcItemDtos = new List(); + if (result_WipFQC.Count == 0) + { + //工單無設定檢驗工項時 在抓料號綁定檢驗工項 + var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(fqcItem.ItemNo); + if (result_MaterialFQC.Count != 0) + { + qcItemDtos = result_QcItem.Data.Where(w => result_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList(); + } + } + else + { + qcItemDtos = result_QcItem.Data.Where(w => result_WipFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList(); + } + + model.MajorQty = qcItemDtos.Where(w => w.ItemType == "A").Count(); + model.MinorQty = qcItemDtos.Where(w => w.ItemType == "B").Count(); + return View(model); } @@ -1274,7 +1301,7 @@ namespace AMESCoreStudio.Web.Controllers string Body = $@"FQC單號:{inhouseNo} 料號:{Material}
檢驗結果為:{Result}"; - await _bllApi.PostToMail(Subject, Body, string.Join(',', MailGroup) , "", false, path); + await _bllApi.PostToMail(Subject, Body, string.Join(',', MailGroup), "", false, path); } } #endregion diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml index a841270c..ec35e028 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml @@ -70,7 +70,7 @@
- +
@@ -80,7 +80,7 @@
- +
diff --git a/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml index c227f1f0..ec226da3 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml @@ -7,27 +7,27 @@ /*.layui-table-main .layui-table-cell {*/ /*height: auto !important;*/ /*white-space: normal; - } + } - .layui-table img { - max-width: 60px; - max-height: 28px; - } + .layui-table img { + max-width: 60px; + max-height: 28px; + } - .layui-tree-main { - cursor: pointer; - padding-right: 10px; - float: left; - border-width: 1px; - border-style: solid; - border-color: #e6e6e6; - margin: 10px 0; - } + .layui-tree-main { + cursor: pointer; + padding-right: 10px; + float: left; + border-width: 1px; + border-style: solid; + border-color: #e6e6e6; + margin: 10px 0; + } - .layui-table-cell { - height: auto; - white-space: normal; - }*/ + .layui-table-cell { + height: auto; + white-space: normal; + }*/ @@ -204,7 +204,7 @@ field: 'statusName', title: '檢驗狀態', sort: true, - templet:'#statusName' + templet: '#statusName' }, { field: 'endTime', @@ -236,6 +236,11 @@ function edit(obj) { if (obj.data.inhouseNo) { hg.open('FQC抽驗作業', '/FQC/FQC007?inhouseNo=' + obj.data.inhouseNo + '&seqID=' + obj.data.seqID, '', '', true); + + var tempwindow = window.open('_blank'); // 先打開頁面 + tempwindow.location = 'https://sms.avalue.com.tw/SMS/SUP/SFIS_SMS001.aspx?MODEL_NO=' + obj.data.modelNo; + var tempwindow1 = window.open('_blank'); // 先打開頁面 + tempwindow1.location = 'http://qazone.avalue.com.tw/qazone/sfislinktocfqr.aspx?QF=2&QA_PRDID=' + obj.data.itemNo; } } @@ -256,7 +261,7 @@ //基本数据表格 var table = hg.table.datatable('query', 'FQC查詢', '/FQC/FQC008Query', {}, tableCols, '', true, 'full-100', ['filter', 'print', 'exports']); - // var table = hg.table.datatable('test', '條碼狀態維護', '/PCS/GetWipInfo', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + // var table = hg.table.datatable('test', '條碼狀態維護', '/PCS/GetWipInfo', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']);