hulh 8 лет назад
Родитель
Сommit
6303b3bdbd

+ 0 - 11
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_add_ctrl.js

@@ -308,17 +308,6 @@ define([ 'app/app' ], function(app) {
             $scope.mapArray.splice(index, 1);
         };
 
-        $scope.containsArea = function (value) {
-            var k = false;
-            for(const i in $scope.qtyAreaArray) {
-                var p = $scope.qtyAreaArray[i];
-                if (value == p)  {
-                    k = true; break;
-                }
-            }
-            return k;
-        };
-
         /**
          * 将本地地址数据转化为可用的结构
          * @param item

+ 24 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js

@@ -54,6 +54,21 @@ define([ 'app/app' ], function(app) {
                 $scope.isModify = true;
                 $scope.isActive = $scope.modifyRule.active == 1;
                 $scope.fareArray = angular.fromJson($scope.modifyRule.fares);
+                if (!$scope.fareArray){
+                    $scope.fareArray = [];
+                    var firstFare = {
+                        start : 0,
+                        end : "",
+                        fare : ""
+                    };
+                    var secondFare = {
+                        start : "",
+                        end : 100000,
+                        fare : ""
+                    };
+                    $scope.fareArray.push(firstFare);
+                    $scope.fareArray.push(secondFare);
+                }
                 if ($scope.modifyRule.orderType){
                     var orderTypeArray = $scope.modifyRule.orderType.split("-");
                     $scope.orderType = {
@@ -76,6 +91,10 @@ define([ 'app/app' ], function(app) {
                     var data = angular.fromJson($scope.modifyRule.areas);
                     $scope.mapArray = data;
                 }
+                console.log($scope.mapArray);
+                if ($scope.mapArray.length == 0){
+
+                }
             }else {
                 $scope.isModify = false;
                 $scope.modifyRule = {};
@@ -258,7 +277,9 @@ define([ 'app/app' ], function(app) {
         };
 
         $scope.saveDistributionRule = function (isAdd) {
-            // $scope.checkRuleName();
+            if (!isAdd){
+                $scope.checkRuleName();
+            }
             if (!$scope.modifyRule.shippingMethod){
                 toaster.pop('error', "请选择配送方式");
                 return;
@@ -765,7 +786,8 @@ define([ 'app/app' ], function(app) {
                                                         var forth = {
                                                             mainland : v.label,
                                                             province : data.label,
-                                                            city : item.label
+                                                            city : item.label,
+                                                            area : m.label
                                                         };
                                                         addressArray.push(forth);
                                                     }

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

@@ -383,6 +383,7 @@
 												<ul ng-if="!address.folded">
 													<li ng-repeat="city in address.items">
 														<div style="width: 100%;">
+															<i ng-if="city.items" class="fa fa-fw" ng-class="city.folded?'fa-caret-right':'fa-caret-down'" ng-click="tree.toggleFold(city)"></i>
 															<span ng-bind="::city.label" ng-click="tree.toggleFold(city)"></span><em ng-if="city.selectedNum!=0 && city.selectedNum!=city.items.length"></span>({{city.selectedNum}})</em>
 															<div class="check-1">
 																<label class="check-act">