Просмотр исходного кода

Merge branch 'fix/Selector.selectUnitDutyCategoryByUnit_Execption' into 'wrdp'

Merge of fix/Selector.selectUnitDutyCategoryByUnit_Execption 修复手机端选人按职务选人可能首个分类出现重复人员的问题 to wrdp

See merge request o2oa/o2oa!1893
蔡祥熠 5 лет назад
Родитель
Сommit
5e36a65927
1 измененных файлов с 16 добавлено и 13 удалено
  1. 16 13
      o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js

+ 16 - 13
o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js

@@ -496,20 +496,23 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
     },
     },
     _loadSub: function(callback){
     _loadSub: function(callback){
         if (!this.loaded){
         if (!this.loaded){
-            if( this.data.identityList && this.data.identityList.length>0 ){
-                this.data.identityList.sort( function(a, b){
-                    //this.selector.getUnitOrderNumber( a.unitLevelName )
-                    return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
-                });
-                this.data.identityList.each( function( identity ){
-                    // if( !this.selector.isExcluded( identity ) ) {
-                    //     if( !this.isExisted( identity ) ){
-                            var item = this.selector._newItem(identity, this.selector, this.children, this.level + 1, this);
-                            this.selector.items.push(item);
-                            if(this.subItems)this.subItems.push( item );
+            if( !this.itemLoaded ){
+                if( this.data.identityList && this.data.identityList.length>0 ){
+                    this.data.identityList.sort( function(a, b){
+                        //this.selector.getUnitOrderNumber( a.unitLevelName )
+                        return (a.orderNumber || 9999999) - (b.orderNumber || 9999999);
+                    });
+                    this.data.identityList.each( function( identity ){
+                        // if( !this.selector.isExcluded( identity ) ) {
+                        //     if( !this.isExisted( identity ) ){
+                                var item = this.selector._newItem(identity, this.selector, this.children, this.level + 1, this);
+                                this.selector.items.push(item);
+                                if(this.subItems)this.subItems.push( item );
+                            // }
                         // }
                         // }
-                    // }
-                }.bind(this))
+                    }.bind(this))
+                }
+                this.itemLoaded = true;
             }
             }
 
 
             if( this.data.unitList && this.data.unitList.length ){
             if( this.data.unitList && this.data.unitList.length ){