Browse Source

Merge remote-tracking branch 'origin/dev' into dev

hulh 8 years ago
parent
commit
e025312295

+ 212 - 1
src/main/webapp/resources/js/prod/controllers/OrderEnsureCtrl.js

@@ -1147,7 +1147,7 @@ define([ 'app/app' ], function(app) {
 	app.register.controller('BillInputCtrl', ['$scope', '$http', 'BaseService', 'Bill', 'toaster', '$stateParams', '$state', 'invoiceInfo', '$upload', '$modalInstance', function($scope, $http, BaseService, Bill, toaster, $stateParams, $state, invoiceInfo, $upload, $modalInstance) {
 		//BaseService.scrollBackToTop();
 		
-		$scope.bill = {};
+		/*$scope.bill = {};
 		$scope.bill.address = {};
 		$scope.bill.is_agree = true;
 		$scope.bill.kind = 1206;
@@ -1234,6 +1234,217 @@ define([ 'app/app' ], function(app) {
 		
 		$scope.exit = function() {
 			$modalInstance.dismiss();
+		}*/
+
+		$scope.bill = {};
+		$scope.invoiceType = Number(invoiceInfo.split("-")[0]);
+		if(invoiceInfo.split("-").length == 2) {
+			$scope.invoiceId = Number(invoiceInfo.split("-")[1]);
+		}
+		$scope.isSpecial = true; //专票,等于true为不存在
+		$scope.isNormal = true; //普票,等于true为不存在
+		// 获取发票信息方法	1205为增值税专用发票	1206为增值税普通发票	1207为不开发票
+
+		$scope.setType = function() {
+			switch($scope.invoiceType) {
+				case 1206:
+					$scope.bill.kind = 1206;
+					$scope.isNormal = true;
+					$scope.isSpecial = false; break;
+				case 1205:
+					$scope.bill.kind = 1205;
+					$scope.isNormal = false;
+					$scope.isSpecial = true; break;
+				default:
+					$scope.isNormal = true;
+					$scope.isSpecial = true;
+			}
+		};
+
+		$scope.setType();
+
+		$scope.getData = function() {
+			if($scope.invoiceId) {
+				Bill.getBillById({id: $scope.invoiceId}, function(data) {
+					$scope.bill = data;
+					if($scope.bill.kind == 1205) {
+						$scope.isNormal = false;
+					}else {
+						$scope.isSpecial = false;
+					}
+					$http.get('static/js/prod/data/city.json').success(function(data) {
+						$scope.division = data;
+						if($scope.bill.area){
+							$scope.bill.address = {};
+							//拼装下拉选择框
+							var arr = $scope.bill.area.split(',');
+							$scope.bill.address.province = arr[0];
+							$scope.bill.address.city = arr[1];
+							$scope.bill.address.district = arr[2];
+						}
+					}).error(function(e) {
+						toaster.pop('error', '系统错误 ' + '加载城市信息失败, 请重新加载界面!');
+					});
+					$scope.bill.is_agree = true;
+				}, function(response) {
+					toaster.pop('error', '获取指定的发票信息失败');
+				});
+			}else {
+				$http.get('static/js/prod/data/city.json').success(function(data) {
+					$scope.division = data;
+				}).error(function(e) {
+					toaster.pop('error', '系统错误 ' + '加载城市信息失败');
+				});
+			}
+		};
+		$scope.getData();
+
+		$scope.bill.address = {};
+
+		//保存发票信息
+		$scope.saveBill = function(flag) {
+			var dataValidFlag = $scope.checkValidFrom();
+			if (!flag && dataValidFlag && $scope.bill.is_agree) {
+				if (!$scope.isAdd) { //修改
+					doSave('修改发票信息');
+				} else { // 新增
+					doSave('添加发票');
+				}
+			} else if (flag || !dataValidFlag) {
+				toaster.pop('error', '请填写正确的发票信息');
+			} else {
+				toaster.pop('error', '请勾选并阅读《发票须知》');
+			}
+		};
+		var doSave = function (message) {
+			$scope.bill.area = $scope.bill.address.province + "," + $scope.bill.address.city + "," + $scope.bill.address.district;
+			var file = null;
+			if($scope.bill.billInfo&&$scope.bill.billInfo[0]) {
+				file = $scope.bill.billInfo[0];
+			}
+			$upload.upload({
+				url: 'trade/bill/save',
+				file: file,
+				method: 'POST',
+				data: {
+					bill: $scope.bill
+				}
+			}).success(function(data){
+				toaster.pop('success', message + '成功');
+				$modalInstance.close(data);
+			}).error(function(data){
+				toaster.pop('error', message + '失败');
+			});
+		}
+
+		$scope.isDoUpload = false;
+		//上传发票许可证
+		$scope.onUploadPermission = function () {
+			$scope.isDoUpload = true;
+			if (event.target.files[0].size < 3*1024*1024) {
+				$scope.bill.attachUrl = event.target.files[0].name;
+			} else {
+				$scope.bill.attachUrl = '';
+			}
+		}
+
+		//判断中文字符串的长度
+		var getRealStringLen = function (str) {
+			var realLength = 0, len = str.length, charCode = -1;
+			for (var i = 0; i < len; i++) {
+				charCode = str.charCodeAt(i);
+				if (charCode >= 0 && charCode <= 128) realLength += 1;
+				else realLength += 2;
+			}
+			return realLength;
+		}
+
+		$scope.validForm = {
+			validBillHead: true,
+			validBillName: true,
+			validBankName: true,
+			validDetailAddress: true,
+			validCompanyAddress: true
+		}
+
+		$scope.initFormFlag = function () {
+			$scope.initFlag = {
+				initBillHead: true,
+				initBillName: true,
+				initBankName: true,
+				initDetailAddress: true,
+				initCompanyAddress: true,
+				initCompanyPhone: true,
+				initCompanyTaxNum: true,
+				initBankAccount: true,
+				initTelephone: true
+			}
+		}
+
+		$scope.initFormFlag();
+
+		$scope.checkValidFrom = function () {
+			var flag = true
+			angular.forEach($scope.validForm, function (item) {
+				if (!item) {
+					flag = false;
+				}
+			})
+			return flag;
+		}
+		$scope.checkValidFrom();
+		//发票抬头check
+		$scope.checkBillHead = function () {
+			var len = getRealStringLen($scope.bill.head);
+			if (len > 100) {
+				$scope.validForm.validBillHead = false;
+			} else {
+				$scope.validForm.validBillHead = true;
+			}
+		}
+
+		//收票人check
+		$scope.checkBillName = function () {
+			var len = getRealStringLen($scope.bill.name);
+			if (len > 20) {
+				$scope.validForm.validBillName = false;
+			} else {
+				$scope.validForm.validBillName = true;
+			}
+		}
+
+		//开户银行Check
+		$scope.checkBankName = function () {
+			var len = getRealStringLen($scope.bill.bankName);
+			if (len > 60) {
+				$scope.validForm.validBankName = false;
+			} else {
+				$scope.validForm.validBankName = true;
+			}
+		}
+
+		//详细地址Check
+		$scope.checkDetailAddress = function () {
+			var len = getRealStringLen($scope.bill.detailAddress);
+			if (len > 60) {
+				$scope.validForm.validDetailAddress = false;
+			} else {
+				$scope.validForm.validDetailAddress = true;
+			}
+		}
+
+		//单位地址check
+		$scope.checkCompanyAddress = function () {
+			var len = getRealStringLen($scope.bill.companyAddress);
+			if (len > 100) {
+				$scope.validForm.validCompanyAddress = false;
+			} else {
+				$scope.validForm.validCompanyAddress = true;
+			}
+		}
+
+		$scope.exitEdit = function () {
+			$modalInstance.dismiss();
 		}
 		
 	}]);

+ 212 - 1
src/main/webapp/resources/js/prod/controllers/OrderEnsureCtrlWithMultiCurrency.js

@@ -1057,7 +1057,7 @@ define([ 'app/app' ], function(app) {
 	app.register.controller('BillInputCtrl', ['$scope', '$http', 'BaseService', 'Bill', 'toaster', '$stateParams', '$state', 'invoiceInfo', '$upload', '$modalInstance', function($scope, $http, BaseService, Bill, toaster, $stateParams, $state, invoiceInfo, $upload, $modalInstance) {
 		//BaseService.scrollBackToTop();
 		
-		$scope.bill = {};
+		/*$scope.bill = {};
 		$scope.bill.address = {};
 		$scope.bill.is_agree = true;
 		$scope.bill.kind = 1206;
@@ -1144,6 +1144,217 @@ define([ 'app/app' ], function(app) {
 		
 		$scope.exit = function() {
 			$modalInstance.dismiss();
+		}*/
+
+		$scope.bill = {};
+		$scope.invoiceType = Number(invoiceInfo.split("-")[0]);
+		if(invoiceInfo.split("-").length == 2) {
+			$scope.invoiceId = Number(invoiceInfo.split("-")[1]);
+		}
+		$scope.isSpecial = true; //专票,等于true为不存在
+		$scope.isNormal = true; //普票,等于true为不存在
+		// 获取发票信息方法	1205为增值税专用发票	1206为增值税普通发票	1207为不开发票
+
+		$scope.setType = function() {
+			switch($scope.invoiceType) {
+				case 1206:
+					$scope.bill.kind = 1206;
+					$scope.isNormal = true;
+					$scope.isSpecial = false; break;
+				case 1205:
+					$scope.bill.kind = 1205;
+					$scope.isNormal = false;
+					$scope.isSpecial = true; break;
+				default:
+					$scope.isNormal = true;
+					$scope.isSpecial = true;
+			}
+		};
+
+		$scope.setType();
+
+		$scope.getData = function() {
+			if($scope.invoiceId) {
+				Bill.getBillById({id: $scope.invoiceId}, function(data) {
+					$scope.bill = data;
+					if($scope.bill.kind == 1205) {
+						$scope.isNormal = false;
+					}else {
+						$scope.isSpecial = false;
+					}
+					$http.get('static/js/prod/data/city.json').success(function(data) {
+						$scope.division = data;
+						if($scope.bill.area){
+							$scope.bill.address = {};
+							//拼装下拉选择框
+							var arr = $scope.bill.area.split(',');
+							$scope.bill.address.province = arr[0];
+							$scope.bill.address.city = arr[1];
+							$scope.bill.address.district = arr[2];
+						}
+					}).error(function(e) {
+						toaster.pop('error', '系统错误 ' + '加载城市信息失败, 请重新加载界面!');
+					});
+					$scope.bill.is_agree = true;
+				}, function(response) {
+					toaster.pop('error', '获取指定的发票信息失败');
+				});
+			}else {
+				$http.get('static/js/prod/data/city.json').success(function(data) {
+					$scope.division = data;
+				}).error(function(e) {
+					toaster.pop('error', '系统错误 ' + '加载城市信息失败');
+				});
+			}
+		};
+		$scope.getData();
+
+		$scope.bill.address = {};
+
+		//保存发票信息
+		$scope.saveBill = function(flag) {
+			var dataValidFlag = $scope.checkValidFrom();
+			if (!flag && dataValidFlag && $scope.bill.is_agree) {
+				if (!$scope.isAdd) { //修改
+					doSave('修改发票信息');
+				} else { // 新增
+					doSave('添加发票');
+				}
+			} else if (flag || !dataValidFlag) {
+				toaster.pop('error', '请填写正确的发票信息');
+			} else {
+				toaster.pop('error', '请勾选并阅读《发票须知》');
+			}
+		};
+		var doSave = function (message) {
+			$scope.bill.area = $scope.bill.address.province + "," + $scope.bill.address.city + "," + $scope.bill.address.district;
+			var file = null;
+			if($scope.bill.billInfo&&$scope.bill.billInfo[0]) {
+				file = $scope.bill.billInfo[0];
+			}
+			$upload.upload({
+				url: 'trade/bill/save',
+				file: file,
+				method: 'POST',
+				data: {
+					bill: $scope.bill
+				}
+			}).success(function(data){
+				toaster.pop('success', message + '成功');
+				$modalInstance.close(data);
+			}).error(function(data){
+				toaster.pop('error', message + '失败');
+			});
+		}
+
+		$scope.isDoUpload = false;
+		//上传发票许可证
+		$scope.onUploadPermission = function () {
+			$scope.isDoUpload = true;
+			if (event.target.files[0].size < 3*1024*1024) {
+				$scope.bill.attachUrl = event.target.files[0].name;
+			} else {
+				$scope.bill.attachUrl = '';
+			}
+		}
+
+		//判断中文字符串的长度
+		var getRealStringLen = function (str) {
+			var realLength = 0, len = str.length, charCode = -1;
+			for (var i = 0; i < len; i++) {
+				charCode = str.charCodeAt(i);
+				if (charCode >= 0 && charCode <= 128) realLength += 1;
+				else realLength += 2;
+			}
+			return realLength;
+		}
+
+		$scope.validForm = {
+			validBillHead: true,
+			validBillName: true,
+			validBankName: true,
+			validDetailAddress: true,
+			validCompanyAddress: true
+		}
+
+		$scope.initFormFlag = function () {
+			$scope.initFlag = {
+				initBillHead: true,
+				initBillName: true,
+				initBankName: true,
+				initDetailAddress: true,
+				initCompanyAddress: true,
+				initCompanyPhone: true,
+				initCompanyTaxNum: true,
+				initBankAccount: true,
+				initTelephone: true
+			}
+		}
+
+		$scope.initFormFlag();
+
+		$scope.checkValidFrom = function () {
+			var flag = true
+			angular.forEach($scope.validForm, function (item) {
+				if (!item) {
+					flag = false;
+				}
+			})
+			return flag;
+		}
+		$scope.checkValidFrom();
+		//发票抬头check
+		$scope.checkBillHead = function () {
+			var len = getRealStringLen($scope.bill.head);
+			if (len > 100) {
+				$scope.validForm.validBillHead = false;
+			} else {
+				$scope.validForm.validBillHead = true;
+			}
+		}
+
+		//收票人check
+		$scope.checkBillName = function () {
+			var len = getRealStringLen($scope.bill.name);
+			if (len > 20) {
+				$scope.validForm.validBillName = false;
+			} else {
+				$scope.validForm.validBillName = true;
+			}
+		}
+
+		//开户银行Check
+		$scope.checkBankName = function () {
+			var len = getRealStringLen($scope.bill.bankName);
+			if (len > 60) {
+				$scope.validForm.validBankName = false;
+			} else {
+				$scope.validForm.validBankName = true;
+			}
+		}
+
+		//详细地址Check
+		$scope.checkDetailAddress = function () {
+			var len = getRealStringLen($scope.bill.detailAddress);
+			if (len > 60) {
+				$scope.validForm.validDetailAddress = false;
+			} else {
+				$scope.validForm.validDetailAddress = true;
+			}
+		}
+
+		//单位地址check
+		$scope.checkCompanyAddress = function () {
+			var len = getRealStringLen($scope.bill.companyAddress);
+			if (len > 100) {
+				$scope.validForm.validCompanyAddress = false;
+			} else {
+				$scope.validForm.validCompanyAddress = true;
+			}
+		}
+
+		$scope.exitEdit = function () {
+			$modalInstance.dismiss();
 		}
 		
 	}]);

+ 133 - 45
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_home_ctrl.js

@@ -311,18 +311,16 @@ define(['app/app', 'calendar'], function(app) {
 
     // 发票编辑模态框
     app.register.controller('BillInputCtrl', ['$scope', '$http', 'BaseService', 'Bill', 'toaster', '$stateParams', '$state', 'invoiceInfo', '$upload', '$modalInstance', function($scope, $http, BaseService, Bill, toaster, $stateParams, $state, invoiceInfo, $upload, $modalInstance) {
-        //BaseService.scrollBackToTop();
 
-        $scope.bill = {};
-        $scope.bill.address = {};
-        $scope.bill.is_agree = true;
-        $scope.bill.kind = 1206;
-        $scope.isNormal = true;
-        $scope.isSpecial = true;
+       $scope.bill = {};
         $scope.invoiceType = Number(invoiceInfo.split("-")[0]);
         if(invoiceInfo.split("-").length == 2) {
             $scope.invoiceId = Number(invoiceInfo.split("-")[1]);
         }
+        $scope.isSpecial = true; //专票,等于true为不存在
+        $scope.isNormal = true; //普票,等于true为不存在
+        // 获取发票信息方法	1205为增值税专用发票	1206为增值税普通发票	1207为不开发票
+
         $scope.setType = function() {
             switch($scope.invoiceType) {
                 case 1206:
@@ -341,39 +339,6 @@ define(['app/app', 'calendar'], function(app) {
 
         $scope.setType();
 
-        $scope.linkmanLen = function(num) {
-            var size;
-            if (num == 1){
-                size = document.getElementById("mpbillname").value.length;
-            }else if (num == 2){
-                size = document.getElementById("mzbillname").value.length;
-            }
-            console.log(size);
-            if (size > 10) {
-                $scope.linkError = true;
-                console.log($scope.linkError);
-                return;
-            }
-            $scope.linkError = false;
-            console.log($scope.linkError);
-        }
-        $scope.addressLen = function(num) {
-            var size;
-            if (num == 1){
-                size = document.getElementById("mpaddress").value.length;
-            }else if (num == 2){
-                size = document.getElementById("mzaddress").value.length;
-            }
-            console.log(size);
-            if (size > 30) {
-                $scope.addressError = true;
-                console.log($scope.addressError);
-                return;
-            }
-            $scope.addressError = false;
-            console.log($scope.addressError);
-        }
-
         $scope.getData = function() {
             if($scope.invoiceId) {
                 Bill.getBillById({id: $scope.invoiceId}, function(data) {
@@ -410,7 +375,24 @@ define(['app/app', 'calendar'], function(app) {
         };
         $scope.getData();
 
-        $scope.saveBill = function() {
+        $scope.bill.address = {};
+
+        //保存发票信息
+        $scope.saveBill = function(flag) {
+            var dataValidFlag = $scope.checkValidFrom();
+            if (!flag && dataValidFlag && $scope.bill.is_agree) {
+                if (!$scope.isAdd) { //修改
+                    doSave('修改发票信息');
+                } else { // 新增
+                    doSave('添加发票');
+                }
+            } else if (flag || !dataValidFlag) {
+                toaster.pop('error', '请填写正确的发票信息');
+            } else {
+                toaster.pop('error', '请勾选并阅读《发票须知》');
+            }
+        };
+        var doSave = function (message) {
             $scope.bill.area = $scope.bill.address.province + "," + $scope.bill.address.city + "," + $scope.bill.address.district;
             var file = null;
             if($scope.bill.billInfo&&$scope.bill.billInfo[0]) {
@@ -424,14 +406,120 @@ define(['app/app', 'calendar'], function(app) {
                     bill: $scope.bill
                 }
             }).success(function(data){
-                toaster.pop('success', '保存发票信息成功');
+                toaster.pop('success', message + '成功');
                 $modalInstance.close(data);
             }).error(function(data){
-                toaster.pop('error', '保存发票信息失败');
+                toaster.pop('error', message + '失败');
             });
-        };
+        }
+
+        $scope.isDoUpload = false;
+        //上传发票许可证
+        $scope.onUploadPermission = function () {
+            $scope.isDoUpload = true;
+            if (event.target.files[0].size < 3*1024*1024) {
+                $scope.bill.attachUrl = event.target.files[0].name;
+            } else {
+                $scope.bill.attachUrl = '';
+            }
+        }
+
+        //判断中文字符串的长度
+        var getRealStringLen = function (str) {
+            var realLength = 0, len = str.length, charCode = -1;
+            for (var i = 0; i < len; i++) {
+                charCode = str.charCodeAt(i);
+                if (charCode >= 0 && charCode <= 128) realLength += 1;
+                else realLength += 2;
+            }
+            return realLength;
+        }
+
+        $scope.validForm = {
+            validBillHead: true,
+            validBillName: true,
+            validBankName: true,
+            validDetailAddress: true,
+            validCompanyAddress: true
+        }
+
+        $scope.initFormFlag = function () {
+            $scope.initFlag = {
+                initBillHead: true,
+                initBillName: true,
+                initBankName: true,
+                initDetailAddress: true,
+                initCompanyAddress: true,
+                initCompanyPhone: true,
+                initCompanyTaxNum: true,
+                initBankAccount: true,
+                initTelephone: true
+            }
+        }
+
+        $scope.initFormFlag();
+
+        $scope.checkValidFrom = function () {
+            var flag = true
+            angular.forEach($scope.validForm, function (item) {
+                if (!item) {
+                    flag = false;
+                }
+            })
+            return flag;
+        }
+        $scope.checkValidFrom();
+        //发票抬头check
+        $scope.checkBillHead = function () {
+            var len = getRealStringLen($scope.bill.head);
+            if (len > 100) {
+                $scope.validForm.validBillHead = false;
+            } else {
+                $scope.validForm.validBillHead = true;
+            }
+        }
+
+        //收票人check
+        $scope.checkBillName = function () {
+            var len = getRealStringLen($scope.bill.name);
+            if (len > 20) {
+                $scope.validForm.validBillName = false;
+            } else {
+                $scope.validForm.validBillName = true;
+            }
+        }
+
+        //开户银行Check
+        $scope.checkBankName = function () {
+            var len = getRealStringLen($scope.bill.bankName);
+            if (len > 60) {
+                $scope.validForm.validBankName = false;
+            } else {
+                $scope.validForm.validBankName = true;
+            }
+        }
+
+        //详细地址Check
+        $scope.checkDetailAddress = function () {
+            var len = getRealStringLen($scope.bill.detailAddress);
+            if (len > 60) {
+                $scope.validForm.validDetailAddress = false;
+            } else {
+                $scope.validForm.validDetailAddress = true;
+            }
+        }
+
+        //单位地址check
+        $scope.checkCompanyAddress = function () {
+            var len = getRealStringLen($scope.bill.companyAddress);
+            if (len > 100) {
+                $scope.validForm.validCompanyAddress = false;
+            } else {
+                $scope.validForm.validCompanyAddress = true;
+            }
+        }
 
-        $scope.exit = function() {
+        $scope.exitEdit = function () {
             $modalInstance.dismiss();
         }
 

+ 159 - 43
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -975,44 +975,13 @@ define(['app/app'], function(app) {
 
 	// 发票编辑模态框
 	app.register.controller('BillInputCtrl', ['$scope', '$http', 'BaseService', 'Bill', 'toaster', '$stateParams', '$state', 'invoice', '$upload', '$modalInstance', '$q', function($scope, $http, BaseService, Bill, toaster, $stateParams, $state, invoice, $upload, $modalInstance, $q) {
-		//BaseService.scrollBackToTop();
 
-		$scope.bill = {};
-		$scope.bill.address = {};
-		$scope.bill.is_agree = true;
-		$scope.bill.kind = 1206;
-		$scope.isNormal = true;
-		$scope.isSpecial = true;
 		$scope.invoiceType = invoice.kind;
-		$scope.setType = function() {
-			switch($scope.invoiceType) {
-				case 1206:
-					$scope.bill.kind = 1206;
-					$scope.isNormal = true;
-					$scope.isSpecial = false; break;
-				case 1205:
-					$scope.bill.kind = 1205;
-					$scope.isNormal = false;
-					$scope.isSpecial = true; break;
-				default:
-					$scope.isNormal = true;
-					$scope.isSpecial = true;
-			}
-		};
-
-		$scope.setType();
+		$scope.isSpecial = true; //专票,等于true为不存在
+		$scope.isNormal = true; //普票,等于true为不存在
+		// 获取发票信息方法	1205为增值税专用发票	1206为增值税普通发票	1207为不开发票
 
-		//获取城市信息的数据
-		var getCityData = function () {
-			return $http.get('static/js/prod/data/city.json').success(function(data) {
-				$scope.division = data;
-			}).error(function(reponse) {
-				toaster.pop('error', '系统错误 ' + '加载城市信息失败,' + reponse.data);
-			});
-		};
-
-		//等获取城市信息之后,做拆分
-		$q.all([getCityData().$promise]).then(function() {
+		var getInvoiceInfo = function() {
 			if(invoice&&invoice.kind) {
 				$scope.bill = invoice;
 				if($scope.bill.kind == 1205) {
@@ -1029,12 +998,53 @@ define(['app/app'], function(app) {
 					$scope.bill.address.province = arr[0];
 					$scope.bill.address.city = arr[1];
 					$scope.bill.address.district = arr[2];
+					// console.log($scope.bill.address)
+				}
+				if ($scope.bill.name) {
+					$scope.bill.is_agree = true;
+				} else {
+					$scope.bill.is_agree = false;
 				}
 			}
-			$scope.bill.is_agree = true;
-		});
+		};
+		getInvoiceInfo();
+		// $scope.bill = {};
+		// 获取省市区地理信息
+		var getGeoInfo = function () {
+			$http.get('static/js/prod/data/city.json').success(function(data) {
+				$scope.division = data;
+				if($scope.bill.area){
+					$scope.bill.address = {};
+					//拼装下拉选择框
+					var arr = $scope.bill.area.split(',');
+					$scope.bill.address.province = arr[0];
+					$scope.bill.address.city = arr[1];
+					$scope.bill.address.district = arr[2];
+				}
+			}).error(function(e) {
+				toaster.pop('error', '系统错误 ' + '加载城市信息失败, 请重新加载界面!');
+			});
+		};
+		getGeoInfo();
+
+		$scope.bill.address = {};
 
-		$scope.saveBill = function() {
+		//保存发票信息
+		$scope.saveBill = function(flag) {
+			var dataValidFlag = $scope.checkValidFrom();
+			if (!flag && dataValidFlag && $scope.bill.is_agree) {
+				if (!$scope.isAdd) { //修改
+					doSave('修改发票信息');
+				} else { // 新增
+					doSave('添加发票');
+				}
+			} else if (flag || !dataValidFlag) {
+				toaster.pop('error', '请填写正确的发票信息');
+			} else {
+				toaster.pop('error', '请勾选并阅读《发票须知》');
+			}
+		};
+		var doSave = function (message) {
 			$scope.bill.area = $scope.bill.address.province + "," + $scope.bill.address.city + "," + $scope.bill.address.district;
 			var file = null;
 			if($scope.bill.billInfo&&$scope.bill.billInfo[0]) {
@@ -1048,14 +1058,120 @@ define(['app/app'], function(app) {
 					bill: $scope.bill
 				}
 			}).success(function(data){
-				toaster.pop('success', '保存发票信息成功');
+				toaster.pop('success', message + '成功');
 				$modalInstance.close(data);
-			}).error(function(res){
-				toaster.pop('error', '保存发票信息失败,' + res.data);
+			}).error(function(data){
+				toaster.pop('error', message + '失败');
 			});
-		};
+		}
+
+		$scope.isDoUpload = false;
+		//上传发票许可证
+		$scope.onUploadPermission = function () {
+			$scope.isDoUpload = true;
+			if (event.target.files[0].size < 3*1024*1024) {
+				$scope.bill.attachUrl = event.target.files[0].name;
+			} else {
+				$scope.bill.attachUrl = '';
+			}
+		}
+
+		//判断中文字符串的长度
+		var getRealStringLen = function (str) {
+			var realLength = 0, len = str.length, charCode = -1;
+			for (var i = 0; i < len; i++) {
+				charCode = str.charCodeAt(i);
+				if (charCode >= 0 && charCode <= 128) realLength += 1;
+				else realLength += 2;
+			}
+			return realLength;
+		}
+
+		$scope.validForm = {
+			validBillHead: true,
+			validBillName: true,
+			validBankName: true,
+			validDetailAddress: true,
+			validCompanyAddress: true
+		}
+
+		$scope.initFormFlag = function () {
+			$scope.initFlag = {
+				initBillHead: true,
+				initBillName: true,
+				initBankName: true,
+				initDetailAddress: true,
+				initCompanyAddress: true,
+				initCompanyPhone: true,
+				initCompanyTaxNum: true,
+				initBankAccount: true,
+				initTelephone: true
+			}
+		}
+
+		$scope.initFormFlag();
+
+		$scope.checkValidFrom = function () {
+			var flag = true
+			angular.forEach($scope.validForm, function (item) {
+				if (!item) {
+					flag = false;
+				}
+			})
+			return flag;
+		}
+		$scope.checkValidFrom();
+		//发票抬头check
+		$scope.checkBillHead = function () {
+			var len = getRealStringLen($scope.bill.head);
+			if (len > 100) {
+				$scope.validForm.validBillHead = false;
+			} else {
+				$scope.validForm.validBillHead = true;
+			}
+		}
+
+		//收票人check
+		$scope.checkBillName = function () {
+			var len = getRealStringLen($scope.bill.name);
+			if (len > 20) {
+				$scope.validForm.validBillName = false;
+			} else {
+				$scope.validForm.validBillName = true;
+			}
+		}
+
+		//开户银行Check
+		$scope.checkBankName = function () {
+			var len = getRealStringLen($scope.bill.bankName);
+			if (len > 60) {
+				$scope.validForm.validBankName = false;
+			} else {
+				$scope.validForm.validBankName = true;
+			}
+		}
+
+		//详细地址Check
+		$scope.checkDetailAddress = function () {
+			var len = getRealStringLen($scope.bill.detailAddress);
+			if (len > 60) {
+				$scope.validForm.validDetailAddress = false;
+			} else {
+				$scope.validForm.validDetailAddress = true;
+			}
+		}
+
+		//单位地址check
+		$scope.checkCompanyAddress = function () {
+			var len = getRealStringLen($scope.bill.companyAddress);
+			if (len > 100) {
+				$scope.validForm.validCompanyAddress = false;
+			} else {
+				$scope.validForm.validCompanyAddress = true;
+			}
+		}
 
-		$scope.exit = function() {
+		$scope.exitEdit = function () {
 			$modalInstance.dismiss();
 		}
 

+ 2 - 2
src/main/webapp/resources/view/admin/checkMoney/billInput.html

@@ -212,7 +212,7 @@ a:HOVER {
 					                     <label class="checkbox-inline text-inverse">
 					                     		<input type="checkbox" checked="true" name="is_agree" ng-model="bill.is_agree" required="required" /> 我已阅读并同意 
 					                     </label>
-					                     <a href="help/nav/19">《发票须知》</a>
+					                     <a href="/help/helpList/205">《发票须知》</a>
 				                     </div>
 				               </div>
 				               <div class="text-center span8 text-center">
@@ -330,7 +330,7 @@ a:HOVER {
 				                       <label class="check-inline text-inverse">
 				                       		<input checked="true" type="checkbox" ng-model="bill.is_agree" name="is_agree" required=""> 我已阅读并同意
 				                       </label>
-				                       	<a href="help/nav/19">《发票须知》</a>
+				                       	<a href="/help/helpList/205">《发票须知》</a>
 				                   </div>
 				               </div>
 				               <div class="text-center span8">

+ 394 - 9
src/main/webapp/resources/view/prod/modal/edit-invoice-modal.html

@@ -1,4 +1,4 @@
-<style type="text/css">
+<!--<style type="text/css">
     .content-header {
         font-size: 24px;
         border-bottom: 1px dashed rgb(129,184,233);
@@ -102,10 +102,10 @@
         background:url("static/img/user/images/xiala.png") right no-repeat ;
         background-position-x: 150px;
     }
-</style>
-<div id="bill-info">
+</style>-->
+<!--<div id="bill-info">
       <div class="row">
-          <h2 class="content-header">新增开票资料</h2>
+          <h2 class="content-header" ng-bind="bill.head?'修改开票资料':'新增开票资料'">修改开票资料</h2>
       </div>
       <div class="row">
           <label class="col-md-3 normal-control-label"><b class="text-inverse">*</b>发票类型:</label>
@@ -201,7 +201,7 @@
                             <label for="check-mpy"></label>
                              <span>我已阅读并同意</span>
                      </label>
-                     <a href="help/helpList/19" class="base-line" target="_blank" style=" position: relative;top: -3px;">《发票须知》</a>
+                     <a href="/help/helpList/205" class="base-line" target="_blank" style=" position: relative;top: -3px;">《发票须知》</a>
                     </div>
               </div>
               <div class="col-md-offset-3">
@@ -315,12 +315,12 @@
                   </div>
                   <div class="text-inverse error col-md-3" ng-show="(bill.bankAccount||form.account.$touched)&&(form.account.$invalid)">输入正确的银行卡账号</div>
               </div>
-              <!--<div class="form-group" ng-show="bill.generalTaxpayerCertUrl">
+              &lt;!&ndash;<div class="form-group" ng-show="bill.generalTaxpayerCertUrl">
                   <label for="generalTaxpayerCert" class="col-md-3 control-label">一般纳税人认定证书:</label>
                   <div class="col-md-5">
                       <input type="file" id="generalTaxpayerCert" name="generalTaxpayerCert" class="form-control" ng-file-select ng-model="generalTaxpayerCertFile" ng-multiple="false" accept="image/*,application/pdf,*.pdf">
                   </div>
-              </div>-->
+              </div>&ndash;&gt;
               <div class="form-group" ng-show="bill.attachUrl&&!billInfoRevise">
                   <label class="col-md-3 control-label" for="exampleInputFile">开票资料:</label>
                   <div class="col-md-5 height-34">
@@ -341,7 +341,7 @@
                           <label for="check-mzy"></label>
                           <span>我已阅读并同意</span>
                       </label>
-                      <a href="help/helpList/19">《发票须知》</a>
+                      <a href="/help/helpList/205">《发票须知》</a>
                   </div>
               </div>
               <div class="col-md-offset-3">
@@ -350,4 +350,389 @@
                   <input type="button" ng-if="invoiceId" value="取消修改" class="btn btn-default" ng-click="exit()">
               </div>
       </form>
-</div>
+</div>-->
+
+<style>
+    /*新增普票样式*/
+    .content-title {
+        font-size: 19px;
+    }
+
+    td > .simple-select {
+        display: inline;
+    }
+    .normal-control-label {
+        margin-bottom: 0;
+        text-align: right;
+        padding-top: 7px;
+        padding-right: 23px;
+    }
+
+    #bill-info label {
+        font-size: 14px;
+        line-height: 1.429;
+        font-weight: normal;
+    }
+    #bill-info span.disable {
+        color: rgb(153, 153, 153);
+    }
+    .base-line {
+        vertical-align: -webkit-baseline-middle;
+    }
+
+    #bill-info .row {
+        margin-left: 0px;
+        margin-right: 0px;
+    }
+
+    #bill-info {
+        font-size: 15px;
+        margin-bottom: 1em;
+    }
+
+    .error {
+        padding-top: 7px;
+        line-height: 1.5;
+    }
+
+    div.radio {
+        margin-top: 0px;
+        margin-bottom: 0;
+        height: 27px;
+        line-height: 27px;
+        padding-top: 6px;
+        padding-left: 0;
+    }
+
+    .padding-top-5 {
+        padding-top: 5px;
+    }
+
+    label.padding-left-0 {
+        padding-left: 0px;
+    }
+
+    .checkbox .col-md-3 {
+        padding-right: 0px;
+    }
+
+    div.upload {
+        margin-left: 15px;
+        width: 370px;
+    }
+
+    #bill-info,  #bill-info input, #bill-info select{
+        font-size: 14px !important;
+    }
+
+    .height-34 {
+        height: 34px;
+        line-height: 26px;
+    }
+
+    .a-background {
+        color: red;
+    }
+
+    .address .checkbox .col-md-3{
+        width: 20%;
+    }
+    #bill-info .form-control {
+        color: #000;
+        font-size: 14px;
+    }
+    #bill-info .format-error {
+        color: red;
+        height: 30px;
+        line-height: 30px;
+    }
+
+    #bill-info select {
+        opacity: 1;
+    }
+    #bill-info .content-header{
+        font-size: 14px;
+        color: rgb(80, 120, 203);
+        font-weight: bold;
+        line-height: 1.429;
+        padding: 10px 0 10px 40px;
+    }
+    .select-adder{
+        background:url("static/img/user/images/xiala.png") right no-repeat ;
+        background-position-x: 150px;
+    }
+    .form-btn .btn {
+        background: #5078cb;
+        border-color: #3b88c3;
+        width: 60px;
+        height: 26px;
+        line-height: 13px;
+        color: #fff;
+        border-radius: 0;
+        text-align: center;
+        vertical-align: middle;
+        white-space: nowrap;
+    }
+    .form-btn .btn:first-child{
+        background: #c8c6c6;
+        border: 1px solid #c8c6c6;
+    }
+    .form-area {
+        background: #f5f8fe;
+        margin: 0 15px;
+    }
+    .form-area .row {
+        padding-top: 15px;
+    }
+    .form-area .address .row {
+        padding-top: 0px;
+    }
+    .form-area form {
+        padding-top: 15px;
+    }
+    .form-bottom {
+        background: #fff;
+        text-align: center;
+        vertical-align: middle;
+        padding-top: 20px;
+        padding-bottom: 3px;
+    }
+    .ticket_record_list dl dt span {
+        font-weight: normal;
+    }
+    /*radio*/
+    #bill-info .radioLabel {
+        line-height: 20px;
+        cursor: pointer;
+        color: #666;
+    }
+    #bill-info .radio-inline {
+        padding-left: 0;
+        margin: 0 26px;
+    }
+    #bill-info .radioLabel label{
+        width: 12px;
+        height: 12px;
+        background: url(static/img/icon/check-rule.png);
+        background-position: 0 0px;
+        vertical-align: middle;
+        margin-bottom: 0 !important;
+        margin-right: 0px !important;
+        padding: 0;
+        min-height: 12px;
+        left: -7px;
+    }
+    #bill-info .radioLabel input[type="radio"]:checked + label {
+        background-position: -15px -12px;
+    }
+    #bill-info .radioLabel input[type="radio"]:checked + label{
+        color: #5078cb;
+    }
+    #bill-info .radioLabel input[type="radio"]{
+        display: none;
+    }
+    #bill-info .form-area .input-file-default {
+        width: 75px;
+    }
+    .ticket_record_list dl dd:hover {
+        background: #f1f5ff;
+    }
+    #bill-info .select-file-box input {
+        display: none;
+    }
+    #bill-info .select-file-box span {
+        width: 74px;
+        display: block;
+        text-align: center;
+        height: 22px;
+        line-height: 22px;
+        background: #ff8522;
+        font-size: 12px;
+        color: #fff;
+        margin-top: 5px;
+        position: relative;
+        left: -22px;
+        border-radius: 2px;
+    }
+    .cursor-not-allowed {
+        cursor: not-allowed!important;
+    }
+    .ticket_record_list .ticket_data dd {
+        border-left: #dae5fd 1px solid;
+        border-bottom: #dae5fd 1px solid!important;
+        border-right: #dae5fd 1px solid;
+    }
+    #bill-info .form-input-line {
+        height: 34px;
+        width: 331px;
+        display: inline-block;
+        margin: 0 15px;
+        float: left;
+    }
+    #bill-info .form-input-line input[type='text'],#bill-info .form-input-line select {
+        border-radius: 2px;
+        border: 1px solid #eef4ff;
+    }
+    #bill-info .file-line {
+        width: 247px;
+    }
+    #bill-info .address .form-input-line {
+        margin: 0 10px 0 0;
+    }
+    #bill-info .address .form-input-line:first-child {
+        margin-left: 15px;
+    }
+    #bill-info .control-label{
+        position: relative;
+        top: 7px;
+    }
+    #bill-info .normal-control-label {
+        position: relative;
+        top: 5px;
+    }
+    .bg-fff8ee {
+        background: #fff8ee;
+    }
+    .bg-fff {
+        -webkit-box-shadow: 0 0 0px 1000px white inset!important;
+    }
+    input:-webkit-autofill,
+    input:-webkit-autofill:hover,
+    input:-webkit-autofill:focus,
+    input:-webkit-autofill:active {
+        -webkit-transition-delay: 99999s;
+        -webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
+        /* -webkit-box-shadow: 0 0 0px 1000px white inset;*/
+    }
+    .modal-lg {
+        width: 914px;
+    }
+</style>
+
+<div id="bill-info">
+    <div class="row">
+        <h2 class="content-header ng-binding" ng-bind="bill.head?'修改开票资料':'新增开票资料'">修改开票资料</h2>
+    </div>
+    <div class="form-area">
+        <form class="form-horizontal" novalidate="novalidate" name="form">
+            <div class="form-group">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>发票抬头:</label>
+                <div class="form-input-line">
+                    <input type="text" class="form-control" ng-class="{'bg-fff8ee': !initFlag.initBillHead&&(form.billHead.$invalid || !validForm.validBillHead)}" ng-model="bill.head" ng-focus="form.billHead.$touched = false;" ng-blur="form.billHead.$touched = true;initFlag.initBillHead = false;checkBillHead()" name="billHead" required="required" placeholder="请输入发票抬头">
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.billHead.$touched&&(form.billHead.$invalid || !validForm.validBillHead)" ng-bind="form.billHead.$error.required?'请填写发票抬头':'请勿超过50个字'"></div>
+            </div>
+            <div class="form-group" ng-if="invoiceType == 1205">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>单位地址:</label>
+                <div class="form-input-line">
+                    <input type="text" class="form-control" ng-class="{'bg-fff8ee': !initFlag.initCompanyAddress&&(form.companyAddr.$invalid || !validForm.validCompanyAddress)}" ng-model="bill.companyAddress" ng-focus="form.companyAddr.$touched = false;" ng-blur="form.companyAddr.$touched = true;initFlag.initCompanyAddress = false; checkCompanyAddress()" name="companyAddr" required="required" placeholder="请输入单位地址">
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.companyAddr.$touched&&(form.companyAddr.$invalid || !validForm.validCompanyAddress)" ng-bind="form.companyAddr.$error.required?'请填写单位地址':'请勿超过50个字'"></div>
+            </div>
+            <div class="form-group"  ng-if="invoiceType == 1205">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>单位电话:</label>
+                <div class="form-input-line">
+                    <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyPhone&&form.companyPhone.$error.required, 'bg-fff':!form.companyPhone.$invalid}" ng-focus="form.companyPhone.$touched = false" ng-blur="form.companyPhone.$touched = true;initFlag.initCompanyPhone=false;" placeholder="区号和号码使用 '-' 隔开" name="companyPhone" ng-model="bill.companyPhone" ng-pattern="/^0\d{2,3}-[1-9]\d{6,7}$/" ng-maxlength="20" required="required">
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.companyPhone.$touched&&form.companyPhone.$invalid" ng-bind="form.companyPhone.$error.required?'请填写单位电话':form.companyPhone.$error.maxlength?'请勿超过20个字符':'请填写正确的电话号码,用-隔开'"></div>
+            </div>
+            <div class="form-group"  ng-if="invoiceType == 1205">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>税务登记号:</label>
+                <div class="form-input-line">
+                    <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyTaxNum&&form.companyTaxNum.$error.required, 'bg-fff':!form.companyTaxNum.$invalid}" ng-model="bill.companyTaxNumber" ng-focus="form.companyTaxNum.$touched = false" ng-blur="form.companyTaxNum.$touched = true; initFlag.initCompanyTaxNum = false;" name="companyTaxNum" required="true" ng-maxlength="20" ng-minlength="15" ng-pattern="/^[0-9a-zA-Z]+$/" placeholder="请输入税务登记号">
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.companyTaxNum.$touched&&(form.companyTaxNum.$invalid)" ng-bind="form.companyTaxNum.$error.required?'请填写税务登记号':'请填写15-20位数字或字母'"></div>
+            </div>
+            <div class="form-group"  ng-if="invoiceType == 1205">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>开户银行:</label>
+                <div class="form-input-line">
+                    <input type="text" class="form-control" ng-class="{'bg-fff8ee': !initFlag.initBankName&&(form.bankName.$invalid || !validForm.validBankName)}" ng-model="bill.bankName" ng-focus="form.bankName.$touched = false;" ng-blur="form.bankName.$touched = true;initFlag.initBankName = false; checkBankName()" name="bankName" required="required" placeholder="请输入开户银行">
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.bankName.$touched&&(form.bankName.$invalid || !validForm.validBankName)" ng-bind="form.bankName.$error.required?'请填写开户银行':'请勿超过30个字'"></div>
+            </div>
+            <div class="form-group"  ng-if="invoiceType == 1205">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>开户银行账户:</label>
+                <div class="form-input-line">
+                    <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initBankAccount&&form.account.$error.required}" ng-model="bill.bankAccount" name="account" ng-focus="form.account.$touched = false" ng-blur="form.account.$touched = true; initFlag.initBankAccount=false" ng-pattern="/^[0-9]*$/" required ng-maxlength="30" placeholder="请输入开户银行账号">
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.account.$touched&&(form.account.$invalid)" ng-bind="form.account.$error.required?'请填写开户银行账号':'请填写30位以内的数字'"></div>
+            </div>
+            <div class="form-group"  ng-if="invoiceType == 1205">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>上传开户许可证:{{form.permissionUpload}}</label>
+                <div class="form-input-line file-line">
+                    <input type="text" name="permission" required class="form-control" ng-model="bill.attachUrl" readonly style="background: #fff">
+                </div>
+                <div class="col-md-1">
+                    <label class="select-file-box">
+                        <span>选择文件</span>
+                        <input class="input-file-default" type="file" ng-file-select ng-model="bill.billInfo" ng-change="onUploadPermission()" ng-multiple="false" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg,application/pdf,*.pdf">
+                    </label></div>
+                <div class="text-inverse error col-md-3" ng-show="isDoUpload&&(form.permission.$error.required)">请勿超过3M</div>
+            </div>
+            <div class="form-group">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>收票人:</label>
+                <div class="form-input-line">
+                    <input id="mzbillname" ng-class="{'bg-fff8ee': !initFlag.initBillName&&(form.billName.$invalid || !validForm.validBillName)}" type="text" class="form-control" ng-focus="form.billName.$touched = false; " ng-blur="form.billName.$touched = true;initFlag.initBillName = false; checkBillName()" ng-model="bill.name" name="billName" required="required" placeholder="请输入收票人">
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.billName.$touched&&(form.billName.$invalid || !validForm.validBillName)" ng-bind="form.billName.$error.required?'请填写收票人姓名':'请勿超过10个字'"></div>
+            </div>
+            <div class="form-group">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>联系电话:</label>
+                <div class="form-input-line">
+                    <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initTelephone&&form.billTel.$error.required, 'bg-fff':!form.billTel.$invalid||!form.billTel.$touched}" ng-model="bill.telephone" ng-focus="form.billTel.$touched = false" ng-blur="form.billTel.$touched = true; initFlag.initTelephone=false;" name="billTel"
+                           ng-pattern="/^[0-9]*$/" ng-minlength="8" ng-maxlength="11" required="required" placeholder="请输入联系电话">
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.billTel.$touched&&form.billTel.$invalid" ng-bind="form.billTel.$error.required?'请填写联系电话':'请输入8-11位数字'"></div>
+            </div>
+            <div class="form-group address">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>所在地区:</label>
+                <div class="row checkbox">
+                    <div class="form-input-line" style="width: 160px">
+                        <select required="required" class="select-adder form-control"
+                                ng-model="bill.address.province" name="province"
+                                ng-options="key as key for (key,value) in division"
+                                ng-change="bill.address.city='';bill.address.district='';">
+                            <option value="">省</option>
+                        </select>
+                    </div>
+                    <div class="form-input-line" style="width: 160px">
+                        <select class="select-adder form-control" ng-model="bill.address.city" name="city"
+                                ng-options="key as key for (key,value) in division[bill.address.province]"
+                                ng-change="bill.address.district='';" required="required">
+                            <option value="">市</option>
+                        </select>
+                    </div>
+                    <div class="form-input-line" style="width: 160px">
+                        <select class="select-adder form-control" ng-model="bill.address.district" name="district"
+                                ng-options="value as value for value in division[bill.address.province][bill.address.city]" required="required">
+                            <option value="">区</option>
+                        </select>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-md-2 control-label"><b class="text-inverse">*</b>详细地址:</label>
+                <div class="form-input-line" style="width: 502px">
+                    <input id="mzaddress" type="text" class="form-control" ng-class="{'bg-fff8ee': !initFlag.initDetailAddress&&(form.billDetail.$invalid|| !validForm.validDetailAddress)}" required="required" name="billDetail" ng-model="bill.detailAddress" title="建议您填写详细发件地址,如街道名,门牌号,楼层和房间号等信息"
+                           placeholder="建议您填写详细发件地址,如街道名,门牌号,楼层和房间号等信息" ng-focus="form.billDetail.$touched = false; " ng-blur="form.billDetail.$touched = true;initFlag.initDetailAddress = false; checkDetailAddress()" >
+                </div>
+                <div class="text-inverse error col-md-3" ng-show="form.billDetail.$touched&&(form.billDetail.$invalid|| !validForm.validDetailAddress)" ng-bind="form.billDetail.$error.required?'请填写详细地址':'请勿超过30个字'"></div>
+            </div>
+            <div class="form-bottom">
+                <div class="form-group">
+                    <label class="check-active checkbox-inline text-inverse">
+                        <input checked="true" type="checkbox" ng-model="bill.is_agree" name="is_agree" id="check-mzy">
+                        <label for="check-mzy" style="position: relative;bottom: 2px;"></label>
+                        <span style="color: #333;">我已阅读并同意</span>
+                    </label>
+                    <a href="/help/helpList/205" target="_blank" style="color: #5078cb; font-size: 14px; position: relative;top: 2px;">《发票须知》</a>
+                </div>
+                <div class="form-btn">
+                    <input type="button" value="取消" class="btn" ng-click="exitEdit()">
+                    <input type="submit" value="保存" class="btn"
+                           ng-click="saveBill(form.$invalid)">
+                </div>
+            </div>
+        </form>
+    </div>
+</div>

+ 3 - 3
src/main/webapp/resources/view/usercenter/billInput.html

@@ -82,7 +82,7 @@ h2 {
 </style>
 <div id="bill-info">
   <div class="row">
-      <h2 class="content-header">新增开票资料</h2>
+      <h2 class="content-header" ng-bind="bill.head?'修改开票资料':'新增开票资料'">新增开票资料</h2>
   </div>
    <div class="row">
        <label class="col-md-3 normal-control-label"><b class="text-inverse">*</b>发票类型:</label>
@@ -157,7 +157,7 @@ h2 {
                      <label class="checkbox-inline text-inverse">
                             <input type="checkbox" checked="true" name="is_agree" ng-model="bill.is_agree" required="required" /> 我已阅读并同意
                      </label>
-                     <a href="help#/nav/19" class="base-line" target="_blank">《发票须知》</a>
+                     <a href="/help/helpList/205" class="base-line" target="_blank">《发票须知》</a>
                  </div>
            </div>
            <div class="col-md-offset-3">
@@ -274,7 +274,7 @@ h2 {
                    <label class="check-inline text-inverse">
                         <input checked="true" type="checkbox" ng-model="bill.is_agree" name="is_agree" required=""> 我已阅读并同意
                    </label>
-                    <a href="help#/nav/19">《发票须知》</a>
+                    <a href="/help/helpList/205">《发票须知》</a>
                </div>
            </div>
            <div class="col-md-offset-3">

+ 15 - 4
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html

@@ -435,6 +435,17 @@
     .bg-fff8ee {
         background: #fff8ee;
     }
+    .bg-fff {
+        -webkit-box-shadow: 0 0 0px 1000px white inset!important;
+    }
+    input:-webkit-autofill,
+    input:-webkit-autofill:hover,
+    input:-webkit-autofill:focus,
+    input:-webkit-autofill:active {
+        -webkit-transition-delay: 99999s;
+        -webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
+       /* -webkit-box-shadow: 0 0 0px 1000px white inset;*/
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr u_c_invoice">
@@ -542,14 +553,14 @@
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>单位电话:</label>
                         <div class="form-input-line">
-                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyPhone&&form.companyPhone.$error.required}" ng-focus="form.companyPhone.$touched = false" ng-blur="form.companyPhone.$touched = true;initFlag.initCompanyPhone=false;" placeholder="区号和号码使用 '-' 隔开" name="companyPhone" ng-model="bill.companyPhone" ng-pattern="/^0\d{2,3}-[1-9]\d{6,7}$/" ng-maxlength="20" required="required">
+                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyPhone&&form.companyPhone.$error.required, 'bg-fff':!form.companyPhone.$invalid}" ng-focus="form.companyPhone.$touched = false" ng-blur="form.companyPhone.$touched = true;initFlag.initCompanyPhone=false;" placeholder="区号和号码使用 '-' 隔开" name="companyPhone" ng-model="bill.companyPhone" ng-pattern="/^0\d{2,3}-[1-9]\d{6,7}$/" ng-maxlength="20" required="required">
                         </div>
                         <div class="text-inverse error col-md-3" ng-show="form.companyPhone.$touched&&form.companyPhone.$invalid" ng-bind="form.companyPhone.$error.required?'请填写单位电话':form.companyPhone.$error.maxlength?'请勿超过20个字符':'请填写正确的电话号码,用-隔开'"></div>
                     </div>
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>税务登记号:</label>
                         <div class="form-input-line">
-                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyTaxNum&&form.companyTaxNum.$error.required}" ng-model="bill.companyTaxNumber" ng-focus="form.companyTaxNum.$touched = false" ng-blur="form.companyTaxNum.$touched = true; initFlag.initCompanyTaxNum = false;" name="companyTaxNum" required="true" ng-maxlength="20" ng-minlength="15" ng-pattern="/^[0-9a-zA-Z]+$/" placeholder="请输入税务登记号">
+                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyTaxNum&&form.companyTaxNum.$error.required, 'bg-fff':!form.companyTaxNum.$invalid}" ng-model="bill.companyTaxNumber" ng-focus="form.companyTaxNum.$touched = false" ng-blur="form.companyTaxNum.$touched = true; initFlag.initCompanyTaxNum = false;" name="companyTaxNum" required="true" ng-maxlength="20" ng-minlength="15" ng-pattern="/^[0-9a-zA-Z]+$/" placeholder="请输入税务登记号">
                         </div>
                         <div class="text-inverse error col-md-3" ng-show="form.companyTaxNum.$touched&&(form.companyTaxNum.$invalid)" ng-bind="form.companyTaxNum.$error.required?'请填写税务登记号':'请填写15-20位数字或字母'"></div>
                     </div>
@@ -589,8 +600,8 @@
                     <div class="form-group">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>联系电话:</label>
                         <div class="form-input-line">
-                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initTelephone&&form.billTel.$error.required}" ng-model="bill.telephone" ng-focus="form.billTel.$touched = false" ng-blur="form.billTel.$touched = true; initFlag.initTelephone=false;" name="billTel"
-                                   ng-pattern="/^[0-9]*$/" ng-maxlength="11" ng-minlength="8" required="required" placeholder="请输入联系电话">
+                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initTelephone&&form.billTel.$error.required, 'bg-fff':!form.billTel.$invalid||!form.billTel.$touched}" ng-model="bill.telephone" ng-focus="form.billTel.$touched = false" ng-blur="form.billTel.$touched = true; initFlag.initTelephone=false;" name="billTel"
+                                   ng-pattern="/^[0-9]*$/" ng-minlength="8" ng-maxlength="11" required="required" placeholder="请输入联系电话">
                         </div>
                         <div class="text-inverse error col-md-3" ng-show="form.billTel.$touched&&form.billTel.$invalid" ng-bind="form.billTel.$error.required?'请填写联系电话':'请输入8-11位数字'"></div>
                     </div>

+ 1 - 1
src/main/webapp/resources/view/usercenter/forstore/order_pay.html

@@ -639,7 +639,7 @@
 				<p><em>发票类型:</em><span ng-bind="order.invoicetype | billTypeFilter "></span></p>
 				<p><em>收票人:</em><span ng-bind="bill.name || '空'"></span></p>
 				<p><em>收票人电话:</em><span ng-bind="bill.telephone || '空'"></span></p>
-				<p><em>座机:</em><span ng-bind="bill.landlineNumber || '空'"></span></p>
+				<p><em>座机:</em><span ng-bind="bill.companyPhone || '空'"></span></p>
 				<p><em>收票人地址:</em><span>{{bill.area}}, {{bill.detailAddress}}</span></p>
 				<p ng-if="order.invoicetype == '1205'"><em>公司地址:</em><span ng-bind="bill.companyAddress || '空'"></span></p>
 				<p ng-if="order.invoicetype == '1205'"><em>税务登记号:</em><span ng-bind="bill.companyTaxNumber || '空'"></span></p>