Browse Source

Yiru 修正ipqc報表展開之資料及ipqc 缺失人員加上工號(登入帳號)

PTD
BB.Wang 2 years ago
parent
commit
f5f04b0f9c
  1. 2
      AMESCoreStudio.Web/Controllers/SPCController.cs
  2. 22
      AMESCoreStudio.Web/Views/QRS/QRS015B.cshtml
  3. 8
      AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml
  4. 54
      AMESCoreStudio.WebApi/Controllers/AMES/InspectionResultMastersController.cs

2
AMESCoreStudio.Web/Controllers/SPCController.cs

@ -237,7 +237,7 @@ namespace AMESCoreStudio.Web.Controllers
UserItems.Add(new SelectListItem("N/A", "-1")); UserItems.Add(new SelectListItem("N/A", "-1"));
foreach (var item in result.Data) foreach (var item in result.Data)
{ {
UserItems.Add(new SelectListItem(item.UserName, item.UserID.ToString())); UserItems.Add(new SelectListItem(item.LoginNo +"_" +item.UserName, item.UserID.ToString()));
} }
ViewBag.UserList = UserItems; ViewBag.UserList = UserItems;
} }

22
AMESCoreStudio.Web/Views/QRS/QRS015B.cshtml

@ -23,7 +23,7 @@
}); });
var tableCols = [[ var tableCols = [[
{ {
field: 'inspectionNo', field: 'inspectionID',
width: 160, width: 160,
title: 'IPQC單號', title: 'IPQC單號',
sort: true sort: true
@ -34,9 +34,8 @@
title: '工單' title: '工單'
}, },
{ {
field: 'modelNo', field: 'barcodeNo',
width: 100, title: '檢驗序號'
title: '機種'
}, },
{ {
field: 'itemNo', field: 'itemNo',
@ -44,18 +43,9 @@
title: '料號' title: '料號'
}, },
{ {
field: 'lineDesc', field: 'createDate',
width: 60, width: 150,
title: '線別' title: '建立日期'
},
{
field: 'stationName',
width: 80,
title: '站別'
},
{
field: 'barcodeNo',
title: '序號'
}, },
{ {
field: 'result', field: 'result',

8
AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml

@ -162,18 +162,18 @@
</select> </select>
</script> </script>
@*缺失人員*@ @*缺失人員*@
@* <script type="text/html" id="selectUser"> <script type="text/html" id="selectUser">
<select name="selectUser" lay-filter="selectUser" id="selectUser" data-value={{d.missingUserID}} lay-search='' asp-items="@ViewBag.UserList" class="layui-form"> <select name="selectUser" lay-filter="selectUser" id="selectUser" data-value={{d.missingUserID}} lay-search='' asp-items="@ViewBag.UserList" class="layui-form">
</select> </select>
</script> </script>
<script type="text/html" id="selectUser"> @* <script type="text/html" id="selectUser">
<input type="text" name="selectUser" lay-filter="selectUser" id="selectUser" data-value={{d.missingUserID}} class="layui-input" style=" margin-top: -10px; margin-left: -10px; margin-right: -10px;"> <input type="text" name="selectUser" lay-filter="selectUser" id="selectUser" data-value={{d.missingUserID}} class="layui-input" style=" margin-top: -10px; margin-left: -10px; margin-right: -10px;">
</script> </script>
*@
<script type="text/html" id="selectUser"> <script type="text/html" id="selectUser">
<input type="text" name="selectUser" lay-filter="selectUser" id="selectUser" data-value={{d.missingUserID}} class="layui-input" style=" margin-top: -10px; margin-left: -10px; margin-right: -10px;"> <input type="text" name="selectUser" lay-filter="selectUser" id="selectUser" data-value={{d.missingUserID}} class="layui-input" style=" margin-top: -10px; margin-left: -10px; margin-right: -10px;">
</script> </script>*@
<script type="text/javascript"> <script type="text/javascript">
////保存 ////保存
$('#querysubmit').click(function () { $('#querysubmit').click(function () {

54
AMESCoreStudio.WebApi/Controllers/AMES/InspectionResultMastersController.cs

@ -218,27 +218,53 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
public async Task<ResultModel<dynamic>> GetIPQCDetailData(string wipNO, string itemNO, string modelNO, string dateStart, string dateEnd, string weekCode, int page = 0, int limit = 10) public async Task<ResultModel<dynamic>> GetIPQCDetailData(string wipNO, string itemNO, string modelNO, string dateStart, string dateEnd, string weekCode, int page = 0, int limit = 10)
{ {
ResultModel<dynamic> result = new ResultModel<dynamic>(); ResultModel<dynamic> result = new ResultModel<dynamic>();
var q = from q1 in _context.InspectionForms
join q2 in _context.InspectionItems on q1.InspectionFormID equals q2.InspectionFormID var d = _context.InspectionResultDetails;
join q3 in _context.InspectionResultDetails on q2.InspectionItemID equals q3.InspectionItemID
join q4 in _context.InspectionResultMasters on q1.InspectionFormID equals q4.InspectionFormID var q = from q0 in _context.InspectionTypes.Where(w => w.InspectionNo.Contains("IPQC"))
join q5 in _context.WipAtts on q4.WipNo equals q5.WipNO join q1 in _context.InspectionForms on q0.InspectionTypeID equals q1.InspectionTypeID
join q6 in _context.CalendarTables on q1.CreateDate.Date equals q6.TimeID join q4 in _context.InspectionResultMasters.Where(w => w.StatusNo == "C") on q1.InspectionFormID equals q4.InspectionFormID
join q7 in _context.LineInfoes on q3.LineID equals q7.LineID join q5 in _context.WipAtts on q4.WipNo equals q5.WipNO into cp5
from q5 in cp5.DefaultIfEmpty()
join q6 in _context.CalendarTables on q4.CreateDate.Date equals q6.TimeID
select new select new
{ {
q1.InspectionFormID, q1.InspectionFormID,
q1.InspectionNo, q4.InspectionID,
q1.CreateDate, q4.CreateDate,
q4.WipNo, q4.WipNo,
q5.ItemNO, q5.ItemNO,
q5.ModelNO, q5.ModelNO,
q7.LineDesc,
StationName = q3.Stations.StationName,
q4.BarcodeNo, q4.BarcodeNo,
q3.Result, IPQCWeek = q6.WeekOfYear,
IPQCWeek = q6.WeekOfYear Result = d.Where(w => w.InspectionID == q4.InspectionID && w.Result == "F").Select(s => s.Result).Count() > 0 ? "F" : "P" };
};
//var q = from q1 in _context.InspectionForms
// join q2 in _context.InspectionItems on q1.InspectionFormID equals q2.InspectionFormID
// join q3 in _context.InspectionResultDetails on q2.InspectionItemID equals q3.InspectionItemID
// join q4 in _context.InspectionResultMasters on q1.InspectionFormID equals q4.InspectionFormID
// join q5 in _context.WipAtts on q4.WipNo equals q5.WipNO
// join q6 in _context.CalendarTables on q1.CreateDate.Date equals q6.TimeID
// join q7 in _context.LineInfoes on q3.LineID equals q7.LineID
// select new
// {
// q1.InspectionFormID,
// q1.InspectionNo,
// q1.CreateDate,
// q4.WipNo,
// q5.ItemNO,
// q5.ModelNO,
// q7.LineDesc,
// StationName = q3.Stations.StationName,
// q4.BarcodeNo,
// q3.Result,
// IPQCWeek = q6.WeekOfYear
// };
if (wipNO != null && wipNO != "") if (wipNO != null && wipNO != "")
{ {

Loading…
Cancel
Save