fanxw 2 jaren geleden
bovenliggende
commit
c33c961815

+ 41 - 47
src/main/resources/static/app/business/customer/controller/customerSaveCtrl.js

@@ -76,10 +76,48 @@ angular.module('app.business').controller("customerSaveCtrl", function($scope, $
76 76
         return this.optional(element)||(checkNumber.test(value));  
77 77
     },"请输入正确的数字类型,最多两位小数!");
78 78
     
79
+    $scope.checkRepeat = function () {
80
+    	var khlx = $scope.customer.classify;
81
+        var zjh;
82
+        var checkNumber;
83
+        var flag = false;
84
+        if (null != khlx && khlx == "3152") {
85
+        	//个人客户的身份证号
86
+        	zjh = $scope.customer.identification;
87
+        	checkNumber = /(^\d{18}$)|(^\d{17}(\d|X)$)/g;
88
+        	flag = checkNumber.test(zjh);
89
+        }else if (null != khlx && khlx == "3153") {
90
+        	//企业客户的统一信用代码
91
+        	zjh = $scope.customer.socialCreditCode;
92
+        	checkNumber = /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/g; 
93
+        	flag = checkNumber.test(zjh);
94
+        } else {
95
+        	alert("请先选择客户类型!");
96
+        	return false;
97
+        }
98
+    	if (flag) {
99
+    		var param = {
100
+    	    		orgId : $rootScope.orgInfo.orgId, 
101
+    	    		zjh : zjh,
102
+    				customerId : $scope.customer.id,
103
+    				customerType : khlx
104
+    	        };
105
+    		$.get(APP_CONFIG.keeperHouseUrl + '/depot/business/customer/checkRepeat', param, function(data){
106
+            	if (data == "false") {
107
+            		alert("请输入正确的身份证号码,且不能重复!");
108
+            		return false;
109
+            	}
110
+            });
111
+    	} else {
112
+    		alert("请输入正确的身份证号码,且不能重复!");
113
+    		return false;
114
+    	}
115
+    }
116
+    
79 117
     $.validator.addMethod("validLength",function(value,element, params) {
80 118
     	var checkNumber = /(^\d{18}$)|(^\d{17}(\d|X)$)/g;
81
-    	return this.optional(element)||(checkNumber.test(value));  
82
-    },"请输入正确的身份证号码!");
119
+    	return this.optional(element)||(checkNumber.test(value));
120
+    },"请输入正确的身份证号码,且不能重复!");
83 121
     
84 122
     $.validator.addMethod("qyLength",function(value,element, params) {
85 123
     	//var checkNumber = /^\w{18}$/g; 
@@ -113,51 +151,7 @@ angular.module('app.business').controller("customerSaveCtrl", function($scope, $
113 151
     	var checkNumber = /^[0-9]{1,30}$/g;
114 152
     	return this.optional(element)||(checkNumber.test(value));
115 153
     },"请输入正确的开户账号!");
116
-    
117
-    // 自定义验证,验证用身份证或统一信用代码是否重复
118
-    $.validator.addMethod("zjh", function(value, element) {
119
-        var result = false;
120
-        // 设置同步
121
-        $.ajaxSetup({
122
-            async: false
123
-        });
124
-        
125
-        var khlx = $scope.customer.classify;
126
-        var zjh;
127
-        if (null != khlx && khlx == "3152") {
128
-        	//个人客户的身份证号
129
-        	zjh = $scope.customer.identification;
130
-        }else if (null != khlx && khlx == "3153") {
131
-        	//企业客户的统一信用代码
132
-        	zjh = $scope.customer.socialCreditCode;
133
-        } else {
134
-        	alert("请先选择客户类型!");
135
-        	return result;
136
-        }
137
-        
138
-        var param = {
139
-    		orgId : $rootScope.orgInfo.orgId, 
140
-    		zjh : zjh,
141
-			customerId : $scope.customer.id,
142
-			customerType : khlx
143
-        };
144
-        $.get(APP_CONFIG.keeperHouseUrl + '/depot/business/customer/checkRepeat', param, function(data){
145
-        	if (data == "true") {
146
-        		result = true;
147
-        	}
148
-        });
149
-        // 恢复异步
150
-        $.ajaxSetup({
151
-            async: true
152
-        });
153
-        return result;
154
-    }, "身份证号或统一信用代码重复,请重新输入");
155
-    
156
-    
157
-    // 返回.
158
-   /* $scope.retList = function () {
159
-    	$state.go('app.business.customer.list');
160
-    }*/
154
+
161 155
     // 返回.
162 156
     $scope.retList = function () {
163 157
         if ($rootScope.previousState_name != '') {

+ 2 - 2
src/main/resources/static/app/business/customer/views/customer-edit.html

@@ -69,7 +69,7 @@
69 69
                                             <label class="label">身份证号<span style="color: red;">*</span></label> 
70 70
                                             <label class="input"> 
71 71
                                                 <input class="form-control" type="text" ng-model="customer.identification" ng-readonly="isNotEdit" name="identification"
72
-                                                validLength=true zjh=true required>
72
+                                                ng-blur="checkRepeat()" required>
73 73
                                             </label>
74 74
                                         </section>
75 75
                                         <section class="col col-4">
@@ -266,7 +266,7 @@
266 266
                                             <label class="label">统一社会信用代码<span style="color: red;">*</span></label>
267 267
                                             <label class="input">
268 268
                                                 <input class="form-control" type="text" ng-model="customer.socialCreditCode" ng-readonly="isNotEdit" name="socialCreditCode"
269
-                                                qyLength=true required maxlength="18">
269
+                                                ng-blur="checkRepeat()" required maxlength="18">
270 270
                                             </label>
271 271
                                         </section>
272 272
                                         <section class="col col-4">

+ 2 - 2
src/main/resources/static/app/storage/grainCard/views/foodSituationList.html

@@ -82,8 +82,8 @@
82 82
 									  <tbody>
83 83
 										<tr ng-repeat="gainCard in pageInfo.list">
84 84
 											<td class="text-center">{{ $index+1 }}</td>
85
-											<td class="text-center">{{ gainCard.storehouseName }}</td>
86
-											<td class="text-center">{{ gainCard.warehouseName }}</td>
85
+											<td class="text-center">{{ storehouseObj[gainCard.storehouseId].storehouseName }}</td>
86
+											<td class="text-center">{{ warehouseObj[gainCard.warehouseId].warehouseName }}</td>
87 87
 											<td class="text-center">{{ gainCard.grainVarietyName }}</td>
88 88
 <!--											<td class="text-center">{{ gainCard.rksl | number : 3}}</td>-->
89 89
 											<td class="text-center">{{ gainCard.acceptDate | date:'yyyy-MM-dd'}}</td>

+ 9 - 4
src/main/resources/static/app/system/views/user-edit.html

@@ -151,7 +151,7 @@
151 151
 											<label class="label">固定电话</label> 
152 152
 											<label class="input">
153 153
 												<i class="icon-prepend fa fa-phone"></i>
154
-												<input type="tel" ng-model="user.telphone" maxlength="30" validZjh=true />
154
+												<input type="tel" ng-model="user.telphone" name="telphone" maxlength="30" validZjh=true />
155 155
 											</label>
156 156
 										</section>
157 157
 										<section class="col col-4">
@@ -185,14 +185,14 @@
185 185
 											<label class="label">QQ号码</label> 
186 186
 											<label class="input"> 
187 187
 												<i class="icon-prepend fa fa-qq"></i> 
188
-												<input type="text" ng-model="user.qqNumber" minlength="4" maxlength="12">
188
+												<input type="text" ng-model="user.qqNumber" name="qqNumber" minlength="4" maxlength="12">
189 189
 											</label>
190 190
 										</section>
191 191
 										<section class="col col-4">
192 192
 											<label class="label">地址</label> 
193 193
 											<label class="input"> 
194 194
 												<i class="icon-prepend fa fa-map-marker"></i> 
195
-												<input type="text" ng-model="user.address" maxlength="30" />
195
+												<input type="text" ng-model="user.address" name="address" maxlength="100" />
196 196
 											</label>
197 197
 										</section>
198 198
 										<section class="col col-4">
@@ -303,7 +303,12 @@
303 303
 												<input type="text" ng-model="user.qdzgzchzyzgsj" name="qdzgzchzyzgsj" class="form-control" onClick="WdatePicker({lang:'zh-cn'})" />
304 304
 											</label>
305 305
 										</section>
306
-										<section class="col col-4"></section>
306
+										<section class="col col-4">
307
+											<label class="label">专业</label>
308
+											<label class="input">
309
+												<input type="text" ng-model="user.zy" name="zy" maxlength="30" />
310
+											</label>
311
+										</section>
307 312
 									</div>
308 313
 								</fieldset>
309 314