You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

575 lines
18 KiB

12 months ago
  1. @{
  2. ViewBag.Title = "宁虹";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script src="~/Content/js/echarts/echarts5.3.3.min.js"></script>
  6. <script src="~/Content/js/echarts/echarts-gl.min.js"></script>
  7. <style>
  8. .ui-jqgrid tr.jqgrow td {
  9. overflow: hidden;
  10. }
  11. .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td {
  12. overflow: hidden !important;
  13. }
  14. .btn-primary {
  15. margin-right: 2px;
  16. }
  17. html {
  18. height: 100%;
  19. }
  20. .topRow {
  21. height: 54px;
  22. background-color: #031c7bc2;
  23. padding-bottom: 5px;
  24. }
  25. body {
  26. height: 100%;
  27. FONT-SIZE: 15px;
  28. /*FONT-SIZE: 18px;*/
  29. background-color: black;
  30. --CustTitlecolor: #0bd4d4; /*表标题颜色*/ /*#4D5457 #000000bf*/
  31. --Custbackgroundcolor: #031c7bc2; /*#031c7b;*/ /*表整体颜色*/
  32. --CustSelect: #103764; /*选中颜色*/ /*悬浮颜色*/
  33. --Custcolor: white; /*字体颜色*/
  34. --CustBorderColor: #031c7bc2; /*边框颜色*/
  35. --CustRow1: #0e59a5d4; /*偶行颜色*/
  36. --CustRow2: #031c7bc2; /*奇行颜色*/
  37. }
  38. /*大标题*/
  39. .TopName {
  40. vertical-align: middle;
  41. text-align: center;
  42. font-size: 24px;
  43. font-weight: 700;
  44. /*color:var(--CustTitlecolor);*/
  45. color: white;
  46. }
  47. /*logo标题*/
  48. .TopNamelogo {
  49. vertical-align: middle;
  50. text-align: left;
  51. font-size: 24px;
  52. font-weight: 700;
  53. color: white;
  54. }
  55. .logoclass {
  56. height: 24px;
  57. }
  58. #logolabel {
  59. width:80%;
  60. }
  61. .time {
  62. vertical-align: middle;
  63. text-align: center;
  64. font-size: 20px;
  65. color: white;
  66. }
  67. .formdiv {
  68. height: 100% !important;
  69. margin-bottom: 2px;
  70. margin-top: 5px;
  71. margin-left: 10px;
  72. margin-right: 10px;
  73. }
  74. .thclass {
  75. width: 100px;
  76. font-weight: 500;
  77. text-align: right;
  78. }
  79. table {
  80. height: 100%;
  81. }
  82. html, body {
  83. height: 100% !important;
  84. }
  85. form {
  86. height: 98% !important;
  87. background-color: black;
  88. }
  89. .bootstrap-select .dropdown-toggle .filter-option-inner-inner {
  90. height: 24px !important;
  91. }
  92. /*表列表头颜色*/
  93. .table > thead:first-child > tr:first-child > th {
  94. background-color: var(--Custbackgroundcolor);
  95. color: var(--CustTitlecolor);
  96. }
  97. /*表整体颜色*/
  98. .ui-jqgrid {
  99. background-color: var(--Custbackgroundcolor);
  100. color: var(--Custcolor);
  101. /*border: 1px solid var(--CustBorderColor);*/
  102. border: none;
  103. }
  104. .ui-jqgrid .table-bordered td {
  105. /*border: 0.5px solid var(--CustBorderColor);*/
  106. border: none;
  107. border-left: none;
  108. border-right: none;
  109. }
  110. /*悬浮颜色*/
  111. .table > tbody > tr.active > td, .table > tbody > tr.active > th, .table > tbody > tr > td.active,
  112. .table > tbody > tr > th.active, .table > tfoot > tr.active > td, .table > tfoot > tr.active > th,
  113. .table > tfoot > tr > td.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td,
  114. .table > thead > tr.active > th, .table > thead > tr > td.active, .table > thead > tr > th.active {
  115. background-color: var(--CustSelect);
  116. color: var(--Custcolor);
  117. }
  118. /*选中颜色*/
  119. .table > tbody > tr.success > td, .table > tbody > tr.success > th, .table > tbody > tr > td.success,
  120. .table > tbody > tr > th.success, .table > tfoot > tr.success > td, .table > tfoot > tr.success > th,
  121. .table > tfoot > tr > td.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td,
  122. .table > thead > tr.success > th, .table > thead > tr > td.success, .table > thead > tr > th.success {
  123. background-color: var(--CustSelect);
  124. color: var(--Custcolor);
  125. }
  126. /*偶行颜色*/
  127. div > div > div > table > tbody > tr:nth-child(2n) {
  128. background-color: var(--CustRow1);
  129. color: white;
  130. border: none;
  131. }
  132. /*奇行颜色*/
  133. div > div > div > table > tbody > tr:nth-child(2n+1) {
  134. background-color: var(--CustRow2);
  135. color: white;
  136. border: none;
  137. }
  138. form > div > table > tbody > tr > td {
  139. padding-bottom: 5px;
  140. padding-top: 5px;
  141. padding-left: 5px;
  142. padding-right: 5px;
  143. }
  144. ::-webkit-scrollbar-thumb {
  145. background-color: var(--CustTitlecolor);
  146. }
  147. #tdXX1 > div > div > canvas {
  148. height: 100% !important;
  149. }
  150. #tdXX1 > div > div {
  151. height: 100% !important;
  152. }
  153. /*.ui-jqgrid .ui-jqgrid-htable thead th {
  154. padding:4px 2px 4px 2px;
  155. }*/
  156. .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td,
  157. .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
  158. padding: 4px 2px 4px 2px;
  159. }
  160. </style>
  161. <link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" />
  162. <script src="~/Content/js/CommonReport/CommonReport.js"></script>
  163. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  164. <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
  165. <script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
  166. <script src="~/Content/js/xm-select.js"></script>
  167. <script>
  168. var HeightToDel = 100;
  169. var timer;
  170. var timer2;//刷新数据时间
  171. var TBBackColor = "#031c7bc2";
  172. var TBTitleFontColor = "#0bd4d4";
  173. var GunDongRate = 2 * 1000;//单位毫秒 //表格滚动间隔时间
  174. var DataF = 300;//单位秒 //刷新数据时间
  175. var IsFirstShow = false;
  176. var GunDongRow = 1;
  177. var demo1;
  178. $(function () {
  179. demo1 = xmSelect.render({
  180. el: '#demo1',
  181. toolbar: { // 工具条【‘全选’,‘清空’】
  182. show: true, // 开启工具条
  183. showIcon: false, // 隐藏工具条的图标
  184. },
  185. filterable: true,
  186. //prop:{
  187. // name:'ssdesc',
  188. // value:'sscode'
  189. //}
  190. });
  191. $.ajax({
  192. url: "/SRM/WatchPanel/GetSScode?" + Math.random(),
  193. dataType: "json",
  194. async: false,
  195. type: 'GET',
  196. success: function (data1){
  197. //var array = new data1.length();
  198. var array = new Array();
  199. for (var i = 0; i < data1.length ; i++) {
  200. var datames = new Object();
  201. datames.name = data1[i].name;
  202. datames.value = data1[i].value;
  203. datames.selected = (data1[i].selected == "true" ? true : false);
  204. array.push(datames);
  205. }
  206. demo1.update({
  207. data: array
  208. })
  209. }
  210. })
  211. //显示时间
  212. getTime();
  213. gridList1();
  214. $(window).resize(function () {
  215. // gridList1();
  216. GunDongRow = 0;
  217. });
  218. scrollBody();
  219. //刷新数据
  220. timer2 = setInterval(function () {
  221. gridList1();
  222. }, DataF * 1000);
  223. });
  224. //自动滚动
  225. function scrollBody() {
  226. timer = setInterval(function () {
  227. scrollBody_act();
  228. }, GunDongRate);
  229. }
  230. function scrollBody_act()
  231. {
  232. var ob3 = $('#gridList1').getGridParam("records");
  233. var div = $('#gridList1').closest('.ui-jqgrid-bdiv')[0];
  234. var offsetHeight = div.offsetHeight;
  235. var scrollHeight = div.scrollHeight - offsetHeight;
  236. if (GunDongRow == 0) {
  237. var hh = offsetHeight;
  238. //GunDongRow = Math.floor(hh / 30.3);
  239. GunDongRow = 1;
  240. }
  241. // div.scrollTop = div.scrollTop + 1;
  242. if (div.scrollTop >= scrollHeight) {//循环滚动
  243. scrollHeight = div.scrollHeight - offsetHeight;//如果在滚动过程中添加过数据,需要重新结算scrollHeight
  244. if (div.scrollTop >= scrollHeight) {
  245. div.scrollTop = 0; //循环滚动,重置滚动头即可
  246. IsFirstShow = true;
  247. }
  248. if (div.scrollTop >= ob3 * 30.4) {
  249. div.scrollTop = 0; //循环滚动,重置滚动头即可
  250. IsFirstShow = true;
  251. }
  252. }
  253. if (!IsFirstShow) {
  254. div.scrollTop = div.scrollTop + (GunDongRow * 30.3);
  255. }
  256. else { IsFirstShow = false; }
  257. }
  258. //end 自动滚动
  259. function GetAllCols1() {
  260. var _cols = new Array();
  261. //项目号 客户名称 设备类型 产品名称 产品型号 序列号 计划开工日期 计划完工日期 数量 设备编号 生产工单号
  262. //项目进度条 项目阶段 状态 生产确认表 电装开始 电装完成 机械装配开始 机械装配完成 总装开始 总装完成 仪表配置开始
  263. //仪表配置完成 调试测试开始 调试测试完成 FAT开始 FAT完成 FQC OQC 产品类型
  264. //_cols.push({ label: 'ID', name: 'ID', width: 110, align: 'left', hidden: true, });
  265. _cols.push({ label: '线体', name: '线体', width: 80, align: 'left', });
  266. _cols.push({ label: '生产订单号', name: '生产订单号', width: 130, align: 'left', });
  267. _cols.push({ label: 'AB面', name: 'AB面', width: 60, align: 'left', });
  268. //_cols.push({ label: '工单日期', name: '工单日期', width: 160,lign: 'left', });
  269. _cols.push({ label: '产品编码', name: '产品编码', width: 140, align: 'left', });
  270. _cols.push({ label: '产品代码', name: '产品代码', width: 200, align: 'left', });
  271. // _cols.push({ label: '规格', name: '规格', width: 240, align: 'left', });
  272. _cols.push({ label: '换线时间', name: '换线时间', width: 160, align: 'left', });
  273. _cols.push({ label: '打件时间', name: '打件时间', width: 160, align: 'left', });
  274. _cols.push({ label: '首检时间', name: '首检时间', width: 160, align: 'left', });
  275. _cols.push({ label: '计划量', name: '计划量', width: 80, align: 'left', });
  276. _cols.push({ label: '产出量', name: '产出量', width: 80, align: 'left', });
  277. //_cols.push({ label: 'COLORSTR', name: 'COLORSTR', width: 50, align: 'left', hidden: true, });
  278. //_cols.push({
  279. // label: '项目阶段', name: '项目阶段', width: 150, align: 'left',
  280. // cellattr: function addCellAttr(rowId, val, rawObject, cm, rdata) {
  281. // if (rawObject.COLORSTR == "green") {
  282. // return "style='color:#42f943'";
  283. // }
  284. // }
  285. //});
  286. //_cols.push({
  287. // label: '完成率', name: '完成率', width: 200, align: 'left',
  288. // formatter: function (cellvalue, options, rowObject) {
  289. // var str_retrun = '<div id="JDText_' + rowObject.ID + '" style="width: 99%;height:98%;"></div>';
  290. // return cellvalue = str_retrun;
  291. // }
  292. //});
  293. _cols.push({ label: '完成率', name: '完成率', width: 80, align: 'left' });
  294. _cols.push({ label: '', name: '', width: 5, align: 'left' });
  295. return _cols;
  296. }
  297. function gridList1() {
  298. document.getElementById("gridPanel1").innerHTML = ' <table id="gridList1"></table> ';//重置grid
  299. var _cols = GetAllCols1();
  300. var $gridList = $("#gridList1" );
  301. var queryJson = {
  302. value:xmSelect.get('#demo1', true).getValue()
  303. }
  304. $gridList.dataGrid({
  305. url: "/SRM/WatchPanel/GetGridJson_WIPJinDu?" + Math.random(),
  306. postData: { queryJson: JSON.stringify(queryJson) },
  307. height: $("#form1").height() - HeightToDel,
  308. colModel: _cols,
  309. // caption: '生产进度汇总表',
  310. // sortname: " ",
  311. rowNum: 5000,
  312. viewrecords: true,
  313. rownumbers: true,
  314. multiselect: false,
  315. gridComplete: function () {
  316. $("#gridList1").jqGrid('setLabel', 'rn', '序号', { 'text-align': 'center', 'vertical-align': 'middle' }, '');
  317. // var strIds = $("#gridList1").jqGrid("getDataIDs");
  318. // for (var i = 0; i < strIds.length; i++) {
  319. // var ID = $("#gridList1").jqGrid("getCell", strIds[i], "ID");
  320. // var QTY = $("#gridList1").jqGrid("getCell", strIds[i], "完成率值");
  321. //var COLORSTR = $("#gridList1").jqGrid("getCell", strIds[i], "COLORSTR");
  322. //var Status = $("#gridList1").jqGrid("getCell", strIds[i], "状态");
  323. //JDPictureSet("JDText_" + ID, QTY, '');
  324. // }
  325. }
  326. });
  327. }
  328. function JDPictureSet(JDDivID, JDQty, Status) {
  329. var myChart = echarts.init(document.getElementById(JDDivID));
  330. var Colorfont = "black";
  331. var Color = "white";
  332. //if (Status == "紧急") {
  333. // Color = "yellow";//黄色
  334. //}
  335. //if (Status == "完成") {
  336. // Color = "#42f943";//绿色
  337. //}
  338. //if (Status == "延期") {
  339. // Color = "red";//红色
  340. // Colorfont = "white";
  341. //}
  342. //if (JDQty == 0) {
  343. // Colorfont = Color;
  344. //}
  345. myChart.setOption({ //加载数据图表
  346. title: {
  347. show: false,
  348. },
  349. tooltip: {
  350. show: false,
  351. },
  352. legend: { show: false, },
  353. grid: { show: false, },
  354. xAxis: {
  355. type: 'value',
  356. axisLine: { show: false },
  357. axisTick: { show: false },
  358. axisLabel: { show: false },
  359. splitLine: { show: false },
  360. max: 100,
  361. min: 0,
  362. },
  363. yAxis: {
  364. axisLine: { show: false },
  365. axisTick: { show: false },
  366. axisLabel: { show: false },
  367. splitLine: { show: false },
  368. type: 'category',
  369. },
  370. series: [
  371. {
  372. type: 'bar',
  373. data: [JDQty],
  374. label: {
  375. show: true,
  376. formatter: '{c}%',
  377. color: Colorfont
  378. },
  379. itemStyle: {
  380. color: Color,
  381. }
  382. }
  383. ]
  384. });
  385. }
  386. function getTime() {
  387. var days = new Array("日", "一", "二", "三", "四", "五", "六");
  388. var currentDT = new Date();
  389. var y, m, date, day, hs, ms, ss, theDateStr;
  390. y = currentDT.getFullYear(); //四位整数表示的年份
  391. m = currentDT.getMonth() < 10 ? '0' + (currentDT.getMonth() + 1) : (currentDT.getMonth() + 1); //月
  392. date = currentDT.getDate() < 10 ? '0' + currentDT.getDate() : currentDT.getDate(); //日
  393. day = currentDT.getDay(); //星期
  394. hs = currentDT.getHours() < 10 ? '0' + currentDT.getHours() : currentDT.getHours(); //时
  395. ms = currentDT.getMinutes() < 10 ? '0' + currentDT.getMinutes() : currentDT.getMinutes(); //分
  396. ss = currentDT.getSeconds() < 10 ? '0' + currentDT.getSeconds() : currentDT.getSeconds(); //秒
  397. theDateStr = y + "-" + m + "-" + date + " " + hs + ":" + ms + ":" + ss;
  398. //填充到组件中
  399. $("#timeStr").text(theDateStr);
  400. // setTimeout 在执行时,是在载入后延迟指定时间后,去执行一次表达式,仅执行一次
  401. window.setTimeout(getTime, 1000);
  402. }
  403. function ChangeStartEnd()
  404. {
  405. var textTT=$("#IsStartEnd").text();
  406. if (textTT == "暂停滚动") {
  407. timer = window.clearInterval(timer);//停止滚动
  408. $("#IsStartEnd").text("开始滚动");
  409. }
  410. else {
  411. timer = setInterval(function () {
  412. scrollBody_act();
  413. }, GunDongRate);
  414. $("#IsStartEnd").text("暂停滚动");
  415. }
  416. }
  417. function btn_ExportAll() {
  418. var txtProject ="";
  419. var txtEQPType = "";
  420. var txtItemStd = "";
  421. var txtEQPCode = "";
  422. var txtPlanStartDay = "";
  423. var txtMOCode = "";
  424. var txtItemCode = "";
  425. var txtProJieDuan = "";
  426. var txtStatus = "";
  427. var txtPlanEndDay = "";
  428. var queryJson = {
  429. value: xmSelect.get('#demo1', true).getValue()
  430. }
  431. var VV="";
  432. for(var i =0;i<queryJson.length;i++)
  433. {
  434. if(i==0){
  435. VV = queryJson[i].value;
  436. }
  437. else
  438. {
  439. VV = VV + "," + queryJson[i].value;
  440. }
  441. }
  442. var data = "&value=" + VV;
  443. $.download("/SRM/WatchPanel/ExportAll?" + Math.random(), data, 'post');
  444. }
  445. </script>
  446. <form id="form1">
  447. <div class="formdiv">
  448. <table class="form">
  449. <tr class="topRow">
  450. <td style="text-align:right;width:8%">
  451. <label class="radio-inline" id="logolabel">
  452. <img src="~/Content/img/ninghong.jpg" border="0" class="logoclass" />
  453. </label>
  454. </td>
  455. <td style="text-align:left;width:22%">
  456. <div class="TopNamelogo" id="TopNamelogo">宁虹电子</div>
  457. </td>
  458. <td style="width:20%">
  459. <div class="TopName" id="TopName">订单执行看板</div>
  460. </td>
  461. <td style="width:16%">
  462. <div style="" id="demo1" class="xm-select-demo" ></div>
  463. </td>
  464. <td style="width:5%">
  465. <a id="IsOut" href="#" style="float:right;color:antiquewhite;font-size:18px" class="btn btn-primary" onclick="gridList1()">查询</a>
  466. </td>
  467. <td style="width:5%">
  468. <a id="IsOut" href="#" style="float:right;color:antiquewhite;font-size:18px" class="btn btn-primary" onclick="btn_ExportAll()">导出</a>
  469. </td>
  470. <td style="width:8%">
  471. <a id="IsStartEnd" href="#" onclick="ChangeStartEnd()" class="btn btn-primary" style="float:right;color:antiquewhite; font-size:18px">暂停滚动</a>
  472. </td>
  473. <td style="width:10%">
  474. <div class="time" id="timeStr"></div>
  475. </td>
  476. </tr>
  477. <tr style="width:100%;height:100%;">
  478. <td colspan="8" >
  479. <div class="gridPanel" id="gridPanel1">
  480. <table id="gridList1"></table>
  481. </div>
  482. </td>
  483. </tr>
  484. </table>
  485. </div>
  486. </form>