Browse Source

1. 修正PCS027 批次刪除問題

2. 工單查詢可以匯出EXCEL
master
Sai 9 months ago
parent
commit
cfd07b4684
  1. 14
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 4
      AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs
  3. 2
      AMESCoreStudio.Web/Views/PCS/PCS005.cshtml
  4. 6
      AMESCoreStudio.Web/Views/PCS/PCS027.cshtml
  5. 5
      AMESCoreStudio.Web/web.config
  6. 10
      AMESCoreStudio.WebApi/Controllers/AMES/BarcodeItemsController.cs
  7. 2
      AMESCoreStudio.WebApi/Models/AMES/BarcodeItem.cs

14
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -6901,11 +6901,11 @@ namespace AMESCoreStudio.Web.Controllers
return View(result[0]); return View(result[0]);
} }
public async Task<IActionResult> PCS024DAsync(int id) //public async Task<IActionResult> PCS024DAsync(int id)
{ //{
var result = await _pcsApi.DeleteBarcodeItem(id); // var result = await _pcsApi.DeleteBarcodeItem(id,0,0);
return Json(new Result() { success = true, msg = "" }); // return Json(new Result() { success = true, msg = "" });
} //}
[HttpGet] [HttpGet]
public async Task<IActionResult> GetBarcodeInfoesByNoAsync(string id) public async Task<IActionResult> GetBarcodeInfoesByNoAsync(string id)
@ -7161,7 +7161,7 @@ namespace AMESCoreStudio.Web.Controllers
barcodeItemChange.UpdateDate = System.DateTime.Now; barcodeItemChange.UpdateDate = System.DateTime.Now;
await _pcsApi.PostBarcodeItemChange(JsonConvert.SerializeObject(barcodeItemChange)); await _pcsApi.PostBarcodeItemChange(JsonConvert.SerializeObject(barcodeItemChange));
await _pcsApi.DeleteBarcodeItem(item.BarcodeItemID); await _pcsApi.DeleteBarcodeItem(item.BarcodeItemID, item.BarcodeID, item.WipID);
} }
return Json(new Result() { success = true, msg = "刪除成功" }); return Json(new Result() { success = true, msg = "刪除成功" });
} }
@ -7657,7 +7657,7 @@ namespace AMESCoreStudio.Web.Controllers
if (result2.Success) if (result2.Success)
{ {
result = await _pcsApi.DeleteBarcodeItem(id); result = await _pcsApi.DeleteBarcodeItem(id, barcodeItemOld.BarcodeID, barcodeItemOld.WipID);
return Json(new Result() { success = (result.Success), msg = result.Msg }); return Json(new Result() { success = (result.Success), msg = result.Msg });
} }

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

@ -859,8 +859,8 @@ namespace AMESCoreStudio.Web
/// 刪除組件 /// 刪除組件
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[WebApiClient.Attributes.HttpDelete("api/BarcodeItems/{id}")] [WebApiClient.Attributes.HttpDelete("api/BarcodeItems/{id}/{barcodeId}/{wipId}")]
ITask<ResultModel<string>> DeleteBarcodeItem(int id); ITask<ResultModel<string>> DeleteBarcodeItem(int id, int barcodeId, int wipId);
/// <summary> /// <summary>
/// 根據ID獲取指定組件 /// 根據ID獲取指定組件

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

@ -250,7 +250,7 @@
var param = unitNo.value + '_' + wipNo.value + '_' + itemNo.value + '_' + factoryNo.value; var param = unitNo.value + '_' + wipNo.value + '_' + itemNo.value + '_' + factoryNo.value;
//alert(param); //alert(param);
var table = hg.table.datatable('query', '工單資料查詢', '/PCS/PCS005Query/' + param, {}, tableCols, "", true, 'full-100', ['filter', 'print', 'exports']); var table = hg.table.datatable('query', '工單資料查詢', '/PCS/PCS005Query/' + param, {}, 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) {

6
AMESCoreStudio.Web/Views/PCS/PCS027.cshtml

@ -57,6 +57,7 @@
<a class="layui-btn layui-btn-sm layui-btn-normal" id="attachment" title="文件上傳" lay-submit lay-filter="attachment"> <a class="layui-btn layui-btn-sm layui-btn-normal" id="attachment" title="文件上傳" lay-submit lay-filter="attachment">
<i class="layui-icon layui-icon-sm">&#xe62f;</i> <i class="layui-icon layui-icon-sm">&#xe62f;</i>
</a> </a>
<span style="color:red">匯入筆數最多500筆</span>
</div> </div>
</div> </div>
@ -177,10 +178,9 @@
width: 100 width: 100
}, },
{ {
field: 'unLockDate', field: 'createDate',
title: '過站時間', title: '過站時間',
width: 100, templet: '<div>{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd HH:mm:ss") }}</div>'
templet: '<div>{{ layui.util.toDateString(d.unLockDate, "yyyy/MM/dd") }}</div>'
}] }]
]; ];

5
AMESCoreStudio.Web/web.config

@ -14,6 +14,11 @@
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" /> <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables> </environmentVariables>
</aspNetCore> </aspNetCore>
<security>
<requestFiltering>
<requestLimits maxQueryString="32767" maxUrl="65535" />
</requestFiltering>
</security>
</system.webServer> </system.webServer>
</location> </location>
</configuration> </configuration>

10
AMESCoreStudio.WebApi/Controllers/AMES/BarcodeItemsController.cs

@ -704,14 +704,16 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
/// 删除條碼资料 /// 删除條碼资料
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <param name="barcodeId"></param>
/// <param name="wipId"></param>
/// <returns></returns> /// <returns></returns>
// DELETE: api/BarcodeItems/5 [HttpDelete("{id}/{barcodeId}/{wipId}")]
[HttpDelete("{id}")] public async Task<ResultModel<BarcodeItem>> DeleteBarcodeItems(int id,int barcodeId , int wipId)
public async Task<ResultModel<BarcodeItem>> DeleteBarcodeItems(int id)
{ {
ResultModel<BarcodeItem> result = new ResultModel<BarcodeItem>(); ResultModel<BarcodeItem> result = new ResultModel<BarcodeItem>();
//var repairResponsibleUnits = await _context.BarcodeItems.FindAsync(id); //var repairResponsibleUnits = await _context.BarcodeItems.FindAsync(id);
var barcodeItem = await _context.BarcodeItems.Where(m => m.BarcodeItemID == id).FirstOrDefaultAsync(); var barcodeItem = await _context.BarcodeItems.Where(m => m.BarcodeItemID == id &&
m.BarcodeID == barcodeId && m.WipID == wipId).FirstOrDefaultAsync();
if (barcodeItem == null) if (barcodeItem == null)
{ {
result.Success = false; result.Success = false;

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

@ -17,8 +17,8 @@ namespace AMESCoreStudio.WebApi.Models.AMES
[Column("BARCODE_ITEM_ID")] [Column("BARCODE_ITEM_ID")]
[DataMember] [DataMember]
[Display(Name = "條碼組件ID")] [Display(Name = "條碼組件ID")]
[Key]
public int BarcodeItemID { get; set; } public int BarcodeItemID { get; set; }
/// <summary> /// <summary>
/// 内部條碼ID /// 内部條碼ID
/// </summary> /// </summary>

Loading…
Cancel
Save