|
|
@@ -12120,13 +12120,37 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
|
|
|
$scope.submit = function(tender) {
|
|
|
- PurcTender.decide(tender, function(){
|
|
|
- toaster.pop('success', '确认成功');
|
|
|
-
|
|
|
- window.location.hash = '#/purc/tender';
|
|
|
- }, function(response){
|
|
|
- toaster.pop('error', '确认失败', response.data);
|
|
|
+ var canSubmit = true;
|
|
|
+ var hasPrice = false;
|
|
|
+ var hasDecide = false;
|
|
|
+ angular.forEach(tender.purchaseTenderProds, function(tenderProd) {
|
|
|
+ angular.forEach(tenderProd.saleTenderItems, function(saleTenderItem) {
|
|
|
+ if (saleTenderItem.price) { // 只要存在报价的行,就需要对其中一个定标
|
|
|
+ hasPrice = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (hasPrice) {
|
|
|
+ angular.forEach(tenderProd.saleTenderItems, function(saleTenderItem) {
|
|
|
+ if (saleTenderItem.applyStatus) { // 只要有一行定标,就可以投标
|
|
|
+ hasDecide = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (!hasDecide) {
|
|
|
+ canSubmit = false;
|
|
|
+ }
|
|
|
});
|
|
|
+ if (!canSubmit) {
|
|
|
+ toaster.pop('info', '提示', '您还有已投标未选定的产品!');
|
|
|
+ } else {
|
|
|
+ PurcTender.decide(tender, function(){
|
|
|
+ toaster.pop('success', '确认成功');
|
|
|
+
|
|
|
+ window.location.hash = '#/purc/tender';
|
|
|
+ }, function(response){
|
|
|
+ toaster.pop('error', '确认失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}]);
|