|
@@ -11905,6 +11905,29 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 查询上次的关键词记录
|
|
|
|
|
+ DeputyOrder.hisKeywords({}, function(data) {
|
|
|
|
|
+ $scope.deOrder.vendtel = data.vendtel;
|
|
|
|
|
+ $scope.deOrder.venduser = data.venduser;
|
|
|
|
|
+ $scope.deOrder.otherdata = data.otherdata;
|
|
|
|
|
+ $scope.deOrder.companyname = data.companyname;
|
|
|
|
|
+ $scope.deOrder.bankaccount = data.bankaccount;
|
|
|
|
|
+ $scope.deOrder.bankaddress = data.bankaddress;
|
|
|
|
|
+ $scope.deOrder.bankcode = data.bankcode;
|
|
|
|
|
+ $scope.deOrder.bankname = data.bankname;
|
|
|
|
|
+ $scope.deOrder.legalrepresent = data.legalrepresent;
|
|
|
|
|
+ $scope.deOrder.tervendaddress = data.tervendaddress;
|
|
|
|
|
+ }, function(response) {
|
|
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 查询历史供应商
|
|
|
|
|
+ DeputyOrder.hisvendors({}, function(data) {
|
|
|
|
|
+ $scope.hisvendors = data;
|
|
|
|
|
+ }, function(response) {
|
|
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
//增加商品
|
|
//增加商品
|
|
|
$scope.add = function(index) {
|
|
$scope.add = function(index) {
|
|
|
if($scope.deOrder.deputyOrderItems[index].prodcode == null) {
|
|
if($scope.deOrder.deputyOrderItems[index].prodcode == null) {
|
|
@@ -12163,6 +12186,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
};
|
|
|
loadData();
|
|
loadData();
|
|
|
|
|
|
|
|
|
|
+ // 查询历史供应商
|
|
|
|
|
+ DeputyOrder.hisvendors({}, function(data) {
|
|
|
|
|
+ $scope.hisvendors = data;
|
|
|
|
|
+ }, function(response) {
|
|
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// 代采企业列表
|
|
// 代采企业列表
|
|
|
DeputyOrder.deputyEnterprise({}, function(data) {
|
|
DeputyOrder.deputyEnterprise({}, function(data) {
|
|
|
$scope.deputyEnterprises = data;
|
|
$scope.deputyEnterprises = data;
|
|
@@ -12258,6 +12288,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
|
|
+ $scope.deOrder.orderamount = 0;
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
$scope.deOrder.usdpayment += 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.orderamount += item.amount * item.unitprice * (1 + $scope.rate.rate/100);
|
|
@@ -12300,6 +12332,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.save = function() {
|
|
$scope.save = function() {
|
|
|
$scope.deOrder.entrystatus = '保存';
|
|
$scope.deOrder.entrystatus = '保存';
|
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
angular.forEach($scope.deOrder.deputyOrderItems, function(item) {
|
|
|
|
|
+ $scope.deOrder.totalamount = 0;
|
|
|
|
|
+ $scope.deOrder.totalpayament = 0;
|
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
$scope.deOrder.totalamount += item.amount * item.unitprice;
|
|
|
$scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
$scope.deOrder.totalpayament += item.amount * item.unitprice;
|
|
|
});
|
|
});
|
|
@@ -12309,7 +12343,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
|
|
|
if(data.id) {
|
|
if(data.id) {
|
|
|
toaster.pop('success', '提示', '保存成功');
|
|
toaster.pop('success', '提示', '保存成功');
|
|
|
- window.location.reload();
|
|
|
|
|
|
|
+ loadData();
|
|
|
}
|
|
}
|
|
|
if(data.error) {
|
|
if(data.error) {
|
|
|
toaster.pop('error', '提示', '保存失败');
|
|
toaster.pop('error', '提示', '保存失败');
|