Browse Source

修正巡檢作業查詢PLM_ECN失敗問題

PTD
Yiru 1 year ago
parent
commit
53117382ac
  1. 9
      AMESCoreStudio.Web/Controllers/SPCController.cs
  2. 6
      AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs
  3. 23
      AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml
  4. 25
      AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml

9
AMESCoreStudio.Web/Controllers/SPCController.cs

@ -1267,6 +1267,15 @@ namespace AMESCoreStudio.Web.Controllers
//return Json(new Result() { success = true, msg = "資料有誤!!" });
}
[HttpPost]
public async Task<IActionResult> SPC005GetPLMECN(string ItemNo)
{
IResultModel<string> result;
result = await _spcApi.GetPLMEcn(ItemNo);
return Json(result);
}
[ResponseCache(Duration = 0)]
[HttpGet]
public async Task<IActionResult> GetInspectionResultMastersAsync()

6
AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs

@ -338,6 +338,12 @@ namespace AMESCoreStudio.Web
ITask<ResultModel<string>> PutInspectionResultDetailForType([FromBody, RawJsonContent] string model);
/// <summary>
/// FQC007 取PLM ECN
/// </summary>
/// <returns></returns>
[WebApiClient.Attributes.HttpGet("api/GetPLMData/Get_PLM_ECN")]
ITask<ResultModel<string>> GetPLMEcn(string ItemNo);
#endregion

23
AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml

@ -69,10 +69,10 @@
</div>
<div class="layui-input-inline" style="width:25%;">
<label class="control-label col-sm-2">PLMENC</label>
<label class="control-label col-sm-2">PLM_ECN</label>
<div>
<input type="text" readonly style="width:80%;display:inline" class="layui-input" id="PLMECN" />
<a id="GetPLMECN" class="layui-btn layui-btn-sm layui-btn-normal" style="padding: 0 5px;" title="刷新PLM_ECN">
<a onclick="GetPLM_ECN();" class="layui-btn layui-btn-sm layui-btn-normal" style="padding: 0 5px;" title="刷新PLM_ECN">
<i class="layui-icon layui-icon-sm">&#xe669;</i>
</a>
</div>
@ -702,21 +702,26 @@
// PLM_ECN
$("#GetPLMECN").on("click", function () {
function GetPLM_ECN() {
var ItemNo = $("#ItemNo").val();
$.ajax({
url: `http://plm935fs01:50786/RMA_GetLocation/QueryLastReleaseECN?item=${ItemNo}`,
type: "Get",
data: {},
url: "@Url.Action("SPC005GetPLMECN", "SPC")",
type: "Post",
data: { "ItemNo": ItemNo },
success: function (result) {
alert(resut.d);
$('#PLMECN').val(result.d);
if (result.success) {
$('#PLMECN').val(result.msg);
}
else {
alert(result.msg);
}
},
error: function (result) {
alert(`呼叫API失敗`);
}
});
});
}
// SMS異常
$(".sms").click(function () {

25
AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml

@ -56,10 +56,10 @@
<div class="layui-input-inline" style="width:25%;">
<label class="control-label col-sm-2">PLMENC</label>
<label class="control-label col-sm-2">PLM_ECN</label>
<div>
<input type="text" readonly style="width:80%;display:inline" class="layui-input" id="PLMECN" />
<a id="GetPLMECN" class="layui-btn layui-btn-sm layui-btn-normal" style="padding: 0 5px;" title="刷新PLM_ECN">
<a onclick="GetPLM_ECN();" class="layui-btn layui-btn-sm layui-btn-normal" style="padding: 0 5px;" title="刷新PLM_ECN">
<i class="layui-icon layui-icon-sm">&#xe669;</i>
</a>
</div>
@ -534,11 +534,30 @@
});
});
function GetPLM_ECN() {
var ItemNo = $("#ItemNo").val();
$.ajax({
url: "@Url.Action("SPC005GetPLMECN", "SPC")",
type: "Post",
data: { "ItemNo": ItemNo },
success: function (result) {
if (result.success) {
$('#PLMECN').val(result.msg);
}
else {
alert(result.msg);
}
},
error: function (result) {
alert(`呼叫API失敗`);
}
});
}
// PLM_ECN
$("#GetPLMECN").on("click", function () {
var ItemNo = $("#ItemNo").val();
$.ajax({
url: `http://plm935fs01:50786/RMA_GetLocation/QueryLastReleaseECN?item=${ItemNo}`,
url: 'http://plm935fs01:50786/RMA_GetLocation/QueryLastReleaseECN?item=' + ItemNo,
type: "Get",
data: {},
success: function (result) {

Loading…
Cancel
Save