var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var SrmRateData; var RobotRateData; var page = { init: function () { $("#beginTime").val(beginTime); $("#endTime").val(endTime); //$("#robotbeginTime").val(beginTime); //$("#robotendTime").val(endTime); //$("#rgvbeginTime").val(beginTime); //$("#rgvendTime").val(endTime); //$("#hjbeginTime").val(beginTime); //$("#hjendTime").val(endTime); page.initGird(); page.bind(); }, bind: function () { // 查询 //$('#btn_rgvSearch').on('click', function () { // if (page.SearchValid('rgvbeginTime', 'rgvendTime')) { // return; // } // page.searchrgv({ queryJson: JSON.stringify({ beginTime: $("#beginTime").val(), endTime: $("#endTime").val(), DevType: '1' }) }); //}); $('#btn_Search').on('click', function () { if (page.SearchValid('beginTime', 'endTime')) { return; } page.search({ queryJson: JSON.stringify({ beginTime: $("#beginTime").val(), endTime: $("#endTime").val(), DevType: '2' }) }); }); //$('#btn_robotSearch').on('click', function () { // if (page.SearchValid('robotbeginTime', 'robotendTime')) { // return; // } // page.searchrobot({ queryJson: JSON.stringify({ beginTime: $("#robotbeginTime").val(), endTime: $("#robotendTime").val(), DevType: '3' }) }); //}); //$('#btn_hjSearch').on('click', function () { // if (page.SearchValid('hjbeginTime', 'hjendTime')) { // return; // } // page.searchhj({ queryJson: JSON.stringify({ beginTime: $("#hjbeginTime").val(), endTime: $("#hjendTime").val(), DevType: '4' }) }); //}); }, SearchValid: function (begin,end) { let result = false; var beginTime = $("#"+begin).val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (beginTime.length == 0) { learun.alert.error('开始时间不能为空!'); result = true; return result; } var endTime = $("#"+end).val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (endTime.length == 0) { learun.alert.error('结束时间不能为空!'); result = true; return result; } if (!page.isDateValid(beginTime)) { learun.alert.error('开始时间格式不正确!'); result = true; return result; } if (!page.isDateValid(endTime)) { learun.alert.error('结束时间格式不正确!'); result = true; return result; } }, isDateValid: function (dateString) { const date = new Date(dateString); return !isNaN(date.getTime()); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/CPManager/DeviceEffectives/GetSRMPageList', headData: [ { label: "设备名", name: "Code", width: 80, align: "left" }, { label: "出库", name: "OutDepot", width: 80, align: "left" }, { label: "入库", name: "EnterDepot", width: 80, align: "left" }, { label: "移库", name: "MoveDepot", width: 80, align: "left" }, //{ // label: "状态分析", name: "State", width: 500, align: "left" // , formatter: function (cellvalue) { // let w1 = cellvalue[0] <= 30 ? 30 : cellvalue[0] >= 100?100:cellvalue[0]*1; // let w2 = cellvalue[1] <= 30 ? 30 : cellvalue[1] >= 100?100:cellvalue[1]*1; // let w3 = cellvalue[2] <= 30 ? 30 : cellvalue[2] >= 100?100:cellvalue[2]*1; // let w4 = cellvalue[3] <= 30 ? 30 : cellvalue[3] >= 100?100:cellvalue[3]*1; // let w5 = cellvalue[4] <= 30 ? 30 : cellvalue[4] >= 100?100:cellvalue[4]*1; // return '
' + cellvalue[0] + '%
' + cellvalue[1] + '%
' + cellvalue[2] + '%
' + cellvalue[3] + '%
' + cellvalue[4] +'%
' //} //}, { label: "空闲(分钟)", name: "Free", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "手动(分钟)", name: "Manual", width: 80, align: "left" , formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "自动(分钟)", name: "Automatic", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "报警(分钟)", name: "Alarm", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "运行(分钟)", name: "Working", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "总时间(分钟)", name: "TotalTime", width: 80, align: "left", formatter: function (cellvalue) { return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); } }, { label: "设备执行分析", name: "DevAction", width: 400, align: "left" , formatter: function (cellvalue) { let str = '
'; for (var i = 0; i < cellvalue.length; i++) { str += '
' + cellvalue[i].Type + ',次数:' + cellvalue[i].ActionAmount + ',平均耗时:' + cellvalue[i].ActionTime + '
' } str += '
'; return str; } }, { label: "工位使用", name: "StationCount", width: 400, align: "left" , formatter: function (cellvalue) { let str = '
'; for (var i = 0; i < cellvalue.length; i++) { str += '
' + cellvalue[i].Type + ',工位数:' + cellvalue[i].StationIndex + ',执行数量:' + cellvalue[i].StationNum + '
' } str += '
'; return str; } }, ], rowHeight: 70, mainId: 'Code', isPage: true, reloadSelected: true, autowWidth: true, sidx: 'Code', sord: 'DESC', }); page.search({ queryJson: JSON.stringify({ beginTime: $("#beginTime").val(), endTime: $("#endTime").val(), DevType: '2' }) }); //$('#gridtable2').jfGrid({ // url: top.$.rootUrl + '/CPManager/DeviceEffectives/GetRobotPageList', // headData: [ // { label: "设备名", name: "Code", width: 80, align: "left" }, // { label: "出库", name: "OutDepot", width: 80, align: "left" }, // { label: "入库", name: "EnterDepot", width: 80, align: "left" }, // { label: "移库", name: "MoveDepot", width: 80, align: "left" }, // //{ // // label: "状态分析", name: "State", width: 500, align: "left" // // , formatter: function (cellvalue) { // // let w1 = cellvalue[0] <= 30 ? 30 : cellvalue[0] >= 100?100:cellvalue[0]*1; // // let w2 = cellvalue[1] <= 30 ? 30 : cellvalue[1] >= 100?100:cellvalue[1]*1; // // let w3 = cellvalue[2] <= 30 ? 30 : cellvalue[2] >= 100?100:cellvalue[2]*1; // // let w4 = cellvalue[3] <= 30 ? 30 : cellvalue[3] >= 100?100:cellvalue[3]*1; // // let w5 = cellvalue[4] <= 30 ? 30 : cellvalue[4] >= 100?100:cellvalue[4]*1; // // return '
' + cellvalue[0] + '%
' + cellvalue[1] + '%
' + cellvalue[2] + '%
' + cellvalue[3] + '%
' + cellvalue[4] +'%
' // //} // //}, // { // label: "空闲(分钟)", name: "Free", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "手动(分钟)", name: "Manual", width: 80, align: "left" // , formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "自动(分钟)", name: "Automatic", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "报警(分钟)", name: "Alarm", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "运行(分钟)", name: "Working", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "总时间(分钟)", name: "TotalTime", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "设备执行分析", name: "DevAction", width: 400, align: "left" // , formatter: function (cellvalue) { // let str = '
'; // for (var i = 0; i < cellvalue.length; i++) { // str += '
' + cellvalue[i].Type + ',次数:' + cellvalue[i].ActionAmount + ',平均耗时:' + cellvalue[i].ActionTime + '
' // } // str += '
'; // return str; // } // }, // { // label: "工位使用", name: "StationCount", width: 400, align: "left" // , formatter: function (cellvalue) { // let str = '
'; // for (var i = 0; i < cellvalue.length; i++) { // str += '
' + cellvalue[i].Type + ',工位数:' + cellvalue[i].StationIndex + ',执行数量:' + cellvalue[i].StationNum + '
' // } // str += '
'; // return str; // } // }, // ], // rowHeight: 70, // mainId: 'Code', // isPage: true, // reloadSelected: true, // autowWidth: true, // sidx: 'Code', // sord: 'DESC', //}); //page.searchrobot({ queryJson: JSON.stringify({ beginTime: $("#robotbeginTime").val(), endTime: $("#robotendTime").val(), DevType: '3' }) }); //$('#rgvgridtable').jfGrid({ // url: top.$.rootUrl + '/CPManager/DeviceEffectives/GetRgvPageList', // headData: [ // { label: "设备名", name: "Code", width: 80, align: "left" }, // { label: "出库", name: "OutDepot", width: 80, align: "left" }, // { label: "入库", name: "EnterDepot", width: 80, align: "left" }, // { label: "移库", name: "MoveDepot", width: 80, align: "left" }, // //{ // // label: "状态分析", name: "State", width: 500, align: "left" // // , formatter: function (cellvalue) { // // let w1 = cellvalue[0] <= 30 ? 30 : cellvalue[0] >= 100?100:cellvalue[0]*1; // // let w2 = cellvalue[1] <= 30 ? 30 : cellvalue[1] >= 100?100:cellvalue[1]*1; // // let w3 = cellvalue[2] <= 30 ? 30 : cellvalue[2] >= 100?100:cellvalue[2]*1; // // let w4 = cellvalue[3] <= 30 ? 30 : cellvalue[3] >= 100?100:cellvalue[3]*1; // // let w5 = cellvalue[4] <= 30 ? 30 : cellvalue[4] >= 100?100:cellvalue[4]*1; // // return '
' + cellvalue[0] + '%
' + cellvalue[1] + '%
' + cellvalue[2] + '%
' + cellvalue[3] + '%
' + cellvalue[4] +'%
' // //} // //}, // { // label: "空闲(分钟)", name: "Free", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "手动(分钟)", name: "Manual", width: 80, align: "left" // , formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "自动(分钟)", name: "Automatic", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "报警(分钟)", name: "Alarm", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "运行(分钟)", name: "Working", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "总时间(分钟)", name: "TotalTime", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "设备执行分析", name: "DevAction", width: 400, align: "left" // , formatter: function (cellvalue) { // let str = '
'; // for (var i = 0; i < cellvalue.length; i++) { // str += '
' + cellvalue[i].Type + ',次数:' + cellvalue[i].ActionAmount + ',平均耗时:' + cellvalue[i].ActionTime + '
' // } // str += '
'; // return str; // } // }, // { // label: "工位使用", name: "StationCount", width: 400, align: "left" // , formatter: function (cellvalue) { // let str = '
'; // for (var i = 0; i < cellvalue.length; i++) { // str += '
' + cellvalue[i].Type + ',工位数:' + cellvalue[i].StationIndex + ',执行数量:' + cellvalue[i].StationNum + '
' // } // str += '
'; // return str; // } // }, // ], // rowHeight: 70, // mainId: 'Code', // isPage: true, // reloadSelected: true, // autowWidth: true, // sidx: 'Code', // sord: 'DESC', //}); //page.searchrgv({ queryJson: JSON.stringify({ beginTime: $("#robotbeginTime").val(), endTime: $("#robotendTime").val(), DevType: '1' }) }); //$('#hjgridtable').jfGrid({ // url: top.$.rootUrl + '/CPManager/DeviceEffectives/GetHJPageList', // headData: [ // { label: "设备名", name: "Code", width: 80, align: "left" }, // { label: "出库", name: "OutDepot", width: 80, align: "left" }, // { label: "入库", name: "EnterDepot", width: 80, align: "left" }, // { label: "移库", name: "MoveDepot", width: 80, align: "left" }, // //{ // // label: "状态分析", name: "State", width: 500, align: "left" // // , formatter: function (cellvalue) { // // let w1 = cellvalue[0] <= 30 ? 30 : cellvalue[0] >= 100?100:cellvalue[0]*1; // // let w2 = cellvalue[1] <= 30 ? 30 : cellvalue[1] >= 100?100:cellvalue[1]*1; // // let w3 = cellvalue[2] <= 30 ? 30 : cellvalue[2] >= 100?100:cellvalue[2]*1; // // let w4 = cellvalue[3] <= 30 ? 30 : cellvalue[3] >= 100?100:cellvalue[3]*1; // // let w5 = cellvalue[4] <= 30 ? 30 : cellvalue[4] >= 100?100:cellvalue[4]*1; // // return '
' + cellvalue[0] + '%
' + cellvalue[1] + '%
' + cellvalue[2] + '%
' + cellvalue[3] + '%
' + cellvalue[4] +'%
' // //} // //}, // { // label: "空闲(分钟)", name: "Free", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "手动(分钟)", name: "Manual", width: 80, align: "left" // , formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "自动(分钟)", name: "Automatic", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "报警(分钟)", name: "Alarm", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "运行(分钟)", name: "Working", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "总时间(分钟)", name: "TotalTime", width: 80, align: "left", formatter: function (cellvalue) { // return cellvalue % 1 >= 0.5 ? Math.ceil(cellvalue) : Math.floor(cellvalue); // } // }, // { // label: "设备执行分析", name: "DevAction", width: 400, align: "left" // , formatter: function (cellvalue) { // let str = '
'; // for (var i = 0; i < cellvalue.length; i++) { // str += '
' + cellvalue[i].Type + ',次数:' + cellvalue[i].ActionAmount + ',平均耗时:' + cellvalue[i].ActionTime + '
' // } // str += '
'; // return str; // } // }, // { // label: "工位使用", name: "StationCount", width: 400, align: "left" // , formatter: function (cellvalue) { // let str = '
'; // for (var i = 0; i < cellvalue.length; i++) { // str += '
' + cellvalue[i].Type + ',工位数:' + cellvalue[i].StationIndex + ',执行数量:' + cellvalue[i].StationNum + '
' // } // str += '
'; // return str; // } // }, // ], // rowHeight: 102, // mainId: 'Code', // isPage: true, // reloadSelected: true, // autowWidth: true, // sidx: 'Code', // sord: 'DESC', //}); //page.searchhj({ queryJson: JSON.stringify({ beginTime: $("#robotbeginTime").val(), endTime: $("#robotendTime").val(), DevType: '4' }) }); }, search: function (param) { $('#gridtable').jfGridSet('reload', param); }, //searchrobot: function (param) { // $('#gridtable2').jfGridSet('reload', param); //}, //searchrgv: function (param) { // $('#rgvgridtable').jfGridSet('reload', param); //}, //searchhj: function (param) { // $('#hjgridtable').jfGridSet('reload', param); //}, }; refreshGirdData = function () { }; page.init(); }