<!DOCTYPE html>
|
<html lang="en">
|
<head>
|
<meta charset="UTF-8">
|
<title>添加包机机房或设备</title>
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/>
|
<link rel="stylesheet" type="text/css" href="css/tbl.css">
|
<script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
|
<script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
|
<link rel="stylesheet" href="css/fgpanel.css">
|
<style type="text/css">
|
.tbl-container table{
|
color:#e61212!important;
|
}
|
</style>
|
</head>
|
<body>
|
<div data-role="page" id="pageone">
|
<!-- 面板内容 -->
|
<div class="fg-panel">
|
<form>
|
<div class="fg-panel-header">筛选</div>
|
<div class="fg-panel-content">
|
<fieldset data-role="controlgroup">
|
<p>省</p>
|
<select id="mainteArea" data-mini="true">
|
<option value="">全部</option>
|
</select>
|
<p>市</p>
|
<select id="city" data-mini="true">
|
<option value="">全部</option>
|
</select>
|
<p>区/县</p>
|
<select id="country" data-mini="true">
|
<option value="">全部</option>
|
</select>
|
<p>机房站点</p>
|
<select id="homeName" data-mini="true">
|
<option value="">全部</option>
|
</select>
|
<p>蓄电池组</p>
|
<select id="battgroup_name" data-mini="true">
|
<option value="0">全部</option>
|
</select>
|
</fieldset>
|
</div>
|
<div class="fg-panel-btn">
|
<a href="javascript:panel.hide(true);" data-role="button" id="submit" class="ui-btn ui-mini ui-btn-b ui-shadow">添加</a>
|
</div>
|
</form>
|
</div>
|
|
<!-- 头部内容 -->
|
<div data-role="header" data-position="fixed">
|
<a href="elegroup-batt.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">返回</a>
|
<h1>添加包机机房或设备</h1>
|
<a href="javascript:panel.show();" class="ui-btn ui-corner-all ui-shadow ui-icon-grid ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;" id="screen">筛选</a>
|
</div>
|
<!-- 主体内容 -->
|
<div data-role="main">
|
<div class="pre-page"><a href="#" class="ui-btn ui-corner-all ui-icon-carat-l ui-btn-icon-notext">图标</a></div>
|
<div class="next-page"><a href="#" class="ui-btn ui-corner-all ui-icon-carat-r ui-btn-icon-notext">图标</a></div>
|
<!-- 表格容器 -->
|
<div class="tbl-container"></div>
|
<table data-role="table" class="ui-responsive ui-shadow" id="tab" >
|
</table>
|
</div>
|
<!-- 页脚内容 -->
|
<div data-role="footer" data-position="fixed" data-theme="a">
|
<div data-role="navbar">
|
<ul>
|
<li><a href="#yourPopup" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but ui-btn-icon-check" data-position-to="window" data-icon="check" data-role="button">应用</a></li>
|
<li><a href="elegroup-batt.html" id="cancel" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but ui-btn-icon-delete" data-position-to="window" data-icon="delete" data-role="button">取消</a></li>
|
</ul>
|
</div>
|
</div>
|
<div data-role="popup" id="yourPopup" class="ui-content" data-overlay-theme="b">
|
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn ui-icon-delete ui-btn-icon-notext ui-btn-right">关闭</a>
|
<a href="" data-rel="back" id="sure" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ui-icon-check" >提交应用</a>
|
<a href="" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ui-icon-delete" >取消应用</a>
|
</div>
|
</div>
|
|
</body>
|
|
<script type="text/javascript" src="mobilJs/base.js"></script>
|
<script type="text/javascript" src="js/tbl.js"></script>
|
<script type="text/javascript" src="js/echarts.js"></script>
|
<script type="text/javascript" src="js/eleAnalyse.js"></script>
|
<script type="text/javascript" src="js/panel.js"></script>
|
<script type="text/javascript">
|
|
var data = new Date;
|
var arrTh = ['包机机房', '包机电池组'];
|
var dataArr = new Array();
|
dataArr = [];
|
var newArrTd = [];
|
var tblCon = $('.tbl-container');
|
var battProducer = "";
|
var Page = {
|
pageSize : 10,
|
pageCurr : 1,
|
pageAll : 0,
|
};
|
|
var startTime = "1980-01-01";
|
var endTime = new Date;
|
|
$(document).ready(function(){
|
$("#submit").click(function(){
|
searchDisCharage();
|
});
|
});
|
|
|
function searchDisCharage(){
|
loadshow();
|
arr=[];
|
for(i=0;i<100;i++){arr[i]=i*10}
|
createTbl(tblCon, arrTh, arr);
|
loadclose();
|
}
|
|
|
function judgepronextshow(){
|
var pageNum = Math.ceil(Page.pageAll/Page.pageSize);
|
console.info(Page.pageCurr);
|
if (pageNum!==1){//有多页
|
if (Page.pageCurr==1){
|
setPageTurning(false, true); //当前页为1,隐藏左边
|
}
|
else if (Page.pageCurr== pageNum)
|
{
|
setPageTurning(true, false); //当前页为最后一页,隐藏右边
|
}
|
else
|
{
|
setPageTurning(true, true); //为中间,两边都不隐藏
|
}
|
}else{
|
setPageTurning(false, false);
|
} //只有一页,隐藏两边
|
}
|
|
|
//页面加载时查询省
|
$.post("BattInfAction_serchByStation",null,function(data){
|
data = data.result;
|
data = eval("("+data+")");
|
//console.info(data);
|
//console.info(data.code);
|
if(data.code==1&&data.data.length>0){
|
var $Ostation_name1=$("#mainteArea");
|
$Ostation_name1.text("");
|
var arr = new Array();
|
for(var i=0;i<=data.data.length;i++)
|
{
|
if(i == 0){
|
arr.push({
|
val:"",
|
txt:"全部(共"+data.sum+"个)",
|
});
|
}else{
|
arr.push({
|
val:data.data[i-1].StationName1,
|
txt:data.data[i-1].StationName1,
|
});
|
}
|
}
|
updataSel($Ostation_name1, arr);
|
}
|
findCity();
|
});
|
|
|
//当省改变时更新市
|
function findCity(){
|
var data = {
|
StationName1: $("#mainteArea").val()
|
};
|
//console.info(data);
|
// 请求获取当前省下的市
|
$.ajax({
|
type: "post",
|
url: "BattInfAction!serchStationName2",
|
async:true,
|
dataType:'json',
|
data:"json = "+JSON.stringify(data),
|
success: function(data){
|
data = data.result;
|
data = eval("("+data+")");
|
//console.info(data);
|
//console.info(data.code);
|
if(data.code==1&&data.data.length>0){
|
var $Ostation_name1=$("#city");
|
$Ostation_name1.text("");
|
var arr = new Array();
|
for(var i=0;i<=data.data.length;i++)
|
{
|
if(i == 0){
|
arr.push({
|
val:"",
|
txt:"全部(共"+data.data.length+"个)",
|
});
|
}else{
|
arr.push({
|
val:data.data[i-1].StationName2,
|
txt:data.data[i-1].StationName2,
|
});
|
}
|
}
|
updataSel($Ostation_name1, arr);
|
}
|
findCounty();
|
}
|
});
|
}
|
|
//当市改变时更新区/县
|
function findCounty(){
|
var data = {
|
StationName1: $("#mainteArea").val(),
|
StationName2:$("#city").val(),
|
};
|
//console.info(data);
|
$.ajax({
|
type: "post",
|
url: "BattInfAction!serchStationName5",
|
async:true,
|
dataType:'json',
|
data:"json = "+JSON.stringify(data),
|
success: function(data){
|
data = data.result;
|
data = eval("("+data+")");
|
//console.info(data);
|
//console.info(data.code);
|
if(data.code==1&&data.data.length>0){
|
var $Ostation_name1=$("#country");
|
$Ostation_name1.text("");
|
var arr = new Array();
|
for(var i=0;i<=data.data.length;i++)
|
{
|
if(i == 0){
|
arr.push({
|
val:"",
|
txt:"全部(共"+data.data.length+"个)",
|
});
|
}else{
|
arr.push({
|
val:data.data[i-1].StationName5,
|
txt:data.data[i-1].StationName5,
|
});
|
}
|
}
|
updataSel($Ostation_name1, arr);
|
}
|
findStationNamebyStationname1();
|
}
|
});
|
}
|
|
//当区县更新时更新机房
|
function findStationNamebyStationname1(){
|
var data = {
|
StationName1: $("#mainteArea").val(),
|
StationName2:$("#city").val(),
|
StationName5:$("#country").val()
|
};
|
$.ajax({
|
type: "post",
|
url: "BattInfAction!serchStationName3",
|
async:true,
|
dataType:'json',
|
data:"json = "+JSON.stringify(data),
|
success: function(data){
|
data = data.result;
|
data = eval("("+data+")");
|
//console.info(data);
|
//console.info(data.code);
|
if(data.code==1&&data.data.length>0){
|
var $Ostation_name1=$("#homeName");
|
$Ostation_name1.text("");
|
var arr = new Array();
|
for(var i=0;i<=data.data.length;i++)
|
{
|
if(i == 0){
|
arr.push({
|
val:"",
|
stationid:"",
|
txt:"全部(共"+data.data.length+"个)",
|
});
|
}else{
|
arr.push({
|
val:data.data[i-1].StationName,
|
stationid:data.data[i-1].StationId,
|
txt:data.data[i-1].StationName3,
|
});
|
}
|
}
|
updataSelStation($Ostation_name1, arr);
|
}
|
|
findserchByBattGroupNamebystationname();
|
}
|
});
|
}
|
|
//根据机房获取电池组
|
function findserchByBattGroupNamebystationname(){
|
var stationid = $("#homeName").find('option:selected').attr('stationid')?$("#homeName").find('option:selected').attr('stationid'):'';
|
|
var data = {
|
StationName1: $("#mainteArea").val(),
|
StationName2:$("#city").val(),
|
StationName5:$("#country").val(),
|
StationName: $("#homeName").val(),
|
StationId: stationid
|
};
|
|
//console.info(data);
|
$.ajax({
|
type: "post",
|
url: "BattInfAction!serchBattByStation",
|
async:true,
|
dataType:'json',
|
data:"json = "+JSON.stringify(data),
|
success: function(data){
|
data = data.result;
|
data = eval("("+data+")");
|
//console.warn();
|
//console.info(data);
|
//console.info(data.code);
|
if(data.code==1&&data.data.length>0){
|
var $Ostation_name1=$("#battgroup_name");
|
$Ostation_name1.text("");
|
var arr = new Array();
|
for(var i=0;i<=data.data.length;i++)
|
{
|
if(i == 0){
|
arr.push({
|
val:0,
|
txt:"全部(共"+data.data.length+"个)",
|
});
|
}else{
|
arr.push({
|
val:data.data[i-1].BattGroupId,
|
txt:data.data[i-1].BattGroupName,
|
});
|
}
|
}
|
updataSel($Ostation_name1, arr);
|
}
|
|
}
|
});
|
}
|
|
//当省改变时更新市
|
$('#mainteArea').change(function(){
|
findCity();
|
});
|
//当市改变时改变区/县
|
$('#city').change(function(){
|
findCounty();
|
});
|
//当区/县改变时改变机房
|
$('#country').change(function(){
|
findStationNamebyStationname1();
|
});
|
//当机房改变时,更新电池组
|
$('#homeName').change(function(){
|
findserchByBattGroupNamebystationname();
|
});
|
|
$(function() {
|
$('.pre-page').on('click', 'a', function() {
|
var isShowPre = true;
|
Page.pageSize = 10;
|
var pageNum = Math.ceil(Page.pageAll/Page.pageSize)
|
if(Page.pageCurr>1){
|
Page.pageCurr = Page.pageCurr - 1;
|
searchDisCharage();
|
}else {
|
searchDisCharage();
|
}
|
});
|
|
$('.next-page').on('click', 'a', function() {
|
var isShowNext = true;
|
Page.pageSize = 10;
|
console.info(Page.pageAll);
|
console.info(Page.pageSize);
|
var pageNum = Math.ceil(Page.pageAll/Page.pageSize);
|
if(Page.pageCurr<pageNum){
|
Page.pageCurr = Page.pageCurr + 1;
|
console.info(Page.pageCurr);
|
searchDisCharage()
|
}
|
});
|
});
|
|
|
// 添加整个省的机房
|
$('#tb-right-menu .add-province').click(function() {
|
//获取包机房名称和新增电池组名称
|
var myRoom=new Array();
|
var myRoomVal=new Array();
|
var singleELeGroup=new Array();
|
var singleEleVal=new Array();
|
var province=$('#station_name1').attr('value');
|
if(province.length>0 && $('#lbottom .li-con li.b8cfe5').text().length>0){
|
var binf=new Object();
|
binf={
|
BattGroupId: 0, // 电池组id
|
StationName: '', // 机房名称
|
StationName5: '', // 区/县
|
StationName2: '', // 市
|
StationName1: province, // 省
|
};
|
var json=window.JSON.stringify(binf);
|
$.post('BattInfAction!serchBatt','result='+json,function(data){
|
var model=eval("("+data.result+")");
|
//console.info(model);
|
if(model.code==1 && model.data.length>0){
|
//var stationid=0;
|
for(var i=0;i<model.data.length;i++){
|
var batt=model.data[i];
|
//console.info(batt);
|
myRoom.push(batt.StationName);
|
myRoomVal.push(batt.StationId);
|
singleELeGroup.push(batt.StationName);
|
singleELeGroup.push(batt.BattGroupName);
|
singleEleVal.push(batt.StationId);
|
singleEleVal.push(batt.BattGroupId);
|
}
|
//console.info(singleELeGroup);
|
addRedLi(myRoom,myRoomVal,singleELeGroup,singleEleVal);
|
}
|
});
|
}else{
|
layer.msg('请选择省!'); //请先选择省
|
}
|
});
|
|
// 添加整个市的机房
|
$('#tb-right-menu .add-city').click(function() {
|
//获取包机房名称和新增电池组名称
|
var myRoom=new Array();
|
var myRoomVal=new Array();
|
var singleELeGroup=new Array();
|
var singleEleVal=new Array();
|
var city = $('#city').attr('value');
|
if(city.length>0 && $('#lbottom .li-con li.b8cfe5').text().length>0){
|
var binf=new Object();
|
binf={
|
BattGroupId: 0, // 电池组id
|
StationName: '', // 机房名称
|
StationName5: '', // 区/县
|
StationName2: city, // 市
|
StationName1: '', // 省
|
};
|
//console.log(binf);
|
var json=window.JSON.stringify(binf);
|
$.post('BattInfAction!serchBatt','result='+json,function(data){
|
var model=eval("("+data.result+")");
|
//console.info(model);
|
if(model.code==1 && model.data.length>0){
|
//var stationid=0;
|
for(var i=0;i<model.data.length;i++){
|
var batt=model.data[i];
|
//console.info(batt);
|
myRoom.push(batt.StationName);
|
myRoomVal.push(batt.StationId);
|
singleELeGroup.push(batt.StationName);
|
singleELeGroup.push(batt.BattGroupName);
|
singleEleVal.push(batt.StationId);
|
singleEleVal.push(batt.BattGroupId);
|
}
|
//console.info(singleELeGroup);
|
addRedLi(myRoom,myRoomVal,singleELeGroup,singleEleVal);
|
}
|
});
|
}else{
|
layer.msg('请选择市!'); //请先选择市
|
}
|
});
|
|
// 添加整个区/县的机房
|
$('#tb-right-menu .add-county').click(function() {
|
//获取包机房名称和新增电池组名称
|
var myRoom=new Array();
|
var myRoomVal=new Array();
|
var singleELeGroup=new Array();
|
var singleEleVal=new Array();
|
var county = $('#county').attr('value');
|
if(county.length>0 && $('#lbottom .li-con li.b8cfe5').text().length>0){
|
var binf=new Object();
|
binf={
|
BattGroupId: 0, // 电池组id
|
StationName: '', // 机房名称
|
StationName5: county, // 区/县
|
StationName2: '', // 市
|
StationName1: '', // 省
|
};
|
//console.log(binf);
|
var json=window.JSON.stringify(binf);
|
$.post('BattInfAction!serchBatt','result='+json,function(data){
|
var model=eval("("+data.result+")");
|
console.info(model);
|
if(model.code==1 && model.data.length>0){
|
//var stationid=0;
|
for(var i=0;i<model.data.length;i++){
|
var batt=model.data[i];
|
//console.info(batt);
|
myRoom.push(batt.StationName);
|
myRoomVal.push(batt.StationId);
|
singleELeGroup.push(batt.StationName);
|
singleELeGroup.push(batt.BattGroupName);
|
singleEleVal.push(batt.StationId);
|
singleEleVal.push(batt.BattGroupId);
|
}
|
//console.info(singleELeGroup);
|
addRedLi(myRoom,myRoomVal,singleELeGroup,singleEleVal);
|
}
|
});
|
}else{
|
layer.msg('请选择区/县!'); //请先选择区/县
|
}
|
});
|
|
//添加单个电池组
|
$('#tb-right-menu .add-batt').click(function(){
|
var battgrouid= $('#battgroup_name').attr('value');
|
if(battgrouid!=0 && $('#lbottom .li-con li.b8cfe5').text().length>0){
|
var binf=new Object();
|
binf={
|
BattGroupId: battgrouid, // 电池组id
|
StationName: '', // 机房名称
|
StationName5: '', // 区/县
|
StationName2: '', // 市
|
StationName1: '', // 省
|
};
|
var json=window.JSON.stringify(binf);
|
$.post('BattInfAction!serchBatt','result='+json,function(data){
|
var model=eval("("+data.result+")");
|
//console.info(model);
|
var myRoom=new Array();
|
var myRoomVal=new Array();
|
var singleELeGroup=new Array();
|
var singleEleVal=new Array();
|
if(model.code==1){
|
var data=model.data[0];
|
myRoom.push(data.StationName);
|
myRoomVal.push(data.StationId);
|
singleELeGroup.push(data.StationName);
|
singleELeGroup.push(data.BattGroupName);
|
singleEleVal.push(data.StationId);
|
singleEleVal.push(data.BattGroupId);
|
//console.info(myRoom);
|
addRedLi(myRoom,myRoomVal,singleELeGroup,singleEleVal);
|
}
|
});
|
}else{
|
layer.msg('<s:text name="Please_choose_a_group_of_battery_pack!"/>');
|
}
|
});
|
//添加整个机房的电池组
|
$('#tb-right-menu .add-station').click(function(){
|
//获取包机房名称和新增电池组名称
|
var myRoom=new Array();
|
var myRoomVal=new Array();
|
var singleELeGroup=new Array();
|
var singleEleVal=new Array();
|
var stationname=$('#station_name').attr('value');
|
if(stationname.length>0 && $('#lbottom .li-con li.b8cfe5').text().length>0){
|
var binf=new Object();
|
binf={
|
BattGroupId: 0, // 电池组id
|
StationName: stationname, // 机房名称
|
StationName5: '', // 区/县
|
StationName2: '', // 市
|
StationName1: '', // 省
|
};
|
var json=window.JSON.stringify(binf);
|
$.post('BattInfAction!serchBatt','result='+json,function(data){
|
var model=eval("("+data.result+")");
|
//console.info(model);
|
if(model.code==1 && model.data.length>0){
|
var stationid=0;
|
for(var i=0;i<model.data.length;i++){
|
var batt=model.data[i];
|
//console.info(batt);
|
myRoom.push(batt.StationName);
|
myRoomVal.push(batt.StationId);
|
singleELeGroup.push(batt.StationName);
|
singleELeGroup.push(batt.BattGroupName);
|
singleEleVal.push(batt.StationId);
|
singleEleVal.push(batt.BattGroupId);
|
}
|
//console.info(singleELeGroup);
|
addRedLi(myRoom,myRoomVal,singleELeGroup,singleEleVal);
|
}
|
});
|
}else{
|
layer.msg('<s:text name="Please_select_a_set_of_Computer_room"/>!'); //请先选择一组机房
|
}
|
});
|
|
// 判断是否显示翻页按钮
|
function setPageTurning(isShowPre, isShowNext) {
|
if(isShowPre) { // 判断是否显示向上翻页按钮
|
$('.pre-page').show();
|
}else {
|
$('.pre-page').hide();
|
}
|
|
if(isShowNext) { // 判断是否显示向下翻页按钮
|
$('.next-page').show();
|
}else {
|
$('.next-page').hide();
|
}
|
}
|
|
$('document').ready(function(){
|
panel.show();
|
});
|
</script>
|
</html>
|
|
|