|
@@ -17216,11 +17216,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行订单单价未填写');
|
|
toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行订单单价未填写');
|
|
|
} else {
|
|
} else {
|
|
|
$scope.checkresult = true;
|
|
$scope.checkresult = true;
|
|
|
- if ($scope.deOrder.entrystatus == '保存') {
|
|
|
|
|
- $scope.isSave = true;
|
|
|
|
|
- } else if ($scope.deOrder.entrystatus == '已提交') {
|
|
|
|
|
- $scope.isSubmit = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $scope.isSave = true;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|
|
@@ -17228,42 +17224,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
|
|
// 保存
|
|
// 保存
|
|
|
$scope.isSave = false;
|
|
$scope.isSave = false;
|
|
|
- $scope.save = function () {
|
|
|
|
|
- $scope.deOrder.entrystatus = '保存';
|
|
|
|
|
- checkKeyword();
|
|
|
|
|
- if ($scope.checkresult) {
|
|
|
|
|
- $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 += DecimalNumber.accMul(item.amount, item.unitprice);
|
|
|
|
|
- $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
|
|
|
|
|
- $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
|
|
|
|
|
- $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
|
|
|
|
|
- });
|
|
|
|
|
- if ($scope.deOrder.deputyOrderItems[0].prodcode == null) {
|
|
|
|
|
- toaster.pop('info', '提示', '您还未填写任何商品信息');
|
|
|
|
|
- } else {
|
|
|
|
|
- DeputyOrder.saveDeOrder({}, $scope.deOrder, function (data) {
|
|
|
|
|
- if (data.id) {
|
|
|
|
|
- toaster.pop('success', '提示', '保存成功');
|
|
|
|
|
- window.location.hash = "#/purc/deputy/" + data.id;
|
|
|
|
|
- }
|
|
|
|
|
- if (data.error) {
|
|
|
|
|
- toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
- }
|
|
|
|
|
- }, function (response) {
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 提交
|
|
|
|
|
- $scope.isSubmit = false;
|
|
|
|
|
- $scope.submit = function () {
|
|
|
|
|
- $scope.deOrder.entrystatus = '已提交';
|
|
|
|
|
|
|
+ $scope.save = function (status) {
|
|
|
|
|
+ $scope.deOrder.entrystatus = status;
|
|
|
checkKeyword();
|
|
checkKeyword();
|
|
|
if ($scope.checkresult) {
|
|
if ($scope.checkresult) {
|
|
|
$scope.deOrder.totalamount = 0;
|
|
$scope.deOrder.totalamount = 0;
|
|
@@ -17281,11 +17243,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
} else {
|
|
} else {
|
|
|
DeputyOrder.saveDeOrder({}, $scope.deOrder, function (data) {
|
|
DeputyOrder.saveDeOrder({}, $scope.deOrder, function (data) {
|
|
|
if (data.id) {
|
|
if (data.id) {
|
|
|
- toaster.pop('success', '提示', '提交成功');
|
|
|
|
|
|
|
+ toaster.pop('success', '提示', status + '成功');
|
|
|
window.location.hash = "#/purc/deputy/" + data.id;
|
|
window.location.hash = "#/purc/deputy/" + data.id;
|
|
|
}
|
|
}
|
|
|
if (data.error) {
|
|
if (data.error) {
|
|
|
- toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
|
|
+ toaster.pop('error', '提示', status + '失败');
|
|
|
}
|
|
}
|
|
|
}, function (response) {
|
|
}, function (response) {
|
|
|
|
|
|
|
@@ -17716,11 +17678,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行订单单价未填写');
|
|
toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行订单单价未填写');
|
|
|
} else {
|
|
} else {
|
|
|
$scope.checkresult = true;
|
|
$scope.checkresult = true;
|
|
|
- if ($scope.deOrder.entrystatus == '保存') {
|
|
|
|
|
- $scope.isSave = true;
|
|
|
|
|
- } else if ($scope.deOrder.entrystatus == '已提交') {
|
|
|
|
|
- $scope.isSubmit = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $scope.isSave = true;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -17728,7 +17686,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
|
|
// 保存
|
|
// 保存
|
|
|
$scope.isSave = false;
|
|
$scope.isSave = false;
|
|
|
- $scope.save = function () {
|
|
|
|
|
|
|
+ $scope.save = function (status) {
|
|
|
|
|
+ $scope.deOrder.entrystatus = status;
|
|
|
checkKeyword();
|
|
checkKeyword();
|
|
|
if ($scope.checkresult) {
|
|
if ($scope.checkresult) {
|
|
|
$scope.deOrder.totalamount = 0;
|
|
$scope.deOrder.totalamount = 0;
|
|
@@ -17760,36 +17719,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 提交
|
|
|
|
|
- $scope.isSubmit = false;
|
|
|
|
|
- $scope.submit = function () {
|
|
|
|
|
- checkKeyword();
|
|
|
|
|
- if ($scope.checkresult) {
|
|
|
|
|
- $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 += DecimalNumber.accMul(item.amount, item.unitprice);
|
|
|
|
|
- $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
|
|
|
|
|
- $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
|
|
|
|
|
- $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
|
|
|
|
|
- });
|
|
|
|
|
- DeputyOrder.submitDeOrder({}, $scope.deOrder, function (data) {
|
|
|
|
|
- if (data.id) {
|
|
|
|
|
- toaster.pop('success', '提示', '提交成功');
|
|
|
|
|
- window.location.hash = "#/purc/deputy/" + data.id;
|
|
|
|
|
- window.location.reload();
|
|
|
|
|
- }
|
|
|
|
|
- if (data.error) {
|
|
|
|
|
- toaster.pop('error', '提示', '保存失败');
|
|
|
|
|
- }
|
|
|
|
|
- }, function (response) {
|
|
|
|
|
- toaster.pop('error', '保存失败', response.data);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
$scope.openDatePicker = function ($event, deOrder, openParam) {
|
|
$scope.openDatePicker = function ($event, deOrder, openParam) {
|
|
|
$event.preventDefault();
|
|
$event.preventDefault();
|
|
|
$event.stopPropagation();
|
|
$event.stopPropagation();
|