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

修复组织管理新建人员某些情况报错的问题

unknown 5 лет назад
Родитель
Сommit
cc7f7e4a2b
2 измененных файлов с 25 добавлено и 10 удалено
  1. 1 0
      o2web/source/x_component_Org/List.js
  2. 24 10
      o2web/source/x_component_Org/PersonExplorer.js

+ 1 - 0
o2web/source/x_component_Org/List.js

@@ -264,6 +264,7 @@ MWF.xApplication.Org.List.Item = new Class({
         input.focus();
         input.focus();
         input.addEvents({
         input.addEvents({
             "blur": function(){
             "blur": function(){
+                debugger;
                 var value = this.get("value");
                 var value = this.get("value");
                 if (value){
                 if (value){
                     if (typeOf(attr)==="object"){
                     if (typeOf(attr)==="object"){

+ 24 - 10
o2web/source/x_component_Org/PersonExplorer.js

@@ -157,13 +157,21 @@ MWF.xApplication.Org.PersonExplorer.PersonContent = new Class({
     },
     },
     _loadContent: function(){
     _loadContent: function(){
         this._listBaseInfor();
         this._listBaseInfor();
+        if( this.data.id ){
+            this._listAttribute();
+            this._listIdentity();
+            this._listRole();
+            this.loadListCount();
+        }
+
+        //
+        // this.showAttribute();
+    },
+    loadList : function(){
         this._listAttribute();
         this._listAttribute();
         this._listIdentity();
         this._listIdentity();
         this._listRole();
         this._listRole();
         this.loadListCount();
         this.loadListCount();
-
-        //
-        // this.showAttribute();
     },
     },
     loadListCount: function(){
     loadListCount: function(){
         if (this.data.woIdentityList){
         if (this.data.woIdentityList){
@@ -227,7 +235,7 @@ MWF.xApplication.Org.PersonExplorer.PersonContent = new Class({
             },
             },
             "attr": ["name", {
             "attr": ["name", {
                 "get": function(){return this.attributeList.join(",")},
                 "get": function(){return this.attributeList.join(",")},
-                "set": function(value){this.attributeList = value.split(/,\s*/g)}
+                "set": function(value){ this.attributeList = value.split(/,\s*/g)}
             }, "description"],
             }, "description"],
             "onPostSave": function(item, id){
             "onPostSave": function(item, id){
                 if (!item.data.id){
                 if (!item.data.id){
@@ -489,12 +497,14 @@ MWF.xApplication.Org.PersonExplorer.PersonContent = new Class({
             {"style": "width: 30px", "text": ""}
             {"style": "width: 30px", "text": ""}
         ]);
         ]);
 
 
-        o2.Actions.load("x_organization_assemble_control").RoleAction.listWithPerson(this.data.id, function (json) {
-            this.roleDataList = json.data;
-            json.data.each( function ( item ) {
-                this.roleList.push(item);
-            }.bind(this))
-        }.bind(this), null, false);
+        if( this.data.id ){
+            o2.Actions.load("x_organization_assemble_control").RoleAction.listWithPerson(this.data.id, function (json) {
+                this.roleDataList = json.data;
+                json.data.each( function ( item ) {
+                    this.roleList.push(item);
+                }.bind(this))
+            }.bind(this), null, false);
+        }
 
 
         // this.data.woPersonAttributeList.each(function(item){
         // this.data.woPersonAttributeList.each(function(item){
         //     this.roleList.push(item);
         //     this.roleList.push(item);
@@ -896,6 +906,7 @@ MWF.xApplication.Org.PersonExplorer.PersonContent.BaseInfor = new Class({
             }
             }
         }
         }
         this.explorer.actions.savePerson(data, function(json){
         this.explorer.actions.savePerson(data, function(json){
+            debugger;
             Object.merge(this.data, data);
             Object.merge(this.data, data);
             if (this.data.id){
             if (this.data.id){
                 this.data.id = json.data.id;
                 this.data.id = json.data.id;
@@ -906,6 +917,9 @@ MWF.xApplication.Org.PersonExplorer.PersonContent.BaseInfor = new Class({
                     this.data = Object.merge(this.data, json.data);
                     this.data = Object.merge(this.data, json.data);
                     this.item.data = this.data;
                     this.item.data = this.data;
                     this.item.refresh();
                     this.item.refresh();
+
+                    this.content.loadList();
+
                     if (callback) callback();
                     if (callback) callback();
                 }.bind(this), null, json.data.id);
                 }.bind(this), null, json.data.id);
             }
             }