diff --git a/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj b/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj index bf956823..e81a4ba2 100644 --- a/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj +++ b/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj @@ -33,9 +33,13 @@ - + + + + + diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index ec81e4d8..27ada4c6 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -4,7 +4,8 @@ using AMESCoreStudio.WebApi.DTO.AMES; using AMESCoreStudio.WebApi.Enum; using AMESCoreStudio.WebApi.Models.AMES; using AMESCoreStudio.WebApi.Models.BAS; -using AspNetCore.Reporting; +//using AspNetCore.Reporting; +using Microsoft.Reporting.NETCore; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -19,6 +20,7 @@ using System.IO; using System.Linq; using System.Threading.Tasks; + namespace AMESCoreStudio.Web.Controllers { /// @@ -1507,11 +1509,16 @@ namespace AMESCoreStudio.Web.Controllers int extension = 1; Dictionary param = new Dictionary(); var localReport = GetReprot(inhouseNo, seqID); - var reportResult = localReport.Result.Execute(RenderType.Pdf, extension, param, mimeType); + var reportResult = localReport.Result.Render("PDF"); using (var stream = new FileStream(path, FileMode.Create)) { - await stream.WriteAsync(reportResult.MainStream, 0, reportResult.MainStream.Length); + await stream.WriteAsync(reportResult, 0, reportResult.Length); } + //var reportResult = localReport.Result.Execute(RenderType.Pdf, extension, param, mimeType); + //using (var stream = new FileStream(path, FileMode.Create)) + //{ + // await stream.WriteAsync(reportResult.MainStream, 0, reportResult.MainStream.Length); + //} Result = Result == "P" ? "允收" : "驗退"; string Subject = $"FQC自動派送發信 FQC單號:{inhouseNo} 料號:{Material}"; @@ -1970,28 +1977,36 @@ namespace AMESCoreStudio.Web.Controllers #endregion #region FQC010 報表 + public IActionResult FQC010_PDF(string inhouseNo, int seqID) { - string mimeType = ""; - int extension = 1; + //string mimeType = ""; + //int extension = 1; + //Dictionary param = new Dictionary(); + //var localReport = GetReprot(inhouseNo, seqID); + //var result = localReport.Result.Execute(RenderType.Pdf, extension, param, mimeType); + //return File(result.MainStream, "application/pdf"); Dictionary param = new Dictionary(); var localReport = GetReprot(inhouseNo, seqID); - var result = localReport.Result.Execute(RenderType.Pdf, extension, param, mimeType); - return File(result.MainStream, "application/pdf"); + var result = localReport.Result.Render("PDF"); + return File(result, "application/pdf"); } public IActionResult FQC010_Excel(string inhouseNo, int seqID) { - string mimeType = ""; - int extension = 1; + //string mimeType = ""; + //int extension = 1; + //Dictionary param = new Dictionary(); + //var localReport = GetReprot(inhouseNo, seqID); + //var result = localReport.Result.Execute(RenderType.ExcelOpenXml, extension, param, mimeType); + ////return File(result.MainStream, "application/msexcel", "Export.xls"); + //return File(result.MainStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Export.xlsx"); + ////return File(result.MainStream, "application/msexcel", "Export.xls"); Dictionary param = new Dictionary(); var localReport = GetReprot(inhouseNo, seqID); - var result = localReport.Result.Execute(RenderType.ExcelOpenXml, extension, param, mimeType); - //return File(result.MainStream, "application/msexcel", "Export.xls"); - return File(result.MainStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Export.xlsx"); - //return File(result.MainStream, "application/msexcel", "Export.xls"); + var result = localReport.Result.Render("EXCELOPENXML"); + return File(result, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Export.xlsx"); } - /// /// 產生FQC報表 /// @@ -2001,7 +2016,8 @@ namespace AMESCoreStudio.Web.Controllers private async Task GetReprot(string inhouseNo, int seqID) { var path = $"{this._env.WebRootPath}\\Reports\\FQC010View.rdlc"; - LocalReport localReport = new LocalReport(path); + LocalReport localReport = new LocalReport(); + localReport.ReportPath = path; System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); System.Text.Encoding.GetEncoding(1252); @@ -2153,9 +2169,12 @@ namespace AMESCoreStudio.Web.Controllers var FQC010Masters = new List(); FQC010Masters.Add(FQC010Master); - localReport.AddDataSource("DataSet1", FQC010Masters); - localReport.AddDataSource("DataSet2", FQC010Master.Detail1); - localReport.AddDataSource("DataSet3", FQC010Master.Detail2); + //localReport.AddDataSource("DataSet1", FQC010Masters); + //localReport.AddDataSource("DataSet2", FQC010Master.Detail1); + //localReport.AddDataSource("DataSet3", FQC010Master.Detail2); + localReport.DataSources.Add(new ReportDataSource("DataSet1", FQC010Masters)); + localReport.DataSources.Add(new ReportDataSource("DataSet2", FQC010Master.Detail1)); + localReport.DataSources.Add(new ReportDataSource("DataSet3", FQC010Master.Detail2)); return localReport; } diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 884fb5b1..8bcbd47a 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -4251,6 +4251,7 @@ namespace AMESCoreStudio.Web.Controllers wipLog.WipID = wipID; wipLog.WipDesc = "."; wipLog.StatusNO = statusNO; + wipLog.CreateUserID = GetLogInUserID(); // 當切換STOP時,強制收線 if (statusNO == "S") @@ -9203,6 +9204,8 @@ namespace AMESCoreStudio.Web.Controllers { IResultModel result; + model.UpdateUserID = user_id; + result = await _pcsApi.PutWipClearDetail(model.ClearDetailID, JsonConvert.SerializeObject(model)); if (result.Success) diff --git a/AMESCoreStudio.Web/Controllers/PTDController.cs b/AMESCoreStudio.Web/Controllers/PTDController.cs index 97209bd9..b3205825 100644 --- a/AMESCoreStudio.Web/Controllers/PTDController.cs +++ b/AMESCoreStudio.Web/Controllers/PTDController.cs @@ -255,6 +255,7 @@ namespace AMESCoreStudio.Web.Controllers #region "PTD002 一段式入出庫作業" public async Task PTD002() { + var RBU = string.Empty; if (Request.Cookies["_AMESCookie"] != null) { var userID = ""; @@ -264,6 +265,7 @@ namespace AMESCoreStudio.Web.Controllers var user_info = await _sysApi.GetUserInfo(int.Parse(userID)); var factory_info = await _basApi.GetFactoryInfo(user_info[0].FactoryID); ViewData["RBU"] = factory_info[0].Address; + RBU = factory_info[0].Address; } } @@ -272,15 +274,17 @@ namespace AMESCoreStudio.Web.Controllers var allRecordType = new[] { "653", "632", "261", "262", "101R", "201", "202", "291", "292", "601", "601DB", "657", "952", "634" }; var filtered = from o in RecordTypes where allRecordType.Contains(o.ID) + && o.RBU == RBU select o; - RecordTypes = filtered.ToList(); + RecordTypes = filtered.OrderBy(o => o.ID).ToList(); var SelectListItem = new List(); foreach (WebApi.Models.AMES.RecordTypeInfo RecordType in RecordTypes) { - SelectListItem.Add(new SelectListItem(RecordType.ID.ToString() + "-" + RecordType.TypeName, RecordType.ID.ToString())); + if (!SelectListItem.Any(a => RecordType.ID == a.Value)) + SelectListItem.Add(new SelectListItem(RecordType.ID.ToString() + "-" + RecordType.TypeName, RecordType.ID.ToString())); } ViewBag.RecordTypeInfo = RecordTypes; ViewBag.RecordType = SelectListItem; @@ -302,25 +306,44 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task PTD002_Commit(string data) { + var ptd002 = JsonConvert.DeserializeObject(data); + var result = await _ptdApi.PostPTD002Commit(data); + + var item = ptd002.TableData.FirstOrDefault(); + var zDNDetail = await _ptdApi.GetGetZDNDetail(item.DnNo, item.LineNo); + var zProductTrans = await _ptdApi.GetZProductTrans(recordNumber: item.DnNo, lineNo: item.LineNo); + if (zDNDetail.Any() && zProductTrans.Any()) + { + // DN數量 == 已扣帳數量 + if (zDNDetail.FirstOrDefault().shipQty == zProductTrans.Count()) + await _ptdApi.PutZDNDetailByIsRecord(item.DnNo, item.LineNo, 1); + } + //将数据Json化并传到前台视图 - return Json(new { data = result }); + return Json(new + { + data = result + }); } [HttpPost] public async Task PTD002_CheckInputData(WebApi.Models.AMES.PTDCheckInputData model) { var inputCheck = await CheckInputData(model); - var correct = new List(); var msg = string.Empty; if (!string.IsNullOrWhiteSpace(inputCheck)) return Json(new Result() { success = false, msg = inputCheck }); - // + // 取RecordType var recordType = await _ptdApi.GetRecordTypeInfo(); var recordTypeFirst = recordType.Where(w => w.ID == model.RecordType).FirstOrDefault(); - var zsnInfo = new List(); + // 資料收集 + var sn = new List(); + var addInput = new List(); + var msgInput = new List(); + var msgInputAlert = new List(); // 序號區間 if (!string.IsNullOrWhiteSpace(model.FrontSN)) @@ -328,6 +351,11 @@ namespace AMESCoreStudio.Web.Controllers // PCS if (model.StockUnit == "0") { + var sequential = model.Sequential; + var frontLength = model.FrontSN.Length; + // 前綴 + var title = model.FrontSN.Substring(0, frontLength - sequential); + // Begin=End if (model.PcsUnit == "Y") model.EndSN = model.FrontSN; @@ -336,16 +364,20 @@ namespace AMESCoreStudio.Web.Controllers // EndSn 空白 計算備貨量 if (string.IsNullOrWhiteSpace(model.EndSN)) { - var sequential = model.Sequential; - var frontLength = model.FrontSN.Length; - // 前綴 - var title = model.FrontSN.Substring(0, frontLength - sequential); // 開始流水號 var frontSequential = int.Parse(model.FrontSN.Substring(frontLength - sequential, sequential)); model.EndSN = $"{title}{(frontSequential + model.StockQty - 1).ToString().PadLeft(sequential, '0')}"; } } - zsnInfo = await _ptdApi.GetZSNInfoByIntervalNumber(model.FrontSN, model.EndSN); + + int startNumber = int.Parse(model.FrontSN.Substring(frontLength - sequential, sequential)); + int endNumber = int.Parse(model.EndSN.Substring(frontLength - sequential, sequential)); + // 用起訖區間推序號 + for (int i = startNumber; i <= endNumber; i++) + { + string serialNumber = title + i.ToString().PadLeft(sequential, '0'); + sn.Add(serialNumber); + } } // BOX else if (model.StockUnit == "1") @@ -364,9 +396,7 @@ namespace AMESCoreStudio.Web.Controllers var boxSn = await _ptdApi.GetBarcodeInfoByBoxInterval(model.FrontSN, model.EndSN); foreach (var item in boxSn.Where(w => w.StatusID == -1)) { - var byBarcodeNo = await _ptdApi.GetZSNInfoByNumber(item.BarcodeNo); - if (byBarcodeNo.Any()) - zsnInfo.Add(byBarcodeNo.FirstOrDefault()); + sn.Add(item.BarcodeNo); } } } @@ -374,69 +404,121 @@ namespace AMESCoreStudio.Web.Controllers // ExcelInput if (!string.IsNullOrWhiteSpace(model.SNData)) { - var sndata = model.SNData.Split("\n"); - foreach (var item in sndata) - { - var byNumber = await _ptdApi.GetZSNInfoByNumber(item); - if (byNumber.Any()) - zsnInfo.Add(byNumber.FirstOrDefault()); - } + sn.AddRange(model.SNData.Split("\n").ToList()); + sn = sn.Where(w => !string.IsNullOrWhiteSpace(w)).ToList(); } // Type是WO的 上一個狀態需要是WI if (recordTypeFirst != null) { - if (recordTypeFirst.Status == "WO") + // 確認序號狀態 + foreach (var item in sn) { - // Record 狀態是WI 的ID - var recodeIdBystaus = recordType.Where(w => w.Status == "WI").Select(s => s.ID).ToList(); - // 特殊 - if (model.RecordType == "633") - recodeIdBystaus.Add("631"); + // zsnInfo 資料 + var zSnInfo = await _ptdApi.GetZSNInfoByNumber(item); - correct = zsnInfo.Where(w => recodeIdBystaus.Contains((string)w.recordTypeID) && - w.originalProductID == model.ProductId).ToList(); - } - else if (recordTypeFirst.Status == "WI") - { - // 取得特定上一個作業 - var flowRule = await _ptdApi.GetPtdFlowRules(model.RecordType); - if (flowRule.Any()) + if (recordTypeFirst.Status == "WO") { - var toIDs = flowRule.Select(s => (string)s.toID).ToList(); - // 653需要確認料號是否一樣 - if (recordTypeFirst.ID == "653") + // Record 狀態是WI 的ID + var recodeIdBystaus = recordType.Where(w => w.Status == "WI").Select(s => s.ID).ToList(); + // 特殊 + if (model.RecordType == "633") + recodeIdBystaus.Add("631"); + + // ZsnInfo 符合狀態的序號且料號要一致 + if (zSnInfo.Any()) { - correct = zsnInfo.Where(w => toIDs.Contains((string)w.recordTypeID) && - w.originalProductID == model.ProductId).ToList(); + if (zSnInfo.Any(w => recodeIdBystaus.Contains((string)w.recordTypeID) && + w.originalProductID == model.ProductId)) + addInput.Add(item); + else + { + msgInputAlert.Add($"{item}(型態或料號不對)"); + msgInput.Add(item); + } } else - correct = zsnInfo.Where(w => toIDs.Contains((string)w.recordTypeID)).ToList(); + { + msgInputAlert.Add($"{item}(序號不存在)"); + msgInput.Add(item); + } + + } + else if (recordTypeFirst.Status == "WI") + { + // 292 不會有Info資料 + if (model.RecordType == "292") + { + if (zSnInfo.Any()) + { + msgInput.Add(item); + msgInputAlert.Add($"{item}(序號重複)"); + } + else + addInput.Add(item); + } + // 其他要走特定上一個作業 + else + { + var flowRule = await _ptdApi.GetPtdFlowRules(model.RecordType); + if (flowRule.Any()) + { + var toIDs = flowRule.Select(s => (string)s.toID).ToList(); + + // ZsnInfo 符合狀態的序號且料號要一致 + if (zSnInfo.Any()) + { + // 653需要確認料號是否一樣 + if (recordTypeFirst.ID == "653") + { + if (zSnInfo.Any(w => toIDs.Contains((string)w.recordTypeID) && + w.originalProductID == model.ProductId)) + addInput.Add(item); + else + { + msgInputAlert.Add($"{item}(型態或料號不對)"); + msgInput.Add(item); + } + } + else + { + if (zSnInfo.Any(w => toIDs.Contains((string)w.recordTypeID))) + addInput.Add(item); + else + { + msgInputAlert.Add($"{item}(型態不對)"); + msgInput.Add(item); + } + } + } + else + { + msgInputAlert.Add($"{item}(序號不存在)"); + msgInput.Add(item); + } + } + } } } } + addInput = addInput.Except(msgInput.Distinct()).ToList(); var datas = new List(); - foreach (var item in zsnInfo) + // add + foreach (var item in addInput) { - // 符合的顯示出來 - if (correct.Any(a => a.serialNumber == item.serialNumber)) + var newRowData = new { - var newRowData = new - { - dnNo = model.RecordNumber, - lineNo = model.LineNo, - material = model.ProductId, - sn = item.serialNumber - }; - datas.Add(newRowData); - } - else - msg += $"{item.serialNumber}、"; + dnNo = model.RecordNumber, + lineNo = model.LineNo, + material = model.ProductId, + sn = item + }; + datas.Add(newRowData); } - if (!string.IsNullOrWhiteSpace(msg)) - msg = "流程狀態或序號比對料號錯誤:" + msg.Substring(0, msg.Length - 1); + if (msgInputAlert.Any()) + msg = "新增失敗:" + string.Join("、", msgInputAlert.Distinct()); return Json(new Result() { success = true, msg = msg, data = datas }); } @@ -450,15 +532,19 @@ namespace AMESCoreStudio.Web.Controllers { // RecordNumber if (string.IsNullOrWhiteSpace(model.RecordNumber)) - { return "請輸入 RecordNumber"; - } // LineNo if (string.IsNullOrWhiteSpace(model.LineNo)) + return "請輸入 LineNo"; + else if (model.LineNo.Trim().Length != 6) + return "LineNo不足6碼"; + + // 判斷是否已備貨完成 + var isRecord = await CheckRecordNoIsRecord(model.RecordNumber, model.LineNo); + if (!(isRecord.Value as Result).success) { - if (model.RecordType != "101" && model.RecordType != "292") - return "請輸入 LineNo"; + return $"RecordNumber【{model.RecordNumber}】 LineNo【{model.LineNo}】 已備貨完成"; } // Location @@ -467,19 +553,21 @@ namespace AMESCoreStudio.Web.Controllers return "請輸入 Location"; } - var recordType = await _ptdApi.GetRecordTypeInfoById(model.RecordType); + var recordType = await _ptdApi.GetRecordTypeInfo(); + recordType = recordType.Where(w => w.ID == model.RecordType && w.RBU == model.Rbu).ToList(); if (recordType.Any()) { - var recordInfoItem = recordType.FirstOrDefault(); - if (model.RecordNumber.Length != int.Parse((string)recordInfoItem.length)) - return "RecordNumber長度與設定的長度不符,請在確認"; - - if (!model.RecordNumber.StartsWith((string)recordInfoItem.prefixCode)) + var recordInfoItem = recordType.Where(s => model.RecordNumber.StartsWith(s.PrefixCode)) + .FirstOrDefault(); + if (recordInfoItem == null) return "RecordNumber單據號碼開頭與設定開頭不符,請在確認"; + + if (model.RecordNumber.Length != recordInfoItem.Length) + return "RecordNumber長度與設定的長度不符,請在確認"; } else { - return "請維護RecordNumber單投說明表"; + return "請維護RecordNumber單頭說明表"; } // ProductId @@ -501,6 +589,10 @@ namespace AMESCoreStudio.Web.Controllers return "請輸入 Scanner"; } + // 輸入序號或Excel匯入只能選一種 + if (!string.IsNullOrWhiteSpace(model.FrontSN) && !string.IsNullOrWhiteSpace(model.SNData)) + return "條碼區間設定或Excel匯入只能選一種執行"; + // 判斷序號區間格式正確 if (!string.IsNullOrWhiteSpace(model.FrontSN)) { @@ -602,23 +694,26 @@ namespace AMESCoreStudio.Web.Controllers SelectListItem.Add(new SelectListItem("全部", "全部")); foreach (WebApi.Models.AMES.RecordTypeInfo RecordType in RecordTypes) { - SelectListItem.Add(new SelectListItem(RecordType.ID.ToString() + "-" + RecordType.TypeName, RecordType.ID.ToString())); + if (!SelectListItem.Any(a => RecordType.ID == a.Value)) + SelectListItem.Add(new SelectListItem(RecordType.ID.ToString() + "-" + RecordType.TypeName, RecordType.ID.ToString())); } ViewBag.RecordType = SelectListItem; //ViewBag.StartDate = System.DateTime.Now.AddDays(-7).ToString("yyyy/MM/dd"); //ViewBag.EndDate = System.DateTime.Now.ToString("yyyy/MM/dd"); ViewBag.WorkCenter = "TWM0"; - + ViewBag.rowCount = "總筆數: 0"; return View(); } - public async Task PTD003QueryAsync(string recordType, string recordNumber, string lineNo, string materialNo, string shippingSN, string dateStart, string dateEnd, int autoLoad = 0, string RBU = null) + public async Task PTD003QueryAsync(string recordType, string recordNumber, string lineNo, string materialNo, string shippingSN, string dateStart, string dateEnd, + int autoLoad = 0, string RBU = null, string soNumber = null, string soLineNo = null, string customer = null) { - //if (recordNumber == null || recordNumber == "") - // return Json(new Table() { count = 0, data = null }); if (autoLoad == 0) + { return Json(new Table() { count = 0, data = null }); + } - var result = await _ptdApi.GetData4PTD003(recordType, recordNumber, lineNo, materialNo, shippingSN, dateStart, dateEnd, RBU); + var result = await _ptdApi.GetData4PTD003(recordType, recordNumber, lineNo, materialNo, shippingSN, + dateStart, dateEnd, RBU, soNumber, soLineNo, customer); if (result.DataTotal > 0) { return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); @@ -653,10 +748,10 @@ namespace AMESCoreStudio.Web.Controllers } //修改页面 [HttpGet] - public async Task PTD004UAsync(string id) + public async Task PTD004UAsync(string seq) { - var result = await _ptdApi.GetRecordTypeInfo(id); + var result = await _ptdApi.GetRecordTypeInfo(seq); if (result.Count == 0) { @@ -765,11 +860,18 @@ namespace AMESCoreStudio.Web.Controllers IResultModel result; if (model.Mode == 0) { - result = await _ptdApi.PostCustomerItemMailGroup(JsonConvert.SerializeObject(model)); + var checkData = await _ptdApi.GetCustomerItemMailGroup(model.CustomerCode); + if (!checkData.Any()) + result = await _ptdApi.PostCustomerItemMailGroup(JsonConvert.SerializeObject(model)); + else + { + ModelState.AddModelError("error", "客戶代號已有重複"); + return View("PTD005C", model); + } } else { - result = await _ptdApi.PutCustomerItemMailGroup(model.ItemNumber, JsonConvert.SerializeObject(model)); + result = await _ptdApi.PutCustomerItemMailGroup(model.CustomerCode, JsonConvert.SerializeObject(model)); } if (result.Success) @@ -815,6 +917,7 @@ namespace AMESCoreStudio.Web.Controllers #region "PTD006 備貨作業" public async Task PTD006() { + var RBU = string.Empty; if (Request.Cookies["_AMESCookie"] != null) { var userID = ""; @@ -824,26 +927,28 @@ namespace AMESCoreStudio.Web.Controllers var user_info = await _sysApi.GetUserInfo(int.Parse(userID)); var factory_info = await _basApi.GetFactoryInfo(user_info[0].FactoryID); ViewData["RBU"] = factory_info[0].Address; + RBU = factory_info[0].Address; } - } List RecordTypes = await _ptdApi.GetRecordTypeInfo(); var allRecordType = new[] { "101", "601", "631", "633", "951" }; var filtered = from o in RecordTypes where allRecordType.Contains(o.ID) + && o.RBU == RBU select o; - RecordTypes = filtered.ToList(); + RecordTypes = filtered.OrderBy(o => o.ID).ToList(); var SelectListItem = new List(); foreach (WebApi.Models.AMES.RecordTypeInfo RecordType in RecordTypes) { - SelectListItem.Add(new SelectListItem(RecordType.ID.ToString() + "-" + RecordType.TypeName, RecordType.ID.ToString())); + if (!SelectListItem.Any(a => RecordType.ID == a.Value)) + SelectListItem.Add(new SelectListItem(RecordType.ID.ToString() + "-" + RecordType.TypeName, RecordType.ID.ToString())); } ViewBag.RecordTypeInfo = RecordTypes; - ViewBag.RecordType = SelectListItem; + ViewBag.RecordType = SelectListItem.Distinct().ToList(); ViewBag.Location = "9000"; ViewBag.WorkCenter = "TWM0"; ViewBag.RecordDate = System.DateTime.Now.ToString("yyyy/MM/dd"); @@ -895,11 +1000,31 @@ namespace AMESCoreStudio.Web.Controllers } } + public async Task PTD006DAllAsync(string recordNumber, string lineNo) + { + var result = await _ptdApi.DeleteZWHPickListDetailAll(recordNumber, lineNo); + if (result.Success) + { + return Json(new Result() { success = true, msg = "" }); + } + else + { + return Json(new Result() { success = false, msg = result.Msg }); + } + } + public async Task PTD006_CheckInputData(WebApi.Models.AMES.PTDCheckInputData model) { // 基本資料判定 var inputCheck = await CheckInputData(model); var msg = string.Empty; + // 資料收集 + var sn = new List(); + var addInput = new List(); + var msgInput = new List(); + var msgInputAlert = new List(); + var checkFQC = false; + if (!string.IsNullOrWhiteSpace(inputCheck)) return Json(new Result() { success = false, msg = inputCheck }); @@ -927,11 +1052,6 @@ namespace AMESCoreStudio.Web.Controllers else return Json(new Result() { success = false, msg = "請新增單頭說明維護", data = null }); - // 資料收集 - var sn = new List(); - var addInput = new List(); - var msgInput = new List(); - // 序號區間 if (!string.IsNullOrWhiteSpace(model.FrontSN)) { @@ -994,6 +1114,15 @@ namespace AMESCoreStudio.Web.Controllers if (!string.IsNullOrWhiteSpace(model.SNData)) { sn.AddRange(model.SNData.Split("\n").ToList()); + sn = sn.Where(w => !string.IsNullOrWhiteSpace(w)).ToList(); + } + + // FFQC判斷 + var resultZDNDetail = await _ptdApi.GetGetZDNDetail(model.RecordNumber, model.LineNo); + if (resultZDNDetail.Any()) + { + if (resultZDNDetail.FirstOrDefault().shipSLoc == "0S08") + checkFQC = true; } // 確認序號狀態 @@ -1013,29 +1142,73 @@ namespace AMESCoreStudio.Web.Controllers w.originalProductID == model.ProductId)) addInput.Add(item); else - msgInput.Add(item); + { + if (zSnInfo.Any(w => !recodeIdBystaus.Contains((string)w.recordTypeID))) + { + msgInput.Add(item); + msgInputAlert.Add($"{item}(型態不對)"); + } + else if (zSnInfo.Any(w => w.originalProductID != model.ProductId)) + { + msgInput.Add(item); + msgInputAlert.Add($"{item}(品號不符)"); + } + } } else + { msgInput.Add(item); + msgInputAlert.Add($"{item}(序號不存在)"); + } // 排除PickDetail有重複相同recordNumber & lineNo 的序號 - if (pickDetail.Any(w => w.recordNumber == model.RecordNumber && w.rcLineNO == model.LineNo)) + //if (pickDetail.Any(w => w.recordNumber == model.RecordNumber && w.rcLineNO == model.LineNo)) + if (pickDetail.Any(w => w.recordTypeID == model.RecordType)) + { msgInput.Add(item); + msgInputAlert.Add($"{item}(序號重複)"); + } else addInput.Add(item); + + // FQC檢驗 + if (checkFQC) + { + try + { + var resultCheckFqc = await _ptdApi.CheckFQCTestOk(extraBarcodeNo: item); + if (!resultCheckFqc.Any()) + { + msgInput.Add(item); + msgInputAlert.Add($"{item}(尚未通過FQC檢驗)"); + } + } + catch + { + msgInput.Add(item); + msgInputAlert.Add($"{item}(尚未通過FQC檢驗)"); + } + } } else { // 101 不會有Info資料 if (zSnInfo.Any()) + { msgInput.Add(item); + msgInputAlert.Add($"{item}(序號重複)"); + } else addInput.Add(item); // 排除PickDetail有重複相同recordNumber & lineNo 的序號 - if (pickDetail.Any(w => w.recordNumber == model.RecordNumber && w.rcLineNO == model.LineNo)) + //if (pickDetail.Any(w => w.recordNumber == model.RecordNumber && w.rcLineNO == model.LineNo)) + if (pickDetail.Any(w => w.recordTypeID == model.RecordType)) + { msgInput.Add(item); + msgInputAlert.Add($"{item}(序號重複)"); + } else addInput.Add(item); } @@ -1063,12 +1236,18 @@ namespace AMESCoreStudio.Web.Controllers var result = await _ptdApi.PostPTD006Commit(JsonConvert.SerializeObject(addPtd006)); } - if (msgInput.Any()) - msg = "序號新增失敗:" + string.Join("、", msgInput.Distinct()); + if (msgInputAlert.Any()) + msg = "新增失敗:" + string.Join("、", msgInputAlert.Distinct()); return Json(new Result() { success = true, msg = msg, data = new List() }); } + /// + /// 取得 RecordNo & LineNo 訂單數量 + /// + /// RecordNo + /// LineNo + /// public async Task GetRecordNumberQty(string dnNo, string dnlineNo) { var zDNDetail = await _ptdApi.GetGetZDNDetail(dnNo, dnlineNo); @@ -1085,11 +1264,31 @@ namespace AMESCoreStudio.Web.Controllers } + /// + /// 確認 RecordNo & LineNo 是否可備貨 + /// + /// RecordNo + /// LineNo + /// ture可 false不可 + public async Task CheckRecordNoIsRecord(string dnNo, string dnlineNo) + { + var zDNDetail = await _ptdApi.GetGetZDNDetail(dnNo, dnlineNo); + + if (zDNDetail.Any()) + { + var isRecord = zDNDetail.FirstOrDefault().isRecord; + if ((int)isRecord == 1) + return Json(new Result() { success = false }); + } + return Json(new Result() { success = true }); + } + #endregion #region "PTD007 扣帳作業" public async Task PTD007() { + var RBU = string.Empty; if (Request.Cookies["_AMESCookie"] != null) { var userID = ""; @@ -1097,24 +1296,27 @@ namespace AMESCoreStudio.Web.Controllers if (userID != "") { var user_info = await _sysApi.GetUserInfo(int.Parse(userID)); - List factory_info = await _basApi.GetFactoryInfo(user_info[0].FactoryID); + var factory_info = await _basApi.GetFactoryInfo(user_info[0].FactoryID); ViewData["RBU"] = factory_info[0].Address; + RBU = factory_info[0].Address; } } List RecordTypes = await _ptdApi.GetRecordTypeInfo(); - var allRecordType = new[] { "101", "601", "631", "633", "951" }; + var allRecordType = new[] { "101", "601", "631", "633", "951", "101P" }; var filtered = from o in RecordTypes where allRecordType.Contains(o.ID) + && o.RBU == RBU select o; - RecordTypes = filtered.ToList(); + RecordTypes = filtered.OrderBy(o => o.ID).ToList(); var SelectListItem = new List(); foreach (WebApi.Models.AMES.RecordTypeInfo RecordType in RecordTypes) { - SelectListItem.Add(new SelectListItem(RecordType.ID.ToString() + "-" + RecordType.TypeName, RecordType.ID.ToString())); + if (!SelectListItem.Any(a => RecordType.ID == a.Value)) + SelectListItem.Add(new SelectListItem(RecordType.ID.ToString() + "-" + RecordType.TypeName, RecordType.ID.ToString())); } ViewBag.RecordType = SelectListItem; @@ -1123,12 +1325,20 @@ namespace AMESCoreStudio.Web.Controllers return View(); } - public async Task PTD007QueryAsync(string recordType, string recordNumber) + public async Task PTD007QueryAsync(string recordType, string recordNumber, string RBU) { if (recordNumber == null || recordNumber == "") return Json(new Table() { count = 0, data = null }); - var result = await _ptdApi.GetZDNDetailJoinZWHPickListDetail(recordType, recordNumber); + var result = new ResultModel(); + + if (recordType == "101P") + { + result = await _ptdApi.GetPTD007QueryByRBU(recordNumber, RBU); + } + else + result = await _ptdApi.GetZDNDetailJoinZWHPickListDetail(recordType, recordNumber); + if (result.DataTotal > 0) { return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); @@ -1139,7 +1349,37 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task PTD007_Commit(string data) { - var result = await _ptdApi.PostPTD007Commit(data); + var ptd007 = JsonConvert.DeserializeObject(data); + var result = new ResultModel(); + // 先確認需求數量是否=備貨數量 + foreach (var item in ptd007.TableData) + { + if (item.shipQty != item.qty) + { + result.Success = false; + result.Msg = $"DN單號【{item.dnno}】 LineNo【{item.dnLineNO}】 數量不符合,請檢查備貨資料"; + return Json(new { data = result }); + } + } + // 執行扣帳 + if (ptd007.RecordType == "101P") + result = await _ptdApi.PostPTD007CommitByRBU(data); + else + result = await _ptdApi.PostPTD007Commit(data); + + foreach (var item in ptd007.TableData) + { + var zDNDetail = await _ptdApi.GetGetZDNDetail(item.dnno, item.dnLineNO); + var zProductTrans = await _ptdApi.GetZProductTrans(recordNumber: item.dnno, lineNo: item.dnLineNO); + + if (zDNDetail.Any() && zProductTrans.Any()) + { + // DN數量 == 已扣帳數量 + if (zDNDetail.FirstOrDefault().shipQty == zProductTrans.Count()) + await _ptdApi.PutZDNDetailByIsRecord(item.dnno, item.dnLineNO, 1); + } + } + //将数据Json化并传到前台视图 return Json(new { data = result }); } @@ -1163,12 +1403,96 @@ namespace AMESCoreStudio.Web.Controllers } return Json(new Table() { count = 0, data = null, msg = result.Msg }); } + [HttpPost] - public async Task PTD008_Commit(string data) + public async Task PTD008_Commit(string recordNumber, string lineNo, string materialNo, string shippingSN) { - var result = await _ptdApi.PostPTD008Commit(data); - //将数据Json化并传到前台视图 - return Json(new { data = result }); + var data = await _ptdApi.GetData4PTD008(recordNumber, lineNo, materialNo, shippingSN); + + if (data.Data.Any(w => w.recordTypeID == "101" || w.recordTypeID == "292")) + return Json(new Result() { success = false, msg = "ReCordType狀態是【101】或【292】 ,不可做還原動作" }); + + int okQty = 0, ngQty = 0; + foreach (var item in data.Data.LastOrDefault()) + { + var zProductTrans = await _ptdApi.GetZProductTrans(serialNumber: (string)item.sn); + var delcheck = true; + + if (!zProductTrans.Any()) + { + ngQty += 1; + continue; + } + // 取序號最新一次狀態 + else if (zProductTrans.Any()) + { + var newRecordId = zProductTrans.OrderByDescending(o => o.createDate).FirstOrDefault().recordTypeID; + // 確認目前還原是否是最新的 + if (newRecordId != item.recordTypeID) + { + ngQty += 1; + continue; + } + } + + // 可進行還原 + delcheck = await _ptdApi.Put_PTD008((string)item.sn, recordNumber, lineNo, materialNo , item.recordTypeID); + if (delcheck) + okQty += 1; + else + ngQty += 1; + } + + // 成功刪除筆數大於1 + if (okQty >= 1) + { + await _ptdApi.PutZDNDetailByIsRecord(recordNumber, lineNo, 0); + } + + return Json(new Result() { success = true, msg = $"還原成功筆數【{okQty}】,失敗筆數【{ngQty}】" }); + } + + /// + /// 刪除動作 + /// + /// + /// + [HttpPost] + public async Task PTD008_Del(string recordNumber, string lineNo, string materialNo, string shippingSN) + { + var data = await _ptdApi.GetData4PTD008(recordNumber, lineNo, materialNo, shippingSN); + + if (data.Data.Any(w => w.recordTypeID != "101" && w.recordTypeID != "292")) + return Json(new Result() { success = false, msg = "ReCordType狀態不是【101】或【292】 ,不可做刪除動作" }); + + int okQty = 0, ngQty = 0; + foreach (var item in data.Data) + { + var zProductTrans = await _ptdApi.GetZProductTrans(serialNumber: (string)item.sn); + var delcheck = true; + // 大於一筆 代表尚有其他作業需還原 + if (zProductTrans.Count > 1) + { + ngQty += 1; + } + // 可進行刪除 + else + { + delcheck = await _ptdApi.Del_PTD008((string)item.sn, recordNumber, lineNo, materialNo); + if (delcheck) + okQty += 1; + else + ngQty += 1; + } + } + + // 成功刪除筆數大於1,將ZDetail + if (okQty >= 1) + { + await _ptdApi.PutZDNDetailByIsRecord(recordNumber, lineNo, 0); + } + + return Json(new Result() { success = true, msg = $"刪除成功筆數【{okQty}】,失敗筆數【{ngQty}】" }); } #endregion diff --git a/AMESCoreStudio.Web/Controllers/QRSController.cs b/AMESCoreStudio.Web/Controllers/QRSController.cs index d26b7135..90b22820 100644 --- a/AMESCoreStudio.Web/Controllers/QRSController.cs +++ b/AMESCoreStudio.Web/Controllers/QRSController.cs @@ -627,7 +627,7 @@ namespace AMESCoreStudio.Web.Controllers for (int j = 0; j < station_list.Length - 1; j++) { int wip_qty = 0; - var wip_station1 = await _pcsApi.GetWipBarcode4QRS009(wip_id, int.Parse(station_list[j]), 0, 10); + var wip_station1 = await _pcsApi.GetWipBarcodeCount4QRS009(wip_id, int.Parse(station_list[j]), 0, 10); if (wip_station1.DataTotal > 0) { @@ -713,6 +713,24 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetWipStationBarcodeNew(string id, int page = 0, int limit = 10) + { + string[] param = id.Split("_"); + int wip_id = int.Parse(param[0]); + int station_id = int.Parse(param[1]); + + var result = await _pcsApi.GetWipBarcode4QRS009New(wip_id, station_id, page, limit); + + if (result.DataTotal > 0) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } + + return Json(new Table() { count = 0, data = null }); + } + private async Task GetProductTypeList() { var result = await _pcsApi.GetProductTypes(); @@ -1119,13 +1137,14 @@ namespace AMESCoreStudio.Web.Controllers //2024-03-26 BB.Wang Modify 修正良率(代小平) //double sum_rate = 100.0; //int sum_idx = 1; - double sum_rate = 0.0; + double sum_rate = 100.0; int sum_idx = 0; for (int i = 0; i < ft_stations.Count; i++) { int station_id = ft_stations[i].StationID; - var wip_station = await _pcsApi.GetWipStation4QRS009Group(wip_id, station_id); + //var wip_station = await _pcsApi.GetWipStation4QRS009Group(wip_id, station_id); + var wip_station = await _pcsApi.GetBarcodeStation4QRS009Group(wip_id, station_id, param[3], param[4]); int okQty = 0, ngQty = 0, inputQty = 0; @@ -1151,6 +1170,11 @@ namespace AMESCoreStudio.Web.Controllers rate = (okQty * 1.0 / inputQty) * 100; } + if (rate > 0) + { + sum_rate = double.Parse((sum_rate * (rate / 100.0)).ToString("0.00")); + } + /* if (rate > 0) { @@ -1158,18 +1182,22 @@ namespace AMESCoreStudio.Web.Controllers } */ + /* if (rate > 0) { sum_idx = sum_idx + 1; sum_rate = sum_rate + rate; } + */ } query.SumYieldDatas.Add(new SumYieldData { WipID = int.Parse(jo["wipID"].ToString()), WipNO = jo["wipNO"].ToString(), - Yield = sum_rate / sum_idx + //Yield = sum_rate / sum_idx + //Yield = double.Parse((sum_rate / sum_idx).ToString("0.00")) + Yield = sum_rate }); } diff --git a/AMESCoreStudio.Web/Controllers/SPCController.cs b/AMESCoreStudio.Web/Controllers/SPCController.cs index 3905d0b9..6a12cbff 100644 --- a/AMESCoreStudio.Web/Controllers/SPCController.cs +++ b/AMESCoreStudio.Web/Controllers/SPCController.cs @@ -1402,27 +1402,51 @@ namespace AMESCoreStudio.Web.Controllers public async Task CheckBarcodeNOAsync(string BarcodeNo, string WipNo) { - // var result_WipNo = await _pcsApi.GetWipBarcode(WipNo); + // var result_WipNo = await _pcsApi.GetWipBarcode(WipNo); var BarcodeInfo = await _pcsApi.GetBarcodeInfoesByNo(BarcodeNo); var wipInfo = await _pcsApi.GetWipInfoByWipNO(WipNo); - if (BarcodeInfo.Count > 0 && wipInfo.Count > 0) + //工單WipType ="N" 表示無序號,不需檢查 + + if (wipInfo.Where(w => w.WipType != "N").Count() > 0) { + if (BarcodeInfo.Count > 0 && wipInfo.Count > 0) + { + var BarcodeWip = await _pcsApi.GetBarcodeWipByTwoKey(BarcodeInfo.Select(s => s.BarcodeID).FirstOrDefault(), wipInfo.Select(s => s.WipID).FirstOrDefault()); - var BarcodeWip = await _pcsApi.GetBarcodeWipByTwoKey(BarcodeInfo.Select(s => s.BarcodeID).FirstOrDefault(), wipInfo.Select(s => s.WipID).FirstOrDefault()); - if (BarcodeWip != null) { - return Json(new Table() { code = 0, msg = "", data = BarcodeWip, count = 1 }); + return Json(new Table() { code = 0, msg = "OK", data = BarcodeWip, count = 1 }); } - + + } + + return Json(new Table() { count = 0, msg = "生產序號不在工單區間內", data = null }); + } - return Json(new Table() { count = 0,msg = "生產序號不在工單區間內", data = null }); + else + { + //新增一個BarcodeWip變數,並填入預設值 + + var BarcodeWip = new BarcodeWip(); + BarcodeWip.BarcodeID = 0; + BarcodeWip.WipID = wipInfo.Where(w => w.WipType == "N").Select(s => s.WipID).FirstOrDefault(); + + return Json(new Table() { count = 0, msg = "OK", data = BarcodeWip }); + } + } #endregion #region SPC005 報表 + + /// + /// 產出PDF報表 + /// + /// + /// + /// public async Task SPC005_PDF(int id,string Types) { string mimeType = ""; @@ -1442,13 +1466,39 @@ namespace AMESCoreStudio.Web.Controllers } } /// + /// 產出EXCEL報表 + /// + /// + /// + /// + public async Task SPC005_Excel(int id, string Types) + { + string mimeType = ""; + int extension = 1; + Dictionary param = new Dictionary(); + if (Types == "IPQC") + { + var localReport = GetReprot(id); + var result = localReport.Result.Execute(RenderType.ExcelOpenXml, extension, param, mimeType); + //return File(result.MainStream, "application/msexcel", "Export.xls"); + return File(result.MainStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Export.xlsx"); + } + else + { + var localReport = GetFAIReprot(id); + var result = localReport.Result.Execute(RenderType.ExcelOpenXml, extension, param, mimeType); + //return File(result.MainStream, "application/msexcel", "Export.xls"); + return File(result.MainStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Export.xlsx"); + } + } + /// /// 產生IPQC報表 /// /// IPQC報表 /// private async Task GetReprot(int id) { - var path = $"{this._env.WebRootPath}\\Reports\\SPC005View.rdlc"; + var path = $"{this._env.WebRootPath}\\Reports\\SPC005View1.rdlc"; LocalReport localReport = new LocalReport(path); System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); @@ -1492,7 +1542,7 @@ namespace AMESCoreStudio.Web.Controllers { SPC005Master.Detail2_ASSY.Add(new SPC005Detail2 { - + BarcodeNO = item.BarcodeNO, SEQ = item.Seq.ToString(), InspectionItemDesc = item.InspectionItemDesc, InspectionResults = item.InspectionResult @@ -1513,7 +1563,7 @@ namespace AMESCoreStudio.Web.Controllers { SPC005Master.Detail2_TEST.Add(new SPC005Detail2 { - + BarcodeNO = item.BarcodeNO, SEQ = item.Seq.ToString(), InspectionItemDesc = item.InspectionItemDesc, InspectionResults = item.InspectionResult @@ -1534,7 +1584,7 @@ namespace AMESCoreStudio.Web.Controllers { SPC005Master.Detail2_PACK.Add(new SPC005Detail2 { - + BarcodeNO = item.BarcodeNO, SEQ = item.Seq.ToString(), InspectionItemDesc = item.InspectionItemDesc, InspectionResults = item.InspectionResult diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 26a60a6b..1af6518d 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -1131,6 +1131,20 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/BarcodeInfoes/GetWipBarcode4QRS009")] ITask> GetWipBarcode4QRS009(int wipID, int stationID, int page, int limit); + /// + /// 查詢工單站別在製條碼資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/BarcodeInfoes/GetWipBarcode4QRS009New")] + ITask> GetWipBarcode4QRS009New(int wipID, int stationID, int page, int limit); + + /// + /// 查詢工單站別在製條碼資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/BarcodeInfoes/GetWipBarcodeCount4QRS009")] + ITask> GetWipBarcodeCount4QRS009(int wipID, int stationID, int page, int limit); + #endregion #region QRS010 良率 diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPTD.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPTD.cs index 43087f0a..d985c4d8 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPTD.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPTD.cs @@ -44,13 +44,23 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/PTD/GetZDNDetail")] ITask> GetGetZDNDetail(string dnNo, string dnlineNo); + /// + /// 更新 PTD ZDNDetail RecordNumber ByisRecord 已扣帳狀態 + /// + /// RecordNumber + /// LineNo + /// 已扣障 0:未完成 1:已完成 + /// + [WebApiClient.Attributes.HttpPut("api/PTD/PutZDNDetail")] + ITask PutZDNDetail(string dnNo, string dnlineNo, int isRecord); + /// /// 查詢 ZSNInfo 主表 序號區間 /// /// /// [WebApiClient.Attributes.HttpGet("api/PTD/ZSNInfoByIntervalNumber")] - ITask> GetZSNInfoByIntervalNumber(string strNumber ,string endNumber); + ITask> GetZSNInfoByIntervalNumber(string strNumber, string endNumber); /// /// 查詢 ZSNInfo 主表 By 指定序號 @@ -94,6 +104,14 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/PTD/CustomerItemMailGroupByCustomerCode/{id}")] ITask> GetCustomerItemMailGroupByCustomerCode(string id); + /// + /// 確認序號是否已通過FQC檢驗 + /// + /// 內部序號 + /// 出貨序號 + /// + [WebApiClient.Attributes.HttpGet("http://192.168.4.109:5088/api/FqcInhouseMaster/CheckFQCTestOk1")] + ITask> CheckFQCTestOk(string barcodeNo = null, string extraBarcodeNo = null); #region "PTD003 作業查詢" @@ -101,7 +119,7 @@ namespace AMESCoreStudio.Web ITask> GetRecordTypes(); [WebApiClient.Attributes.HttpGet("api/WipInfos/GetData4PTD003")] - ITask> GetData4PTD003(string recordType, string recordNumber, string lineNo, string materialNo, string shippingSN, string dateStart, string dateEnd, string RBU); + ITask> GetData4PTD003(string recordType, string recordNumber, string lineNo, string materialNo, string shippingSN, string dateStart, string dateEnd, string RBU, string soNumber, string soLineNo, string customer); [WebApiClient.Attributes.HttpGet("api/WipInfos/GetCustomer/{recordNumber}")] ITask GetCustomer(string recordNumber); @@ -140,6 +158,28 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpDelete("api/WipInfos/DeleteRecordTypeInfo/{id}")] ITask> DeleteRecordTypeInfo(string id); + /// + /// 查詢 ZProductTrans + /// + /// 序號 + /// RecordNumber + /// LineNo + /// 料號 + /// 類型 + /// + [WebApiClient.Attributes.HttpGet("api/PTD/GetZProductTrans")] + ITask> GetZProductTrans(string serialNumber = null, string recordNumber = null, string lineNo = null, string productID = null, string recordTypeID = null); + + + /// + /// 更新 PTD ZDNDetail RecordNumber ByisRecord 已扣帳狀態 + /// + /// RecordNumber + /// LineNo + /// 已扣障 0:未完成 1:已完成 + /// + [WebApiClient.Attributes.HttpPut("api/PTD/PutZDNDetail")] + ITask PutZDNDetailByIsRecord(string dnNo, string dnlineNo, int isRecord); #endregion #region "PTD005 設定 ERP 客戶代號和客戶收件人名單" @@ -197,20 +237,38 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpDelete("api/WipInfos/DeleteZWHPickListDetail/{sn}")] ITask> DeleteZWHPickListDetail(string sn); + + [WebApiClient.Attributes.HttpDelete("api/WipInfos/DeleteZWHPickListDetailAll/{recordNo}/{lineNo}")] + ITask> DeleteZWHPickListDetailAll(string recordNo, string lineNo); #endregion #region "PTD007 扣帳作業" [WebApiClient.Attributes.HttpGet("api/WipInfos/GetZDNDetailJoinZWHPickListDetail")] ITask> GetZDNDetailJoinZWHPickListDetail(string recordType, string recordNumber); + [WebApiClient.Attributes.HttpPost("api/WipInfos/PostPTD007Commit")] ITask> PostPTD007Commit([FromBody, RawJsonContent] string model); + + [WebApiClient.Attributes.HttpGet("api/WipInfos/GetPTD007QueryByRBU")] + ITask> GetPTD007QueryByRBU(string recordNumber, string RBU); + + [WebApiClient.Attributes.HttpPost("api/WipInfos/PostPTD007CommitByRBU")] + ITask> PostPTD007CommitByRBU([FromBody, RawJsonContent] string model); + #endregion #region "PTD008 還原作業" [WebApiClient.Attributes.HttpGet("api/WipInfos/GetData4PTD008")] ITask> GetData4PTD008(string recordNumber, string lineNo, string materialNo, string shippingSN); + [WebApiClient.Attributes.HttpPost("api/WipInfos/PostPTD008Commit")] ITask> PostPTD008Commit([FromBody, RawJsonContent] string model); + + [WebApiClient.Attributes.HttpPut("api/PTD/PTD008")] + ITask Put_PTD008(string serialNumber, string recordNumber, string lineNo, string productID ,string recordTypeID); + + [WebApiClient.Attributes.HttpDelete("api/PTD/PTD008")] + ITask Del_PTD008(string serialNumber, string recordNumber, string lineNo, string productID); #endregion } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs b/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs index 3db00cc7..0e353ae4 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs @@ -278,7 +278,7 @@ namespace AMESCoreStudio.Web /// IPQC資料 /// /// - [WebApiClient.Attributes.HttpGet("api/InspectionResultMasters/IpqcQuery/{InspectionID}")] + [WebApiClient.Attributes.HttpGet("api/InspectionResultMasters/IpqcQueryToSPC005/{InspectionID}")] ITask> GetIpqcQuery(int InspectionID); diff --git a/AMESCoreStudio.Web/Startup.cs b/AMESCoreStudio.Web/Startup.cs index ec9efe5d..41af1b38 100644 --- a/AMESCoreStudio.Web/Startup.cs +++ b/AMESCoreStudio.Web/Startup.cs @@ -50,7 +50,7 @@ namespace AMESCoreStudio.Web // ValidationVisitor exceeded the maximum configured validation depth '32' services.AddMvc().AddMvcOptions(options => { - options.MaxModelValidationErrors = 999999; + options.MaxModelValidationErrors = 999999; }); // ɮץؿ @@ -80,11 +80,15 @@ namespace AMESCoreStudio.Web { config.ForEach(f => { - fileServerOptions.Add(new FileServerOptions + try { - FileProvider = new PhysicalFileProvider(@f.RealPath), - RequestPath = new PathString(f.RequestPath), - }); + fileServerOptions.Add(new FileServerOptions + { + FileProvider = new PhysicalFileProvider(@f.RealPath), + RequestPath = new PathString(f.RequestPath), + }); + } + catch { } }); }; services.AddSingleton(new FileServerProvider(fileServerOptions)); diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 6313ab3f..37f1c303 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -519,18 +519,9 @@
- - - + + +
@@ -546,10 +537,7 @@
- +
@@ -570,10 +558,7 @@
- +
@@ -586,10 +571,7 @@
- +
@@ -605,10 +587,7 @@
- +
@@ -722,252 +701,252 @@ @* 系統-工程資訊sheet *@
-
-
- -
- -
+
+
+
+ +
+ +
- -
- -
+ +
+ +
-
- - @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) - { - 有維護標準工時 - } - else - { - **無維護標準工時** - } +
+ + @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) + { + 有維護標準工時 + } + else + { + **無維護標準工時** + } +
-
-
-
- -
- -
-
- +
+
+ +
+ +
+
+ +
-
-
- -
- +
+ +
+ +
-
-
-
- -
- -
- -
- -
-
小時
- -
- -
- -
- -
-
- - - +
+
+ +
+ +
+ +
+ +
+
小時
+ +
+ +
+ +
+ +
+
-
-
- -
- +
+ +
+ +
-
-
-
- -
- -
-
- -
-
- -
- -
- -
- -
- +
+
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
+
-
-
-
-
- -
- -
- -
- +
+
+ +
+ +
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
+ +
+ +
- -
- +
+ +
+ +
+
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
- -
- -
+
+ 請先維護標工資訊
@@ -1040,8 +1019,8 @@ SOP文件敘述 @* - 檔案路徑 - *@ + 檔案路徑 + *@ SOP類型 @@ -1065,8 +1044,8 @@ @* - - *@ + + *@ @@ -1225,7 +1204,7 @@ RuleStation($("#flowId").val()); - // 安勤統一只Show工程資訊 + // 統一Show工程資訊 $("#system").show(); $("#board").hide(); @@ -1240,6 +1219,20 @@ } } + // 無標工資訊,不顯示工程資訊 + let totalCt1 = '@Model.itemNoCT1'; + if (totalCt1 === '' || totalCt1 ==='0') + { + $("#wipSystemDataView").hide(); + $("#wipsystemNoCT1AlertShow").show(); + } + else + { + $("#wipSystemDataView").show(); + $("#wipsystemNoCT1AlertShow").hide(); + } + console.log(totalCt1); + // DIV 出貨序號 if ($('#wipBarcodeOtherCount').val() != "0") { $("#barcodeOtherDiv").hide(); diff --git a/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml index 8d8c0173..0304f83b 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml @@ -501,18 +501,9 @@
- - - + + +
@@ -528,10 +519,7 @@
- +
@@ -552,10 +540,7 @@
- +
@@ -568,10 +553,7 @@
- +
@@ -587,10 +569,7 @@
- +
@@ -704,252 +683,252 @@ @* 系統-工程資訊sheet *@
-
-
- -
- -
+
+
+
+ +
+ +
- -
- -
+ +
+ +
-
- - @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) - { - 有維護標準工時 - } - else - { - **無維護標準工時** - } +
+ + @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) + { + 有維護標準工時 + } + else + { + **無維護標準工時** + } +
-
-
-
- -
- -
-
- +
+
+ +
+ +
+
+ +
-
-
- -
- +
+ +
+ +
-
-
-
- -
- -
- -
- -
-
小時
- -
- -
- -
- -
-
- - - +
+
+ +
+ +
+ +
+ +
+
小時
+ +
+ +
+ +
+ +
+
-
-
- -
- +
+ +
+ +
-
-
-
- -
- -
-
- -
-
- -
- -
- -
- -
- +
+
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
-
-
-
- -
- -
-
- -
-
- +
+
+ +
+ +
+
+ +
+
+ +
+
-
-
-
-
- -
- -
- -
- +
+
+ +
+ +
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
+ +
+ +
- -
- +
+ +
+ +
+
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
- -
- -
+
+ 請先維護標工資訊
@@ -1022,8 +1001,8 @@ SOP文件敘述 @* - 檔案路徑 - *@ + 檔案路徑 + *@ SOP類型 @@ -1047,8 +1026,8 @@ @* - - *@ + + *@ @@ -1206,7 +1185,7 @@ } RuleStation($("#flowId").val()); - // 安勤統一只Show工程資訊 + // 統一Show工程資訊 $("#system").show(); $("#board").hide(); @@ -1221,6 +1200,19 @@ } } + // 無標工資訊,不顯示工程資訊 + let totalCt1 = '@Model.itemNoCT1'; + if (totalCt1 === '' || totalCt1 ==='0') + { + $("#wipSystemDataView").hide(); + $("#wipsystemNoCT1AlertShow").show(); + } + else + { + $("#wipSystemDataView").show(); + $("#wipsystemNoCT1AlertShow").hide(); + } + // DIV 出貨序號 if ($('#wipBarcodeOtherCount').val() != "0") { $("#barcodeOtherDiv").hide(); diff --git a/AMESCoreStudio.Web/Views/PTD/PTD002.cshtml b/AMESCoreStudio.Web/Views/PTD/PTD002.cshtml index 9ca9f752..57e98a9d 100644 --- a/AMESCoreStudio.Web/Views/PTD/PTD002.cshtml +++ b/AMESCoreStudio.Web/Views/PTD/PTD002.cshtml @@ -76,7 +76,7 @@
- +
@@ -105,7 +105,6 @@
-
@@ -120,54 +119,49 @@
-
-
-
-
- -
-
- -
-
-
- -
+
+ +
+
+
-
- -
- -
+
+
+
-
- -
- -
+
+
+ +
+
+
+ +
+ +
+
+
-
-
-
- -
-
- -
- - +
+
+ +
+
-
- -
- -
+ + +
+
+ +
+
- + 條碼輸入與Excel匯入,只能選一種執行
+
@@ -222,6 +216,7 @@ var recordNumber = document.getElementById('recordNumber').value; var recordType = document.getElementById('recordType').value; var recordTypeInfo = @Html.Raw(Json.Serialize(ViewBag.RecordTypeInfo)); + var lineNo = document.getElementById('lineNo').value; var filteredInfo = recordTypeInfo.find(function (info) { return info.id === recordType; }); @@ -239,8 +234,32 @@ $("#recordNumber").val(''); return; } - var lineNo = document.getElementById('lineNo'); - lineNo.focus(); + + if (lineNo.length === 0) { + document.getElementById('lineNo').focus(); + } + else { + $.ajax({ + url: '@Url.Action("CheckRecordNoIsRecord", "PTD")', + type: 'POST', + data: { dnNo: recordNumber, dnlineNo: lineNo }, + success: function (result) { + // 处理成功的情况 + if (!result.success) { + hg.msg(`RecordNumber【${recordNumber}】 LineNo【${lineNo}】 已備貨完成`); + $("#recordNumber").val(''); + $("#lineNo").val(''); + $("#Customer").val(''); + $('#PartNumber').val(''); + $("#PartDesc").val(''); + } + }, + error: function (error) { + hg.msg('錯誤:' + error); + console.log(error); + } + }); + } } }); @@ -275,9 +294,30 @@ console.log(error); } }); - } + $.ajax({ + url: '@Url.Action("CheckRecordNoIsRecord", "PTD")', + type: 'POST', + data: { dnNo: recordNumber, dnlineNo: lineNo }, + success: function (result) { + // 处理成功的情况 + if (!result.success) { + hg.msg(`RecordNumber【${recordNumber}】 LineNo【${lineNo}】 已備貨完成`); + $("#recordNumber").val(''); + $("#lineNo").val(''); + $("#Customer").val(''); + $('#PartNumber').val(''); + $("#PartDesc").val(''); + } + }, + error: function (error) { + hg.msg('錯誤:' + error); + console.log(error); + } + }); + } }); + $('#PartNumber').on('keypress', function (event) { if (event.keyCode == 13) { getItemDesc(document.getElementById('PartNumber').value); @@ -360,6 +400,16 @@ }; var serializedData = new URLSearchParams(postData).toString(); + var index = layer.load(1, { + shade: [0.4, '#000'], + content: '儲存中......', + success: function (layero) { + layero.find('.layui-layer-content').css({ + 'padding-top': '60px', + 'width': '200px' + }) + } + }); $.ajax({ url: "@Url.Action("PTD002_CheckInputData", "PTD")", @@ -372,6 +422,11 @@ } // 用来统计重复的SN var duplicateSNs = []; + // 清空表格 + layui.table.reload('query', { + data: [], + }); + res.data.forEach(function (item) { if (isSNAlreadyExist('query', item.sn)) { // 将重复的SN加入到duplicateSNs数组中 @@ -390,6 +445,9 @@ hg.msg('加入失敗:' + res.msg); } }, + complete: function (XMLHttpRequest, status) { //请求完成后最终执行参数 + layer.close(index); + }, error: function (error) { hg.msg('加入失敗:' + error.msg); return; @@ -414,7 +472,6 @@ return; // Do not add the row } - var postData = { recordType: recordType, workCenter: workCenter, @@ -423,7 +480,6 @@ recordDate: recordDate, location: location, customer: customer, - tableData: tableData }; diff --git a/AMESCoreStudio.Web/Views/PTD/PTD003.cshtml b/AMESCoreStudio.Web/Views/PTD/PTD003.cshtml index 361979bd..658b5001 100644 --- a/AMESCoreStudio.Web/Views/PTD/PTD003.cshtml +++ b/AMESCoreStudio.Web/Views/PTD/PTD003.cshtml @@ -41,7 +41,7 @@
+
@@ -58,15 +58,15 @@
- +
- +
- +
@@ -74,11 +74,19 @@
-
+
- + +
+ +
+ +
+ +
+
@@ -90,7 +98,7 @@
- +
@@ -118,9 +126,12 @@
+
+ +
-
+
@section Scripts{ @@ -214,36 +225,50 @@ }; $('#recordNumber').on('keypress', function (event) { - if (event.keyCode == 13) { getCustomer($('#recordNumber').val()); } - }); //监听表单提交事件 hg.form.onsubmit('querysubmit', function (data) { hg.msghide("重新載入資料.."); data.autoLoad = 1; - table && table.reload(data); + //table && table.reload(data); + console.log(data); + layui.table.reload('query', { + where: { + recordType: data.recordType, + recordNumber: data.recordNumber, + lineNo: data.lineNo, + materialNo: data.materialNo, + shippingSN: data.shippingSN, + dateStart: data.dateStart, + dateEnd: data.dateEnd, + autoLoad: data.autoLoad, + RBU: data.RBU, + soNumber: data.soNumber, + soLineNo: data.soLineNo, + customer: data.customer + }, + done: function (res, curr, count) { + $('#rowCount').text('總筆數: ' + count); + } + }); }); var tableCols = [[ { field: 'recordTypeID', title: 'RecordType', - sort: true }, { field: 'recordNumber', title: 'RecordNumber', - sort: true }, { field: 'lineNo', - width: 120, title: 'LineNo', - sort: true }, { field: 'sn', @@ -257,27 +282,35 @@ sort: true }, { - field: 'customer', - title: 'Customer', - width: 160, - sort: true + field: 'soNumber', + title: 'SO Number', + }, + { + field: 'soLineNo', + title: 'SO Line', }, { field: 'location', title: 'Location', - width: 100, - sort: true }, { - field: 'creatorID', + field: 'empID', title: 'EMP', - width: 100, sort: true }, + { + field: 'extNotes', + title: 'Notes', + }, { field: 'recordDate', title: 'RecordDate', templet: '
{{ layui.util.toDateString(d.recordDate, "yyyy/MM/dd HH:mm:ss") }}
' + }, + { + field: 'createDate', + title: 'CreateDate', + templet: '
{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd HH:mm:ss") }}
' }] ]; diff --git a/AMESCoreStudio.Web/Views/PTD/PTD004.cshtml b/AMESCoreStudio.Web/Views/PTD/PTD004.cshtml index 956d3aa5..ecbce47d 100644 --- a/AMESCoreStudio.Web/Views/PTD/PTD004.cshtml +++ b/AMESCoreStudio.Web/Views/PTD/PTD004.cshtml @@ -31,7 +31,6 @@ }, { field: 'id', - width: 100, title: '代號' }, { @@ -47,12 +46,10 @@ { field: 'source', title: '來源', - width: 160 }, { field: 'prefixCode', title: '開頭', - width: 160 }, { field: 'length', @@ -193,25 +190,26 @@ //通过行tool编辑,lay-event="edit" function edit(obj) { - if (obj.data.id) { - hg.open('修改單頭說明', '/PTD/PTD004U/' + obj.data.id, 480, 480); + if (obj.data.seq) { + hg.open('修改單頭說明', '/PTD/PTD004U?idx=' + obj.data.sEQ, 480, 480); } } //通过行tool删除,lay-event="del" function del(obj) { - if (obj.data.id) { + if (obj.data.seq) { hg.confirm("系統:" + obj.data.typeName + ",確定要刪除嗎?", function () { $.ajax({ url: '/PTD/PTD004D', - data: { id: obj.data.id }, + data: { id: obj.data.seq }, type: 'POST', success: function (res) { if (res.success) { hg.msghide("刪除成功!", { icon: 6 }); - layui.table.reload('test', { page: { curr: $(".layui-laypage-em").next().html() } }) + layui.table.reload('test') + //layui.table.reload('test', { page: { curr: $(".layui-laypage-em").next().html() } }) } else { hg.msg(data.msg); diff --git a/AMESCoreStudio.Web/Views/PTD/PTD004U.cshtml b/AMESCoreStudio.Web/Views/PTD/PTD004U.cshtml index 8574fad2..40881c8a 100644 --- a/AMESCoreStudio.Web/Views/PTD/PTD004U.cshtml +++ b/AMESCoreStudio.Web/Views/PTD/PTD004U.cshtml @@ -16,6 +16,7 @@
+
diff --git a/AMESCoreStudio.Web/Views/PTD/PTD005.cshtml b/AMESCoreStudio.Web/Views/PTD/PTD005.cshtml index 2b2cd28b..67657702 100644 --- a/AMESCoreStudio.Web/Views/PTD/PTD005.cshtml +++ b/AMESCoreStudio.Web/Views/PTD/PTD005.cshtml @@ -57,8 +57,8 @@ //通过行tool编辑,lay-event="edit" function edit(obj) { - if (obj.data.itemNumber) { - hg.open('修改收件人名單', '/PTD/PTD005U/' + obj.data.itemNumber, 480,480); + if (obj.data.customerCode) { + hg.open('修改收件人名單', '/PTD/PTD005U/' + obj.data.customerCode, 480,480); } } @@ -69,11 +69,11 @@ str = "停用"; else str = "啟用"; - if (obj.data.itemNumber) { - hg.confirm("料號:" + obj.data.itemNumber + ",確定要"+str+"嗎?", function () { + if (obj.data.customerCode) { + hg.confirm("客戶代號:" + obj.data.customerCode + ",確定要"+str+"嗎?", function () { $.ajax({ url: '/PTD/PTD005D', - data: { id: obj.data.itemNumber }, + data: { id: obj.data.customerCode }, type: 'POST', success: function (data) { if (data.success) { diff --git a/AMESCoreStudio.Web/Views/PTD/PTD005U.cshtml b/AMESCoreStudio.Web/Views/PTD/PTD005U.cshtml index c11f257f..5c4691eb 100644 --- a/AMESCoreStudio.Web/Views/PTD/PTD005U.cshtml +++ b/AMESCoreStudio.Web/Views/PTD/PTD005U.cshtml @@ -19,11 +19,11 @@
- +
- +
diff --git a/AMESCoreStudio.Web/Views/PTD/PTD006.cshtml b/AMESCoreStudio.Web/Views/PTD/PTD006.cshtml index a8d3b04f..fc122e03 100644 --- a/AMESCoreStudio.Web/Views/PTD/PTD006.cshtml +++ b/AMESCoreStudio.Web/Views/PTD/PTD006.cshtml @@ -68,7 +68,7 @@
- +
@@ -111,52 +111,47 @@
+
-
-
-
-
- -
-
- -
-
-
- -
+
+ +
+
+
-
- -
- -
- -
- -
+
+
+
- -
-
-
- -
-
- -
- - +
+ +
+
-
- -
- -
+ +
+
+
+
+ +
+
+ +
+ + +
+
+ +
+ +
+
+ 條碼輸入與Excel匯入,只能選一種執行
@@ -209,42 +204,81 @@ var recordNumber = document.getElementById('recordNumber').value; var recordType = document.getElementById('recordType').value; var recordTypeInfo = @Html.Raw(Json.Serialize(ViewBag.RecordTypeInfo)); - var filteredInfo = recordTypeInfo.find(function (info) { + var lineNo = document.getElementById('lineNo').value; + var filteredInfo = recordTypeInfo.filter(function (info) { return info.id === recordType; }); - //check recordNumber - if (recordNumber.length !== filteredInfo.length) { - layer.msg('請確認recordNumber碼長!', { icon: 2 }); + + var allPrefixes = []; + var isAnyValid = filteredInfo.some(function (filteredInfo) { + // 检查 recordNumber 长度 + if (recordNumber.length !== filteredInfo.length) { + layer.msg('請確認recordNumber碼長!', { icon: 2 }); + $("#recordNumber").val(''); + return false; // 退出 some 循环 + } + + // 检查 recordNumber 是否以 prefixCode 开头 + var prefixCode = filteredInfo.prefixCode; + if (recordNumber.startsWith(prefixCode)) { + return true; // 有一个符合条件,退出 some 循环 + } else { + allPrefixes.push(prefixCode); // 收集不符合的 prefixCode + return false; + } + }); + + if (!isAnyValid) { + layer.msg('recordNumber開頭必須是其中之一: ' + allPrefixes.join(', '), { icon: 2 }); $("#recordNumber").val(''); return; } - // Check if recordNumber starts with prefixCode - var prefixCode = filteredInfo.prefixCode; - if (!recordNumber.startsWith(prefixCode)) { - layer.msg('recordNumber開頭必須是:' + prefixCode, { icon: 2 }); - $("#recordNumber").val(''); - return; + + if (lineNo.length === 0) { + document.getElementById('lineNo').focus(); } + else { + table.reload('query', { + where: { + recordNumber: recordNumber, + LineNO: lineNo + }, + page: { + curr: 1 + }, + done: function (res, curr, count) { + // 表格更新成功後計算資料筆數 + calculateRowCount(res.data); + } + }); - table.reload('query', { - where: { - recordNumber: recordNumber - }, - page: { - curr: 1 + $.ajax({ + url: '@Url.Action("CheckRecordNoIsRecord", "PTD")', + type: 'POST', + data: { dnNo: recordNumber, dnlineNo: lineNo }, + success: function (result) { + // 处理成功的情况 + if (!result.success) { + hg.msg(`RecordNumber【${recordNumber}】 LineNo【${lineNo}】 已備貨完成`); + $("#recordNumber").val(''); + $("#lineNo").val(''); + $("#Customer").val(''); + $('#PartNumber').val(''); + $("#PartDesc").val(''); + } }, - done: function (res, curr, count) { - // 表格更新成功後計算資料筆數 - calculateRowCount(res.data); - var lineNo = document.getElementById('lineNo'); - lineNo.focus(); + error: function (error) { + hg.msg('錯誤:' + error); + console.log(error); } }); + } //calculateRowCount(table.cache['query']); //var lineNo = document.getElementById('lineNo'); //lineNo.focus(); } }); + $('#lineNo').on('keypress', function (event) { if (event.keyCode == 13) { var table = layui.table; @@ -290,8 +324,30 @@ console.log(error); } }); + + $.ajax({ + url: '@Url.Action("CheckRecordNoIsRecord", "PTD")', + type: 'POST', + data: { dnNo: recordNumber, dnlineNo: lineNo }, + success: function (result) { + // 处理成功的情况 + if (!result.success) { + hg.msg(`RecordNumber【${recordNumber}】 LineNo【${lineNo}】 已備貨完成`); + $("#recordNumber").val(''); + $("#lineNo").val(''); + $("#Customer").val(''); + $('#PartNumber').val(''); + $("#PartDesc").val(''); + } + }, + error: function (error) { + hg.msg('錯誤:' + error); + console.log(error); + } + }); } }); + $('#snQuery').on('keypress', function (event) { if (event.keyCode == 13) { var table = layui.table; @@ -402,6 +458,17 @@ var serializedData = new URLSearchParams(postData).toString(); + var index = layer.load(1, { + shade: [0.4, '#000'], + content: '資料處理中......', + success: function (layero) { + layero.find('.layui-layer-content').css({ + 'padding-top': '60px', + 'width': '200px' + }) + } + }); + $.ajax({ url: "@Url.Action("PTD006_CheckInputData", "PTD")", type: 'POST', @@ -411,6 +478,9 @@ if (res.msg) { hg.msg(res.msg); } + else { + layer.msg('備貨成功!', { icon: 1 }); + } var table = layui.table; table.reload('query', { where: { @@ -423,7 +493,6 @@ done: function(res, curr, count) { // 表格更新成功後計算資料筆數 calculateRowCount(res.data); - layer.msg('備貨成功!', { icon: 1 }); } }); } @@ -431,6 +500,9 @@ hg.msg('加入失敗:' + res.msg); } }, + complete: function (XMLHttpRequest, status) { //请求完成后最终执行参数 + layer.close(index); + }, error: function (error) { hg.msg('加入失敗:' + error.msg); return; @@ -441,15 +513,15 @@ $('#delAll').on('click', function () { hg.confirm("請確認是否整批刪除?", function () { var tableData = layui.table.cache['query']; - - $.each(tableData, function (index, data) { + if (tableData && tableData.length > 0) { + var firstRow = tableData[0]; + console.log(firstRow); $.ajax({ - url: '/PTD/PTD006D', - data: { sn: data.sn }, + url: '/PTD/PTD006DAll', + data: { recordNumber: firstRow.dnNo, lineNo: firstRow.lineNo }, type: 'POST', success: function (res) { if (res.success) { - if (index == (tableData.length - 1)) { // 重新加载表格数据 layui.table.reload('query', { data: tableData, @@ -458,27 +530,13 @@ }); calculateRowCount(tableData); hg.msg('刪除成功'); - } - } - else { - hg.msg(res.msg); - - // 重新加载表格数据 - layui.table.reload('query', { - data: tableData, - page: false, - limit: 2000 - }); - calculateRowCount(tableData); - } }, error: function () { hg.msg("網路請求失敗!"); } }); - }); - + } }); }); diff --git a/AMESCoreStudio.Web/Views/PTD/PTD008.cshtml b/AMESCoreStudio.Web/Views/PTD/PTD008.cshtml index e237e6c2..a64d8175 100644 --- a/AMESCoreStudio.Web/Views/PTD/PTD008.cshtml +++ b/AMESCoreStudio.Web/Views/PTD/PTD008.cshtml @@ -36,49 +36,47 @@
-
-
-
- -
- -
- -
- -
+
+
+ +
+
-
-
-
-
-
- -
- -
+
+
+ +
+
-
-
-
-
-
- -
- -
+
+
+ +
+
-
- +
+
+
+
+ +
+
+
+ +
+
+
+
+
@@ -88,7 +86,6 @@
-
@@ -97,136 +94,154 @@ @section Scripts{ - -} \ No newline at end of file +} diff --git a/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml b/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml index fa98a8b2..e599e800 100644 --- a/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml +++ b/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml @@ -48,6 +48,6 @@ ]; //基本数据表格 - var table = hg.table.datatable('test', '在製條碼資料', '/QRS/GetWipStationBarcode/' + wip_id.value + '_' + station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + var table = hg.table.datatable('test', '在製條碼資料', '/QRS/GetWipStationBarcodeNew/' + wip_id.value + '_' + station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml index 0ab8e54b..77758eb0 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml @@ -247,7 +247,7 @@ sort: true }, { - align: 'center', title: '操作', width: 150, fixed: 'right', + align: 'center', title: '操作', width: 250, fixed: 'right', sort: true, templet: function (item) { var btns = ''; @@ -257,7 +257,9 @@ else if (item.statusNo == "保存") { btns = btns + '檢視'; if (item.inspectionTypeID == 1001) { - btns = btns + 'PDF '; + btns = '编辑' + + btns + + 'PDFExcel '; } if (item.inspectionTypeID == 1000 || item.inspectionTypeID == 1002) { btns = btns + 'PDF '; @@ -282,6 +284,13 @@ hg.open('PDF', '/SPC/SPC005_PDF?id=' + obj.data.inspectionID +"&Types=IPQC" , '', '', true); } } + function Excel(obj) { + if (obj.data.inspectionID) { + window.open('/SPC/SPC005_Excel?id=' + obj.data.inspectionID + "&Types=IPQC", '', '', true); + return; + //hg.open('Excel', '/FQC/FQC010_Excel?inhouseNo=' + obj.data.inhouseNo + '&seqID=' + obj.data.seqID, '', '', true); + } + } function PDF_FAI(obj) { if (obj.data.inspectionID) { diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml index 7b81d5b6..7c52fe28 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml @@ -138,7 +138,7 @@ @*回復*@ - - } diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005V.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005V.cshtml index 4f1796c7..2e6d316f 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005V.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005V.cshtml @@ -1,7 +1,8 @@ @model AMESCoreStudio.WebApi.Models.AMES.InspectionResultMaster -@{ ViewData["Title"] = "SPC005U"; +@{ + ViewData["Title"] = "SPC005U"; Layout = "~/Views/Shared/_AMESLayout.cshtml"; //Layout = "~/Views/Shared/_FormLayout.cshtml"; } @@ -15,12 +16,24 @@ margin-left: -10px; margin-right: -10px; } + .layui-table-cell { height: auto; overflow: visible; text-overflow: inherit; white-space: normal } + + .layui-disabled-red { + color: red !important; + cursor: not-allowed !important + } + + .layui-disabled-green { + color: green !important; + cursor: not-allowed !important + } + green
@@ -64,15 +77,17 @@
-
+
@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); - await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + @{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); + } @*回復*@ } diff --git a/AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml index 9b2e9916..20c7c6e0 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml @@ -447,7 +447,7 @@ success: function (result) { if (result.data) { $("#DutyUserID").empty(); - $('#DutyUserID').append(new Option("請選擇", "")); + $('#DutyUserID').append(new Option("請選擇", "-1")); var count = 0; $.each(result.data, function (index, item) { if (item.deptID == data) { @@ -457,12 +457,12 @@ }); if (count == 0) { $("#DutyUserID").empty(); - $('#DutyUserID').append(new Option("無選項", "")); + $('#DutyUserID').append(new Option("無選項", "-1")); } } else { $("#DutyUserID").empty(); - $('#DutyUserID').append(new Option("無選項", "")); + $('#DutyUserID').append(new Option("無選項", "-1")); } layui.form.render("select"); } diff --git a/AMESCoreStudio.Web/wwwroot/Reports/SPC005View1.rdlc b/AMESCoreStudio.Web/wwwroot/Reports/SPC005View1.rdlc new file mode 100644 index 00000000..557c0bef --- /dev/null +++ b/AMESCoreStudio.Web/wwwroot/Reports/SPC005View1.rdlc @@ -0,0 +1,2929 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + e0dcb4ed-57fb-41b0-a865-d53383fc0026 + + + + + + Accessory + /* Local Query */ + + + + Approved + System.String + + + Inspector + System.String + + + PlanQTY + System.String + + + BIOSVer + System.String + + + InspectionDate + System.String + + + InspectionNumber + System.String + + + MedicalModel + System.String + + + ItemNo + System.String + + + ItemNoDesc + System.String + + + OrderNumber + System.String + + + VIP + System.String + + + ApprovedSignImg + System.String + + + InspectorSignImg + System.String + + + + Accessory + FQC010VIiew + Accessory.FQC010VIiew, Accessory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + Accessory + /* Local Query */ + + + + BarcodeNO + System.String + + + Result + System.String + + + Defect + System.String + + + + Accessory + FQC010VIiew + Detail1 + Accessory.FQC010VIiew, Accessory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + Accessory + /* Local Query */ + + + + BarcodeNO + System.String + + + InspectionResults + System.String + + + InspectionItemDesc + System.String + + + SEQ + System.String + + + + Accessory + FQC010VIiew + Detail2 + Accessory.FQC010VIiew, Accessory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + Accessory + /* Local Query */ + + + + BarcodeNO + System.String + + + Result + System.String + + + Defect + System.String + + + + Accessory + FQC010VIiew + Detail1 + Accessory.FQC010VIiew, Accessory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + Accessory + /* Local Query */ + + + + BarcodeNO + System.String + + + InspectionResults + System.String + + + InspectionItemDesc + System.String + + + SEQ + System.String + + + + Accessory + FQC010VIiew + Detail2 + Accessory.FQC010VIiew, Accessory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + Accessory + /* Local Query */ + + + + BarcodeNO + System.String + + + Result + System.String + + + Defect + System.String + + + + Accessory + FQC010VIiew + Detail1 + Accessory.FQC010VIiew, Accessory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + Accessory + /* Local Query */ + + + + BarcodeNO + System.String + + + InspectionResults + System.String + + + InspectionItemDesc + System.String + + + SEQ + System.String + + + + Accessory + FQC010VIiew + Detail2 + Accessory.FQC010VIiew, Accessory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + + + + + + + true + true + + + + + IPQC檢驗單號: + + + + + + + Textbox1 + 1.36409cm + 0.30622cm + 0.60324cm + 4.68409cm + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 工單/委外廠單號: + + + + + + + Textbox1 + 1.96733cm + 0.30622cm + 0.60324cm + 4.68409cm + 1 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 料號: + + + + + + + Textbox1 + 2.57057cm + 0.30622cm + 0.60324cm + 4.68409cm + 2 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 數量: + + + + + + + Textbox1 + 3.17381cm + 0.30622cm + 0.60324cm + 4.68409cm + 3 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 醫療機種?: + + + + + + + Textbox1 + 3.17381cm + 8.33174cm + 0.60324cm + 3.04704cm + 4 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + BIOS Ver: + + + + + + + Textbox1 + 3.17381cm + 20.21795cm + 0.60324cm + 3.78532cm + 5 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Inspection Date: + + + + Textbox1 + 1.36409cm + 20.21795cm + 0.60324cm + 3.72887cm + 6 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Aulue-Technology Inc. + + + + + + + + + IPQC Inspection Report + + + + + + + Textbox44 + 0.10583cm + 9.15951cm + 1.24355cm + 9.71299cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + QQ4-044 + + + + + + + Textbox45 + 0.5147cm + 21.48352cm + 0.61419cm + 2.4633cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Rev.A7 + + + + + + + Textbox45 + 0.5147cm + 26.8639cm + 0.61419cm + 1.81031cm + 9 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!BIOSVer.Value, "DataSet1") + + + + + 0.5pt + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!InspectionDate.Value, "DataSet1") + + + + + 0.5pt + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!OrderNumber.Value, "DataSet1") + + 0.5pt + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!ItemNo.Value, "DataSet1") + + + + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!PlanQTY.Value, "DataSet1") + + + + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!VIP.Value, "DataSet1") + + + + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!InspectionNumber.Value, "DataSet1") + + + + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + avalue + FitProportional + 0.10583cm + 1.92953cm + 1.14483cm + 5.40124cm + 17 + + + + + + true + true + + + + + =First(Fields!MedicalModel.Value, "DataSet1") + + + + + 0.5pt + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + VIP?: + + + + + + + Textbox1 + 3.17381cm + 14.24447cm + 0.60324cm + 2.64327cm + 19 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ASSY + + + + + + + Textbox45 + 4.19762cm + 0.30622cm + 0.61419cm + 28.36799cm + 20 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + DodgerBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + 7.97752cm + + + 2.8473cm + + + 17.54318cm + + + + + 0.62117cm + + + + + true + true + + + + + 抽驗序號 + + + + Textbox38 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + 檢驗結果 + + + + Textbox40 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Defect description + + + + Textbox42 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.62117cm + + + + + true + true + + + + + =Fields!BarcodeNO.Value + + + + ItemID + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Result.Value + + + + ItemName + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Defect.Value + + + + ItemType + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet2 + 5.15641cm + 0.30622cm + 1.24234cm + 28.368cm + 21 + + + + + + + + + 3.79896cm + + + 2.06048cm + + + 12.45692cm + + + 1.74015cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!BarcodeNO.Value + + + + BarcodeNO + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SEQ.Value + + + + ProductionSerialNumber1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!InspectionItemDesc.Value + + + + ShippingSerialNumber + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!InspectionResults.Value + + + + InspectionResults + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + DataSet3 + 6.78923cm + 4.44345cm + 0.6cm + 20.05651cm + 22 + + + + + + true + true + + + + + TEST + + + + + + + Textbox45 + 8.28524cm + 0.30622cm + 0.61419cm + 28.36799cm + 23 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + DodgerBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + 7.97752cm + + + 2.8473cm + + + 17.54318cm + + + + + 0.62117cm + + + + + true + true + + + + + 抽驗序號 + + + + Textbox38 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + 檢驗結果 + + + + Textbox40 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Defect description + + + + Textbox42 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.62117cm + + + + + true + true + + + + + =Fields!BarcodeNO.Value + + + + ItemID + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Result.Value + + + + ItemName + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Defect.Value + + + + ItemType + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet2_TEST + 9.24403cm + 0.30622cm + 1.24234cm + 28.368cm + 24 + + + + + + + + + 3.79896cm + + + 2.06048cm + + + 12.45692cm + + + 1.74015cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!BarcodeNO.Value + + + + BarcodeNO1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SEQ.Value + + + + ProductionSerialNumber1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!InspectionItemDesc.Value + + + + ShippingSerialNumber + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!InspectionResults.Value + + + + InspectionResults + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + DataSet3_TEST + 10.87685cm + 4.44345cm + 0.6cm + 20.05651cm + 25 + + + + + + true + true + + + + + Packing + + + + + + + Textbox45 + 11.99999cm + 0.30622cm + 0.61419cm + 28.36799cm + 26 + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + DodgerBlue + 2pt + 2pt + 2pt + 2pt + + + + + + + 8.20078cm + + + 3.07056cm + + + 17.09666cm + + + + + 0.62117cm + + + + + true + true + + + + + 抽驗序號 + + + + Textbox38 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + 檢驗結果 + + + + Textbox40 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Defect description + + + + Textbox42 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.62117cm + + + + + true + true + + + + + =Fields!BarcodeNO.Value + + + + ItemID + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Result.Value + + + + ItemName + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Defect.Value + + + + ItemType + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet2_PACK + 12.95878cm + 0.30622cm + 1.24234cm + 28.368cm + 27 + + + + + + + + + 3.79896cm + + + 2.06048cm + + + 12.45692cm + + + 1.74015cm + + + + + 0.6cm + + + + + true + true + + + + + =Fields!BarcodeNO.Value + + + + BarcodeNO2 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SEQ.Value + + + + ProductionSerialNumber1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!InspectionItemDesc.Value + + + + ShippingSerialNumber + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!InspectionResults.Value + + + + InspectionResults + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + DataSet3_PACK + 14.5916cm + 4.44345cm + 0.6cm + 20.05651cm + 28 + + + + + + true + true + + + + + Inspector: + + + + + + + Textbox76 + 15.5803cm + 14.96744cm + 1.00557cm + 3.14055cm + 29 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + Database + =First(Fields!InspectorSignImg.Value, "DataSet1") + image/png + FitProportional + 15.5803cm + 18.17855cm + 1.00557cm + 4.62927cm + 30 + + + + + + true + + + + + Approved: + + + + + + + Textbox76 + 15.5803cm + 7.31026cm + 1.00557cm + 2.99263cm + 31 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!Approved.Value, "DataSet1") + + + + + + + 15.94013cm + 10.37345cm + 0.64574cm + 4.594cm + 32 + + =iif(IsNothing(First(Fields!ApprovedSignImg.Value, "DataSet1")),False,True) + + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + Database + =First(Fields!ApprovedSignImg.Value, "DataSet1") + image/png + FitProportional + 15.61558cm + 10.35961cm + 1.00557cm + 4.60783cm + 33 + + + + + + true + true + + + + + =First(Fields!Inspector.Value, "DataSet1") + + + + + + + 15.97541cm + 18.17855cm + 0.64574cm + 4.594cm + 34 + + =iif(IsNothing(First(Fields!InspectorSignImg.Value, "DataSet1")), False, True) + + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =First(Fields!ItemNoDesc.Value, "DataSet1") + + + + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + 2pt + 2pt + 2pt + 2pt + + + + true + 0.31154cm + 0.20185cm + 17.5985cm + 29.26494cm + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + Black + + 0.5pt + + + + + 7.14086in +