47 changed files with 8363 additions and 8 deletions
File diff suppressed because it is too large
@ -0,0 +1,375 @@ |
|||
using System.Collections.Generic; |
|||
using WebApiClient; |
|||
using WebApiClient.Attributes; |
|||
using AMESCoreStudio.WebApi; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using AMESCoreStudio.WebApi.Models.AMES; |
|||
using AMESCoreStudio.WebApi.Models.BAS; |
|||
using AMESCoreStudio.CommonTools.Result; |
|||
|
|||
namespace AMESCoreStudio.Web |
|||
{ |
|||
[JsonReturn] |
|||
public interface IWHS:IHttpApi |
|||
{ |
|||
#region WHS001 工作群組維護
|
|||
|
|||
/// <summary>
|
|||
/// 新增工作群組
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPost("api/WorkGroups")] |
|||
ITask<ResultModel<WorkGroup>> PostWorkGroups([FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 更新工作群組
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPut("api/WorkGroups/{id}")] |
|||
ITask<ResultModel<WorkGroup>> PutWorkGroups(int id, [FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 刪除工作群組
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpDelete("api/WorkGroups/{id}")] |
|||
ITask<ResultModel<string>> DeleteWorkGroups(int id); |
|||
|
|||
/// <summary>
|
|||
/// 根據ID獲取指定工單狀態資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/WorkGroups/{id}")] |
|||
ITask<List<WorkGroup>> GetWorkGroups(int id); |
|||
|
|||
/// <summary>
|
|||
/// 獲取工單狀態資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/WorkGroups")] |
|||
ITask<List<WorkGroup>> GetWorkGroups(); |
|||
|
|||
#endregion
|
|||
|
|||
#region WHS002 工時類別維護
|
|||
|
|||
/// <summary>
|
|||
/// 新增工時類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPost("api/WorkClasses")] |
|||
ITask<ResultModel<WorkClass>> PostWorkClass([FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 更新工時類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPut("api/WorkClasses/{id}")] |
|||
ITask<ResultModel<WorkClass>> PutWorkClass(int id, [FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 刪除工時類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpDelete("api/WorkClasses/{id}")] |
|||
ITask<ResultModel<string>> DeleteWorkClass(int id); |
|||
|
|||
/// <summary>
|
|||
/// 根據ID獲取指定工時類別資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/WorkClasses/{id}")] |
|||
ITask<List<WorkClass>> GetWorkClasses(int id); |
|||
|
|||
/// <summary>
|
|||
/// 獲取工時類別資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/WorkClasses")] |
|||
ITask<List<WorkClass>> GetWorkClasses(); |
|||
|
|||
#endregion
|
|||
|
|||
#region WHS003 標準工時維護
|
|||
|
|||
/// <summary>
|
|||
/// 新增標準工時
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPost("api/StandardWorkTimes")] |
|||
ITask<ResultModel<StandardWorkTime>> PostStandardWorkTime([FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 更新標準工時
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPut("api/StandardWorkTimes/{id}")] |
|||
ITask<ResultModel<StandardWorkTime>> PutStandardWorkTime(int id, [FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 刪除標準工時
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpDelete("api/StandardWorkTimes/{id}")] |
|||
ITask<string> DeleteStandardWorkTime(int id); |
|||
|
|||
/// <summary>
|
|||
/// 根據ID獲取指定標準工時資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/StandardWorkTimes/{id}")] |
|||
ITask<List<StandardWorkTime>> GetStandardWorkTime(int id); |
|||
|
|||
/// <summary>
|
|||
/// 獲取標準工時資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/StandardWorkTimes")] |
|||
ITask<List<StandardWorkTime>> GetStandardWorkTimes(); |
|||
|
|||
/// <summary>
|
|||
/// 獲取標準工時資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/StandardWorkTimes/WHS003/{u}/{l}/{i}")] |
|||
ITask<List<StandardWorkTime>> GetStandardWorkTimes003(string u,int l,string i); |
|||
|
|||
/// <summary>
|
|||
/// 獲取標準工時資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/StandardWorkTimes/WHS005/{u}/{l}/{i}")] |
|||
ITask<List<StandardWorkTime>> GetStandardWorkTimes005(string u, string l, string i); |
|||
#endregion
|
|||
|
|||
#region WHS006 異常類別維護
|
|||
|
|||
/// <summary>
|
|||
/// 新增異常類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPost("api/ErrorClasses")] |
|||
ITask<ResultModel<ErrorClass>> PostErrorClass([FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 更新異常類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPut("api/ErrorClasses/{id}")] |
|||
ITask<ResultModel<ErrorClass>> PutErrorClass(string id, [FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 刪除異常類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpDelete("api/ErrorClasses/{id}")] |
|||
ITask<ResultModel<string>> DeleteErrorClass(string id); |
|||
|
|||
/// <summary>
|
|||
/// 根據ID獲取指定異常類別資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/ErrorClasses/{id}")] |
|||
ITask<List<ErrorClass>> GetErrorClass(string id); |
|||
|
|||
/// <summary>
|
|||
/// 獲取異常類別資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/ErrorClasses")] |
|||
ITask<List<ErrorClass>> GetErrorClasses(); |
|||
|
|||
/// <summary>
|
|||
/// 根据群組代碼獲取類別資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/ErrorClasses/Group/{no}")] |
|||
ITask<List<ErrorClass>> GetErrorClassesByGroup(string no); |
|||
|
|||
#endregion
|
|||
|
|||
#region WHS007 異常原因維護
|
|||
|
|||
/// <summary>
|
|||
/// 新增異常原因
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPost("api/ErrorReasons")] |
|||
ITask<ResultModel<ErrorReason>> PostErrorReason([FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 更新異常原因
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPut("api/ErrorReasons/{id}")] |
|||
ITask<ResultModel<ErrorReason>> PutErrorReason(string id, [FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 刪除異常原因
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpDelete("api/ErrorReasons/{id}")] |
|||
ITask<ResultModel<string>> DeleteErrorReason(string id); |
|||
|
|||
/// <summary>
|
|||
/// 根據ID獲取指定異常原因資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/ErrorReasons/{id}")] |
|||
ITask<List<ErrorReason>> GetErrorReason(string id); |
|||
|
|||
/// <summary>
|
|||
/// 獲取異常原因資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/ErrorReasons")] |
|||
ITask<List<ErrorReason>> GetErrorReasons(); |
|||
|
|||
/// <summary>
|
|||
/// 根据類別代碼獲取原因資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/ErrorReasons/Class/{no}")] |
|||
ITask<List<ErrorReason>> GetErrorReasonsByClass(string no); |
|||
|
|||
#endregion
|
|||
|
|||
#region WHS008 工時援入/外資料維護
|
|||
|
|||
/// <summary>
|
|||
/// 新增工時援入/外
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPost("api/SupportUsers")] |
|||
ITask<ResultModel<SupportUser>> PostSupportUser([FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 更新工時援入/外
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPut("api/SupportUsers/{id}")] |
|||
ITask<ResultModel<SupportUser>> PutSupportUser(int id, [FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 刪除工時援入/外
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpDelete("api/SupportUsers/{id}")] |
|||
ITask<ResultModel<SupportUser>> DeleteSupportUser(int id); |
|||
|
|||
/// <summary>
|
|||
/// 獲取指定工時援入/外群組資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/SupportUsers/")] |
|||
ITask<List<SupportUser>> GetSupportUsers(); |
|||
|
|||
/// <summary>
|
|||
/// 根據ID獲取指定工時援入/外群組資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/SupportUsers/{id}")] |
|||
ITask<List<SupportUser>> GetSupportUser(int id); |
|||
|
|||
/// <summary>
|
|||
/// 援入援外綜合查詢
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/SupportUsers/Query/{f}/{type}/{unit}/{sd}/{ed}")] |
|||
ITask<List<SupportUser>> GetSupportUserByQuery(string f, string type, string unit, string sd, string ed); |
|||
|
|||
#endregion
|
|||
|
|||
#region WHS009 不良現象類別維護
|
|||
|
|||
/// <summary>
|
|||
/// 新增不良現象類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPost("api/NGClasses")] |
|||
ITask<ResultModel<NGClass>> PostNGClass([FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 更新不良現象類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPut("api/NGClasses/{id}")] |
|||
ITask<ResultModel<NGClass>> PutNGClass(string id, [FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 刪除不良現象類別
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpDelete("api/NGClasses/{id}")] |
|||
ITask<ResultModel<NGClass>> DeleteNGClass(string id); |
|||
|
|||
/// <summary>
|
|||
/// 根據ID獲取指定不良現象類別資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/NGClasses/{id}")] |
|||
ITask<List<NGClass>> GetNGClass(string id); |
|||
|
|||
/// <summary>
|
|||
/// 獲取不良現象類別資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/NGClasses")] |
|||
ITask<List<NGClass>> GetNGClasses(); |
|||
|
|||
/// <summary>
|
|||
/// 根据群組代碼獲取不良現象類別資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/NGClasses/Group/{no}")] |
|||
ITask<List<NGClass>> GetNGClassesByGroup(string no, int page = 1, int limit = 10); |
|||
|
|||
#endregion
|
|||
|
|||
#region WHS011 重工標準工時維護
|
|||
|
|||
/// <summary>
|
|||
/// 新增重工標準工時
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPost("api/StandardWorkTimeReworks")] |
|||
ITask<ResultModel<StandardWorkTimeRework>> PostStandardWorkTimeRework([FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 更新重工標準工時
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpPut("api/StandardWorkTimeReworks/{id}")] |
|||
ITask<ResultModel<StandardWorkTimeRework>> PutStandardWorkTimeRework(int id, [FromBody, RawJsonContent] string model); |
|||
|
|||
/// <summary>
|
|||
/// 刪除重工標準工時
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpDelete("api/StandardWorkTimeReworks/{id}")] |
|||
ITask<ResultModel<StandardWorkTimeRework>> DeleteStandardWorkTimeRework(int id); |
|||
|
|||
/// <summary>
|
|||
/// 根據ID獲取指定重工標準工時
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/StandardWorkTimeReworks/{id}")] |
|||
ITask<List<StandardWorkTimeRework>> GetStandardWorkTimeRework(int id); |
|||
|
|||
/// <summary>
|
|||
/// 獲取重工標準工時資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/StandardWorkTimeReworks")] |
|||
ITask<List<StandardWorkTimeRework>> GetStandardWorkTimeReworks(); |
|||
|
|||
/// <summary>
|
|||
/// 根据類別代碼獲取不良現象原因資料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[WebApiClient.Attributes.HttpGet("api/StandardWorkTimeReworks/Query/{wipno}/{sid}")] |
|||
ITask<List<StandardWorkTimeRework>> GetStandardWorkTimeReworkByQuery(string wipno, int sid); |
|||
|
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,221 @@ |
|||
@{ |
|||
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:0px;"> |
|||
<label class=" layui-inline layui-form-label" style="width:120px;">请選擇單位名稱</label> |
|||
<div class="layui-input-inline" width:400px;"> |
|||
<select id="unit" lay-event="unit" lay-filter="unit" lay-submit asp-items="@ViewBag.FactoryUnit"> |
|||
</select> |
|||
</div> |
|||
<input id="unitId" type="hidden" name="unitId" /> |
|||
</div> |
|||
<div class="layui-inline" style="margin-right:5px;"> |
|||
<input type="text" class="layui-input" id="edtSearch" value="" placeholder="請輸入內部條碼" style="display: inline-block;width: 140px;height: 30px;line-height: 30px;margin-left:20px;" /> |
|||
</div> |
|||
<div class="layui-inline" style="margin-left:0px;"> |
|||
<div class="layui-btn-group"> |
|||
<button id="btnSearch" class="layui-btn layui-btn-sm"> |
|||
<i class="layui-icon"></i>搜索 |
|||
</button> |
|||
<button id="btnClearSearch" class="layui-btn layui-btn-sm layui-btn-primary"> |
|||
<i class="layui-icon">ဆ</i>清除 |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<button type="button" id="btnAdd" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i>新增</button> |
|||
</div> |
|||
<table class="layui-hide" id="test" lay-filter="test"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@section Scripts{ |
|||
<script type="text/javascript"> |
|||
var treeTable; |
|||
layui.config({ |
|||
base: '../lib/layui_ext/' |
|||
}).extend({ |
|||
treeTable: 'treetable/treeTable' |
|||
}).use(['treeTable'], function () { |
|||
treeTable = layui.treeTable; |
|||
//treeTable.on('tool(test)', function (obj) { |
|||
// if (obj.event == 'edit') { |
|||
// if (obj.data.lineID) { |
|||
// hg.open('修改線別', '/BAS/BAS003U/' + obj.data.lineID, 480, 480); |
|||
// } |
|||
// } |
|||
// if (obj.event == 'del') { |
|||
// var str; |
|||
// if (obj.data.statusNo == 'A') |
|||
// str = '停用'; |
|||
// else |
|||
// str = '啟用'; |
|||
// hg.confirm("系統:" + obj.data.lineDesc + ",确定要"+str+"吗?", function () { |
|||
// $.ajax({ |
|||
// url: '/BAS/BAS003U2', //抓取停用 |
|||
// data: { model: obj.data }, |
|||
// type: 'POST', |
|||
// success: function (data) { |
|||
// if (data.success) { |
|||
// //obj.del(); //只删本地数据 |
|||
// hg.msghide("成功!"); |
|||
// var aa = $("#unitId").val(); |
|||
// request(aa); |
|||
// } |
|||
// else { |
|||
// hg.msg(data.msg); |
|||
// } |
|||
// }, |
|||
// error: function () { |
|||
// hg.msg("网络请求失败!"); |
|||
// } |
|||
// }); |
|||
// }); |
|||
// } |
|||
//}); |
|||
form.on('select(unit)', function (data) { |
|||
$("#unitId").val(data.value); |
|||
}); |
|||
}); |
|||
var data = []; |
|||
$(document).ready(function () { |
|||
request(); |
|||
}); |
|||
//通过table定义reload刷新列表,update本地填充一条数据 |
|||
var TABLE = function () { |
|||
return { |
|||
reload: function () { |
|||
request(); |
|||
}, |
|||
update: function (d) { |
|||
var model = $.parseJSON(d); |
|||
var up = false; |
|||
layui.each(data, function (i, d) { |
|||
if (d.id == model.id) { |
|||
data[i] = model; |
|||
up = true; |
|||
return false; |
|||
} |
|||
}); |
|||
up || data.push(model); |
|||
init(data); |
|||
} |
|||
} |
|||
} |
|||
var insTb; |
|||
function init(data) { |
|||
insTb = treeTable.render({ |
|||
elem: '#test', |
|||
height: 'full-180', |
|||
text: { |
|||
none: '<div style="padding: 18px 0;">無資料</div>' |
|||
}, |
|||
data: data, |
|||
tree: { |
|||
iconIndex: -1, |
|||
isPidData: false, |
|||
idName: 'barcodeID', |
|||
}, |
|||
cols: [ |
|||
{ |
|||
field: 'b', |
|||
minWidth: 100, |
|||
title: '內部條碼' |
|||
, templet: function (d) { |
|||
console.log(d.b); |
|||
var iN; |
|||
if (d.i) |
|||
iN = d.b["barcodeNo"]; |
|||
else |
|||
iN = "N/A"; |
|||
return iN; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'partNo', |
|||
minWidth: 100, |
|||
title: '組件條碼' |
|||
}, |
|||
{ |
|||
field: 'kpItemNo', |
|||
minWidth: 100, |
|||
title: '組件料號' |
|||
}, |
|||
{ |
|||
field: 'i', |
|||
title: '組件名稱' |
|||
, templet: function (d) { |
|||
var iN; |
|||
if (d.i) |
|||
iN = d.i["itemName"]; |
|||
else |
|||
iN = "N/A"; |
|||
return iN; |
|||
} |
|||
} |
|||
], |
|||
style: 'margin-top:0;', |
|||
done: function () { |
|||
} |
|||
}); |
|||
insTb.expandAll(); |
|||
} |
|||
var table = new TABLE() |
|||
//更新資料 |
|||
function request() { |
|||
var aa = $("#unit").val(); |
|||
var keywords = $('#edtSearch').val(); |
|||
if (keywords && aa) |
|||
//hg.request('/PCS/GetBItem/' + aa + '/' + keywords , function (result) { |
|||
hg.request('/PCS/GetBarcodeItemByUnit/' + aa + '=' + keywords, function (result) { |
|||
data = result.data; |
|||
init(data); |
|||
}); |
|||
} |
|||
//搜索 |
|||
$('#btnSearch').click(function () { |
|||
var aa = $("#unit").val(); |
|||
var keywords = $('#edtSearch').val(); |
|||
if (aa) { |
|||
if (keywords) { |
|||
hg.msghide("刷新数据!"); |
|||
request(); |
|||
} else { |
|||
alert("請輸入條碼!!"); |
|||
} |
|||
} |
|||
else { |
|||
alert("請選擇生產單位!!"); |
|||
} |
|||
}); |
|||
//清除 |
|||
$('#btnClearSearch').click(function () { |
|||
$('#edtSearch').val(""); |
|||
insTb.clearFilter(); |
|||
}); |
|||
//新增 |
|||
$('#btnAdd').click(function () { |
|||
var keywords = $('#edtSearch').val(); |
|||
if (keywords) |
|||
hg.open('新增組件資料', '/PCS/PCS024C/' + keywords, 480, 480); |
|||
else |
|||
alert("請先輸入內部條碼!!"); |
|||
}); |
|||
|
|||
</script> |
|||
|
|||
} |
@ -0,0 +1,147 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.BarcodeItem |
|||
|
|||
@{ ViewData["Title"] = "PCS024C"; |
|||
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="PCS024CSave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="BarcodeItemID" value="0" /> |
|||
<input type="hidden" asp-for="BarcodeID" value="@ViewBag.BarcodeID" /> |
|||
<input type="hidden" asp-for="WipID" value="@ViewBag.WipID" /> |
|||
<input type="hidden" asp-for="CreateUserID" value="0" /> |
|||
<input type="hidden" asp-for="CreateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" asp-for="SysType" value="I" /> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label class="control-label col-sm-3">製成單位</label> |
|||
<select name="aa" id="aa" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"></select> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label class="control-label col-sm-3">站別</label> |
|||
<select name="Role" id="Role" lay-filter="RoleInfo" asp-items="@ViewBag.GetStationsList" class="custom-select col-sm-9"> |
|||
<option value="">——請選擇站別——</option> |
|||
</select> |
|||
<input name="RuleStationID" id="RuleStationID" asp-for="RuleStationID" /> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="ItemNo" class="control-label col-sm-3"></label> |
|||
<select asp-for="ItemNo" asp-items="@ViewBag.ItemsList" class="custom-select col-sm-9"></select> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label class="control-label col-sm-3">內部條碼</label> |
|||
<input class="form-control col-sm-9" value="@ViewBag.BarcodeNo" readonly /> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="KpItemNo" class="control-label col-sm-3"></label> |
|||
<input asp-for="KpItemNo" class="form-control col-sm-9" placeholder="請輸入组件名稱" /> |
|||
<span asp-validation-for="KpItemNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="PartNo" class="control-label col-sm-3"></label> |
|||
<input asp-for="PartNo" class="form-control col-sm-9" placeholder="請輸入组件條碼" /> |
|||
<span asp-validation-for="PartNo" 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); |
|||
} |
|||
}); |
|||
|
|||
$("#aa").change(function () { |
|||
var data = $("#aa").val(); |
|||
console.info(data); |
|||
getRoles(data); |
|||
}) |
|||
|
|||
$("#Role").change(function () { |
|||
var data = $("#Role").val(); |
|||
console.info(data); |
|||
$("#RuleStationID").val(data); |
|||
}) |
|||
function getRoles(data) { |
|||
|
|||
//再利用ajax將資料傳到後端,來獲取到對應下拉框選項而出現的值 |
|||
//檢查專案新增到下拉框中 |
|||
$.ajax({ |
|||
url: "/BAS/GetRuleStationByUnit", |
|||
//url: "/BAS/GetStationsByUnit", |
|||
dataType: 'json', |
|||
data: { id: data }, |
|||
contentType: "application/json", |
|||
type: 'get', |
|||
success: function (result) { |
|||
console.info("info:" ); |
|||
console.info(result.data); |
|||
if (result.data) { |
|||
$("#Role").empty();//清空下拉框的值 |
|||
$.each(result.data, function (index, item) { |
|||
$('#Role').append(new Option(item.station.stationName, item.ruleStationID));// 下拉選單裡新增元素 |
|||
//$('#Role').append(new Option(item.stationName, item.stationID));// 下拉選單裡新增元素 |
|||
}); |
|||
} |
|||
else { |
|||
$("#Role").empty();//清空下拉框的值 |
|||
$('#Role').append(new Option("無選項","NA"));// 下拉選單裡新增元素 |
|||
} |
|||
layui.form.render("select");//重新渲染 固定寫法 |
|||
} |
|||
}); |
|||
}; |
|||
//LayUI渲染以及啟動模組 |
|||
@*layui.use(['form', 'layedit', 'laydate'], function () { |
|||
var form = layui.form,//獲取form模組 |
|||
layer = layui.layer,//獲取layer模組 |
|||
layedit = layui.layedit,//獲取layedit模組 |
|||
laydate = layui.laydate,//獲取laydate模組 |
|||
$ = layui.$; |
|||
// 得到部門 |
|||
$.ajax({ |
|||
url: "@Url.Action("GetFactoryUnits","BAS")", |
|||
dataType: 'json', |
|||
type: 'post', |
|||
success: function (result) { |
|||
console.log("success"); |
|||
$.each(result.data, function (index, item) { |
|||
$('#unitNo').append(new Option(item.unitName, item.unitNo));// 下拉選單裡新增元素 |
|||
}); |
|||
layui.form.render("select");//重新渲染 固定寫法 |
|||
} |
|||
}); |
|||
// 聯動 |
|||
form.on('select(unitNo)', function (data) { |
|||
//監聽到了下拉框選擇的選項,傳遞過來 |
|||
console.info("unitNo:" +data); |
|||
getRoles(data); |
|||
}); |
|||
});*@ |
|||
</script> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,335 @@ |
|||
@{ |
|||
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"> |
|||
<button type="button" id="btnAdd" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i>新增</button> |
|||
</div> |
|||
<div class="layui-inline" style="margin-right:0px;"> |
|||
<label class=" layui-inline layui-form-label" style="width:120px;">请選擇單位名稱</label> |
|||
<div class="layui-input-inline" width:400px;"> |
|||
<select id="unit" lay-event="unit" lay-filter="unit" lay-submit asp-items="@ViewBag.FactoryUnit"> |
|||
</select> |
|||
</div> |
|||
<input id="unitId" type="hidden" name="unitId" /> |
|||
</div> |
|||
<div class="layui-inline" style="margin-left:0px;"> |
|||
<div class="layui-btn-group"> |
|||
<button id="btnSearch" class="layui-btn layui-btn-sm layui-btn-normal"> |
|||
<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"> |
|||
var treeTable; |
|||
layui.config({ |
|||
base: '../lib/layui_ext/' |
|||
}).extend({ |
|||
treeTable: 'treetable/treeTable' |
|||
}).use(['treeTable'], function () { |
|||
treeTable = layui.treeTable; |
|||
treeTable.on('tool(test)', function (obj) { |
|||
if (obj.event == 'edit') { |
|||
if (obj.data.lineID) { |
|||
hg.open('修改線別', '/BAS/BAS003U/' + obj.data.lineID, 480, 480); |
|||
} |
|||
} |
|||
if (obj.event == 'del') { |
|||
var str; |
|||
if (obj.data.statusNo == 'A') |
|||
str = '停用'; |
|||
else |
|||
str = '啟用'; |
|||
hg.confirm("系統:" + obj.data.lineDesc + ",确定要"+str+"吗?", function () { |
|||
$.ajax({ |
|||
url: '/BAS/BAS003U2', //抓取停用 |
|||
data: { model: obj.data }, |
|||
type: 'POST', |
|||
success: function (data) { |
|||
if (data.success) { |
|||
//obj.del(); //只删本地数据 |
|||
hg.msghide("成功!"); |
|||
var aa = $("#unitId").val(); |
|||
request(aa); |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
}); |
|||
form.on('select(unit)', function (data) { |
|||
//alert("select yessss!!"); |
|||
$("#unitId").val(data.value); |
|||
$('#btnSearch').click(); |
|||
}); |
|||
}); |
|||
var data = []; |
|||
$(document).ready(function () { |
|||
var aa = $("#unitId").val(); |
|||
request(aa); |
|||
}); |
|||
//通过table定义reload刷新列表,update本地填充一条数据 |
|||
var TABLE = function () { |
|||
return { |
|||
reload: function () { |
|||
var aa = $("#unitId").val(); |
|||
request(aa); |
|||
}, |
|||
update: function (d) { |
|||
var model = $.parseJSON(d); |
|||
var up = false; |
|||
layui.each(data, function (i, d) { |
|||
if (d.id == model.id) { |
|||
data[i] = model; |
|||
up = true; |
|||
return false; |
|||
} |
|||
}); |
|||
up || data.push(model); |
|||
init(data); |
|||
} |
|||
} |
|||
} |
|||
function request(Unitstr) { |
|||
hg.request('/BAS/GetLineInfoByUnit/' + Unitstr, function (result) { |
|||
data = result.data; |
|||
init(data); |
|||
}); |
|||
} |
|||
var insTb; |
|||
function init(data) { |
|||
insTb = treeTable.render({ |
|||
elem: '#test', |
|||
height: 'full-180', |
|||
text: { |
|||
none: '<div style="padding: 18px 0;">暂无数据</div>' |
|||
}, |
|||
data: data, |
|||
tree: { |
|||
iconIndex: -1, |
|||
isPidData: false, |
|||
idName: 'lineID', |
|||
}, |
|||
cols: [ |
|||
{ |
|||
field: 'lineID', |
|||
width: 120, |
|||
title: '#', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'deptID', |
|||
width: 100, |
|||
title: '部門代碼', |
|||
templet: function (d) { |
|||
return d.dept["deptNo"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'dept', |
|||
title: '部門名稱', |
|||
templet: function (d) { |
|||
return d.dept["deptName"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unit', |
|||
title: '製程單位', |
|||
templet: function (d) { |
|||
return d.unit["unitName"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'lineDesc', |
|||
minWidth: 100, |
|||
title: '線別說明' |
|||
}, |
|||
{ |
|||
field: 'story', |
|||
title: '樓層', |
|||
width: 80 |
|||
}, |
|||
{ |
|||
align: 'center' |
|||
, title: '操作' |
|||
, width: 200 |
|||
,templet: function (item) { |
|||
var btns = ''; |
|||
btns = btns + '<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>'; |
|||
if (item.statusNo == "A") |
|||
btns = btns + '<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">停用</a>'; |
|||
else if (item.statusNo == "S") |
|||
btns = btns + '<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="del">啟用</a>'; |
|||
|
|||
return btns; |
|||
} |
|||
} |
|||
], |
|||
style: 'margin-top:0;', |
|||
done: function () { |
|||
} |
|||
}); |
|||
insTb.expandAll(); |
|||
} |
|||
var table = new TABLE(); |
|||
//搜索 |
|||
$('#btnSearch').click(function () { |
|||
|
|||
hg.msghide("刷新数据!"); |
|||
var aa = $("#unit").val(); |
|||
//alert(aa); |
|||
|
|||
request(aa); |
|||
}) |
|||
|
|||
$('#btnAdd').click(function () { |
|||
hg.open('新增線別', '/BAS/BAS003C', 480, 480); |
|||
}); |
|||
</script> |
|||
@*<script type="text/javascript"> |
|||
//监听表单提交事件 |
|||
hg.form.onsubmit('querysubmit', function (data) { |
|||
table && table.reload(data); |
|||
}); |
|||
var tableCols = [[ |
|||
{ |
|||
field: 'lineID', |
|||
width: 50, |
|||
title: '#', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'deptID', |
|||
width: 100, |
|||
title: '部門代碼', |
|||
templet: function (d) { |
|||
return d.dept["deptNo"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'dept', |
|||
width: 100, |
|||
title: '部門名稱', |
|||
templet: function (d) { |
|||
return d.dept["deptName"]; |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
field: 'lineDesc', |
|||
minWidth: 100, |
|||
title: '線別說明' |
|||
}, |
|||
{ |
|||
field: 'story', |
|||
title: '樓層', |
|||
width: 80 |
|||
}, |
|||
{ |
|||
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="edit2">停用</a> <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) { |
|||
alert(obj); |
|||
if (obj.data.lineID) { |
|||
hg.open('修改線別', '/BAS/BAS003U/' + obj.data.lineID, 480,480); |
|||
} |
|||
} |
|||
|
|||
//通过行tool删除,lay-event="del" |
|||
function del(obj) { |
|||
if (obj.data.lineID) { |
|||
hg.confirm("系統:" + obj.data.lineDesc + ",确定要删除吗?", function () { |
|||
$.ajax({ |
|||
url: '/BAS/BAS003D', |
|||
data: { id: obj.data.lineID }, |
|||
type: 'POST', |
|||
success: function (data) { |
|||
if (data.success) { |
|||
obj.del(); //只删本地数据 |
|||
hg.msghide("删除成功!"); |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
//通过行tool停用,lay-event="edit2" |
|||
function edit2(obj) { |
|||
if (obj.data.lineID) { |
|||
hg.confirm("系統:" + obj.data.lineDesc + ",确定要停用吗?", function () { |
|||
$.ajax({ |
|||
url: '/BAS/BAS003U2', |
|||
data: { model: obj.data}, |
|||
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('新增線別資料', '/BAS/BAS003C', 480, 480); |
|||
|
|||
} |
|||
} |
|||
]; |
|||
//基本数据表格 |
|||
var table = hg.table.datatable('test', '線別資料維護', '/BAS/GetLineInfoes', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
|||
</script>*@ |
|||
} |
@ -0,0 +1,73 @@ |
|||
@model AMESCoreStudio.WebApi.Models.BAS.LineInfo |
|||
|
|||
|
|||
@{ ViewData["Title"] = "BAS003C"; |
|||
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="BAS003Save"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="LineID" value="0" /> |
|||
<input type="hidden" asp-for="WipNo" value="-1" /> |
|||
<input type="hidden" asp-for="CreateUserId" value="0" /> |
|||
<input type="hidden" asp-for="CreateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" asp-for="StatusNo" value="A" /> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UnitNo" class="control-label col-sm-3"></label> |
|||
<select asp-for="UnitNo" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="UnitNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="DeptID" class="control-label col-sm-3"></label> |
|||
<select asp-for="DeptID" asp-items="@ViewBag.DeptList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="DeptID" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
|
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="LineDesc" class="control-label col-sm-3"></label> |
|||
<input asp-for="LineDesc" class="form-control col-sm-9" placeholder="請輸入線別說明" /> |
|||
<span asp-validation-for="LineDesc" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Story" class="control-label col-sm-3"></label> |
|||
<input asp-for="Story" class="form-control col-sm-9" placeholder="請輸入樓層" /> |
|||
<span asp-validation-for="Story" 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> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,335 @@ |
|||
@{ |
|||
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"> |
|||
<button type="button" id="btnAdd" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i>新增</button> |
|||
</div> |
|||
<div class="layui-inline" style="margin-right:0px;"> |
|||
<label class=" layui-inline layui-form-label" style="width:120px;">请選擇單位名稱</label> |
|||
<div class="layui-input-inline" width:400px;"> |
|||
<select id="unit" lay-event="unit" lay-filter="unit" lay-submit asp-items="@ViewBag.FactoryUnit"> |
|||
</select> |
|||
</div> |
|||
<input id="unitId" type="hidden" name="unitId" /> |
|||
</div> |
|||
<div class="layui-inline" style="margin-left:0px;"> |
|||
<div class="layui-btn-group"> |
|||
<button id="btnSearch" class="layui-btn layui-btn-sm layui-btn-normal"> |
|||
<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"> |
|||
var treeTable; |
|||
layui.config({ |
|||
base: '../lib/layui_ext/' |
|||
}).extend({ |
|||
treeTable: 'treetable/treeTable' |
|||
}).use(['treeTable'], function () { |
|||
treeTable = layui.treeTable; |
|||
treeTable.on('tool(test)', function (obj) { |
|||
if (obj.event == 'edit') { |
|||
if (obj.data.lineID) { |
|||
hg.open('修改線別', '/BAS/BAS003U/' + obj.data.lineID, 480, 480); |
|||
} |
|||
} |
|||
if (obj.event == 'del') { |
|||
var str; |
|||
if (obj.data.statusNo == 'A') |
|||
str = '停用'; |
|||
else |
|||
str = '啟用'; |
|||
hg.confirm("系統:" + obj.data.lineDesc + ",确定要"+str+"吗?", function () { |
|||
$.ajax({ |
|||
url: '/BAS/BAS003U2', //抓取停用 |
|||
data: { model: obj.data }, |
|||
type: 'POST', |
|||
success: function (data) { |
|||
if (data.success) { |
|||
//obj.del(); //只删本地数据 |
|||
hg.msghide("成功!"); |
|||
var aa = $("#unitId").val(); |
|||
request(aa); |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
}); |
|||
form.on('select(unit)', function (data) { |
|||
//alert("select yessss!!"); |
|||
$("#unitId").val(data.value); |
|||
$('#btnSearch').click(); |
|||
}); |
|||
}); |
|||
var data = []; |
|||
$(document).ready(function () { |
|||
var aa = $("#unitId").val(); |
|||
request(aa); |
|||
}); |
|||
//通过table定义reload刷新列表,update本地填充一条数据 |
|||
var TABLE = function () { |
|||
return { |
|||
reload: function () { |
|||
var aa = $("#unitId").val(); |
|||
request(aa); |
|||
}, |
|||
update: function (d) { |
|||
var model = $.parseJSON(d); |
|||
var up = false; |
|||
layui.each(data, function (i, d) { |
|||
if (d.id == model.id) { |
|||
data[i] = model; |
|||
up = true; |
|||
return false; |
|||
} |
|||
}); |
|||
up || data.push(model); |
|||
init(data); |
|||
} |
|||
} |
|||
} |
|||
function request(Unitstr) { |
|||
hg.request('/BAS/GetLineInfoByUnit/' + Unitstr, function (result) { |
|||
data = result.data; |
|||
init(data); |
|||
}); |
|||
} |
|||
var insTb; |
|||
function init(data) { |
|||
insTb = treeTable.render({ |
|||
elem: '#test', |
|||
height: 'full-180', |
|||
text: { |
|||
none: '<div style="padding: 18px 0;">暂无数据</div>' |
|||
}, |
|||
data: data, |
|||
tree: { |
|||
iconIndex: -1, |
|||
isPidData: false, |
|||
idName: 'lineID', |
|||
}, |
|||
cols: [ |
|||
{ |
|||
field: 'lineID', |
|||
width: 120, |
|||
title: '#', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'deptID', |
|||
width: 100, |
|||
title: '部門代碼', |
|||
templet: function (d) { |
|||
return d.dept["deptNo"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'dept', |
|||
title: '部門名稱', |
|||
templet: function (d) { |
|||
return d.dept["deptName"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unit', |
|||
title: '製程單位', |
|||
templet: function (d) { |
|||
return d.unit["unitName"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'lineDesc', |
|||
minWidth: 100, |
|||
title: '線別說明' |
|||
}, |
|||
{ |
|||
field: 'story', |
|||
title: '樓層', |
|||
width: 80 |
|||
}, |
|||
{ |
|||
align: 'center' |
|||
, title: '操作' |
|||
, width: 200 |
|||
,templet: function (item) { |
|||
var btns = ''; |
|||
btns = btns + '<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>'; |
|||
if (item.statusNo == "A") |
|||
btns = btns + '<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">停用</a>'; |
|||
else if (item.statusNo == "S") |
|||
btns = btns + '<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="del">啟用</a>'; |
|||
|
|||
return btns; |
|||
} |
|||
} |
|||
], |
|||
style: 'margin-top:0;', |
|||
done: function () { |
|||
} |
|||
}); |
|||
insTb.expandAll(); |
|||
} |
|||
var table = new TABLE(); |
|||
//搜索 |
|||
$('#btnSearch').click(function () { |
|||
|
|||
hg.msghide("刷新数据!"); |
|||
var aa = $("#unit").val(); |
|||
//alert(aa); |
|||
|
|||
request(aa); |
|||
}) |
|||
|
|||
$('#btnAdd').click(function () { |
|||
hg.open('新增線別', '/BAS/BAS003C', 480, 480); |
|||
}); |
|||
</script> |
|||
@*<script type="text/javascript"> |
|||
//监听表单提交事件 |
|||
hg.form.onsubmit('querysubmit', function (data) { |
|||
table && table.reload(data); |
|||
}); |
|||
var tableCols = [[ |
|||
{ |
|||
field: 'lineID', |
|||
width: 50, |
|||
title: '#', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'deptID', |
|||
width: 100, |
|||
title: '部門代碼', |
|||
templet: function (d) { |
|||
return d.dept["deptNo"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'dept', |
|||
width: 100, |
|||
title: '部門名稱', |
|||
templet: function (d) { |
|||
return d.dept["deptName"]; |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
field: 'lineDesc', |
|||
minWidth: 100, |
|||
title: '線別說明' |
|||
}, |
|||
{ |
|||
field: 'story', |
|||
title: '樓層', |
|||
width: 80 |
|||
}, |
|||
{ |
|||
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="edit2">停用</a> <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) { |
|||
alert(obj); |
|||
if (obj.data.lineID) { |
|||
hg.open('修改線別', '/BAS/BAS003U/' + obj.data.lineID, 480,480); |
|||
} |
|||
} |
|||
|
|||
//通过行tool删除,lay-event="del" |
|||
function del(obj) { |
|||
if (obj.data.lineID) { |
|||
hg.confirm("系統:" + obj.data.lineDesc + ",确定要删除吗?", function () { |
|||
$.ajax({ |
|||
url: '/BAS/BAS003D', |
|||
data: { id: obj.data.lineID }, |
|||
type: 'POST', |
|||
success: function (data) { |
|||
if (data.success) { |
|||
obj.del(); //只删本地数据 |
|||
hg.msghide("删除成功!"); |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
//通过行tool停用,lay-event="edit2" |
|||
function edit2(obj) { |
|||
if (obj.data.lineID) { |
|||
hg.confirm("系統:" + obj.data.lineDesc + ",确定要停用吗?", function () { |
|||
$.ajax({ |
|||
url: '/BAS/BAS003U2', |
|||
data: { model: obj.data}, |
|||
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('新增線別資料', '/BAS/BAS003C', 480, 480); |
|||
|
|||
} |
|||
} |
|||
]; |
|||
//基本数据表格 |
|||
var table = hg.table.datatable('test', '線別資料維護', '/BAS/GetLineInfoes', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
|||
</script>*@ |
|||
} |
@ -0,0 +1,73 @@ |
|||
@model AMESCoreStudio.WebApi.Models.BAS.LineInfo |
|||
|
|||
|
|||
@{ ViewData["Title"] = "BAS003C"; |
|||
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="BAS003Save"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="LineID" value="0" /> |
|||
<input type="hidden" asp-for="WipNo" value="-1" /> |
|||
<input type="hidden" asp-for="CreateUserId" value="0" /> |
|||
<input type="hidden" asp-for="CreateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" asp-for="StatusNo" value="A" /> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UnitNo" class="control-label col-sm-3"></label> |
|||
<select asp-for="UnitNo" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="UnitNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="DeptID" class="control-label col-sm-3"></label> |
|||
<select asp-for="DeptID" asp-items="@ViewBag.DeptList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="DeptID" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
|
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="LineDesc" class="control-label col-sm-3"></label> |
|||
<input asp-for="LineDesc" class="form-control col-sm-9" placeholder="請輸入線別說明" /> |
|||
<span asp-validation-for="LineDesc" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Story" class="control-label col-sm-3"></label> |
|||
<input asp-for="Story" class="form-control col-sm-9" placeholder="請輸入樓層" /> |
|||
<span asp-validation-for="Story" 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> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,94 @@ |
|||
@{ |
|||
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"> |
|||
<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: 'groupID', |
|||
width: 200, |
|||
title: '#' |
|||
}, |
|||
{ |
|||
field: 'groupName', |
|||
title: '群組名稱' |
|||
}, |
|||
{ |
|||
field: 'groupFlag', |
|||
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) { |
|||
if (obj.data.groupID) { |
|||
hg.open('修改工作群組', '/WHS/WHS001U/' + obj.data.groupID, 640,320); |
|||
} |
|||
} |
|||
|
|||
//通过行tool删除,lay-event="del" |
|||
function del(obj) { |
|||
if (obj.data.groupID) { |
|||
hg.confirm("工作群組:" + obj.data.groupName + ",确定要删除吗?", function () { |
|||
$.ajax({ |
|||
url: '/WHS/WHS001D', |
|||
data: { id: obj.data.groupID }, |
|||
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('新增工作群組', '/WHS/WHS001C', 640, 320); |
|||
|
|||
} |
|||
} |
|||
]; |
|||
//基本数据表格 |
|||
var table = hg.table.datatable('test', '工作群組維護', '/WHS/GetWorkGroups', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
|||
</script> |
|||
} |
@ -0,0 +1,53 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.WorkGroup |
|||
|
|||
|
|||
@{ ViewData["Title"] = "WHS001C"; |
|||
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="WHS001CSave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="GroupName" class="control-label col-sm-3"></label> |
|||
<input asp-for="GroupName" class="form-control col-sm-9" placeholder="請輸入群組名稱" /> |
|||
<span asp-validation-for="GroupName" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="GroupFlag" class="control-label col-sm-3"></label> |
|||
<select asp-for="GroupFlag" asp-items="@ViewBag.FlagList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="GroupFlag" 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> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,54 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.WorkGroup |
|||
|
|||
|
|||
@{ ViewData["Title"] = "WHS001U"; |
|||
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="WHS001USave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="GroupID" /> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="GroupName" class="control-label col-sm-3"></label> |
|||
<input asp-for="GroupName" class="form-control col-sm-9" readonly="readonly" /> |
|||
<span asp-validation-for="GroupName" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="GroupFlag" class="control-label col-sm-3"></label> |
|||
<select asp-for="GroupFlag" asp-items="@ViewBag.FlagList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="GroupFlag" 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> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,101 @@ |
|||
@{ |
|||
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"> |
|||
<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: 'classID', |
|||
width: 200, |
|||
title: '#' |
|||
}, |
|||
{ |
|||
field: 'groupID', |
|||
title: '群組ID' |
|||
}, |
|||
{ |
|||
field: 'group', |
|||
title: '群組名稱', |
|||
templet: function (d) { |
|||
return d.group["groupName"]; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'className', |
|||
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) { |
|||
if (obj.data.classID) { |
|||
hg.open('修改工作群組', '/WHS/WHS002U/' + obj.data.classID, 640,320); |
|||
} |
|||
} |
|||
|
|||
//通过行tool删除,lay-event="del" |
|||
function del(obj) { |
|||
if (obj.data.classID) { |
|||
hg.confirm("工作群組:" + obj.data.className + ",确定要删除吗?", function () { |
|||
$.ajax({ |
|||
url: '/WHS/WHS002D', |
|||
data: { id: obj.data.classID }, |
|||
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('新增工作群組', '/WHS/WHS002C', 640, 320); |
|||
|
|||
} |
|||
} |
|||
]; |
|||
//基本数据表格 |
|||
var table = hg.table.datatable('test', '工作群組維護', '/WHS/GetWorkClasses', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
|||
</script> |
|||
} |
@ -0,0 +1,53 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.WorkClass |
|||
|
|||
|
|||
@{ ViewData["Title"] = "WHS002C"; |
|||
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="WHS002CSave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="ClassName" class="control-label col-sm-3"></label> |
|||
<input asp-for="ClassName" class="form-control col-sm-9" placeholder="請輸入群組名稱" /> |
|||
<span asp-validation-for="ClassName" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="GroupID" class="control-label col-sm-3"></label> |
|||
<select asp-for="GroupID" asp-items="@ViewBag.GroupList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="GroupID" 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> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,54 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.WorkClass |
|||
|
|||
|
|||
@{ ViewData["Title"] = "WHS002U"; |
|||
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="WHS002USave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="ClassID" /> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="ClassName" class="control-label col-sm-3"></label> |
|||
<input asp-for="ClassName" class="form-control col-sm-9" readonly="readonly"/> |
|||
<span asp-validation-for="ClassName" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="GroupID" class="control-label col-sm-3"></label> |
|||
<select asp-for="GroupID" asp-items="@ViewBag.GroupList" class="custom-select col-sm-9" ></select> |
|||
<span asp-validation-for="GroupID" 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> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,291 @@ |
|||
@{ |
|||
ViewData["Title"] = "標準工時資料查詢"; |
|||
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
|||
} |
|||
|
|||
<div class="layui-card"> |
|||
<div class="layui-card-header"> |
|||
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
|||
</div> |
|||
<div class="layui-card-body"> |
|||
<div class="layui-form"> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-inline" style="margin-right:0px;"> |
|||
<label class="layui-inline layui-form-label" style="width:80px;">製程單位</label> |
|||
<div class="layui-input-inline" style="width: 90px; margin-right: 5px;"> |
|||
<select style="width:90px;" lay-filter="unitNo" lay-submit id="unitNo" name="unitNo" asp-items="@ViewBag.FactoryUnit" > |
|||
</select> |
|||
</div> |
|||
<input id="unitId" type="hidden" name="unitId" /> |
|||
<label class="layui-inline layui-form-label" style="width:80px;">線別</label> |
|||
<div class="layui-input-inline" style="width:120px;"> |
|||
<select name="lineID" id="lineID" lay-filter="lineID" lay-search> |
|||
<option value=""> —請選擇線別— </option> |
|||
</select> |
|||
<input type="hidden" id="line" name="line" /> |
|||
</div> |
|||
</div> |
|||
<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="modelname" id="modelname" placeholder="请输入料號" autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline" style="margin-left:0px;"> |
|||
<button id="btnSearch" class="layui-btn tt"> |
|||
<i class="layui-icon"></i>搜索 |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<button type="button" id="btnAdd" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i>新增</button> |
|||
</div> |
|||
<table class="layui-hide" id="test" lay-filter="test"></table> |
|||
</div> |
|||
</div> |
|||
@section Scripts{ |
|||
<script> |
|||
var treeTable; |
|||
layui.config({ |
|||
base: '../lib/layui_ext/' |
|||
}).extend({ |
|||
treeTable: 'treetable/treeTable' |
|||
}).use(['treeTable', 'jquery', 'form', 'laydate'], function () { |
|||
treeTable = layui.treeTable; |
|||
var $ = layui.$; |
|||
var form = layui.form, |
|||
layer = layui.layer; |
|||
treeTable.on('tool(test)', function (obj) { |
|||
if (obj.event == 'edit') { |
|||
if (obj.data.standardID) { |
|||
hg.open('修改標準工時', '/WHS/WHS003U/' + obj.data.standardID, 480, 480); |
|||
} |
|||
} |
|||
if (obj.event == 'del') { |
|||
if (obj.data.standardID) { |
|||
var str; |
|||
str = "刪除"; |
|||
hg.confirm("系統:" + obj.data.standardID + ",確定要" + str + "嗎?", function () { |
|||
$.ajax({ |
|||
url: '/WHS/WHS003D', |
|||
data: { id: obj.data.standardID }, |
|||
type: 'POST', |
|||
success: function (res) { |
|||
if (res.success) { |
|||
obj.del(); //只删本地数据 |
|||
hg.msghide(str + "成功!", { |
|||
icon: 6 |
|||
}); |
|||
layui.table.reload('test', { page: { curr: $(".layui-laypage-em").next().html() } }) |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
form.on('select(unitNo)', function (data) { |
|||
var data = $("#unitNo").val(); |
|||
console.info(data); |
|||
getLineInfoes(data); |
|||
}); |
|||
|
|||
}); |
|||
var data = []; |
|||
$(document).ready(function () { |
|||
//console.log("ready"); |
|||
request(); |
|||
}); |
|||
//通过table定义reload刷新列表,update本地填充一条数据 |
|||
var TABLE = function () { |
|||
return { |
|||
reload: function () { |
|||
request(); |
|||
}, |
|||
update: function (d) { |
|||
var model = $.parseJSON(d); |
|||
var up = false; |
|||
layui.each(data, function (i, d) { |
|||
if (d.id == model.id) { |
|||
data[i] = model; |
|||
up = true; |
|||
return false; |
|||
} |
|||
}); |
|||
up || data.push(model); |
|||
init(data); |
|||
} |
|||
} |
|||
} |
|||
var insTb; |
|||
function init(data) { |
|||
insTb = treeTable.render({ |
|||
elem: '#test', |
|||
height: 'full-180', |
|||
text: { |
|||
none: '<div style="padding: 18px 0;">無資料</div>' |
|||
}, |
|||
data: data, |
|||
tree: { |
|||
iconIndex: -1, |
|||
isPidData: false, |
|||
idName: 'standardID', |
|||
}, |
|||
cols: [ |
|||
{ |
|||
field: 'standardID', |
|||
width: 60, |
|||
title: '#', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'unitNo', |
|||
width: 50, |
|||
title: '單位代號' |
|||
}, |
|||
{ |
|||
field: 'lineID', |
|||
Width: 50, |
|||
title: '線別' |
|||
}, |
|||
{ |
|||
field: 'stationID', |
|||
Width: 50, |
|||
title: '站別' |
|||
}, |
|||
{ |
|||
field: 'itemNo', |
|||
title: '料號', |
|||
|
|||
}, |
|||
{ |
|||
field: 'side', |
|||
title: '正背面', |
|||
width: 10 |
|||
}, |
|||
{ |
|||
field: 'opcnt', |
|||
title: '作業人數', |
|||
minwidth: 5 |
|||
}, |
|||
{ |
|||
field: 'firstTime', |
|||
title: '首件產出時間(分)', |
|||
width: 5 |
|||
}, |
|||
{ |
|||
field: 'totalCT', |
|||
title: 'C/T(分)', |
|||
width: 5 |
|||
}, |
|||
{ |
|||
field: 'ct', |
|||
title: '節拍時間', |
|||
|
|||
}, |
|||
{ |
|||
field: 'machineCT', |
|||
title: '操機數', |
|||
|
|||
}, |
|||
{ |
|||
field: 'center', |
|||
width: 200, |
|||
title: '操作', |
|||
templet: function (item) { |
|||
var btn = '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a>'; |
|||
btn += ' <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del">刪除</a>'; |
|||
return btn |
|||
} |
|||
} |
|||
], |
|||
style: 'margin-top:2;', |
|||
done: function () { |
|||
} |
|||
}); |
|||
insTb.expandAll(); |
|||
} |
|||
var table = new TABLE() |
|||
//更新TABLE資料 |
|||
function request() { |
|||
var unit = $("#unitNo").val(); |
|||
var lineID = $('#line').val(); |
|||
var keywords = $('#modelname').val(); |
|||
//if (unit || lineID) { |
|||
hg.request('/WHS/GetStandardWorkTimes2?u=' + unit + '&l=' + lineID + '&i=' + keywords, function (result) { |
|||
console.info(result.data); |
|||
data = result.data; |
|||
init(data); |
|||
}); |
|||
//} |
|||
} |
|||
//新增 |
|||
$('#btnAdd').click(function () { |
|||
var unit = $("#unitNo").val(); |
|||
var lineID = $('#lineID').val(); |
|||
if (lineID) { |
|||
hg.open('新增標準工時', '/WHS/WHS003C?unit=' + unit + "&lineID=" + lineID, 480, 480); |
|||
} |
|||
else { |
|||
alert("請選擇線別!!"); |
|||
} |
|||
|
|||
|
|||
}); |
|||
//搜索 |
|||
$('#btnSearch').click(function () { |
|||
var unit = $("#unitNo").val(); |
|||
|
|||
var lineID = $('#lineID').val(); |
|||
var line = $('#line').val(); |
|||
if (lineID) { |
|||
$('#line').val(lineID); |
|||
} |
|||
else { |
|||
$('#line').val(-99); |
|||
} |
|||
//if (unit) { |
|||
// if (lineID) { |
|||
hg.msghide("刷新数据!"); |
|||
request(); |
|||
// } else { |
|||
// alert("請選擇線別!!"); |
|||
// } |
|||
// } |
|||
//else { |
|||
// alert("請選擇生產單位!!"); |
|||
// } |
|||
}); |
|||
//利用ajax將資料傳到後端,來獲取到對應下拉框選項而出現的值 |
|||
function getLineInfoes(data) { |
|||
$.ajax({ |
|||
url: "/BAS/GetLineInfoByUnit", |
|||
dataType: 'json', |
|||
data: { id: data }, |
|||
contentType: "application/json", |
|||
type: 'get', |
|||
success: function (result) { |
|||
if (result.data) { |
|||
$("#lineID").empty();//清空下拉框的值 |
|||
$('#lineID').append(new Option("全部", "-99"));// 下拉選單裡新增元素 |
|||
$.each(result.data, function (index, item) { |
|||
$('#lineID').append(new Option(item.lineDesc, item.lineID));// 下拉選單裡新增元素 |
|||
}); |
|||
} |
|||
else { |
|||
$("#lineID").empty();//清空下拉框的值 |
|||
$('#lineID').append(new Option("無選項", "-99"));// 下拉選單裡新增元素 |
|||
} |
|||
layui.form.render("select");//重新渲染 固定寫法 |
|||
} |
|||
}); |
|||
}; |
|||
</script> |
|||
} |
@ -0,0 +1,90 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.StandardWorkTime |
|||
|
|||
|
|||
@{ ViewData["Title"] = "WHS003C"; |
|||
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="WHS003CSave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="StandardID" value="0" /> |
|||
<input type="hidden" asp-for="LineID" value="@ViewBag.LineID" /> |
|||
<input type="hidden" asp-for="UnitNo" value="@ViewBag.UnitNo" /> |
|||
<input type="hidden" asp-for="CreateUserID" value="0" /> |
|||
<input type="hidden" asp-for="UpdateUserID" value="0" /> |
|||
<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="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="StationID" class="control-label col-sm-3"></label> |
|||
<select asp-for="StationID" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="StationID" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Side" class="control-label col-sm-3"></label> |
|||
<select asp-for="Side" asp-items="@ViewBag.SideList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="Side" 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="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="TotalCT" class="control-label col-sm-3"></label> |
|||
<input asp-for="TotalCT" class="form-control col-sm-9" placeholder="請輸入CT" /> |
|||
<span asp-validation-for="TotalCT" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="CT" class="control-label col-sm-3"></label> |
|||
<input asp-for="CT" class="form-control col-sm-9" placeholder="請輸入節拍時間" /> |
|||
<span asp-validation-for="CT" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="MachineCT" class="control-label col-sm-3"></label> |
|||
<input asp-for="MachineCT" class="form-control col-sm-9" placeholder="請輸入操機數" /> |
|||
<span asp-validation-for="MachineCT" 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> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,88 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.StandardWorkTime |
|||
|
|||
@{ |
|||
ViewData["Title"] = "WHS003U"; |
|||
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="WHS003USave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="StandardID"/> |
|||
<input type="hidden" asp-for="LineID" /> |
|||
<input type="hidden" asp-for="UnitNo"/> |
|||
<input type="hidden" asp-for="CreateUserID" /> |
|||
<input type="hidden" asp-for="UpdateUserID" value="0"/> |
|||
<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="ItemNo" class="control-label col-sm-3"></label> |
|||
<input asp-for="ItemNo" class="form-control col-sm-9" /> |
|||
<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="StationID" class="control-label col-sm-3"></label> |
|||
<select asp-for="StationID" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="StationID" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Side" class="control-label col-sm-3"></label> |
|||
<select asp-for="Side" asp-items="@ViewBag.SideList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="Side" 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="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="TotalCT" class="control-label col-sm-3"></label> |
|||
<input asp-for="TotalCT" class="form-control col-sm-9" placeholder="請輸入CT" /> |
|||
<span asp-validation-for="TotalCT" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="CT" class="control-label col-sm-3"></label> |
|||
<input asp-for="CT" class="form-control col-sm-9" placeholder="請輸入節拍時間" /> |
|||
<span asp-validation-for="CT" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="MachineCT" class="control-label col-sm-3"></label> |
|||
<input asp-for="MachineCT" class="form-control col-sm-9" placeholder="請輸入操機數" /> |
|||
<span asp-validation-for="MachineCT" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<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> |
|||
} |
@ -0,0 +1,180 @@ |
|||
@{ |
|||
ViewData["Title"] = "標準工時資料查詢"; |
|||
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
|||
|
|||
} |
|||
<!DOCTYPE html> |
|||
<div class="layui-card" id="userinfo"> |
|||
<div class="layui-card-header"> |
|||
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
|||
</div> |
|||
<div class="layui-card-body"> |
|||
<form class="layui-form" action="" lay-filter="info"> |
|||
<div class="form-inline "> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-input-inline"> |
|||
<label class="control-label col-sm-3">请選擇單位名稱</label> |
|||
<div class="layui-input-inline" width:680px;> |
|||
<select id="unit" lay-event="unit" lay-filter="unit" lay-submit asp-items="@ViewBag.FactoryUnit"> |
|||
</select> |
|||
</div> |
|||
<input id="unitId" type="hidden" name="unitId" /> |
|||
</div> |
|||
<div class="layui-input-inline"> |
|||
<label class="control-label col-sm-3">料號</label> |
|||
<input style="width:280px;" type="text" name="modelname" placeholder="请输入" autocomplete="off" class="layui-input"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-inline"> |
|||
<div class="layui-form-item"> |
|||
<label class="control-label col-sm-3">線別</label> |
|||
<div id="demo1" width:400px;></div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline"> |
|||
<div class="layui-form-item"> |
|||
<button type="submit" class="layui-btn tt" lay-submit="" lay-filter="demo1">查詢</button> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<table class="layui-hide" id="test" lay-filter="test"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
@section Scripts{ |
|||
<!-- layui css --> |
|||
<link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui-v2.5.6/css/layui.css" /> |
|||
<!-- layui js --> |
|||
<script src="https://www.layuicdn.com/layui-v2.5.6/layui.js"></script> |
|||
<!-- 下载地址 https://gitee.com/maplemei/xm-select/attach_files/591517/download/xm-select-v1.2.2.zip --> |
|||
<script src="https://maplemei.gitee.io/xm-select/xm-select.js" type="text/javascript" charset="utf-8"></script> |
|||
<script> |
|||
layui.use(['table','jquery', 'form', 'laydate'], function () { |
|||
var $ = layui.$; |
|||
var form = layui.form, |
|||
layer = layui.layer; |
|||
var table = layui.table; |
|||
table.render({ |
|||
elem: '#test' |
|||
, url: "@Url.Action("GetStandardWorkTimes", "WHS")" |
|||
, title: '標準工時資料維護' |
|||
, cellMinwidth: 80//全局定义常规单元格的最小宽度,1ayui 2.2.1 新增 |
|||
, cols: [[ |
|||
{ |
|||
field: 'standardID', |
|||
title: '#', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'unitNo', |
|||
title: '單位代號' |
|||
}, |
|||
{ |
|||
field: 'lineID', |
|||
title: '線別' |
|||
}, |
|||
{ |
|||
field: 'StationID', |
|||
title: '線別' |
|||
}, |
|||
{ |
|||
field: 'itemNo', |
|||
title: '料號', |
|||
}, |
|||
{ |
|||
field: 'side', |
|||
title: '正背面', |
|||
}, |
|||
{ |
|||
field: 'opcnt', |
|||
title: '作業人數', |
|||
}, |
|||
{ |
|||
field: 'firstTime', |
|||
title: '首件產出時間(分)', |
|||
}, |
|||
{ |
|||
field: 'totalCT', |
|||
title: 'C/T(分)', |
|||
minwidth: 20 |
|||
}, |
|||
{ |
|||
field: 'ct', |
|||
title: '節拍時間', |
|||
}, |
|||
{ |
|||
field: 'machineCT', |
|||
title: '操機數', |
|||
} |
|||
]] |
|||
, page: true |
|||
, limits: [3, 5, 10]//一页选择显示3,5或10条数据 |
|||
, limit: 10 //一页显示10条数据 |
|||
, parseData: function (res) { //将原始数据解析成tabe组件所规定的数据,res光 |
|||
var result; |
|||
if (this.page.curr) { |
|||
result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr) |
|||
} |
|||
else { |
|||
result = res.data.slice(0, this.limit); |
|||
} |
|||
|
|||
return { |
|||
"code": res.code,//解析接口状态 |
|||
"msg": res.msg,//解析提示文本 |
|||
"count": res.count,//解析数据长度 |
|||
"data": result//解析数据列表 |
|||
}; |
|||
} |
|||
}); |
|||
//如果需要使用原始保单提交方式(刷新整个页面) |
|||
//请注释掉下方 监听表单的 代码 |
|||
form.on('submit(demo1)', function (data) { |
|||
//打印表单数据 |
|||
table.reload('test', { |
|||
url: '/WHS/GetStandardWorkTimes005/', |
|||
where: { |
|||
u: $("#unit").val(), |
|||
l: data.field.xmselectName, |
|||
i: data.field.modelname |
|||
} |
|||
}); |
|||
return false;//阻止默认表单提交行为 |
|||
}); |
|||
|
|||
}); |
|||
var options = { |
|||
el: '#demo1', |
|||
name: 'xmselectName',//表单的name属性 |
|||
layVerify: 'required',//必填项 |
|||
//layVerType: 'tips',//提示类型 同layui |
|||
tips: '請選擇站別', |
|||
toolbar: {//工具条,全选,清空,反选,自定义 |
|||
show: true, |
|||
list: [ |
|||
'ALL', |
|||
'CLEAR', |
|||
'REVERSE', |
|||
] |
|||
}, |
|||
data: [], |
|||
}; |
|||
var demo1 = xmSelect.render(options) |
|||
setTimeout(function () { |
|||
$.ajax({ |
|||
url: '/BAS/GetLineInfoesList', |
|||
method: 'get', |
|||
dataType: 'JSON', |
|||
success: function (data) { |
|||
var res = data; |
|||
demo1.update({ |
|||
data: res.data, |
|||
autoRow: true, |
|||
}) |
|||
} |
|||
}); |
|||
}, 100); |
|||
|
|||
</script> |
|||
} |
@ -0,0 +1,202 @@ |
|||
@{ |
|||
ViewData["Title"] = "援入/外資料維護"; |
|||
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
|||
|
|||
} |
|||
<div class="layui-card"> |
|||
<div class="layui-card-header"> |
|||
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
|||
</div> |
|||
<div class="layui-card-body"> |
|||
<div class="layui-form" style="margin-bottom:5px;"> |
|||
<div class="layui-form-item"> |
|||
<div class="layui-input-inline"> |
|||
<label class=" layui-inline layui-form-label" >廠別:</label> |
|||
<div class="layui-input-inline"> |
|||
<select id="werks" lay-event="werks" asp-items="@ViewBag.FactoryList"> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="layui-input-inline"> |
|||
<label class=" layui-inline layui-form-label" >援入援外:</label> |
|||
<div class="layui-input-inline"> |
|||
<select id="type" name="type" > |
|||
<option value="i">援入</option> |
|||
<option value="o">援外</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="layui-input-inline"> |
|||
<label class="layui-inline layui-form-label" >單位名稱:</label> |
|||
<div class="layui-input-inline"> |
|||
<select id="unit" lay-event="unit" lay-filter="unit" lay-submit asp-items="@ViewBag.FactoryUnit"> |
|||
</select> |
|||
<input id="unitId" type="hidden" name="unitId" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="layui-form-item"> |
|||
<label class="layui-inline layui-form-label" >援入援外日期</label> |
|||
<input id="supportDateS" type="date" name="supportDateS" text="@System.DateTime.Now.AddDays(-8)" />~ |
|||
<input id="supportDateE" type="date" name="supportDateE" text="@System.DateTime.Now.AddDays(-1)" /> |
|||
<button id="btnSearch" class="layui-btn layui-btn-normal layui-btn-sm"> |
|||
<i class="layui-icon"></i>搜索 |
|||
</button> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline" style="margin-left:90%"> |
|||
<button type="button" id="btnAdd" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i>新增</button> |
|||
</div> |
|||
<table class="layui-hide" id="test" name="test" lay-filter="test"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
@section Scripts{ |
|||
<script> |
|||
layui.use(['table','jquery', 'form', 'laydate'], function () { |
|||
var $ = layui.$; |
|||
var form = layui.form, |
|||
layer = layui.layer; |
|||
var table = layui.table; |
|||
table.render({ |
|||
elem: '#test' |
|||
, data:[] |
|||
, title: '援入援外資料維護' |
|||
, cellMinwidth: 80//全局定义常规单元格的最小宽度,1ayui 2.2.1 新增 |
|||
, cols: [[ |
|||
{ |
|||
field: 'supportDate', |
|||
title: '日期', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'userNo', |
|||
title: '員工工號' |
|||
}, |
|||
{ |
|||
field: 'userNane', |
|||
title: '員工姓名' |
|||
}, |
|||
{ |
|||
field: 'unitNoI', |
|||
title: '援入部門' |
|||
}, |
|||
{ |
|||
field: 'otherDeptI', |
|||
title: '援入其他部門', |
|||
}, |
|||
{ |
|||
field: 'unitNoO', |
|||
title: '援出部門', |
|||
}, |
|||
{ |
|||
field: 'otherDeptO', |
|||
title: '援出其他部門', |
|||
}, |
|||
{ |
|||
field: 'hours', |
|||
title: '支援時數(分鐘)', |
|||
}, |
|||
{ |
|||
field: 'center', |
|||
width: 200, |
|||
title: '操作', |
|||
templet: function (item) { |
|||
var btn = '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a>'; |
|||
btn += ' <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del">刪除</a>'; |
|||
return btn |
|||
} |
|||
} |
|||
]] |
|||
, page: true |
|||
, limits: [3, 5, 10]//一页选择显示3,5或10条数据 |
|||
, limit: 10 //一页显示10条数据 |
|||
//, parseData: function (res) { //将原始数据解析成tabe组件所规定的数据,res光 |
|||
// var result; |
|||
// if (this.page.curr) { |
|||
// if (res.data) |
|||
// result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr) |
|||
// } |
|||
// else { |
|||
// if (res.data) |
|||
// result = res.data.slice(0, this.limit); |
|||
// } |
|||
// |
|||
// return { |
|||
// "code": res.code,//解析接口状态 |
|||
// "msg": res.msg,//解析提示文本 |
|||
// "count": res.count,//解析数据长度 |
|||
// "data": result//解析数据列表 |
|||
// }; |
|||
// } |
|||
}); |
|||
table.on('tool(test)', function (obj) { |
|||
if (obj.event == 'edit') { |
|||
if (obj.data.supportID) { |
|||
hg.open('修改援入援外資料', '/WHS/WHS008U?id=' + obj.data.supportID + '&type=' + $("#type").val(), 480, 480); |
|||
} |
|||
} |
|||
if (obj.event == 'del') { |
|||
if (obj.data.supportID) { |
|||
var str; |
|||
str = "刪除"; |
|||
hg.confirm("系統:" + obj.data.supportID + ",確定要" + str + "嗎?", function () { |
|||
$.ajax({ |
|||
url: '/WHS/WHS008D', |
|||
data: { id: obj.data.supportID }, |
|||
type: 'POST', |
|||
success: function (res) { |
|||
if (res.success) { |
|||
obj.del(); //只删本地数据 |
|||
hg.msghide(str + "成功!", { |
|||
icon: 6 |
|||
}); |
|||
layui.table.reload('test', { page: { curr: $(".layui-laypage-em").next().html() } }) |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
//搜索 |
|||
$('#btnSearch').click(function () { |
|||
var sd = $("#supportDateS").val(); |
|||
var ed = $("#supportDateE").val(); |
|||
if (sd && ed) { |
|||
hg.msghide("刷新数据!"); |
|||
table.reload('test', { |
|||
url: '/WHS/GetSupportUser2/', |
|||
where: { |
|||
//廠別 |
|||
//生產單位 |
|||
f: $("#werks").val(), |
|||
type: $("#type").val(), |
|||
unit: $("#unit").val(), |
|||
sd: $("#supportDateS").val(), |
|||
ed: $("#supportDateE").val() |
|||
//i: data.field.modelname |
|||
} |
|||
}); |
|||
} |
|||
else { |
|||
alert("請填寫查詢時間!!!!"); |
|||
} |
|||
return false; |
|||
|
|||
}); |
|||
//新增 |
|||
$('#btnAdd').click(function () { |
|||
hg.open('新增援入援外資料', '/WHS/WHS008C', 480, 480); |
|||
}); |
|||
}); |
|||
|
|||
|
|||
</script> |
|||
} |
@ -0,0 +1,156 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.SupportUser |
|||
|
|||
|
|||
@{ ViewData["Title"] = "WHS008C"; |
|||
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="WHS008CSave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="SupportID" value="0" /> |
|||
<input type="hidden" asp-for="CreateUserID" value="0" /> |
|||
<input type="hidden" asp-for="UpdateUserID" value="0" /> |
|||
<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="Werks" class="control-label col-sm-3"></label> |
|||
<select asp-for="Werks" asp-items="@ViewBag.FactoryList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="Werks" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="SupportDate" class="control-label col-sm-3"></label> |
|||
<input asp-for="SupportDate" type="date" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="SupportDate" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="ClassNo" class="control-label col-sm-3"></label> |
|||
<select asp-for="ClassNo" asp-items="@ViewBag.ClassList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="ClassNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UnitNoI" class="control-label col-sm-3"></label> |
|||
<select id="UnitNoI" asp-for="UnitNoI" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="UnitNoI" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="LineIDI" class="control-label col-sm-3"></label> |
|||
<select asp-for="LineIDI" asp-items="@ViewBag.LineList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="LineIDI" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="StationIDI" class="control-label col-sm-3"></label> |
|||
<select asp-for="StationIDI" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="StationIDI" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="OtherDeptI" class="control-label col-sm-3"></label> |
|||
<select asp-for="OtherDeptI" asp-items="@ViewBag.DeptList" class="custom-select col-sm-9" disabled></select> |
|||
<span asp-validation-for="OtherDeptI" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UserNo" class="control-label col-sm-3"></label> |
|||
<input asp-for="UserNo" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="UserNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UserNane" class="control-label col-sm-3"></label> |
|||
<input asp-for="UserNane" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="UserNane" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UnitNoO" class="control-label col-sm-3"></label> |
|||
<select id="UnitNoO" asp-for="UnitNoO" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="UnitNoO" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="LineIDO" class="control-label col-sm-3"></label> |
|||
<select asp-for="LineIDO" asp-items="@ViewBag.LineList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="LineIDO" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="StationIDO" class="control-label col-sm-3"></label> |
|||
<select asp-for="StationIDO" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="StationIDO" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="OtherDeptO" class="control-label col-sm-3"></label> |
|||
<select asp-for="OtherDeptO" asp-items="@ViewBag.DeptList" class="custom-select col-sm-9" disabled></select> |
|||
<span asp-validation-for="OtherDeptO" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Hours" class="control-label col-sm-3"></label> |
|||
<input asp-for="Hours"class="form-control col-sm-9" /> |
|||
<span asp-validation-for="Hours" 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" /> |
|||
<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); |
|||
} |
|||
}); |
|||
|
|||
$("#UnitNoI").change(function () { |
|||
console.log("#UnitNoI"); |
|||
var data = $("#UnitNoI").val(); |
|||
if (data == "0") { |
|||
$("#LineIDI").attr("disabled", true); |
|||
$("#StationIDI").attr("disabled", true); |
|||
$("#OtherDeptI").val(0); |
|||
$("#OtherDeptI").attr("disabled", false); |
|||
} |
|||
else { |
|||
$("#LineIDI").val(0); |
|||
$("#StationIDI").val(0); |
|||
$("#LineIDI").attr("disabled", false); |
|||
$("#StationIDI").attr("disabled", false); |
|||
$("#OtherDeptI").attr("disabled", true); |
|||
} |
|||
}); |
|||
|
|||
$("#UnitNoO").change(function () { |
|||
console.log("#UnitNoO"); |
|||
var data = $("#UnitNoO").val(); |
|||
if (data == "0") { |
|||
$("#LineIDO").attr("disabled", true); |
|||
$("#StationIDO").attr("disabled", true); |
|||
$("#v").val(0); |
|||
$("#OtherDeptO").attr("disabled", false); |
|||
} |
|||
else { |
|||
$("#LineIDO").val(0); |
|||
$("#StationIDO").val(0); |
|||
$("#LineIDO").attr("disabled", false); |
|||
$("#StationIDO").attr("disabled", false); |
|||
$("#OtherDeptO").attr("disabled", true); |
|||
} |
|||
}); |
|||
</script> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,216 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.SupportUser |
|||
@{ ViewData["Title"] = "WHS008U"; |
|||
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="WHS008USave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="SupportID" /> |
|||
<input type="hidden" asp-for="CreateUserID" /> |
|||
<input type="hidden" asp-for="UpdateUserID" value="0" /> |
|||
<input type="hidden" asp-for="CreateDate" /> |
|||
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" id="type" value="@ViewBag.type" /> |
|||
<input type="hidden" id="UnitNoI" asp-for="UnitNoI" /> |
|||
<input type="hidden" id="LineIDI" asp-for="LineIDI" /> |
|||
<input type="hidden" id="StationIDI" asp-for="StationIDI" /> |
|||
<input type="hidden" id="OtherDeptI" asp-for="OtherDeptI" /> |
|||
<input type="hidden" id="UnitNoO" asp-for="UnitNoO" /> |
|||
<input type="hidden" id="LineIDO" asp-for="LineIDO" /> |
|||
<input type="hidden" id="StationIDO" asp-for="StationIDO" /> |
|||
<input type="hidden" id="OtherDeptO" asp-for="OtherDeptO"/> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Werks" class="control-label col-sm-3"></label> |
|||
<select asp-for="Werks" asp-items="@ViewBag.FactoryList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="Werks" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="SupportDate" class="control-label col-sm-3"></label> |
|||
<input asp-for="SupportDate" type="date" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="SupportDate" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="ClassNo" class="control-label col-sm-3"></label> |
|||
<select asp-for="ClassNo" asp-items="@ViewBag.ClassList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="ClassNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UnitNoI" class="control-label col-sm-3"></label> |
|||
<select id="UnitNoIShow" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="UnitNoI" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="LineIDI" class="control-label col-sm-3"></label> |
|||
<select id="LineIDIShow" asp-items="@ViewBag.LineList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="LineIDI" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="StationIDI" class="control-label col-sm-3"></label> |
|||
<select id="StationIDIShow" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="StationIDI" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="OtherDeptI" class="control-label col-sm-3"></label> |
|||
<select id="OtherDeptIShow" asp-items="@ViewBag.DeptList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="OtherDeptI" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UserNo" class="control-label col-sm-3"></label> |
|||
<input asp-for="UserNo" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="UserNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UserNane" class="control-label col-sm-3"></label> |
|||
<input asp-for="UserNane" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="UserNane" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="UnitNoO" class="control-label col-sm-3"></label> |
|||
<select id="UnitNoOShow" asp-items="@ViewBag.FactoryUnit" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="UnitNoO" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="LineIDO" class="control-label col-sm-3"></label> |
|||
<select id="LineIDOShow" asp-items="@ViewBag.LineList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="LineIDO" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="StationIDO" class="control-label col-sm-3"></label> |
|||
<select id="StationIDOShow" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="StationIDO" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="OtherDeptO" class="control-label col-sm-3"></label> |
|||
<select id="OtherDeptOShow" asp-items="@ViewBag.DeptList"class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="OtherDeptO" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="Hours" class="control-label col-sm-3"></label> |
|||
<input asp-for="Hours" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="Hours" 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" /> |
|||
<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); |
|||
} |
|||
$("#UnitNoOShow").val($("#UnitNoO").val()); |
|||
$("#LineIDOShow").val($("#LineIDO").val()); |
|||
$("#StationIDOShow").val($("#StationIDO").val()); |
|||
$("#OtherDeptOShow").val($("#OtherDeptO").val()); |
|||
$("#UnitNoIShow").val($("#UnitNoI").val()); |
|||
$("#LineIDIShow").val($("#LineIDI").val()); |
|||
$("#StationIDIShow").val($("#StationIDI").val()); |
|||
$("#OtherDeptIShow").val($("#OtherDeptI").val()); |
|||
|
|||
|
|||
var type = $("#type").val(); |
|||
console.log(type); |
|||
if (type == "i") { |
|||
$("#UnitNoOShow").attr("disabled", true); |
|||
$("#LineIDOShow").attr("disabled", true); |
|||
$("#StationIDOShow").attr("disabled", true); |
|||
$("#OtherDeptOShow").attr("disabled", true); } |
|||
else { |
|||
$("#UnitNoIShow").attr("disabled", true); |
|||
$("#LineIDIShow").attr("disabled", true); |
|||
$("#StationIDIShow").attr("disabled", true); |
|||
$("#OtherDeptIShow").attr("disabled", true); |
|||
} |
|||
|
|||
}); |
|||
|
|||
$("#UnitNoIShow").change(function () { |
|||
var data = $("#UnitNoIShow").val(); |
|||
$("#UnitNoI").val(data); |
|||
if (data == "0") { |
|||
$("#LineIDIShow").attr("disabled", true); |
|||
$("#StationIDIShow").attr("disabled", true); |
|||
$("#OtherDeptIShow").val(0); |
|||
$("#OtherDeptIShow").attr("disabled", false); |
|||
} |
|||
else { |
|||
$("#LineIDIShow").val(0); |
|||
$("#StationIDIShow").val(0); |
|||
$("#LineIDIShow").attr("disabled", false); |
|||
$("#StationIDIShow").attr("disabled", false); |
|||
$("#OtherDeptIShow").attr("disabled", true); |
|||
} |
|||
}); |
|||
|
|||
$("#UnitNoOShow").change(function () { |
|||
var data = $("#UnitNoOShow").val(); |
|||
$("#UnitNoO").val(data); |
|||
if (data == "0") { |
|||
$("#LineIDOShow").attr("disabled", true); |
|||
$("#StationIDOShow").attr("disabled", true); |
|||
$("#OtherDeptOShow").val(0); |
|||
$("#OtherDeptOShow").attr("disabled", false); |
|||
} |
|||
else { |
|||
$("#LineIDOShow").val(0); |
|||
$("#StationIDOShow").val(0); |
|||
$("#LineIDOShow").attr("disabled", false); |
|||
$("#StationIDOShow").attr("disabled", false); |
|||
$("#OtherDeptOShow").attr("disabled", true); |
|||
} |
|||
}); |
|||
|
|||
$("#LineIDIShow").change(function () { |
|||
var data = $("#LineIDIShow").val(); |
|||
$("#LineIDI").val(data); |
|||
}); |
|||
$("#StationIDIShow").change(function () { |
|||
var data = $("#StationIDIShow").val(); |
|||
$("#StationIDI").val(data); |
|||
}); |
|||
$("#OtherDeptIShow").change(function () { |
|||
var data = $("#OtherDeptIShow").val(); |
|||
$("#OtherDeptI").val(data); |
|||
}); |
|||
$("#LineIDOShow").change(function () { |
|||
var data = $("#LineIDOShow").val(); |
|||
$("#LineIDO").val(data); |
|||
}); |
|||
$("#StationIDOShow").change(function () { |
|||
var data = $("#StationIDOShow").val(); |
|||
$("#StationIDO").val(data); |
|||
}); |
|||
$("#OtherDeptOShow").change(function () { |
|||
var data = $("#OtherDeptOShow").val(); |
|||
$("#OtherDeptO").val(data); |
|||
}); |
|||
|
|||
|
|||
|
|||
</script> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,171 @@ |
|||
@{ |
|||
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; margin-right: 5px; "> |
|||
<div class="layui-form-item" style="margin-right: 2px; margin-left: 0px;"> |
|||
<div class="layui-inline" style="margin-right: 2px; margin-left: 0px;"> |
|||
<label class=" layui-inline layui-form-label">工單</label> |
|||
<div class="layui-input-inline" style="margin-right: 2px; margin-left: 0px;"> |
|||
<input class="layui-input" id="wipno" name="wipno" /> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline" style="margin-right: 5px; margin-left: 0px;"> |
|||
<label class=" layui-inline layui-form-label">站別</label> |
|||
<div class="layui-input-inline" > |
|||
<select id="sid" lay-event="sid" lay-filter="sid" lay-submit asp-items="@ViewBag.StationList"> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="layui-inline" style="margin-right: 0px; margin-left: 0px;"> |
|||
<div class="layui-btn-group"> |
|||
<button id="btnSearch" class="layui-btn layui-btn-sm layui-btn-normal"> |
|||
<i class="layui-icon layui-icon-sm"></i>搜尋 |
|||
</button> |
|||
<button type="button" id="btnAdd" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon"></i>新增 |
|||
</button> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<table class="layui-hide" id="test" lay-filter="test"></table> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
@section Scripts{ |
|||
<script> |
|||
layui.use(['table','jquery', 'form', 'laydate'], function () { |
|||
var $ = layui.$; |
|||
var form = layui.form, |
|||
layer = layui.layer; |
|||
var table = layui.table; |
|||
table.render({ |
|||
elem: '#test' |
|||
, data:[] |
|||
, title: '重工標準工時維護' |
|||
, cellMinwidth: 80//全局定义常规单元格的最小宽度,1ayui 2.2.1 新增 |
|||
, cols: [[ |
|||
{ |
|||
field: 'reworkStandardID', |
|||
title: '#', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'wipNo', |
|||
title: '工單號碼', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'itemNo', |
|||
title: '料號' |
|||
}, |
|||
{ |
|||
field: 'stationID', |
|||
title: '站別' |
|||
}, |
|||
{ |
|||
field: 'totalCT', |
|||
title: 'C/T(分)' |
|||
}, |
|||
{ |
|||
field: 'center', |
|||
width: 200, |
|||
title: '操作', |
|||
templet: function (item) { |
|||
var btn = '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a>'; |
|||
btn += ' <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del">刪除</a>'; |
|||
return btn |
|||
} |
|||
} |
|||
]] |
|||
, page: true |
|||
, limits: [3, 5, 10]//一页选择显示3,5或10条数据 |
|||
, limit: 10 //一页显示10条数据 |
|||
//, parseData: function (res) { //将原始数据解析成tabe组件所规定的数据,res光 |
|||
// var result; |
|||
// if (this.page.curr) { |
|||
// if (res.data) |
|||
// result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr) |
|||
// } |
|||
// else { |
|||
// if (res.data) |
|||
// result = res.data.slice(0, this.limit); |
|||
// } |
|||
// |
|||
// return { |
|||
// "code": res.code,//解析接口状态 |
|||
// "msg": res.msg,//解析提示文本 |
|||
// "count": res.count,//解析数据长度 |
|||
// "data": result//解析数据列表 |
|||
// }; |
|||
// } |
|||
}); |
|||
table.on('tool(test)', function (obj) { |
|||
if (obj.event == 'edit') { |
|||
if (obj.data.reworkStandardID) { |
|||
hg.open('修改重工標準工時', '/WHS/WHS011U/' + obj.data.reworkStandardID , 480, 480); |
|||
} |
|||
} |
|||
if (obj.event == 'del') { |
|||
if (obj.data.reworkStandardID) { |
|||
var str; |
|||
str = "刪除"; |
|||
hg.confirm("系統:" + obj.data.reworkStandardID + ",確定要" + str + "嗎?", function () { |
|||
$.ajax({ |
|||
url: '/WHS/WHS011D', |
|||
data: { id: obj.data.reworkStandardID }, |
|||
type: 'POST', |
|||
success: function (res) { |
|||
if (res.success) { |
|||
obj.del(); //只删本地数据 |
|||
hg.msghide(str + "成功!", { |
|||
icon: 6 |
|||
}); |
|||
layui.table.reload('test', { page: { curr: $(".layui-laypage-em").next().html() } }) |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
//搜索 |
|||
$('#btnSearch').click(function () { |
|||
hg.msghide("刷新数据!"); |
|||
table.reload('test', { |
|||
url: '/WHS/GetStandardWorkTimeReworkByQuery/', |
|||
where: { |
|||
wipno: $("#wipno").val(), |
|||
sid: $("#sid").val(), |
|||
} |
|||
}); |
|||
return false; |
|||
|
|||
}); |
|||
}); |
|||
|
|||
//新增 |
|||
$('#btnAdd').click(function () { |
|||
hg.open('新增重工標準工時', '/WHS/WHS011C', 480, 480); |
|||
}); |
|||
|
|||
</script> |
|||
} |
@ -0,0 +1,68 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.StandardWorkTimeRework |
|||
|
|||
|
|||
@{ ViewData["Title"] = "WHS011C"; |
|||
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="WHS011CSave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="ReworkStandardID" value="0" /> |
|||
<input type="hidden" asp-for="CreateUserID" value="0" /> |
|||
<input type="hidden" asp-for="UpdateUserID" value="0" /> |
|||
<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="WipNo" class="control-label col-sm-3"></label> |
|||
<input asp-for="WipNo" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="WipNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</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" /> |
|||
<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="StationID" class="control-label col-sm-3"></label> |
|||
<select asp-for="StationID" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="StationID" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="TotalCT" class="control-label col-sm-3"></label> |
|||
<input asp-for="TotalCT" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="TotalCT" 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> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,76 @@ |
|||
@model AMESCoreStudio.WebApi.Models.AMES.StandardWorkTimeRework |
|||
|
|||
|
|||
@{ ViewData["Title"] = "WHS011U"; |
|||
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="WHS011USave"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<input type="hidden" asp-for="ReworkStandardID" /> |
|||
<input type="hidden" asp-for="CreateUserID" /> |
|||
<input type="hidden" asp-for="UpdateUserID" value="0" /> |
|||
<input type="hidden" asp-for="CreateDate" /> |
|||
<input type="hidden" asp-for="UpdateDate" value="@System.DateTime.Now" /> |
|||
<input type="hidden" id="StationID" asp-for="StationID" class="form-control col-sm-9" /> |
|||
<input type="hidden" id="WipNo" asp-for="WipNo" class="form-control col-sm-9" /> |
|||
|
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="WipNo" class="control-label col-sm-3"></label> |
|||
<input id="WipNoShow" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="WipNo" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</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" /> |
|||
<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="StationID" class="control-label col-sm-3"></label> |
|||
<select id="StationIDShow" asp-items="@ViewBag.StationList" class="custom-select col-sm-9"></select> |
|||
<span asp-validation-for="StationID" class="text-danger offset-sm-3 my-sm-1"></span> |
|||
</div> |
|||
<div class="form-group form-inline my-sm-1"> |
|||
<label asp-for="TotalCT" class="control-label col-sm-3"></label> |
|||
<input asp-for="TotalCT" class="form-control col-sm-9" /> |
|||
<span asp-validation-for="TotalCT" 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); |
|||
} |
|||
$("#WipNoShow").val($("#WipNo").val()); |
|||
$("#StationIDShow").val($("#StationID").val()); |
|||
|
|||
$("#WipNoShow").attr("disabled", true); |
|||
$("#StationIDShow").attr("disabled", true); |
|||
|
|||
}); |
|||
</script> |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,178 @@ |
|||
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; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Controllers.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工廠资料维护
|
|||
/// </summary>
|
|||
[Route("api/[controller]")]
|
|||
[ApiController] |
|||
public class BarcodeInfoesController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public BarcodeInfoesController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取全部條碼资料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeInfoes
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<BarcodeInfo>>> GetBarcodeInfoes() |
|||
{ |
|||
IQueryable<BarcodeInfo> q = _context.BarcodeInfoes; |
|||
q = q.OrderBy(p => p.BarcodeID); |
|||
|
|||
var BarcodeInfoes = await q.ToListAsync(); |
|||
return BarcodeInfoes; |
|||
//return await _context.BarcodeInfoes.ToListAsync();
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 用ID获取该條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeInfoes/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<BarcodeInfo>>> GetBarcodeInfoes(int id) |
|||
{ |
|||
|
|||
IQueryable<BarcodeInfo> q = _context.BarcodeInfoes; |
|||
q = q.Where(p => p.BarcodeID.Equals(id)); |
|||
var barcodeInfo = await q.ToListAsync(); |
|||
|
|||
if (barcodeInfo == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return barcodeInfo; |
|||
} |
|||
/// <summary>
|
|||
/// 用No获取该條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeInfoes/5
|
|||
[HttpGet("No/{id}")] |
|||
public async Task<ActionResult<IEnumerable<BarcodeInfo>>> GetBarcodeInfoesByNo(string id) |
|||
{ |
|||
|
|||
IQueryable<BarcodeInfo> q = _context.BarcodeInfoes; |
|||
q = q.Where(p => p.BarcodeNo.Equals(id)); |
|||
var barcodeInfo = await q.ToListAsync(); |
|||
|
|||
if (barcodeInfo == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return barcodeInfo; |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 更新條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="barcodeInfo"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/BarcodeInfoes/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<ActionResult<BarcodeInfo>> PutBarcodeInfoes(int id, [FromBody] BarcodeInfo barcodeInfo) |
|||
{ |
|||
if (id != barcodeInfo.BarcodeID) |
|||
{ |
|||
return BadRequest(); |
|||
} |
|||
|
|||
_context.Entry(barcodeInfo).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!BarcodeInfoesExists(id)) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
return barcodeInfo; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增條碼资料
|
|||
/// </summary>
|
|||
/// <param name="barcodeInfo"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/BarcodeInfoes
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ActionResult<BarcodeInfo>> PostBarcodeInfoes(BarcodeInfo barcodeInfo) |
|||
{ |
|||
Helper helper = new Helper(_context); |
|||
barcodeInfo.BarcodeID = helper.GetIDKey("BARCODE_ID").Result; |
|||
|
|||
_context.BarcodeInfoes.Add(barcodeInfo); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return CreatedAtAction("GetBarcodeInfoes", new { id = barcodeInfo.BarcodeID }, barcodeInfo); |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/BarcodeInfoes/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ActionResult<BarcodeInfo>> DeleteBarcodeInfoes(int id) |
|||
{ |
|||
//var repairResponsibleUnits = await _context.BarcodeInfoes.FindAsync(id);
|
|||
var barcodeInfo = await _context.BarcodeInfoes.Where(m => m.BarcodeID == id).FirstOrDefaultAsync(); |
|||
if (barcodeInfo == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
_context.BarcodeInfoes.Remove(barcodeInfo); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return barcodeInfo; |
|||
} |
|||
|
|||
private bool BarcodeInfoesExists(int id) |
|||
{ |
|||
return _context.BarcodeInfoes.Any(e => e.BarcodeID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,334 @@ |
|||
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 BarcodeItemsController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public BarcodeItemsController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取全部條組件料
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeItems
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<BarcodeItem>>> GetBarcodeItems() |
|||
{ |
|||
IQueryable<BarcodeItem> q = _context.BarcodeItems; |
|||
q = q.OrderBy(p => p.BarcodeID); |
|||
|
|||
|
|||
|
|||
var BarcodeItems = await q.ToListAsync(); |
|||
|
|||
|
|||
|
|||
foreach (var data in BarcodeItems) |
|||
{ |
|||
data.B = _context.BarcodeInfoes.Find(data.BarcodeID); |
|||
data.I = _context.Items.Find(data.ItemNo); |
|||
data.S = _context.RuleStations.Find(data.RuleStationID); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
return BarcodeItems; |
|||
//return await _context.BarcodeItems.ToListAsync();
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 用ID获取该條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeItems/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<BarcodeItem>>> GetBarcodeItems(int id) |
|||
{ |
|||
|
|||
IQueryable<BarcodeItem> q = _context.BarcodeItems; |
|||
q = q.Where(p => p.BarcodeID.Equals(id)); |
|||
var barcodeItem = await q.ToListAsync(); |
|||
|
|||
if (barcodeItem == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return barcodeItem; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 用Unit获取该條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeItems/5
|
|||
[HttpGet("Unit/{id}")] |
|||
public async Task<ActionResult<IEnumerable<BarcodeItem>>> GetBarcodeItemByUnit(string id) |
|||
{ |
|||
|
|||
IQueryable<BarcodeItem> q = _context.BarcodeItems; |
|||
if(id != "0") |
|||
q = q.Where(p => p.I.ItemType.Equals(id)); |
|||
var barcodeItem = await q.ToListAsync(); |
|||
|
|||
foreach (var data in barcodeItem) |
|||
{ |
|||
data.B = _context.BarcodeInfoes.Find(data.BarcodeID); |
|||
data.I = _context.Items.Find(data.ItemNo); |
|||
data.S = _context.RuleStations.Find(data.RuleStationID); |
|||
} |
|||
|
|||
if (barcodeItem == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return barcodeItem; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 用Unit获取该條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeItems/5
|
|||
[HttpGet("UnitStr/{id}")] |
|||
public async Task<ActionResult<IEnumerable<BarcodeItem>>> GetBarcodeItemByUnitStr(string id) |
|||
{ |
|||
var str = ""; |
|||
IQueryable<BarcodeItem> q = _context.BarcodeItems; |
|||
if (id != "0") |
|||
{ |
|||
q = q.Where(p => p.I.ItemType.Equals(id)); |
|||
q = q.Where(p => p.B.BarcodeNo.Equals(str)); |
|||
} |
|||
var barcodeItem = await q.ToListAsync(); |
|||
var i = 0; |
|||
|
|||
foreach (var data in barcodeItem) |
|||
{ |
|||
//data.Serial = i + 1;
|
|||
data.B = _context.BarcodeInfoes.Find(data.BarcodeID); |
|||
data.I = _context.Items.Find(data.ItemNo); |
|||
data.S = _context.RuleStations.Find(data.RuleStationID); |
|||
} |
|||
|
|||
if (barcodeItem == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return barcodeItem; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 用Unit获取该條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="str"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeItems/5
|
|||
[HttpGet("Unit/{id}/Str/{str}")] |
|||
public async Task<ActionResult<IEnumerable<BarcodeItem>>> GetBarcodeItemByUnitStr(string id,string str) |
|||
{ |
|||
|
|||
IQueryable<BarcodeItem> q = _context.BarcodeItems; |
|||
if (id != "0") |
|||
{ |
|||
//製程單位
|
|||
q = q.Where(p => p.S.Station.UnitNo.Equals(id)); |
|||
//內部條碼
|
|||
q = q.Where(p => p.B.BarcodeNo.Equals(str)); |
|||
} |
|||
var barcodeItem = await q.ToListAsync(); |
|||
|
|||
foreach (var data in barcodeItem) |
|||
{ |
|||
//data.Serial = i + 1;
|
|||
data.B = _context.BarcodeInfoes.Find(data.BarcodeID); |
|||
data.I = _context.Items.Find(data.ItemNo); |
|||
data.S = _context.RuleStations.Find(data.RuleStationID); |
|||
} |
|||
|
|||
if (barcodeItem == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return barcodeItem; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 用Unit获取该條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="str"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/BarcodeItems/5
|
|||
[HttpGet("Str/{str}")] |
|||
public async Task<ActionResult<IEnumerable<BarcodeItem>>> GetBarcodeItemByStr(string strO) |
|||
{ |
|||
string id, str; |
|||
var strA = strO.Split(";"); |
|||
id = strA[0]; |
|||
str = strA[1]; |
|||
//WO0002A10001
|
|||
|
|||
IQueryable<BarcodeItem> q = _context.BarcodeItems; |
|||
if (id != "0") |
|||
q = q.Where(p => p.I.ItemType.Equals(id)); |
|||
|
|||
q = q.Where(p => p.B.BarcodeNo.Equals(str)); |
|||
var barcodeItem = await q.ToListAsync(); |
|||
|
|||
foreach (var data in barcodeItem) |
|||
{ |
|||
data.B = _context.BarcodeInfoes.Find(data.BarcodeID); |
|||
data.I = _context.Items.Find(data.ItemNo); |
|||
} |
|||
|
|||
if (barcodeItem == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return barcodeItem; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 更新條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="barcodeItem"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/BarcodeItems/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<BarcodeItem>> PutBarcodeItems(int id, [FromBody] BarcodeItem barcodeItem) |
|||
{ |
|||
ResultModel<BarcodeItem> result = new ResultModel<BarcodeItem>(); |
|||
if (id != barcodeItem.BarcodeID) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號錯誤"; |
|||
return result; |
|||
} |
|||
|
|||
_context.Entry(barcodeItem).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!BarcodeItemsExists(id)) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號不存在"; |
|||
return result; |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增條碼资料
|
|||
/// </summary>
|
|||
/// <param name="barcodeItem"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/BarcodeItems
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ResultModel<BarcodeItem>> PostBarcodeItems(BarcodeItem barcodeItem) |
|||
{ |
|||
ResultModel<BarcodeItem> result = new ResultModel<BarcodeItem>(); |
|||
Helper helper = new Helper(_context); |
|||
barcodeItem.BarcodeItemID = helper.GetIDKey("BARCODEITEM_ID").Result; |
|||
|
|||
_context.BarcodeItems.Add(barcodeItem); |
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateException) |
|||
{ |
|||
throw; |
|||
} |
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除條碼资料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/BarcodeItems/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ResultModel<BarcodeItem>> DeleteBarcodeItems(int id) |
|||
{ |
|||
ResultModel<BarcodeItem> result = new ResultModel<BarcodeItem>(); |
|||
//var repairResponsibleUnits = await _context.BarcodeItems.FindAsync(id);
|
|||
var barcodeItem = await _context.BarcodeItems.Where(m => m.BarcodeID == id).FirstOrDefaultAsync(); |
|||
if (barcodeItem == null) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號不存在"; |
|||
return result; |
|||
} |
|||
|
|||
_context.BarcodeItems.Remove(barcodeItem); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
} |
|||
|
|||
private bool BarcodeItemsExists(int id) |
|||
{ |
|||
return _context.BarcodeItems.Any(e => e.BarcodeID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,155 @@ |
|||
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; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Controllers.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工作群組維護
|
|||
/// </summary>
|
|||
[Route("api/[controller]")]
|
|||
[ApiController] |
|||
public class ExceptionWorktimeOlinesController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public ExceptionWorktimeOlinesController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/ExceptionWorktimeOlines
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<ExceptionWorktimeOline>>> GetExceptionWorktimeOline() |
|||
{ |
|||
IQueryable<ExceptionWorktimeOline> q = _context.ExceptionWorktimeOlines; |
|||
|
|||
q = q.OrderBy(p => p.OlineID); |
|||
|
|||
var exceptionWorktimeOline = await q.ToListAsync(); |
|||
|
|||
return exceptionWorktimeOline; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/ExceptionWorktimeOlines/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<ExceptionWorktimeOline>>> GetExceptionWorktimeOline(string id) |
|||
{ |
|||
IQueryable<ExceptionWorktimeOline> q = _context.ExceptionWorktimeOlines; |
|||
q = q.Where(p => p.OlineID.Equals(id)); |
|||
|
|||
var exceptionWorktimeOline = await q.ToListAsync(); |
|||
|
|||
if (exceptionWorktimeOline == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return exceptionWorktimeOline; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="exceptionWorktimeOline"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/ExceptionWorktimeOlines/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<ActionResult<ExceptionWorktimeOline>> PutExceptionWorktimeOline(int id, [FromBody] ExceptionWorktimeOline exceptionWorktimeOline) |
|||
{ |
|||
if (id != exceptionWorktimeOline.OlineID) |
|||
{ |
|||
return BadRequest(); |
|||
} |
|||
|
|||
_context.Entry(exceptionWorktimeOline).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!ExceptionWorktimeOlineExists(id)) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
return exceptionWorktimeOline; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增资料
|
|||
/// </summary>
|
|||
/// <param name="exceptionWorktimeOline"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/ExceptionWorktimeOlines
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ActionResult<ExceptionWorktimeOline>> PostExceptionWorktimeOline(ExceptionWorktimeOline exceptionWorktimeOline) |
|||
{ |
|||
Helper helper = new Helper(_context); |
|||
exceptionWorktimeOline.OlineID = helper.GetIDKey("ONLINE_ID").Result; |
|||
|
|||
_context.ExceptionWorktimeOlines.Add(exceptionWorktimeOline); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return CreatedAtAction("GetExceptionWorktimeOline", new { id = exceptionWorktimeOline.OlineID }, exceptionWorktimeOline); |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/ExceptionWorktimeOlines/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ActionResult<ExceptionWorktimeOline>> DeleteExceptionWorktimeOline(int id) |
|||
{ |
|||
var exceptionWorktimeOline = await _context.ExceptionWorktimeOlines.Where(p => p.OlineID == id).FirstOrDefaultAsync(); |
|||
if (exceptionWorktimeOline == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
_context.ExceptionWorktimeOlines.Remove(exceptionWorktimeOline); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return exceptionWorktimeOline; |
|||
} |
|||
|
|||
private bool ExceptionWorktimeOlineExists(int id) |
|||
{ |
|||
return _context.ExceptionWorktimeOlines.Any(e => e.OlineID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,155 @@ |
|||
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; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Controllers.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工作群組維護
|
|||
/// </summary>
|
|||
[Route("api/[controller]")]
|
|||
[ApiController] |
|||
public class ExceptionWorktimesController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public ExceptionWorktimesController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/ExceptionWorktimes
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<ExceptionWorktime>>> GetExceptionWorktime() |
|||
{ |
|||
IQueryable<ExceptionWorktime> q = _context.ExceptionWorktimes; |
|||
|
|||
q = q.OrderBy(p => p.ExceptionID); |
|||
|
|||
var exceptionWorktime = await q.ToListAsync(); |
|||
|
|||
return exceptionWorktime; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/ExceptionWorktimes/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<ExceptionWorktime>>> GetExceptionWorktime(string id) |
|||
{ |
|||
IQueryable<ExceptionWorktime> q = _context.ExceptionWorktimes; |
|||
q = q.Where(p => p.ExceptionID.Equals(id)); |
|||
|
|||
var exceptionWorktime = await q.ToListAsync(); |
|||
|
|||
if (exceptionWorktime == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return exceptionWorktime; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="exceptionWorktime"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/ExceptionWorktimes/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<ActionResult<ExceptionWorktime>> PutExceptionWorktime(int id, [FromBody] ExceptionWorktime exceptionWorktime) |
|||
{ |
|||
if (id != exceptionWorktime.ExceptionID) |
|||
{ |
|||
return BadRequest(); |
|||
} |
|||
|
|||
_context.Entry(exceptionWorktime).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!ExceptionWorktimeExists(id)) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
return exceptionWorktime; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增资料
|
|||
/// </summary>
|
|||
/// <param name="exceptionWorktime"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/ExceptionWorktimes
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ActionResult<ExceptionWorktime>> PostExceptionWorktime(ExceptionWorktime exceptionWorktime) |
|||
{ |
|||
Helper helper = new Helper(_context); |
|||
exceptionWorktime.ExceptionID = helper.GetIDKey("EXCEPTION_WORKTIME_ID").Result; |
|||
|
|||
_context.ExceptionWorktimes.Add(exceptionWorktime); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return CreatedAtAction("GetExceptionWorktime", new { id = exceptionWorktime.ExceptionID }, exceptionWorktime); |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/ExceptionWorktimes/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ActionResult<ExceptionWorktime>> DeleteExceptionWorktime(int id) |
|||
{ |
|||
var exceptionWorktime = await _context.ExceptionWorktimes.Where(p => p.ExceptionID == id).FirstOrDefaultAsync(); |
|||
if (exceptionWorktime == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
_context.ExceptionWorktimes.Remove(exceptionWorktime); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return exceptionWorktime; |
|||
} |
|||
|
|||
private bool ExceptionWorktimeExists(int id) |
|||
{ |
|||
return _context.ExceptionWorktimes.Any(e => e.ExceptionID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,234 @@ |
|||
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 StandardWorkTimeReworksController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
/// 重工標準工時
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public StandardWorkTimeReworksController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/StandardWorkTimeReworks
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<StandardWorkTimeRework>>> GetStandardWorkTimeRework() |
|||
{ |
|||
IQueryable<StandardWorkTimeRework> q = _context.StandardWorkTimeReworks; |
|||
|
|||
q = q.OrderBy(p => p.ReworkStandardID); |
|||
|
|||
var standardWorkTimeRework = await q.ToListAsync(); |
|||
|
|||
return standardWorkTimeRework; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/StandardWorkTimeReworks/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<StandardWorkTimeRework>>> GetStandardWorkTimeRework(int id) |
|||
{ |
|||
IQueryable<StandardWorkTimeRework> q = _context.StandardWorkTimeReworks; |
|||
q = q.Where(p => p.ReworkStandardID.Equals(id)); |
|||
|
|||
var standardWorkTimeRework = await q.ToListAsync(); |
|||
|
|||
if (standardWorkTimeRework == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return standardWorkTimeRework; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/StandardWorkTimeReworks/5
|
|||
[HttpGet("Query/{wipno}/{sid}")] |
|||
public async Task<ActionResult<IEnumerable<StandardWorkTimeRework>>> GetStandardWorkTimeReworkByQuery(string wipno,int sid) |
|||
{ |
|||
IQueryable<StandardWorkTimeRework> q = _context.StandardWorkTimeReworks; |
|||
if(wipno!="*") |
|||
q = q.Where(p => p.WipNo.Contains(wipno)&& p.StationID.Equals(sid)); |
|||
else |
|||
q = q.Where(p => p.StationID.Equals(sid)); |
|||
|
|||
var standardWorkTimeRework = await q.ToListAsync(); |
|||
|
|||
if (standardWorkTimeRework == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return standardWorkTimeRework; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 修改重工標準工時
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="standardWorkTimeRework"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/StandardWorkTimeReworks/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<StandardWorkTimeRework>> PutStandardWorkTimeRework(int id, [FromBody] StandardWorkTimeRework standardWorkTimeRework) |
|||
{ |
|||
ResultModel<StandardWorkTimeRework> result = new ResultModel<StandardWorkTimeRework>(); |
|||
|
|||
if (id != standardWorkTimeRework.ReworkStandardID) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號錯誤"; |
|||
return result; |
|||
} |
|||
|
|||
_context.Entry(standardWorkTimeRework).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!StandardWorkTimeExists(id)) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號不存在"; |
|||
return result; |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
|
|||
//if (id != standardWorkTimeRework.ReworkStandardID)
|
|||
//{
|
|||
// return BadRequest();
|
|||
//}
|
|||
|
|||
//_context.Entry(standardWorkTimeRework).State = EntityState.Modified;
|
|||
|
|||
//try
|
|||
//{
|
|||
// await _context.SaveChangesAsync();
|
|||
//}
|
|||
//catch (DbUpdateConcurrencyException)
|
|||
//{
|
|||
// if (!StandardWorkTimeExists(id))
|
|||
// {
|
|||
// return NotFound();
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// throw;
|
|||
// }
|
|||
//}
|
|||
|
|||
//return standardWorkTimeRework;
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增资料
|
|||
/// </summary>
|
|||
/// <param name="standardWorkTimeRework"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/StandardWorkTimeReworks
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ResultModel<StandardWorkTimeRework>> PostStandardWorkTimeRework(StandardWorkTimeRework standardWorkTimeRework) |
|||
{ |
|||
ResultModel<StandardWorkTimeRework> result = new ResultModel<StandardWorkTimeRework>(); |
|||
Helper helper = new Helper(_context); |
|||
standardWorkTimeRework.ReworkStandardID = helper.GetIDKey("RE_WORKTIME_ID").Result; |
|||
|
|||
_context.StandardWorkTimeReworks.Add(standardWorkTimeRework); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
//return CreatedAtAction("GetStandardWorkTime", new { id = standardWorkTimeRework.ReworkStandardID }, standardWorkTimeRework);
|
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/StandardWorkTimeReworks/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ResultModel<StandardWorkTimeRework>> DeleteStandardWorkTimeRework(int id) |
|||
{ |
|||
ResultModel<StandardWorkTimeRework> result = new ResultModel<StandardWorkTimeRework>(); |
|||
|
|||
var standardWorkTimeRework = await _context.StandardWorkTimeReworks.FindAsync(id); |
|||
if (standardWorkTimeRework == null) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號不存在"; |
|||
return result; |
|||
} |
|||
|
|||
_context.StandardWorkTimeReworks.Remove(standardWorkTimeRework); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
//var standardWorkTimeRework = await _context.StandardWorkTimeReworks.Where(p => p.ReworkStandardID == id).FirstOrDefaultAsync();
|
|||
//if (standardWorkTimeRework == null)
|
|||
//{
|
|||
// return NotFound();
|
|||
//}
|
|||
|
|||
//_context.StandardWorkTimeReworks.Remove(standardWorkTimeRework);
|
|||
//await _context.SaveChangesAsync();
|
|||
|
|||
//return standardWorkTimeRework;
|
|||
} |
|||
|
|||
private bool StandardWorkTimeExists(int id) |
|||
{ |
|||
return _context.StandardWorkTimeReworks.Any(e => e.ReworkStandardID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,276 @@ |
|||
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 StandardWorkTimesController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public StandardWorkTimesController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/StandardWorkTimes
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<StandardWorkTime>>> GetStandardWorkTime() |
|||
{ |
|||
IQueryable<StandardWorkTime> q = _context.StandardWorkTimes; |
|||
|
|||
q = q.OrderBy(p => p.StandardID); |
|||
|
|||
var standardWorkTime = await q.ToListAsync(); |
|||
|
|||
return standardWorkTime; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/StandardWorkTimes/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<StandardWorkTime>>> GetStandardWorkTime(int id) |
|||
{ |
|||
IQueryable<StandardWorkTime> q = _context.StandardWorkTimes; |
|||
q = q.Where(p => p.StandardID.Equals(id)); |
|||
|
|||
var standardWorkTime = await q.ToListAsync(); |
|||
|
|||
if (standardWorkTime == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return standardWorkTime; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// WHS005
|
|||
/// </summary>
|
|||
/// <param name="u"></param>
|
|||
/// <param name="l"></param>
|
|||
/// <param name="i"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/StandardWorkTimes/5
|
|||
[HttpGet("WHS003/{u}/{l}/{i}")] |
|||
public async Task<ActionResult<IEnumerable<StandardWorkTime>>> GetStandardWorkTimeByQuery003(string u ,int l,string i) |
|||
{ |
|||
IQueryable<StandardWorkTime> q = _context.StandardWorkTimes; |
|||
|
|||
if (l == -99) { |
|||
if (u != "Null" && i != "Null") |
|||
{ |
|||
q = q.Where(p => p.UnitNo.Equals(u) && p.ItemNo.Contains(i)); |
|||
} |
|||
else if (u == "Null" && i != "Null") |
|||
{ |
|||
q = q.Where(p => p.ItemNo.Contains(i)); |
|||
} |
|||
else if (u != "Null" && i == "Null") |
|||
{ |
|||
q = q.Where(p => p.UnitNo.Equals(u)); |
|||
} |
|||
} |
|||
else { |
|||
if (i != "Null") |
|||
q = q.Where(p => p.LineID.Equals(l) && p.ItemNo.Contains(i)); |
|||
else |
|||
q = q.Where(p => p.LineID.Equals(l)); |
|||
} |
|||
|
|||
var standardWorkTime = await q.ToListAsync(); |
|||
|
|||
if (standardWorkTime == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return standardWorkTime; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// WHS005
|
|||
/// </summary>
|
|||
/// <param name="u"></param>
|
|||
/// <param name="l"></param>
|
|||
/// <param name="i"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/StandardWorkTimes/5
|
|||
[HttpGet("WHS005/{u}/{l}/{i}")] |
|||
public async Task<ActionResult<IEnumerable<StandardWorkTime>>> GetStandardWorkTimeByQuery005(string u, string l, string i) |
|||
{ |
|||
IQueryable<StandardWorkTime> q = _context.StandardWorkTimes; |
|||
|
|||
var strA = l.Split(","); |
|||
int[] array = new int[strA.Length]; |
|||
for (int t = 0; t < strA.Length; t++) { |
|||
array[t] = int.Parse(strA[t]); |
|||
} |
|||
|
|||
//LINQ的 IN:
|
|||
var queryResult = from p in q |
|||
where (array).Contains(p.LineID) |
|||
select p; |
|||
|
|||
if(u!="Null") |
|||
queryResult = queryResult.Where(p => p.UnitNo.Equals(u)); |
|||
if(i!="Null") |
|||
queryResult = queryResult.Where(p => p.LineID.Equals(l)); |
|||
|
|||
var standardWorkTime = await q.ToListAsync(); |
|||
|
|||
if (standardWorkTime == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return standardWorkTime; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="standardWorkTime"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/StandardWorkTimes/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<StandardWorkTime>> PutStandardWorkTime(int id, [FromBody] StandardWorkTime standardWorkTime) |
|||
{ |
|||
|
|||
ResultModel<StandardWorkTime> result = new ResultModel<StandardWorkTime>(); |
|||
if (id != standardWorkTime.StandardID) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號錯誤"; |
|||
return result; |
|||
} |
|||
|
|||
_context.Entry(standardWorkTime).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!StandardWorkTimeExists(id)) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號不存在"; |
|||
return result; |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增资料
|
|||
/// </summary>
|
|||
/// <param name="standardWorkTime"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/StandardWorkTimes
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ResultModel<StandardWorkTime>> PostStandardWorkTime(StandardWorkTime standardWorkTime) |
|||
{ |
|||
ResultModel<StandardWorkTime> result = new ResultModel<StandardWorkTime>(); |
|||
Helper helper = new Helper(_context); |
|||
standardWorkTime.StandardID = helper.GetIDKey("STANDARD_WORKTIME_ID").Result; |
|||
var sid = standardWorkTime.StandardID; |
|||
_context.StandardWorkTimes.Add(standardWorkTime); |
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateException) |
|||
{ |
|||
throw; |
|||
} |
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
|
|||
|
|||
|
|||
// return CreatedAtAction("GetStandardWorkTime", new { id = sid }, standardWorkTime);
|
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/StandardWorkTimes/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ResultModel<StandardWorkTime>> DeleteStandardWorkTime(int id) |
|||
{ |
|||
ResultModel<StandardWorkTime> result = new ResultModel<StandardWorkTime>(); |
|||
|
|||
var standardWorkTime = await _context.StandardWorkTimes.FindAsync(id); |
|||
if (standardWorkTime == null) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號不存在"; |
|||
return result; |
|||
} |
|||
|
|||
_context.StandardWorkTimes.Remove(standardWorkTime); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
//var standardWorkTime = await _context.StandardWorkTimes.Where(p => p.StandardID == id).FirstOrDefaultAsync();
|
|||
//if (standardWorkTime == null)
|
|||
//{
|
|||
// return NotFound();
|
|||
//}
|
|||
//
|
|||
//_context.StandardWorkTimes.Remove(standardWorkTime);
|
|||
//await _context.SaveChangesAsync();
|
|||
//
|
|||
//return standardWorkTime;
|
|||
} |
|||
|
|||
private bool StandardWorkTimeExists(int id) |
|||
{ |
|||
return _context.StandardWorkTimes.Any(e => e.StandardID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,237 @@ |
|||
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 SupportUsersController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public SupportUsersController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/SupportUsers
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<SupportUser>>> GetSupportUser() |
|||
{ |
|||
IQueryable<SupportUser> q = _context.SupportUsers; |
|||
|
|||
q = q.OrderBy(p => p.SupportID); |
|||
|
|||
var supportUser = await q.ToListAsync(); |
|||
|
|||
return supportUser; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/SupportUsers/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<SupportUser>>> GetSupportUser(int id) |
|||
{ |
|||
IQueryable<SupportUser> q = _context.SupportUsers; |
|||
q = q.Where(p => p.SupportID.Equals(id)); |
|||
|
|||
var supportUser = await q.ToListAsync(); |
|||
|
|||
if (supportUser == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return supportUser; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 援入援外綜合查詢
|
|||
/// </summary>
|
|||
/// <param name="f">廠別</param>
|
|||
/// <param name="type">援入/外</param>
|
|||
/// <param name="unit">製程單位</param>
|
|||
/// <param name="sd">開始時間</param>
|
|||
/// <param name="ed">結束時間</param>
|
|||
/// <returns></returns>
|
|||
// GET: api/StandardWorkTimes/5
|
|||
[HttpGet("Query/{f}/{type}/{unit}/{sd}/{ed}")] |
|||
public async Task<ActionResult<IEnumerable<SupportUser>>> GetSupportUserByQuery(string f, string type, string unit, string sd, string ed) |
|||
{ |
|||
IQueryable<SupportUser> q = _context.SupportUsers; |
|||
|
|||
//LINQ的 IN:
|
|||
//var queryResult = from p in q
|
|||
// where (array).Contains(p.LineID)
|
|||
// select p;
|
|||
|
|||
var sd2 = System.DateTime.Parse(sd); |
|||
var ed2 = System.DateTime.Parse(ed); |
|||
if (type == "i") |
|||
{ |
|||
q = q.Where(p => p.Werks.Equals(f) && p.UnitNoI.Equals(unit) && (DateTime.Compare(sd2, p.SupportDate) <=0 && DateTime.Compare(ed2, p.SupportDate)>=0) ); |
|||
} |
|||
else |
|||
q = q.Where(p => p.Werks.Equals(f) && p.UnitNoO.Equals(unit) && (DateTime.Compare(sd2, p.SupportDate) <= 0 && DateTime.Compare(ed2, p.SupportDate) >= 0)); |
|||
|
|||
var supportUser = await q.ToListAsync(); |
|||
|
|||
if (supportUser == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return supportUser; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 修改工時援入/外
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="supportUser"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/SupportUsers/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<SupportUser>> PutSupportUser(int id, [FromBody] SupportUser supportUser) |
|||
{ |
|||
|
|||
ResultModel<SupportUser> result = new ResultModel<SupportUser>(); |
|||
|
|||
if (id != supportUser.SupportID) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號錯誤"; |
|||
return result; |
|||
} |
|||
|
|||
_context.Entry(supportUser).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!SupportUserExists(id)) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號不存在"; |
|||
return result; |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增援入外资料
|
|||
/// </summary>
|
|||
/// <param name="supportUser"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/SupportUsers
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ResultModel<SupportUser>> PostSupportUser(SupportUser supportUser) |
|||
{ |
|||
ResultModel<SupportUser> result = new ResultModel<SupportUser>(); |
|||
Helper helper = new Helper(_context); |
|||
supportUser.SupportID = helper.GetIDKey("SUPPORT_ID").Result; |
|||
|
|||
_context.SupportUsers.Add(supportUser); |
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateException) |
|||
{ |
|||
throw; |
|||
} |
|||
|
|||
|
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
// return CreatedAtAction("GetSupportUser", new { id = supportUser.SupportID }, supportUser);
|
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 刪除援入外資料
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/SupportUsers/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ResultModel<SupportUser>> DeleteSupportUser(int id) |
|||
{ |
|||
|
|||
|
|||
ResultModel<SupportUser> result = new ResultModel<SupportUser>(); |
|||
|
|||
var supportUser = await _context.SupportUsers.FindAsync(id); |
|||
if (supportUser == null) |
|||
{ |
|||
result.Success = false; |
|||
result.Msg = "序號不存在"; |
|||
return result; |
|||
} |
|||
|
|||
_context.SupportUsers.Remove(supportUser); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
result.Success = true; |
|||
result.Msg = "OK"; |
|||
return result; |
|||
//var supportUser = await _context.SupportUsers.Where(p => p.SupportID == id).FirstOrDefaultAsync();
|
|||
//if (supportUser == null)
|
|||
//{
|
|||
// return NotFound();
|
|||
//}
|
|||
|
|||
//_context.SupportUsers.Remove(supportUser);
|
|||
//await _context.SaveChangesAsync();
|
|||
|
|||
//return supportUser;
|
|||
} |
|||
|
|||
private bool SupportUserExists(int id) |
|||
{ |
|||
return _context.SupportUsers.Any(e => e.SupportID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,167 @@ |
|||
|
|||
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; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Controllers.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工作群組維護
|
|||
/// </summary>
|
|||
[Route("api/[controller]")]
|
|||
[ApiController] |
|||
public class WorkClassesController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public WorkClassesController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/WorkClasses
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<WorkClass>>> GetWorkClasses() |
|||
{ |
|||
IQueryable<WorkClass> q = _context.WorkClasses; |
|||
|
|||
q = q.OrderBy(p => p.ClassID); |
|||
|
|||
var workClass = await q.ToListAsync(); |
|||
|
|||
foreach (var data in workClass) |
|||
{ |
|||
data.Group = _context.WorkGroups.Find(data.GroupID); |
|||
} |
|||
|
|||
return workClass; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/WorkClasses/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<WorkClass>>> GetWorkClasses(int id) |
|||
{ |
|||
IQueryable<WorkClass> q = _context.WorkClasses; |
|||
q = q.Where(p => p.ClassID.Equals(id)); |
|||
|
|||
var workClass = await q.ToListAsync(); |
|||
|
|||
foreach (var data in workClass) |
|||
{ |
|||
data.Group = _context.WorkGroups.Find(data.GroupID); |
|||
} |
|||
|
|||
|
|||
if (workClass == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return workClass; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="workClass"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/WorkClasses/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<ActionResult<WorkClass>> PutWorkClass(int id, [FromBody] WorkClass workClass) |
|||
{ |
|||
if (id != workClass.ClassID) |
|||
{ |
|||
return BadRequest(); |
|||
} |
|||
|
|||
_context.Entry(workClass).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!WorkClassExists(id)) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
return workClass; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增资料
|
|||
/// </summary>
|
|||
/// <param name="workClass"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/WorkClasses
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ActionResult<WorkClass>> PostWorkClass(WorkClass workClass) |
|||
{ |
|||
Helper helper = new Helper(_context); |
|||
workClass.ClassID = helper.GetIDKey("WORKCLASS_ID").Result; |
|||
|
|||
_context.WorkClasses.Add(workClass); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return CreatedAtAction("GetWorkClasses", new { id = workClass.ClassID }, workClass); |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/WorkClasses/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ActionResult<WorkClass>> DeleteWorkClass(int id) |
|||
{ |
|||
var workClass = await _context.WorkClasses.Where(p => p.ClassID == id).FirstOrDefaultAsync(); |
|||
if (workClass == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
_context.WorkClasses.Remove(workClass); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return workClass; |
|||
} |
|||
|
|||
private bool WorkClassExists(int id) |
|||
{ |
|||
return _context.WorkClasses.Any(e => e.ClassID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,155 @@ |
|||
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; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Controllers.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工作群組維護
|
|||
/// </summary>
|
|||
[Route("api/[controller]")]
|
|||
[ApiController] |
|||
public class WorkGroupsController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public WorkGroupsController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/WorkGroups
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<WorkGroup>>> GetWorkGroup() |
|||
{ |
|||
IQueryable<WorkGroup> q = _context.WorkGroups; |
|||
|
|||
q = q.OrderBy(p => p.GroupID); |
|||
|
|||
var workGroup = await q.ToListAsync(); |
|||
|
|||
return workGroup; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/WorkGroups/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<WorkGroup>>> GetWorkGroup(int id) |
|||
{ |
|||
IQueryable<WorkGroup> q = _context.WorkGroups; |
|||
q = q.Where(p => p.GroupID.Equals(id)); |
|||
|
|||
var workGroup = await q.ToListAsync(); |
|||
|
|||
if (workGroup == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return workGroup; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="workGroup"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/WorkGroups/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<ActionResult<WorkGroup>> PutWorkGroup(int id, [FromBody] WorkGroup workGroup) |
|||
{ |
|||
if (id != workGroup.GroupID) |
|||
{ |
|||
return BadRequest(); |
|||
} |
|||
|
|||
_context.Entry(workGroup).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!WorkGroupExists(id)) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
return workGroup; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增资料
|
|||
/// </summary>
|
|||
/// <param name="workGroup"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/WorkGroups
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ActionResult<WorkGroup>> PostWorkGroup(WorkGroup workGroup) |
|||
{ |
|||
Helper helper = new Helper(_context); |
|||
workGroup.GroupID = helper.GetIDKey("WORKGROUP_ID").Result; |
|||
|
|||
_context.WorkGroups.Add(workGroup); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return CreatedAtAction("GetWorkGroup", new { id = workGroup.GroupID }, workGroup); |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/WorkGroups/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ActionResult<WorkGroup>> DeleteWorkGroup(int id) |
|||
{ |
|||
var workGroup = await _context.WorkGroups.Where(p => p.GroupID == id).FirstOrDefaultAsync(); |
|||
if (workGroup == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
_context.WorkGroups.Remove(workGroup); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return workGroup; |
|||
} |
|||
|
|||
private bool WorkGroupExists(int id) |
|||
{ |
|||
return _context.WorkGroups.Any(e => e.GroupID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,155 @@ |
|||
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; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Controllers.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工作群組維護
|
|||
/// </summary>
|
|||
[Route("api/[controller]")]
|
|||
[ApiController] |
|||
public class WorkManPowersController : ControllerBase |
|||
{ |
|||
private readonly AMESContext _context; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="context"></param>
|
|||
public WorkManPowersController(AMESContext context) |
|||
{ |
|||
_context = context; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
// GET: api/WorkManPowers
|
|||
[HttpGet] |
|||
public async Task<ActionResult<IEnumerable<WorkManPower>>> GetWorkManPower() |
|||
{ |
|||
IQueryable<WorkManPower> q = _context.WorkManPowers; |
|||
|
|||
q = q.OrderBy(p => p.PowerID); |
|||
|
|||
var workManPower = await q.ToListAsync(); |
|||
|
|||
return workManPower; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// GET: api/WorkManPowers/5
|
|||
[HttpGet("{id}")] |
|||
public async Task<ActionResult<IEnumerable<WorkManPower>>> GetWorkManPower(string id) |
|||
{ |
|||
IQueryable<WorkManPower> q = _context.WorkManPowers; |
|||
q = q.Where(p => p.PowerID.Equals(id)); |
|||
|
|||
var workManPower = await q.ToListAsync(); |
|||
|
|||
if (workManPower == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
return workManPower; |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="workManPower"></param>
|
|||
/// <returns></returns>
|
|||
// PUT: api/WorkManPowers/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<ActionResult<WorkManPower>> PutWorkManPower(int id, [FromBody] WorkManPower workManPower) |
|||
{ |
|||
if (id != workManPower.PowerID) |
|||
{ |
|||
return BadRequest(); |
|||
} |
|||
|
|||
_context.Entry(workManPower).State = EntityState.Modified; |
|||
|
|||
try |
|||
{ |
|||
await _context.SaveChangesAsync(); |
|||
} |
|||
catch (DbUpdateConcurrencyException) |
|||
{ |
|||
if (!WorkManPowerExists(id)) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
else |
|||
{ |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
return workManPower; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增资料
|
|||
/// </summary>
|
|||
/// <param name="workManPower"></param>
|
|||
/// <returns></returns>
|
|||
// POST: api/WorkManPowers
|
|||
// 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.
|
|||
[HttpPost] |
|||
public async Task<ActionResult<WorkManPower>> PostWorkManPower(WorkManPower workManPower) |
|||
{ |
|||
Helper helper = new Helper(_context); |
|||
workManPower.PowerID = helper.GetIDKey("STANDARD_WORKTIME_ID").Result; |
|||
|
|||
_context.WorkManPowers.Add(workManPower); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return CreatedAtAction("GetWorkManPower", new { id = workManPower.PowerID }, workManPower); |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
// DELETE: api/WorkManPowers/5
|
|||
[HttpDelete("{id}")] |
|||
public async Task<ActionResult<WorkManPower>> DeleteWorkManPower(int id) |
|||
{ |
|||
var workManPower = await _context.WorkManPowers.Where(p => p.PowerID == id).FirstOrDefaultAsync(); |
|||
if (workManPower == null) |
|||
{ |
|||
return NotFound(); |
|||
} |
|||
|
|||
_context.WorkManPowers.Remove(workManPower); |
|||
await _context.SaveChangesAsync(); |
|||
|
|||
return workManPower; |
|||
} |
|||
|
|||
private bool WorkManPowerExists(int id) |
|||
{ |
|||
return _context.WorkManPowers.Any(e => e.PowerID == id); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,125 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 條碼變更資料表
|
|||
/// </summary>
|
|||
[Table("BARCODE_INFO", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public class BarcodeInfo |
|||
{ |
|||
/// <summary>
|
|||
/// 條碼ID
|
|||
/// </summary>
|
|||
[Column("BARCODE_ID")] |
|||
[DataMember] |
|||
[Display(Name = "條碼ID")] |
|||
[Key] |
|||
public int BarcodeID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 條碼序號
|
|||
/// </summary>
|
|||
[Column("BARCODE_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "條碼序號")] |
|||
public string BarcodeNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("STATUS_NO")] |
|||
[DataMember] |
|||
public string StatusNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("EXTRA_BARCODE_NO")] |
|||
[DataMember] |
|||
public string ExtraBarcodeNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("LOCATION_ID")] |
|||
[DataMember] |
|||
public string LocationID { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("RULE_STATION_ID")] |
|||
[DataMember] |
|||
public string RuleStationID { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("RULE_STATUS")] |
|||
[DataMember] |
|||
public string RuleStatus { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("WIP_ID")] |
|||
[DataMember] |
|||
public string WipID { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("BOX_NO")] |
|||
[DataMember] |
|||
public string BoxNo { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("SYSTYPE")] |
|||
[DataMember] |
|||
public string SysType { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[Column("STATUS_ID")] |
|||
[DataMember] |
|||
public string StatusID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立者
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "建立者")] |
|||
public decimal CreateUserID { get; set; } = -1; |
|||
|
|||
/// <summary>
|
|||
/// 建立時間
|
|||
/// </summary>
|
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "建立時間")] |
|||
public DateTime CreateDate { get; set; } = DateTime.Now; |
|||
|
|||
/// <summary>
|
|||
/// 修改時間
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "修改時間")] |
|||
public DateTime UpdateDate { get; set; } = DateTime.Now; |
|||
|
|||
} |
|||
} |
@ -0,0 +1,119 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 條碼组件資料檔
|
|||
/// </summary>
|
|||
[Table("BARCODE_ITEM", Schema = "JHAMES")] |
|||
public class BarcodeItem |
|||
{ |
|||
/// <summary>
|
|||
/// 條碼組件ID
|
|||
/// </summary>
|
|||
[Column("BARCODE_ITEM_ID")] |
|||
[DataMember] |
|||
[Display(Name = "條碼組件ID")] |
|||
[Key] |
|||
public int BarcodeItemID { get; set; } |
|||
/// <summary>
|
|||
/// 内部條碼ID
|
|||
/// </summary>
|
|||
[Column("BARCODE_ID")] |
|||
[DataMember] |
|||
[Display(Name = "内部條碼ID")] |
|||
//[Key]
|
|||
public int BarcodeID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工單ID
|
|||
/// </summary>
|
|||
[Column("WIP_ID")] |
|||
[DataMember] |
|||
public int WipID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 流程站别ID
|
|||
/// </summary>
|
|||
[Column("RULE_STATION_ID")] |
|||
[DataMember] |
|||
[Display(Name = "站别")] |
|||
public int RuleStationID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 组件代碼
|
|||
/// </summary>
|
|||
[Column("ITEM_NO")] |
|||
[DataMember] |
|||
[Display(Name = "组件代碼")] |
|||
public string ItemNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 组件條碼
|
|||
/// </summary>
|
|||
[Column("PART_NO")] |
|||
[DataMember] |
|||
[Display(Name = "组件條碼")] |
|||
public string PartNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 系统狀態
|
|||
/// </summary>
|
|||
[Column("SYSTYPE")] |
|||
[DataMember] |
|||
public string SysType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 组件料號
|
|||
/// </summary>
|
|||
[Column("KP_ITEM_NO")] |
|||
[DataMember] |
|||
[Display(Name = "组件料號")] |
|||
public string KpItemNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立者
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "建立者")] |
|||
public int CreateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立時間
|
|||
/// </summary>
|
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "建立時間")] |
|||
public DateTime CreateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改時間
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "修改時間")] |
|||
public DateTime UpdateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 條碼资料
|
|||
/// </summary>
|
|||
public virtual BarcodeInfo B { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 組件资料
|
|||
/// </summary>
|
|||
public virtual Item I { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 站別资料
|
|||
/// </summary>
|
|||
public virtual AMESCoreStudio.WebApi.Models.BAS.RuleStation S { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,275 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 異常工時資料
|
|||
/// </summary>
|
|||
[Table("EXCEPTION_WORKTIME", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public class ExceptionWorktime |
|||
{ |
|||
/// <summary>
|
|||
/// 異常工時ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("EXCEPTION_ID")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[DataMember] |
|||
public decimal ExceptionID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 廠別
|
|||
/// </summary>
|
|||
[Column("FACTORY_NO")] |
|||
[DataMember] |
|||
[Display(Name = "廠別")] |
|||
public string FactoryNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 制程代碼
|
|||
/// </summary>
|
|||
[Column("UNIT_NO")] |
|||
[DataMember] |
|||
[Display(Name = "制程代碼")] |
|||
public string UnitNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 線別
|
|||
/// </summary>
|
|||
[Column("LINE_ID")] |
|||
[DataMember] |
|||
[Display(Name = "線別")] |
|||
public int LineID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 異常日期
|
|||
/// </summary>
|
|||
[Column("EXCEPTION_DATE")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "異常日期")] |
|||
public DateTime ExceptionDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 異常班別
|
|||
/// </summary>
|
|||
[Column("CLASS_NO")] |
|||
[DataMember] |
|||
[Display(Name = "異常班別")] |
|||
public string ClassNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 異常代碼
|
|||
/// </summary>
|
|||
[Column("EXCEPTION_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "異常代碼")] |
|||
public string ExceptionNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 歸屬工單
|
|||
/// </summary>
|
|||
[Column("WIP_NO")] |
|||
[Display(Name = "歸屬工單")] |
|||
public string WipNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 機種
|
|||
/// </summary>
|
|||
[Column("MODEL_NO")] |
|||
[Display(Name = "機種")] |
|||
public string ModelNo { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 異常工時(Min)
|
|||
/// </summary>
|
|||
[Column("TIME")] |
|||
[DataMember] |
|||
[Display(Name = "常工時(Min)")] |
|||
public int Time { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 歸屬部門
|
|||
/// </summary>
|
|||
[Column("DEPT_ID")] |
|||
[DataMember] |
|||
[Display(Name = "歸屬部門")] |
|||
public int DeptID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 異常備註
|
|||
/// </summary>
|
|||
[Column("MEMO")] |
|||
public string Memo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 站別ID
|
|||
/// </summary>
|
|||
[Column("STATION_ID")] |
|||
[DataMember] |
|||
[Display(Name = "站別")] |
|||
public int StationID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// T2站點姓名
|
|||
/// </summary>
|
|||
[Column("T2_USER_NAME")] |
|||
[Display(Name = "T2站點姓名")] |
|||
public string T2UserName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 起始時間
|
|||
/// </summary>
|
|||
[Column("START_TIME")] |
|||
[Display(Name = "起始時間")] |
|||
public DateTime StartTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 結束時間
|
|||
/// </summary>
|
|||
[Column("END_TIME")] |
|||
[Display(Name = "結束時間")] |
|||
public DateTime EndTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定單位
|
|||
/// </summary>
|
|||
[Column("DECIDE_DEPT")] |
|||
[Display(Name = "判定單位")] |
|||
public string DecideDept { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定負責人
|
|||
/// </summary>
|
|||
[Column("DECIDE_USER")] |
|||
[Display(Name = "判定負責人")] |
|||
public string DecideUser{ get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 責任單位(回覆)
|
|||
/// </summary>
|
|||
[Column("DUTY_DEPT")] |
|||
[Display(Name = "責任單位(回覆)")] |
|||
public string DutyDept { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 回覆: 回覆對策
|
|||
/// </summary>
|
|||
[Column("MEASURE")] |
|||
[Display(Name = "回覆: 回覆對策")] |
|||
public string Measure { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 回覆: 異常人數
|
|||
/// </summary>
|
|||
[Column("PERSON_NUM")] |
|||
[DataMember] |
|||
[Display(Name = "回覆: 異常人數")] |
|||
public int PersonNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 回覆: 判定描述
|
|||
/// </summary>
|
|||
[Column("REASON_NAME_CH")] |
|||
[Display(Name = "回覆: 判定描述")] |
|||
public string PersonNameCh { get; set; } |
|||
|
|||
/// <summary>
|
|||
///回覆: 判定類別
|
|||
/// </summary>
|
|||
[Column("REASON_NO")] |
|||
[Display(Name = "回覆: 判定類別")] |
|||
public string PersonNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 回覆: 回覆日期
|
|||
/// </summary>
|
|||
[Column("MEASURE_DATE")] |
|||
[Display(Name = "回覆: 回覆日期")] |
|||
public DateTime MeasureDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 回覆: 回覆備註
|
|||
/// </summary>
|
|||
[Column("MEASURE_MEMO")] |
|||
[Display(Name = "回覆: 回覆備註")] |
|||
public DateTime MeasureMemo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定單位ID
|
|||
/// </summary>
|
|||
[Column("DECIDE_DEPT_ID")] |
|||
[Display(Name = "判定單位ID")] |
|||
public int DecidDeptID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定負責人ID
|
|||
/// </summary>
|
|||
[Column("DECIDE_USER_ID")] |
|||
public int DecidUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 責任單位ID
|
|||
/// </summary>
|
|||
[Column("DUTY_DEPT_ID")] |
|||
[Display(Name = "責任單位ID")] |
|||
public int DutyDeptID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 責任人ID
|
|||
/// </summary>
|
|||
[Column("DUTY_USER_ID")] |
|||
[Display(Name = "責任人ID")] |
|||
public int DutyUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 責任人工號
|
|||
/// </summary>
|
|||
[Column("DUTY_USER")] |
|||
[Display(Name = "責任人工號")] |
|||
public string DutyUser { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立者
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "建立者")] |
|||
public decimal CreateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立日期
|
|||
/// </summary>
|
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "建立日期")] |
|||
public DateTime CreateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改者
|
|||
/// </summary>
|
|||
[Column("UPDATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "修改者")] |
|||
public decimal UpdateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改日期
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "修改日期")] |
|||
public DateTime UpdateDate { get; set; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,229 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 無效工時在線收集資料檔
|
|||
/// </summary>
|
|||
[Table("EXCEPTION_WORKTIME_ONLINE", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public class ExceptionWorktimeOline |
|||
{ |
|||
/// <summary>
|
|||
/// 異常工時ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("ONLINE_ID")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[DataMember] |
|||
public decimal OlineID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 廠別
|
|||
/// </summary>
|
|||
[Column("FACTORY_NO")] |
|||
[DataMember] |
|||
[Display(Name = "廠別")] |
|||
public string FactoryNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 制程代碼
|
|||
/// </summary>
|
|||
[Column("UNIT_NO")] |
|||
[DataMember] |
|||
[Display(Name = "制程代碼")] |
|||
public string UnitNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 線別
|
|||
/// </summary>
|
|||
[Column("LINE_ID")] |
|||
[DataMember] |
|||
[Display(Name = "線別")] |
|||
public int LineID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 站別ID
|
|||
/// </summary>
|
|||
[Column("STATION_ID")] |
|||
[DataMember] |
|||
[Display(Name = "站別")] |
|||
public int StationID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 收集人員工號
|
|||
/// </summary>
|
|||
[Column("T2_USER_NAME")] |
|||
[Display(Name = "收集人員工號")] |
|||
public string T2UserName { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 異常日期
|
|||
/// </summary>
|
|||
[Column("EXCEPTION_DATE")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "異常發生日期")] |
|||
public DateTime ExceptionDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 異常班別
|
|||
/// </summary>
|
|||
[Column("CLASS_NO")] |
|||
[DataMember] |
|||
[Display(Name = "班別")] |
|||
public string ClassNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 異常代碼
|
|||
/// </summary>
|
|||
[Column("EXCEPTION_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "異常代碼")] |
|||
public string ExceptionNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工單號碼
|
|||
/// </summary>
|
|||
[Column("WIP_NO")] |
|||
[Display(Name = "工單號碼")] |
|||
public string WipNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 機種
|
|||
/// </summary>
|
|||
[Column("MODEL_NO")] |
|||
[Display(Name = "機種")] |
|||
public string ModelNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 起始時間
|
|||
/// </summary>
|
|||
[Column("START_TIME")] |
|||
[Display(Name = "起始時間")] |
|||
public DateTime StartTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 結束時間
|
|||
/// </summary>
|
|||
[Column("END_TIME")] |
|||
[Display(Name = "結束時間")] |
|||
public DateTime EndTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 異常人數
|
|||
/// </summary>
|
|||
[Column("PERSON_NUM")] |
|||
[DataMember] |
|||
[Display(Name = "異常人數")] |
|||
public int PersonNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 異常工時(Min)
|
|||
/// </summary>
|
|||
[Column("TIME")] |
|||
[DataMember] |
|||
[Display(Name = "常工時(Min)")] |
|||
public int Time { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 歸屬部門
|
|||
/// </summary>
|
|||
[Column("DEPT_ID")] |
|||
[DataMember] |
|||
[Display(Name = "歸屬部門")] |
|||
public int DeptID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定單位
|
|||
/// </summary>
|
|||
[Column("DECIDE_DEPT")] |
|||
[Display(Name = "判定單位")] |
|||
public string DecideDept { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定負責人
|
|||
/// </summary>
|
|||
[Column("DECIDE_USER")] |
|||
[Display(Name = "判定負責人")] |
|||
public string DecideUser{ get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定單位ID
|
|||
/// </summary>
|
|||
[Column("DECIDE_DEPT_ID")] |
|||
[Display(Name = "判定單位ID")] |
|||
public int DecidDeptID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定負責人ID
|
|||
/// </summary>
|
|||
[Column("DECIDE_USER_ID")] |
|||
public int DecidUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定類別
|
|||
/// </summary>
|
|||
[Column("REASON_NO")] |
|||
[Display(Name = "判定類別")] |
|||
public string PersonNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 判定描述
|
|||
/// </summary>
|
|||
[Column("REASON_NAME_CH")] |
|||
[Display(Name = "判定描述")] |
|||
public string PersonNameCh { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 無效工時收集標誌
|
|||
/// </summary>
|
|||
[Column("TYPE_FLAG")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "無效工時收集標誌")] |
|||
public int TypeFlag { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立者
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "建立者")] |
|||
public decimal CreateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立日期
|
|||
/// </summary>
|
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "建立日期")] |
|||
public DateTime CreateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改者
|
|||
/// </summary>
|
|||
[Column("UPDATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "修改者")] |
|||
public decimal UpdateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改日期
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "修改日期")] |
|||
public DateTime UpdateDate { get; set; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,45 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 組件資料檔
|
|||
/// </summary>
|
|||
[Table("ITEMS", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public class Item |
|||
{ |
|||
/// <summary>
|
|||
/// 组件代碼
|
|||
/// </summary>
|
|||
[Column("ITEM_NO")] |
|||
[DataMember] |
|||
[Key] |
|||
public string ItemNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 组件名稱
|
|||
/// </summary>
|
|||
[Column("ITEM_NAME")] |
|||
[DataMember] |
|||
public string ItemName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 組件類別
|
|||
/// </summary>
|
|||
[Column("ITEM_TYPE")] |
|||
[DataMember] |
|||
public string ItemType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 組件區間管控
|
|||
/// </summary>
|
|||
[Column("SN_INTERVAL")] |
|||
[DataMember] |
|||
public string SnInerval { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,146 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 標準工時资料表
|
|||
/// </summary>
|
|||
[Table("STANDARD_WORKTIME", Schema = "JHAMES")] |
|||
public class StandardWorkTime |
|||
{ |
|||
/// <summary>
|
|||
/// 標準工時ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("STANDARD_ID")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[DataMember] |
|||
public int StandardID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 生產單位
|
|||
/// </summary>
|
|||
[Column("UNIT_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "生產單位")] |
|||
public string UnitNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 線別ID
|
|||
/// </summary>
|
|||
[Column("LINE_ID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "線別")] |
|||
public int LineID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 料號
|
|||
/// </summary>
|
|||
[Column("ITEM_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "料號")] |
|||
public string ItemNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 作業人數
|
|||
/// </summary>
|
|||
[Column("OP_CNT")] |
|||
[DataMember] |
|||
[Display(Name = "作業人數")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
public int OPCNT { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 首件產出時間
|
|||
/// </summary>
|
|||
[Column("FIRST_TIME")] |
|||
[DataMember] |
|||
[Display(Name = "首件產出時間(分)")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
public decimal FirstTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// CT
|
|||
/// </summary>
|
|||
[Column("TOTAL_CT")] |
|||
[DataMember] |
|||
[Display(Name = "C/T(分)")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
public decimal TotalCT { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 節拍時間
|
|||
/// </summary>
|
|||
[Column("CT")] |
|||
[DataMember] |
|||
[Display(Name = "節拍時間(分)")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
public decimal CT { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 操機數
|
|||
/// </summary>
|
|||
[Column("MACHINE_CNT")] |
|||
[DataMember] |
|||
[Display(Name = "操機數(台/人)")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
public decimal MachineCT { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 正背面
|
|||
/// </summary>
|
|||
[Column("SIDE")] |
|||
[DataMember] |
|||
[Display(Name = "正背面")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
public string Side { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 節拍時站別ID間
|
|||
/// </summary>
|
|||
[Column("STATION_ID")] |
|||
[DataMember] |
|||
[Display(Name = "站別")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
public int StationID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立者
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[DataMember] |
|||
[Display(Name = "建立者")] |
|||
public int CreateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立日期
|
|||
/// </summary>
|
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "建立日期")] |
|||
public DateTime CreateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改者
|
|||
/// </summary>
|
|||
[Column("UPDATE_USERID")] |
|||
[Display(Name = "修改者")] |
|||
public int UpdateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改日期
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[Display(Name = "修改日期")] |
|||
public DateTime UpdateDate { get; set; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,95 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 重工標準工時資料
|
|||
/// </summary>
|
|||
[Table("STANDARD_WORKTIME_REWORK", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public class StandardWorkTimeRework |
|||
{ |
|||
/// <summary>
|
|||
/// 標準工時ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("REWORK_STANDARD_ID")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[DataMember] |
|||
public int ReworkStandardID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工單號碼
|
|||
/// </summary>
|
|||
[Column("WIP_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "工單號碼")] |
|||
public string WipNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 料號
|
|||
/// </summary>
|
|||
[Column("ITEM_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "料號")] |
|||
public string ItemNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 站別ID
|
|||
/// </summary>
|
|||
[Column("STATION_ID")] |
|||
[DataMember] |
|||
[Display(Name = "站別")] |
|||
public int StationID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// CT
|
|||
/// </summary>
|
|||
[Column("TOTAL_CT")] |
|||
[DataMember] |
|||
[Display(Name = "CT")] |
|||
public int TotalCT { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立者
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "建立者")] |
|||
public decimal CreateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立日期
|
|||
/// </summary>
|
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "建立日期")] |
|||
public DateTime CreateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改者
|
|||
/// </summary>
|
|||
[Column("UPDATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "修改者")] |
|||
public decimal UpdateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改日期
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "修改日期")] |
|||
public DateTime UpdateDate { get; set; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,176 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 援入援外資料檔
|
|||
/// </summary>
|
|||
[Table("SUPPORT_USER", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public class SupportUser |
|||
{ |
|||
/// <summary>
|
|||
/// 援入援出ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("SUPPORT_ID")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[DataMember] |
|||
public int SupportID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 援入援出日期
|
|||
/// </summary>
|
|||
[Column("SUPPORT_DATE")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "援入援出日期")] |
|||
public DateTime SupportDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 員工工號
|
|||
/// </summary>
|
|||
[Column("USER_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "員工工號")] |
|||
public string UserNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 員工名稱
|
|||
/// </summary>
|
|||
[Column("USER_NAME")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "員工名稱")] |
|||
public string UserNane { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 援入部門
|
|||
/// </summary>
|
|||
[Column("UNIT_NO_I")] |
|||
[DataMember] |
|||
[Display(Name = "援入部門")] |
|||
public string UnitNoI { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 援入其他部門
|
|||
/// </summary>
|
|||
[Column("OTHER_DEPT_I")] |
|||
[DataMember] |
|||
[Display(Name = "援入其他部門")] |
|||
|
|||
public string OtherDeptI { get; set; } |
|||
/// <summary>
|
|||
/// 援出部門
|
|||
/// </summary>
|
|||
[Column("UNIT_NO_O")] |
|||
[DataMember] |
|||
[Display(Name = "援出部門")] |
|||
public string UnitNoO { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 援出其他部門
|
|||
/// </summary>
|
|||
[Column("OTHER_DEPT_O")] |
|||
[DataMember] |
|||
[Display(Name = "援出其他部門")] |
|||
public string OtherDeptO { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 支援時數(分鐘)
|
|||
/// </summary>
|
|||
[Column("HOURS")] |
|||
[DataMember] |
|||
[Display(Name = "支援時數(分鐘)")] |
|||
public int Hours { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 援入線別
|
|||
/// </summary>
|
|||
[Column("LINE_ID_I")] |
|||
[DataMember] |
|||
[Display(Name = "援入線別")] |
|||
public int LineIDI { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 援入站別
|
|||
/// </summary>
|
|||
[Column("STATION_ID_I")] |
|||
[DataMember] |
|||
[Display(Name = "援入站別")] |
|||
public int StationIDI { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 援出線別
|
|||
/// </summary>
|
|||
[Column("LINE_ID_O")] |
|||
[DataMember] |
|||
[Display(Name = "援出線別")] |
|||
public int LineIDO { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 援出站別
|
|||
/// </summary>
|
|||
[Column("STATION_ID_O")] |
|||
[DataMember] |
|||
[Display(Name = "援出站別")] |
|||
public int StationIDO { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 備註
|
|||
/// </summary>
|
|||
[Column("MEMO")] |
|||
[DataMember] |
|||
[Display(Name = "備註")] |
|||
public string Memo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 廠別
|
|||
/// </summary>
|
|||
[Column("WERKS")] |
|||
[DataMember] |
|||
[Display(Name = "廠別")] |
|||
public string Werks { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 班別
|
|||
/// </summary>
|
|||
[Column("CLASS_NO")] |
|||
[DataMember] |
|||
[Display(Name = "班別")] |
|||
public string ClassNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立者
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[DataMember] |
|||
public int CreateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立日期
|
|||
/// </summary>
|
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
public DateTime CreateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改者
|
|||
/// </summary>
|
|||
[Column("UPDATE_USERID")] |
|||
public int UpdateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改日期
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
public DateTime UpdateDate { get; set; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,54 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工作類別資料檔
|
|||
/// </summary>
|
|||
[Table("WORK_CLASS", Schema = "JHAMES")] |
|||
public class WorkClass |
|||
{ |
|||
/// <summary>
|
|||
/// 工作類別ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("CLASS_ID")] |
|||
[DataMember] |
|||
public int ClassID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工作群組ID
|
|||
/// </summary>
|
|||
[Column("GROUP_ID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
|
|||
public int GroupID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工作類別名稱
|
|||
/// </summary>
|
|||
[Column("CLASS_NAME")] |
|||
[DataMember] |
|||
[Display(Name = "工作類別名稱")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[StringLength(50, ErrorMessage = "{0},不能大于{1}")] |
|||
public string ClassName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 順序
|
|||
/// </summary>
|
|||
[Column("SEQ")] |
|||
public int SEQ { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 條碼资料
|
|||
/// </summary>
|
|||
public virtual WorkGroup Group { get; set; } |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,44 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 工作群組資料檔
|
|||
/// </summary>
|
|||
[Table("WORK_GROUP", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public class WorkGroup |
|||
{ |
|||
/// <summary>
|
|||
/// 工作群組ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("GROUP_ID")] |
|||
[DataMember] |
|||
public int GroupID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工作群組名稱
|
|||
/// </summary>
|
|||
[Column("GROUP_NAME")] |
|||
[DataMember] |
|||
[Display(Name = "工作群組名稱")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[StringLength(5, ErrorMessage = "{0},不能大于{1}")] |
|||
public string GroupName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 有效工時
|
|||
/// </summary>
|
|||
[Column("GROUP_FLAG")] |
|||
[DataMember] |
|||
[Display(Name = "有效工時")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
public string GroupFlag { get; set; } |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,184 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.AMES |
|||
{ |
|||
/// <summary>
|
|||
/// 每日出勤資料檔
|
|||
/// </summary>
|
|||
[Table("WORK_MANPOWER", Schema = "JHAMES")] |
|||
[DataContract] |
|||
public class WorkManPower |
|||
{ |
|||
/// <summary>
|
|||
/// 每日出勤ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("POWER_ID")] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[DataMember] |
|||
public decimal PowerID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 出勤日期
|
|||
/// </summary>
|
|||
[Column("POWER_DATE")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "出勤日期")] |
|||
public DateTime PowerDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 員工工號
|
|||
/// </summary>
|
|||
[Column("USER_NO")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "員工工號")] |
|||
public string UserNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 員工名稱
|
|||
/// </summary>
|
|||
[Column("USER_NAME")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "員工名稱")] |
|||
public string UserNane { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 制程代碼
|
|||
/// </summary>
|
|||
[Column("UNIT_NO")] |
|||
[DataMember] |
|||
[Display(Name = "制程代碼")] |
|||
public string UnitNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工作類別ID
|
|||
/// </summary>
|
|||
[Column("CLASS_ID")] |
|||
[DataMember] |
|||
[Display(Name = "工作類別ID")] |
|||
public int ClassID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 正常加班(H)
|
|||
/// </summary>
|
|||
[Column("OVER_H")] |
|||
[DataMember] |
|||
[Display(Name = "正常加班(H)")] |
|||
public decimal OvarH { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 預加/補班(H)
|
|||
/// </summary>
|
|||
[Column("PREPAR_REST_H")] |
|||
[DataMember] |
|||
[Display(Name = "預加/補班(H)")] |
|||
public decimal PreparRestH { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 實際調休(H)
|
|||
/// </summary>
|
|||
[Column("FACT_REST_H")] |
|||
[DataMember] |
|||
[Display(Name = "實際調休(H)")] |
|||
public decimal FactRestH { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 請假(H)
|
|||
/// </summary>
|
|||
[Column("LEAVE_H")] |
|||
[DataMember] |
|||
[Display(Name = "請假(H)")] |
|||
public decimal LeaveH { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 線別
|
|||
/// </summary>
|
|||
[Column("LINE_ID")] |
|||
[DataMember] |
|||
[Display(Name = "線別")] |
|||
public int LineID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 站別ID
|
|||
/// </summary>
|
|||
[Column("STATION_ID")] |
|||
[DataMember] |
|||
[Display(Name = "站別")] |
|||
public int StationID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 休息時間(Min)
|
|||
/// </summary>
|
|||
[Column("BREAK_TIME")] |
|||
[DataMember] |
|||
[Display(Name = "休息時間(Min)")] |
|||
public int BreakTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 廠別
|
|||
/// </summary>
|
|||
[Column("WERKS")] |
|||
[DataMember] |
|||
[Display(Name = "廠別")] |
|||
public string Werks { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 實際出勤時數(H)
|
|||
/// </summary>
|
|||
[Column("FACT_WORK_H")] |
|||
[DataMember] |
|||
[Display(Name = "實際出勤時數(H)")] |
|||
public decimal FactWorkH { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 出勤班別
|
|||
/// </summary>
|
|||
[Column("CLASS_NO")] |
|||
[DataMember] |
|||
[Display(Name = "出勤班別")] |
|||
public string ClassNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立者
|
|||
/// </summary>
|
|||
[Column("CREATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "建立者")] |
|||
public decimal CreateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 建立日期
|
|||
/// </summary>
|
|||
[Column("CREATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "建立日期")] |
|||
public DateTime CreateDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改者
|
|||
/// </summary>
|
|||
[Column("UPDATE_USERID")] |
|||
[DataMember] |
|||
[Required(ErrorMessage = "{0},不能空白")] |
|||
[Display(Name = "修改者")] |
|||
public decimal UpdateUserID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 修改日期
|
|||
/// </summary>
|
|||
[Column("UPDATE_DATE")] |
|||
[DataMember] |
|||
[Display(Name = "修改日期")] |
|||
public DateTime UpdateDate { get; set; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Runtime.Serialization; |
|||
|
|||
namespace AMESCoreStudio.WebApi.Models.BAS |
|||
{ |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public class ListObj |
|||
{ |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public string name { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public string value { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public bool selected { get; set; } |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public bool disabled { get; set; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue