From 992fe380736be878d276fcc3cedd2ba4844ce02d Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 13 May 2022 17:27:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9FQC=E6=9F=A5=E8=A9=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FQCController.cs | 19 +++++ AMESCoreStudio.Web/Views/FQC/FQC008.cshtml | 80 +++++++++++-------- .../AMES/FqcInhouseMasterController.cs | 39 ++++----- .../DTO/AMES/FqcInhouseMasterDto.cs | 15 +++- 4 files changed, 100 insertions(+), 53 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index 58e4529a..c189e3af 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -934,5 +934,24 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } #endregion + + /// + /// 登入UserID + /// + /// + public int GetLogInUserID() + { + int user_id = -1; + HttpContext.Request.Cookies.TryGetValue("UserID", out string userID); + + if (userID != null) + { + if (int.Parse(userID.ToString()) >= 0) + { + user_id = int.Parse(userID.ToString()); + } + } + return user_id; + } } } diff --git a/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml index 71a1c6a1..0c63b3c2 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC008.cshtml @@ -23,6 +23,11 @@ border-color: #e6e6e6; margin: 10px 0; } + + .layui-table-cell { + height: auto; + white-space: normal; + } @@ -129,6 +134,18 @@ }); var tableCols = [[ + { + field: 'werks', + width: 80, + title: '委外廠', + sort: true + }, + { + field: 'createDate', + title: '入庫時間', + sort: true, + templet: '
{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd HH:mm:ss") }}
' + }, { field: 'inhouseNo', width: 150, @@ -138,6 +155,7 @@ { field: 'seqID', title: '順序', + width: 80, sort: true }, { @@ -151,16 +169,16 @@ sort: true }, { - field: 'createDate', - title: '入庫時間', - sort: true, - templet: '
{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd") }}
' - }, - { - field: 'serialNo', - title: '箱號', + field: 'inhouseQty', + width: 80, + title: '批量', sort: true }, + //{ + // field: 'serialNo', + // title: '箱號', + // sort: true + //}, { field: 'statusName', title: '檢驗狀態', @@ -173,32 +191,28 @@ sort: true, templet: '
{{ layui.util.toDateString(d.endTime, "yyyy/MM/dd") }}
' }, - //, - //{ - // field: 'right', - // width: 80, - // title: '操作', - // align: 'center', - // fixed: 'right', - // templet: function (d) { - // return '' - // } - //} + { + field: 'qaMeno', + title: '備註', + }, + , + { + field: 'right', + width: 80, + title: '操作', + align: 'center', + fixed: 'right', + templet: function (d) { + return '修改' + } + } ]]; - - //通过行tool编辑,lay-event="show" - function show(obj) { - layui.use('layer', function () { - var layer = layui.layer; - layer.open({ - type: 2, - area: ['900px', '650px'], - fixed: false, //不固定 - maxmin: true, - content: obj.data.filePath + obj.data.newName - }); - }); - }; + //通过行tool编辑,lay-event="edit" + function edit(obj) { + if (obj.data.wipID) { + hg.open('修改工單資料', '/PCS/PCS003/' + obj.data.wipID, '', '', true); + } + } //基本数据表格 var table = hg.table.datatable('query', 'FQC查詢', '/FQC/FQC008Query', {}, tableCols, '', true, 'full-100', ['filter', 'print', 'exports']); diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index a3059e2d..917de3b5 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -95,22 +95,25 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES 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) { - IQueryable 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 - select new FqcInhouseMasterDto - { - InhouseNo = q1.InhouseNo, - SeqID = q1.SeqID, - WipNo = q1.WipNo, - ItemNo = q1.ItemNo, - ModelNo = q1.ModelNo, - SerialNo = q2.SerialNo, - StatusName = q1.Status, - ProTypeName = q1.ProType, - CreateDate = q1.CreateDate, - EndTime = q3.EndTime - }; + 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 + join q4 in _context.WipInfos on q1.WipNo equals q4.WipNO into s + from q4 in s.DefaultIfEmpty() + select new FqcInhouseMasterDto + { + Werks = q4.Werks, + InhouseNo = q1.InhouseNo, + SeqID = q1.SeqID, + WipNo = q1.WipNo, + ItemNo = q1.ItemNo, + InhouseQty = q1.InhouseQty, + ModelNo = q1.ModelNo, + StatusName = q1.Status, + ProTypeName = q1.ProType, + CreateDate = q1.CreateDate, + EndTime = q3.EndTime + }; //q1.Status == "P" ? "允收" : q1.Status == "R" ? "批退" : "未驗收完成", //IQueryable q1 = _context.FqcInhouseDetails; if (!string.IsNullOrWhiteSpace(inhouseNo)) @@ -158,7 +161,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES { q = q.Skip((page - 1) * limit).Take(limit); } - result.Data = await q.ToListAsync(); + result.Data = await q.Distinct().ToListAsync(); // 判斷結束時間 result.Data = result.Data.Select(s => { s.EndTime = s.StatusName == "A" ? null : s.EndTime; return s; }) @@ -277,7 +280,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task> PostFqcInhouseMaster(FqcInhouseMaster fqcInhouseMaster) { ResultModel result = new ResultModel(); - + try { _context.FqcInhouseMasters.Add(fqcInhouseMaster); diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs index 360be4e7..23a30e10 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs @@ -15,6 +15,12 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// public partial class FqcInhouseMasterDto { + /// + /// 委外廠 + /// + [DataMember] + public string Werks { get; set; } + /// /// 入庫單號碼 /// @@ -49,6 +55,13 @@ namespace AMESCoreStudio.WebApi.DTO.AMES [Display(Name = "品名/機種")] public string ModelNo { get; set; } + /// + /// 批量 + /// + [DataMember] + [Display(Name = "批量")] + public int InhouseQty { get; set; } + /// /// 箱號/條碼 /// @@ -61,7 +74,6 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// [DataMember] [Display(Name = "抽驗狀態")] - public string StatusName { get; set; } = "A"; /// @@ -77,7 +89,6 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// [DataMember] [Display(Name = "結束抽驗時間")] - public DateTime? EndTime { get; set; } ///