Browse Source

1. 工單鎖定 加入ECN選項

2. 工單資料維護 新增981工單可查詢目前DB KeyParts數量
PTD
Ray 2 years ago
parent
commit
6e4ca468e2
  1. 74
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 381
      AMESCoreStudio.Web/Views/PCS/PCS003.cshtml

74
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -874,6 +874,11 @@ namespace AMESCoreStudio.Web.Controllers
{
Text = "驗證工單",
Value = "1",
},
new SelectListItem
{
Text = "ECN",
Value = "2",
},
new SelectListItem
{
@ -1399,7 +1404,6 @@ namespace AMESCoreStudio.Web.Controllers
return Json(new { data = items });
}
/// <summary>
/// 取出貨序號 取到資料先儲存出貨序號
/// </summary>
@ -1523,6 +1527,18 @@ namespace AMESCoreStudio.Web.Controllers
}
/// <summary>
/// 取It提供的工單EAN
/// </summary>
/// <param name="wipNo">工單號碼</param>
/// <returns></returns>
[HttpPost]
public async Task<JsonResult> GetKpDbCount(string wipNo)
{
var result = await _pcsApi.GetWipKpByWipNo(wipNo);
return Json(new Result() { success = true, data = result.Count() });
}
#endregion
///// <summary>
@ -5952,7 +5968,7 @@ namespace AMESCoreStudio.Web.Controllers
string Msg = string.Empty;
bool Success = true;
if(string.IsNullOrWhiteSpace(model.Input))
if (string.IsNullOrWhiteSpace(model.Input))
return Json(new Result1() { success = Success, msg = Msg, data = "", data1 = "" });
string Data = model.Input.ToUpper();
@ -7347,9 +7363,9 @@ namespace AMESCoreStudio.Web.Controllers
IResultModel<FqcInhouseMaster_WareDto> result;
if (factority == "1")
{
result = await _pcsApi.GetFqcInhouseMasterMultiQuery(barcodeNo: barcodeNo, wipNo: wipNo
, boxNo: boxNo, inhouseNo: inhouseNo, date_str: date_str, date_end: date_end
, status: status, page: page, limit: limit);
result = await _pcsApi.GetFqcInhouseMasterMultiQuery(barcodeNo: barcodeNo, wipNo: wipNo
, boxNo: boxNo, inhouseNo: inhouseNo, date_str: date_str, date_end: date_end
, status: status, page: page, limit: limit);
}
else
@ -7426,7 +7442,7 @@ namespace AMESCoreStudio.Web.Controllers
}
}
public async Task<IActionResult> PCS031inhouseAsync(string InhouseNo, string boxNo, int seq, string recordNumber, string locationNo,string factorityID)
public async Task<IActionResult> PCS031inhouseAsync(string InhouseNo, string boxNo, int seq, string recordNumber, string locationNo, string factorityID)
{
var result = await PCS0311inhouse(InhouseNo, boxNo, seq, recordNumber, locationNo, factorityID);
return Json(new Result() { success = result.success, msg = result.msg });
@ -7447,11 +7463,11 @@ namespace AMESCoreStudio.Web.Controllers
var result1 = new List<FqcInhouseDetail>();
if (factorityID == "1")
{
result1 = await _pcsApi.GetWareHouseing(inhouseNo: InhouseNo, seq: seq);
result1 = await _pcsApi.GetWareHouseing(inhouseNo: InhouseNo, seq: seq);
}
else
{
result1 = await _pcsApi.GetWareHouseing_EVER(inhouseNo: InhouseNo, seq: seq);
result1 = await _pcsApi.GetWareHouseing_EVER(inhouseNo: InhouseNo, seq: seq);
}
if (result1.Count() > 0)
@ -7465,11 +7481,11 @@ namespace AMESCoreStudio.Web.Controllers
var result = new List<BarcodeInfo>();
if (factorityID == "1")
{
result = await _fqcApi.GetBarcodeInfoesByBoxNo(boxNo: boxNo);
result = await _fqcApi.GetBarcodeInfoesByBoxNo(boxNo: boxNo);
}
else
{
result = await _pcsApi.GetBarcodeInfoesByBoxNo_EVER(boxNo: boxNo);
result = await _pcsApi.GetBarcodeInfoesByBoxNo_EVER(boxNo: boxNo);
}
if (result.Count() != 0)
@ -7530,7 +7546,7 @@ namespace AMESCoreStudio.Web.Controllers
var FlowRules_result = new List<FlowRule>();
if (factorityID == "1")
{
FlowRules_result = await _basApi.GetFlowRulesByUnit("W");
FlowRules_result = await _basApi.GetFlowRulesByUnit("W");
}
else
{
@ -7543,11 +7559,11 @@ namespace AMESCoreStudio.Web.Controllers
var ruleStations_result = new List<RuleStation>();
if (factorityID == "1")
{
ruleStations_result = await GetRuleStationByFlowRuleID(FlowRuleID);
ruleStations_result = await GetRuleStationByFlowRuleID(FlowRuleID);
}
else
{
ruleStations_result = await GetRuleStationByFlowRuleID_EVER(FlowRuleID);
ruleStations_result = await GetRuleStationByFlowRuleID_EVER(FlowRuleID);
}
if (ruleStations_result.Count() != 0)
@ -7568,16 +7584,16 @@ namespace AMESCoreStudio.Web.Controllers
var WipAtt_result = new WipAtt();
if (factorityID == "1")
{
WipAtt_result = await _pcsApi.GetWipAtt(Wipinfo_result.Select(s => s.WipNO).First()); //料號
WipAtt_result = await _pcsApi.GetWipAtt(Wipinfo_result.Select(s => s.WipNO).First()); //料號
}
else
{
WipAtt_result = await _pcsApi.GetWipAtt_EVER(Wipinfo_result.Select(s => s.WipNO).First()); //料號
WipAtt_result = await _pcsApi.GetWipAtt_EVER(Wipinfo_result.Select(s => s.WipNO).First()); //料號
}
var Userinfo_result = new List<UserInfo>();
var Userinfo_result = new List<UserInfo>();
if (factorityID == "1")
{
Userinfo_result = await _sysApi.GetUserInfo(GetLogInUserID());
Userinfo_result = await _sysApi.GetUserInfo(GetLogInUserID());
}
else
{
@ -7589,23 +7605,23 @@ namespace AMESCoreStudio.Web.Controllers
var fqcInhouseMaster = new FqcInhouseMaster();
if (factorityID == "1")
{
fqcInhouseMaster = await _fqcApi.GetFqcInhouseMaster(InhouseNo, seq);
fqcInhouseMaster = await _fqcApi.GetFqcInhouseMaster(InhouseNo, seq);
}
else
{
fqcInhouseMaster = await _pcsApi.GetFqcInhouseMaster_EVER(InhouseNo, seq);
fqcInhouseMaster = await _pcsApi.GetFqcInhouseMaster_EVER(InhouseNo, seq);
}
fqcInhouseMaster.LocationNo = locationNo;
var result_FQC = new ResultModel<FqcInhouseMaster>();
var result_FQC = new ResultModel<FqcInhouseMaster>();
if (factorityID == "1")
{
result_FQC = await _fqcApi.PutFqcInhouseMaster(JsonConvert.SerializeObject(fqcInhouseMaster));
result_FQC = await _fqcApi.PutFqcInhouseMaster(JsonConvert.SerializeObject(fqcInhouseMaster));
}
else
{
result_FQC = await _pcsApi.PutFqcInhouseMaster_EVER(JsonConvert.SerializeObject(fqcInhouseMaster));
result_FQC = await _pcsApi.PutFqcInhouseMaster_EVER(JsonConvert.SerializeObject(fqcInhouseMaster));
}
if (!result_FQC.Success)
@ -7770,22 +7786,22 @@ namespace AMESCoreStudio.Web.Controllers
#endregion
#region PCS031V入庫單箱號查詢
public async Task<IActionResult> PCS031V(string Factory_API,string InhouseNo, int SeqID)
public async Task<IActionResult> PCS031V(string Factory_API, string InhouseNo, int SeqID)
{
var model = new FqcDto();
model.InhouseNo = InhouseNo;// "QWO0002A1001";
model.SeqID = SeqID;
IResultModel<FqcDto> result;
if (Factory_API == "1")
{
result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID);
}
else
else
{
result = await _pcsApi.GetFqcQuery_EVER(model.InhouseNo, model.SeqID);
}
if (result.Data.Count() != 0)
{
model = result.Data.FirstOrDefault();
@ -7824,7 +7840,7 @@ namespace AMESCoreStudio.Web.Controllers
{
result = await _pcsApi.GetFqcQuery_EVER(model.InhouseNo, model.SeqID);
}
if (result.Data.Count() != 0)
{
@ -7847,7 +7863,7 @@ namespace AMESCoreStudio.Web.Controllers
#region PCS031Q入庫單箱號查詢
// [HttpGet]
public async Task<IActionResult> PCS031Q(string BoxNo,string factorityID)
public async Task<IActionResult> PCS031Q(string BoxNo, string factorityID)
{
@ -7885,7 +7901,7 @@ namespace AMESCoreStudio.Web.Controllers
if (factorityID == "1")
{
result = await _pcsApi.GetBarcodeInfoesByBoxNoPCS031Q(boxNo: id, page: page, limit: limit);
result = await _pcsApi.GetBarcodeInfoesByBoxNoPCS031Q(boxNo: id, page: page, limit: limit);
}
else
{

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

@ -250,14 +250,14 @@
<tbody>
@foreach (var index in Model.wipBarcodes)
{
<tr>
<td>
@index.StartNO
</td>
<td>
@index.EndNO
</td>
</tr>
<tr>
<td>
@index.StartNO
</td>
<td>
@index.EndNO
</td>
</tr>
}
</tbody>
</table>
@ -309,14 +309,14 @@
<tbody>
@foreach (var index in Model.wipMACs)
{
<tr>
<td>
@index.Title@index.StartNO
</td>
<td>
@index.Title@index.EndNO
</td>
</tr>
<tr>
<td>
@index.Title@index.StartNO
</td>
<td>
@index.Title@index.EndNO
</td>
</tr>
}
</tbody>
</table>
@ -346,6 +346,11 @@
<button type="button" id="attachment" title="文件上傳" lay-submit lay-filter="attachment" class="layui-btn layui-btn-normal">
<i class="layui-icon layui-icon-upload-circle" style="font-size: 20px"></i>
</button>
<span>確認筆數:</span>
<input class="layui-input" style="width:50px;display: initial;" id="wipKpDbCount" name="wipKpDbCount" readonly="readonly" />
<a onclick="GetKpDbCount();" class="layui-btn layui-btn-sm layui-btn-normal" style="padding: 0 5px;" title="更新燒機資訊">
<i class="layui-icon layui-icon-sm">&#xe669;</i>
</a>
</div>
</div>
<input type="hidden" value=@Model.WipKps.Count() id="WipKpCount" />
@ -381,30 +386,30 @@
<tbody>
@foreach (var index in Model.WipKps)
{
<tr>
<td>
<input name="WipKps[@k].WipKpID" type="hidden" value="@index.WipKpID" />
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.KpName" name="WipKps[@k].KpName" />
</td>
<td>
<select asp-for="@index.KpNo" name="WipKps[@k].KpNo" asp-items="@ViewBag.ItemsList" class=""></select>
</td>
<td>
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.KpSeq" name="WipKps[@k].KpSeq" />
</td>
<td>
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.Title" name="WipKps[@k].Title" />
</td>
<td>
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.Length" name="WipKps[@k].Length" />
</td>
<td>
<select asp-for="@index.UnitNo" name="WipKps[@k].UnitNo" asp-items="@ViewBag.FactoryUnitByWipNo" class=""></select>
</td>
<td>
<a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a>
</td>
</tr>
<tr>
<td>
<input name="WipKps[@k].WipKpID" type="hidden" value="@index.WipKpID" />
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.KpName" name="WipKps[@k].KpName" />
</td>
<td>
<select asp-for="@index.KpNo" name="WipKps[@k].KpNo" asp-items="@ViewBag.ItemsList" class=""></select>
</td>
<td>
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.KpSeq" name="WipKps[@k].KpSeq" />
</td>
<td>
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.Title" name="WipKps[@k].Title" />
</td>
<td>
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.Length" name="WipKps[@k].Length" />
</td>
<td>
<select asp-for="@index.UnitNo" name="WipKps[@k].UnitNo" asp-items="@ViewBag.FactoryUnitByWipNo" class=""></select>
</td>
<td>
<a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a>
</td>
</tr>
k++;
}
</tbody>
@ -455,11 +460,11 @@
<input asp-for="itemNoCT1" type="hidden" value="@Model.itemNoCT1" />
@if (!string.IsNullOrWhiteSpace(Model.itemNoCT1))
{
<span style="color:red">有維護標準工時</span>
<span style="color:red">有維護標準工時</span>
}
else
{
<span style="color:red">**無維護標準工時**</span>
<span style="color:red">**無維護標準工時**</span>
}
</div>
</div>
@ -502,9 +507,18 @@
<label class="layui-form-label">DIP</label>
<div class="layui-input-block">
<cl-checkbox asp-items="@ViewBag.GetCheckboxDIP" asp-for="wipBoard.DipSides" asp-skin="defult"></cl-checkbox>
<input @if (Model.wipBoard != null) { @(Model.wipBoard.DipCarrier == "Y" ? "checked" : "") } type="checkbox" title="CARRIER" name="wipBoard.DipCarrier" />
<input @if (Model.wipBoard != null) { @(Model.wipBoard.DipTape == "Y" ? "checked" : "") } type="checkbox" title="貼付膠帶" name="wipBoard.DipTape" />
<input @if (Model.wipBoard != null) { @(Model.wipBoard.DipSolderMask == "Y" ? "checked" : "") } type="checkbox" title="點防焊膠" name="wipBoard.DipSolderMask" />
<input @if (Model.wipBoard != null)
{
@(Model.wipBoard.DipCarrier == "Y" ? "checked" : "")
} type="checkbox" title="CARRIER" name="wipBoard.DipCarrier" />
<input @if (Model.wipBoard != null)
{
@(Model.wipBoard.DipTape == "Y" ? "checked" : "")
} type="checkbox" title="貼付膠帶" name="wipBoard.DipTape" />
<input @if (Model.wipBoard != null)
{
@(Model.wipBoard.DipSolderMask == "Y" ? "checked" : "")
} type="checkbox" title="點防焊膠" name="wipBoard.DipSolderMask" />
</div>
</div>
</div>
@ -520,7 +534,10 @@
<div class="layui-inline">
<label class="layui-form-label">燒錄</label>
<div class="layui-input-inline">
<input @if (Model.wipBoard != null) { @(Model.wipBoard.Burn == "Y" ? "checked" : "") } type="checkbox" title="是否燒入" name="wipBoard.Burn" />
<input @if (Model.wipBoard != null)
{
@(Model.wipBoard.Burn == "Y" ? "checked" : "")
} type="checkbox" title="是否燒入" name="wipBoard.Burn" />
</div>
<label class="layui-form-label">燒機位置</label>
@ -541,7 +558,10 @@
<div class="layui-inline">
<label class="layui-form-label">零件烘烤</label>
<div class="layui-input-inline">
<input @if (Model.wipBoard != null) { @(Model.wipBoard.ISPartsBake == "Y" ? "checked" : "") } type="checkbox" title="零件是否需要烘烤" name="wipBoard.ISPartsBake" />
<input @if (Model.wipBoard != null)
{
@(Model.wipBoard.ISPartsBake == "Y" ? "checked" : "")
} type="checkbox" title="零件是否需要烘烤" name="wipBoard.ISPartsBake" />
</div>
<label class="layui-form-label">零件烘烤溫度</label>
<div class="layui-input-inline" style="width:100px">
@ -554,7 +574,10 @@
</div>
<div class="layui-input-inline">
<input @if (Model.wipBoard != null) { @(Model.wipBoard.PartsBakeOvertime == "Y" ? "checked" : "") } type="checkbox" title="零件烘烤超過48hrs" name="wipBoard.PartsBakeOvertime" />
<input @if (Model.wipBoard != null)
{
@(Model.wipBoard.PartsBakeOvertime == "Y" ? "checked" : "")
} type="checkbox" title="零件烘烤超過48hrs" name="wipBoard.PartsBakeOvertime" />
</div>
</div>
</div>
@ -570,7 +593,10 @@
<div class="layui-inline">
<label class="layui-form-label">PCB烘烤</label>
<div class="layui-input-inline">
<input @if (Model.wipBoard != null) { @(Model.wipBoard.ISPcbBake == "Y" ? "checked" : "") } type="checkbox" title="PCB是否需要烘烤" name="wipBoard.ISPcbBake" />
<input @if (Model.wipBoard != null)
{
@(Model.wipBoard.ISPcbBake == "Y" ? "checked" : "")
} type="checkbox" title="PCB是否需要烘烤" name="wipBoard.ISPcbBake" />
</div>
<div class="layui-input-inline">
<select asp-items="@ViewBag.GetPCBBakeTypeSelect" asp-for="wipBoard.PcbBake" class=""></select>
@ -700,11 +726,11 @@
<input asp-for="itemNoCT1" type="hidden" value="@Model.itemNoCT1" />
@if (!string.IsNullOrWhiteSpace(Model.itemNoCT1))
{
<span style="color:red">有維護標準工時</span>
<span style="color:red">有維護標準工時</span>
}
else
{
<span style="color:red">**無維護標準工時**</span>
<span style="color:red">**無維護標準工時**</span>
}
</div>
</div>
@ -878,7 +904,10 @@
<div class="layui-inline">
<label class="layui-form-label">FINE_PACKAGE</label>
<div class="layui-input-inline">
<input @if (Model.wipSystem != null) { @(Model.wipSystem.FinePackage == "Y" ? "checked" : "") } type="checkbox" title="是否為精裝" name="wipSystem.FinePackage" />
<input @if (Model.wipSystem != null)
{
@(Model.wipSystem.FinePackage == "Y" ? "checked" : "")
} type="checkbox" title="是否為精裝" name="wipSystem.FinePackage" />
</div>
</div>
</div>
@ -952,23 +981,23 @@
<tbody>
@foreach (var index in Model.WipOutfits)
{
<tr>
<tr>
<td>
<input name="WipOutfits[@l].WipOutfitID" type="hidden" value="@index.WipOutfitID" />
<select asp-for="@index.PartNo" name="WipOutfits[@l].PartNo" asp-items="@ViewBag.OutfitCommodityInfo" class=""></select>
</td>
<td>
<select asp-for="@index.UnitNo" name="WipOutfits[@l].UnitNo" asp-items="@ViewBag.FactoryUnitByWipNo" class=""></select>
</td>
<td>
<select asp-for="@index.StationID" name="WipOutfits[@l].StationID" asp-items="@ViewBag.RuleStationByWipNoUnitNoList" class=""></select>
</td>
<td>
<a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a>
</td>
</tr>
<td>
<input name="WipOutfits[@l].WipOutfitID" type="hidden" value="@index.WipOutfitID" />
<select asp-for="@index.PartNo" name="WipOutfits[@l].PartNo" asp-items="@ViewBag.OutfitCommodityInfo" class=""></select>
</td>
<td>
<select asp-for="@index.UnitNo" name="WipOutfits[@l].UnitNo" asp-items="@ViewBag.FactoryUnitByWipNo" class=""></select>
</td>
<td>
<select asp-for="@index.StationID" name="WipOutfits[@l].StationID" asp-items="@ViewBag.RuleStationByWipNoUnitNoList" class=""></select>
</td>
<td>
<a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a>
</td>
</tr>
l++;
}
</tbody>
@ -994,8 +1023,8 @@
SOP文件敘述
</th>
@*<th>
檔案路徑
</th>*@
檔案路徑
</th>*@
<th>
SOP類型
</th>
@ -1013,27 +1042,27 @@
<tbody>
@foreach (var index in Model.WipSops)
{
<tr>
<td>
<input name="WipSops[@i].WipSOPID" type="hidden" value="@index.WipSOPID" />
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.SOPName" name="WipSops[@i].SOPName" />
</td>
@*<td>
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.SOPPath" name="WipSops[@i].SOPPath" />
</td>*@
<td>
<select asp-for="@index.SOPType" name="WipSops[@i].SOPType" asp-items="@ViewBag.GetSOPTypeSelect" class=""></select>
</td>
<td>
<select asp-for="@index.UnitNo" name="WipSops[@i].UnitNo" asp-items="@ViewBag.FactoryUnitByWipNo" class=""></select>
</td>
<td>
<input onfocus="this.blur()" class="layui-input" asp-for="@index.SOPVer" name="WipSops[@i].SOPVer" />
</td>
<td>
<a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a>
</td>
</tr>
<tr>
<td>
<input name="WipSops[@i].WipSOPID" type="hidden" value="@index.WipSOPID" />
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.SOPName" name="WipSops[@i].SOPName" />
</td>
@*<td>
<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" asp-for="@index.SOPPath" name="WipSops[@i].SOPPath" />
</td>*@
<td>
<select asp-for="@index.SOPType" name="WipSops[@i].SOPType" asp-items="@ViewBag.GetSOPTypeSelect" class=""></select>
</td>
<td>
<select asp-for="@index.UnitNo" name="WipSops[@i].UnitNo" asp-items="@ViewBag.FactoryUnitByWipNo" class=""></select>
</td>
<td>
<input onfocus="this.blur()" class="layui-input" asp-for="@index.SOPVer" name="WipSops[@i].SOPVer" />
</td>
<td>
<a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a>
</td>
</tr>
i++;
}
</tbody>
@ -1105,23 +1134,23 @@
<tbody>
@foreach (var index in Model.wipInfoBlobs)
{
<tr>
<td>
<span id="FileName">@index.ImageName</span>
</td>
<td>
<span id="Filepath">@index.Filepath</span>
</td>
<td>
<span id="Remark">@index.Remark</span>
<tr>
<td>
<span id="FileName">@index.ImageName</span>
</td>
<td>
<span id="Filepath">@index.Filepath</span>
</td>
<td>
<span id="Remark">@index.Remark</span>
</td>
<td>
<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-read" onclick="show(this)">預覽</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" onclick="filedownload(this)">下載</a>
<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-danger" onclick="deleteFile(this)">刪除</a>
</td>
</tr>
</td>
<td>
<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-read" onclick="show(this)">預覽</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" onclick="filedownload(this)">下載</a>
<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-danger" onclick="deleteFile(this)">刪除</a>
</td>
</tr>
}
</tbody>
</table>
@ -1340,7 +1369,7 @@
});
// 產生MAC
$("#GetMAC").click(function (event) {
$("#GetMAC").click(function (event) {
var wipNO = $('#wipAtt_ItemNO').val();
var planQTY = $('#wipInfo_PlanQTY').val();
if (wipNO == '' || !wipNO) {
@ -1970,18 +1999,18 @@
hg.msghide("查無資料,不需要更新!");
}
else {
var result_data = result.data.eaN_NO;
console.log(result_data.eaN_NO);
if (result_data.length == 0) {
hg.msghide("不需要更新!");
}
else if ('@Model.wipAtt.ECN' != result_data) {
layer.confirm('比對與PLM ECN/ECR不一樣,確定更新ECN/ECR嗎?', {
btn: ['確定', '取消']
}, function () {
layer.closeAll('dialog');
$("#wipAtt_ECN").val(result_data);
})
var result_data = result.data.eaN_NO;
console.log(result_data.eaN_NO);
if (result_data.length == 0) {
hg.msghide("不需要更新!");
}
else if ('@Model.wipAtt.ECN' != result_data) {
layer.confirm('比對與PLM ECN/ECR不一樣,確定更新ECN/ECR嗎?', {
btn: ['確定', '取消']
}, function () {
layer.closeAll('dialog');
$("#wipAtt_ECN").val(result_data);
})
}
}
}
@ -2024,59 +2053,77 @@
layer.confirm('確定要同步料號SOP資料嗎?', {
btn: ['確定', '取消']
}, function () {
$.ajax({
type: "POST",
url: "@Url.Action("GetMaterialSop", "PCS")",
type: "Post",
async: true,
data: { "ItemNo": '@Model.wipAtt.ItemNO' },
success: function (result) {
if (result.success) {
let No = 0;
var Unit = getFactoryUnitByWipNoList();
var SopType = getSOPType();
$("#SopTable").find("tr:not(:first)").remove();
$.each(result.data, function (index, item) {
var FactoryUnit = Unit;
var Select = "<select id=WipSops[" + No + "].UnitNo name=WipSops[" + No + "].UnitNo>";
$.each(FactoryUnit, function (index, item1) {
if (item1.value == item.unitNo) {
Select += '<option value=' + item1.value + '>' + item1.text + '</option>';
}
});
Select += '</select>';
var SoptypeItem = SopType;
var SelectSoptype = "<select id=WipSops[" + No + "].SOPType name=WipSops[" + No + "].SOPType>";
$.each(SoptypeItem, function (index, item2) {
if (item2.value == item.sopType) {
SelectSoptype += '<option value=' + item2.value + '>' + item2.text + '</option>';
}
$.ajax({
type: "POST",
url: "@Url.Action("GetMaterialSop", "PCS")",
type: "Post",
async: true,
data: { "ItemNo": '@Model.wipAtt.ItemNO' },
success: function (result) {
if (result.success) {
let No = 0;
var Unit = getFactoryUnitByWipNoList();
var SopType = getSOPType();
$("#SopTable").find("tr:not(:first)").remove();
$.each(result.data, function (index, item) {
var FactoryUnit = Unit;
var Select = "<select id=WipSops[" + No + "].UnitNo name=WipSops[" + No + "].UnitNo>";
$.each(FactoryUnit, function (index, item1) {
if (item1.value == item.unitNo) {
Select += '<option value=' + item1.value + '>' + item1.text + '</option>';
}
});
Select += '</select>';
var SoptypeItem = SopType;
var SelectSoptype = "<select id=WipSops[" + No + "].SOPType name=WipSops[" + No + "].SOPType>";
$.each(SoptypeItem, function (index, item2) {
if (item2.value == item.sopType) {
SelectSoptype += '<option value=' + item2.value + '>' + item2.text + '</option>';
}
});
SelectSoptype += '</select>';
var contactdiv = '<tr>' +
'<td><input type="hidden" value="" name="WipSops[' + No + '].WipSOPID" />' +
'<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" name="WipSops[' + No + '].SOPName" value=' + item.sopName + ' /></td>' +
'<td>' + SelectSoptype + '</td>' +
'<td>' + Select + '</td>' +
'<td> <input onfocus="this.blur()" class="layui-input" name="WipSops[' + No + '].SOPVer" /></td>' +
'<td><a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a></td>' +
'</tr>';
$('#SopTable').append(contactdiv);
No += 1;
});
SelectSoptype += '</select>';
var contactdiv = '<tr>' +
'<td><input type="hidden" value="" name="WipSops[' + No + '].WipSOPID" />' +
'<input onkeypress="if( event.keyCode == 13 ) { return false; }" class="layui-input" name="WipSops[' + No + '].SOPName" value=' + item.sopName + ' /></td>' +
'<td>' + SelectSoptype + '</td>' +
'<td>' + Select + '</td>' +
'<td> <input onfocus="this.blur()" class="layui-input" name="WipSops[' + No + '].SOPVer" /></td>' +
'<td><a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" onclick="Remove(this);">刪除</a></td>' +
'</tr>';
$('#SopTable').append(contactdiv);
No += 1;
});
$('#WipSopCount').val(No);
layui.form.render("select");//重新渲染 固定写法
$('#WipSopCount').val(No);
layui.form.render("select");//重新渲染 固定写法
}
else {
hg.msg("同步SOP失敗:" + result.data);
}
},
error: function () {
hg.msg("同步SOP失敗");
}
else {
hg.msg("同步SOP失敗:" + result.data);
});
layer.closeAll('dialog');
})
}
// 抓DB目前KP數量
function GetKpDbCount() {
$.ajax({
url: "@Url.Action("GetKpDbCount", "PCS")",
type: "Post",
async: true,
data: { "wipNo": '@Model.wipInfo.WipNO' },
success: function (result) {
if (result.success) {
$("#wipKpDbCount").val(result.data);
}
},
error: function () {
hg.msg("同步SOP失敗");
error: function (result) {
parent.hg.msg(`呼叫API失敗`);
}
});
layer.closeAll('dialog');
})
}
</script>
}

Loading…
Cancel
Save