9 changed files with 651 additions and 30 deletions
@ -0,0 +1,113 @@ |
|||||
|
@{ |
||||
|
ViewData["Title"] = "機種C/T資料維護"; |
||||
|
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"> |
||||
|
<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: 'itemNo', |
||||
|
title: '料號' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'cT1', |
||||
|
width: 200, |
||||
|
title: '每個產出時間' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'cT2', |
||||
|
width: 200, |
||||
|
title: '每分鐘產出個數' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'unit', |
||||
|
title: '製程', |
||||
|
width: 200, |
||||
|
sort: true, |
||||
|
templet: function (d) { |
||||
|
return d.unit['unitName']; |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'line', |
||||
|
title: '線別', |
||||
|
width: 200, |
||||
|
sort: true, |
||||
|
templet: function (d) { |
||||
|
return d.line['lineDesc']; |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
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) { |
||||
|
if (obj.data.itemNo) { |
||||
|
hg.open('修改機種C/T資料', '/PPS/PPS003U/' + obj.data.itemNo + ',' + obj.data.lineID, 800, 800); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//通过行tool删除,lay-event="del" |
||||
|
function del(obj) { |
||||
|
if (obj.data.itemNo) { |
||||
|
hg.confirm("機種C/T資料:" + obj.data.itemNo + ',' + obj.data.line.lineDesc + ",确定要删除吗?", function () { |
||||
|
$.ajax({ |
||||
|
url: '/PPS/PPS003D', |
||||
|
data: { id: obj.data.itemNo + ',' + obj.data.lineID }, |
||||
|
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('新增機種C/T資料', '/PPS/PPS003C', 800, 800); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
//基本数据表格 |
||||
|
var table = hg.table.datatable('test', '機種C/T資料維護', '/PPS/GetCycleTimes', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
</script> |
||||
|
} |
@ -0,0 +1,136 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.CycleTime |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS003C"; |
||||
|
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="PPS003CSave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="ItemNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="ItemNo" class="form-control col-sm-9" placeholder="請輸入料號" /> |
||||
|
<span asp-validation-for="ItemNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="CT1" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="CT1" class="form-control col-sm-9" placeholder="請輸入每個產出時間" /> |
||||
|
<span asp-validation-for="CT1" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="CT2" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="CT2" class="form-control col-sm-9" placeholder="請輸入每分鐘產出個數" /> |
||||
|
<span asp-validation-for="CT2" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="SectionNo" class="control-label col-sm-3"></label> |
||||
|
<select id="section" lay-filter="section" lay-verify="required" asp-for="SectionNo" asp-items="@ViewBag.SectionList" class="custom-select col-sm-9"></select> |
||||
|
<span asp-validation-for="SectionNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
<input id="sectionNo" type="hidden" name="sectionNo" value="*" /> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="LineID" class="control-label col-sm-3"></label> |
||||
|
<select id="line" lay-filter="line" lay-verify="required" asp-for="LineID" asp-items="@ViewBag.LineList" class="custom-select col-sm-9"></select> |
||||
|
<span asp-validation-for="LineID" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="FirstTime" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="FirstTime" class="form-control col-sm-9" placeholder="請輸入首件產出時間" /> |
||||
|
<span asp-validation-for="FirstTime" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="PassTime" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="PassTime" class="form-control col-sm-9" placeholder="請輸入良品產出時間" /> |
||||
|
<span asp-validation-for="PassTime" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="OPCnt" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="OPCnt" class="form-control col-sm-9" placeholder="請輸入作業人數" /> |
||||
|
<span asp-validation-for="OPCnt" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="PROCnt" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="PROCnt" class="form-control col-sm-9" placeholder="請輸入日產能" /> |
||||
|
<span asp-validation-for="PROCnt" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="MOHUnit" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="MOHUnit" class="form-control col-sm-9" placeholder="請輸入月產出" /> |
||||
|
<span asp-validation-for="MOHUnit" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="WIUnit" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="WIUnit" class="form-control col-sm-9" placeholder="請輸入週產出" /> |
||||
|
<span asp-validation-for="WIUnit" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="Memo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="Memo" class="form-control col-sm-9" placeholder="請輸入備註" /> |
||||
|
<span asp-validation-for="Memo" 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"> |
||||
|
|
||||
|
function getLineList(data) { |
||||
|
$.ajax( |
||||
|
{ |
||||
|
url: "@Url.Action("GetLineJson", "PPS")", |
||||
|
dataType: 'json', |
||||
|
data: { "unit_no": $("#sectionNo").val() }, |
||||
|
type: 'post', |
||||
|
success: function (result) { |
||||
|
console.info(result.data); |
||||
|
$("#line").empty();//清空下拉框的值 |
||||
|
$.each(result.data, function (index, item) { |
||||
|
$("#line").append(new Option(item.text, item.value));// 下拉菜单里添加元素 |
||||
|
//$("#errorClass").append($("<option>").text(item.text).val(item.value)) |
||||
|
}); |
||||
|
|
||||
|
layui.form.render("select");//重新渲染 固定写法 |
||||
|
}, |
||||
|
error: function (result) { |
||||
|
alert(result); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
|
||||
|
$("#section").change(function () { |
||||
|
//alert("hi"); |
||||
|
var section_no = $(this).children('option:selected').val(); |
||||
|
$("#sectionNo").val(section_no); |
||||
|
//alert(section_no); |
||||
|
getLineList(section_no); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,106 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.CycleTime |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS003U"; |
||||
|
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="PPS003USave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
<input type="hidden" asp-for="CreateUserId" /> |
||||
|
<input type="hidden" asp-for="CreateDate" /> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="ItemNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="ItemNo" class="form-control col-sm-9" placeholder="請輸入料號" readonly="readonly" /> |
||||
|
<span asp-validation-for="ItemNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="CT1" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="CT1" class="form-control col-sm-9" placeholder="請輸入每個產出時間" /> |
||||
|
<span asp-validation-for="CT1" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="CT2" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="CT2" class="form-control col-sm-9" placeholder="請輸入每分鐘產出個數" /> |
||||
|
<span asp-validation-for="CT2" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="SectionNo" class="control-label col-sm-3"></label> |
||||
|
<select id="section" lay-filter="section" lay-verify="required" asp-for="SectionNo" asp-items="@ViewBag.SectionList" class="custom-select col-sm-9" disabled></select> |
||||
|
<span asp-validation-for="SectionNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
<input id="sectionNo" type="hidden" name="sectionNo" value="*" /> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="LineID" class="control-label col-sm-3"></label> |
||||
|
<select id="line" lay-filter="line" lay-verify="required" asp-for="LineID" asp-items="@ViewBag.LineList" class="custom-select col-sm-9" disabled></select> |
||||
|
<span asp-validation-for="LineID" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="FirstTime" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="FirstTime" class="form-control col-sm-9" placeholder="請輸入首件產出時間" /> |
||||
|
<span asp-validation-for="FirstTime" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="PassTime" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="PassTime" class="form-control col-sm-9" placeholder="請輸入良品產出時間" /> |
||||
|
<span asp-validation-for="PassTime" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="OPCnt" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="OPCnt" class="form-control col-sm-9" placeholder="請輸入作業人數" /> |
||||
|
<span asp-validation-for="OPCnt" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="PROCnt" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="PROCnt" class="form-control col-sm-9" placeholder="請輸入日產能" /> |
||||
|
<span asp-validation-for="PROCnt" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="MOHUnit" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="MOHUnit" class="form-control col-sm-9" placeholder="請輸入月產出" /> |
||||
|
<span asp-validation-for="MOHUnit" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="WIUnit" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="WIUnit" class="form-control col-sm-9" placeholder="請輸入週產出" /> |
||||
|
<span asp-validation-for="WIUnit" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="Memo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="Memo" class="form-control col-sm-9" placeholder="請輸入備註" /> |
||||
|
<span asp-validation-for="Memo" 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); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
Loading…
Reference in new issue