Browse Source

1. 修正過站工程資訊長度

2. 修改工單查詢-(修改)工程資訊及板卡資訊 保存判斷,出貨序號加入按鈕產生
PTD
ray 3 years ago
parent
commit
57dd5b25ee
  1. 99
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 5
      AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs
  3. 3
      AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml
  4. 58
      AMESCoreStudio.Web/Views/PCS/PCS003.cshtml
  5. 2
      AMESCoreStudio.Web/Views/PCS/PCS021.cshtml
  6. 2
      AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs

99
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -117,16 +117,45 @@ namespace AMESCoreStudio.Web.Controllers
return Msg;
}
/// <summary>
/// 工單工程 保存判斷
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public string CheckWipInfoInsert_WipSystem(WipSystem model)
{
string Msg = string.Empty;
// 當工單-工程資訊有填寫任何一個欄位,就要把必填欄位都填寫
if (!string.IsNullOrWhiteSpace(model.Engineer) ||
!string.IsNullOrWhiteSpace(model.PowerMode) ||
!string.IsNullOrWhiteSpace(model.BiMemo) ||
!string.IsNullOrWhiteSpace(model.BiTime) ||
!string.IsNullOrWhiteSpace(model.BiTemperature) ||
model.BiRatio != 0 ||
!string.IsNullOrWhiteSpace(model.Checksum) ||
!string.IsNullOrWhiteSpace(model.Bios) ||
!string.IsNullOrWhiteSpace(model.BiosVer) ||
!string.IsNullOrWhiteSpace(model.Cpu) ||
!string.IsNullOrWhiteSpace(model.DmiBi) ||
!string.IsNullOrWhiteSpace(model.Ram) ||
!string.IsNullOrWhiteSpace(model.Fw) ||
!string.IsNullOrWhiteSpace(model.Fw1) ||
!string.IsNullOrWhiteSpace(model.Fw2) ||
!string.IsNullOrWhiteSpace(model.Ec) ||
!string.IsNullOrWhiteSpace(model.OsVer) ||
!string.IsNullOrWhiteSpace(model.Jumper) ||
!string.IsNullOrWhiteSpace(model.Memo))
{
// 判斷預設值是否更改過,如果有就判斷必填欄位
if (!string.IsNullOrWhiteSpace(model.BiTemperature) ||
!string.IsNullOrWhiteSpace(model.BiTime) ||
!string.IsNullOrWhiteSpace(model.BiMemo) ||
model.BiRatio == 0 ||
!string.IsNullOrWhiteSpace(model.Checksum) ||
!string.IsNullOrWhiteSpace(model.Bios))
!string.IsNullOrWhiteSpace(model.Bios) ||
!string.IsNullOrWhiteSpace(model.BiosVer))
{
if (string.IsNullOrWhiteSpace(model.BiTemperature))
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.BiTemperature)).Name + ",";
@ -143,8 +172,13 @@ namespace AMESCoreStudio.Web.Controllers
if (string.IsNullOrWhiteSpace(model.Bios))
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.Bios)).Name + ",";
}
if (string.IsNullOrWhiteSpace(model.BiosVer))
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.BiosVer)).Name + ",";
if (model.BiRatio == 0)
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.BiRatio)).Name + ",";
}
}
return Msg;
}
@ -152,16 +186,49 @@ namespace AMESCoreStudio.Web.Controllers
{
string Msg = string.Empty;
// 判斷預設值是否更改過,如果有就判斷必填欄位
// 當工單-板卡資訊有填寫任何一個欄位,就要把必填欄位都填寫
if (model.BiRatio != 0 ||
!string.IsNullOrWhiteSpace(model.BiosRemarks) ||
!string.IsNullOrWhiteSpace(model.BiTemperature) ||
!string.IsNullOrWhiteSpace(model.BiTime) ||
!string.IsNullOrWhiteSpace(model.BiosRemarks) ||
!string.IsNullOrWhiteSpace(model.BiosVer) ||
!string.IsNullOrWhiteSpace(model.BiRemarks) ||
!string.IsNullOrWhiteSpace(model.BurnLocation) ||
!string.IsNullOrWhiteSpace(model.BurnRemarks) ||
!string.IsNullOrWhiteSpace(model.Checksum) ||
!string.IsNullOrWhiteSpace(model.CsRemarks) ||
!string.IsNullOrWhiteSpace(model.Engineer) ||
!string.IsNullOrWhiteSpace(model.PartsBakeRemarks) ||
model.PartsBakeTime != 0 ||
model.PcbBake != 0 ||
!string.IsNullOrWhiteSpace(model.PcbBakeRemarks) ||
!string.IsNullOrWhiteSpace(model.PcbProcessingRemarks))
{
// 判斷預設值是否更改過,如果有就判斷必填欄位
if (model.BiRatio == 0 ||
model.PartsBakeTime == 0 ||
model.PcbBake == 0 ||
!string.IsNullOrWhiteSpace(model.BiosVer) ||
!string.IsNullOrWhiteSpace(model.BiTemperature) ||
!string.IsNullOrWhiteSpace(model.BiTime) ||
!string.IsNullOrWhiteSpace(model.Checksum) ||
!string.IsNullOrWhiteSpace(model.BurnLocation))
{
if (model.BiRatio == 0)
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.BiRatio)).Name + ",";
if (model.PartsBakeTime == 0)
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.PartsBakeTime)).Name + ",";
if (model.PcbBake == 0)
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.PcbBake)).Name + ",";
if (string.IsNullOrWhiteSpace(model.BiosVer))
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.BiosVer)).Name + ",";
if (string.IsNullOrWhiteSpace(model.BiTemperature))
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.BiTemperature)).Name + ",";
@ -175,7 +242,7 @@ namespace AMESCoreStudio.Web.Controllers
Msg += model.GetAttributeFrom<DisplayAttribute>(nameof(model.BurnLocation)).Name + ",";
}
}
return Msg;
}
#endregion
@ -1213,6 +1280,30 @@ namespace AMESCoreStudio.Web.Controllers
ViewBag.RuleStationByWipNoUnitNoList = items;
return Json(new { data = items });
}
/// <summary>
/// 取出貨序號
/// </summary>
/// <param name="itemNo">料號</param>
/// <param name="lotNo">生產序號</param>
/// <param name="num">生產數量</param>
/// <returns>RuleStation </returns>
[HttpPost]
public async Task<JsonResult> GetBarcodeOther(string itemNo, string lotNo, int num)
{
var result = await _pcsApi.GetSerialRuleByQurey(itemNo, lotNo.Trim().ToUpper(), num);
string StartNO = "";
string EndNO = "";
if (result.Success)
{
StartNO = result.Msg.Split('~')[0];
EndNO = result.Msg.Split('~')[1] ?? result.Msg.Split('~')[0];
}
return Json(new Result() { success = result.Success, msg = result.Msg, data = new { StartNO, EndNO } });
}
#endregion
[ResponseCache(Duration = 0)]

5
AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs

@ -1095,5 +1095,10 @@ namespace AMESCoreStudio.Web
ITask<List<OutfitCommodityInfo>> GetOutfitCommodityInfo();
#endregion
#region 取出貨序號
[WebApiClient.Attributes.HttpGet("api/SerialRules/ByQurey/{itemNo}/{lotNo}/{num}")]
ITask<ResultModel<string>> GetSerialRuleByQurey(string itemNo,string lotNo ,int num);
#endregion
}
}

3
AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml

@ -784,7 +784,8 @@
<div class="layui-inline">
<label class="layui-form-label">FINE_PACKAGE</label>
<div class="layui-input-inline">
<input class="layui-input" asp-for="wipSystem.FinePackage" autocomplete="off" />
<input type="checkbox" title="是否為精裝" @(Model.wipSystem.FinePackage == "Y" ? "checked" : "") />
</div>
</div>
</div>

58
AMESCoreStudio.Web/Views/PCS/PCS003.cshtml

@ -285,6 +285,15 @@
<div class="layui-input-inline">
<input asp-for="wipBarcodeOther.EndNO" class="layui-input" />
</div>
<div id="barcodeOtherDiv" style="display:inline;">
<label class="layui-form-label">lotNo</label>
<div class="layui-input-inline" style="width:100px;">
<input id="lotNo" class="layui-input" style="width:100px;" type="text" />
</div>
<div class="layui-input-inline">
<input id="GetBarcodeOther" class="layui-btn layui-btn-primary layui-border-blue layui-btn-sm" type="button" value="產生出貨序號" />
</div>
</div>
</div>
</div>
@ -858,7 +867,7 @@
<div class="layui-inline">
<label class="layui-form-label">FINE_PACKAGE</label>
<div class="layui-input-inline">
<input class="layui-input" asp-for="wipSystem.FinePackage" autocomplete="off" />
<input @if (Model.wipSystem != null) { @(Model.wipSystem.FinePackage == "Y" ? "checked" : "") } type="checkbox" title="是否為精裝" name="wipSystem.FinePackage" />
</div>
</div>
</div>
@ -1105,6 +1114,12 @@
$("#board").show();
}
// DIV 出貨序號
if ($('#wipBarcodeOther_StartNO').val() != "" && $('#wipBarcodeOther_EndNO').val() != "") {
$("#barcodeOtherDiv").hide();
}
// DIV MAC
if ($('#wipMAC_StartNO').val() != "" && $('#wipMAC_EndNO').val() != "") {
$("#GetMAC").hide();
}
@ -1128,6 +1143,47 @@
});
// 產生出貨序號
$("#GetBarcodeOther").click(function (event) {
var itemNo = $('#wipAtt_ItemNO').val();
var planQTY = $('#wipInfo_PlanQTY').val();
var lotNo = $('#lotNo').val();
if (itemNo == '' || !itemNo) {
parent.hg.msg("請輸入料號");
return;
}
if (planQTY == '' || !planQTY || planQTY == 0) {
parent.hg.msg("請確認計畫數量");
return;
}
if (lotNo == '' || !lotNo) {
parent.hg.msg("請確認lotNo");
return;
}
$.ajax({
url: '@Url.Action("GetBarcodeOther", "PCS")',
dataType: 'json',
data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY },
cache: false,
type: "POST",
success: function (result) {
// 錯誤訊息
if (!result.success) {
parent.hg.msg(result.msg);
}
else {
$("#wipBarcodeOther_StartNO").val(result.data.startNO);
$("#wipBarcodeOther_EndNO").val(result.data.endNO);
$("#barcodeOtherDiv").hide();
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Found error when using Ajax!!");
}
});
});
// 產生MAC
$("#GetMAC").click(function (event) {
var wipNO = $('#wipAtt_ItemNO').val();

2
AMESCoreStudio.Web/Views/PCS/PCS021.cshtml

@ -199,7 +199,7 @@
<fieldset id="Memo" class="layui-elem-field layui-field-title">
<legend style="color: #e18917">工程備註</legend>
<div class="layui-form-item">
<label class="layui-form-label" style="text-align: left; color: blue;">@Model.SystemMemo</label>
<label class="layui-form-label" style="width:auto; text-align: left; color: blue;">@Model.SystemMemo</label>
</div>
</fieldset>
<fieldset class="layui-elem-field layui-field-title">

2
AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs

@ -47,6 +47,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES
/// POWER_MODE_TYPE
/// </summary>
[DataMember]
[Display(Name = "POWER MODE型態")]
[Column("POWER_MODE_TYPE")]
public int PowerModeType { get; set; } = 1;
@ -55,6 +56,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES
/// </summary>
[Column("POWER_MODE")]
[StringLength(20)]
[Display(Name = "PLM出貨設定")]
[DataMember]
public string PowerMode { get; set; }

Loading…
Cancel
Save