Browse Source

pref: 处理图片更换后保存问题

wangcz 6 years ago
parent
commit
539815d96e

+ 10 - 1
src/main/webapp/resources/js/admin/controllers/StoreQualificationCtrl.js

@@ -74,7 +74,6 @@ define([ 'app/app' ], function(app) {
                 toaster.pop('error', '上传营业执照失败');
                 return ;
             }
-            $scope.newImg.resourceUrl = $data.path;
             $scope.qualifications[$scope.qType.businessLicense].resourceUrl = $data.path;
             $scope.newImg.type = type;
         };
@@ -83,6 +82,8 @@ define([ 'app/app' ], function(app) {
             $scope.editImg = false;
         	if(!type) {
                 $scope.qualifications[$scope.qType.businessLicense].resourceUrl = $scope.resourceNodUrl;
+			} else {
+                $scope.newImg.resourceUrl = $scope.qualifications[$scope.qType.businessLicense].resourceUrl;
 			}
 		}
 
@@ -385,6 +386,10 @@ define([ 'app/app' ], function(app) {
 		 * @param isPass		是否通过审核
 		 */
 		function audit(isPass) {
+			if ($scope.editImg) {
+                toaster.pop('info', '提示', '请先保存或取消修改图片!');
+                return
+			};
 
 			// 如果审核通过,验证企业信息
 			if (isPass) {
@@ -453,6 +458,10 @@ define([ 'app/app' ], function(app) {
 		 * 审核未通过开铺申请
 		 */
 		function auditUnpass() {
+            if ($scope.editImg) {
+                toaster.pop('info', '提示', '请先保存或取消修改图片!');
+                return
+            };
 			openReasonModal().then(function (reason) {
 				$scope.reason = reason;
 				$scope.audit(false);