Browse Source

1. 修改FQC查詢

PTD
Ray 3 years ago
parent
commit
992fe38073
  1. 19
      AMESCoreStudio.Web/Controllers/FQCController.cs
  2. 80
      AMESCoreStudio.Web/Views/FQC/FQC008.cshtml
  3. 39
      AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs
  4. 15
      AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs

19
AMESCoreStudio.Web/Controllers/FQCController.cs

@ -934,5 +934,24 @@ namespace AMESCoreStudio.Web.Controllers
return Json(new Table() { count = 0, data = null }); return Json(new Table() { count = 0, data = null });
} }
#endregion #endregion
/// <summary>
/// 登入UserID
/// </summary>
/// <returns></returns>
public int GetLogInUserID()
{
int user_id = -1;
HttpContext.Request.Cookies.TryGetValue("UserID", out string userID);
if (userID != null)
{
if (int.Parse(userID.ToString()) >= 0)
{
user_id = int.Parse(userID.ToString());
}
}
return user_id;
}
} }
} }

80
AMESCoreStudio.Web/Views/FQC/FQC008.cshtml

@ -23,6 +23,11 @@
border-color: #e6e6e6; border-color: #e6e6e6;
margin: 10px 0; margin: 10px 0;
} }
.layui-table-cell {
height: auto;
white-space: normal;
}
</style> </style>
@ -129,6 +134,18 @@
}); });
var tableCols = [[ var tableCols = [[
{
field: 'werks',
width: 80,
title: '委外廠',
sort: true
},
{
field: 'createDate',
title: '入庫時間',
sort: true,
templet: '<div>{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd HH:mm:ss") }}</div>'
},
{ {
field: 'inhouseNo', field: 'inhouseNo',
width: 150, width: 150,
@ -138,6 +155,7 @@
{ {
field: 'seqID', field: 'seqID',
title: '順序', title: '順序',
width: 80,
sort: true sort: true
}, },
{ {
@ -151,16 +169,16 @@
sort: true sort: true
}, },
{ {
field: 'createDate', field: 'inhouseQty',
title: '入庫時間', width: 80,
sort: true, title: '批量',
templet: '<div>{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd") }}</div>'
},
{
field: 'serialNo',
title: '箱號',
sort: true sort: true
}, },
//{
// field: 'serialNo',
// title: '箱號',
// sort: true
//},
{ {
field: 'statusName', field: 'statusName',
title: '檢驗狀態', title: '檢驗狀態',
@ -173,32 +191,28 @@
sort: true, sort: true,
templet: '<div>{{ layui.util.toDateString(d.endTime, "yyyy/MM/dd") }}</div>' templet: '<div>{{ layui.util.toDateString(d.endTime, "yyyy/MM/dd") }}</div>'
}, },
//, {
//{ field: 'qaMeno',
// field: 'right', title: '備註',
// width: 80, },
// title: '操作', ,
// align: 'center', {
// fixed: 'right', field: 'right',
// templet: function (d) { width: 80,
// return '<button class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-read" lay-event="show">預覽</button>' title: '操作',
// } align: 'center',
//} fixed: 'right',
templet: function (d) {
return '<a class="layui-btn layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a>'
}
}
]]; ]];
//通过行tool编辑,lay-event="edit"
//通过行tool编辑,lay-event="show" function edit(obj) {
function show(obj) { if (obj.data.wipID) {
layui.use('layer', function () { hg.open('修改工單資料', '/PCS/PCS003/' + obj.data.wipID, '', '', true);
var layer = layui.layer; }
layer.open({ }
type: 2,
area: ['900px', '650px'],
fixed: false, //不固定
maxmin: true,
content: obj.data.filePath + obj.data.newName
});
});
};
//基本数据表格 //基本数据表格
var table = hg.table.datatable('query', 'FQC查詢', '/FQC/FQC008Query', {}, tableCols, '', true, 'full-100', ['filter', 'print', 'exports']); var table = hg.table.datatable('query', 'FQC查詢', '/FQC/FQC008Query', {}, tableCols, '', true, 'full-100', ['filter', 'print', 'exports']);

39
AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs

@ -95,22 +95,25 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
public async Task<ResultModel<FqcInhouseMasterDto>> GetFqcInhouseMasterQuery(string barcodeNo, string wipNo, string boxNo public async Task<ResultModel<FqcInhouseMasterDto>> GetFqcInhouseMasterQuery(string barcodeNo, string wipNo, string boxNo
, string inhouseNo, string date_str, string date_end, string status, int page = 0, int limit = 10) , string inhouseNo, string date_str, string date_end, string status, int page = 0, int limit = 10)
{ {
IQueryable<FqcInhouseMasterDto> q = from q1 in _context.FqcInhouseMasters var q = from q1 in _context.FqcInhouseMasters
join q2 in _context.FqcInhouseDetails on new { q1.InhouseNo, q1.SeqID } equals new { q2.InhouseNo, q2.SeqID } //join q2 in _context.FqcInhouseDetails on new { q1.InhouseNo, q1.SeqID } equals new { q2.InhouseNo, q2.SeqID }
join q3 in _context.FqcResultMasters on q1.InhouseNo equals q3.InhouseNo join q3 in _context.FqcResultMasters on q1.InhouseNo equals q3.InhouseNo
select new FqcInhouseMasterDto join q4 in _context.WipInfos on q1.WipNo equals q4.WipNO into s
{ from q4 in s.DefaultIfEmpty()
InhouseNo = q1.InhouseNo, select new FqcInhouseMasterDto
SeqID = q1.SeqID, {
WipNo = q1.WipNo, Werks = q4.Werks,
ItemNo = q1.ItemNo, InhouseNo = q1.InhouseNo,
ModelNo = q1.ModelNo, SeqID = q1.SeqID,
SerialNo = q2.SerialNo, WipNo = q1.WipNo,
StatusName = q1.Status, ItemNo = q1.ItemNo,
ProTypeName = q1.ProType, InhouseQty = q1.InhouseQty,
CreateDate = q1.CreateDate, ModelNo = q1.ModelNo,
EndTime = q3.EndTime StatusName = q1.Status,
}; ProTypeName = q1.ProType,
CreateDate = q1.CreateDate,
EndTime = q3.EndTime
};
//q1.Status == "P" ? "允收" : q1.Status == "R" ? "批退" : "未驗收完成", //q1.Status == "P" ? "允收" : q1.Status == "R" ? "批退" : "未驗收完成",
//IQueryable <FqcInhouseDetail> q1 = _context.FqcInhouseDetails; //IQueryable <FqcInhouseDetail> q1 = _context.FqcInhouseDetails;
if (!string.IsNullOrWhiteSpace(inhouseNo)) if (!string.IsNullOrWhiteSpace(inhouseNo))
@ -158,7 +161,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
{ {
q = q.Skip((page - 1) * limit).Take(limit); q = q.Skip((page - 1) * limit).Take(limit);
} }
result.Data = await q.ToListAsync(); result.Data = await q.Distinct().ToListAsync();
// 判斷結束時間 // 判斷結束時間
result.Data = result.Data.Select(s => { s.EndTime = s.StatusName == "A" ? null : s.EndTime; return s; }) result.Data = result.Data.Select(s => { s.EndTime = s.StatusName == "A" ? null : s.EndTime; return s; })
@ -277,7 +280,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
public async Task<ResultModel<FqcInhouseMaster>> PostFqcInhouseMaster(FqcInhouseMaster fqcInhouseMaster) public async Task<ResultModel<FqcInhouseMaster>> PostFqcInhouseMaster(FqcInhouseMaster fqcInhouseMaster)
{ {
ResultModel<FqcInhouseMaster> result = new ResultModel<FqcInhouseMaster>(); ResultModel<FqcInhouseMaster> result = new ResultModel<FqcInhouseMaster>();
try try
{ {
_context.FqcInhouseMasters.Add(fqcInhouseMaster); _context.FqcInhouseMasters.Add(fqcInhouseMaster);

15
AMESCoreStudio.WebApi/DTO/AMES/FqcInhouseMasterDto.cs

@ -15,6 +15,12 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
public partial class FqcInhouseMasterDto public partial class FqcInhouseMasterDto
{ {
/// <summary>
/// 委外廠
/// </summary>
[DataMember]
public string Werks { get; set; }
/// <summary> /// <summary>
/// 入庫單號碼 /// 入庫單號碼
/// </summary> /// </summary>
@ -49,6 +55,13 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
[Display(Name = "品名/機種")] [Display(Name = "品名/機種")]
public string ModelNo { get; set; } public string ModelNo { get; set; }
/// <summary>
/// 批量
/// </summary>
[DataMember]
[Display(Name = "批量")]
public int InhouseQty { get; set; }
/// <summary> /// <summary>
/// 箱號/條碼 /// 箱號/條碼
/// </summary> /// </summary>
@ -61,7 +74,6 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
[DataMember] [DataMember]
[Display(Name = "抽驗狀態")] [Display(Name = "抽驗狀態")]
public string StatusName { get; set; } = "A"; public string StatusName { get; set; } = "A";
/// <summary> /// <summary>
@ -77,7 +89,6 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
/// </summary> /// </summary>
[DataMember] [DataMember]
[Display(Name = "結束抽驗時間")] [Display(Name = "結束抽驗時間")]
public DateTime? EndTime { get; set; } public DateTime? EndTime { get; set; }
/// <summary> /// <summary>

Loading…
Cancel
Save