| | |
| | | <div class="layui-page-container">
|
| | | <!-- 页面主题内容 -->
|
| | | <div class="layui-page-content" style="position: relative;">
|
| | | <div class="tbl-filter" lay-filter="tblFilter" style="position: absolute;z-index: 891;top: 8px; left: 15px">
|
| | | <div class="layui-form layui-form-pane" lay-filter="tblFilter">
|
| | | <button class="layui-btn layui-btn-sm layui-btn-green" id="exBattGroups">批量审批</button>
|
| | | <button class="layui-btn layui-btn-sm layui-bg-blue" id="acceptBattGroups">批量验收</button>
|
| | | <!-- <button class="layui-btn layui-btn-sm layui-btn-normal" id="reTbl">刷新表格</button> -->
|
| | | <div class="layui-tab layui-tab-card" lay-filter="tabsFilter">
|
| | | <ul class="layui-tab-title">
|
| | | <li class="layui-this">待审核<span class="layui-badge" id="applyNum">0</span></li>
|
| | | <li>待验收<span class="layui-badge" id="acceptNum">0</span></li>
|
| | | </ul>
|
| | | <div class="layui-tab-content">
|
| | | <div class="layui-tab-item layui-show">
|
| | | <!-- 表格内容 -->
|
| | | <table id="pageTbl" lay-filter="pageTbl"></table>
|
| | | </div>
|
| | | <div class="layui-tab-item">
|
| | | <!-- 表格内容 -->
|
| | | <table id="acceptTbl" lay-filter="acceptTbl"></table>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <!-- 表格内容 -->
|
| | | <table id="pageTbl" lay-filter="pageTbl"></table>
|
| | | </div>
|
| | | <div class="data-footer">
|
| | | <!-- 分页内容 -->
|
| | |
| | | </div>
|
| | | </div>
|
| | | <script type="text/html" id="battGrouptools">
|
| | | <a class="layui-btn layui-btn-xs" lay-event="adopt">通过</a>
|
| | | <a class="layui-btn layui-btn-xs" lay-event="adopt">审核</a>
|
| | | </script>
|
| | | <script type="text/html" id="acceptBattGroupTools">
|
| | | <a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="accept">验收</a>
|
| | | <a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="control">实时查询</a>
|
| | | </script>
|
| | | <script type="text/html" id="applyEn">
|
| | | {{# if(d.apply_en){ }}
|
| | | <a class="layui-btn layui-btn-xs">已通过</a>
|
| | | {{# }else{ }}
|
| | | <a class="layui-btn layui-btn-danger layui-btn-xs">待审核</a>
|
| | | {{# } }}
|
| | | </script>
|
| | | <script type="text/html" id="acceptEn">
|
| | | {{# if(d.check_en){ }}
|
| | | <a class="layui-btn layui-btn-xs">已验收</a>
|
| | | {{# }else{ }}
|
| | | <a class="layui-btn layui-btn-danger layui-btn-xs">待验收</a>
|
| | | {{# } }}
|
| | | </script>
|
| | | <script type="text/html" id="produceTime">
|
| | |
| | | <script type="text/javascript" src="pages/js/common.js"></script>
|
| | | <script type="text/javascript">
|
| | | layui.use(['form', 'table', 'layer', 'element'], function() {
|
| | | /* 页面导入layui模块 */
|
| | | var table = layui.table; // 获取表格模块
|
| | | var form = layui.form; // 获取表单模块
|
| | | var layer = layui.layer; // 获取弹出框模块
|
| | | var element = layui.element; // 获取元素操作模块
|
| | |
|
| | | /* 分页信息模块 */
|
| | | var Page = new TblPage(); // 实例化TblPage对象--验收的的审核信息
|
| | | Page.set(1, 0, 20); // 初始化值
|
| | | |
| | | var acceptPage = new TblPage(); // 实例化TblPage对象--待验收的分页信息
|
| | | acceptPage.set(1, 0, 20); // 初始化值
|
| | | |
| | | // 页面dom对象
|
| | | var pagePage = new PagePage({
|
| | | search: $('#paging .search') // 查询
|
| | | ,home: $('#page_home') // 首页
|
| | | ,pre: $('#page_pre')
|
| | | ,next: $('#page_next_p')
|
| | | ,last: $('#page_last')
|
| | | ,num: $('#page_num')
|
| | | ,go: $('#page_go')
|
| | | ,total: $('#total')
|
| | | ,size: $('#number')
|
| | | ,current: $('#current')
|
| | | });
|
| | | |
| | | pagePage.init(Page, search);
|
| | | |
| | | // 选项卡模块
|
| | | var tabsIndex = 0;
|
| | | element.on('tab(tabsFilter)', function(data){
|
| | | // console.log(this); //当前Tab标题所在的原始DOM元素
|
| | | // console.log(data.index); //得到当前Tab的所在下标
|
| | | // console.log(data.elem); //得到当前的Tab大容器
|
| | | tabsIndex = data.index; // 标识显示的选项卡内容
|
| | | if(tabsIndex) {
|
| | | pagePage.init(acceptPage, acceptSearch); // 待验收
|
| | | }else {
|
| | | pagePage.init(Page, search); // 待审核
|
| | | }
|
| | | $(window).resize();
|
| | | });
|
| | | |
| | | |
| | | // 表格模块
|
| | | var tOptions = {
|
| | | elem: '#pageTbl'
|
| | | ,toolbar: true
|
| | | ,toolbar: false
|
| | | ,defaultToolbar: []
|
| | | ,cellMinWidth: 80
|
| | | ,cols: [[
|
| | |
| | | ,{field:'useDate', title:'投入使用日期', templet: '#useTime', align:'center', width: 140}
|
| | | ,{field:'isInstall', title:'安装状态', templet: '#isInstall', align:'center', width: 140}
|
| | | ,{field:'install_user', title:'设备安装人员', align:'center', width: 260}
|
| | | ,{field:'apply_uid', title:'申请人', align:'center', width: 120}
|
| | | ,{field:'apply_name', title:'申请人', align:'center', width: 120}
|
| | | ,{field:'apply_en', title:'申请状态', align:'center', templet: '#applyEn',width: 120}
|
| | | ,{field:'apply_date', title:'申请日期', align:'center', width: 260}
|
| | | ,{fixed: 'right', title:'审批操作', align: 'center', toolbar: '#battGrouptools', width:160}
|
| | | ,{fixed: 'right', title:'审批操作', align: 'center', toolbar: '#battGrouptools', width:120}
|
| | | ]]
|
| | | ,data:[]
|
| | | ,limit: 10000
|
| | | ,page: false
|
| | | ,height: 'full-190'
|
| | | ,height: 'full-235'
|
| | | };
|
| | |
|
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | | |
| | | |
| | | // 待验收的表格 |
| | | var acceptOptions = {
|
| | | elem: '#acceptTbl'
|
| | | ,toolbar: false
|
| | | ,defaultToolbar: []
|
| | | ,cellMinWidth: 80
|
| | | ,cols: [[
|
| | | {type:'checkbox',fixed: 'left'}
|
| | | ,{field:'StationId', title:'机房编号', align:'center', width: 120}
|
| | | ,{field:'StationName1', title:'省', align:'center', width: 100}
|
| | | ,{field:'StationName2', title:'市', align:'center', width: 100}
|
| | | ,{field:'StationName5', title:'区县', align:'center', width: 100}
|
| | | ,{field:'StationName3', title:'机房名称', align:'center', width: 360}
|
| | | ,{field:'StationName4', title:'设备名称', align:'center', width: 150}
|
| | | ,{field:'StationIp', title:'机房ip', align:'center', width: 160}
|
| | | ,{field: 'FBSDeviceId', title: 'FBS设备ID(重要)', align: 'center', width: 160}
|
| | | ,{field:'FbsDeviceIp', title:'FBS设备IP(重要)', align:'center', width: 160}
|
| | | ,{field:'FbsDeviceIp_YM', title:'子网掩码', align:'center', width: 160}
|
| | | ,{field:'FbsDeviceIp_WG', title:'网关', align:'center', width: 160}
|
| | | ,{field:'FBSDeviceName', title:'FBS设备名称', align:'center', width: 160}
|
| | | ,{field:'GroupIndexInFBSDevice', title:'FBS设备索引', align:'center', width: 160}
|
| | | ,{field:'BattGroupId', title:'电池组ID', align:'center', width: 160}
|
| | | ,{field:'BattGroupNum', title:'机房内电池组编号', align:'center', width: 160}
|
| | | ,{field:'BattGroupName', title:'电池组名称', align:'center', width: 160}
|
| | | ,{field:'FloatVolLevel', title:'浮充电压阀值', align:'center', width: 160}
|
| | | ,{field:'OfflineVolLevel', title:'离线电压阀值', align:'center', width: 160}
|
| | | ,{field:'BattFloatCurrent', title:'浮充阀值', align:'center', width: 100}
|
| | | ,{field:'MonCount', title:'单体数量', align:'center', width: 100}
|
| | | ,{field:'MonCapStd', title:'标称容量', align:'center', width: 100}
|
| | | ,{field:'MonVolStd', title:'标称单体电压', align:'center', width: 140}
|
| | | ,{field:'MonResStd', title:'标称单体内阻', align:'center', width: 140}
|
| | | ,{field:'MonSerStd', title:'标称单体电导', align:'center', width: 140}
|
| | | ,{field:'MonVolLowToAvg', title:'单体电压次低偏移量', align:'center', width: 140}
|
| | | ,{field:'Load_curr', title:'负载电流', align:'center', width: 140}
|
| | | ,{field:'DisCurrMax', title:'最大核容电流', align:'center', width: 140}
|
| | | ,{field:'station_phone', title:'基站手机号码', align:'center', width: 140}
|
| | | ,{field:'BattProducer', title:'电池品牌', align:'center', width: 140}
|
| | | ,{field:'BattModel', title:'电池型号', align:'center', width: 260}
|
| | | ,{field:'productDate', title:'电池生产日期', templet: '#produceTime', align:'center', width: 140}
|
| | | ,{field:'useDate', title:'投入使用日期', templet: '#useTime', align:'center', width: 140}
|
| | | ,{field:'isInstall', title:'安装状态', templet: '#isInstall', align:'center', width: 140}
|
| | | ,{field:'install_user', title:'设备安装人员', align:'center', width: 260}
|
| | | ,{field:'check_en', title:'验收状态', templet: '#acceptEn',align:'center', width: 120}
|
| | | ,{field:'apply_name', title:'申请人', align:'center', width: 120}
|
| | | ,{field:'apply_date', title:'申请日期', align:'center', width: 260}
|
| | | ,{field:'confirm_name', title:'审核人', align:'center', width: 120}
|
| | | ,{fixed: 'right', title:'验收操作', align: 'center', toolbar: '#acceptBattGroupTools', width:180}
|
| | | ]]
|
| | | ,data:[]
|
| | | ,limit: 10000
|
| | | ,page: false
|
| | | ,height: 'full-235'
|
| | | };
|
| | | |
| | | // 生成表格数据
|
| | | table.render(acceptOptions);
|
| | | |
| | |
|
| | | // 审批操作栏
|
| | | table.on('tool(pageTbl)', function(obj) {
|
| | |
| | | layer.msg('功能开发中...');
|
| | | break;
|
| | | };
|
| | | });
|
| | | |
| | | // 验收操作栏
|
| | | table.on('tool(acceptTbl)', function(obj) {
|
| | | switch(obj.event) {
|
| | | case 'accept':
|
| | | acceptBattGroup(obj.data);
|
| | | break;
|
| | | case 'control':
|
| | | controlPage(obj.data);
|
| | | break;
|
| | | default:
|
| | | layer.msg('功能开发中...');
|
| | | break;
|
| | | }
|
| | | });
|
| | |
|
| | |
|
| | |
| | | // console.log(rs);
|
| | | if(rs.code == 1) {
|
| | | layer.msg('确认审核成功!');
|
| | | // 查询后台数据
|
| | | search(createSearchParam(), true);
|
| | | // 查询待审核后台数据
|
| | | search();
|
| | | |
| | | // 查询待验收后台数据
|
| | | acceptSearch();
|
| | | }else {
|
| | | layer.msg('确认审核失败!');
|
| | | }
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | // 实例化TblPage对象
|
| | | var Page = new TblPage();
|
| | | Page.set(1, 0, 20);
|
| | | |
| | | // 通过验收
|
| | | function acceptBattGroup(data) {
|
| | | // 构造验收通过的机房的信息
|
| | | var temp = [createAcceptParam(data)];
|
| | | // 是否却确认验收
|
| | | layer.confirm('是否确认验收', {icon: 3, title: '提示'}, function(index) {
|
| | | layer.close(index);
|
| | | // 向后台申请验收通过
|
| | | acceptBattGroupAjax(temp);
|
| | | });
|
| | | }
|
| | | |
| | | // 构造向后台请求的验收的数据
|
| | | function createAcceptParam(data) {
|
| | | // 遍历data对象并返回指定格式的对象
|
| | | var temp = {};
|
| | | temp.binf = {};
|
| | | Object.keys(data).forEach(function(key) {
|
| | | if(key == 'num') {
|
| | | temp.num = data[key];
|
| | | }else {
|
| | | temp.binf[key] = data[key];
|
| | | }
|
| | | });
|
| | | |
| | | return temp;
|
| | | }
|
| | | |
| | | // 向后台申请通过验收
|
| | | function acceptBattGroupAjax(data) {
|
| | | var load = layer.load(1); // 添加等待框
|
| | | // 请求后台
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | | ,url: "Battinf_applyAction!check"
|
| | | ,data: "json="+JSON.stringify(data)
|
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | // console.log(rs);
|
| | | if(rs.code == 1) {
|
| | | layer.msg('确认验收成功!');
|
| | | |
| | | // 查询待验收后台数据
|
| | | acceptSearch();
|
| | | }else {
|
| | | layer.msg('确认验收失败!');
|
| | | }
|
| | | |
| | | }
|
| | | ,complete: function() {
|
| | | layer.close(load);
|
| | | }
|
| | | });
|
| | | |
| | | }
|
| | | |
| | | |
| | | // 跳转到实时页面
|
| | | function controlPage(data) {
|
| | | console.log(data);
|
| | | var home = data.StationName;
|
| | | var province = data.StationName1;
|
| | | var city = data.StationName2;
|
| | | var county = data.StationName5;
|
| | | var url = skipUrl('control.jsp',province,city,county,home);
|
| | | window.open(url);
|
| | | }
|
| | | |
| | | // 查询后台数据
|
| | | search(createSearchParam(), true);
|
| | | function search(temp, newLoad) {
|
| | | var load;
|
| | | if(newLoad) {
|
| | | load = layer.load(1);
|
| | | }
|
| | | search();
|
| | | function search() {
|
| | | var load = layer.load(1);
|
| | | var temp = createSearchParam();
|
| | | // 查询后台
|
| | | $.ajax({
|
| | | type: 'post'
|
| | |
| | | var resData = [];
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | console.log(data);
|
| | | //console.log(data);
|
| | | // 遍历数据的值
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | |
| | | Page.setAll(_data.apply_note);
|
| | | }
|
| | | }
|
| | | // console.log(resData);
|
| | | setPageVal(Page);
|
| | | tOptions.data = resData;
|
| | | pagePage.setVal(); // 设置分页信息
|
| | | $('#applyNum').text(Page.all); // 设置徽章
|
| | | tOptions.data = resData; // 设置表格的数据
|
| | |
|
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | |
| | | return temp;
|
| | | }
|
| | |
|
| | | // 查询待验收的机房
|
| | | acceptSearch();
|
| | | function acceptSearch(temp, newLoad) {
|
| | | var load = layer.load(1);
|
| | | var temp = acceptSearchParam();
|
| | | //console.log(temp);
|
| | | // 查询后台
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | | ,url: "Battinf_applyAction!serchByCondition"
|
| | | ,data: "json="+JSON.stringify(temp)
|
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | //console.log(res);
|
| | | var rs = JSON.parse(res.result);
|
| | | var resData = [];
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | // console.log(data);
|
| | | // 遍历数据的值
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _tmp = formaterResData(_data);
|
| | | resData.push(_tmp);
|
| | | acceptPage.setAll(_data.apply_note);
|
| | | }
|
| | | }
|
| | | pagePage.setVal(); // 设置分页信息
|
| | | $('#acceptNum').text(acceptPage.all); // 设置徽章
|
| | | acceptOptions.data = resData; // 设置表格的数据
|
| | | |
| | | // 生成表格数据
|
| | | table.render(acceptOptions);
|
| | | |
| | | }
|
| | | ,complete: function() {
|
| | | layer.close(load);
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 构造验收的查询条件
|
| | | function acceptSearchParam() {
|
| | | var temp = {
|
| | | apply_en: 1
|
| | | ,binf: {
|
| | | page: acceptPage.getPage()
|
| | | }
|
| | | };
|
| | | return temp;
|
| | | }
|
| | | |
| | | // 构造结果集
|
| | | function formaterResData(data) {
|
| | | // 遍历结果集
|
| | |
| | | });
|
| | |
|
| | | return temp;
|
| | | }
|
| | | |
| | | //点击查询按钮
|
| | | $('#paging .search').click(function(){
|
| | | search(createSearchParam(), false);
|
| | | });
|
| | | |
| | | //首页
|
| | | $('#page_home').click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.curr != 1){
|
| | | Page.setCurr(1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | } |
| | | });
|
| | | |
| | | //点击上一页
|
| | | $("#page_pre").click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.curr > 1){
|
| | | Page.setCurr(Page.curr-1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //点击下一页
|
| | | $("#page_next_p").click(function(){ |
| | | if(Page != undefined){
|
| | | if(Page.num > Page.curr){
|
| | | Page.setCurr(Page.curr+1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //尾页
|
| | | $('#page_last').click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.curr < Page.num){
|
| | | Page.setCurr(Page.num);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //设置每页行数
|
| | | $('#number').blur(function(){
|
| | | var value=$('#number').val();
|
| | | //当输入的数大于0时
|
| | | if(value>0){
|
| | | if(value != Page.size){
|
| | | Page.setSize(parseInt(value));
|
| | | Page.setCurr(1);
|
| | | }
|
| | | }else{
|
| | | //当输入非法数字时
|
| | | alert("请输入合法的数字"); /* 请输入合法的整数 */
|
| | | $('#number').val(Page.size); |
| | | }
|
| | | });
|
| | | |
| | | //点击跳转
|
| | | $('#page_go').click(function(){
|
| | | var tarpage=$('#page_num').attr('value');
|
| | | if(tarpage > Page.num){
|
| | | Page.setCurr(Page.num);
|
| | | search(createSearchParam(), true);
|
| | | }else if(tarpage > 0 && tarpage!= Page.curr){
|
| | | Page.setCurr(parseInt(tarpage));
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | |
| | | });
|
| | | |
| | | // 设置页面Page
|
| | | function setPageVal(page) {
|
| | | $('#current').text(page.curr+'/'+page.num);
|
| | | $('#total').text(page.all);
|
| | | $('#number').val(page.size);
|
| | | }
|
| | | });
|
| | | </script>
|