From e5e84697944ee6e52ea1e16e8b8929f81ea16d13 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期五, 16 九月 2022 08:58:48 +0800 Subject: [PATCH] 设备稼动率看板 --- KB_EquipmentUtilizationRate.html | 144 +++++++++++++++++------------------------------ 1 files changed, 53 insertions(+), 91 deletions(-) diff --git a/KB_EquipmentUtilizationRate.html b/KB_EquipmentUtilizationRate.html index 86bcb32..ec8d988 100644 --- a/KB_EquipmentUtilizationRate.html +++ b/KB_EquipmentUtilizationRate.html @@ -15,6 +15,7 @@ <script src="js/jquery.SuperSlide.2.1.3.js"></script> <script src='js/template.js'></script> <script src="js/jquery.qrcode.min.js"></script> + <script src="js/webConfig.js"></script> <style> .clock { font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif; @@ -222,7 +223,7 @@ </style> <script type="text/javascript"> //鍙傛暟閰嶇疆 - var HouseCode = '509'; + var HouseCode = '509'; var interval;//璁℃椂鍣� @@ -263,10 +264,11 @@ var mychart3 = echarts.init(document.getElementById('mychart3')); Chart(mychart1, mychart2, mychart3); - DataTable(); + + DataTableCol(20); + // 瀹氭椂鍣� interval = setInterval(function () { - num = 0; NetQtys = []; //寮�鏈� SumQtys = []; //寮�宸� WayQtys = []; //缁翠慨 @@ -276,8 +278,8 @@ Chart(mychart1, mychart2, mychart3); }, 20000); interval1 = setInterval(function () { - $("#tb_order").bootstrapTable('refresh'); - }, 10000); + DataTableCol(20); + }, 1000); //鏍规嵁娴忚鍣ㄥぇ灏忔敼鍙樺ぇ灏� window.onresize = () => { mychart1.resize(); @@ -288,7 +290,7 @@ function Chart(mychart1, mychart2, mychart3) { $.ajax({ - url: "http://localhost:12298/api/loaddata/KB_EquipmentUtilizationRateData", + url: GetWEBURL() +"loaddata/KB_EquipmentUtilizationRateData", dataType: "JSON", async: false,//浣跨敤鍚屾鐨勬柟寮�,true涓哄紓姝ユ柟寮� type: "Get", @@ -341,7 +343,7 @@ } }) - const colorList = ['#47A2FF', '#ff9900', '#c0ffff','#ffffff'] + const colorList = ['#47A2FF', '#ff9900', '#c0ffff', '#ffffff'] option1 = { title: [ { @@ -570,15 +572,47 @@ //mychart2.setOption(option2); mychart3.setOption(option3); } + var col = []; + var colTable = []; + var option = []; + function DataTableCol(nums) { + var params = queryParams(nums); + $.ajax({ + url: GetWEBURL() + '/loaddata/KB_EquipmentUtilizationRateTableData' + , type: "get" + , data: { + HouseCode: params.HouseCode, + limit: params.limit, //椤甸潰澶у皬 + offset: params.offset //椤电爜 + } + , success: function (data) { + col = []; + var dataTable = JSON.parse(data); + //鍒ゆ柇鏄惁鏄渶鍚庝竴椤� + var num_total = (dataTable.data[0][0]["Column1"]) / nums + if (num >= num_total) { + num = 0 + } + + for (var i = 0; i < dataTable.ColName.length; i++) { + col.push({ field: dataTable.ColName[i].ColName, title: dataTable.ColName[i].ColName, align: "left" }) + } + colTable = dataTable.data[1]; + DataTable(); + $('#tb_order').bootstrapTable('destroy');//鍏堝垹闄� + $('#tb_order').bootstrapTable(option);//鍐嶉噸鏂版覆鏌� + } + }) + } function DataTable() { - - $('#tb_order').bootstrapTable({ - url: 'http://122.227.199.62:5058/HDKanBanApi/api/loaddata/LackMatsTableData', - //data: dataJson, - method: 'get', //璇锋眰鏂瑰紡锛�*锛� - dataType: "json", - queryParams: queryParams, + //$('#tb_order').bootstrapTable(); + option = { + //url: GetWEBURL() +'/loaddata/KB_EquipmentUtilizationRateTableData', + data: colTable, + //method: 'get', //璇锋眰鏂瑰紡锛�*锛� + //dataType: "json", + //queryParams: queryParams, striped: false, //鏄惁鏄剧ず琛岄棿闅旇壊 cache: false, //鏄惁浣跨敤缂撳瓨锛岄粯璁や负true锛屾墍浠ヤ竴鑸儏鍐典笅闇�瑕佽缃竴涓嬭繖涓睘鎬э紙*锛� pagination: true, //鏄惁鏄剧ず鍒嗛〉锛�*锛� @@ -595,77 +629,7 @@ uniqueId: "ID", //姣忎竴琛岀殑鍞竴鏍囪瘑锛屼竴鑸负涓婚敭鍒� cardView: false, //鏄惁鏄剧ず璇︾粏瑙嗗浘 detailView: false, //鏄惁鏄剧ず鐖跺瓙琛� - - columns: [ - { field: 'PartNumber', title: '鐗╂枡缂栫爜', align: "left" }, - { - field: 'PartName', title: '鐗╂枡鍚嶇О', align: "left", cellStyle: function (value, row, index) { - return { - css: { - "min-width": "100px", - "white-space": "nowrap", - "text-overflow": "ellipsis", - "overflow": "hidden", - "max-width": "120px" - } - } - } - }, - { - field: 'PartSpec', title: '瑙勬牸鍨嬪彿', align: "left", cellStyle: function (value, row, index) { - return { - css: { - "min-width": "100px", - "white-space": "nowrap", - "text-overflow": "ellipsis", - "overflow": "hidden", - "max-width": "120px" - } - } - } - }, - { - field: 'LackMastQty', title: '缂烘枡鏁伴噺', align: "left", formatter: function (value, row, index) { - return parseFloat(value).toFixed(2); - } - }, - { - field: 'KQty', title: '搴撳瓨鏁伴噺', align: "left", formatter: function (value, row, index) { - return parseFloat(value).toFixed(2); - } - }, - { - field: 'EmpQty', title: '鍗犵敤鏁伴噺', align: "left", formatter: function (value, row, index) { - return parseFloat(value).toFixed(2); - } - }, - { - field: 'AVAILQTY', title: '鍓╀綑鍙敤鏁伴噺', align: "left", formatter: function (value, row, index) { - var res = row.KQty - row.EmpQty; - return parseFloat(res).toFixed(2); - } - }, - { - field: 'PuchQty', title: '閲囪喘鍦ㄩ�旀暟閲�', align: "left", formatter: function (value, row, index) { - return parseFloat(value).toFixed(2); - } - }, - { - field: 'SafeQty', title: '瀹夊叏搴撳瓨', align: "left", formatter: function (value, row, index) { - return parseFloat(value).toFixed(2); - } - }, - { - field: 'SupQty', title: '闇�姹傞噺', align: "left", formatter: function (value, row, index) { - return parseFloat(value).toFixed(2); - } - }, - { - field: 'ToDaySupQty', title: '鏈棩姹傞噺', align: "left", formatter: function (value, row, index) { - return parseFloat(value).toFixed(2); - } - } - ], + columns: col, onClickRow: function (row, $element) { }, @@ -673,21 +637,19 @@ }, onLoadSuccess: function (row) { - var num_total = (row.total) / 20 - if (num >= num_total) { - num = 0 - } + //var a = $('#tb_order').bootstrapTable('getSelections'); } - }) + }; } //寰楀埌鏌ヨ鐨勫弬鏁� function queryParams(params) { num += 1; var temp = { //杩欓噷鐨勯敭鐨勫悕瀛楀拰鎺у埗鍣ㄧ殑鍙橀噺鍚嶅繀椤讳竴鐩达紝杩欒竟鏀瑰姩锛屾帶鍒跺櫒涔熼渶瑕佹敼鎴愪竴鏍风殑 HouseCode: HouseCode, - limit: params.limit, //椤甸潰澶у皬 + //limit: params.limit, //椤甸潰澶у皬 + limit: params, //椤甸潰澶у皬 offset: num, //椤电爜 }; return temp; -- Gitblit v1.9.1