24 changed files with 921 additions and 201 deletions
@ -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: 'wipNO', |
||||
|
width: 200, |
||||
|
title: '工單號碼' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'lineID', |
||||
|
title: '線別' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'planQTY', |
||||
|
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.statusNo) { |
||||
|
hg.open('修改條碼狀態', '/PPS/PPS002U/' + obj.data.statusNo, 640,320); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//通过行tool删除,lay-event="del" |
||||
|
function del(obj) { |
||||
|
if (obj.data.statusNo) { |
||||
|
hg.confirm("條碼狀態:" + obj.data.statusDesc + ",确定要删除吗?", function () { |
||||
|
$.ajax({ |
||||
|
url: '/PPS/PPS002D', |
||||
|
data: { id: obj.data.statusNo }, |
||||
|
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('新增工單資料', '/PCS/PCS001', 800, 600); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
//基本数据表格 |
||||
|
var table = hg.table.datatable('test', '條碼狀態維護', '/PCS/GetWipInfo', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
</script> |
||||
|
} |
@ -0,0 +1,90 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.WipLock |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PCS010"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; } |
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PCS010Save" class="layui-form"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="LockType" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<select asp-for="LockType" asp-items="@ViewBag.GetLockTypeList" class=""></select> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="StationID" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<select asp-for="StationID" asp-items="@ViewBag.GetStationsList"></select> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="LockReasonType" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<select asp-for="LockReasonType" asp-items="@ViewBag.GetLockReasonTypeList"></select> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="WipNO" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="WipNO" class="layui-input" placeholder="請輸入工單/條碼" /> |
||||
|
<span asp-validation-for="WipNO" class="text-danger"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-inline"> |
||||
|
<label asp-for="LockReason" class="layui-form-label"></label> |
||||
|
<div class="layui-input-inline"> |
||||
|
<input asp-for="LockReason" class="layui-input" placeholder="請輸入鎖定原因" /> |
||||
|
<span asp-validation-for="LockReason" class="text-danger"></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="layui-form-item"> |
||||
|
<div class="layui-input-block"> |
||||
|
<input type="submit" value="保存" class="layui-btn" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
layui.use(['form'], function () { |
||||
|
form = layui.form; |
||||
|
}); |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
} |
||||
|
|
File diff suppressed because one or more lines are too long
@ -1,2 +1 @@ |
|||||
/** layui-v2.5.5 MIT License By https://www.layui.com */ |
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none} |
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} |
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 277 KiB After Width: | Height: | Size: 299 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,50 @@ |
|||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class WipBarcodeController : Controller |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public WipBarcodeController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增工單資料-條碼
|
||||
|
/// </summary>
|
||||
|
/// <param name="wipBarcode"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// POST: api/SystemInfoes
|
||||
|
// 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<WipBarcode>> PostWipBarcode([FromBody] WipBarcode wipBarcode) |
||||
|
{ |
||||
|
Helper helper = new Helper(_context); |
||||
|
wipBarcode.WipID = wipBarcode.WipID == 0 ? helper.GetIDKey("WIP_ID").Result : wipBarcode.WipID; |
||||
|
wipBarcode.CreateUserID = 0; |
||||
|
|
||||
|
_context.WipBarcodes.Add(wipBarcode); |
||||
|
await _context.SaveChangesAsync(); |
||||
|
|
||||
|
return CreatedAtAction("PostWipBarcode", new { id = wipBarcode.WipID }, wipBarcode); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class WipLockController : Controller |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public WipLockController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 工單鎖定資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<WipLock>>> GetWipLock() |
||||
|
{ |
||||
|
IQueryable<WipLock> q = _context.WipLocks; |
||||
|
q = q.OrderBy(p => p.WipNO); |
||||
|
var WipLock = await q.ToListAsync(); |
||||
|
return WipLock; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 工單鎖定資料 to WipNO
|
||||
|
/// </summary>
|
||||
|
/// <param name="WipNO">工單編號</param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/RolePrograms/5
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<WipLock>>> GetWipLock(string WipNO) |
||||
|
{ |
||||
|
IQueryable<WipLock> q = _context.WipLocks; |
||||
|
|
||||
|
q = q.Where(p => p.WipNO == WipNO); |
||||
|
|
||||
|
var WipLock = await q.ToListAsync(); |
||||
|
|
||||
|
if (WipLock == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return WipLock; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增工單鎖定資料檔
|
||||
|
/// </summary>
|
||||
|
/// <param name="wiplock"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost] |
||||
|
public async Task<ActionResult<WipLock>> PostWipLock([FromBody] WipLock wiplock) |
||||
|
{ |
||||
|
Helper helper = new Helper(_context); |
||||
|
wiplock.WipLockID = helper.GetIDKey("WIP_LOCK_ID").Result; |
||||
|
wiplock.UnLockUserID = 0; |
||||
|
|
||||
|
_context.WipLocks.Add(wiplock); |
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
return CreatedAtAction("GetWipLock", new { WipNO = wiplock.WipNO }, wiplock); |
||||
|
//return ;
|
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue