Browse Source

选人出现两次的问题处理

Pojun 5 months ago
parent
commit
e84d89cf6c

+ 11 - 5
tip-front/src/main/webapp/tc_tap/choosePerson/js/choosePersonConfig.js

@@ -135,6 +135,8 @@
 				cid:0,
 				pid:0
 			},
+			// 增加个时间, 作为多次点击的判断, 短期内重复点击不生效
+			delayDate: new Date().getTime(),
 			/**
 			 * 选人界面的普通调用
 			 * @param chooseId 界面唯一标识(通过本标识获取配置信息与数据中心)
@@ -144,6 +146,11 @@
 			 * @param closedCall 关闭选人组件时回调
 			 */
 			choosePerson:function(chooseId,config,dataCenter,callBack, closedCall){
+				var currentTime = new Date().getTime();
+				if(currentTime - this.delayDate < 1000){
+					return;
+				}
+				this.delayDate = currentTime;
 
 				/*   分保 秘密等级参数传递 zcl  2020/8/3 start*/
 				var classification=$("#classification");
@@ -152,7 +159,6 @@
 					classificationId=classification.val();
 				}
 
-
 				/*   分保 秘密等级参数传递 zcl  2020/8/3 end*/
 
 				config = this.defaultChoosePersonConfig(config);
@@ -327,7 +333,7 @@
 						}
 					}
 				}
-				
+
 				return defaultChoosePersonConfig;
 			},
 			/**
@@ -401,7 +407,7 @@
 							return result;
 						},
 						putItems:function(result){
-							
+
 							if(result){
                                 //修改一下,需要使用result.result 才能出来真实的对象 modify by huzy 2017/10/12 下午6:54
 								var datas = result.result;
@@ -487,7 +493,7 @@
 					if(window.__windowChoosePersonConfig) {
 						return window.__windowChoosePersonConfig;
 					}
-					
+
 					return TC.data.select("windowChoosePersonConfig");
 				}else{
 					TC.data.insert("windowChoosePersonConfig" , config);
@@ -560,4 +566,4 @@
 	};
 	// 选人组件加载到TC框架之中
 	//TC.module("TC.ui.ChooseOrg",ChooseOrg);
-})(jQuery,TC);
+})(jQuery,TC);