21 changed files with 3030 additions and 2 deletions
@ -0,0 +1,210 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.NgInfoAlertMaster |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "FQC014U"; |
||||
|
// Layout = "~/Views/Shared/_FormLayout.cshtml"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml";} |
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-body"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="FQC014USave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
<input type="hidden" asp-for="UserID" /> |
||||
|
<input type="hidden" asp-for="CreateDate" /> |
||||
|
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
||||
|
<input type="hidden" asp-for="FinishDate" /> |
||||
|
<input type="hidden" asp-for="BarcodeNo" /> |
||||
|
<input type="hidden" asp-for="WipNoH" /> |
||||
|
<input type="hidden" asp-for="ItemNoH" /> |
||||
|
<input type="hidden" asp-for="GetFactoryInfo.FactoryNameCh" /> |
||||
|
<input type="hidden" asp-for="GetFactoryInfo.FactoryNameEn" /> |
||||
|
<input type="hidden" asp-for="FactoryID" /> |
||||
|
<input type="hidden" asp-for="StationID" /> |
||||
|
|
||||
|
<table class="table table-bordered"> |
||||
|
<tr> |
||||
|
<td style="width: 90px;"><label asp-for="CaseID" class="control-label"></label></td> |
||||
|
<td colspan="2"><input asp-for="CaseID" name="CaseID" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
<td style="width: 90px;"><label asp-for="ModelName" class="control-label"></label></td> |
||||
|
<td colspan="2"><input asp-for="ModelName" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="ItemNoF" class="control-label"></label></td> |
||||
|
<td colspan="5"><input asp-for="ItemNoF" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="GetFactoryInfo.FactoryNo" class="control-label"></label></td> |
||||
|
<td style="width: 150px;"><input asp-for="GetFactoryInfo.FactoryNo" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="WipNoF" class="control-label"></label></td> |
||||
|
<td style="width: 150px;"><input asp-for="WipNoF" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="ReasonNo" class="control-label"></label></td> |
||||
|
<td><input asp-for="ReasonNo" class="form-control" readonly="readonly" /></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<a>CASE 編輯</a> |
||||
|
<table class="table table-bordered"> |
||||
|
<tr> |
||||
|
<td><label asp-for="CreateDate" class="control-label"></label></td> |
||||
|
<td><input asp-for="CreateDate" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="FinishDate" class="control-label"></label></td> |
||||
|
<td><input asp-for="FinishDate" class="form-control" readonly="readonly" /></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td><label asp-for="StatusNo" class="control-label"></label></td> |
||||
|
<td> |
||||
|
<select asp-for="StatusNo" class="custom-select"> |
||||
|
<option value="E">處理中</option> |
||||
|
<option value="F">已完結</option> |
||||
|
</select> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="ShortTerm" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="ShortTerm" class="form-control" rows="4"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="LongTerm" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="LongTerm" class="form-control" rows="4"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="Memos" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="Memos" class="form-control" rows="4"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="Link" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="Link" class="form-control" rows="4"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="UpdateUserID" class="control-label"></label></td> |
||||
|
<td colspan="3"><select asp-for="UpdateUserID" asp-items="@ViewBag.UserList" class="custom-select"></select></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="儲存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
var toolbar = []; |
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'barcodeNo', |
||||
|
width: 100, |
||||
|
title: '生產序號', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'factoryNo', |
||||
|
width: 100, |
||||
|
title: '廠別', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'wipNoF', |
||||
|
width: 100, |
||||
|
title: '系統工單', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'itemNoF', |
||||
|
width: 100, |
||||
|
title: '系統料號', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'modelName', |
||||
|
width: 100, |
||||
|
title: '機種', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'wipNoH', |
||||
|
width: 100, |
||||
|
title: '單板工單', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'itemNoH', |
||||
|
width: 100, |
||||
|
title: '單板料號', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'createDate', |
||||
|
width: 100, |
||||
|
title: '警報異常時間', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'reasonNo', |
||||
|
width: 100, |
||||
|
title: '警報原因', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'stationNo', |
||||
|
width: 100, |
||||
|
title: '發生站別', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'repairNo', |
||||
|
width: 100, |
||||
|
title: '維修代碼', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'repairDesc', |
||||
|
width: 100, |
||||
|
title: '維修原因', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'userName', |
||||
|
width: 100, |
||||
|
title: '作業人員', |
||||
|
sort: true |
||||
|
} |
||||
|
|
||||
|
]]; |
||||
|
|
||||
|
var caseID = $("#CaseID").val(); |
||||
|
// alert(caseID); |
||||
|
var table = hg.table.datatable('test', '異常不良警示資料維護', '/FQC/GetNGINFOAlertDetailByQuery?caseID=' + caseID, {}, tableCols, '', true, 'full-100'); |
||||
|
//alert("TABLE1"); |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
} |
@ -0,0 +1,416 @@ |
|||||
|
@{ |
||||
|
ViewData["Title"] = "異常警報資料維護"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
||||
|
} |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"> |
||||
|
<div class="layui-form"> |
||||
|
<div class="layui-form-item "> |
||||
|
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<div class="layui-form"> |
||||
|
<input type="hidden" id="caseID" name="caseID" value="@ViewBag.caseID" /> |
||||
|
<div class="layui-row"> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-col-sm2"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label">料號</label> |
||||
|
<div class="layui-input-inline" style="width:140px"> |
||||
|
<input id="itemNoF" name="itemNoF" autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-sm2"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label">機種</label> |
||||
|
<div class="layui-input-inline" style="width:140px"> |
||||
|
<input id="modelName" name="modelName" autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-sm2"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label">工單</label> |
||||
|
<div class="layui-input-inline" style="width:140px"> |
||||
|
<input id="wipNoF" name="wipNoF" autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-sm3"> |
||||
|
<div class="layui-col-sm1"> |
||||
|
<div class="layui-inline layui-show-xs-block"> |
||||
|
<button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="querysubmit"> |
||||
|
<i class="layui-icon layui-icon-sm"></i> |
||||
|
</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-row"> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-col-sm2"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label">異常代碼</label> |
||||
|
<div class="layui-input-inline" style="width:140px"> |
||||
|
<input id="errorCode" name="errorCode" autocomplete="off" class="layui-input"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-sm2"> |
||||
|
<label class="layui-form-label">狀態</label> |
||||
|
<div class="layui-input-inline" style="width:100px"> |
||||
|
<select id="statusNo" name="statusNo" lay-filter="statusNo" lay-submit> |
||||
|
<option value="">請選擇</option> |
||||
|
<option value="ALL">全部</option> |
||||
|
<option value="未處理">未處理</option> |
||||
|
<option value="處理中">處理中</option> |
||||
|
<option value="已結案">已結案</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-sm3"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label">警報時間:</label> |
||||
|
<div class="layui-input-inline" style="width:150px"> |
||||
|
<input id="dateStart" name="dateStart" autocomplete="off" class="layui-input" readonly=""> |
||||
|
</div> |
||||
|
<div class="layui-form-mid">~</div> |
||||
|
<div class="layui-input-inline" style="width:150px"> |
||||
|
<input id="dateEnd" name="dateEnd" autocomplete="off" class="layui-input" readonly=""> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts{ |
||||
|
<script type="text/javascript"> |
||||
|
layui.use(['form', 'layer', 'laydate'], function () { |
||||
|
form = layui.form; |
||||
|
laydate = layui.laydate; |
||||
|
laydate.render({ |
||||
|
elem: '#dateStart' |
||||
|
, trigger: 'click' |
||||
|
, format: 'yyyy/MM/dd' |
||||
|
, theme: 'grid' |
||||
|
}); |
||||
|
|
||||
|
laydate.render({ |
||||
|
elem: '#dateEnd' |
||||
|
, trigger: 'click' |
||||
|
, format: 'yyyy/MM/dd' |
||||
|
, theme: 'grid' |
||||
|
}); |
||||
|
}); |
||||
|
//监听表单提交事件 |
||||
|
hg.form.onsubmit('querysubmit', function (data) { |
||||
|
// table && table.reload(data); |
||||
|
tt(); |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'caseID', |
||||
|
width: 100, |
||||
|
title: 'CaseID', |
||||
|
sort: true, |
||||
|
templet: '#caseID1' |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'factoryNo', |
||||
|
width: 80, |
||||
|
title: '廠別', |
||||
|
sort: true, |
||||
|
templet: '#factoryNo' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'wipNoF', |
||||
|
title: '系統工單', |
||||
|
width: 100, |
||||
|
sort: true, |
||||
|
templet: '#wipNoF1' |
||||
|
}, { |
||||
|
field: 'itemNoF', |
||||
|
title: '系統料號', |
||||
|
sort: true, |
||||
|
templet: '#itemNoF1' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'modelName', |
||||
|
title: '機種', |
||||
|
sort: true, |
||||
|
templet: '#modelName1' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'wipNoH', |
||||
|
title: '單板工單', |
||||
|
width: 100, |
||||
|
sort: true, |
||||
|
templet: '#wipNoH' |
||||
|
|
||||
|
}, { |
||||
|
field: 'itemNoH', |
||||
|
title: '單板料號', |
||||
|
sort: true, |
||||
|
templet: '#itemNoH' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'reasonNo', |
||||
|
title: '警報原因', |
||||
|
width: 190, |
||||
|
sort: true, |
||||
|
templet: '#reasonNo' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'stationName', |
||||
|
width: 100, |
||||
|
title: '發生站別', |
||||
|
sort: true, templet: '#stationName' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'userName', |
||||
|
title: 'QA人員', |
||||
|
width: 100, |
||||
|
sort: true, |
||||
|
templet: '#userName' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 150, |
||||
|
title: '操作', |
||||
|
fixed: 'right', |
||||
|
|
||||
|
templet: function (d) { |
||||
|
var btn = '<a class="layui-btn layui-bg-blue layui-btn-xs layui-icon layui-icon-form" lay-event="view">檢視</a>' |
||||
|
if (d.statusNo != "已結案") { |
||||
|
btn += '<a class="layui-btn layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a>' |
||||
|
} |
||||
|
return btn |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'statusNo', |
||||
|
title: '狀態', |
||||
|
width: 80, |
||||
|
sort: true, |
||||
|
templet: '#statusNo1' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'updateDate', |
||||
|
// templet: '<div>{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd") }}</div>', |
||||
|
title: '警報處理時間', |
||||
|
width: 100, |
||||
|
sort: true, |
||||
|
templet: '#updateDate' |
||||
|
}, { |
||||
|
field: 'finishDate', |
||||
|
// templet: '<div>{{ layui.util.toDateString(d.finishDate, "yyyy/MM/dd") }}</div>', |
||||
|
title: '處理完成時間', |
||||
|
width: 100, |
||||
|
sort: true, |
||||
|
templet: '#finishDate' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 130, |
||||
|
title: '上傳檔案', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
btn = `<a class="layui-btn layui-bg-blue layui-btn-xs" lay-event="Download">下載</a>` |
||||
|
if (d.statusNo != "已結案") { |
||||
|
btn += `<a class="layui-btn layui-btn-xs" lay-event="Upload">上傳</a>` |
||||
|
} |
||||
|
return btn |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
|
||||
|
//修改 |
||||
|
function edit(obj) { |
||||
|
if (obj.data.caseID) { |
||||
|
hg.open('異常警報處理回覆', '/FQC/FQC014U/' + obj.data.caseID, 1200, 800); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//檢視 |
||||
|
function view(obj) { |
||||
|
if (obj.data.caseID) { |
||||
|
|
||||
|
hg.open('異常警報處理檢視', '/FQC/FQC014UV/' + obj.data.caseID, 1000, 800); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//上傳 |
||||
|
function Upload(obj) { |
||||
|
if (obj.data.caseID) { |
||||
|
|
||||
|
hg.open('上傳檔案', '/FQC/FQC014R/' + obj.data.caseID, 800, 550); |
||||
|
} |
||||
|
}; |
||||
|
//下載 |
||||
|
function Download(obj) { |
||||
|
if (obj.data.caseID) { |
||||
|
|
||||
|
hg.open('下載檔案', '/FQC/FQC014RV/' + obj.data.caseID, 800, 550); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var toolbar = []; |
||||
|
//基本数据表格 |
||||
|
tt(); |
||||
|
function tt() { |
||||
|
//基本数据表格 |
||||
|
// var table = hg.table.datatable('test', '異常不良警示資料維護', '/FQC/GetNGINFOAlertMasterByQuery', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
|
||||
|
var caseID = $("#caseID").val(); |
||||
|
var itemNoF = $("#itemNoF").val(); |
||||
|
var modelName = $("#modelName").val();; |
||||
|
var wipNoF = $("#wipNoF").val(); |
||||
|
var errorCode = $("#errorCode").val(); |
||||
|
var statusNo = $("#statusNo").val(); |
||||
|
var dateStart = $("#dateStart").val(); |
||||
|
var dateEnd = $("#dateEnd").val(); |
||||
|
var table = hg.table.datatable('test', '異常不良警示資料維護', '/FQC/GetNGINFOAlertMasterByQuery?caseID=' + caseID + "&itemNoF=" + itemNoF + "&modelName=" + modelName + "&wipNoF=" + wipNoF + "&errorCode=" + errorCode + "&statusNo=" + statusNo + "&dateStart=&dateEnd=", {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
<script type="text/html" id="statusNo1"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.statusNo }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.statusNo }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.statusNo }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="caseID1"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.caseID }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.caseID }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.caseID }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="factoryNo"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.factoryNo }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.factoryNo }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.factoryNo }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="wipNoF1"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.wipNoF }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.wipNoF }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.wipNoF }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="itemNoF1"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.itemNoF }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.itemNoF }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.itemNoF }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="modelName1"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.modelName }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.modelName }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.modelName }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="wipNoH"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.wipNoH }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.wipNoH }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.wipNoH }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="itemNoH"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.itemNoH }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.itemNoH }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.itemNoH }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
|
||||
|
<script type="text/html" id="reasonNo"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.reasonNo }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.reasonNo }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.reasonNo }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="stationName"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.stationName }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.stationName }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.stationName }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="userName"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000">{{ d.userName }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; ">{{ d.userName }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ d.userName }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="updateDate"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000"> {{ layui.util.toDateString(d.updateDate, "yyyy/MM/dd") }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; "> {{ layui.util.toDateString(d.updateDate, "yyyy/MM/dd") }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ layui.util.toDateString(d.updateDate, "yyyy/MM/dd") }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
<script type="text/html" id="finishDate"> |
||||
|
{{# if(d.statusNo === '未處理' ){ }} |
||||
|
<span style="color: #FF0000"> {{ layui.util.toDateString(d.finishDate, "yyyy/MM/dd") }}</span> |
||||
|
{{# } else if(d.statusNo === '已結案'){ }} |
||||
|
<span style="color: #D3D3D3; "> {{ layui.util.toDateString(d.finishDate, "yyyy/MM/dd") }}</span> |
||||
|
{{# } else { }} |
||||
|
{{ layui.util.toDateString(d.finishDate, "yyyy/MM/dd") }} |
||||
|
{{# } }} |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,171 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.NgInfoAlertBlob |
||||
|
|
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "FQC014R"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; } |
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
|
||||
|
.text-error { |
||||
|
color: #dc3545 !important; |
||||
|
} |
||||
|
|
||||
|
.my-read-only-class { |
||||
|
cursor: not-allowed; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-body"> |
||||
|
<form enctype="multipart/form-data" class="layui-form" method="post" asp-action="FQC014RSave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<input type="hidden" id="id" asp-for="CaseID" value="@ViewBag.CaseID" /> |
||||
|
<div class="layui-form-item" style="text-align:center"> |
||||
|
<div class="layui-inline" style="width: 100%;"> |
||||
|
<label class="layui-btn" style="width: 50%;"> |
||||
|
<input type="file" name="formFile" style="width: 50%;" /> |
||||
|
</label> |
||||
|
<input type="submit" id="asubmit" value="上傳" class="layui-btn layui-icon" style="width: 10%;" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item" style="text-align:center"> |
||||
|
<label asp-for="Memos" class="control-label" style="width: 55%;"></label> |
||||
|
<textarea asp-for="Memos" class="form-control" rows="6" style="width: 55%;"></textarea> |
||||
|
<span asp-validation-for="Memos" class="text-danger"></span> |
||||
|
</div> |
||||
|
<div style="text-align:center"> |
||||
|
<div class="layui-inline"> |
||||
|
<span style="color: firebrick; word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
@* SOP文件 sheet *@ |
||||
|
<table class="layui-hide" id="sop" lay-filter="sop"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
//layui.use(['form', 'layer', 'laydate'], function () { |
||||
|
// form = layui.form; |
||||
|
// |
||||
|
// form.on('select(Type)', function (data) { |
||||
|
// var data = $("#Type").val(); |
||||
|
// getInspectionForms(data); |
||||
|
// }); |
||||
|
// |
||||
|
//}); |
||||
|
hg.form.onsubmit('asubmit', function (data) { |
||||
|
tt(); |
||||
|
//table && table.reload(data); |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
//通过行tool编辑,lay-event="show" |
||||
|
function show(obj) { |
||||
|
layui.use('layer', function () { |
||||
|
var layer = layui.layer; |
||||
|
layer.open({ |
||||
|
type: 2, |
||||
|
title: '預覽文件', |
||||
|
shadeClose: true,//点击遮罩关闭层 |
||||
|
shade: 0.8, |
||||
|
area: ['90%', '90%'], |
||||
|
content: obj.data.filePath + obj.data.newName, //iframe的url |
||||
|
zIndex: 19891014, |
||||
|
//iframe: { |
||||
|
// src:obj.data.filePath + obj.data.newName |
||||
|
// |
||||
|
//} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
}; |
||||
|
//通过行tool删除,lay-event="del" |
||||
|
function del(obj) { |
||||
|
|
||||
|
if (obj.data.imageName) { |
||||
|
|
||||
|
hg.confirm("資料:" + obj.data.imageName + ",确定要删除吗?", function () { |
||||
|
$.ajax({ |
||||
|
url: '/FQC/FQC014RD' , |
||||
|
data: { id: obj.data.caseItemID }, |
||||
|
type: 'POST', |
||||
|
success: function (data) { |
||||
|
if (data.success) { |
||||
|
obj.del(); //只删本地数据 |
||||
|
hg.msghide("删除成功!"); |
||||
|
} |
||||
|
else { |
||||
|
hg.msg(data.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function () { |
||||
|
hg.msg("网络请求失败!"); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@* SOP文件 sheet *@ |
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'imageName', |
||||
|
title: '檔案名稱', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'memos', |
||||
|
title: '備註', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 150, |
||||
|
title: '操作', |
||||
|
align: 'center', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
var btn = ' <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del">刪除</a>'; |
||||
|
|
||||
|
return btn; |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
//基本数据表格 |
||||
|
var table; |
||||
|
$(function () { |
||||
|
|
||||
|
tt(); |
||||
|
}); |
||||
|
function tt() { |
||||
|
|
||||
|
//基本数据表格 |
||||
|
// alert("/FQC/GetNgInfoAlertBlobs/"+ id.value); |
||||
|
table = hg.table.datatable('sop', '上傳文件', '/FQC/GetNgInfoAlertBlobs/' + id.value , {}, tableCols, false, 'full-100'); |
||||
|
}; |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,136 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.NgInfoAlertBlob |
||||
|
|
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "FQC014RV"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; } |
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
|
||||
|
.text-error { |
||||
|
color: #dc3545 !important; |
||||
|
} |
||||
|
|
||||
|
.my-read-only-class { |
||||
|
cursor: not-allowed; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-body"> |
||||
|
<form enctype="multipart/form-data" class="layui-form" method="post" asp-action="FQC014RSave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<input type="hidden" id="id" asp-for="CaseID" value="@ViewBag.CaseID" /> |
||||
|
<div style="text-align:center"> |
||||
|
<div class="layui-inline"> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
@* <input type="submit" id="asubmit" value="上傳" class="layui-btn layui-btn-normal layui-btn-xs layui-icon " /> *@ |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
@* SOP文件 sheet *@ |
||||
|
<table class="layui-hide" id="sop" lay-filter="sop"></table> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
|
||||
|
hg.form.onsubmit('asubmit', function (data) { |
||||
|
tt(); |
||||
|
//table && table.reload(data); |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
//通过行tool编辑,lay-event="show" |
||||
|
function show(obj) { |
||||
|
layui.use('layer', function () { |
||||
|
var layer = layui.layer; |
||||
|
layer.open({ |
||||
|
type: 2, |
||||
|
title: '預覽文件', |
||||
|
shadeClose: true,//点击遮罩关闭层 |
||||
|
shade: 0.8, |
||||
|
area: ['90%', '90%'], |
||||
|
content: obj.data.filePath + obj.data.newName, //iframe的url |
||||
|
zIndex: 19891014, |
||||
|
//iframe: { |
||||
|
// src:obj.data.filePath + obj.data.newName |
||||
|
// |
||||
|
//} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
}; |
||||
|
//通过行tool删除,lay-event="del" |
||||
|
function filedownload(obj) { |
||||
|
|
||||
|
if (obj.data.imageName) { |
||||
|
// alert(obj.data.imageName); |
||||
|
// alert(obj.data.filePath); |
||||
|
var Path = obj.data.filePath; |
||||
|
Path = Path.replace(/\\/g, '/'); |
||||
|
var FileName = obj.data.imageName; |
||||
|
filePath = '/FQC/FileDownload_byPath?Path=' + Path + '&FileName=' + FileName; |
||||
|
window.open(filePath); |
||||
|
} |
||||
|
}; |
||||
|
@* SOP文件 sheet *@ |
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'imageName', |
||||
|
title: '檔案名稱', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'memos', |
||||
|
title: '備註', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 150, |
||||
|
title: '操作', |
||||
|
align: 'center', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
var btn = ' <a class="layui-btn layui-btn-normal layui-btn-xs " lay-event="filedownload">下載</a>'; |
||||
|
return btn; |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
//基本数据表格 |
||||
|
var table; |
||||
|
$(function () { |
||||
|
|
||||
|
tt(); |
||||
|
}); |
||||
|
function tt() { |
||||
|
|
||||
|
//基本数据表格 |
||||
|
// alert("/FQC/GetNgInfoAlertBlobs/"+ id.value); |
||||
|
table = hg.table.datatable('sop', '上傳文件', '/FQC/GetNgInfoAlertBlobs/' + id.value , {}, tableCols, false, 'full-100'); |
||||
|
}; |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,213 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.NgInfoAlertMaster |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "FQC014U"; |
||||
|
// Layout = "~/Views/Shared/_FormLayout.cshtml"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml";} |
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-body"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="FQC014USave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
<input type="hidden" asp-for="UserID" /> |
||||
|
<input type="hidden" asp-for="CreateDate" /> |
||||
|
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
||||
|
<input type="hidden" asp-for="FinishDate" /> |
||||
|
<input type="hidden" asp-for="BarcodeNo" /> |
||||
|
<input type="hidden" asp-for="WipNoH" /> |
||||
|
<input type="hidden" asp-for="ItemNoH" /> |
||||
|
<input type="hidden" asp-for="GetFactoryInfo.FactoryNameCh" /> |
||||
|
<input type="hidden" asp-for="GetFactoryInfo.FactoryNameEn" /> |
||||
|
<input type="hidden" asp-for="FactoryID" /> |
||||
|
<input type="hidden" asp-for="StationID" /> |
||||
|
<table class="layui-table"> |
||||
|
@*// <table class="table table-bordered">*@ |
||||
|
<tr> |
||||
|
<td style="width: 90px;"><label asp-for="CaseID" class="control-label"></label></td> |
||||
|
<td colspan="2"><input asp-for="CaseID" name="CaseID" class="layui-input" style="background-color: #D3D3D3;" readonly="readonly" /></td> |
||||
|
|
||||
|
<td style="width: 90px;"><label asp-for="ModelName" class="control-label"></label></td> |
||||
|
<td colspan="2"><input asp-for="ModelName" class="layui-input" style="background-color: #D3D3D3;" readonly="readonly" /></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="ItemNoF" class="control-label"></label></td> |
||||
|
<td colspan="5"><input asp-for="ItemNoF" class="layui-input" style="background-color: #D3D3D3;" readonly="readonly" /></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="GetFactoryInfo.FactoryNo" class="control-label"></label></td> |
||||
|
<td style="width: 150px;"><input asp-for="GetFactoryInfo.FactoryNo" class="layui-input" style="background-color: #D3D3D3;"readonly="readonly" /></td> |
||||
|
|
||||
|
<td><label asp-for="WipNoF" class="control-label"></label></td> |
||||
|
<td style="width: 150px;"><input asp-for="WipNoF" class="layui-input" style="background-color: #D3D3D3;"readonly="readonly" /></td> |
||||
|
|
||||
|
<td><label asp-for="ReasonNo" class="control-label"></label></td> |
||||
|
<td><input asp-for="ReasonNo" class="layui-input" style="background-color: #D3D3D3;" readonly="readonly" /></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<a>CASE 編輯</a> |
||||
|
<table class="layui-table"> |
||||
|
<tr> |
||||
|
<td><label asp-for="CreateDate" class="control-label"></label></td> |
||||
|
<td><input asp-for="CreateDate" class="layui-input" style="background-color: #D3D3D3;" readonly="readonly" /></td> |
||||
|
<td><label asp-for="FinishDate" class="control-label"></label></td> |
||||
|
<td><input asp-for="FinishDate" class="layui-input" style="background-color: #D3D3D3;" readonly="readonly" /></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td><label asp-for="StatusNo" class="control-label"></label></td> |
||||
|
<td> |
||||
|
<select asp-for="StatusNo" class="custom-select col-sm-9"> |
||||
|
<option value="E">處理中</option> |
||||
|
<option value="F">已完結</option> |
||||
|
</select> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="ShortTerm" class="control-label"></label></td> |
||||
|
<td colspan="3"> |
||||
|
<textarea asp-for="ShortTerm" class="layui-textarea" rows="4" style="background-color: #FFFFE0;"></textarea> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="LongTerm" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="LongTerm" class="layui-textarea" rows="4" style="background-color: #FFFFE0;"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="Memos" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="Memos" class="layui-textarea" rows="4" style="background-color: #FFFFE0;"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="Link" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="Link" class="layui-textarea" rows="4" style="background-color: #FFFFE0;"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="UpdateUserID" class="control-label"></label></td> |
||||
|
<td colspan="3"><select asp-for="UpdateUserID" asp-items="@ViewBag.UserList" class="custom-select"></select></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="layui-row" style="text-align:center"> |
||||
|
<input type="submit" value="儲存" class="layui-btn" /> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
var toolbar = []; |
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'barcodeNo', |
||||
|
width: 100, |
||||
|
title: '生產序號', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'factoryNo', |
||||
|
width: 100, |
||||
|
title: '廠別', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'wipNoF', |
||||
|
width: 100, |
||||
|
title: '系統工單', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'itemNoF', |
||||
|
width: 100, |
||||
|
title: '系統料號', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'modelName', |
||||
|
width: 100, |
||||
|
title: '機種', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'wipNoH', |
||||
|
width: 100, |
||||
|
title: '單板工單', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'itemNoH', |
||||
|
width: 100, |
||||
|
title: '單板料號', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'createDate', |
||||
|
width: 100, |
||||
|
title: '警報異常時間', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'reasonNo', |
||||
|
width: 100, |
||||
|
title: '警報原因', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'stationNo', |
||||
|
width: 100, |
||||
|
title: '發生站別', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'repairNo', |
||||
|
width: 100, |
||||
|
title: '維修代碼', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'repairDesc', |
||||
|
width: 100, |
||||
|
title: '維修原因', |
||||
|
sort: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'userName', |
||||
|
width: 100, |
||||
|
title: '作業人員', |
||||
|
sort: true |
||||
|
} |
||||
|
|
||||
|
]]; |
||||
|
|
||||
|
var caseID = $("#CaseID").val(); |
||||
|
// alert(caseID); |
||||
|
var table = hg.table.datatable('test', '異常不良警示資料維護', '/FQC/GetNGINFOAlertDetailByQuery?caseID=' + caseID, {}, tableCols, '', false, 'full-100'); |
||||
|
//alert("TABLE1"); |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
} |
@ -0,0 +1,188 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.NgInfoAlertMaster |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "FQC014U"; |
||||
|
// Layout = "~/Views/Shared/_FormLayout.cshtml"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml";} |
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-body"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form class="layui-form" id="modelform"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
<input type="hidden" asp-for="UserID" /> |
||||
|
<input type="hidden" asp-for="CreateDate" /> |
||||
|
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
||||
|
<input type="hidden" asp-for="FinishDate" /> |
||||
|
<input type="hidden" asp-for="BarcodeNo" /> |
||||
|
<input type="hidden" asp-for="WipNoH" /> |
||||
|
<input type="hidden" asp-for="ItemNoH" /> |
||||
|
<input type="hidden" asp-for="GetFactoryInfo.FactoryNameCh" /> |
||||
|
<input type="hidden" asp-for="GetFactoryInfo.FactoryNameEn" /> |
||||
|
<input type="hidden" asp-for="FactoryID" /> |
||||
|
<input type="hidden" asp-for="StationID" /> |
||||
|
|
||||
|
<table class="table table-bordered"> |
||||
|
<tr> |
||||
|
<td style="width: 90px;"><label asp-for="CaseID" class="control-label"></label></td> |
||||
|
<td colspan="2"><input asp-for="CaseID" name="CaseID" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
<td style="width: 90px;"><label asp-for="ModelName" class="control-label"></label></td> |
||||
|
<td colspan="2"><input asp-for="ModelName" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="ItemNoF" class="control-label"></label></td> |
||||
|
<td colspan="5"><input asp-for="ItemNoF" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="GetFactoryInfo.FactoryNo" class="control-label"></label></td> |
||||
|
<td style="width: 150px;"><input asp-for="GetFactoryInfo.FactoryNo" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="WipNoF" class="control-label"></label></td> |
||||
|
<td style="width: 150px;"><input asp-for="WipNoF" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="ReasonNo" class="control-label"></label></td> |
||||
|
<td><input asp-for="ReasonNo" class="form-control" readonly="readonly" /></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<a>CASE 編輯</a> |
||||
|
<table class="table table-bordered"> |
||||
|
<tr> |
||||
|
<td><label asp-for="CreateDate" class="control-label"></label></td> |
||||
|
<td><input asp-for="CreateDate" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="FinishDate" class="control-label"></label></td> |
||||
|
<td><input asp-for="FinishDate" class="form-control" readonly="readonly" /></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td><label asp-for="StatusNo" class="control-label"></label></td> |
||||
|
<td> |
||||
|
<select asp-for="StatusNo" class="custom-select"> |
||||
|
<option value="E">處理中</option> |
||||
|
<option value="F">已完結</option> |
||||
|
</select> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="ShortTerm" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="ShortTerm" class="form-control" rows="4"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="LongTerm" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="LongTerm" class="form-control" rows="4"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="Memos" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="Memos" class="form-control" rows="4"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="Link" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="Link" class="form-control" rows="4"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="UpdateUserID" class="control-label"></label></td> |
||||
|
<td colspan="3"><select asp-for="UpdateUserID" asp-items="@ViewBag.UserList" class="custom-select"></select></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<button id="querysubmit" class="layui-btn tt">儲存</button> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
|
||||
|
$('#querysubmit').click(function () { |
||||
|
var caseID = $("#CaseID").val(); |
||||
|
//var factoryID = 0; |
||||
|
//var barcodeNo = string, |
||||
|
//var wipNoF = string, |
||||
|
//var itemNoF = string, |
||||
|
//var modelName = string, |
||||
|
//var wipNoH = string, |
||||
|
//var itemNoH = string, |
||||
|
//var stationID = 0, |
||||
|
//var createDate = 2024 - 12 - 23T13 = 05 = 24.738Z, |
||||
|
//var reasonNo = string, |
||||
|
//var userID = 0, |
||||
|
//var statusNo = st, |
||||
|
//var updateDate = 2024 - 12 - 23T13 = 05 = 24.738Z, |
||||
|
//var finishDate = 2024 - 12 - 23T13 = 05 = 24.738Z, |
||||
|
//var updateUserID = 0, |
||||
|
var shortTerm = $("#CaseID").val(); |
||||
|
//var longTerm = string, |
||||
|
//var memos = string, |
||||
|
//var link = string, |
||||
|
//var InspectionID = $("#InspectionID").val(); |
||||
|
//var InspectionFormID = $("#InspectionFormID").val(); |
||||
|
//var WipNo = $("#WipNo").val(); |
||||
|
//var ItemNo = $("#ItemNo").val(); |
||||
|
//var BarcodeNo = $("#BarcodeNo").val(); |
||||
|
//var CreateUserID = $("#CreateUserID").val(); |
||||
|
//var UpdateUserID = $("#CreateUserID").val(); |
||||
|
//var CreateDate = $("#CreateDate").val(); |
||||
|
//var UpdateDate = $("#CreateDate").val(); |
||||
|
//var StatusNo; |
||||
|
|
||||
|
|
||||
|
$.post("/FQC/FQC014USAVE", |
||||
|
{ |
||||
|
caseID: caseID |
||||
|
}, |
||||
|
function (data) { |
||||
|
console.log(data); |
||||
|
if (data.success) { |
||||
|
console.log("master:data.success"); |
||||
|
insertList(data.msg); |
||||
|
} |
||||
|
}).success(function () { alert("second success"); }) |
||||
|
.error(function () { alert("error"); }) |
||||
|
.complete(function () { alert("complete"); }); |
||||
|
|
||||
|
}); |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
var toolbar = []; |
||||
|
|
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'caseID', |
||||
|
width: 100, |
||||
|
title: 'CaseID', |
||||
|
sort: true |
||||
|
} |
||||
|
|
||||
|
]]; |
||||
|
var table; |
||||
|
var caseID = $("#CaseID").val(); |
||||
|
alert(caseID); |
||||
|
table = hg.table.datatable('test', '異常不良警示資料維護', '/FQC/GetNGINFOAlertDetailByQuery?caseID=' + caseID, {}, tableCols, '', true, 'full-100'); |
||||
|
alert("TABLE1"); |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
} |
@ -0,0 +1,135 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.NgInfoAlertMaster |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "FQC014U"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="FQC014USave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
<input type="hidden" asp-for="CaseID" /> |
||||
|
<input type="hidden" asp-for="UserID" /> |
||||
|
<input type="hidden" asp-for="CreateDate" /> |
||||
|
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
||||
|
<input type="hidden" asp-for="FinishDate" /> |
||||
|
<input type="hidden" asp-for="BarcodeNo" /> |
||||
|
<input type="hidden" asp-for="WipNoH" /> |
||||
|
<input type="hidden" asp-for="ItemNoH" /> |
||||
|
|
||||
|
<table class="table table-bordered"> |
||||
|
<tr> |
||||
|
<td style="width: 90px;"><label asp-for="CaseID" class="control-label"></label></td> |
||||
|
<td colspan="2"><input asp-for="CaseID" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
<td style="width: 90px;"><label asp-for="ModelName" class="control-label"></label></td> |
||||
|
<td colspan="2"><input asp-for="ModelName" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="ItemNoF" class="control-label"></label></td> |
||||
|
<td colspan="5"><input asp-for="ItemNoF" class="form-control" readonly="readonly" /></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="GetFactoryInfo.FactoryNo" class="control-label"></label></td> |
||||
|
<td style="width: 150px;"><input asp-for="GetFactoryInfo.FactoryNo" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="WipNoF" class="control-label"></label></td> |
||||
|
<td style="width: 150px;"><input asp-for="WipNoF" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="ReasonNo" class="control-label"></label></td> |
||||
|
<td><input asp-for="ReasonNo" class="form-control" readonly="readonly" /></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<a>CASE 內容</a> |
||||
|
<table class="table table-bordered"> |
||||
|
<tr> |
||||
|
<td><label asp-for="CreateDate" class="control-label"></label></td> |
||||
|
<td><input asp-for="CreateDate" class="form-control" readonly="readonly" /></td> |
||||
|
<td><label asp-for="FinishDate" class="control-label"></label></td> |
||||
|
<td><input asp-for="FinishDate" class="form-control" readonly="readonly" /></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td><label asp-for="StatusNo" class="control-label"></label></td> |
||||
|
<td> |
||||
|
<select asp-for="StatusNo" class="custom-select" readonly="readonly"> |
||||
|
<option value="E">處理中</option> |
||||
|
<option value="F">已完結</option> |
||||
|
</select> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="ShortTerm" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="ShortTerm" class="form-control" rows="4" readonly="readonly"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="LongTerm" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="LongTerm" class="form-control" rows="4" readonly="readonly"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="Memos" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="Memos" class="form-control" rows="4" readonly="readonly"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="Link" class="control-label"></label></td> |
||||
|
<td colspan="3"><textarea asp-for="Link" class="form-control" rows="4" readonly="readonly"></textarea></td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><label asp-for="UpdateUserID" class="control-label"></label></td> |
||||
|
<td colspan="3"><select asp-for="UpdateUserID" asp-items="@ViewBag.UserList" class="custom-select" readonly="readonly"></select></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
layui.use(['laydate'], function () { |
||||
|
//form = layui.form; |
||||
|
laydate = layui.laydate; |
||||
|
laydate.render({ |
||||
|
elem: '#StartTime' |
||||
|
, trigger: 'click' |
||||
|
, type: 'datetime' |
||||
|
, format: 'yyyy-MM-dd HH:mm' |
||||
|
, theme: 'grid' |
||||
|
}); |
||||
|
laydate.render({ |
||||
|
elem: '#EndTime' |
||||
|
, trigger: 'click' |
||||
|
, type: 'datetime' |
||||
|
, format: 'yyyy-MM-dd HH:mm' |
||||
|
, theme: 'grid' |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,198 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.WebApi; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
using AMESCoreStudio.CommonTools.Result; |
||||
|
|
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 巡檢類別資料维护
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class NgInfoAlertBlobsController : ControllerBase |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public NgInfoAlertBlobsController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取全部巡檢類別資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/NgInfoAlertBlobs
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<NgInfoAlertBlob>>> GetNgInfoAlertBlobs() |
||||
|
{ |
||||
|
IQueryable<NgInfoAlertBlob> q = _context.NgInfoAlertBlobs; |
||||
|
q = q.OrderBy(p => p.CaseID); |
||||
|
q = q.OrderBy(p => p.CaseItemID); |
||||
|
|
||||
|
var NgInfoAlertBlobs = await q.ToListAsync(); |
||||
|
|
||||
|
return NgInfoAlertBlobs; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 用ID获取该巡檢類別資料
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/NgInfoAlertBlobs/5
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<NgInfoAlertBlob>>> GetNgInfoAlertBlobs(string id ) |
||||
|
{ |
||||
|
|
||||
|
IQueryable<NgInfoAlertBlob> q = _context.NgInfoAlertBlobs; |
||||
|
q = q.Where(p => p.CaseID.Equals(id)); |
||||
|
var NgInfoAlertBlob = await q.ToListAsync(); |
||||
|
|
||||
|
if (NgInfoAlertBlob == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return NgInfoAlertBlob; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取该巡檢表單Blob By Query
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <param name="itemID"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/NgInfoAlertBlobs/Query/5
|
||||
|
[HttpGet("Query/{id}/{itemID}")] |
||||
|
public async Task<ActionResult<IEnumerable<NgInfoAlertBlob>>> GetNgInfoAlertBlobsByQuery(string id, int itemID) |
||||
|
{ |
||||
|
|
||||
|
IQueryable<NgInfoAlertBlob> q = _context.NgInfoAlertBlobs; |
||||
|
q = q.Where(p => p.CaseID.Equals(id)); |
||||
|
q = q.Where(p => p.CaseItemID.Equals(itemID)); |
||||
|
var NgInfoAlertBlob = await q.ToListAsync(); |
||||
|
|
||||
|
if (NgInfoAlertBlob.Count == 0 ) |
||||
|
{ |
||||
|
return NgInfoAlertBlob; |
||||
|
} |
||||
|
|
||||
|
return NgInfoAlertBlob; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新巡檢類別資料
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <param name="NgInfoAlertBlob"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// PUT: api/NgInfoAlertBlobs/5
|
||||
|
// To protect from overposting attacks, enable the specific properties you want to bind to, for
|
||||
|
// more details, see https://go.microsoft.com/fwlink/?linkid=2123754.
|
||||
|
[HttpPut("{id}")] |
||||
|
public async Task<ResultModel<NgInfoAlertBlob>> PutNgInfoAlertBlobs(int id, [FromBody] NgInfoAlertBlob NgInfoAlertBlob) |
||||
|
{ |
||||
|
ResultModel<NgInfoAlertBlob> result = new ResultModel<NgInfoAlertBlob>(); |
||||
|
if (id != NgInfoAlertBlob.CaseItemID) |
||||
|
{ |
||||
|
result.Success = false; |
||||
|
result.Msg = "錯誤"; |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
_context.Entry(NgInfoAlertBlob).State = EntityState.Modified; |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (Exception e) |
||||
|
{ |
||||
|
result.Success = false; |
||||
|
result.Msg = e.Message; |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
result.Success = true; |
||||
|
result.Msg = "OK"; |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增 檢驗結果上傳圖檔資料表
|
||||
|
/// </summary>
|
||||
|
/// <param name="NgInfoAlertBlob"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost] |
||||
|
public async Task<ResultModel<NgInfoAlertBlob>> PostNgInfoAlertBlob(NgInfoAlertBlob NgInfoAlertBlob) |
||||
|
{ |
||||
|
ResultModel<NgInfoAlertBlob> result = new ResultModel<NgInfoAlertBlob>(); |
||||
|
NgInfoAlertBlob.CreateDate = DateTime.Now; |
||||
|
NgInfoAlertBlob.UpdateDate = DateTime.Now; |
||||
|
Helper helper = new Helper(_context); |
||||
|
NgInfoAlertBlob.CaseItemID = helper.GetIDKey("NGINFOALERT_BLOBID").Result; |
||||
|
|
||||
|
_context.NgInfoAlertBlobs.Add(NgInfoAlertBlob); |
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
result.Success = true; |
||||
|
result.Msg = "OK"; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
result.Success = false; |
||||
|
result.Msg = ex.InnerException.Message; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 删除巡檢類別資料
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// DELETE: api/NgInfoAlertBlobs/5
|
||||
|
[HttpDelete("{id}")] |
||||
|
public async Task<ResultModel<NgInfoAlertBlob>> DeleteNgInfoAlertBlobs(int id) |
||||
|
{ |
||||
|
ResultModel<NgInfoAlertBlob> result = new ResultModel<NgInfoAlertBlob>(); |
||||
|
var inspectionType = await _context.NgInfoAlertBlobs.Where(m => m.CaseItemID == id).FirstOrDefaultAsync(); |
||||
|
if (inspectionType == null) |
||||
|
{ |
||||
|
result.Success = false; |
||||
|
result.Msg = "序號不存在"; |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
_context.NgInfoAlertBlobs.Remove(inspectionType); |
||||
|
await _context.SaveChangesAsync(); |
||||
|
|
||||
|
result.Success = true; |
||||
|
result.Msg = "OK"; |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
private bool NgInfoAlertBlobsExists(int id) |
||||
|
{ |
||||
|
return _context.NgInfoAlertBlobs.Any(e => e.CaseItemID == id); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,142 @@ |
|||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
using AMESCoreStudio.CommonTools.Result; |
||||
|
using AMESCoreStudio.WebApi.DTO.AMES; |
||||
|
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class NgInfoAlertDetailController : ControllerBase |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public NgInfoAlertDetailController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 異常Alert序號明細資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<NgInfoAlertDetail>>> GetNgInfoAlertDetail() |
||||
|
{ |
||||
|
IQueryable<NgInfoAlertDetail> q = _context.NgInfoAlertDetails; |
||||
|
q = q.OrderBy(p => p.CaseID).ThenBy(p=>p.CaseItemID); |
||||
|
var NgInfoAlertDetail = await q.ToListAsync(); |
||||
|
return NgInfoAlertDetail; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 異常Alert序號明細資料by CaseID
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<NgInfoAlertDetail>>> GetNgInfoAlertDetails(string id) |
||||
|
{ |
||||
|
|
||||
|
IQueryable<NgInfoAlertDetail> q = _context.NgInfoAlertDetails; |
||||
|
q = q.Where(p => p.CaseID.Equals(id)); |
||||
|
var NgInfoAlertDetails = await q.ToListAsync(); |
||||
|
|
||||
|
if (NgInfoAlertDetails == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return NgInfoAlertDetails; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增異常Alert序號明細資料
|
||||
|
/// </summary>
|
||||
|
/// <param name="NgInfoAlertDetail"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost] |
||||
|
public async Task<ResultModel<NgInfoAlertDetail>> PostNgInfoAlertDetail(List<NgInfoAlertDetail> NgInfoAlertDetail) |
||||
|
{ |
||||
|
ResultModel<NgInfoAlertDetail> result = new ResultModel<NgInfoAlertDetail>(); |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
IQueryable<NgInfoAlertDetail> q = _context.NgInfoAlertDetails; |
||||
|
Helper helper = new Helper(_context); |
||||
|
foreach (var item in NgInfoAlertDetail) |
||||
|
{ |
||||
|
|
||||
|
item.CaseItemID = helper.GetIDKey("CASE_ITEM_ID").Result;// CaseItemID;
|
||||
|
item.CreateDate = DateTime.Now; |
||||
|
_context.NgInfoAlertDetails.Add(item); |
||||
|
|
||||
|
} |
||||
|
await _context.SaveChangesAsync(); |
||||
|
result.Success = true; |
||||
|
result.Msg = "OK"; |
||||
|
|
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
result.Success = false; |
||||
|
result.Msg = ex.InnerException.Message; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新異常Alert序號明細資料
|
||||
|
/// </summary>
|
||||
|
/// <param name="NgInfoAlertDetail"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPut] |
||||
|
public async Task<ResultModel<NgInfoAlertDetail>> PutNgInfoAlertDetail(NgInfoAlertDetail NgInfoAlertDetail) |
||||
|
{ |
||||
|
ResultModel<NgInfoAlertDetail> result = new ResultModel<NgInfoAlertDetail>(); |
||||
|
var CaseItemID = NgInfoAlertDetail.CaseItemID; |
||||
|
try |
||||
|
{ |
||||
|
if (_context.NgInfoAlertDetails.Any(e => e.CaseItemID == CaseItemID)) |
||||
|
{ |
||||
|
_context.Entry(NgInfoAlertDetail).State = EntityState.Modified; |
||||
|
_context.Entry<NgInfoAlertDetail>(NgInfoAlertDetail).Property("CreateDate").IsModified = false; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_context.NgInfoAlertDetails.Add(NgInfoAlertDetail); |
||||
|
} |
||||
|
|
||||
|
await _context.SaveChangesAsync(); |
||||
|
result.Success = true; |
||||
|
result.Msg = "OK"; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
result.Success = false; |
||||
|
result.Msg = ex.InnerException.Message; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
// DELETE api/<NgInfoAlertDetailController>/5
|
||||
|
[HttpDelete("{id}")] |
||||
|
public void Delete(int id) |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,268 @@ |
|||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
using AMESCoreStudio.CommonTools.Result; |
||||
|
using AMESCoreStudio.WebApi.DTO.AMES; |
||||
|
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class NgInfoAlertMasterController : ControllerBase |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public NgInfoAlertMasterController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 異常Alert資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<NgInfoAlertMaster>>> GetNgInfoAlertMaster() |
||||
|
{ |
||||
|
IQueryable<NgInfoAlertMaster> q = _context.NgInfoAlertMasters; |
||||
|
q = q.OrderBy(p => p.CaseID); |
||||
|
var NgInfoAlertMaster = await q.ToListAsync(); |
||||
|
return NgInfoAlertMaster; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 異常Alert資料by CaseID
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<NgInfoAlertMaster>> GetNgInfoAlertMaster(string id) |
||||
|
{ |
||||
|
IQueryable<NgInfoAlertMaster> q = _context.NgInfoAlertMasters; |
||||
|
|
||||
|
var NgInfoAlertMaster = await q.Where(p => p.CaseID == id).FirstOrDefaultAsync(); |
||||
|
|
||||
|
//if (NgInfoAlertMaster == null)
|
||||
|
//{
|
||||
|
// return NotFound();
|
||||
|
//}
|
||||
|
|
||||
|
return NgInfoAlertMaster; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增異常Alert資料
|
||||
|
/// </summary>
|
||||
|
/// <param name="NgInfoAlertMaster"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost] |
||||
|
public async Task<ResultModel<NgInfoAlertMaster>> PostNgInfoAlertMaster([FromBody] NgInfoAlertMaster NgInfoAlertMaster) |
||||
|
{ |
||||
|
ResultModel<NgInfoAlertMaster> result = new ResultModel<NgInfoAlertMaster>(); |
||||
|
var TmpCaseID = "R" + DateTime.Now.ToString("yyyy"); |
||||
|
var MaxCaseID= _context.NgInfoAlertMasters.Where(w => w.CaseID.Contains(TmpCaseID)).Max(m => m.CaseID); |
||||
|
if (String.IsNullOrWhiteSpace(MaxCaseID)) |
||||
|
{ |
||||
|
MaxCaseID = "0000"; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
MaxCaseID = MaxCaseID.Substring(4); |
||||
|
} |
||||
|
int serialNumber = int.Parse(MaxCaseID); // 將四位數字轉換為整數
|
||||
|
// 若流水號小於9999,則加1
|
||||
|
if (serialNumber < 9999) |
||||
|
{ |
||||
|
serialNumber++; |
||||
|
} |
||||
|
// 用新的流水號更新字串,若流水號為9999,則不再進位
|
||||
|
NgInfoAlertMaster.CaseID = TmpCaseID + serialNumber.ToString("D4"); |
||||
|
_context.NgInfoAlertMasters.Add(NgInfoAlertMaster); |
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
result.Success = true; |
||||
|
result.Msg = NgInfoAlertMaster.CaseID.ToString(); |
||||
|
|
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
result.Success = false; |
||||
|
result.Msg = ex.InnerException.Message; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新異常Alert資料
|
||||
|
/// </summary>
|
||||
|
/// <param name="NgInfoAlertMaster"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPut] |
||||
|
public async Task<ResultModel<NgInfoAlertMaster>> PutNgInfoAlertMaster(NgInfoAlertMaster NgInfoAlertMaster) |
||||
|
{ |
||||
|
ResultModel<NgInfoAlertMaster> result = new ResultModel<NgInfoAlertMaster>(); |
||||
|
var CaseID = NgInfoAlertMaster.CaseID; |
||||
|
try |
||||
|
{ |
||||
|
if (_context.NgInfoAlertMasters.Any(e => e.CaseID == CaseID)) |
||||
|
{ |
||||
|
_context.Entry(NgInfoAlertMaster).State = EntityState.Modified; |
||||
|
_context.Entry<NgInfoAlertMaster>(NgInfoAlertMaster).Property("CreateDate").IsModified = false; |
||||
|
_context.Entry<NgInfoAlertMaster>(NgInfoAlertMaster).Property("UserID").IsModified = false; |
||||
|
if (NgInfoAlertMaster.StatusNo == "F") |
||||
|
{ |
||||
|
NgInfoAlertMaster.FinishDate = DateTime.Now; |
||||
|
if (NgInfoAlertMaster.UpdateDate == null) |
||||
|
{ |
||||
|
NgInfoAlertMaster.UpdateDate = DateTime.Now; |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
NgInfoAlertMaster.UpdateDate = DateTime.Now; |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
_context.NgInfoAlertMasters.Add(NgInfoAlertMaster); |
||||
|
} |
||||
|
|
||||
|
await _context.SaveChangesAsync(); |
||||
|
result.Success = true; |
||||
|
result.Msg = "OK"; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
result.Success = false; |
||||
|
result.Msg = ex.InnerException.Message; |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 查詢工單站別在製條碼資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[Route("[action]")]
|
||||
|
[HttpGet] |
||||
|
public async Task<ResultModel<dynamic>> GetNGINFOAlertMasterByQuery(string caseID,string itemNoF, string modelName, string wipNoF, string errorCode, string statusNo, string dateStart, string dateEnd, int page = 0, int limit = 10) |
||||
|
{ |
||||
|
ResultModel<dynamic> result = new ResultModel<dynamic>(); |
||||
|
|
||||
|
var q = from m in _context.NgInfoAlertMasters |
||||
|
join s in _context.Stationses on m.StationID equals s.StationID into stationsJoin |
||||
|
from s in stationsJoin.DefaultIfEmpty() |
||||
|
join u in _context.UserInfoes on m.UpdateUserID equals u.UserID into userJoin |
||||
|
from u in userJoin.DefaultIfEmpty() |
||||
|
join f in _context.FactoryInfos on m.FactoryID equals f.FactoryID into factoryJoin |
||||
|
from f in factoryJoin.DefaultIfEmpty() |
||||
|
select new |
||||
|
{ |
||||
|
m.CaseID, |
||||
|
m.FactoryID, |
||||
|
m.BarcodeNo, |
||||
|
m.WipNoF, |
||||
|
m.ItemNoF, |
||||
|
m.ModelName, |
||||
|
m.WipNoH, |
||||
|
m.ItemNoH, |
||||
|
m.StationID, |
||||
|
m.CreateDate, |
||||
|
m.ReasonNo, |
||||
|
m.UpdateUserID, |
||||
|
StatusNo = m.StatusNo == "A" ? "未處理" : |
||||
|
m.StatusNo == "E" ? "處理中" : |
||||
|
m.StatusNo == "F" ? "已結案" : "未知狀態", // 根據 StatusNo 顯示不同的狀態
|
||||
|
s.StationName, |
||||
|
u.UserName, |
||||
|
f.FactoryNo, |
||||
|
m.UpdateDate, |
||||
|
m.FinishDate |
||||
|
}; |
||||
|
if (!string.IsNullOrWhiteSpace(caseID)) |
||||
|
{ |
||||
|
q = q.Where(w => w.CaseID == caseID); |
||||
|
} |
||||
|
if (!string.IsNullOrWhiteSpace(itemNoF)) |
||||
|
{ |
||||
|
q = q.Where(w => w.ItemNoF == itemNoF); |
||||
|
} |
||||
|
if (!string.IsNullOrWhiteSpace(modelName)) |
||||
|
{ |
||||
|
q = q.Where(w => w.ModelName == modelName); |
||||
|
} |
||||
|
if (!string.IsNullOrWhiteSpace(wipNoF)) |
||||
|
{ |
||||
|
q = q.Where(w => w.WipNoF == wipNoF); |
||||
|
} |
||||
|
if (!string.IsNullOrWhiteSpace(errorCode)) |
||||
|
{ |
||||
|
|
||||
|
q = q.Where(w => w.ReasonNo == errorCode); |
||||
|
} |
||||
|
if (!string.IsNullOrWhiteSpace(statusNo) && statusNo != "ALL") |
||||
|
{ |
||||
|
|
||||
|
q = q.Where(w => w.StatusNo == statusNo); |
||||
|
} |
||||
|
|
||||
|
if (dateStart != null && dateStart != "" && dateEnd != null && dateEnd != "") |
||||
|
{ |
||||
|
q = q.Where(w => w.CreateDate >= DateTime.Parse(dateStart + " 00:00:00") && w.CreateDate <= DateTime.Parse(dateEnd + " 23:59:59")); |
||||
|
} |
||||
|
|
||||
|
if (string.IsNullOrWhiteSpace(itemNoF) && string.IsNullOrWhiteSpace(modelName) && |
||||
|
string.IsNullOrWhiteSpace(wipNoF) && string.IsNullOrWhiteSpace(errorCode) && |
||||
|
string.IsNullOrWhiteSpace(statusNo) && string.IsNullOrWhiteSpace(dateStart) |
||||
|
&& string.IsNullOrWhiteSpace(dateEnd)) |
||||
|
{ |
||||
|
q = q.OrderByDescending(c => c.CreateDate).Take(5); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
//紀錄筆數
|
||||
|
|
||||
|
result.DataTotal = q.Count(); |
||||
|
|
||||
|
// Table 頁數
|
||||
|
if (page > 0) |
||||
|
{ |
||||
|
q = q.Skip((page - 1) * limit).Take(limit); |
||||
|
} |
||||
|
if (result == null) |
||||
|
{ |
||||
|
result.Msg = "查無資料"; |
||||
|
result.Success = false; |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
result.Data = await q.ToListAsync(); |
||||
|
result.Success = true; |
||||
|
return result; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
// DELETE api/<NgInfoAlertMasterController>/5
|
||||
|
[HttpDelete("{id}")] |
||||
|
public void Delete(int id) |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,102 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Runtime.Serialization; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.AMES |
||||
|
{ // YIRU 2022-90-20
|
||||
|
/// <summary>
|
||||
|
/// 設備圖
|
||||
|
/// </summary>
|
||||
|
[Table("NG_INFO_ALERT_BLOB", Schema = "JHAMES")] |
||||
|
public partial class NgInfoAlertBlob |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 警報ID
|
||||
|
/// </summary>
|
||||
|
[Column("CASE_ID")] |
||||
|
[DataMember] |
||||
|
[Key] |
||||
|
[Required] |
||||
|
|
||||
|
public string CaseID { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 警報ID
|
||||
|
/// </summary>
|
||||
|
[Column("CASE_ITEMID")] |
||||
|
[DataMember] |
||||
|
[Key] |
||||
|
[Required] |
||||
|
|
||||
|
public int CaseItemID { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 檔名
|
||||
|
/// </summary>
|
||||
|
[Column("IMAGE_NAME")] |
||||
|
[Display(Name = "檔名")] |
||||
|
[DataMember] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
public string ImageName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 圖檔
|
||||
|
/// </summary>
|
||||
|
[Column("IMAGE_BLOB")] |
||||
|
[Display(Name = "圖檔")] |
||||
|
[DataMember] |
||||
|
public byte[] ImageBlob { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 儲存路徑
|
||||
|
/// </summary>
|
||||
|
[Column("FILEPATH")] |
||||
|
[Display(Name = "儲存路徑")] |
||||
|
[DataMember] |
||||
|
public string FilePath { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 備註
|
||||
|
/// </summary>
|
||||
|
[Column("MEMOS")] |
||||
|
[Display(Name = "檔案備註")] |
||||
|
[DataMember] |
||||
|
public string Memos { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建者ID
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int CreateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 創建日期
|
||||
|
/// </summary>
|
||||
|
[Column("CREATE_DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime CreateDate { get; set; } = System.DateTime.Now; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新者ID
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int UpdateUserID { get; set; } = 0; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新日期
|
||||
|
/// </summary>
|
||||
|
[Column("UPDATE_DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime UpdateDate { get; set; } = System.DateTime.Now; |
||||
|
} |
||||
|
} |
@ -0,0 +1,129 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using System.Runtime.Serialization; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.AMES |
||||
|
{ |
||||
|
[Table("NG_INFO_ALERT_DETAIL", Schema = "JHAMES")] |
||||
|
public partial class NgInfoAlertDetail |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 案件編號 (Case ID)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "CASE ID")] |
||||
|
[Required(ErrorMessage = "{0} 不能空白")] |
||||
|
[Column("CASE_ID")] |
||||
|
public string CaseID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 案件項目編號 (Case Item ID)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "CASEITEM ID")] |
||||
|
[Key] |
||||
|
[Column("CASE_ITEM_ID")] |
||||
|
public int CaseItemID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生產序號 (Production Serial Number)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "生產序號")] |
||||
|
[Column("BARCODE_NO")] |
||||
|
public string BarcodeNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 發生站別 (Station ID)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "發生站別")] |
||||
|
[Column("STATION_ID")] |
||||
|
public int StationID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 警報時間 (Alert Time)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "建立時間")] |
||||
|
[Column("CREATE_DATE")] |
||||
|
public DateTime CreateDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 作業人員 (Operator ID)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "作業人員")] |
||||
|
[Column("USER_ID")] |
||||
|
public int UserID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 資料來源 (Data Source)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "資料來源")] |
||||
|
[Column("SOURCE")] |
||||
|
public string Source { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 警報原因 (Alert Reason)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "警報原因")] |
||||
|
[Column("REASON_NO")] |
||||
|
public string ReasonNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 機種 (Model Name)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "機種")] |
||||
|
[Column("MODEL_NAME")] |
||||
|
public string ModelName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 系統工單 (System Work Order)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "系統工單")] |
||||
|
[Column("WIP_NO_F")] |
||||
|
public string WipNoF { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 單板工單 (Sub-Board Work Order)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "單板工單")] |
||||
|
[Column("WIP_NO_H")] |
||||
|
public string WipNoH { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 系統料號 (System Item Number)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "系統料號")] |
||||
|
[Column("ITEM_NO_F")] |
||||
|
public string ItemNoF { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 單板料號 (Sub-Board Item Number)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "單板料號")] |
||||
|
[Column("ITEM_NO_H")] |
||||
|
public string ItemNoH { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 廠別 (Factory ID)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "廠別")] |
||||
|
[Column("FACTORY_ID")] |
||||
|
public int FactoryID { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,195 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using System.Runtime.Serialization; |
||||
|
using AMESCoreStudio.WebApi.Models.BAS; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 異常警報
|
||||
|
/// </summary>
|
||||
|
[Table("NG_INFO_ALERT_MASTER", Schema = "JHAMES")] |
||||
|
public partial class NgInfoAlertMaster |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 案件編號
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "CASE ID")] |
||||
|
[Required(ErrorMessage = "{0} 不能空白")] |
||||
|
[Key] |
||||
|
[Column("CASE_ID")] |
||||
|
public string CaseID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 廠別
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "廠別")] |
||||
|
[Required(ErrorMessage = "{0} 不能空白")] |
||||
|
[Column("FACTORY_ID")] |
||||
|
public int FactoryID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生產序號
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "生產序號")] |
||||
|
[Column("BARCODE_NO")] |
||||
|
public string BarcodeNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 系統工單
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "系統工單")] |
||||
|
[Column("WIP_NO_F")] |
||||
|
public string WipNoF { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 系統料號
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "系統料號")] |
||||
|
[Column("ITEM_NO_F")] |
||||
|
public string ItemNoF { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 機種
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "機種")] |
||||
|
[Column("MODEL_NAME")] |
||||
|
public string ModelName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 單板工單
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "單板工單")] |
||||
|
[Column("WIP_NO_H")] |
||||
|
public string WipNoH { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 單板料號
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "單板料號")] |
||||
|
[Column("ITEM_NO_H")] |
||||
|
public string ItemNoH { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 發生站別
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "發生站別")] |
||||
|
[Column("STATION_ID")] |
||||
|
public int StationID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 警報時間
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "警報時間")] |
||||
|
[Column("CREATE_DATE")] |
||||
|
public DateTime CreateDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 警報原因
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "警報原因")] |
||||
|
[Column("REASON_NO")] |
||||
|
public string ReasonNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 作業人員
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "作業人員")] |
||||
|
[Column("USER_ID")] |
||||
|
public int UserID { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 狀態 (A: 未處理, E: 處理中, F: 已結案)
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "狀態")] |
||||
|
[StringLength(2)] |
||||
|
[Column("STATUS_NO")] |
||||
|
public string StatusNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 警報處理時間
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "警報處理時間")] |
||||
|
[Column("UPDATE_DATE")] |
||||
|
public DateTime? UpdateDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 處理完成時間
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "處理完成時間")] |
||||
|
[Column("FINISH_DATE")] |
||||
|
public DateTime? FinishDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 警報處理人員
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "QA人員")] |
||||
|
[Column("UPDATE_USERID")] |
||||
|
public int UpdateUserID { get; set; } = 0; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 短期對策
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "短期對策")] |
||||
|
[Column("SHORT_TERM")] |
||||
|
public string ShortTerm { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 長期對策
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "長期對策")] |
||||
|
[Column("LONG_TERM")] |
||||
|
public string LongTerm { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 備註
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "備註")] |
||||
|
[Column("MEMOS")] |
||||
|
public string Memos { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 連結
|
||||
|
/// </summary>
|
||||
|
[DataMember] |
||||
|
[Display(Name = "連結")] |
||||
|
[Column("LINK")] |
||||
|
public string Link { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 工單-基本資料
|
||||
|
/// </summary>
|
||||
|
[ForeignKey("FactoryID")] |
||||
|
[DataMember] |
||||
|
public virtual FactoryInfo GetFactoryInfo { get; set; } |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue