|
|
@{ ViewBag.Title = "宁虹"; Layout = "~/Views/Shared/_Form.cshtml"; } <script src="~/Content/js/echarts/echarts5.3.3.min.js"></script> <script src="~/Content/js/echarts/echarts-gl.min.js"></script> <style> .ui-jqgrid tr.jqgrow td { overflow: hidden; }
.ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden !important; }
.btn-primary { margin-right: 2px; }
html { height: 100%; }
.topRow { height: 54px; background-color: #031c7bc2; padding-bottom: 5px; }
body { height: 100%; FONT-SIZE: 15px; /*FONT-SIZE: 18px;*/ background-color: black; --CustTitlecolor: #0bd4d4; /*表标题颜色*/ /*#4D5457 #000000bf*/ --Custbackgroundcolor: #031c7bc2; /*#031c7b;*/ /*表整体颜色*/ --CustSelect: #103764; /*选中颜色*/ /*悬浮颜色*/ --Custcolor: white; /*字体颜色*/ --CustBorderColor: #031c7bc2; /*边框颜色*/ --CustRow1: #0e59a5d4; /*偶行颜色*/ --CustRow2: #031c7bc2; /*奇行颜色*/ }
/*大标题*/ .TopName { vertical-align: middle; text-align: center; font-size: 24px; font-weight: 700; /*color:var(--CustTitlecolor);*/ color: white; }
/*logo标题*/ .TopNamelogo { vertical-align: middle; text-align: left; font-size: 24px; font-weight: 700; color: white; }
.logoclass { height: 24px; }
#logolabel { width:80%; }
.time { vertical-align: middle; text-align: center; font-size: 20px; color: white; }
.formdiv { height: 100% !important; margin-bottom: 2px; margin-top: 5px; margin-left: 10px; margin-right: 10px; }
.thclass { width: 100px; font-weight: 500; text-align: right; }
table { height: 100%; }
html, body { height: 100% !important; }
form { height: 98% !important; background-color: black; }
.bootstrap-select .dropdown-toggle .filter-option-inner-inner { height: 24px !important; }
/*表列表头颜色*/ .table > thead:first-child > tr:first-child > th { background-color: var(--Custbackgroundcolor); color: var(--CustTitlecolor); } /*表整体颜色*/ .ui-jqgrid { background-color: var(--Custbackgroundcolor); color: var(--Custcolor); /*border: 1px solid var(--CustBorderColor);*/ border: none; }
.ui-jqgrid .table-bordered td { /*border: 0.5px solid var(--CustBorderColor);*/ border: none; border-left: none; border-right: none; }
/*悬浮颜色*/ .table > tbody > tr.active > td, .table > tbody > tr.active > th, .table > tbody > tr > td.active, .table > tbody > tr > th.active, .table > tfoot > tr.active > td, .table > tfoot > tr.active > th, .table > tfoot > tr > td.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > thead > tr.active > th, .table > thead > tr > td.active, .table > thead > tr > th.active { background-color: var(--CustSelect); color: var(--Custcolor); }
/*选中颜色*/ .table > tbody > tr.success > td, .table > tbody > tr.success > th, .table > tbody > tr > td.success, .table > tbody > tr > th.success, .table > tfoot > tr.success > td, .table > tfoot > tr.success > th, .table > tfoot > tr > td.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > thead > tr.success > th, .table > thead > tr > td.success, .table > thead > tr > th.success { background-color: var(--CustSelect); color: var(--Custcolor); } /*偶行颜色*/ div > div > div > table > tbody > tr:nth-child(2n) { background-color: var(--CustRow1); color: white; border: none; } /*奇行颜色*/ div > div > div > table > tbody > tr:nth-child(2n+1) { background-color: var(--CustRow2); color: white; border: none; }
form > div > table > tbody > tr > td { padding-bottom: 5px; padding-top: 5px; padding-left: 5px; padding-right: 5px; }
::-webkit-scrollbar-thumb { background-color: var(--CustTitlecolor); }
#tdXX1 > div > div > canvas { height: 100% !important; }
#tdXX1 > div > div { height: 100% !important; }
/*.ui-jqgrid .ui-jqgrid-htable thead th { padding:4px 2px 4px 2px; }*/ .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th { padding: 4px 2px 4px 2px; } </style> <link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" /> <script src="~/Content/js/CommonReport/CommonReport.js"></script> <script src="~/Content/js/datepicker/WdatePicker.js"></script> <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" /> <script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script> <script src="~/Content/js/xm-select.js"></script> <script> var HeightToDel = 100; var timer; var timer2;//刷新数据时间 var TBBackColor = "#031c7bc2"; var TBTitleFontColor = "#0bd4d4"; var GunDongRate = 2 * 1000;//单位毫秒 //表格滚动间隔时间 var DataF = 300;//单位秒 //刷新数据时间 var IsFirstShow = false; var GunDongRow = 1; var demo1; $(function () {
demo1 = xmSelect.render({ el: '#demo1', toolbar: { // 工具条【‘全选’,‘清空’】 show: true, // 开启工具条 showIcon: false, // 隐藏工具条的图标 }, filterable: true, //prop:{ // name:'ssdesc', // value:'sscode' //} }); $.ajax({ url: "/SRM/WatchPanel/GetSScode?" + Math.random(), dataType: "json", async: false, type: 'GET', success: function (data1){ //var array = new data1.length(); var array = new Array(); for (var i = 0; i < data1.length ; i++) { var datames = new Object(); datames.name = data1[i].name; datames.value = data1[i].value; datames.selected = (data1[i].selected == "true" ? true : false); array.push(datames); } demo1.update({ data: array }) }
})
//显示时间 getTime();
gridList1(); $(window).resize(function () {
// gridList1(); GunDongRow = 0; }); scrollBody(); //刷新数据 timer2 = setInterval(function () { gridList1(); }, DataF * 1000);
});
//自动滚动 function scrollBody() { timer = setInterval(function () { scrollBody_act(); }, GunDongRate);
}
function scrollBody_act() { var ob3 = $('#gridList1').getGridParam("records"); var div = $('#gridList1').closest('.ui-jqgrid-bdiv')[0]; var offsetHeight = div.offsetHeight; var scrollHeight = div.scrollHeight - offsetHeight; if (GunDongRow == 0) { var hh = offsetHeight; //GunDongRow = Math.floor(hh / 30.3); GunDongRow = 1; }
// div.scrollTop = div.scrollTop + 1; if (div.scrollTop >= scrollHeight) {//循环滚动 scrollHeight = div.scrollHeight - offsetHeight;//如果在滚动过程中添加过数据,需要重新结算scrollHeight if (div.scrollTop >= scrollHeight) { div.scrollTop = 0; //循环滚动,重置滚动头即可 IsFirstShow = true; } if (div.scrollTop >= ob3 * 30.4) { div.scrollTop = 0; //循环滚动,重置滚动头即可 IsFirstShow = true; } } if (!IsFirstShow) { div.scrollTop = div.scrollTop + (GunDongRow * 30.3); } else { IsFirstShow = false; } } //end 自动滚动
function GetAllCols1() { var _cols = new Array(); //项目号 客户名称 设备类型 产品名称 产品型号 序列号 计划开工日期 计划完工日期 数量 设备编号 生产工单号 //项目进度条 项目阶段 状态 生产确认表 电装开始 电装完成 机械装配开始 机械装配完成 总装开始 总装完成 仪表配置开始 //仪表配置完成 调试测试开始 调试测试完成 FAT开始 FAT完成 FQC OQC 产品类型 //_cols.push({ label: 'ID', name: 'ID', width: 110, align: 'left', hidden: true, }); _cols.push({ label: '线体', name: '线体', width: 80, align: 'left', }); _cols.push({ label: '生产订单号', name: '生产订单号', width: 130, align: 'left', }); _cols.push({ label: 'AB面', name: 'AB面', width: 60, align: 'left', }); //_cols.push({ label: '工单日期', name: '工单日期', width: 160,lign: 'left', }); _cols.push({ label: '产品编码', name: '产品编码', width: 140, align: 'left', }); _cols.push({ label: '产品代码', name: '产品代码', width: 200, align: 'left', }); // _cols.push({ label: '规格', name: '规格', width: 240, align: 'left', }); _cols.push({ label: '换线时间', name: '换线时间', width: 160, align: 'left', }); _cols.push({ label: '打件时间', name: '打件时间', width: 160, align: 'left', }); _cols.push({ label: '首检时间', name: '首检时间', width: 160, align: 'left', }); _cols.push({ label: '计划量', name: '计划量', width: 80, align: 'left', }); _cols.push({ label: '产出量', name: '产出量', width: 80, align: 'left', }); //_cols.push({ label: 'COLORSTR', name: 'COLORSTR', width: 50, align: 'left', hidden: true, }); //_cols.push({ // label: '项目阶段', name: '项目阶段', width: 150, align: 'left', // cellattr: function addCellAttr(rowId, val, rawObject, cm, rdata) { // if (rawObject.COLORSTR == "green") { // return "style='color:#42f943'"; // } // } //});
//_cols.push({ // label: '完成率', name: '完成率', width: 200, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var str_retrun = '<div id="JDText_' + rowObject.ID + '" style="width: 99%;height:98%;"></div>'; // return cellvalue = str_retrun;
// }
//});
_cols.push({ label: '完成率', name: '完成率', width: 80, align: 'left' }); _cols.push({ label: '', name: '', width: 5, align: 'left' });
return _cols; }
function gridList1() { document.getElementById("gridPanel1").innerHTML = ' <table id="gridList1"></table> ';//重置grid var _cols = GetAllCols1(); var $gridList = $("#gridList1" );
var queryJson = { value:xmSelect.get('#demo1', true).getValue() } $gridList.dataGrid({ url: "/SRM/WatchPanel/GetGridJson_WIPJinDu?" + Math.random(), postData: { queryJson: JSON.stringify(queryJson) }, height: $("#form1").height() - HeightToDel, colModel: _cols, // caption: '生产进度汇总表', // sortname: " ", rowNum: 5000, viewrecords: true, rownumbers: true, multiselect: false, gridComplete: function () { $("#gridList1").jqGrid('setLabel', 'rn', '序号', { 'text-align': 'center', 'vertical-align': 'middle' }, ''); // var strIds = $("#gridList1").jqGrid("getDataIDs");
// for (var i = 0; i < strIds.length; i++) { // var ID = $("#gridList1").jqGrid("getCell", strIds[i], "ID"); // var QTY = $("#gridList1").jqGrid("getCell", strIds[i], "完成率值"); //var COLORSTR = $("#gridList1").jqGrid("getCell", strIds[i], "COLORSTR"); //var Status = $("#gridList1").jqGrid("getCell", strIds[i], "状态"); //JDPictureSet("JDText_" + ID, QTY, ''); // }
} }); }
function JDPictureSet(JDDivID, JDQty, Status) { var myChart = echarts.init(document.getElementById(JDDivID)); var Colorfont = "black"; var Color = "white"; //if (Status == "紧急") { // Color = "yellow";//黄色 //} //if (Status == "完成") { // Color = "#42f943";//绿色 //} //if (Status == "延期") { // Color = "red";//红色 // Colorfont = "white"; //} //if (JDQty == 0) { // Colorfont = Color; //}
myChart.setOption({ //加载数据图表
title: { show: false, }, tooltip: { show: false, }, legend: { show: false, }, grid: { show: false, }, xAxis: { type: 'value', axisLine: { show: false }, axisTick: { show: false }, axisLabel: { show: false }, splitLine: { show: false }, max: 100, min: 0, }, yAxis: { axisLine: { show: false }, axisTick: { show: false }, axisLabel: { show: false }, splitLine: { show: false }, type: 'category', }, series: [ { type: 'bar', data: [JDQty], label: { show: true, formatter: '{c}%', color: Colorfont }, itemStyle: { color: Color, } } ] });
}
function getTime() { var days = new Array("日", "一", "二", "三", "四", "五", "六"); var currentDT = new Date(); var y, m, date, day, hs, ms, ss, theDateStr; y = currentDT.getFullYear(); //四位整数表示的年份 m = currentDT.getMonth() < 10 ? '0' + (currentDT.getMonth() + 1) : (currentDT.getMonth() + 1); //月 date = currentDT.getDate() < 10 ? '0' + currentDT.getDate() : currentDT.getDate(); //日 day = currentDT.getDay(); //星期 hs = currentDT.getHours() < 10 ? '0' + currentDT.getHours() : currentDT.getHours(); //时 ms = currentDT.getMinutes() < 10 ? '0' + currentDT.getMinutes() : currentDT.getMinutes(); //分 ss = currentDT.getSeconds() < 10 ? '0' + currentDT.getSeconds() : currentDT.getSeconds(); //秒 theDateStr = y + "-" + m + "-" + date + " " + hs + ":" + ms + ":" + ss; //填充到组件中 $("#timeStr").text(theDateStr); // setTimeout 在执行时,是在载入后延迟指定时间后,去执行一次表达式,仅执行一次 window.setTimeout(getTime, 1000); }
function ChangeStartEnd() { var textTT=$("#IsStartEnd").text(); if (textTT == "暂停滚动") { timer = window.clearInterval(timer);//停止滚动 $("#IsStartEnd").text("开始滚动"); } else { timer = setInterval(function () { scrollBody_act(); }, GunDongRate); $("#IsStartEnd").text("暂停滚动"); } }
function btn_ExportAll() {
var txtProject =""; var txtEQPType = ""; var txtItemStd = ""; var txtEQPCode = ""; var txtPlanStartDay = ""; var txtMOCode = ""; var txtItemCode = ""; var txtProJieDuan = ""; var txtStatus = ""; var txtPlanEndDay = "";
var queryJson = { value: xmSelect.get('#demo1', true).getValue() } var VV=""; for(var i =0;i<queryJson.length;i++) { if(i==0){ VV = queryJson[i].value; } else { VV = VV + "," + queryJson[i].value; } } var data = "&value=" + VV; $.download("/SRM/WatchPanel/ExportAll?" + Math.random(), data, 'post'); }
</script>
<form id="form1"> <div class="formdiv">
<table class="form"> <tr class="topRow"> <td style="text-align:right;width:8%"> <label class="radio-inline" id="logolabel"> <img src="~/Content/img/ninghong.jpg" border="0" class="logoclass" /> </label> </td> <td style="text-align:left;width:22%"> <div class="TopNamelogo" id="TopNamelogo">宁虹电子</div> </td> <td style="width:20%"> <div class="TopName" id="TopName">订单执行看板</div> </td> <td style="width:16%"> <div style="" id="demo1" class="xm-select-demo" ></div> </td> <td style="width:5%"> <a id="IsOut" href="#" style="float:right;color:antiquewhite;font-size:18px" class="btn btn-primary" onclick="gridList1()">查询</a> </td> <td style="width:5%"> <a id="IsOut" href="#" style="float:right;color:antiquewhite;font-size:18px" class="btn btn-primary" onclick="btn_ExportAll()">导出</a> </td> <td style="width:8%"> <a id="IsStartEnd" href="#" onclick="ChangeStartEnd()" class="btn btn-primary" style="float:right;color:antiquewhite; font-size:18px">暂停滚动</a> </td> <td style="width:10%"> <div class="time" id="timeStr"></div> </td> </tr>
<tr style="width:100%;height:100%;"> <td colspan="8" > <div class="gridPanel" id="gridPanel1"> <table id="gridList1"></table>
</div> </td>
</tr>
</table>
</div>
</form>
|