|
|
@@ -108,20 +108,19 @@ define([ 'app/app' ], function(app) {
|
|
|
};
|
|
|
Enterprise.getCurrencyByRegisterAddress({}, {} ,function (data) {
|
|
|
if (data){
|
|
|
- $scope.modifyRule.currencyName = data.data;
|
|
|
+ /**
|
|
|
+ * 目前存在没有注册地址的公司,暂时设为RMB
|
|
|
+ */
|
|
|
+ $scope.modifyRule.currencyName = data.data ? data.data : 'RMB';
|
|
|
}
|
|
|
}, function (error) {
|
|
|
toaster.pop('error', "获取企业币别信息失败");
|
|
|
});
|
|
|
|
|
|
- /**
|
|
|
- * 目前存在没有注册地址的公司,暂时设为RMB
|
|
|
- */
|
|
|
- if (!$scope.modifyRule.currencyName){
|
|
|
- $scope.modifyRule.currencyName = 'RMB';
|
|
|
- }
|
|
|
$scope.currencySymbol = $scope.modifyRule.currencyName == "RMB" ? "¥" : "$";
|
|
|
|
|
|
+ console.log($scope.currencySymbol);
|
|
|
+
|
|
|
DistributionRule.findCountOfRule({}, {}, function (data) {
|
|
|
if (data){
|
|
|
var num = data.data;
|
|
|
@@ -155,12 +154,12 @@ define([ 'app/app' ], function(app) {
|
|
|
|
|
|
$scope.inputNum = function (data) {
|
|
|
if(isNaN(data.num)){
|
|
|
- data.num = 1;
|
|
|
+ data.num = null;
|
|
|
toaster.pop('warning', '提示', '请输入大于0的整数');
|
|
|
return false;
|
|
|
}
|
|
|
- if(Number(data.num) < 0 || Number(data.num) % 1 != 0) {
|
|
|
- data.num = 1;
|
|
|
+ if(Number(data.num) < 1 || Number(data.num) % 1 != 0) {
|
|
|
+ data.num = null;
|
|
|
toaster.pop('warning', '提示', '请输入大于0的整数');
|
|
|
return false;
|
|
|
}
|
|
|
@@ -356,22 +355,7 @@ define([ 'app/app' ], function(app) {
|
|
|
return false;
|
|
|
}
|
|
|
if ($scope.mapArray.length > 0){
|
|
|
- var resultArray = angular.copy($scope.mapArray);
|
|
|
- angular.forEach($scope.mapArray, 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);
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ var resultArray = convertArray($scope.mapArray);
|
|
|
$scope.modifyRule.qtyArea = angular.toJson(resultArray);
|
|
|
}else {
|
|
|
toaster.pop('error', "您还没有选择任何地区");
|
|
|
@@ -475,9 +459,10 @@ define([ 'app/app' ], function(app) {
|
|
|
|
|
|
var convertArray = function (array) {
|
|
|
var resultArray = angular.copy(array);
|
|
|
+ var indexArray = [];
|
|
|
angular.forEach(array, function (item, index) {
|
|
|
if (item.mainland && !item.province){
|
|
|
- resultArray.splice(index, 1);
|
|
|
+ indexArray.push(index);
|
|
|
angular.forEach($scope.tree.$data, function (v) {
|
|
|
if (v.label == item.mainland){
|
|
|
angular.forEach(v.items, function (p) {
|
|
|
@@ -490,6 +475,9 @@ define([ 'app/app' ], function(app) {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ angular.forEach(indexArray, function (index) {
|
|
|
+ resultArray.splice(index, 1);
|
|
|
+ });
|
|
|
return resultArray;
|
|
|
};
|
|
|
|