| | |
| | | <div >
|
| | | <!-- 分页内容 -->
|
| | | <div id="paging">
|
| | | <!-- <a href="javascript:" class="search">添加</a> 添加 -->
|
| | | <a href="javascript:" id="search" class="layui-btn layui-btn-normal search">查找</a>
|
| | | <a class="layui-btn layui-btn-normal addbtn">添加</a>
|
| | | <script type="text/html" id="toolBar">
|
| | | <a class="layui-btn layui-btn-xs" lay-event="details">添加</a>
|
| | |
| | |
|
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | | $(document).ready(function(){
|
| | | console.info(1111);
|
| | | tOptions.data=getData(100,0);
|
| | | var tableObj = table.render(tOptions);
|
| | | tableObj.reload(tOptions);
|
| | | });
|
| | | // $(document).ready(function(){
|
| | | //console.info(1111);
|
| | | // tOptions.data=getData(100,0);
|
| | | // var tableObj = table.render(tOptions);
|
| | | // tableObj.reload(tOptions);
|
| | | // });
|
| | |
|
| | |
|
| | | function getData(a,b){
|
| | | var arr=[];
|
| | | for(i=0;i<a;i++){
|
| | | arr.push({'station_name1':b,'city':b+i,'stationName3':b+i+1,'note':b+i+2,'question':'hahaha哈哈卡卡卡卡卡卡卡卡'+i});
|
| | | arr.push({'station_name1':b,'city':b+i,'stationName3':b+i+1,'note':b+i+2,'question':'hahaha哈哈卡卡卡卡卡卡卡卡'+i});
|
| | | }
|
| | | return arr
|
| | | }
|
| | |
| | | });
|
| | | function searchStationHistRecord(){
|
| | | // 将param添加到#detailsOpts
|
| | | //$('#detailsOpts').data('data', param);
|
| | | |
| | | //$('#detailsOpts').data('data', param); |
| | | // 请求获取当前省下的市
|
| | | |
| | | // 显示面板
|
| | | layer.open({
|
| | | type: 2,
|
| | |
| | | });
|
| | |
|
| | | }
|
| | | |
| | | |
| | | |
| | | // 省-市-机房-电池组
|
| | | $(document).ready(function() {
|
| | |
|
| | | //页面加载时查询维护区中的枢纽类型
|
| | | $.post("User_battgroup_baojigroup_battgroupAction!serchStationName1InGroup", null,
|
| | | function(data) {
|
| | | data = data.result;
|
| | | data = eval("(" + data + ")");
|
| | | //console.info(data);
|
| | | if (data.code == 1 && data.data.length > 0) {
|
| | | var $select = $("#station_name1");
|
| | | $select.text('');
|
| | | for (var i = 0; i <= data.data.length; i++) {
|
| | | $option = $("<option></option>");
|
| | | if (i == 0) {
|
| | | $option.html("全部(" + data.data.length + ")");
|
| | | $option.attr("value", "");
|
| | | } else {
|
| | | $option.text(data.data[i - 1]);
|
| | | $option.attr("value", data.data[i - 1]);
|
| | | }
|
| | | $select.append($option);
|
| | | |
| | | |
| | | }
|
| | | |
| | | } else {
|
| | | $("#station_name1").text('').html('<option>暂无管理的维护区</option>');
|
| | | |
| | | }
|
| | | findCity();
|
| | | });
|
| | | });
|
| | | // 省-市-机房-电池组
|
| | | $(document).ready(function() {
|
| | | //页面加载时查询维护区中的枢纽类型
|
| | | $.post("User_battgroup_baojigroup_battgroupAction!serchStationName1InGroup", null,
|
| | | function(data) {
|
| | | data = data.result;
|
| | | data = eval("(" + data + ")");
|
| | | //console.info(data);
|
| | | if (data.code == 1 && data.data.length > 0) {
|
| | | var $select = $("#station_name1");
|
| | | $select.text('');
|
| | | for (var i = 0; i <= data.data.length; i++) {
|
| | | $option = $("<option></option>");
|
| | | if (i == 0) {
|
| | | $option.html("全部(" + data.data.length + ")");
|
| | | $option.attr("value", "");
|
| | | } else {
|
| | | $option.text(data.data[i - 1]);
|
| | | $option.attr("value", data.data[i - 1]);
|
| | | }
|
| | | $select.append($option); |
| | | } |
| | | } else {
|
| | | $("#station_name1").text('').html('<option>暂无管理的维护区</option>'); |
| | | }
|
| | | findCity();
|
| | | });
|
| | | });
|
| | |
|
| | | function findCity() {
|
| | | var data = {
|
| | |
| | |
|
| | | }
|
| | | });
|
| | | } |
| | | |
| | | function tempCondition(){
|
| | | temp ={
|
| | | StationId:"",
|
| | | StationName1:$('#station_name1').val(),
|
| | | StationName2:$('#city').val(),
|
| | | StationName5:"",
|
| | | page:{
|
| | | pageSize:10,
|
| | | pageCurr:1,
|
| | | }, |
| | | }
|
| | | console.info(temp);
|
| | | return temp; |
| | | }
|
| | | |
| | | |
| | | }); |
| | | |
| | | function searchfault()
|
| | | {
|
| | | var sData = tempCondition(); |
| | | var loading = layer.load();
|
| | | // 根据查询条件,查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: 'Deverror_recordAction!serchByCondition',
|
| | | data: "json="+JSON.stringify(sData),
|
| | | dataType: 'json',
|
| | | success: function(result) {
|
| | | //console.info(result);
|
| | | var data = JSON.parse(result.result);
|
| | | console.info(data)
|
| | | if(data.code==1&&data.data.length>0){
|
| | | console.info(data);
|
| | | var data = data.data;
|
| | | for(i=0;i<data.length;i++){
|
| | | var tmp = {};
|
| | | var data = data[i];
|
| | | tmp.station_name1 = data.stationName1;
|
| | | tmp.city = data.stationName2;
|
| | | tmp.stationName3 = data.stationName; |
| | | tmp.note = data.record_time;
|
| | | tmp.question = data.error_descript;
|
| | | tOptions.data.push(tmp);
|
| | | }
|
| | | }else {
|
| | | layer.msg('暂无数据!', {icon:0, shade: 0.1,shadeClose:true});
|
| | | }
|
| | | console.info(tOptions);
|
| | | var pageNum = data.length;
|
| | | console.info(pageNum);
|
| | | tOptions.limit = pageNum;
|
| | | // 设置分页信息
|
| | | $('#total').text(pageNum);
|
| | | table.render(tOptions);
|
| | | layer.close(loading);
|
| | | } |
| | | });
|
| | | }
|
| | | |
| | | $('#search').click(function(){
|
| | | searchfault();
|
| | | });
|
| | | |
| | | }); |
| | |
|
| | |
|
| | |
|