|
|
@@ -12848,9 +12848,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
$scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
$scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
|
|
|
@@ -12891,11 +12896,19 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
//计算采购单价
|
|
|
$scope.checkPrice = function(rate) {
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
if(rate == null) {
|
|
|
toaster.pop('info', '提示', '请先填入税率');
|
|
|
} else {
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
item.purcprice = item.unitprice * (1 + rate/100);
|
|
|
+ $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -12903,10 +12916,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.save = function() {
|
|
|
$scope.deOrder.entrystatus = '保存';
|
|
|
$scope.deOrder.totalamount = 0;
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
$scope.deOrder.totalpayament = 0;
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
$scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
@@ -12928,11 +12945,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 提交
|
|
|
$scope.submit = function() {
|
|
|
$scope.deOrder.entrystatus = '已提交';
|
|
|
- $scope.deOrder.totalpayament = 0;
|
|
|
$scope.deOrder.totalamount = 0;
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
$scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
@@ -13145,8 +13166,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
$scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
- $scope.deOrder.orderamount += item.amount * item.unitprice * (1 + $scope.rate.rate/100);
|
|
|
$scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
}, function(response) {
|
|
|
toaster.pop('error', '提示', response.data);
|
|
|
@@ -13197,7 +13218,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
$scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
$scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
- $scope.deOrder.orderamount += item.amount * item.unitprice * (1 + $scope.rate.rate/100);
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
|
|
|
}, function(){
|
|
|
@@ -13234,11 +13255,19 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
//计算采购单价
|
|
|
$scope.checkPrice = function(rate) {
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
+ $scope.deOrder.usdpayment = 0;
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
if(rate == null) {
|
|
|
toaster.pop('info', '提示', '请先填入税率');
|
|
|
} else {
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
item.purcprice = item.unitprice * (1 + rate/100);
|
|
|
+ $scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -13254,7 +13283,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
$scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
$scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
- $scope.deOrder.orderamount += item.amount * item.unitprice * (1 + $scope.rate.rate/100);
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
if($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
@@ -13284,7 +13313,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
$scope.deOrder.usdpayment += item.amount * item.unitprice;
|
|
|
$scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
- $scope.deOrder.orderamount += item.amount * item.unitprice * (1 + $scope.rate.rate/100);
|
|
|
+ $scope.deOrder.orderamount += item.amount * item.purcprice;
|
|
|
});
|
|
|
DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
if(data.id) {
|
|
|
@@ -15915,13 +15944,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
};
|
|
|
var getService = function() {
|
|
|
- return ProductAll;
|
|
|
+// return ProductAll;
|
|
|
+ return Products.getAllNewest;
|
|
|
};
|
|
|
|
|
|
$scope.tableParams = new ngTableParams({
|
|
|
page : 1,
|
|
|
count : 20,
|
|
|
sorting: {
|
|
|
+ standard: 'desc',
|
|
|
+ id: 'desc',
|
|
|
}
|
|
|
}, {
|
|
|
total : 0,
|
|
|
@@ -15931,7 +15963,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
var pageParams = params.url();
|
|
|
pageParams.keyword = $scope.keyword;
|
|
|
pageParams.searchFilter = $scope.searchFilter;
|
|
|
- getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
+ getService().call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
|
if(page) {
|
|
|
params.total(page.totalElement);
|