|
|
@@ -382,7 +382,8 @@ define([ 'app/app' ], function(app) {
|
|
|
return false;
|
|
|
}
|
|
|
if ($scope.modifyRule.fareType == 1){
|
|
|
- if (!$scope.modifyRule.uniformPrice){
|
|
|
+ if (typeof($scope.modifyRule.uniformPrice) == 'undefined' ||
|
|
|
+ typeof($scope.modifyRule.uniformPrice) == 'string'){
|
|
|
toaster.pop('error', "请输入统一规定运费");
|
|
|
return false;
|
|
|
}
|
|
|
@@ -472,30 +473,32 @@ define([ 'app/app' ], function(app) {
|
|
|
$scope.modifyRule.fareType = t;
|
|
|
};
|
|
|
|
|
|
+ var convertArray = function (array) {
|
|
|
+ var resultArray = angular.copy(array);
|
|
|
+ angular.forEach(array, function (item, index) {
|
|
|
+ if (item.mainland && !item.province){
|
|
|
+ resultArray.splice(index, 1);
|
|
|
+ angular.forEach($scope.tree.$data, function (v) {
|
|
|
+ if (v.label == item.mainland){
|
|
|
+ angular.forEach(v.items, function (p) {
|
|
|
+ var object = {
|
|
|
+ province : p.label
|
|
|
+ };
|
|
|
+ resultArray.push(object);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return resultArray;
|
|
|
+ };
|
|
|
+
|
|
|
$scope.chooseBox = false;
|
|
|
$scope.cancel = function () {
|
|
|
$scope.resetData($scope.tree.$data);
|
|
|
if ($scope.mapArray.length > 0){
|
|
|
- var resultArray = [];
|
|
|
- angular.forEach($scope.mapArray, function (item) {
|
|
|
- if (item.mainland && !item.province){
|
|
|
- angular.forEach($scope.tree.$data, function (v) {
|
|
|
- if (v.label == item.mainland){
|
|
|
- angular.forEach(v.items, function (p) {
|
|
|
- var object = {
|
|
|
- province : p.label
|
|
|
- };
|
|
|
- resultArray.push(object);
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- if (resultArray.length == 0){
|
|
|
- $scope.tree.newInitData($scope.mapArray);
|
|
|
- }else {
|
|
|
- $scope.tree.newInitData(resultArray);
|
|
|
- }
|
|
|
+ var resultArray = convertArray($scope.mapArray);
|
|
|
+ $scope.tree.newInitData(resultArray);
|
|
|
}
|
|
|
$scope.chooseBox = false;
|
|
|
};
|
|
|
@@ -533,6 +536,11 @@ define([ 'app/app' ], function(app) {
|
|
|
|
|
|
$scope.deleteMapItem = function (index) {
|
|
|
$scope.mapArray.splice(index, 1);
|
|
|
+ $scope.resetData($scope.tree.$data);
|
|
|
+ if ($scope.mapArray.length > 0){
|
|
|
+ var resultArray = convertArray($scope.mapArray);
|
|
|
+ $scope.tree.newInitData(resultArray);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
/**
|