diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index 5591f409..8b4ae22c 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -30,11 +30,13 @@ namespace AMESCoreStudio.Web.Controllers private readonly ILogger _logger; public readonly IFQC _fqcApi; private readonly IWebHostEnvironment _env; - public FQCController(ILogger logger, IFQC fqcApi, IWebHostEnvironment env) + public readonly IPCS _pcsApi; + public FQCController(ILogger logger, IFQC fqcApi, IWebHostEnvironment env , IPCS pcsApi) { _logger = logger; _fqcApi = fqcApi; _env = env; + _pcsApi = pcsApi; } #region 下拉選單 @@ -161,6 +163,28 @@ namespace AMESCoreStudio.Web.Controllers //将数据Json化并传到前台视图 return Json(new { data = item }); } + + /// + /// 廠別/委外廠 + /// + /// + private async Task GetFactoryInfo() + { + var result = await _pcsApi.GetFactoryInfo(); + + var FactoryInfo = new List(); + for (int i = 0; i < result.Count; i++) + { + FactoryInfo.Add(new SelectListItem(result[i].FactoryNo + "-" + result[i].FactoryNameCh, result[i].FactoryID.ToString())); + } + + if (FactoryInfo.Count == 0) + { + FactoryInfo.Add(new SelectListItem("N/A", null)); + } + + ViewBag.FactoryInfoList = FactoryInfo; + } #endregion #region FQC001 檢驗類別維護 @@ -887,7 +911,7 @@ namespace AMESCoreStudio.Web.Controllers if (model.StatusNo == "F") FqcResultMaster.FailQty += 1; else - { + { FqcResultMaster.PassQty += 1; FqcResultDetail.NgReasonNo = ""; FqcResultDetail.NgMemo = ""; @@ -1135,19 +1159,21 @@ namespace AMESCoreStudio.Web.Controllers #endregion #region FQC008 FQC查詢 - public IActionResult FQC008() + public async Task FQC008() { + await GetFactoryInfo(); return View(); } public async Task FQC008QueryAsync(string barcodeNo, string wipNo - , string boxNo, string inhouseNo, string date_str, string date_end + , string boxNo, string inhouseNo, string date_str, string date_end ,string factoryID , string status, int page = 0, int limit = 10) { IResultModel result = await _fqcApi.GetFqcInhouseMasterQuery(barcodeNo: barcodeNo, wipNo: wipNo , boxNo: boxNo, inhouseNo: inhouseNo, date_str: date_str, date_end: date_end - , status: status, page: page, limit: limit); + , status: status, page: page, limit: limit , factoryID: factoryID); + await GetFactoryInfo(); if (result.Data.Count() != 0) { return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs b/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs index a9d3f2ef..84570491 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs @@ -452,11 +452,12 @@ namespace AMESCoreStudio.Web /// 抽驗結果 /// 頁數 /// 筆數 + /// 委外廠商 /// [WebApiClient.Attributes.HttpGet("api/FqcInhouseMaster/FqcInhouseMasterQuery")] ITask> GetFqcInhouseMasterQuery(string barcodeNo = null, string wipNo = null , string boxNo = null, string inhouseNo = null, string date_str = null, string date_end = null - , string status = null, int page = 0, int limit = 10); + , string status = null, int page = 0, int limit = 10 ,string factoryID = null); #endregion #region FQC009 料號檢驗工項維護 diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index a12313b9..caa9d066 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -444,9 +444,11 @@ layer.open({ title: '抽驗', type: 2, - area: ['600px', '600px'], + area: ['600px', '550px'], fixed: false, //不固定 - maxmin: true, + maxmin: false, + scrollbar: true, + moveOut:true, content: '/FQC/FQC007C?inhouseNo=@Model.h_InhouseNo&seq=@Model.h_SeqID' }); }); diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml index c2c2d48d..0781224a 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml @@ -19,7 +19,7 @@ diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml index 1f921d3c..70caa7bb 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml @@ -11,90 +11,86 @@
-
-
-
-
- - -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- - @Html.ValidationMessage("error") -
-
- -
-
-
+
+
+ + +
+ +
+ +
-
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + @Html.ValidationMessage("error") +
+
+ +
+
+
@section Scripts { @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); await Html.RenderPartialAsync("_FileinputScriptsPartial"); } - + } diff --git a/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml index 8ba73ceb..736287d6 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml @@ -4,9 +4,9 @@ } @@ -43,7 +43,19 @@
-
+
+
+ +
+ + +
+ +
+
+
@@ -51,7 +63,7 @@
-
+
@@ -59,7 +71,7 @@
-
+
@@ -125,8 +137,20 @@ , format: 'yyyy/MM/dd' , theme: 'grid' }); + + form.on('select(factory)', function (data) { + $("#factoryID").val(data.value); + //roleName = data.elem[data.elem.selectedIndex].text; + var qs = $('button[lay-filter="querysubmit"]'); + qs.click(); + + //hg.msghide("刷新数据!"); + //table && table.reload(); + }); }); + + //监听表单提交事件 hg.form.onsubmit('querysubmit', function (data) { hg.msghide("重新載入資料.."); @@ -135,7 +159,7 @@ var tableCols = [[ { - field: 'werks', + field: 'factoryNo', width: 80, title: '委外廠', sort: true @@ -155,8 +179,7 @@ { field: 'seqID', title: '順序', - width: 80, - sort: true + width: 60 }, { field: 'wipNo', @@ -170,9 +193,8 @@ }, { field: 'inhouseQty', - width: 80, - title: '批量', - sort: true + width: 60, + title: '批量' }, //{ // field: 'serialNo', @@ -193,15 +215,12 @@ }, { field: 'qaMeno', - title: '備註', + title: '備註' }, - , { - field: 'right', - width: 80, title: '操作', align: 'center', - fixed: 'right', + width: 75, templet: function (d) { return '修改' } @@ -228,5 +247,5 @@ {{ d.statusName }} {{# } }} - } +} } \ No newline at end of file diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index 3d182ad1..0780b8b8 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -90,20 +90,24 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES /// 抽驗結果 /// 頁數 /// 筆數 + /// 委外廠商ID /// [HttpGet("FqcInhouseMasterQuery")] public async Task> GetFqcInhouseMasterQuery(string barcodeNo, string wipNo, string boxNo - , string inhouseNo, string date_str, string date_end, string status, int page = 0, int limit = 10) + , string inhouseNo, string date_str, string date_end, string status, string factoryID, int page = 0, int limit = 10) { var q = from q1 in _context.FqcInhouseMasters //join q2 in _context.FqcInhouseDetails on new { q1.InhouseNo, q1.SeqID } equals new { q2.InhouseNo, q2.SeqID } join q3 in _context.FqcResultMasters on q1.InhouseNo equals q3.InhouseNo into j1 from q3 in j1.DefaultIfEmpty() join q4 in _context.WipInfos on q1.WipNo equals q4.WipNO into s - from q4 in s.DefaultIfEmpty() + from q4 in s.DefaultIfEmpty() + join q5 in _context.FactoryInfos on q4.Werks equals q5.FactoryID.ToString() into j2 + from q5 in j2.DefaultIfEmpty() select new FqcInhouseMasterDto { Werks = q4.Werks, + FactoryNo = q5.FactoryNo, InhouseNo = q1.InhouseNo, SeqID = q1.SeqID, WipNo = q1.WipNo, @@ -126,6 +130,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (!string.IsNullOrWhiteSpace(status)) q = q.Where(w => w.StatusName == status); + if (!string.IsNullOrWhiteSpace(factoryID)) + q = q.Where(w => w.Werks.ToString() == factoryID); + // 優先用內部序號取出包裝序號 if (!string.IsNullOrWhiteSpace(barcodeNo)) { @@ -154,7 +161,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES ResultModel result = new ResultModel(); - + // Table 頁數 if (page > 0) @@ -218,7 +225,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES CustomerNo = q4.CustomerNO, CustomerMedical = q4.CustomerMedical, CustomerVIP = q4.CustomerVIP, - Werk = q4.Werks+"-"+q5.FactoryNameCh, + Werk = q4.Werks + "-" + q5.FactoryNameCh, BIOS = q2.BIOS, CPU = q2.CPU, OS = q2.OS, @@ -229,7 +236,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES Proved = q2.Proved, Proved_Name = q7.UserName, UpdateUser = q8.UserNo, - UpdateUser_Name =q8.UserName + UpdateUser_Name = q8.UserName }; var query = await q.Distinct().ToListAsync(); diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs index 23a30e10..c19e9656 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs @@ -16,10 +16,16 @@ namespace AMESCoreStudio.WebApi.DTO.AMES public partial class FqcInhouseMasterDto { /// - /// 委外廠 + /// 委外廠ID /// [DataMember] - public string Werks { get; set; } + public string Werks { get; set; } + + /// + /// 委外廠No + /// + [DataMember] + public string FactoryNo { get; set; } /// /// 入庫單號碼