|
|
@@ -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);
|
|
|
}
|