@{
ViewBag.Title = "ProdResultsProdActualDetail";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@Html.AntiForgeryToken()
<div class="x-body">
<div id="frmProdActualDetail" class="layui-form layui-form-pane">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" style="width:130px;">产品序列号</label>
<div class="layui-input-inline ">
<input type="text" id="subLotId" name="subLotId" maxlength="50" autocomplete="off" class="layui-input rd" readonly>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width:130px;">订单编号</label>
<div class="layui-input-inline">
<input type="text" id="orderNo" name="orderNo" maxlength="25" autocomplete="off" class="layui-input rd" readonly>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" style="width:130px;">产品名称</label>
<div class="layui-input-inline ">
<input type="text" id="productName" name="productName" maxlength="25" autocomplete="off" class="layui-input rd" readonly>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width:130px;">产品图号</label>
<div class="layui-input-inline">
<input type="text" id="productNo" name="productNo" maxlength="25" autocomplete="off" class="layui-input rd" readonly>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" style="width:130px;">工艺路线编号</label>
<div class="layui-input-inline ">
<input type="text" id="processNo" name="processNo" maxlength="25" autocomplete="off" class="layui-input rd" readonly>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width:130px;">工艺路线版本</label>
<div class="layui-input-inline">
<input type="text" id="processVersion" name="processVersion" maxlength="10" autocomplete="off" class="layui-input rd" readonly>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">工程版本</label>
<div class="layui-input-inline">
<input type="text" id="allotStepVersion" name="allotStepVersion" maxlength="10" autocomplete="off" class="layui-input rd" readonly>
</div>
</div>
</div>
<div>
<div style="width:100%;">
工序履历表
</div>
<table class="layui-table" id="prodHistory" lay-filter="prodHistory"></table>
</div>
<div class="layui-row">
<div class="layui-col-sm6" style="padding-right:10px;">
工步履历表
</div>
<div class="layui-col-sm6" style="padding-left:10px;">
步骤履历表
</div>
</div>
<div class="layui-row" style="height:280px;">
<div class="layui-col-sm6" style="padding-right:10px;margin-top:-6px;">
<table class="layui-table" id="workStepHistory" lay-filter="workStepHistory"></table>
</div>
<div class="layui-col-sm6" style="padding-left:10px;margin-top:-6px;">
<table class="layui-table" id="stepHistory" lay-filter="stepHistory"></table>
</div>
</div>
<div class="layui-row">
<div class="layui-col-sm12">
@* 表单按钮--详情 *@
<script type="text/html" id="toolBarTpl">
<a lay-event="upload" class="layui-btn layui-btn-xs "><i class="layui-icon"></i>文件上传</a>
</script>
<table class="layui-table" id="dataTable" lay-filter="lfTable"></table>
动作履历表
</div>
</div>
<div class="layui-row" style="height:340px;">
<div class="layui-col-sm12" style="padding-right:10px;margin-top:-6px;">
<table class="layui-table" id="actionHistory" lay-filter="actionHistory"></table>
</div>
</div>
</div>
</div>
<script>
layui.use(['table', 'form','upload'], function () {
var layer = layui.layer;
var table = layui.table;
var upload = layui.upload;
var qrySubLotId = '@ViewBag.subLotId';
//工序履历表
table.render({
elem: '#prodHistory'
, even: true
, autoSort: false
, page: false
, height: 280
, cols: [[
{ field: 'WORKBENCHCODE', title: '作业台编号', width: 120, },
{ field: 'WORKBENCHNAME', title: '作业台名称', width: 130, },
{ field: 'LOTNO', title: 'Lot号', width: 140 },
{ field: 'PROCESSNUM', title: '工序号', width: 80 },
{ field: 'PROCESSNAME', title: '工序名称', width: 120},
{ field: 'PROCESSTEXTNO', title: '工序文本码', width: 130 },
{
field: 'STARTTIME', title: '开始时间', width: 160, templet: function (d) {
if (d.STARTTIME == "" || d.STARTTIME == null)
return "";
return d.STARTTIME.replace('T', ' ');
}
},
{
field: 'COMPLETETIME', title: '完成时间', width: 160, templet: function (d) {
if (d.COMPLETETIME == "" || d.COMPLETETIME == null)
return "";
return d.COMPLETETIME.replace('T', ' ');
}
},
{
field: 'OPERSTARTSTATUS', title: '开工状态', width: 100, templet: function (d) {
if (d.OPERSTARTSTATUS == 0)
return "未申报";
else
return "已申报";
}
},
{
field: 'OPERSTARTTIME', title: '开工时间', width: 160, templet: function (d) {
if (d.OPERSTARTTIME == "" || d.OPERSTARTTIME == null || d.OPERSTARTTIME == "0001-01-01 00:00:00" || d.OPERSTARTTIME == "0001-01-01T00:00:00")
return "";
return d.OPERSTARTTIME.replace('T', ' ');
}
},
{
field: 'OPERENDSTATUS', title: '报工状态', width: 120, templet: function (d) {
if (d.OPERENDSTATUS == 0)
return "未申报";
else
return "已申报";
}
},
{
field: 'OPERENDTIME', title: '报工时间', width: 160, templet: function (d) {
if (d.OPERENDTIME == "" || d.OPERENDTIME == null || d.OPERENDTIME == "0001-01-01 00:00:00" || d.OPERENDTIME == "0001-01-01T00:00:00")
return "";
return d.OPERENDTIME.replace('T', ' ');
}
},
{
field: 'FORCEFLAG', title: '报工强制标识', width: 120, templet: function (d) {
if (d.FORCEFLAG == 0)
return "";
else
return "强制报工";
}
},
]]
, data: []
});
//工步履历表
table.render({
elem: '#workStepHistory'
, even: true
, autoSort: false
, page: false
, height: 280
, cols: [[
{ field: 'PROCESSWORKNUM', title: '工步号', width: 80 },
{ field: 'PROCESSWORKNAME', title: '工步名称', width: 120 },
{ field: 'PROCESSWORKNO', title: '工步文本码', width: 130 },
{
field: 'STARTTIME', title: '开始时间', width: 160, templet: function (d) {
if (d.STARTTIME == "" || d.STARTTIME == null)
return "";
return d.STARTTIME.replace('T', ' ');
}
},
{
field: 'COMPLETETIME', title: '完成时间', width: 160, templet: function (d) {
if (d.COMPLETETIME == "" || d.COMPLETETIME == null)
return "";
return d.COMPLETETIME.replace('T', ' ');
}
},
]],
data:[]
});
//步骤履历表
table.render({
elem: '#stepHistory'
, even: true
, autoSort: false
, page: false
, height: 280
, cols: [[
/* { field: 'LOTNO', title: 'Lot号', width: 120 },*/
{ field: 'PROCESSWORKNUM', title: '工步号', width: 100 },
{ field: 'STEPSEQ', title: '步骤号', width: 120 },
{ field: 'STEPNAME', title: '步骤名称', width: 120 },
{ field: 'STEPKIND_NAME', title: '步骤种类', width: 90 },
{ field: 'STEPCUMULATIVE', title: '累计时间(秒)', width: 120 },
{
field: 'STARTTIME', title: '开始时间', width: 160, templet: function (d) {
if (d.STARTTIME == "" || d.STARTTIME == null)
return "";
return d.STARTTIME.replace('T', ' ');
}
},
{
field: 'COMPLETETIME', title: '完成时间', width: 160, templet: function (d) {
if (d.COMPLETETIME == "" || d.COMPLETETIME == null)
return "";
return d.COMPLETETIME.replace('T', ' ');
}
},
{ field: 'USERCODE', title: '作业员编号', width: 120 },
{
field: 'OPERSTARTSTATUS', title: '开工状态', width: 90, templet: function (d) {
if (d.OPERSTARTSTATUS == 1) return "已申报";
else return "";
}
},
{
field: 'OPERSTARTTIME2', title: '开工时间', width: 150, templet: function (d) {
if (d.OPERSTARTTIME == "" || d.OPERSTARTTIME == null)
return "";
return d.OPERSTARTTIME.replace('T', ' ');
}},
{
field: 'OPERENDSTATUS', title: '报工状态', width: 120, templet: function (d) {
if (d.OPERENDSTATUS == 1) return "已申报";
else return "";
}
},
{
field: 'OPERENDTIME2', title: '报工时间', width: 150, templet: function (d) {
if (d.OPERENDTIME == "" || d.OPERENDTIME == null)
return "";
return d.OPERENDTIME.replace('T', ' ');
}
},
{ fixed: 'right', title: '操作', width: 90, align: 'center', toolbar: '#toolBarTpl' },
]],
});
function statusName(d){
if (d == "0") {
return "未开始";
} else if (d == "1") {
return "OK";
} else if (d == "2") {
return "跳步";
} else if (d == "3") {
return "暂停";
} else if (d == "4") {
return "进行中";
} else if (d == "5") {
return "停止";
} else if (d == "6") {
return "返工";
} else if (d == "7") {
return "手动完成";
} else if (d == "8") {
return "请求暂停";
} else if (d == "9") {
return "NG";
} else if (d == "10") {
return "废弃";
} else {
return "未知";
}
}
//加载步骤动作履历
function loadActionHistory(stepKind, d) {
let column = [];
//取料
if (stepKind == "0") {
column = [
{ field: 'STEPSEQ', title: '步骤号', width: 110 },
{
field: 'ACTIONSTSNAME', title: '动作状态', width: 120, templet: function (d) {
return statusName(d.ACTIONSTS);
}
},
{
field: 'STARTTIME', title: '作业时间', width: 200, templet: function (d) {
if (d.STARTTIME == "" || d.STARTTIME == null)
return "";
return d.STARTTIME.replace('T', ' ');
}
},
{ field: 'ACTIONVALUE10', title: '物料盒号', width: 120 },
{ field: 'ACTIONVALUE11', title: '物料编号', width: 200 },
{ field: 'ACTIONVALUE2', title: '取料量', width: 110 },
{ field: 'USERCODE', title: '作业员编号', width: 160 },
];
}
//工具
if (stepKind == "1") {
column = [
{ field: 'STEPSEQ', title: '步骤号', width: 110 },
{
field: 'ACTIONSTSName', title: '动作状态', width: 110, templet: function (d) {
return statusName(d.ACTIONSTS);
}
},
{ field: 'ACTIONVALUE10', title: '螺丝钉编号', width: 100 },
{
field: 'STARTTIME', title: '作业时间', width: 200, templet: function (d) {
if (d.STARTTIME == "" || d.STARTTIME == null)
return "";
return d.STARTTIME.replace('T', ' ');
}
},
{ field: 'ACTIONVALUE1', title: '理论扭矩最大值', width: 140 },
{ field: 'ACTIONVALUE2', title: '理论扭矩最小值', width: 140 },
{ field: 'ACTIONVALUE3', title: '实际扭矩值', width: 110 },
{ field: 'ACTIONVALUE4', title: '理论角度最大值', width: 140 },
{ field: 'ACTIONVALUE5', title: '理论角度最小值', width: 140 },
{ field: 'ACTIONVALUE6', title: '实际角度值', width: 110 },
{ field: 'ACTIONVALUE7', title: '理论时间最大值', width: 140 },
{ field: 'ACTIONVALUE8', title: '理论时间最小值', width: 140 },
{ field: 'ACTIONVALUE9', title: '实际时间值', width: 110 },
{ field: 'ACTIONVALUE11', title: '程序号', width: 90 },
{ field: 'ACTIONVALUE49', title: '制造商序列号', width: 140 },
{ field: 'USERCODE', title: '作业员编号', width: 160 },
];
}
//拍照
if (stepKind == "3") {
column = [
{ field: 'STEPSEQ', title: '步骤号', width: 110 },
{
field: 'ACTIONSTSName', title: '动作状态', width: 120, templet: function (d) {
return statusName(d.ACTIONSTS);
}
},
{
field: 'STARTTIME', title: '作业时间', width: 200, templet: function (d) {
if (d.STARTTIME == "" || d.STARTTIME == null)
return "";
return d.STARTTIME.replace('T', ' ');
}
},
{ field: 'ACTIONVALUE7', title: '照片文件名', width: 120 },
{ field: 'ACTIONVALUE8', title: 'FTP路径', width: 200 },
{ field: 'ACTIONVALUE10', title: '视觉检测位置号', width: 160 },
{ field: 'ACTIONVALUE14', title: '视觉检测结果', width: 150 },
{ field: 'ACTIONVALUE15', title: '是否复判结果', width: 150 },
{ field: 'USERCODE', title: '作业员编号', width: 160 },
];
}
//条码采集
if (stepKind == "5") {
column = [
{ field: 'STEPSEQ', title: '步骤号', width: 110 },
{
field: 'ACTIONSTSName', title: '动作状态', width: 120, templet: function (d) {
return statusName(d.ACTIONSTS);
}
},
{ field: 'ACTIONVALUE10', title: '采集顺序', width: 120 },
{
field: 'STARTTIME', title: '作业时间', width: 200, templet: function (d) {
if (d.STARTTIME == "" || d.STARTTIME == null)
return "";
return d.STARTTIME.replace('T', ' ');
}
},
{ field: 'ACTIONVALUE11', title: '物料编号', width: 200 },
{ field: 'ACTIONVALUE5', title: '实际采集内容', width: 200 },
{ field: 'ACTIONVALUE4', title: '截取后条码号', width: 200 },
{ field: 'ACTIONVALUE3', title: '关键件位置号', width: 200 },
{ field: 'ACTIONVALUE2', title: '判定结果', width: 200 },
{ field: 'USERCODE', title: '作业员编号', width: 160 },
];
}
//检查项
if (stepKind == "7") {
column = [
{ field: 'STEPSEQ', title: '步骤号', width: 110 },
{
field: 'ACTIONSTSName', title: '动作状态', width: 120, templet: function (d) {
return statusName(d.ACTIONSTS);
}
},
{
field: 'STARTTIME', title: '作业时间', width: 200, templet: function (d) {
if (d.STARTTIME == "" || d.STARTTIME == null)
return "";
return d.STARTTIME.replace('T', ' ');
}
},
{ field: 'ACTIONVALUE6', title: '检查项结果', width: 400 },
{ field: 'ACTIONVALUE7', title: '检查项内容', width: 400 },
{ field: 'USERCODE', title: '作业员编号', width: 160 },
];
}
//检测项
if (stepKind == "8") {
if(d.length==0 || d[0].HANDEQUIPMENT!=1){
column = [
{ field: 'STEPSEQ', title: '步骤号', width: 110 },
{
field: 'HANDEQUIPMENT_NAME', title: '测试设备区分', width: 120, templet: function (d) {
if (d.HANDEQUIPMENT == 1) {
return "手动设备";
} else {
return "自动设备";
}
}
},
{
field: 'STARTTIME', title: '开始时间', width: 200, templet: function (d) {
if (d.START_TIME == "" || d.START_TIME == null)
return "";
return d.START_TIME.replace('T', ' ');
}
},
{
field: 'ENDTIME', title: '结束时间', width: 200, templet: function (d) {
if (d.END_TIME == "" || d.END_TIME == null)
return "";
return d.END_TIME.replace('T', ' ');
}
},
{ field: 'TEST_SEQ', title: '顺序号', width: 90 },
{ field: 'PARENT_ITEM', title: '测试父项名称', width: 130 },
{ field: 'SUB_ITEM', title: '测试子项名称', width: 120 },
{ field: 'STEP', title: '测试项名', width: 110 },
{ field: 'RESULT', title: '测试结果(子项)', width: 140 },
{ field: 'VALUE_UNIT', title: '测试值单位', width: 120 },
{ field: 'VALUE_UNIT_EN', title: '测试值单位2', width: 120 },
{ field: 'UPPER_LIMIT', title: '测试值上限', width: 120 },
{ field: 'LOWER_LIMIT', title: '测试值下限', width: 120 },
{ field: 'RESULT_BOOLE', title: '布尔量测试结果', width: 140 },
{ field: 'RESULT_NUMBERIC', title: '数值测试结果', width: 120 },
{ field: 'RESULT_STRING', title: '字符串测试结果', width: 140 },
{ field: 'PRINT_FLAG', title: '打印标识位', width: 110 },
{ field: 'TOOLMNGNO', title: '工具管理编号', width: 130 },
{ field: 'TOOLMATNAME', title: '工具名称', width: 130 },
{ field: 'MEASUR_PERIOD', title: '校验周期', width: 100 },
{ field: 'LAST_MEASUR_TIME', title: '校验时间', width: 120 },
{ field: 'USERCODE', title: '作业员编号', width: 160 },
];
}else{
column = [
{ field: 'STEPSEQ', title: '步骤号', width: 110 },
{
field: 'HANDEQUIPMENT_NAME', title: '测试设备区分', width: 120, templet: function (d) {
if (d.HANDEQUIPMENT == 1) {
return "手动设备";
} else {
return "自动设备";
}
}
},
{
field: 'STARTTIME', title: '开始时间', width: 200, templet: function (d) {
if (d.START_TIME == "" || d.START_TIME == null)
return "";
return d.START_TIME.replace('T', ' ');
}
},
{
field: 'ENDTIME', title: '结束时间', width: 200, templet: function (d) {
if (d.END_TIME == "" || d.END_TIME == null)
return "";
return d.END_TIME.replace('T', ' ');
}
},
{ field: 'TEST_SEQ', title: '顺序号', width: 90 },
{ field: 'PARENT_ITEM', title: '检测项目名称', width: 130 },
{ field: 'SUB_ITEM', title: '检测项目代号', width: 120 },
{ field: 'STEP', title: '检测项目公式', width: 120 },
{ field: 'RESULT', title: '测试结果(子项)', width: 140 },
{ field: 'VALUE_UNIT', title: '测试值单位', width: 120 },
{ field: 'VALUE_UNIT_EN', title: '测试值单位2', width: 120 },
{ field: 'UPPER_LIMIT', title: '测试值上限', width: 120 },
{ field: 'LOWER_LIMIT', title: '测试值下限', width: 120 },
{ field: 'RESULT_BOOLE', title: '布尔量测试结果', width: 140 },
{ field: 'RESULT_NUMBERIC', title: '数值测试结果', width: 120 },
{ field: 'RESULT_STRING', title: '字符串测试结果', width: 140 },
{ field: 'PRINT_FLAG_NAME', title: '打印标识位', width: 110,templete:function(d){
if(d.PRINT_FLAG==1){
return "报表打印";
}else{
return "";
}
} },
{ field: 'TOOLMNGNO', title: '工具管理编号', width: 130 },
{ field: 'TOOLMATNAME', title: '工具名称', width: 130 },
{ field: 'MEASUR_PERIOD', title: '校验周期', width: 100 },
{ field: 'LAST_MEASUR_TIME', title: '校验时间', width: 120 },
{ field: 'USERCODE', title: '作业员编号', width: 160 },
];
}
}
//动作履历表
table.render({
elem: '#actionHistory'
, even: true
, autoSort: false
, page: true
, height: 300
, cols: [column],
data: d
});
}
//loadActionHistory("1", []);
//产品履历信息获取
function initCallBackProdInfoInit(data) {
closeLoading();
if (data.success == false) {
alertMessage(data.message);
return;
}
let ProdInfo = JSON.parse(data.initData);
if (ProdInfo.length > 0) {
$("#orderNo").val(ProdInfo[0].ORDERNO);
$("#subLotId").val(ProdInfo[0].SUBLOTID);
$("#processNo").val(ProdInfo[0].PROCESSNO);
$("#processVersion").val(ProdInfo[0].PROCESSVERSION);
$("#productNo").val(ProdInfo[0].PRODUCTNO);
$("#productName").val(ProdInfo[0].PRODUCTNAME);
$("#allotStepVersion").val(ProdInfo[0].ALLOTSTEPVERSION);
}
let pd = JSON.parse(data.procNumLst);
table.reload("prodHistory", {
limit: pd.length,
data: pd
});
}
ajaxRequest({ SubLotId: qrySubLotId }, '../prodresults/ProdActualDetailInit', initCallBackProdInfoInit);
//工步行信息获取
function initCallBackWorkStepHistory(data) {
closeLoading();
if (data.success == false) {
alertMessage(data.message);
return;
}
let d = JSON.parse(data.data);
table.reload("workStepHistory", {
limit: d.length,
data: d
});
table.reload("stepHistory", {
limit: 0,
data: []
});
}
table.on('row(prodHistory)', function (obj) {
loading();
//obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");
//标注选中样式
obj.tr.addClass('clickRow').siblings().removeClass('clickRow');
var data = obj.data;
ajaxRequest({
processNum: data.PROCESSNUM, lotNo: data.LOTNO,
subLotId: data.SUBLOTID, operHistoryNo: data.OPERHISTORYNO
}, '../prodresults/FindWorkStepHistory', initCallBackWorkStepHistory);
});
//步骤行信息获取
function initCallBackStepHistory(data) {
closeLoading();
if (data.success == false) {
alertMessage(data.message);
return;
}
let d = JSON.parse(data.data);
table.reload("stepHistory", {
limit: d.length,
data: d
});
}
table.on('row(workStepHistory)', function (obj) {
loading();
//obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");
obj.tr.addClass('clickRow').siblings().removeClass('clickRow');
var data = obj.data;
ajaxRequest({
processNum: data.PROCESSNUM, processWorkNum: data.PROCESSWORKNUM,
lotNo: data.LOTNO, subLotId: data.SUBLOTID, operHistoryNo: data.OPERHISTORYNO
}, '../prodresults/FindStepHistory', initCallBackStepHistory);
});
table.on('row(stepHistory)', function (obj) {
loading();
obj.tr.addClass('clickRow').siblings().removeClass('clickRow');
let data = obj.data;
closeLoading();
ajaxRequest({ sublotId: data.SUBLOTID, factStepId: data.FACTSTEPID, lotNo: data.LOTNO, stepKind: data.STEPKIND }, '../ProdResults/FindStepActionHistory', d => {
closeLoading();
if (d.success == true) {
//loadActionHistory(data.STEPKIND, d.data);
loadActionHistory(data.STEPKIND, d.data);
} else {
//loadActionHistory(data.STEPKIND, []);
loadActionHistory(data.STEPKIND, []);
alertMessage(d.message);
}
});
});
// 监听工具条操作
table.on('tool(lfTable)', function (obj) {
var data = obj.data;
if (obj.event === 'upload') {
document.getElementById('fileInput').click(); // 触发文件选择
}
});
function uploadManualInfoFile(uploadPath) {
var headers1 = {
"__RequestVerificationToken": $("input[name=__RequestVerificationToken]").val(),
"Authorization": getAuthToken()
};
layui.upload.render({
elem: '#fileInput',
url: uploadPath,
auto: true,
accept: 'file',
size: 200 * 1024 * 1024,
exts: '*',
headers: headers1,
choose: function (obj) {
},
before: function () {
layer.load(2); // 显示加载中
},
done: function (res) {
layer.closeAll('loading');
if (res.success) {
layer.msg('上传成功');
} else {
layer.msg(res.message || '上传失败');
}
},
error: function () {
layer.closeAll('loading');
layer.msg('上传出错');
}
});
}
//上传手顺信息文件
uploadManualInfoFile(
"tabData",
'../ProdActualDetail/UploadManualInfo',
"*/*",
"file",
"*");
})
</script>是否有错误