Browse Source

YIRU更新程式,無序號工單入庫問題

PTD
BB.Wang 2 years ago
parent
commit
9a7c14853a
  1. 40
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 35
      AMESCoreStudio.Web/Views/PCS/PCS024.cshtml
  3. 9
      AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs

40
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -6538,14 +6538,21 @@ namespace AMESCoreStudio.Web.Controllers
public async Task<IActionResult> PCS024C(string id)
{
var result = await _pcsApi.GetBarcodeInfoesByNo(id);
if (result.Count > 0)
{
var tt = result[0];
ViewBag.BarcodeID = tt.BarcodeID;
ViewBag.WipID = tt.WipID;
ViewBag.BarcodeNo = id;
var tt = result[0];
ViewBag.BarcodeID = tt.BarcodeID;
ViewBag.WipID = tt.WipID;
ViewBag.BarcodeNo = id;
await GetFactoryUnit();
//await GetStations();
await GetItems();
await GetFactoryUnit();
//await GetStations();
await GetItems();
}
else
{
ViewBag.BarcodeNo = "查無序號請重新輸入";
}
return View();
}
@ -6570,6 +6577,20 @@ namespace AMESCoreStudio.Web.Controllers
return Json(new Result() { success = true, msg = "" });
}
[HttpGet]
public async Task<IActionResult> GetBarcodeInfoesByNoAsync(string id)
{
var result = await _pcsApi.GetBarcodeInfoesByNo(id);
if (result.Count > 0)
{
return Json(new Table() { code = 0, msg = "", data = result, count = 1 });
}
return Json(new Table() { count = 0, data = null });
}
//頁面提交,id=0 添加,id>0 修改
[HttpPost]
public async Task<IActionResult> PCS024CSaveAsync(BarcodeItem model)
@ -8351,7 +8372,7 @@ namespace AMESCoreStudio.Web.Controllers
}
#endregion
}
public static class ObjectExtension
{
public static T GetAttributeFrom<T>(this object instance, string propertyName) where T : Attribute
@ -8362,4 +8383,7 @@ namespace AMESCoreStudio.Web.Controllers
return (T)property.GetCustomAttributes(attributeType, false).FirstOrDefault();
}
}
}

35
AMESCoreStudio.Web/Views/PCS/PCS024.cshtml

@ -94,9 +94,14 @@
//新增
$('#btnAdd').click(function () {
var keywords = $('#barcodeNo').val();
getBarcodeinfo(keywords);
var keywords = $('#barcodeNo').val();
if (keywords)
hg.open('新增組件資料', '/PCS/PCS024C/' + keywords, 640, 480);
{
hg.open('新增組件資料', '/PCS/PCS024C/' + keywords, 640, 480);
}
else
alert("請先輸入內部條碼!!");
});
@ -112,5 +117,33 @@
var table = hg.table.datatable('test', '組件資料', '/PCS/GetBarcodeItemByUnit?unitId=' + unit + '&barcodeNo=' + barcode, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']);
};
function getBarcodeinfo(barcodeNO) {
if (barcodeNO) {
$.ajax({
url: "/PCS/GetBarcodeInfoesByNo",
data: { id: barcodeNO },
dataType: 'json',
contentType: "application/json",
type: 'get',
success: function (result) {
if (result.data) {
}
else {
alert('查無此序號請確認序號是否正確!!!');
return false;
}
}
});
}
};
</script>
}

9
AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs

@ -259,13 +259,14 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
[HttpDelete("{id}")]
public async Task<ActionResult<FqcInhouseDetail>> DeleteFqcInhouseDetail(string id)
{
ResultModel<FqcInhouseDetail> result = new ResultModel<FqcInhouseDetail>();
var fqcInhouseDetail = await _context.FqcInhouseDetails.Where(p => p.InhouseNo == id).FirstOrDefaultAsync();
if (fqcInhouseDetail == null)
{
return NotFound();
}
{
return fqcInhouseDetail;
}
_context.FqcInhouseDetails.Remove(fqcInhouseDetail);
await _context.SaveChangesAsync();

Loading…
Cancel
Save