Browse Source

1. 修正FQC007

PTD
Ray 3 years ago
parent
commit
739c96cbab
  1. 51
      AMESCoreStudio.Web/Controllers/FQCController.cs
  2. 46
      AMESCoreStudio.Web/Views/FQC/FQC007.cshtml
  3. 182
      AMESCoreStudio.Web/wwwroot/Reports/FQC010View.rdlc

51
AMESCoreStudio.Web/Controllers/FQCController.cs

@ -255,6 +255,27 @@ namespace AMESCoreStudio.Web.Controllers
ViewBag.GetAQL_TypeSelect = q;
}
/// <summary>
/// AQL_類型
/// </summary>
/// <param name="SelectedValue"></param>
private void GetInspectionStatusSelect(string SelectedValue = null)
{
List<string> values = new List<string>();
if (SelectedValue != null)
{
values = SelectedValue.Split(',').ToList();
}
var q = Enum.GetValues(typeof(EnumFQC.EnumInspection_Status)).Cast<EnumFQC.EnumInspection_Status>()
.Select(s => new SelectListItem
{
Text = EnumPCS.GetDisplayName(s).ToString(),
Value = s.ToString()
}).ToList();
ViewBag.GetInspectionStatusSelect = q;
}
#endregion
#region FQC001 檢驗類別維護
@ -756,6 +777,7 @@ namespace AMESCoreStudio.Web.Controllers
{
GetInspection_TypeSelect();
GetAQL_TypeSelect();
GetInspectionStatusSelect();
var model = new FqcDto();
if (!string.IsNullOrWhiteSpace(inhouseNo) && seqID != 0)
{
@ -803,6 +825,9 @@ namespace AMESCoreStudio.Web.Controllers
[HttpPost]
public async Task<IActionResult> FQC007Async(FqcDto model, string action)
{
GetInspection_TypeSelect();
GetAQL_TypeSelect();
GetInspectionStatusSelect();
if (string.IsNullOrWhiteSpace(model.InhouseNo))
{
ModelState.AddModelError("error", "請輸入入庫單號");
@ -827,6 +852,9 @@ namespace AMESCoreStudio.Web.Controllers
result_FQCResultMaster.Proved = model.Proved;
result_FQCResultMaster.OutfitNo = model.OutfitNo;
result_FQCResultMaster.InspectionType = model.InspectionType;
result_FQCResultMaster.Note = model.Note;
result_FQCResultMaster.ECN_Memo = model.ECN_Memo;
result_FQCResultMaster.InspectionStatus = model.InspectionStatus;
await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster));
ModelState.AddModelError("error", "儲存成功!");
}
@ -1040,8 +1068,17 @@ namespace AMESCoreStudio.Web.Controllers
var result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID);
var fqcItem = result.Data.FirstOrDefault();
// 抽驗數量 大於 本批次送驗量
if (fqcItem.QcQty > fqcItem.InhouseQty)
{
if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.FailQty)
{
var _msg = "抽樣數量不足,無法判定";
return RedirectToAction("Refresh", "Home", new { msg = _msg });
}
}
//當抽驗數量 小於 抽樣數量就離開
if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty)
else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty)
{
var _msg = "抽樣數量不足,無法判定";
return RedirectToAction("Refresh", "Home", new { msg = _msg });
@ -1412,7 +1449,7 @@ namespace AMESCoreStudio.Web.Controllers
DefectDescription = FqcQuery.QaMeno,
InspectionDate = FqcQuery.EndTime,
AC = FqcQuery.AcQty.ToString(),
Approved = "王曉明",
Approved = FqcQuery.Supervisor_Name,
AQL = FqcQuery.AQL.ToString(),
SpeciallyAdoption = FqcQuery.SpecialPo,
BIOSVer = FqcQuery.BIOS,
@ -1425,7 +1462,7 @@ namespace AMESCoreStudio.Web.Controllers
InspectionNumber = FqcQuery.InhouseNo,
InspectionStatus = FqcQuery.InspectionStatus,
InspectionType = FqcQuery.InspectionTypeName,
Inspector = "蔡喬虎",
Inspector = FqcQuery.UpdateUser_Name,
Judgment = "Defect Quantity",
Line = FqcQuery.InhouseMemo,
LotSize = FqcQuery.InhouseQty.ToString(),
@ -1527,12 +1564,16 @@ namespace AMESCoreStudio.Web.Controllers
if (resultFqcQuery.Data.Count() != 0)
{
var FqcQuery = resultFqcQuery.Data.FirstOrDefault();
// Enum 轉換
FqcQuery.AQLType = EnumFQC.GetDisplayName((EnumFQC.EnumAQL_Type)Enum.Parse(typeof(EnumFQC.EnumAQL_Type), FqcQuery.AQLType));
FqcQuery.InspectionStatus = EnumFQC.GetDisplayName((EnumFQC.EnumInspection_Status)Enum.Parse(typeof(EnumFQC.EnumInspection_Status), FqcQuery.InspectionStatus));
FQC010Master = new FQC010VIiew()
{
DefectDescription = FqcQuery.QaMeno,
InspectionDate = FqcQuery.EndTime,
AC = FqcQuery.AcQty.ToString(),
Approved = "王曉明",
Approved = FqcQuery.Supervisor_Name,
AQL = FqcQuery.AQL.ToString(),
SpeciallyAdoption = FqcQuery.SpecialPo,
BIOSVer = FqcQuery.BIOS,
@ -1545,7 +1586,7 @@ namespace AMESCoreStudio.Web.Controllers
InspectionNumber = FqcQuery.InhouseNo,
InspectionStatus = FqcQuery.InspectionStatus,
InspectionType = FqcQuery.InspectionTypeName,
Inspector = "蔡喬虎",
Inspector = FqcQuery.UpdateUser_Name,
Judgment = "Defect Quantity",
Line = FqcQuery.InhouseMemo,
LotSize = FqcQuery.InhouseQty.ToString(),

46
AMESCoreStudio.Web/Views/FQC/FQC007.cshtml

@ -102,13 +102,16 @@
<input @(Model.CustomerVIP == "Y" ? "checked" : "") id="CustomerVIP" type="checkbox" title="VIP" />
</div>
<div class="layui-col-xs1">
<label class="layui-form-label-col" style="text-align:right;">客戶名稱:</label>
<div class="layui-input-inline">
<select asp-for="InspectionStatus" asp-items="@ViewBag.GetInspectionStatusSelect" class=""></select>
</div>
@*<label class="layui-form-label-col" style="text-align:right;">客戶名稱:</label>*@
</div>
<div class="layui-col-xs2">
<div class="layui-form-item">
<div class="layui-input-block" style="margin-left:auto;">
@*<div class="layui-input-block" style="margin-left:auto;">
<label class="layui-form-label" style="text-align: left; width: 150px;">@Model.CustomerNo</label>
</div>
</div>*@
</div>
</div>
<div class="layui-col-xs1">
@ -129,8 +132,8 @@
<div class="layui-col-xs1" style="text-align:center;">
<input type="hidden" asp-action="CritID" value="@Model.CritID" />
@*<a class="layui-btn layui-btn-sm layui-btn-normal" id="attachment" title="抽驗係數" lay-submit lay-filter="attachment" onclick="openQC()">
<i class="layui-icon layui-icon-sm" style="font-size: 30px; color: #1E9FFF;">&#xe60a;</i>
</a>*@
<i class="layui-icon layui-icon-sm" style="font-size: 30px; color: #1E9FFF;">&#xe60a;</i>
</a>*@
<a title="抽驗係數" lay-submit lay-filter="attachment" onclick="openQC()"><i class="layui-icon layui-icon-form" style="font-size: 30px; color: #ff0000;"></i></a>
</div>
<div class="layui-col-xs3">
@ -289,10 +292,10 @@
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs2">
<div class="layui-col-xs1">
<label class="layui-form-label-col" style="text-align:right;">判定備註:</label>
</div>
<div class="layui-col-xs10">
<div class="layui-col-xs11">
<div class="layui-form-item">
<div class="layui-input-block" style="margin-left:auto;">
<label class="layui-form-label" style="text-align: left;">@Model.QaMeno</label>
@ -301,10 +304,10 @@
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs2">
<div class="layui-col-xs1">
<label class="layui-form-label-col" style="text-align:right;">入庫單備註描述:</label>
</div>
<div class="layui-col-xs10">
<div class="layui-col-xs11">
<div class="layui-form-item">
<div class="layui-input-block" style="margin-left:auto;">
<label class="layui-form-label" style="text-align: left; width: 150px;">@Model.InhouseMemo</label>
@ -312,6 +315,22 @@
</div>
</div>
</div>
<div class="layui-row" style="margin-bottom:10px;">
<div class="layui-col-xs1">
<label class="layui-form-label-col" style="text-align:right;">NOTE:</label>
</div>
<div class="layui-col-xs11">
<textarea asp-for="Note" style="min-height:50px;" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-row" style="margin-bottom:10px;">
<div class="layui-col-xs1">
<label class="layui-form-label-col" style="text-align:right;">ECN Memo:</label>
</div>
<div class="layui-col-xs11">
<textarea asp-for="ECN_Memo" style="min-height:50px;" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-row" id="click" style="display:none">
<div class="layui-col-xs10">
</div>
@ -631,21 +650,18 @@
let Result = '@Model.StatusName';
if (InhouseNo.length != 0 && SeqID.length != 0 && Result == '') {
$("#click").show();
}
}
setupEnterToNext();
});
function setupEnterToNext() {
// add keydown event for all inputs
$(':input').keydown(function (e) {
$(':text').keydown(function (e) {
if (e.keyCode == 13 /*Enter*/) {
// focus next input elements
$(':input:visible:enabled:eq(' + ($(':input:visible:enabled').index(this) + 1) + ')').focus();
$(':text:visible:enabled:eq(' + ($(':text:visible:enabled').index(this) + 1) + ')').focus();
e.preventDefault();
}
});
}
</script>

182
AMESCoreStudio.Web/wwwroot/Reports/FQC010View.rdlc

@ -24,7 +24,6 @@
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>1.36409cm</Top>
<Left>0cm</Left>
<Height>0.60324cm</Height>
<Width>4.88521cm</Width>
<Style>
@ -78,7 +77,6 @@
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>1.96733cm</Top>
<Left>0cm</Left>
<Height>0.60324cm</Height>
<Width>4.88521cm</Width>
<ZIndex>1</ZIndex>
@ -187,7 +185,6 @@
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>3.17381cm</Top>
<Left>0cm</Left>
<Height>0.60324cm</Height>
<Width>4.88521cm</Width>
<ZIndex>3</ZIndex>
@ -242,7 +239,6 @@
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>3.77705cm</Top>
<Left>0cm</Left>
<Height>0.60324cm</Height>
<Width>4.88521cm</Width>
<ZIndex>4</ZIndex>
@ -303,7 +299,6 @@
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>4.38029cm</Top>
<Left>0cm</Left>
<Height>0.60324cm</Height>
<Width>4.88521cm</Width>
<ZIndex>5</ZIndex>
@ -358,7 +353,6 @@
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>4.98353cm</Top>
<Left>0cm</Left>
<Height>0.61241cm</Height>
<Width>4.88521cm</Width>
<ZIndex>6</ZIndex>
@ -1755,6 +1749,7 @@
<Style>Solid</Style>
</Border>
<BackgroundColor>LightGreen</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -1787,6 +1782,7 @@
<Style>Solid</Style>
</Border>
<BackgroundColor>LightGreen</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -1819,6 +1815,7 @@
<Style>Solid</Style>
</Border>
<BackgroundColor>LightGreen</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -1855,6 +1852,7 @@
<Border>
<Style>Solid</Style>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -1886,6 +1884,7 @@
<Border>
<Style>Solid</Style>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -1917,6 +1916,7 @@
<Border>
<Style>Solid</Style>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -2001,27 +2001,8 @@
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<BackgroundColor>LightGreen</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -2053,27 +2034,8 @@
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<BackgroundColor>LightGreen</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -2105,27 +2067,8 @@
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<BackgroundColor>LightGreen</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -2157,27 +2100,8 @@
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<BackgroundColor>LightGreen</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -2214,26 +2138,7 @@
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -2265,26 +2170,7 @@
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -2316,26 +2202,7 @@
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -2367,26 +2234,7 @@
<Border>
<Style>Solid</Style>
</Border>
<TopBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</LeftBorder>
<RightBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</RightBorder>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@ -4261,7 +4109,7 @@
</Style>
</Rectangle>
</ReportItems>
<Height>7.02357in</Height>
<Height>6.65899in</Height>
<Style />
</Body>
<Width>11.66698in</Width>

Loading…
Cancel
Save