Browse Source

评论 :批量回复bug修改

wangdy 8 years ago
parent
commit
726f89bec4

+ 15 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/show_rate_ctrl.js

@@ -216,20 +216,31 @@ define(['app/app'], function(app) {
                     toaster.pop('error', '回复失败');
                     toaster.pop('error', '回复失败');
                 });
                 });
             } else if ($scope.rateType == "allRate") {
             } else if ($scope.rateType == "allRate") {
+                var count= 0 ;
                 if ($scope.order.status == 523){
                 if ($scope.order.status == 523){
                     angular.forEach($scope.buyerRateGoods,function (item,index) {
                     angular.forEach($scope.buyerRateGoods,function (item,index) {
-                        if (item.buyerRate == '此用户没有填写评价!'){
+                        if (item.buyerRate != '此用户没有填写评价!'){
                             if (!item.returnMeg || item.returnMeg =='' ){
                             if (!item.returnMeg || item.returnMeg =='' ){
                                 item.returnMeg = param.returnMeg;
                                 item.returnMeg = param.returnMeg;
-                            }
-                        }
+                            }else{count++;}
+                        }else{count++;}
                     })
                     })
+                    if (count == $scope.buyerRateGoods.length){
+                        $scope.setShowRateBoxFlag(false);
+                        toaster.pop('warning', '所有商品都已回复完成');
+                        return;
+                    }
                 }else if ($scope.order.status == 522){
                 }else if ($scope.order.status == 522){
                     angular.forEach($scope.buyerRateGoods,function (item,index) {
                     angular.forEach($scope.buyerRateGoods,function (item,index) {
                         if (item.buyerAfterRate && !item.afterReturnMeg){
                         if (item.buyerAfterRate && !item.afterReturnMeg){
                             item.afterReturnMeg = param.returnMeg;
                             item.afterReturnMeg = param.returnMeg;
-                        }
+                        }else {count++;}
                     })
                     })
+                    if (count == $scope.buyerRateGoods.length){
+                        $scope.setShowRateBoxFlag(false);
+                        toaster.pop('warning', '所有商品都已回复完成');
+                        return;
+                    }
                 }
                 }
                 Rate.saveAllReply({orderId: $scope.order.orderid},$scope.buyerRateGoods,function (data) {
                 Rate.saveAllReply({orderId: $scope.order.orderid},$scope.buyerRateGoods,function (data) {
                     toaster.pop('success', '批量回复成功');
                     toaster.pop('success', '批量回复成功');

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/showRate.html

@@ -505,7 +505,7 @@
             <span class="modal-btn cancel-modal" ng-click="setShowRateBoxFlag(false)" ng-show="boxStatus == 1 || boxStatus == 2">取消</span>
             <span class="modal-btn cancel-modal" ng-click="setShowRateBoxFlag(false)" ng-show="boxStatus == 1 || boxStatus == 2">取消</span>
             <span class="modal-btn cancel-modal" ng-click="setBoxStatus(1)" ng-show="boxStatus == 3 || boxStatus == 4">返回上一步</span>
             <span class="modal-btn cancel-modal" ng-click="setBoxStatus(1)" ng-show="boxStatus == 3 || boxStatus == 4">返回上一步</span>
             <span class="modal-btn submit-modal" ng-show="boxStatus == 3 || boxStatus == 4" ng-click="saveModal()">保存</span>
             <span class="modal-btn submit-modal" ng-show="boxStatus == 3 || boxStatus == 4" ng-click="saveModal()">保存</span>
-            <span class="modal-btn submit-modal" ng-show="boxStatus == 1 || boxStatus == 2" ng-click="submitRate()">提交</span>
+            <span ng-class="!modalTempData.rateContent || modalTempData.rateContent == ''?'modal-btn cancel-modal':'modal-btn submit-modal'" ng-show="boxStatus == 1 || boxStatus == 2" ng-click="!modalTempData.rateContent || modalTempData.rateContent == ''?'':submitRate()">提交</span>
         </div>
         </div>
     </div>
     </div>
 </div>
 </div>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_order.html

@@ -1153,7 +1153,7 @@
 					<span class="modal-btn cancel-modal" ng-click="setShowRateBoxFlag(false)" ng-show="boxStatus == 1 || boxStatus == 2">取消</span>
 					<span class="modal-btn cancel-modal" ng-click="setShowRateBoxFlag(false)" ng-show="boxStatus == 1 || boxStatus == 2">取消</span>
 					<span class="modal-btn cancel-modal" ng-click="setBoxStatus(1)" ng-show="boxStatus == 3 || boxStatus == 4">返回上一步</span>
 					<span class="modal-btn cancel-modal" ng-click="setBoxStatus(1)" ng-show="boxStatus == 3 || boxStatus == 4">返回上一步</span>
 					<span class="modal-btn submit-modal" ng-show="boxStatus == 3 || boxStatus == 4" ng-click="saveModal()">保存</span>
 					<span class="modal-btn submit-modal" ng-show="boxStatus == 3 || boxStatus == 4" ng-click="saveModal()">保存</span>
-					<span class="modal-btn submit-modal" ng-show="boxStatus == 1 || boxStatus == 2" ng-click="submitRate()">提交</span>
+					<span ng-class="!modalTempData.rateContent || modalTempData.rateContent == ''?'modal-btn cancel-modal':'modal-btn submit-modal'" ng-show="boxStatus == 1 || boxStatus == 2" ng-click="!modalTempData.rateContent || modalTempData.rateContent == ''?'':submitRate()">提交</span>
 				</div>
 				</div>
 			</div>
 			</div>
 		</div>
 		</div>