zhangweicheng il y a 5 ans
Parent
commit
81c31f112f
1 fichiers modifiés avec 16 ajouts et 10 suppressions
  1. 16 10
      public/web/gljUtil.js

+ 16 - 10
public/web/gljUtil.js

@@ -2,6 +2,7 @@
  * Created by zhang on 2018/6/7.
  */
 
+
 let gljUtil = {
     calcProjectGLJQuantity:function (projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal,_,scMathUtil,isReport) {
         let project_gljs = projectGLJDatas.gljList, mixRatioMap = projectGLJDatas.mixRatioMap, com_electrovalence = projectGLJDatas.com_electrovalence;
@@ -279,7 +280,8 @@ let gljUtil = {
         }
     },
     getFlag:function (b) {
-        return this._.find(b.flags,{"fieldName":"fixed"});
+      let lo_sh = typeof _ !== 'undefined'?_:this._;
+      return lo_sh.find(b.flags,{"fieldName":"fixed"});
     },
     getGLJPrice:function (glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil,ext,tenderCoe, isReport) {
         let result = {};
@@ -430,14 +432,16 @@ let gljUtil = {
         return parseInt(str.substr(0,1));
     },
     sortRationGLJ:function (list, std) {
-        const field = std ? 'gljType' : 'type';
-        list = _.sortByAll(list, [function (item) {
-            return gljUtil.getMainType(item[field]);
-        }, gljUtil.getCodeSortMath()]);
-        return list;
+      const field = std ? 'gljType' : 'type';
+      let lo_sh = typeof _ !== 'undefined'?_:this._;
+      list = lo_sh.sortByAll(list, [function (item) {
+          return gljUtil.getMainType(item[field]);
+      }, gljUtil.getCodeSortMath()]);
+      return list;
     },
     sortMixRatio:function (list) {
-        return _.sortByAll(list, ["code"]);
+      let lo_sh = typeof _ !== 'undefined'?_:this._;
+      return lo_sh.sortByAll(list, ["code"]);
     },
     //项目工料机 混凝土、砂浆、配合比排序与定额工料机不一样,同时,type取值的地方不一样
     sortProjectGLJ:function (list,lodash) {
@@ -491,9 +495,10 @@ let gljUtil = {
         return {glj_id:-99,unit_price_file_id:unitFileID,connect_key:connect_key,consumption:consumption,code:'80CCS',name:'车船税',unit:'元',type:302,specs:'',from:"cpt"}
     },
     updateProperty: function (obj, doc) {
-        _.forEach(doc, function (n, key) {
+      let lo_sh = typeof _ !== 'undefined'?_:this._;
+      lo_sh.forEach(doc, function (n, key) {
             obj[key] = n;
-        });
+      });
     },
     getTotalQuantity:function(glj,ration,rd,gd){
         if(ration){
@@ -567,8 +572,9 @@ let gljUtil = {
         }
     },
     setProperty:function(Obj,updateData) {
+      let lo_sh = typeof _ !== 'undefined'?_:this._;
         for(let ukey in updateData){
-            if(_.isObject(updateData[ukey]) && _.isObject(Obj[ukey])&&!_.isArray(updateData[ukey])){
+            if(lo_sh.isObject(updateData[ukey]) && lo_sh.isObject(Obj[ukey])&&!lo_sh.isArray(updateData[ukey])){
                 setProperty(Obj[ukey],updateData[ukey]);
             }else {
                 Obj[ukey] = updateData[ukey];