Browse Source

1. 鋼板量測維護調整

2. 設備基本數據維護新增有效期限欄位
3. 設備規格新增 採購編號
PTD
ray 2 years ago
parent
commit
861fe71f0e
  1. 8
      AMESCoreStudio.Web/Controllers/JIGController.cs
  2. 27
      AMESCoreStudio.Web/Controllers/PCBController.cs
  3. 10
      AMESCoreStudio.Web/Views/JIG/JIG002.cshtml
  4. 4
      AMESCoreStudio.Web/Views/JIG/JIG002C.cshtml
  5. 4
      AMESCoreStudio.Web/Views/JIG/JIG002U.cshtml
  6. 12
      AMESCoreStudio.Web/Views/JIG/JIG004.cshtml
  7. 5
      AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml
  8. 7
      AMESCoreStudio.Web/Views/JIG/JIG004U.cshtml
  9. 4
      AMESCoreStudio.Web/Views/PCB/PCB013.cshtml
  10. 2
      AMESCoreStudio.Web/Views/PCB/PCB013A.cshtml
  11. 13
      AMESCoreStudio.Web/Views/PCB/PCB013V.cshtml
  12. 2
      AMESCoreStudio.WebApi/Controllers/AMES/OutfitVarityInfoesController.cs
  13. 13
      AMESCoreStudio.WebApi/Enums/EnumPCB.cs
  14. 5
      AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs
  15. 8
      AMESCoreStudio.WebApi/Models/AMES/OutfitVarityInfo.cs

8
AMESCoreStudio.Web/Controllers/JIGController.cs

@ -437,13 +437,13 @@ namespace AMESCoreStudio.Web.Controllers
return Json(new Table() { count = 0, data = null }); return Json(new Table() { count = 0, data = null });
} }
public async Task<IActionResult> GetOutfitVarityInfoesByQueryAsync(int TypeFlag, int CommodityID, string Status) public async Task<IActionResult> GetOutfitVarityInfoesByQueryAsync(int TypeFlag, int CommodityID, string Status , int page = 0, int limit = 10)
{ {
var result = await _jigApi.GetOutfitVarityInfoesByQuery(TypeFlag, CommodityID, Status); var result = await _jigApi.GetOutfitVarityInfoesByQuery(TypeFlag, CommodityID, Status);
if (result.Count > 0) if (result.Count > 0)
{ {
return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); return Json(new Table() { code = 0, msg = "", data = result.Skip((page - 1) * limit).Take(limit), count = result.Count });
} }
return Json(new Table() { count = 0, data = null }); return Json(new Table() { count = 0, data = null });
@ -869,7 +869,7 @@ namespace AMESCoreStudio.Web.Controllers
return Json(new Table() { count = 0, data = null }); return Json(new Table() { count = 0, data = null });
} }
public async Task<IActionResult> GetOutfitInfoesByQueryAsync(int TypeFlag, int CommodityID, int VarityID, string Status, string QANo, string PartNo, string UseStatus) public async Task<IActionResult> GetOutfitInfoesByQueryAsync(int TypeFlag, int CommodityID, int VarityID, string Status, string QANo, string PartNo, string UseStatus, int page = 0, int limit = 10)
{ {
@ -882,7 +882,7 @@ namespace AMESCoreStudio.Web.Controllers
if (result.Count > 0) if (result.Count > 0)
{ {
return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); return Json(new Table() { code = 0, msg = "", data = result.Skip((page - 1) * limit).Take(limit), count = result.Count });
} }
return Json(new Table() { count = 0, data = null }); return Json(new Table() { count = 0, data = null });

27
AMESCoreStudio.Web/Controllers/PCBController.cs

@ -34,12 +34,14 @@ namespace AMESCoreStudio.Web.Controllers
public readonly IPCB _pcbApi; public readonly IPCB _pcbApi;
private readonly IWebHostEnvironment _env; private readonly IWebHostEnvironment _env;
public readonly IPCS _pcsApi; public readonly IPCS _pcsApi;
public PCBController(ILogger<PCBController> logger, IPCB pcbApi, IWebHostEnvironment env, IPCS pcsApi) public readonly IBLL _bllApi;
public PCBController(ILogger<PCBController> logger, IPCB pcbApi, IWebHostEnvironment env, IPCS pcsApi, IBLL bllApi)
{ {
_logger = logger; _logger = logger;
_pcbApi = pcbApi; _pcbApi = pcbApi;
_env = env; _env = env;
_pcsApi = pcsApi; _pcsApi = pcsApi;
_bllApi = bllApi;
} }
//#region 下拉選單 //#region 下拉選單
@ -158,8 +160,21 @@ namespace AMESCoreStudio.Web.Controllers
{ {
IResultModel result; IResultModel result;
// 量測基準 35 小於通知寄信
if (double.Parse(model.Tension1) < 35 || double.Parse(model.Tension2) < 35 || double.Parse(model.Tension3) < 35 ||
double.Parse(model.Tension4) < 35 || double.Parse(model.Tension5) < 35)
{
model.MeasureResult = "F";
//string Subject = $"FQC自動派送發信 FQC單號:{inhouseNo} 料號:{Material}";
//string Body = $@"FQC單號:{inhouseNo} 料號:{Material} <br/>
// 檢驗結果為:{Result}";
//await _bllApi.PostToMail(Subject, Body, string.Join(',', MailGroup), "", false, path);
}
else
{
model.MeasureResult = "P"; model.MeasureResult = "P";
}
model.CreateUserID = GetLogInUserID(); model.CreateUserID = GetLogInUserID();
model.CreateDate = DateTime.Now; model.CreateDate = DateTime.Now;
model.UpdateUserID = GetLogInUserID(); model.UpdateUserID = GetLogInUserID();
@ -249,9 +264,15 @@ namespace AMESCoreStudio.Web.Controllers
[HttpPost] [HttpPost]
public async Task<IActionResult> PCB014Async(SolderPasteInfo model) public async Task<IActionResult> PCB014Async(SolderPasteInfo model)
{ {
if (ModelState.IsValid) // 日期判斷
if (model.EffectiveDate < model.ManufactoringDate)
{
ModelState.AddModelError("error", "有效日期不能小於製造日期");
}
else if (ModelState.IsValid)
{ {
IResultModel result; IResultModel result;
if (model.SolderPasteID == 0) if (model.SolderPasteID == 0)
{ {
model.CreateUserID = GetLogInUserID(); model.CreateUserID = GetLogInUserID();
@ -274,11 +295,11 @@ namespace AMESCoreStudio.Web.Controllers
} }
else else
{ {
ModelState.AddModelError("error", result.Msg); ModelState.AddModelError("error", result.Msg);
} }
} }
if (model.SolderPasteID == 0) if (model.SolderPasteID == 0)
{ {
return View("PCB014C", model); return View("PCB014C", model);

10
AMESCoreStudio.Web/Views/JIG/JIG002.cshtml

@ -105,7 +105,7 @@
//通过行tool编辑,lay-event="edit" //通过行tool编辑,lay-event="edit"
function edit(obj) { function edit(obj) {
if (obj.data.varityID) { if (obj.data.varityID) {
hg.open('修改設備規格', '/JIG/JIG002U/' + obj.data.varityID, 640,320); hg.open('修改設備規格', '/JIG/JIG002U/' + obj.data.varityID, 640,550);
} }
} }
@ -117,7 +117,7 @@
else else
status = "啟用"; status = "啟用";
if (obj.data.varityID) { if (obj.data.varityID) {
hg.confirm("設備規格:" + obj.data.varityName + ",确定要" + status +"吗?", function () { hg.confirm("設備規格:" + obj.data.varityName + ",確定要" + status +"嗎?", function () {
$.ajax({ $.ajax({
url: '/JIG/JIG002D', url: '/JIG/JIG002D',
data: { id: obj.data.varityID }, data: { id: obj.data.varityID },
@ -143,7 +143,7 @@
layuiicon: '&#xe608;', layuiicon: '&#xe608;',
class: 'layui-btn-normal', class: 'layui-btn-normal',
handler: function () { handler: function () {
hg.open('新增設備規格', '/JIG/JIG002C', 640, 320); hg.open('新增設備規格', '/JIG/JIG002C', 640, 550);
// hg.open('修改設備規格', '/JIG/JIG002R', 640, 320); // hg.open('修改設備規格', '/JIG/JIG002R', 640, 320);
} }
@ -153,7 +153,7 @@
////搜索 ////搜索
$('#querysubmit').click(function () { $('#querysubmit').click(function () {
hg.msghide("刷新数据!"); hg.msghide("刷新查詢!");
tt(); tt();
}); });
@ -224,7 +224,7 @@
//var itemNo = $("#itemNo").val(); //var itemNo = $("#itemNo").val();
//var itemNo = $("#itemNo").val(); //var itemNo = $("#itemNo").val();
//if (itemNo) { //if (itemNo) {
hg.msghide("刷新数据!"); hg.msghide("刷新查詢!");
tt(); tt();
//} //}
//else { //else {

4
AMESCoreStudio.Web/Views/JIG/JIG002C.cshtml

@ -39,6 +39,10 @@
<input asp-for="VarityName" class="form-control col-sm-9" /> <input asp-for="VarityName" class="form-control col-sm-9" />
<span asp-validation-for="VarityName" class="text-danger offset-sm-3 my-sm-1"></span> <span asp-validation-for="VarityName" class="text-danger offset-sm-3 my-sm-1"></span>
</div> </div>
<div class="form-group form-inline my-sm-1">
<label asp-for="PurchaseNo" class="control-label col-sm-3"></label>
<input asp-for="PurchaseNo" class="form-control col-sm-9" />
</div>
<div class="form-group form-inline my-sm-1"> <div class="form-group form-inline my-sm-1">
<label asp-for="SafeStock" class="control-label col-sm-3"></label> <label asp-for="SafeStock" class="control-label col-sm-3"></label>
<input asp-for="SafeStock" class="form-control col-sm-9" /> <input asp-for="SafeStock" class="form-control col-sm-9" />

4
AMESCoreStudio.Web/Views/JIG/JIG002U.cshtml

@ -39,6 +39,10 @@
<input asp-for="VarityName" class="form-control col-sm-9" /> <input asp-for="VarityName" class="form-control col-sm-9" />
<span asp-validation-for="VarityName" class="text-danger offset-sm-3 my-sm-1"></span> <span asp-validation-for="VarityName" class="text-danger offset-sm-3 my-sm-1"></span>
</div> </div>
<div class="form-group form-inline my-sm-1">
<label asp-for="PurchaseNo" class="control-label col-sm-3"></label>
<input asp-for="PurchaseNo" class="form-control col-sm-9" />
</div>
<div class="form-group form-inline my-sm-1"> <div class="form-group form-inline my-sm-1">
<label asp-for="SafeStock" class="control-label col-sm-3"></label> <label asp-for="SafeStock" class="control-label col-sm-3"></label>
<input asp-for="SafeStock" class="form-control col-sm-9" /> <input asp-for="SafeStock" class="form-control col-sm-9" />

12
AMESCoreStudio.Web/Views/JIG/JIG004.cshtml

@ -151,7 +151,7 @@
//通过行tool编辑,lay-event="edit" //通过行tool编辑,lay-event="edit"
function edit(obj) { function edit(obj) {
if (obj.data.outfitID) { if (obj.data.outfitID) {
hg.open('修改設備基本資料', '/JIG/JIG004U/' + obj.data.outfitID, 640,320); hg.open('修改設備基本資料', '/JIG/JIG004U/' + obj.data.outfitID, 640,550);
} }
} }
@ -166,8 +166,8 @@
if (obj.data.outfitID) { if (obj.data.outfitID) {
hg.confirm("設備:" + obj.data.outfitNo + ",确定要" + status + "吗?", function () { hg.confirm("設備:" + obj.data.outfitNo + ",確定要" + status + "嗎?", function () {
hg.open('停用啟用基本設備', '/JIG/JIG004D/' + obj.data.outfitID, 640, 320); hg.open('停用啟用基本設備', '/JIG/JIG004D/' + obj.data.outfitID, 640, 550);
// $.ajax({ // $.ajax({
// url: '/JIG/JIG004D', // url: '/JIG/JIG004D',
// data: { id: obj.data.outfitID }, // data: { id: obj.data.outfitID },
@ -193,7 +193,7 @@
layuiicon: '&#xe608;', layuiicon: '&#xe608;',
class: 'layui-btn-normal', class: 'layui-btn-normal',
handler: function () { handler: function () {
hg.open('新增設備基本資料', '/JIG/JIG004C', 640, 320); hg.open('新增設備基本資料', '/JIG/JIG004C', 640, 550);
} }
} }
@ -202,7 +202,7 @@
////搜索 ////搜索
$('#querysubmit').click(function () { $('#querysubmit').click(function () {
hg.msghide("刷新数据!"); hg.msghide("刷新查詢!");
tt(); tt();
}); });
@ -290,7 +290,7 @@
}; };
////搜索 ////搜索
$('#querysubmit').click(function () { $('#querysubmit').click(function () {
hg.msghide("刷新数据!"); hg.msghide("刷新查詢!");
tt(); tt();
}); });

5
AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml

@ -86,6 +86,11 @@
<input asp-for="PuchaseDate" type="date" class="form-control col-sm-9" /> <input asp-for="PuchaseDate" type="date" class="form-control col-sm-9" />
<span asp-validation-for="PuchaseDate" class="text-danger offset-sm-3 my-sm-1"></span> <span asp-validation-for="PuchaseDate" class="text-danger offset-sm-3 my-sm-1"></span>
</div> </div>
<div class="form-group form-inline my-sm-1">
<label asp-for="QualityDate" class="control-label col-sm-3"></label>
<input asp-for="QualityDate" type="date" class="form-control col-sm-9" />
<span asp-validation-for="QualityDate" class="text-danger offset-sm-3 my-sm-1"></span>
</div>
<div class="form-group form-inline my-sm-1"> <div class="form-group form-inline my-sm-1">
<label asp-for="UnitPrice" class="control-label col-sm-3"></label> <label asp-for="UnitPrice" class="control-label col-sm-3"></label>
<input asp-for="UnitPrice" class="form-control col-sm-9" /> <input asp-for="UnitPrice" class="form-control col-sm-9" />

7
AMESCoreStudio.Web/Views/JIG/JIG004U.cshtml

@ -87,6 +87,11 @@
<input asp-for="PuchaseDate" type="date" class="form-control col-sm-9" /> <input asp-for="PuchaseDate" type="date" class="form-control col-sm-9" />
<span asp-validation-for="PuchaseDate" class="text-danger offset-sm-3 my-sm-1"></span> <span asp-validation-for="PuchaseDate" class="text-danger offset-sm-3 my-sm-1"></span>
</div> </div>
<div class="form-group form-inline my-sm-1">
<label asp-for="QualityDate" class="control-label col-sm-3"></label>
<input asp-for="QualityDate" type="date" class="form-control col-sm-9" />
<span asp-validation-for="QualityDate" class="text-danger offset-sm-3 my-sm-1"></span>
</div>
<div class="form-group form-inline my-sm-1"> <div class="form-group form-inline my-sm-1">
<label asp-for="UnitPrice" class="control-label col-sm-3"></label> <label asp-for="UnitPrice" class="control-label col-sm-3"></label>
<input asp-for="UnitPrice" class="form-control col-sm-9" /> <input asp-for="UnitPrice" class="form-control col-sm-9" />
@ -148,7 +153,7 @@
<input type="submit" value="儲存" class="btn btn-primary offset-sm-3" /> <input type="submit" value="儲存" class="btn btn-primary offset-sm-3" />
</div> </div>
</form> </form>
</div> </div>
</div> </div>

4
AMESCoreStudio.Web/Views/PCB/PCB013.cshtml

@ -210,13 +210,13 @@
function detail(obj) { function detail(obj) {
if (obj.data.steelPlateID) { if (obj.data.steelPlateID) {
hg.open('新增量測記錄', '/PCB/PCB013A?steelPlateID=' + obj.data.steelPlateID + '&steelPlateNo=' + obj.data.steelPlateNo, 700, 500); hg.open('新增量測記錄', '/PCB/PCB013A?steelPlateID=' + obj.data.steelPlateID + '&steelPlateNo=' + obj.data.steelPlateNo, 700, 550);
} }
} }
function View(obj) { function View(obj) {
if (obj.data.steelPlateID) { if (obj.data.steelPlateID) {
hg.open('檢視量測記錄', '/PCB/PCB013V?steelPlateID=' + obj.data.steelPlateID + '&steelPlateNo=' + obj.data.steelPlateNo, 1000, 500); hg.open('檢視量測記錄', '/PCB/PCB013V?steelPlateID=' + obj.data.steelPlateID + '&steelPlateNo=' + obj.data.steelPlateNo, 1000, 550);
} }
} }

2
AMESCoreStudio.Web/Views/PCB/PCB013A.cshtml

@ -17,7 +17,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">鋼板編號</label> <label class="layui-form-label">鋼板編號</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input value="@ViewBag.steelPlateNo" class="layui-input" autocomplete="off" /> <input value="@ViewBag.steelPlateNo" class="layui-input" autocomplete="off" readonly="" />
</div> </div>
</div> </div>

13
AMESCoreStudio.Web/Views/PCB/PCB013V.cshtml

@ -21,12 +21,18 @@
{ {
field: 'status', field: 'status',
title: '量測狀態', title: '量測狀態',
sort: true
}, },
{ {
field: 'measureResult', field: 'measureResult',
title: '結果', title: '結果',
sort: true templet: function (d) {
var btn;
if (d.measureResult == "P")
btn = 'OK';
else
btn = 'NG';
return btn;
}
}, },
{ {
field: 'tension1', field: 'tension1',
@ -56,7 +62,6 @@
{ {
field: 'remark', field: 'remark',
title: '備註', title: '備註',
sort: true
}, },
{ {
field: 'createUserName', field: 'createUserName',
@ -75,4 +80,6 @@
//基本数据表格 //基本数据表格
var table = hg.table.datatable('test', '鋼板量測紀錄', '/PCB/PCB013VQuery?steelPlateID=' + steelPlateID.value + '&steelPlateNo=' + steelPlateNo.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); var table = hg.table.datatable('test', '鋼板量測紀錄', '/PCB/PCB013VQuery?steelPlateID=' + steelPlateID.value + '&steelPlateNo=' + steelPlateNo.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']);
</script> </script>
} }

2
AMESCoreStudio.WebApi/Controllers/AMES/OutfitVarityInfoesController.cs

@ -70,6 +70,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
if (Status != "*") if (Status != "*")
q = q.Where(p => p.Status.Equals(Status)); q = q.Where(p => p.Status.Equals(Status));
var OutfitVarityInfo = await q.ToListAsync(); var OutfitVarityInfo = await q.ToListAsync();
if (OutfitVarityInfo == null) if (OutfitVarityInfo == null)

13
AMESCoreStudio.WebApi/Enums/EnumPCB.cs

@ -19,22 +19,17 @@ namespace AMESCoreStudio.WebApi.Enum
public enum EnumSteelPlateStatus public enum EnumSteelPlateStatus
{ {
/// <summary> /// <summary>
/// 上線前 /// 拿取
/// </summary> /// </summary>
[Display(Name = "上線前")] [Display(Name = "拿取")]
A = 1, A = 1,
/// <summary> /// <summary>
/// 清洗後 /// 歸還
/// </summary> /// </summary>
[Display(Name = "清洗後")] [Display(Name = "歸還")]
B = 2, B = 2,
/// <summary>
/// 每周點檢
/// </summary>
[Display(Name = "每周點檢")]
C = 3
} }
/// <summary> /// <summary>

5
AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs

@ -191,11 +191,11 @@ namespace AMESCoreStudio.WebApi.Models.AMES
public int? UnitPrice { get; set; } = 0; public int? UnitPrice { get; set; } = 0;
/// <summary> /// <summary>
/// 質保日期 /// 有效日期
/// </summary> /// </summary>
[Column("QUALITY_DATE")] [Column("QUALITY_DATE")]
[DataMember] [DataMember]
[Display(Name = "質保日期")] [Display(Name = "有效日期")]
public DateTime? QualityDate { get; set; } public DateTime? QualityDate { get; set; }
/// <summary> /// <summary>
@ -394,5 +394,6 @@ namespace AMESCoreStudio.WebApi.Models.AMES
[Display(Name = "變更狀態備註(啟用/停用)")] [Display(Name = "變更狀態備註(啟用/停用)")]
public string UseStatusRemark { get; set; } public string UseStatusRemark { get; set; }
} }
} }

8
AMESCoreStudio.WebApi/Models/AMES/OutfitVarityInfo.cs

@ -90,6 +90,14 @@ namespace AMESCoreStudio.WebApi.Models.AMES
[Display(Name = "預警提前次數")] [Display(Name = "預警提前次數")]
public int AlertForeDays { get; set; } = 0; public int AlertForeDays { get; set; } = 0;
/// <summary>
/// 採購編號
/// </summary>
[Column("PURCHASE_NO")]
[DataMember]
[Display(Name = "採購編號")]
public string PurchaseNo { get; set; }
/// <summary> /// <summary>
/// 創建者ID /// 創建者ID

Loading…
Cancel
Save