25 changed files with 968 additions and 26 deletions
@ -0,0 +1,189 @@ |
|||
@{ |
|||
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" style="margin-bottom:5px;"> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-inline" style="margin-right:5px;"> |
|||
<label class="layui-inline layui-form-label">料號</label> |
|||
<div class="layui-input-inline"> |
|||
<input type="text" name="itemNo" id="itemNo" placeholder="请输入料號" autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline" style="margin-left:0px;"> |
|||
<div class="layui-btn-group"> |
|||
<button class="layui-btn layui-btn-sm layui-btn-normal" id="querysubmit" lay-filter="querysubmit"> |
|||
<i class="layui-icon layui-icon-sm"></i> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<table class="layui-hide" id="test" lay-filter="test"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
@section Scripts{ |
|||
<script type="text/javascript"> |
|||
//监听表单提交事件 |
|||
hg.form.onsubmit('querysubmit', function (data) { |
|||
//table && table.reload(data); |
|||
}); |
|||
var tableCols = [[ |
|||
{ |
|||
field: 'item', |
|||
title: '料號', |
|||
sort: true, |
|||
templet: function (d) { |
|||
var itemNo; |
|||
if (d.item) |
|||
itemNo = d.item["itemNo"]; |
|||
else |
|||
itemNo = "N/A"; |
|||
return itemNo; |
|||
|
|||
} |
|||
}, |
|||
{ |
|||
field: 'kpName', |
|||
title: '組件料號名稱' |
|||
}, |
|||
{ |
|||
field: 'kpNo', |
|||
title: '組件料號編碼' |
|||
}, |
|||
{ |
|||
field: 'kpSeq', |
|||
title: '順序' |
|||
}, |
|||
{ |
|||
field: 'title', |
|||
title: '前置碼' |
|||
}, |
|||
{ |
|||
field: 'length', |
|||
title: '長度' |
|||
}, |
|||
{ |
|||
field: 'unit', |
|||
title: '製程單位', |
|||
templet: function (d) { |
|||
var unit; |
|||
if (d.unit) |
|||
unit = d.unit["unitName"]; |
|||
else |
|||
unit = "N/A"; |
|||
return unit; |
|||
} |
|||
},//MTNO001-TEST |
|||
{ |
|||
field: 'isRepeat', |
|||
title: '是否重複' |
|||
}, |
|||
{ |
|||
field: 'right', |
|||
width: 200, |
|||
title: '操作', |
|||
fixed: 'right', |
|||
templet: function (d) { |
|||
return '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a> <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del" > 删除</a> ' |
|||
} |
|||
}] |
|||
]; |
|||
//通过行tool编辑,lay-event="edit" |
|||
function edit(obj) { |
|||
console.info(obj.data); |
|||
if (obj.data.materialKpID) { |
|||
hg.open('修改料號組件對應', '/KCS/KCS007U/' + obj.data.materialKpID , 480,480); |
|||
} |
|||
} |
|||
//通过行tool删除,lay-event="del" |
|||
function del(obj) { |
|||
//alert(obj); |
|||
if (obj.data.materialKpID) { |
|||
hg.confirm("系統:" + obj.data.kpName + ",确定要删除吗?", function () { |
|||
$.ajax({ |
|||
url: '/KCS/KCS007D', |
|||
data: { id: obj.data.materialKpID}, |
|||
type: 'POST', |
|||
success: function (data) { |
|||
if (data.success) { |
|||
obj.del(); //只删本地数据 |
|||
hg.msghide("删除成功!"); |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
var toolbar = [{ |
|||
text: '新增', |
|||
layuiicon: '', |
|||
class: 'layui-btn-normal', |
|||
handler: function () { |
|||
hg.open('新增料號組件對應', '/KCS/KCS007C', 480, 480); |
|||
|
|||
} |
|||
} |
|||
]; |
|||
////搜索 |
|||
$('#querysubmit').click(function () { |
|||
//console.log('#btnSearch'); |
|||
var itemNo = $("#itemNo").val(); |
|||
if (itemNo) { |
|||
hg.msghide("刷新数据!"); |
|||
tt(); |
|||
} |
|||
else { |
|||
alert("請選擇料號!!!!"); |
|||
} |
|||
return false; |
|||
|
|||
}); |
|||
//基本数据表格 |
|||
var table; |
|||
|
|||
function tt() { |
|||
//基本数据表格 |
|||
var iNO = ""; |
|||
iNO = $("#itemNo").val(); |
|||
|
|||
$.ajax({ |
|||
url: '/KCS/GetMaterialItemByItemNO', |
|||
data: { id: iNO }, |
|||
type: 'GET', |
|||
success: function (data) { |
|||
if (data.success) { |
|||
console.log(data); |
|||
table = hg.table.datatable('test', '料號組件對應維護', '/KCS/GetMaterialKpsByItemID?id=' + data.data.itemID |
|||
, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
|||
} |
|||
else { |
|||
hg.msg("請確認料號是正確!"); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("網路請求失敗!"); |
|||
} |
|||
}); |
|||
|
|||
}; |
|||
</script> |
|||
} |
@ -0,0 +1,122 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.MaterialKp |
|||
|
|||
|
|||
@{ ViewData["Title"] = "KCS007C"; |
|||
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="KCS007CSave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="MaterialKpID" value="0" /> |
|||
<input type="hidden" asp-for="CreateUserID" value="@ViewBag.UserID" /> |
|||
<input type="hidden" asp-for="UpdateUserID" value="@ViewBag.UserID" /> |
|||
<input type="hidden" asp-for="CreateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="ItemID" class="control-label col-sm-3"></label> |
|||
<input id="ItemNo" class="form-control col-sm-9" /> |
|||
<input id="ItemID" asp-for="ItemID" type="hidden" /> |
|||
<span asp-validation-for="ItemID" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="KpName" class="control-label col-sm-3"></label> |
|||
<input asp-for="KpName" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="KpName" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="KpNo" class="control-label col-sm-3"></label> |
|||
<input asp-for="KpNo" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="KpNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="KpSeq" class="control-label col-sm-3"></label> |
|||
<input asp-for="KpSeq" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="KpSeq" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Title" class="control-label col-sm-3"></label> |
|||
<input asp-for="Title" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="Title" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Length" class="control-label col-sm-3"></label> |
|||
<input asp-for="Length" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="Length" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="StationType" class="control-label col-sm-3"></label> |
|||
<select asp-for="StationType" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"> |
|||
<option value="">請選擇</option> |
|||
</select> |
|||
<span asp-validation-for="StationType" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="IsRepeat" class="control-label col-sm-3"></label> |
|||
<select asp-for="IsRepeat" class="custom-select col-sm-9"> |
|||
<option value="">請選擇</option> |
|||
<option value="Y">是</option> |
|||
<option value="N">否</option> |
|||
</select> |
|||
<span asp-validation-for="IsRepeat" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<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> |
|||
|
|||
</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); |
|||
} |
|||
}); |
|||
|
|||
$("#ItemNo").blur(function () { |
|||
var data = $("#ItemNo").val(); |
|||
console.log(data); |
|||
getItemID(data); |
|||
//$("input").css("background-color", "#D6D6FF"); |
|||
}); |
|||
function getItemID(itemNo) { |
|||
$.ajax({ |
|||
url: "/KCS/GetMaterialItemByItemNO", |
|||
data: { id: itemNo}, |
|||
dataType: 'json', |
|||
contentType: "application/json", |
|||
type: 'get', |
|||
success: function (result) { |
|||
if (result.data) { |
|||
console.info(result.data); |
|||
$("#ItemID").val(result.data.itemID); |
|||
} |
|||
else { |
|||
alert('請確認料號是否正確!!!'); |
|||
} |
|||
|
|||
} |
|||
}); |
|||
}; |
|||
|
|||
</script> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,122 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.MaterialKp |
|||
|
|||
|
|||
@{ ViewData["Title"] = "KCS007U"; |
|||
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="KCS007USave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="MaterialKpID"/> |
|||
<input type="hidden" asp-for="CreateUserID" /> |
|||
<input type="hidden" asp-for="UpdateUserID" value="@ViewBag.UserID" /> |
|||
<input type="hidden" asp-for="CreateDate" /> |
|||
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="ItemID" class="control-label col-sm-3"></label> |
|||
<input id="ItemNo" value="@Model.Item.ItemNo" class="form-control col-sm-9" readonly/> |
|||
<input id="ItemID" asp-for="ItemID" type="hidden" /> |
|||
<span asp-validation-for="ItemID" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="KpName" class="control-label col-sm-3"></label> |
|||
<input asp-for="KpName" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="KpName" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="KpNo" class="control-label col-sm-3"></label> |
|||
<input asp-for="KpNo" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="KpNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="KpSeq" class="control-label col-sm-3"></label> |
|||
<input asp-for="KpSeq" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="KpSeq" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Title" class="control-label col-sm-3"></label> |
|||
<input asp-for="Title" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="Title" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Length" class="control-label col-sm-3"></label> |
|||
<input asp-for="Length" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="Length" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="StationType" class="control-label col-sm-3"></label> |
|||
<select asp-for="StationType" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"> |
|||
<option value="">請選擇</option> |
|||
</select> |
|||
<span asp-validation-for="StationType" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="IsRepeat" class="control-label col-sm-3"></label> |
|||
<select asp-for="IsRepeat" class="custom-select col-sm-9"> |
|||
<option value="">請選擇</option> |
|||
<option value="Y">是</option> |
|||
<option value="N">否</option> |
|||
</select> |
|||
<span asp-validation-for="IsRepeat" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<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> |
|||
|
|||
</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); |
|||
} |
|||
}); |
|||
|
|||
$("#ItemNo").blur(function () { |
|||
var data = $("#ItemNo").val(); |
|||
console.log(data); |
|||
getItemID(data); |
|||
//$("input").css("background-color", "#D6D6FF"); |
|||
}); |
|||
function getItemID(itemNo) { |
|||
$.ajax({ |
|||
url: "/KCS/GetMaterialItemByItemNO", |
|||
data: { id: itemNo}, |
|||
dataType: 'json', |
|||
contentType: "application/json", |
|||
type: 'get', |
|||
success: function (result) { |
|||
if (result.data) { |
|||
console.info(result.data); |
|||
$("#ItemID").val(result.data.itemID); |
|||
} |
|||
else { |
|||
alert('請確認料號是否正確!!!'); |
|||
} |
|||
|
|||
} |
|||
}); |
|||
}; |
|||
|
|||
</script> |
|||
|
|||
|
|||
} |
|||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue