| | |
| | | return isGood;
|
| | | }
|
| | | };
|
| | |
|
| | | // 统计数据选中个数/总个数
|
| | | var QuantNumber = function(ele) {
|
| | | this.ele = ele;
|
| | | this.mol = 0;
|
| | | this.den = 0;
|
| | | this._init();
|
| | | }
|
| | | // 设置原型方法
|
| | | QuantNumber.prototype = {
|
| | | _init: function() {
|
| | | this._setEleTxt();
|
| | | }
|
| | | ,set: function(mol, den) {
|
| | | this.mol = mol;
|
| | | this.den = den;
|
| | | this._setEleTxt();
|
| | | }
|
| | | ,setMol: function(val) {
|
| | | this.mol = val;
|
| | | this._setEleTxt();
|
| | | }
|
| | | ,setDen: function(val) {
|
| | | this.den = val;
|
| | | this._setEleTxt();
|
| | | }
|
| | | ,_setEleTxt: function() {
|
| | | var str = this.mol+'/'+this.den;
|
| | | this.ele.text(str)
|
| | | }
|
| | | };
|
| | |
|
| | |
|
| | | //获取电池品牌列表
|
| | | function getBattProducers() {
|
| | | let producers = [];
|
| | | // 请求后台查询电池品牌
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: false
|
| | | ,url: 'BattInfAction!serchByBattProducer'
|
| | | ,data: null
|
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | let rs = JSON.parse(res.result);
|
| | | // 判断查询结果
|
| | | if(rs.code == 1) {
|
| | | let data = rs.data;
|
| | | // 遍历查询结果
|
| | | for(let i=0; i<data.length; i++) {
|
| | | let _data = data[i];
|
| | | if(_data.BattProducer) { // 处理为空的品牌
|
| | | producers.push(_data.BattProducer);
|
| | | }
|
| | | }
|
| | | producers.push('其他');
|
| | | }
|
| | | }
|
| | | ,complete: function() {
|
| | | |
| | | }
|
| | | });
|
| | | |
| | | return producers;
|
| | | } |