Browse Source

出貨序號重取在操作增加或減少序號後,可回到查詢畫面並更新資料

PTD
Yiru 1 year ago
parent
commit
89fdf4d105
  1. 54
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 18
      AMESCoreStudio.Web/Views/PCS/PCS040.cshtml

54
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -9021,18 +9021,9 @@ namespace AMESCoreStudio.Web.Controllers
#region PCS040 工單設定 #region PCS040 工單設定
public async Task<IActionResult> PCS040(string id) public async Task<IActionResult> PCS040()
{ {
if (id != null) await GetFactoryUnit();
{
await GetFactoryUnit(id);
ViewBag.UnitNo = id;
}
else
{
await GetFactoryUnit();
}
//await GetFactoryUnit(); //await GetFactoryUnit();
return View(); return View();
} }
@ -9044,16 +9035,18 @@ namespace AMESCoreStudio.Web.Controllers
/// <param name="wipNo">工單號碼</param> /// <param name="wipNo">工單號碼</param>
/// <param name="itemNo">料號</param> /// <param name="itemNo">料號</param>
/// <returns></returns> /// <returns></returns>
public async Task<IActionResult> PCS040QueryAsync(string wipNo, int page = 0, int limit = 10) [ResponseCache(Duration = 0)]
[HttpGet]
public async Task<IActionResult> PCS040QueryAsync(string id, int page = 0, int limit = 10)
{ {
if (string.IsNullOrEmpty(wipNo)) if (string.IsNullOrEmpty(id))
{ {
return Json(new Table() { code = 0, msg = "無資料", data = "", count = 0 }); return Json(new Table() { code = 0, msg = "無資料", data = "", count = 0 });
} }
var wipbarcode = await _pcsApi.GetWipBarcodeOther(wipNo);
var wipbarcode = await _pcsApi.GetWipBarcodeOther(id);
string BegnBarcode = string.Empty; string BegnBarcode = string.Empty;
int snLength = 0; int snLength = 0;
int SerialRuleDetailID = 0; int SerialRuleDetailID = 0;
@ -9068,12 +9061,12 @@ namespace AMESCoreStudio.Web.Controllers
return Json(new Table() { code = 0, msg = "查不到工單出貨序號區間值", data = "", count = 0 }); return Json(new Table() { code = 0, msg = "查不到工單出貨序號區間值", data = "", count = 0 });
} }
// if (SerialRuleDetailID == null) // if (SerialRuleDetailID == null)
// return Json(new Table() { code = 0, msg = "查不到工單出貨序號區間值", data = "", count = 0 }); // return Json(new Table() { code = 0, msg = "查不到工單出貨序號區間值", data = "", count = 0 });
// else // else
{ {
var SerialRule = await _pcsApi.GetSerialRuleDetail(SerialRuleDetailID); var SerialRule = await _pcsApi.GetSerialRuleDetail(SerialRuleDetailID);
var result = await _pcsApi.GetWipBarcodeOtherByItemNo(WipNo: wipNo, ItemNo: SerialRule.Select(s=>s.ItemNo).FirstOrDefault()); var result = await _pcsApi.GetWipBarcodeOtherByItemNo(WipNo: id, ItemNo: SerialRule.Select(s => s.ItemNo).FirstOrDefault());
result.Data = result.Data.Where(w => w.Wip_Status_NO != "E"); result.Data = result.Data.Where(w => w.Wip_Status_NO != "E");
//判斷工單已開線 //判斷工單已開線
foreach (var item in result.Data) foreach (var item in result.Data)
@ -9107,7 +9100,7 @@ namespace AMESCoreStudio.Web.Controllers
#endregion #endregion
} }
result.Data = result.Data.OrderBy(o => o.WipScheduleDate).ThenBy(o =>o.StartNo); result.Data = result.Data.OrderBy(o => o.WipScheduleDate).ThenBy(o => o.StartNo);
return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal });
} }
} }
@ -9467,10 +9460,11 @@ namespace AMESCoreStudio.Web.Controllers
await GetBarcodeOther(model.WipAtt.ItemNO, model.LotNo, QTY, model.WipInfo.WipNO, model.WipInfo.WipScheduleDate.ToString("yyyy-MM-dd")); await GetBarcodeOther(model.WipAtt.ItemNO, model.LotNo, QTY, model.WipInfo.WipNO, model.WipInfo.WipScheduleDate.ToString("yyyy-MM-dd"));
_msg = "產生成功!"; _msg = "產生成功!";
return RedirectToAction("Refresh", "Home", new { id = model.WipInfo.WipNO, msg = _msg });
return RedirectToAction("Refresh", "Home", new { msg = _msg });
} }
IResultModel result; IResultModel result;
model.WipBarcodeOther.WipNO = model.WipInfo.WipNO; model.WipBarcodeOther.WipNO = model.WipInfo.WipNO;
@ -9482,19 +9476,17 @@ namespace AMESCoreStudio.Web.Controllers
if (result.Success) if (result.Success)
{ {
_msg = "修改成功!"; _msg = "修改成功!";
return RedirectToAction("Refresh", "Home", new { wipNo = model.WipInfo.WipNO, msg = _msg });
// return RedirectToAction("PCS040R", "PCS", new { id = model.WipInfo.WipNO,Rule = model.WipAtt.ModelNO, serialRuleitem = model.SerialRuleItem }); return RedirectToAction("Refresh", "Home", new { msg = _msg });
// return RedirectToAction("PCS040Query", "PCS", new { wipNo = model.WipInfo.WipNO });
}
} else
else
{ {
_msg = result.Msg; _msg = result.Msg;
ModelState.AddModelError("error", result.Msg); ModelState.AddModelError("error", result.Msg);
} }
return RedirectToAction("Refresh", "Home", new { msg = _msg });
return RedirectToAction("Refresh", "Home", new { wipNo = model.WipInfo.WipNO, msg = _msg });
} }

18
AMESCoreStudio.Web/Views/PCS/PCS040.cshtml

@ -69,7 +69,8 @@
//监听表单提交事件 //监听表单提交事件
hg.form.onsubmit('querysubmit', function (data) { hg.form.onsubmit('querysubmit', function (data) {
table && table.reload(data); // table && table.reload(data);
tt();
}); });
var tableCols = [[ var tableCols = [[
@ -184,8 +185,6 @@
}); });
} }
function Create(obj) { function Create(obj) {
if (obj.data.wipNo) { if (obj.data.wipNo) {
hg.open('產生工單資料', '/PCS/PCS040C?id=' + obj.data.wipNo + '&rule=' + obj.data.rule + '&serialRuleitem=' + obj.data.itemRule, 740, 350); hg.open('產生工單資料', '/PCS/PCS040C?id=' + obj.data.wipNo + '&rule=' + obj.data.rule + '&serialRuleitem=' + obj.data.itemRule, 740, 350);
@ -193,11 +192,14 @@
} }
var table;
$(function () {
//基本資料表格 tt();
var table = hg.table.datatable('query', '工單資料修改', '/PCS/PCS040Query/' + $("#wipNo").val() , {}, tableCols, {}, true, 'full-100', ['filter', 'print', 'exports']); });
//基本数据表格
function tt() {
table = hg.table.datatable('query', '工單資料修改', '/PCS/PCS040Query?id=' + $("#wipNo").val(), {}, tableCols, {}, true, 'full-100', ['filter', 'print', 'exports']);
}
$(document).off('mousedown', '.layui-table-grid-down'). $(document).off('mousedown', '.layui-table-grid-down').
on('mousedown', '.layui-table-grid-down', function (event) { on('mousedown', '.layui-table-grid-down', function (event) {
table._tableTrCurrr = $(this).closest('td'); table._tableTrCurrr = $(this).closest('td');

Loading…
Cancel
Save