From d904ff8eabc27f101ab1be81f0d26e4777652970 Mon Sep 17 00:00:00 2001 From: Sai Date: Wed, 31 Jan 2024 16:50:41 +0800 Subject: [PATCH 1/7] =?UTF-8?q?1.=20FQC=E6=AA=A2=E9=A9=97-=E5=8A=A0?= =?UTF-8?q?=E5=85=A5FQC=E6=8A=BD=E9=A9=97=E7=BE=A4=E7=B5=84=EF=BC=8CFQC?= =?UTF-8?q?=E6=8A=BD=E9=A9=97=E6=99=82=E5=B0=87=E6=AA=A2=E9=A9=97=E9=A0=85?= =?UTF-8?q?=E7=9B=AE=E7=B5=B1=E4=B8=80=E5=AF=AB=E5=85=A5WIP=5FFQCITEM?= =?UTF-8?q?=EF=BC=8C=E6=8A=BD=E9=A9=97=E6=99=82=E5=85=88=E5=88=A4=E6=96=B7?= =?UTF-8?q?=E8=B3=87=E6=96=99=E6=98=AF=E5=90=A6=E6=AD=A3=E7=A2=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FQCController.cs | 456 ++++++++++++++++-- AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs | 154 +++++- AMESCoreStudio.Web/Views/FQC/FQC007.cshtml | 3 +- AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml | 5 +- AMESCoreStudio.Web/Views/FQC/FQC007V.cshtml | 6 +- AMESCoreStudio.Web/Views/FQC/FQC008.cshtml | 82 ++-- .../AMES/FqcInhouseDetailController.cs | 144 +++--- .../AMES/FqcInhouseMasterController.cs | 99 +++- .../Controllers/AMES/FqcItemController.cs | 146 +++--- .../AMES/FqcItemGroupController.cs | 196 ++++++++ .../AMES/FqcItemGroupMaterialController.cs | 159 ++++++ .../AMES/FqcResultMasterController.cs | 33 ++ .../AMES/MaterialItemController.cs | 14 +- .../Controllers/AMES/QcItemController.cs | 41 +- .../Controllers/AMES/WipFqcItemController.cs | 55 +++ AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs | 10 +- .../DTO/AMES/FqcResultDto.cs | 2 +- AMESCoreStudio.WebApi/Models/AMES/FqcItem.cs | 40 +- AMESCoreStudio.WebApi/Models/AMESContext.cs | 23 +- 19 files changed, 1408 insertions(+), 260 deletions(-) create mode 100644 AMESCoreStudio.WebApi/Controllers/AMES/FqcItemGroupController.cs create mode 100644 AMESCoreStudio.WebApi/Controllers/AMES/FqcItemGroupMaterialController.cs diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index 0ac82978..c0ea02d1 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -1,28 +1,23 @@ -using Microsoft.AspNetCore.Mvc; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; +using AMESCoreStudio.CommonTools.Result; using AMESCoreStudio.Web.Models; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using AMESCoreStudio.WebApi; -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc.Rendering; +using AMESCoreStudio.WebApi.DTO.AMES; +using AMESCoreStudio.WebApi.Enum; using AMESCoreStudio.WebApi.Models.AMES; using AMESCoreStudio.WebApi.Models.BAS; -using AMESCoreStudio.Web.ViewModels; -using AMESCoreStudio.Web.ViewModels.PCS; -using AMESCoreStudio.WebApi.DTO.AMES; -using System.Linq; -using AMESCoreStudio.CommonTools.Result; -using System; -using System.IO; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Hosting; -using System.ComponentModel.DataAnnotations; using AspNetCore.Reporting; -using System.Text.Encodings; -using AMESCoreStudio.WebApi.Enum; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.StaticFiles; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; namespace AMESCoreStudio.Web.Controllers { @@ -843,11 +838,24 @@ namespace AMESCoreStudio.Web.Controllers var result_WipFQC = await _fqcApi.GetWipFqcItemByWipNo(model.WipNo); if (result_WipFQC.Count == 0) { - //工單無設定檢驗工項時 在抓料號綁定檢驗工項 - var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(model.ItemNo); - if (result_MaterialFQC.Count != 0) + // 2024/02/01 切換判斷 + if (model.CreateDate < new DateTime(2024, 2, 1)) { - model.qcItemDtos = result_QcItem.Data.Where(w => result_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList(); + //工單無設定檢驗工項時 在抓料號綁定檢驗工項 + var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(model.ItemNo); + if (result_MaterialFQC.Count != 0) + { + model.qcItemDtos = result_QcItem.Data.Where(w => result_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList(); + } + } + else + { + // 改抓FQC設定群組內綁定的料號取 FQC設定群組項目 + var result_FqcItem = await _fqcApi.GetFqcItemByItemNo(model.ItemNo); + if (result_FqcItem.Count != 0) + { + model.qcItemDtos = result_QcItem.Data.Where(w => result_FqcItem.Select(s => s.QcItemId).Contains(w.ItemID)).ToList(); + } } } else @@ -960,11 +968,24 @@ namespace AMESCoreStudio.Web.Controllers var result_WipFQC = await _fqcApi.GetWipFqcItemByWipNo(model.WipNo); if (result_WipFQC.Count == 0) { - //工單無設定檢驗工項時 在抓料號綁定檢驗工項 - var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(model.ItemNo); - if (result_MaterialFQC.Count != 0) + // 2024/02/01 切換判斷 + if (model.CreateDate < new DateTime(2024, 2, 1)) + { + //工單無設定檢驗工項時 在抓料號綁定檢驗工項 + var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(model.ItemNo); + if (result_MaterialFQC.Count != 0) + { + model.qcItemDtos = result_QcItem.Data.Where(w => result_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList(); + } + } + else { - model.qcItemDtos = result_QcItem.Data.Where(w => result_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList(); + // 改抓FQC設定群組內綁定的料號取 FQC設定群組項目 + var result_FqcItem = await _fqcApi.GetFqcItemByItemNo(model.ItemNo); + if (result_FqcItem.Count != 0) + { + model.qcItemDtos = result_QcItem.Data.Where(w => result_FqcItem.Select(s => s.QcItemId).Contains(w.ItemID)).ToList(); + } } } else @@ -981,6 +1002,20 @@ namespace AMESCoreStudio.Web.Controllers return View(model); } + /// + /// 確認是否可以開立FQC檢驗單 + /// + /// 入庫單號碼 + /// 工單號碼 + /// 序號 + /// + [HttpPost] + public async Task CheckFqcIssue(string inhouseNo, string wipNo, int seqID = 0) + { + var result = await _fqcApi.CheckFqcIssue(inhouseNo, wipNo, seqID); + return Json(new Result() { success = result.Success, msg = result.Msg, data = null }); + } + [HttpPost] public async Task FQC007AjaxJson(FqcDto model) { @@ -1302,11 +1337,24 @@ namespace AMESCoreStudio.Web.Controllers var qcItemDtos = new List(); if (result_WipFQC.Count == 0) { - //工單無設定檢驗工項時 在抓料號綁定檢驗工項 - var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(fqcItem.ItemNo); - if (result_MaterialFQC.Count != 0) + // 2024/02/01 切換判斷 + if (model.CreateDate < new DateTime(2024, 2, 1)) + { + //工單無設定檢驗工項時 在抓料號綁定檢驗工項 + 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_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList(); + // 改抓FQC設定群組內綁定的料號取 FQC設定群組項目 + var result_FqcItem = await _fqcApi.GetFqcItemByItemNo(fqcItem.ItemNo); + if (result_FqcItem.Count != 0) + { + qcItemDtos = result_QcItem.Data.Where(w => result_FqcItem.Select(s => s.QcItemId).Contains(w.ItemID)).ToList(); + } } } else @@ -1336,8 +1384,6 @@ namespace AMESCoreStudio.Web.Controllers if (model.QaResult == "P" && string.IsNullOrWhiteSpace(model.SpecialPo)) { return Json(new { data = "請輸入特採單號", success = false }); - //ModelState.AddModelError("error", "請輸入特採單號"); - //return View("FQC007B", model); } } @@ -1350,16 +1396,12 @@ namespace AMESCoreStudio.Web.Controllers if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.InhouseQty && model.QaResult == "P") { return Json(new { data = "抽樣數量不足,不可判定允收", success = false }); - //ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); - //return View("FQC007B", model); } } //當抽驗數量 小於 抽樣數量就離開 else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty && model.QaResult == "P") { return Json(new { data = "抽樣數量不足,不可判定允收", success = false }); - //ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); - //return View("FQC007B", model); } } } @@ -1385,6 +1427,9 @@ namespace AMESCoreStudio.Web.Controllers result = await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(fqcResultMaster)); if (result.Success) { + // 抽驗時,判斷檢驗項目是否有建立 + await _fqcApi.PostWipFqcItemByWipNo(fqcItem.WipNo); + // 允收且不是無序號供單需要FQC過站 if (model.QaResult == "P" && fqcItem.InspectionStatus != "D") result = await _fqcApi.PassingByFQC(model.InhouseNo, model.SeqID, GetLogInUserID()); @@ -1393,6 +1438,11 @@ namespace AMESCoreStudio.Web.Controllers { await _fqcApi.PostSMS_CAR_FQC(JsonConvert.SerializeObject(fqcResultMaster)); } + // 執行判斷無序號工單檢驗完成 + else if (model.QaResult == "P" && fqcItem.InspectionStatus == "D") + { + await _fqcApi.GetFqcExecuteWithoutWipNoComplete(fqcItem.WipNo); + } if (!result.Success) { @@ -1617,9 +1667,27 @@ namespace AMESCoreStudio.Web.Controllers } [HttpGet] - public async Task FQC007AItemQuery(string wipNo, string itemNo) + public async Task FQC007AItemQuery(string wipNo, string itemNo, DateTime createDate) { - var result = await _fqcApi.GetQcItemQuery(0, 0, 0, itemNo, wipNo); + // 2024/02/01 切換判斷 + var result = new ResultModel(); + if (createDate < new DateTime(2024, 2, 1)) + { + result = await _fqcApi.GetQcItemQuery(0, 0, 0, itemNo, wipNo); + } + else + { + var item = await _pcsApi.GetMaterialItemByItemNO(itemNo); + if (item != null) + { + var fqcGroupId = await _fqcApi.GetFqcItemGroupMaterialByItemId(item.ItemID); + if (fqcGroupId.Any()) + { + result = await _fqcApi.GetQcItemQuery(0, 0, 0, wipNo: wipNo, + fqcItemGroupId: fqcGroupId.FirstOrDefault().GroupId); + } + } + } return Json(new Table() { code = 0, data = result.Data, count = result.DataTotal }); } @@ -1898,7 +1966,7 @@ namespace AMESCoreStudio.Web.Controllers #endregion #region FQC010 報表 - public async Task FQC010_PDF(string inhouseNo, int seqID) + public IActionResult FQC010_PDF(string inhouseNo, int seqID) { string mimeType = ""; int extension = 1; @@ -1908,7 +1976,7 @@ namespace AMESCoreStudio.Web.Controllers return File(result.MainStream, "application/pdf"); } - public async Task FQC010_Excel(string inhouseNo, int seqID) + public IActionResult FQC010_Excel(string inhouseNo, int seqID) { string mimeType = ""; int extension = 1; @@ -1990,10 +2058,11 @@ namespace AMESCoreStudio.Web.Controllers var result_WipFQC = await _fqcApi.GetWipFqcItemByWipNo(FqcQuery.WipNo); if (result_WipFQC.Count == 0) { - //工單無設定檢驗工項時 在抓料號綁定檢驗工項 - var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(FqcQuery.ItemNo); - if (result_MaterialFQC.Count != 0) + // 2024/02/01 切換判斷 + if (FqcQuery.CreateDate < new DateTime(2024, 2, 1)) { + //工單無設定檢驗工項時 在抓料號綁定檢驗工項 + var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(FqcQuery.ItemNo); // 檢驗工項 foreach (var item in result_QcItem.Data.Where(w => result_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList()) { @@ -2005,6 +2074,20 @@ namespace AMESCoreStudio.Web.Controllers }); } } + else + { + // 改抓FQC設定群組內綁定的料號取 FQC設定群組項目 + var result_FqcItem = await _fqcApi.GetFqcItemByItemNo(FqcQuery.ItemNo); + foreach (var item in result_QcItem.Data.Where(w => result_FqcItem.Select(s => s.QcItemId).Contains(w.ItemID)).ToList()) + { + FQC010Master.Detail1.Add(new FQC010Detail1 + { + ItemID = item.ItemID.ToString(), + ItemName = item.ItemNameEN, + ItemType = item.ItemTypeName + }); + } + } } else { @@ -2280,6 +2363,289 @@ namespace AMESCoreStudio.Web.Controllers } #endregion + #region FQC013 檢驗項目群組名稱維護 + public IActionResult FQC013() + { + return View(); + } + + //新增頁面 + public IActionResult FQC013C() + { + return View(); + } + + //修改页面 + [HttpGet] + public async Task FQC013U(int id) + { + var result = await _fqcApi.GetFqcItemGroups(id); + return View(result); + } + + /// + /// 刪除 + /// + /// + /// + public async Task FQC013D(int id) + { + var result = await _fqcApi.DeleteFqcItemGroup(id); + return Json(new Result() { success = result.Success, msg = result.Msg }); + } + + //頁面提交,id=0 添加,id>0 修改 + [HttpPost] + public async Task FQC013Async(FqcItemGroup model) + { + IResultModel result; + // 判斷是否有重複的群組代號 + var checkData = await _fqcApi.GetFqcItemGroupQuery(no: model.ItemGroupNo); + if (checkData.Data.Any(w => w.ItemGroupNo == model.ItemGroupNo)) + { + // 新增 群組 + if (model.FqcItemGroupId == 0) + { + ModelState.AddModelError("error", "已有建立相同的群組代號,請在確認"); + return View("FQC013C", model); + } + // 修改 群組 + else if (checkData.Data.Any(w => w.ItemGroupNo == model.ItemGroupNo && w.FqcItemGroupId != model.FqcItemGroupId)) + { + ModelState.AddModelError("error", "已有建立相同的群組代號,請在確認"); + return View("FQC013U", model); + } + } + + if (ModelState.IsValid) + { + if (model.FqcItemGroupId == 0) + { + model.CreateUserID = GetLogInUserID(); + result = await _fqcApi.PostFqcItemGroup(JsonConvert.SerializeObject(model)); + } + else + { + model.UpdateUserID = GetLogInUserID(); + result = await _fqcApi.PutFqcItemGroup(JsonConvert.SerializeObject(model)); + } + + if (result.Success) + { + var _msg = model.FqcItemGroupId == 0 ? "新增成功!" : "修改成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + ModelState.AddModelError("error", result.Msg); + } + } + + if (model.FqcItemGroupId == 0) + { + return View("FQC013C", model); + } + return View("FQC013U", model); + } + + /// + /// FQC檢驗項目群組名稱設定檔 By Query + /// + /// 群組代號 + /// 群組名稱 + /// 群組描述 + /// 料號 + /// 頁數 + /// 筆數 + /// + [HttpGet] + public async Task FQC013Query(string no, + string name, + string desc, + string itemNo, + int page = 0, + int limit = 10) + { + var result = await _fqcApi.GetFqcItemGroupQuery(no, name, desc, itemNo, page, limit); + + if (result.Data.Count() != 0) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } + + return Json(new Table() { count = 0, data = null }); + } + + #region FQC013A FQC群組綁設定檢驗工項維護 + + public async Task FQC013A(int fqcItemGroupId = 0) + { + var result = await _fqcApi.GetFqcItemGroups(fqcItemGroupId); + if (result != null) + { + ViewBag.GroupNo = result.ItemGroupNo; + ViewBag.GroupName = result.ItemGroupName; + } + ViewBag.GroupId = fqcItemGroupId; + return View(); + } + + /// + /// 查詢 FQC檢驗群組綁定工項 + /// + /// + /// + /// + /// + public async Task FQC013A_Query(int fqcItemGroupId = 0, int page = 0, int limit = 1) + { + var result = await _fqcApi.GetQcItemQuery(0, 0, limit, fqcItemGroupId: fqcItemGroupId); + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } + + [HttpPost] + public async Task FQC013A_Submit(string itemID, string groupID, int fqcItemGroupId) + { + // 取料號綁定檢驗工項 + var result_FqcItem = await _fqcApi.GetFqcItemByFqcGroupId(fqcItemGroupId); + // 有勾選的ItemID + var checkItemID = itemID.Split(',').ToList(); + // 有勾選的GroupID + var checkGroupID = groupID.Split(',').ToList(); + + // 取勾選有的 = 新增 + var insertItemID = checkItemID.Except(result_FqcItem.Select(s => s.QcItemId.ToString())); + for (int i = 0; i < checkItemID.Count; i++) + { + if (insertItemID.Where(w => w == checkItemID[i]).Any()) + { + FqcItem FqcItem = new FqcItem + { + GroupId = fqcItemGroupId, + QcItemId = Int32.Parse(checkItemID[i]), + QcGroupId = Int32.Parse(checkGroupID[i]), + CreateUserID = GetLogInUserID(), + CreateDate = DateTime.Now, + UpdateUserID = GetLogInUserID(), + UpdateDate = DateTime.Now + }; + await _fqcApi.PostFqcItem(JsonConvert.SerializeObject(FqcItem)); + } + } + + // 取有料號綁定 = 需要刪除 + var deteleItemID = result_FqcItem.Select(s => s.QcItemId.ToString()).Except(checkItemID); + foreach (var item in deteleItemID) + { + var FqcItemId = result_FqcItem.Where(w => w.QcItemId == Int32.Parse(item)).FirstOrDefault().FqcItemId; + await _fqcApi.DeleteFqcItem(FqcItemId); + } + + return Json(new { code = 0, msg = "", success = true }); + } + + #endregion + + #region FQC013B FQC群組綁定料號 + + public async Task FQC013B(int groupId = 0) + { + var result = await _fqcApi.GetFqcItemGroups(groupId); + if (result != null) + { + ViewBag.GroupNo = result.ItemGroupNo; + ViewBag.GroupName = result.ItemGroupName; + } + ViewBag.GroupId = groupId; + return View(); + } + + /// + /// 查詢 FQC檢驗群組綁定工項 + /// + /// + /// + /// + /// + public async Task FQC013B_Query(int groupId) + { + var result = await _fqcApi.GetFqcItemGroupMaterialByGroupId(groupId); + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count() }); + } + + /// + /// 新增料號 + /// + /// 群組ID + /// 料號 + /// + [HttpPost] + public async Task FQC013B_addMaterial(int groupId, string materialNo) + { + var msg = string.Empty; + var result = await _fqcApi.GetMaterialItemByItemNO(materialNo); + if (result == null) + { + msg = $"在料號主檔找不到該筆料號【{materialNo}】"; + return Json(new { code = 0, msg, success = false }); + } + else + { + var check = await _fqcApi.GetFqcItemGroupMaterialByItemId(result.ItemID); + if (check.Any()) + { + msg = $"該筆料號【{materialNo}】已有在群組綁定了,請在確認"; + return Json(new { code = 0, msg, success = false }); + } + } + + var model = new FqcItemGroupMaterial + { + GroupId = groupId, + ItemId = result.ItemID, + CreateUserID = GetLogInUserID(), + CreateDate = DateTime.Now, + UpdateUserID = GetLogInUserID(), + UpdateDate = DateTime.Now + }; + + await _fqcApi.PostFqcItemGroupMaterial(JsonConvert.SerializeObject(model)); + return Json(new { code = 0, msg = "綁定成功", success = true }); + } + + /// + /// FQC檢驗群組刪除綁定料號 + /// + /// FQC檢驗群組ID + /// 料號ID + /// + [HttpPost] + public async Task FQC013B_Delete(int groupId, int itemId) + { + // 取料號綁定檢驗工項 + var result = await _fqcApi.DeleteFqcItemGroupMaterial(groupId, itemId); + if (result == 1) + return Json(new { code = 0, msg = "", success = true }); + else + return Json(new { code = 0, msg = "", success = false }); + } + + /// + /// 回傳PLM料號品名_AutoComplete + /// + /// + /// + [HttpPost] + public async Task GetMeterialItemAutoComplete(string search) + { + var result = await _fqcApi.GetMeterialAutoComplete(search); + return Json(new { data = result }); + } + + #endregion + + #endregion + /// /// 登入UserID /// diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs b/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs index 206ab056..6192f13b 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs @@ -81,9 +81,10 @@ namespace AMESCoreStudio.Web /// 比數 /// 料號 /// 工單號碼 + /// FQC檢驗設定群組 /// [WebApiClient.Attributes.HttpGet("api/QcItem/QcItemQuery")] - ITask> GetQcItemQuery(int groupID, int page, int limit, string itemNo = null, string wipNo = null); + ITask> GetQcItemQuery(int groupID, int page, int limit, string itemNo = null, string wipNo = null ,int fqcItemGroupId = 0) ; /// /// 查詢檢驗項目維護 ID @@ -411,7 +412,6 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/FqcResultDetail/{id}")] ITask> GetFqcResultDetail(int id); - /// /// 用id取檢驗單結果 /// @@ -462,6 +462,13 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpDelete("api/WipFqcItem/{id}")] ITask> DeleteWipFqcItem(int id); + /// + /// FqcItem 查詢料號對應設定群組綁定檢驗工項 + /// + /// 料號 + [WebApiClient.Attributes.HttpGet("api/FqcItem/ByItemNo/{id}")] + ITask> GetFqcItemByItemNo(string id); + /// /// FQC抽驗過站 /// @@ -526,6 +533,28 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpDelete("api/FqcResultMasterBlob/ByFileName")] ITask> DeleteFqcResultMasterBlob(int fqcId, string fileName); + /// + /// 執行判斷無序號工單檢驗完成 + /// + /// + [WebApiClient.Attributes.HttpGet("api/FqcResultMaster/ExecuteWithoutWipNoComplete/{id}")] + ITask GetFqcExecuteWithoutWipNoComplete(string id); + + /// + /// 確認FQC抽驗時,箱號是否已經跑到FQC流程 + /// + /// 入庫單號 + /// 工單號碼 + /// 順序 + /// + [WebApiClient.Attributes.HttpGet("api/FqcInhouseMaster/CheckFqcIssue")] + ITask> CheckFqcIssue(string inhouseNo, string wipNo , int seqID); + + /// + /// WipFqcItemByWipNo 新增工單綁定檢驗工項,抽驗時判斷沒有資料就新增預設 + /// + [WebApiClient.Attributes.HttpPost("api/WipFqcItem/ByWipNo/{wipNo}")] + ITask> PostWipFqcItemByWipNo(string wipNo); #endregion #region FQC008 FQC查詢 @@ -627,7 +656,7 @@ namespace AMESCoreStudio.Web /// [WebApiClient.Attributes.HttpDelete("api/FqcInhouseMaster/{no}/{seq}")] ITask> DeleteFqcInhouseMaster(string no, int seq); - + /// /// 刪除FQC 表身 @@ -637,5 +666,124 @@ namespace AMESCoreStudio.Web ITask> DeleteFqcInhouseDetail(string no, int seq); #endregion + + #region FQC013 檢驗項目群組相關維護 + /// + /// FqcItem 新增檢驗項目群組綁定設定檔 + /// + /// + [WebApiClient.Attributes.HttpPost("api/FqcItem")] + ITask> PostFqcItem([FromBody, RawJsonContent] string model); + + /// + /// FqcItem 更新檢驗項目群組綁定設定檔 + /// + /// + [WebApiClient.Attributes.HttpPut("api/FqcItem")] + ITask> PutFqcItem([FromBody, RawJsonContent] string model); + + /// + /// FqcItem 刪除檢驗項目群組綁定設定檔 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/FqcItem/{id}")] + ITask> DeleteFqcItem(int id); + + /// + /// FqcItem 查詢 ByFqcGroupId + /// + /// FqcGroupId + [WebApiClient.Attributes.HttpGet("api/FqcItem/ByFqcGroupId/{id}")] + ITask> GetFqcItemByFqcGroupId(int id); + + /// + /// FqcItemGroup 查詢FQC檢驗項目群組名稱設定檔 By ID + /// + /// + [WebApiClient.Attributes.HttpGet("api/FqcItemGroup/{id}")] + ITask GetFqcItemGroups(int id); + + /// + /// FqcItemGroup 新增FQC檢驗項目群組名稱設定檔 + /// + /// + [WebApiClient.Attributes.HttpPost("api/FqcItemGroup")] + ITask> PostFqcItemGroup([FromBody, RawJsonContent] string model); + + /// + /// FqcItemGroup 更新FQC檢驗項目群組名稱設定檔 + /// + /// + [WebApiClient.Attributes.HttpPut("api/FqcItemGroup")] + ITask> PutFqcItemGroup([FromBody, RawJsonContent] string model); + + /// + /// FqcItemGroup 刪除FQC檢驗項目群組名稱設定檔 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/FqcItemGroup/{id}")] + ITask> DeleteFqcItemGroup(int id); + + /// + /// FQC檢驗項目群組名稱設定檔 By Query + /// + /// 群組代號 + /// 群組名稱 + /// 群組描述 + /// 料號 + /// 頁數 + /// 筆數 + /// + [WebApiClient.Attributes.HttpGet("api/FqcItemGroup/FqcItemGroupQuery")] + ITask> GetFqcItemGroupQuery(string no = null, + string name = null, + string desc = null, + string itemNo = null, + int page = 0, + int limit = 10); + + /// + /// 新增 檢驗群組指定料號設定檔 + /// + /// + [WebApiClient.Attributes.HttpPost("api/FqcItemGroupMaterial")] + ITask> PostFqcItemGroupMaterial([FromBody, RawJsonContent] string model); + + /// + /// 更新 檢驗群組指定料號設定檔 + /// + /// + [WebApiClient.Attributes.HttpPut("api/FqcItemGroupMaterial")] + ITask> PutFqcItemGroupMaterial([FromBody, RawJsonContent] string model); + + /// + /// FqcItemGroupMaterial 查詢檢驗群組指定料號設定檔 By GroupId + /// + /// + [WebApiClient.Attributes.HttpGet("api/FqcItemGroupMaterial/ByGroupId/{id}")] + ITask> GetFqcItemGroupMaterialByGroupId(int id); + + /// + /// FqcItemGroupMaterial 查詢檢驗群組指定料號設定檔 By ItemId + /// + /// + [WebApiClient.Attributes.HttpGet("api/FqcItemGroupMaterial/ByItemId/{id}")] + ITask> GetFqcItemGroupMaterialByItemId(int id); + + /// + /// 刪除 檢驗群組指定料號設定檔 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/FqcItemGroupMaterial/{id}/{id1}")] + ITask DeleteFqcItemGroupMaterial(int id, int id1); + + /// + /// 查詢料號_AutoComplete + /// + /// 料號 + /// + [WebApiClient.Attributes.HttpGet("api/MaterialItem/AutoComplete/{id}")] + ITask> GetMeterialAutoComplete(string id); + #endregion } } diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index 0c8c242d..36d07e6a 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -64,6 +64,7 @@ +
@@ -691,7 +692,7 @@ area: ['700px', '500px'], fixed: false, //不固定 maxmin: true, - content: '/FQC/FQC007A?wipNo=@Model.WipNo&itemNo=@Model.ItemNo', + content: '/FQC/FQC007A?wipNo=@Model.WipNo&itemNo=@Model.ItemNo&createDate=@Model.CreateDate.ToShortDateString()', end: function () { window.location.reload(); } diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml index 84ba9017..183a2aa6 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007A.cshtml @@ -14,6 +14,7 @@
+
@@ -31,7 +32,7 @@ } +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml new file mode 100644 index 00000000..bc51d525 --- /dev/null +++ b/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml @@ -0,0 +1,448 @@ +@model AMESCoreStudio.WebApi.Models.AMES.LabelTemplateMaster + +@{ + ViewData["Title"] = "Label料號參數新增"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+ + + + + + +
+
+ + + +
+
+ +
+
+ + + +
+
+
+
+ +
+
+ +
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ +
+
+ +
+ @*
+ + +
*@ + @*
+ + +
*@ +
+ +
+ + +
+
+
+
+ @Html.ValidationMessage("error") + +
+ +
+
+
+
+
+ +
+ +
+
+
+ +@*備註*@ + +@section Scripts{ + +} + diff --git a/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml new file mode 100644 index 00000000..96f521e7 --- /dev/null +++ b/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml @@ -0,0 +1,367 @@ +@model AMESCoreStudio.WebApi.Models.AMES.LabelTemplateMaster + + +@{ + ViewData["Title"] = "Label料號參數修改"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+ + + + + +
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+ +
+ +
+ + 上架中 +
+ +
+ + 未上架 +
+
+
+
+
+ @Html.ValidationMessage("error") + +
+ +
+
+ + +
+ +
+
+
+ +
+
+
+
+
+ +@*備註*@ + +@section Scripts{ + +} + diff --git a/AMESCoreStudio.Web/Views/LAB/LAB002V.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB002V.cshtml new file mode 100644 index 00000000..348b1d6b --- /dev/null +++ b/AMESCoreStudio.Web/Views/LAB/LAB002V.cshtml @@ -0,0 +1,163 @@ +@model AMESCoreStudio.WebApi.Models.AMES.LabelTemplateMaster + + +@{ + ViewData["Title"] = "Label料號參數修改"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+ + + + + + +
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+ +
+ +
+ + 上架中 +
+ +
+ + 未上架 +
+
+
+
+
+
+ +
+
+
+ @*
*@ +
+
+ +@*備註*@ + +@section Scripts{ + +} + diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs index a3371c6c..9d12324d 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/LabelParamController.cs @@ -145,7 +145,37 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return LabelParam; } + //// GET: api/LabelTemplateDetail/5 + [HttpGet("byMulti/{id}")] + public async Task>> GetLabelParambyTemplateIDMulti(int id) + { + + var query = from p in _context.LabelParam.Where(w => w.STATUS_NO == "Y") + select new + { + p.LABEL_FIELD_ID, + p.LABEL_FIELD_NAME, + DATA = "0" + }; + if (id != 0) + { + query = from p in _context.LabelParam.Where(w => w.STATUS_NO == "Y") + join d in _context.LabelTemplateDetail.Where(w => w.TEMPLATE_ID == id) + on new { p.LABEL_FIELD_ID } equals new { d.LABEL_FIELD_ID } into joined + from sub in joined.DefaultIfEmpty() + select new + { + p.LABEL_FIELD_ID, + p.LABEL_FIELD_NAME, + DATA = sub == null ? "0" : "1" + }; + } + // 执行查询 + var result = query.ToList(); + return result; + + } private bool LabelParamExists(int id) { return _context.LabelParam.Any(e => e.LABEL_FIELD_ID == id); diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateDetailController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateDetailController.cs index 55015abf..f399c613 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateDetailController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateDetailController.cs @@ -36,36 +36,19 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES [HttpGet("{id}")] public async Task>> GetLabelTemplateDetail(int id) { - var labelTemplateDetail = await _context.LabelTemplateDetail.Where(w=>w.TEMPLATE_ID == id).ToListAsync(); + IQueryable q = _context.LabelTemplateDetail; + q = q.Where(p => p.TEMPLATE_ID.Equals(id)); + var LabelTemplatedetail = await q.ToListAsync(); - return labelTemplateDetail; - } - - //// GET: api/LabelTemplateDetail/5 - //[HttpGet("byTemplateIDMulti/{id}")] - //public async Task>> GetLabelTemplateDetailbyTemplateIDMulti(int id) - //{ - // var q = from p in _context.LabelParam - // join d in _context.LabelTemplateDetail - // on new { p.LABEL_FIELD_ID, TemplateID = id } equals new { d.LABEL_FIELD_ID, d.TEMPLATE_ID } into d1 - // from subd in d1.DefaultIfEmpty() - // where p.StatusNo == "Y" - // select new - // { - // LabelFieldID = p.LabelFieldID, - // LabelFieldName = p.LabelFieldName, - // ParamName = p.ParamName, - // TemplateID = subd != null ? 1 : 0 //有此欄位則顯示為1 沒有就為0 - // }; - - - - // var query = await q.ToListAsync(); - - // return query; - //} + if (LabelTemplatedetail == null) + { + return NotFound(); + } + return LabelTemplatedetail; + } + /// /// 更新Label參數檔 /// @@ -108,8 +91,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES try { - Helper helper = new Helper(_context); - LabelTemplateDetail.TEMPLATE_ID = helper.GetIDKey("TEMPLATE_ID").Result; + _context.LabelTemplateDetail.Add(LabelTemplateDetail); await _context.SaveChangesAsync(); result.Success = true; @@ -125,18 +107,24 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES // DELETE: api/LabelTemplateDetail/5 [HttpDelete("{id}")] - public async Task> DeleteLabelTemplateDetail(int id) + public async Task> DeleteLabelTemplateDetail(int id) { - var LabelTemplateDetail = await _context.LabelTemplateDetail.FindAsync(id); - if (LabelTemplateDetail == null) + + ResultModel result = new ResultModel(); + var query = await _context.LabelTemplateDetail.Where(w => w.TEMPLATE_ID == id).ToListAsync(); + try { - return NotFound(); + _context.LabelTemplateDetail.RemoveRange(query); + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; } - - _context.LabelTemplateDetail.Remove(LabelTemplateDetail); - await _context.SaveChangesAsync(); - - return LabelTemplateDetail; + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.InnerException.Message; + } + return result; } private bool LabelTemplateDetailExists(int id) diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateMasterController.cs index cb60fe2a..a7c8ba58 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/LabelTemplateMasterController.cs @@ -59,10 +59,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES ResultModel result = new ResultModel(); _context.Entry(LabelTemplateMaster).State = EntityState.Modified; //設置容器空間某一個模型的某一個欄位 不提交到資料庫 - _context.Entry(LabelTemplateMaster).Property("CreateDate").IsModified = false; - _context.Entry(LabelTemplateMaster).Property("CreateUserID").IsModified = false; - LabelTemplateMaster.UPDATE_DATE = DateTime.Now; - LabelTemplateMaster.UPDATE_USERID = 0; + _context.Entry(LabelTemplateMaster).Property("CREATE_DATE").IsModified = false; + _context.Entry(LabelTemplateMaster).Property("CREATE_USERID").IsModified = false; try { @@ -90,12 +88,22 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES try { - Helper helper = new Helper(_context); - LabelTemplateMaster.TEMPLATE_ID = helper.GetIDKey("TEMPLATE_ID").Result; - _context.LabelTemplateMaster.Add(LabelTemplateMaster); - await _context.SaveChangesAsync(); - result.Success = true; - result.Msg = "OK"; + IQueryable q = _context.LabelTemplateMaster; + q=q.Where(w => w.LABEL_MATNR.Equals(LabelTemplateMaster.LABEL_MATNR)); + if (q.Count() == 0) + { + Helper helper = new Helper(_context); + LabelTemplateMaster.TEMPLATE_ID = helper.GetIDKey("TEMPLATE_ID").Result; + _context.LabelTemplateMaster.Add(LabelTemplateMaster); + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = LabelTemplateMaster.TEMPLATE_ID.ToString(); + } + else { + + result.Success = false; + result.Msg = "Label料號已新增"; + } } catch (Exception ex) { @@ -122,23 +130,19 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } // GET: api/LabelTemplateMaster/5 - [HttpGet("LabelTemplatebyMatnr/{LabelMatnr}/{Status}")] - public async Task>> GetLabelTemplatebyMatnr(string LabelMatnr, string Status, int page = 0, int limit = 10) + [HttpGet("byMatnr")] + public async Task> GetLabelTemplatebyMatnr(string LabelMatnr, int page = 0, int limit = 10) { - + ResultModel result = new ResultModel(); + IQueryable q = _context.LabelTemplateMaster; if (!string.IsNullOrEmpty(LabelMatnr) && LabelMatnr != "*") { - q.Where(w => w.LABEL_MATNR.Equals(LabelMatnr)); + q = q.Where(w => w.LABEL_MATNR.Equals(LabelMatnr)); } - - if (!string.IsNullOrEmpty(Status) && Status != "*") - { - q.Where(w => w.STATUS_NO.Equals(Status) ); - } - + result.DataTotal = q.Count(); if (page > 0) { q = q.OrderBy(p => p.LABEL_MATNR).Skip((page - 1) * limit).Take(limit); @@ -149,64 +153,15 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } var labelTemplateMasters = await q.ToListAsync(); + // 紀錄筆數 + - - - return labelTemplateMasters; + result.Data = labelTemplateMasters; + return result; } - //// GET: api/LabelTemplateMaster/5 - //[HttpGet("LabelTemplateMulti/{LabelMatnr}/{Status}")] - //public async Task>> GetLabelTemplateDto(string LabelMatnr, string Status, int page = 0, int limit = 10) - //{ - // List TemplateDtoList = new List(); - // var LabelTemplateMaster = await _context.LabelTemplateMaster.Where(w => w.LabelMatnr == LabelMatnr).ToListAsync(); - // foreach (var item in LabelTemplateMaster) - // { - // var LabelTemplateDetail = await _context.LabelTemplateDetails.Where(w => w.TemplateID == item.TemplateID).ToListAsync(); - - // var TemplateDto= new LabelTemplateDto - // { - // TemplateID = item.TemplateID, - // LabelMatnr = item.LabelMatnr, - // LabelFile = item.LabelFile, - // ImageName = item.ImageName, - // Remark = item.Remark, - // CreateDate = item.CreateDate, - // CreateUserID = item.CreateUserID, - // UpdateDate = item.UpdateDate, - // UpdateUserID = item.UpdateUserID - - // }; - - // foreach (var item1 in LabelTemplateDetail) - // { - // TemplateDto.labelTemplateDetails.Add(new Models.AMES.LabelTemplateDetail - // { - // TemplateID = item1.TemplateID, - // LabelFieldID = item1.LabelFieldID, - // CreateDate = item1.CreateDate, - // CreateUserID = item1.CreateUserID, - // UpdateDate = item1.UpdateDate, - // UpdateUserID = item1.UpdateUserID - // }); - - // } - - // TemplateDtoList.Add(TemplateDto); - - - // } - - // if (LabelTemplateMaster == null) - // { - // return NotFound(); - // } - - // return TemplateDtoList; - - //} + private bool LabelTemplateMasterExists(int id) { diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index aeb3b62d..64db368e 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -135,6 +135,7 @@ namespace AMESCoreStudio.WebApi modelBuilder.Entity().HasNoKey(); modelBuilder.Entity().HasKey(c => new { c.SerialRuleDetailID }); modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasKey(c => new { c.TEMPLATE_ID, c.LABEL_FIELD_ID }); //Yiru End --------------------------------------------------------------------------------------------------------------------------- From 7a375f88d2ade0ec3b2be094ac5137f61423efa0 Mon Sep 17 00:00:00 2001 From: Yiru Date: Sun, 4 Feb 2024 19:24:55 +0800 Subject: [PATCH 5/7] =?UTF-8?q?Lab002=E8=A3=9C=E4=B8=8A=E5=82=B3=E8=B3=87?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LABController.cs | 72 +------------------ AMESCoreStudio.Web/Views/LAB/LAB002.cshtml | 2 +- AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml | 24 +------ AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml | 30 +------- .../Models/AMES/LabelTemplateDetail.cs | 13 ++-- .../Models/AMES/LabelTemplateMaster.cs | 4 +- 6 files changed, 13 insertions(+), 132 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/LABController.cs b/AMESCoreStudio.Web/Controllers/LABController.cs index 01a46b03..14c71279 100644 --- a/AMESCoreStudio.Web/Controllers/LABController.cs +++ b/AMESCoreStudio.Web/Controllers/LABController.cs @@ -180,77 +180,7 @@ namespace AMESCoreStudio.Web.Controllers /// public async Task LAB002Async(string LabelMatnr, int page = 0, int limit = 10) { - - - var query = new LAB002ViewModel(); - - string rateDataListS = ""; - string rateDataListSData; - // 創建動態模型 - dynamic model = new ExpandoObject(); - - // 添加欄位 - model.FieldName1 = "Value1"; - model.FieldName2 = 42; - - rateDataListS = rateDataListS + @" - - - - - "; - - #region LabelParam - var LabelParamALL = await _labApi.GetLabelTemplatebyMatnr(0); - LabelParamALL = LabelParamALL.Where(s => s.STATUS_NO == "Y").OrderBy(o => o.LABEL_FIELD_ID).ToList(); - foreach (var item in LabelParamALL) - { - rateDataListS = rateDataListS + ""; - } - #endregion - LabelMatnr = "*"; - var Master = await _labApi.LabelTemplatebyMatnr(LabelMatnr, page, limit); - - foreach (var item in Master.Data) - { - rateDataListSData = - @$" - - - - - "; - - - - - var Detail = await _labApi.GetLabelTemplateDetail(item.TEMPLATE_ID); - string DetailString = string.Join(",", Detail.Select(s => s.LABEL_FIELD_ID.ToString()).ToList()); - int i = 0; - foreach (var Param in LabelParamALL) - { - if (DetailString.Contains(Param.LABEL_FIELD_ID.ToString() + ",")) - { - rateDataListSData += $""; - } - else - { - rateDataListSData += $""; - } - i++; - } - - rateDataListS += "" + rateDataListSData + ""; - } - - - // rateDataListS = rateDataListS + "" + rateDataListS_NG + "" + rateDataListS_IPC + "
樣式編號標籤料號標籤檔名狀態備註說明" + item.LABEL_FIELD_NAME + "{item.TEMPLATE_ID}{item.LABEL_MATNR}{item.LABEL_FILE}{item.STATUS_NO}{item.REMARK}{item.IMAGE_NAME}
"; - rateDataListS = rateDataListS + "
"; - ViewData["RateDataListS"] = rateDataListS; - - - - return View(query); + return View(); } [ResponseCache(Duration = 0)] diff --git a/AMESCoreStudio.Web/Views/LAB/LAB002.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB002.cshtml index ebdb215b..de4b1ad0 100644 --- a/AMESCoreStudio.Web/Views/LAB/LAB002.cshtml +++ b/AMESCoreStudio.Web/Views/LAB/LAB002.cshtml @@ -134,7 +134,7 @@ //通过行tool编辑,lay-event="show" function Show(obj) { layui.use('layer', function () { - alert(obj.data.imagE_NAME); + var layer = layui.layer; layer.open({ type: 2, diff --git a/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml index bc51d525..3e2d2455 100644 --- a/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml +++ b/AMESCoreStudio.Web/Views/LAB/LAB002C.cshtml @@ -159,8 +159,7 @@ } else { - alert("insert"); - insertMaster2("T"); + insertMaster2("T"); } @@ -222,7 +221,6 @@ var UpdateUserID = $("#UPDATE_USERID").val(); var CreateDate = $("#CREATE_DATE").val(); var UpdateDate = $("#UPDATE_DATE").val(); - alert("insertList" + id); for (var i = 0; i < modeltable.length - 1; i++) { @@ -416,25 +414,7 @@ } }); - form.on('checkbox(templateID)', function (data) { - console.log(data.elem.checked); //是否被选中,true 或者 false - alert("1"); - if (data.elem.checked) { - $("[data-field='line']").css('display', 'inline-block'); - $("[data-field='station']").css('display', 'inline-block'); - - $('table.layui-table thead tr th:nth-child(5)').removeClass('layui-hide'); - $('table.layui-table thead tr th:nth-child(6)').removeClass('layui-hide'); - } - else { - - $("[data-field='line']").css('display', 'none'); - $("[data-field='station']").css('display', 'none'); - - $('table.layui-table thead tr th:nth-child(5)').addClass('layui-hide'); - $('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide'); - } - }); + // 监听选择文件按钮的点击事件 document.getElementById('selectFileBtn').addEventListener('click', function () { // 模拟点击 input[type=file] 元素 diff --git a/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml b/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml index 96f521e7..22460621 100644 --- a/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml +++ b/AMESCoreStudio.Web/Views/LAB/LAB002U.cshtml @@ -111,7 +111,7 @@