D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore
2019-01-18 2fe250ece8de95b3f70172fe5b45793ab6a3084a
gx_tieta/WebRoot/pages/js/mylayui.js
@@ -607,3 +607,68 @@
        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;
}