| | |
| | | </div>
|
| | | </div>
|
| | |
|
| | | |
| | | <input style="visibility:hidden" id="getnumber" type="text" name="customer_area_id" >
|
| | | </div>
|
| | | </div>
|
| | | </body>
|
| | |
| | | createTbl(tbl, arrTh, dataArr);
|
| | | $(document).ready(function(){
|
| | | setPage();
|
| | | |
| | | Page.pageCurr=1;
|
| | | searchBattLife();
|
| | | getnumber();
|
| | | Page.pageCurr=1;
|
| | | searchBattLife();
|
| | | //console.info($("#getnumber").val());
|
| | |
|
| | | });
|
| | | function getnumber(){ //向获取所有通讯计数并存入缓存
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: 'Battinf_applyAction!devCommNum',
|
| | | data: null,
|
| | | dataType: 'json',
|
| | | success:function(data) {
|
| | | data = JSON.parse(data.result);
|
| | | if(data.code==1){
|
| | | var json =JSON.stringify(data.data);
|
| | | setCookie("numberget",json);
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | function getCookienumber(id){//输入ID,返回通讯计数。数据从缓存获取。
|
| | | //id = 0;
|
| | | var number = getCookie("numberget");
|
| | | number = JSON.parse(number);
|
| | | console.info(number);
|
| | | if(number[0].dev_id){
|
| | | console.info(number);
|
| | | for(var i =0; i<number.length;i++){
|
| | | if(id == number[i].dev_id){
|
| | | return number[i].dev_commcount;
|
| | | }
|
| | | } |
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | function getcreatArr(){
|
| | | obj = {
|
| | |
| | | // 查询内容
|
| | | function searchBattLife(){
|
| | | var temp = JSON.stringify(getcreatArr());
|
| | | console.info(temp);
|
| | | //console.info(temp);
|
| | | arrTd = new Array();
|
| | | getnumber();
|
| | | var index = 0;
|
| | | getCookienumber();
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | |
| | | arrTd[index++] = data[i].binf.BattProductDate.substr(0,10);
|
| | | arrTd[index++] = data[i].binf.BattInUseDate.substr(0,10);
|
| | | arrTd[index++] = data[i].binf.install_user;
|
| | | //arrTd[index++] = "";
|
| | | arrTd[index++]='<a onclick="getButIndex(this)" class="ui-btn ui-btn-inline ui-corner-all operat-but" data-position-to="window"'+'but-index='+i+'>电池组实时数据</a>';
|
| | | arrTd[index++] = getCookienumber(data[i].binf.FBSDeviceId);
|
| | | arrTd[index++] = "";
|
| | | arrTd[index++]='<a onclick="getButIndex(this)" class="ui-btn ui-btn-inline ui-corner-all operat-but" data-position-to="window"'+'but-index='+i+'>电池组实时数据</a>';
|
| | | }
|
| | | }
|
| | | console.info(arrTd);
|
| | | createTbl(tblCon, arrTh, arrTd);
|
| | | createTbl(tblCon, arrTh, arrTd);
|
| | | timeer = window.setTimeout(function() {
|
| | | searchBattLife();
|
| | | }, 5000); |
| | | }
|
| | | });
|
| | | }
|