|
@@ -1363,27 +1363,27 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.dateTime = new Date();
|
|
$scope.dateTime = new Date();
|
|
|
}]);
|
|
}]);
|
|
|
app.controller('TenderCtrl', ['$scope', 'SnapshotService', function($scope, SnapshotService){
|
|
app.controller('TenderCtrl', ['$scope', 'SnapshotService', function($scope, SnapshotService){
|
|
|
- SnapshotService.getTender(250, function(data){
|
|
|
|
|
- $scope.tenders = data;
|
|
|
|
|
- console.log(data);
|
|
|
|
|
- var newDate = new Date();
|
|
|
|
|
- newDate = newDate.setDate(newDate.getDate() - 3);
|
|
|
|
|
- angular.forEach($scope.tenders, function(tender) {
|
|
|
|
|
- if (tender.date > newDate) {
|
|
|
|
|
- tender.isNew = true;
|
|
|
|
|
- } else {
|
|
|
|
|
- tender.isNew = false;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // SnapshotService.getTender(250, function(data){
|
|
|
|
|
+ // $scope.tenders = data;
|
|
|
|
|
+ // console.log(data);
|
|
|
|
|
+ // var newDate = new Date();
|
|
|
|
|
+ // newDate = newDate.setDate(newDate.getDate() - 3);
|
|
|
|
|
+ // angular.forEach($scope.tenders, function(tender) {
|
|
|
|
|
+ // if (tender.date > newDate) {
|
|
|
|
|
+ // tender.isNew = true;
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // tender.isNew = false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // });
|
|
|
|
|
|
|
|
- SnapshotService.getOpenTender(250, function(data){
|
|
|
|
|
|
|
+ SnapshotService.getOpenTender(function(data){
|
|
|
$scope.openTenders = data;
|
|
$scope.openTenders = data;
|
|
|
var newDate = new Date();
|
|
var newDate = new Date();
|
|
|
console.log(data);
|
|
console.log(data);
|
|
|
- newDate = newDate.setDate(newDate.getDate() - 3);
|
|
|
|
|
|
|
+ newDate = newDate.getTime() - 3*24*60*60*1000;
|
|
|
angular.forEach($scope.openTenders, function(tender) {
|
|
angular.forEach($scope.openTenders, function(tender) {
|
|
|
- if (tender.date > newDate) {
|
|
|
|
|
|
|
+ if (tender.date - newDate > 0) {
|
|
|
tender.isNew = true;
|
|
tender.isNew = true;
|
|
|
} else {
|
|
} else {
|
|
|
tender.isNew = false;
|
|
tender.isNew = false;
|
|
@@ -1872,7 +1872,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
fn = 'getPurcWaiting';break;
|
|
fn = 'getPurcWaiting';break;
|
|
|
}
|
|
}
|
|
|
return fn;
|
|
return fn;
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
$scope.tableParams = new ngTableParams({ // ng-Table参数
|
|
$scope.tableParams = new ngTableParams({ // ng-Table参数
|
|
|
page : 1,
|
|
page : 1,
|
|
@@ -10637,6 +10637,24 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
app.controller('PurcTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope) {
|
|
app.controller('PurcTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope) {
|
|
|
BaseService.scrollBackToTop();
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.active = 'done';
|
|
$scope.active = 'done';
|
|
|
|
|
+ $scope.dateZoneText = '不限';
|
|
|
|
|
+ $scope.deliveryZoneText = '不限';
|
|
|
|
|
+ $scope.condition = {dateZone: -1, deliveryZone: -1};
|
|
|
|
|
+ $scope.changeDateZone = function(zone) {
|
|
|
|
|
+ $scope.condition.dateZone = zone;
|
|
|
|
|
+ $scope.dateZoneText = typeof zone == 'undefined' ? '半年前' : (zone == -1 ? '不限' : (zone == 1 ? '一个月内' : '半年内'));
|
|
|
|
|
+ $scope.condition.$dateZoneOpen = false;
|
|
|
|
|
+ getDateCondition(zone, $scope.condition);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.changeDeliveryZone = function(zone) {
|
|
|
|
|
+ $scope.condition.deliveryZoneText = zone;
|
|
|
|
|
+ $scope.deliveryZoneText = typeof zone == 'undefined' ? '不限' : (zone == -1 ? '不限' : (zone == 1 ? '一个月内' : '两个月内'));
|
|
|
|
|
+ $scope.condition.$delievryZoneOpen = false;
|
|
|
|
|
+ getDelveryCondition(zone, $scope.condition);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
$scope.setActive = function(state) {
|
|
$scope.setActive = function(state) {
|
|
|
if($scope.active != state) {
|
|
if($scope.active != state) {
|
|
|
$scope.active = state;
|
|
$scope.active = state;
|
|
@@ -10678,9 +10696,9 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
var pageParams = params.url();
|
|
var pageParams = params.url();
|
|
|
var realActive = {};
|
|
var realActive = {};
|
|
|
pageParams.searchFilter = { // 筛选条件
|
|
pageParams.searchFilter = { // 筛选条件
|
|
|
- keyword: $scope.keyword
|
|
|
|
|
- // fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
|
|
- // endDate: getDateTime($scope.condition.dateTo)
|
|
|
|
|
|
|
+ keyword: $scope.keyword,
|
|
|
|
|
+ fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
|
|
+ endDate: getDateTime($scope.condition.dateTo)
|
|
|
};
|
|
};
|
|
|
PurcTender[getTenderStatus($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
PurcTender[getTenderStatus($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
@@ -10696,6 +10714,25 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.parseDate = function(dateStr) {
|
|
|
|
|
+ if(dateStr)
|
|
|
|
|
+ return Date.parse(dateStr, 'yyyy-MM-dd');
|
|
|
|
|
+ return new Date();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 选择查找日期
|
|
|
|
|
+ $scope.onDateCondition = function(){
|
|
|
|
|
+ $scope.tableParams.page(1);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 搜索框回车
|
|
// 搜索框回车
|
|
|
$scope.onSearch = function() {
|
|
$scope.onSearch = function() {
|
|
|
$scope.tableParams.page(1);
|
|
$scope.tableParams.page(1);
|
|
@@ -10719,10 +10756,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
|
|
|
|
|
|
// 获取收货地址列表
|
|
// 获取收货地址列表
|
|
|
- ShipAddress.shipAddList({}, function(data) {
|
|
|
|
|
- $scope.ships = data;
|
|
|
|
|
- $scope.tender.shipadd = $scope.ships[0];
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ var loadShipAddress = function() {
|
|
|
|
|
+ ShipAddress.shipAddList({}, function(data) {
|
|
|
|
|
+ $scope.ships = data;
|
|
|
|
|
+ $scope.tender.shipadd = $scope.ships[0];
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ loadShipAddress();
|
|
|
|
|
|
|
|
// 获取地址信息
|
|
// 获取地址信息
|
|
|
$http.get('resources/citydata/city.json', {"Accept": "application/json;charset=utf-8", "Accept-Charset":"charset=utf-8"
|
|
$http.get('resources/citydata/city.json', {"Accept": "application/json;charset=utf-8", "Accept-Charset":"charset=utf-8"
|
|
@@ -10736,10 +10776,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
ShipAddress.saveAddress( {}, ship, function(data) {
|
|
ShipAddress.saveAddress( {}, ship, function(data) {
|
|
|
if(data.success) {
|
|
if(data.success) {
|
|
|
// 获取收货地址列表
|
|
// 获取收货地址列表
|
|
|
- ShipAddress.shipAddList({}, function(data) {
|
|
|
|
|
- $scope.ships = data;
|
|
|
|
|
- $scope.tender.shipadd = $scope.ships[0];
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ loadShipAddress();
|
|
|
toaster.pop('success', '提示', data.success);
|
|
toaster.pop('success', '提示', data.success);
|
|
|
}
|
|
}
|
|
|
if(data.error) {
|
|
if(data.error) {
|
|
@@ -11629,13 +11666,52 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 客户指定招标
|
|
|
|
|
|
|
+ * 客户招标
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
app.controller('SaleTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', 'AccountEnterprise', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, AccountEnterprise) {
|
|
app.controller('SaleTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', 'AccountEnterprise', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, AccountEnterprise) {
|
|
|
BaseService.scrollBackToTop();
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.active = 'todo';
|
|
$scope.active = 'todo';
|
|
|
- $scope.condition = {dateZone: 1};
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 改变类型
|
|
|
|
|
+ */
|
|
|
|
|
+ var getTypeCondition = function(zone, condition) {
|
|
|
|
|
+ if(zone == -1) {
|
|
|
|
|
+ condition.ifOpen = null;
|
|
|
|
|
+ } else if(zone == 1) {
|
|
|
|
|
+ condition.ifOpen = 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ condition.ifOpen = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.dateZoneText = '不限';
|
|
|
|
|
+ $scope.typeText = '全部';
|
|
|
|
|
+ $scope.deliveryZoneText = '不限';
|
|
|
|
|
+ $scope.condition = {dateZone: -1, deliveryZone: -1, type: -1};
|
|
|
|
|
+ $scope.changeDateZone = function(zone) {
|
|
|
|
|
+ $scope.condition.dateZone = zone;
|
|
|
|
|
+ $scope.dateZoneText = typeof zone == 'undefined' ? '半年前' : (zone == -1 ? '不限' : (zone == 1 ? '一个月内' : '半年内'));
|
|
|
|
|
+ $scope.condition.$dateZoneOpen = false;
|
|
|
|
|
+ getDateCondition(zone, $scope.condition);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.changeDeliveryZone = function(zone) {
|
|
|
|
|
+ $scope.condition.deliveryZoneText = zone;
|
|
|
|
|
+ $scope.deliveryZoneText = typeof zone == 'undefined' ? '不限' : (zone == -1 ? '不限' : (zone == 1 ? '一个月内' : '两个月内'));
|
|
|
|
|
+ $scope.condition.$delievryZoneOpen = false;
|
|
|
|
|
+ getDelveryCondition(zone, $scope.condition);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.changeType = function(type) {
|
|
|
|
|
+ $scope.condition.type = type;
|
|
|
|
|
+ $scope.typeText = typeof type == 'undefined' ? '全部' : (type == -1 ? '全部' : (type == 1 ? '公开' : '指定'));
|
|
|
|
|
+ getTypeCondition(type, $scope.condition);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
$scope.setActive = function(state) {
|
|
$scope.setActive = function(state) {
|
|
|
if($scope.active != state) {
|
|
if($scope.active != state) {
|
|
|
$scope.active = state;
|
|
$scope.active = state;
|
|
@@ -11663,9 +11739,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
var pageParams = params.url();
|
|
var pageParams = params.url();
|
|
|
var realActive = {};
|
|
var realActive = {};
|
|
|
pageParams.searchFilter = { // 筛选条件
|
|
pageParams.searchFilter = { // 筛选条件
|
|
|
- keyword: $scope.keyword
|
|
|
|
|
- // fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
|
|
- // endDate: getDateTime($scope.condition.dateTo)
|
|
|
|
|
|
|
+ keyword: $scope.keyword,
|
|
|
|
|
+ pt_ifopen: $scope.condition.ifOpen,
|
|
|
|
|
+ fromDate: getDateTime($scope.condition.dateFrom),
|
|
|
|
|
+ endDate: getDateTime($scope.condition.dateTo)
|
|
|
};
|
|
};
|
|
|
AccountEnterprise.get({}, function(data){
|
|
AccountEnterprise.get({}, function(data){
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
@@ -11676,17 +11753,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
if(page) {
|
|
if(page) {
|
|
|
params.total(page.totalElement);
|
|
params.total(page.totalElement);
|
|
|
$defer.resolve(page.content);
|
|
$defer.resolve(page.content);
|
|
|
|
|
+ console.log(page.content);
|
|
|
// $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
// $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词 做导出时需要的字段
|
|
|
angular.forEach(page.content, function(purcTender) {
|
|
angular.forEach(page.content, function(purcTender) {
|
|
|
- angular.forEach(purcTender.purchaseTenderProds[0].saleTenderItems, function(saleTenderItem) {
|
|
|
|
|
- saleTenderItem.saleTender.vendorHasBid = false; // 未投标
|
|
|
|
|
- if ($scope.currentEn.uu === saleTenderItem.saleTender.vendUU && saleTenderItem.price !== null) { // 存在本企业投标明细,且价格已填,判定为已投标
|
|
|
|
|
- saleTenderItem.saleTender.vendorHasBid = true; // 已投标
|
|
|
|
|
- saleTenderItem.saleTender.applyVendor = false; // 未中标
|
|
|
|
|
- if (saleTenderItem.applyStatus === 1) {
|
|
|
|
|
- saleTenderItem.saleTender.applyVendor = true; // 是否中标
|
|
|
|
|
|
|
+ angular.forEach(purcTender.purchaseTenderProds, function(tenderProd) {
|
|
|
|
|
+ angular.forEach(tenderProd.saleTenderItems, function(saleTenderItem) {
|
|
|
|
|
+ if ($scope.currentEn.uu === saleTenderItem.saleTender.vendUU) {
|
|
|
|
|
+ tenderProd.currentItem = saleTenderItem;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -11697,25 +11772,25 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- var stautsItem = [];
|
|
|
|
|
- $scope.getTenderStatus = function (tender) {
|
|
|
|
|
- angular.forEach(tender.purchaseTenderItems, function(thisItem){
|
|
|
|
|
- if ($scope.currentEn.uu == thisItem.enterpriseBaseInfo.uu) {
|
|
|
|
|
- stautsItem = thisItem;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- if (!stautsItem.price) {
|
|
|
|
|
- return "daitoubiao";
|
|
|
|
|
- } else if (!stautsItem.applystatus) {
|
|
|
|
|
- return "yitoubiao";
|
|
|
|
|
- } else if (stautsItem.applystatus == 1) {
|
|
|
|
|
- return "zhongbiao";
|
|
|
|
|
- } else if (stautsItem.applystatus == 0) {
|
|
|
|
|
- return "weizhongbiao";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ $event.preventDefault();
|
|
|
|
|
+ $event.stopPropagation();
|
|
|
|
|
+ item[openParam] = !item[openParam];
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.parseDate = function(dateStr) {
|
|
|
|
|
+ if(dateStr)
|
|
|
|
|
+ return Date.parse(dateStr, 'yyyy-MM-dd');
|
|
|
|
|
+ return new Date();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ // 选择查找日期
|
|
|
|
|
+ $scope.onDateCondition = function(){
|
|
|
|
|
+ $scope.tableParams.page(1);
|
|
|
|
|
+ $scope.tableParams.reload();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 搜索框回车
|
|
// 搜索框回车
|
|
|
$scope.onSearch = function() {
|
|
$scope.onSearch = function() {
|
|
|
$scope.tableParams.page(1);
|
|
$scope.tableParams.page(1);
|
|
@@ -11798,7 +11873,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$scope.toDetail = function(id) {
|
|
$scope.toDetail = function(id) {
|
|
|
- window.location.hash = '#/sale/openTenderDetail/' + id;
|
|
|
|
|
|
|
+ window.location.hash = '#/baseInfo/openTenderDetail/' + id;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// var stautsItem = [];
|
|
// var stautsItem = [];
|
|
@@ -11958,8 +12033,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
if (regex.test(value) && value !== 0) {
|
|
if (regex.test(value) && value !== 0) {
|
|
|
priceYes = true;
|
|
priceYes = true;
|
|
|
} else {
|
|
} else {
|
|
|
- if (!(value instanceof Number) || value) {
|
|
|
|
|
- toaster.pop('warning', '警告', '单价不合法,请重新填写');
|
|
|
|
|
|
|
+ if (value) {
|
|
|
|
|
+ toaster.pop('warning', '警告', '请确认单价是否填写正确');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
@@ -11984,7 +12059,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
// /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
// /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
// 判断填写过的有为0或不符合正则式的,设置不能保存
|
|
// 判断填写过的有为0或不符合正则式的,设置不能保存
|
|
|
console.log(tenderProd.currentItem.cycle);
|
|
console.log(tenderProd.currentItem.cycle);
|
|
|
- if (tenderProd.currentItem.cycle !== null && (!cycleRegex.test(tenderProd.currentItem.cycle)) || (tenderProd.currentItem.taxrate !== null && !taxrateRegex.test(tenderProd.currentItem.taxrate)) || (tenderProd.currentItem.price !== null && (!priceRegex.test(tenderProd.currentItem.price) && tenderProd.currentItem.price !== 0))) {
|
|
|
|
|
|
|
+ if (!cycleRegex.test(tenderProd.currentItem.cycle) || !taxrateRegex.test(tenderProd.currentItem.taxrate) || !priceRegex.test(tenderProd.currentItem.price) && (tenderProd.currentItem.cycle !== null && tenderProd.currentItem.taxrate !== null && tenderProd.currentItem.price !== null)) {
|
|
|
$scope.canSave = false;
|
|
$scope.canSave = false;
|
|
|
} else {
|
|
} else {
|
|
|
$scope.canSave = true;
|
|
$scope.canSave = true;
|
|
@@ -11999,20 +12074,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
currentEnBaseInfo.enEstablishDate = currentEnBaseInfo.enEstablishDate.getTime();
|
|
currentEnBaseInfo.enEstablishDate = currentEnBaseInfo.enEstablishDate.getTime();
|
|
|
}
|
|
}
|
|
|
var saleTenderItems = [];
|
|
var saleTenderItems = [];
|
|
|
- if (tender.ifOpen !== 1) { // 指定投标不把投标单主表设空会报header超长
|
|
|
|
|
angular.forEach(tender.purchaseTenderProds, function(tenderProd) {
|
|
angular.forEach(tender.purchaseTenderProds, function(tenderProd) {
|
|
|
if (tenderProd.currentItem) {
|
|
if (tenderProd.currentItem) {
|
|
|
tenderProd.currentItem.saleTender = {};
|
|
tenderProd.currentItem.saleTender = {};
|
|
|
saleTenderItems.push(tenderProd.currentItem);
|
|
saleTenderItems.push(tenderProd.currentItem);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- } else {
|
|
|
|
|
- angular.forEach(tender.purchaseTenderProds, function(tenderProd) {
|
|
|
|
|
- if (tenderProd.currentItem) {
|
|
|
|
|
- saleTenderItems.push(tenderProd.currentItem);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
PurcTender.reply({tenderItems: saleTenderItems, enBaseInfo: currentEnBaseInfo, attaches:$scope.attaches}, {}, function(data){
|
|
PurcTender.reply({tenderItems: saleTenderItems, enBaseInfo: currentEnBaseInfo, attaches:$scope.attaches}, {}, function(data){
|
|
|
$scope.loading = false;
|
|
$scope.loading = false;
|
|
|
toaster.pop('info', '成功', '投标成功');
|
|
toaster.pop('info', '成功', '投标成功');
|
|
@@ -12055,12 +12122,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
for(var t = Date.now();Date.now() - t <= d;);
|
|
for(var t = Date.now();Date.now() - t <= d;);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- AccountEnterprise.get({}, function(data){
|
|
|
|
|
- $scope.currentEn = data;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ var getCurrentEn = function() {
|
|
|
|
|
+ AccountEnterprise.get({}, function(data){
|
|
|
|
|
+ $scope.currentEn = data;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if( ! angular.isUndefined($stateParams.id)) { // 获取招标单详情
|
|
if( ! angular.isUndefined($stateParams.id)) { // 获取招标单详情
|
|
|
$scope.loading = true;
|
|
$scope.loading = true;
|
|
|
|
|
+ getCurrentEn();
|
|
|
PurcTender.getOne({id: $stateParams.id}, function(data){
|
|
PurcTender.getOne({id: $stateParams.id}, function(data){
|
|
|
data.$editing = false;
|
|
data.$editing = false;
|
|
|
$scope.tender = data;
|
|
$scope.tender = data;
|
|
@@ -12085,8 +12155,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ $scope.hasClick = false;
|
|
|
$scope.iWantToBid = function(id) {
|
|
$scope.iWantToBid = function(id) {
|
|
|
- PurcTender.addItems({id: id}, function(data){ // 添加明细
|
|
|
|
|
|
|
+ $scope.hasClick = true;
|
|
|
|
|
+ PurcTender.addItems({id: id}, {}, function(data){ // 添加明细
|
|
|
// $scope.tender = data;
|
|
// $scope.tender = data;
|
|
|
// angular.forEach(data.purchaseTenderProds, function(tenderProd) {
|
|
// angular.forEach(data.purchaseTenderProds, function(tenderProd) {
|
|
|
// angular.forEach(tenderProd.saleTenderItems, function(saleTenderItem) {
|
|
// angular.forEach(tenderProd.saleTenderItems, function(saleTenderItem) {
|
|
@@ -12103,145 +12175,143 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
// }
|
|
// }
|
|
|
// });
|
|
// });
|
|
|
// });
|
|
// });
|
|
|
- if (data.success) {
|
|
|
|
|
- toaster.pop('success', '成功', '转投标单成功');
|
|
|
|
|
- window.location.hash = '#/sale/tender';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ toaster.pop('success', '成功', '转投标单成功');
|
|
|
|
|
+ window.location.reload();
|
|
|
}, function(response){
|
|
}, function(response){
|
|
|
toaster.pop('error', '操作失败', response.data);
|
|
toaster.pop('error', '操作失败', response.data);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $scope.upload = function(myFile) { // 上传附件
|
|
|
|
|
- var file = $scope.myFile, file = file && file.length > 0 ? file : null;
|
|
|
|
|
- $upload.upload({
|
|
|
|
|
- url: 'tender/addTenderItemAttach',
|
|
|
|
|
- file: file,
|
|
|
|
|
- method: 'POST'
|
|
|
|
|
- }).success(function (attach) {
|
|
|
|
|
- $scope.attaches.push(attach);
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- $scope.removeAttach = function(id, index) {
|
|
|
|
|
- $scope.attaches.splice(index, 1);
|
|
|
|
|
- PurcTender.removeAttach({attachId:id}, function() {
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- var taxrateYes = false;
|
|
|
|
|
- var cycleYes = false;
|
|
|
|
|
- var priceYes = false;
|
|
|
|
|
- $scope.canSave = false;
|
|
|
|
|
- $scope.validateThis = function(value, type) {
|
|
|
|
|
- switch(type) {
|
|
|
|
|
- case 'taxrate':
|
|
|
|
|
- var regex = /^\+?[0-9][0-9]{0,1}$/;
|
|
|
|
|
- if (regex.test(value)) {
|
|
|
|
|
- taxrateYes = true;
|
|
|
|
|
- } else {
|
|
|
|
|
- toaster.pop('warning', '警告', '税率不合法,请重新填写');
|
|
|
|
|
- }
|
|
|
|
|
- break;
|
|
|
|
|
- case 'cycle':
|
|
|
|
|
- regex = /^\+?[1-9][0-9]*$/;
|
|
|
|
|
- if (regex.test(value)) {
|
|
|
|
|
- cycleYes = true;
|
|
|
|
|
- } else {
|
|
|
|
|
- toaster.pop('warning', '警告', '周期不合法,请重新填写');
|
|
|
|
|
- }
|
|
|
|
|
- break;
|
|
|
|
|
- case 'price':
|
|
|
|
|
- regex = /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
|
|
- if (regex.test(value) && value !== 0) {
|
|
|
|
|
- priceYes = true;
|
|
|
|
|
- } else {
|
|
|
|
|
- if (!(value instanceof Number) || value) {
|
|
|
|
|
- toaster.pop('warning', '警告', '单价不合法,请重新填写');
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- $scope.emNumYes = true;
|
|
|
|
|
-
|
|
|
|
|
- $scope.validEmNum = function (value) {
|
|
|
|
|
- var regex = /^\+?[1-9][0-9]*$/;
|
|
|
|
|
- if (!regex.test(value) || value == 0 || value !== null) {
|
|
|
|
|
- $scope.emNumYes = false;
|
|
|
|
|
- toaster.pop('warning', '警告', '人数不合法,请重新填写');
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- $scope.validateProds = function(tenderProd) {
|
|
|
|
|
- // angular.forEach(tenderProds, function (tenderProd) {
|
|
|
|
|
- var cycleRegex = /^\+?[1-9][0-9]*$/;
|
|
|
|
|
- var taxrateRegex = /^\+?[0-9][0-9]{0,1}$/;
|
|
|
|
|
- var priceRegex = /^(([0-9]+\.[0-9]{1,6})|([0-9]*[1-9][0-9]*\.[0-9]{1,6})|([0-9]*[1-9][0-9]*))$/; // 非零最多六位小数正实数
|
|
|
|
|
- // /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
|
|
- // 判断填写过的有为0或不符合正则式的,设置不能保存
|
|
|
|
|
- console.log(tenderProd.currentItem.cycle);
|
|
|
|
|
- if (tenderProd.currentItem.cycle !== null && (!cycleRegex.test(tenderProd.currentItem.cycle)) || (tenderProd.currentItem.taxrate !== null && !taxrateRegex.test(tenderProd.currentItem.taxrate)) || (tenderProd.currentItem.price !==null && (!priceRegex.test(tenderProd.currentItem.price) && tenderProd.currentItem.price !== 0))) {
|
|
|
|
|
- $scope.canSave = false;
|
|
|
|
|
- } else {
|
|
|
|
|
- $scope.canSave = true;
|
|
|
|
|
- }
|
|
|
|
|
- // });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- // 投标
|
|
|
|
|
- $scope.bidIt = function(tender, currentEnBaseInfo){
|
|
|
|
|
- $scope.loading = true;
|
|
|
|
|
- if(currentEnBaseInfo.enEstablishDate instanceof Date) {
|
|
|
|
|
- currentEnBaseInfo.enEstablishDate = currentEnBaseInfo.enEstablishDate.getTime();
|
|
|
|
|
- }
|
|
|
|
|
- var saleTenderItems = [];
|
|
|
|
|
- if (tender.ifOpen !== 1) { // 指定投标不把投标单主表设空会报header超长
|
|
|
|
|
- angular.forEach(tender.purchaseTenderProds, function(tenderProd) {
|
|
|
|
|
- if (tenderProd.currentItem) {
|
|
|
|
|
- tenderProd.currentItem.saleTender = {};
|
|
|
|
|
- saleTenderItems.push(tenderProd.currentItem);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- angular.forEach(tender.purchaseTenderProds, function(tenderProd) {
|
|
|
|
|
- if (tenderProd.currentItem) {
|
|
|
|
|
- saleTenderItems.push(tenderProd.currentItem);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- PurcTender.reply({tenderItems: saleTenderItems, enBaseInfo: currentEnBaseInfo, attaches:$scope.attaches}, {}, function(data){
|
|
|
|
|
- $scope.loading = false;
|
|
|
|
|
- toaster.pop('info', '成功', '投标成功');
|
|
|
|
|
- // $window.location.reload();
|
|
|
|
|
- // if (tender.ifOpen) { // 根据是否公开,选择跳转
|
|
|
|
|
- // window.location.hash = '#/sale/opentender';
|
|
|
|
|
- // } else {
|
|
|
|
|
- window.location.hash = '#/sale/tender';
|
|
|
|
|
- // }
|
|
|
|
|
- }, function(response){
|
|
|
|
|
- $scope.loading = false;
|
|
|
|
|
- toaster.pop('error', '投标失败', '出现异常,投标失败');
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // $scope.upload = function(myFile) { // 上传附件
|
|
|
|
|
+ // var file = $scope.myFile, file = file && file.length > 0 ? file : null;
|
|
|
|
|
+ // $upload.upload({
|
|
|
|
|
+ // url: 'tender/addTenderItemAttach',
|
|
|
|
|
+ // file: file,
|
|
|
|
|
+ // method: 'POST'
|
|
|
|
|
+ // }).success(function (attach) {
|
|
|
|
|
+ // $scope.attaches.push(attach);
|
|
|
|
|
+ // });
|
|
|
|
|
+ // };
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- $scope.condition = {
|
|
|
|
|
- $fromOpened:false
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
- $scope.getMaxDate = function() {
|
|
|
|
|
- return $filter('date')(new Date(), 'yyyy-MM-dd');
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // $scope.removeAttach = function(id, index) {
|
|
|
|
|
+ // $scope.attaches.splice(index, 1);
|
|
|
|
|
+ // PurcTender.removeAttach({attachId:id}, function() {
|
|
|
|
|
+ //
|
|
|
|
|
+ // });
|
|
|
|
|
+ // };
|
|
|
|
|
|
|
|
- $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
- $event.preventDefault();
|
|
|
|
|
- $event.stopPropagation();
|
|
|
|
|
- item[openParam] = !item[openParam];
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ // var taxrateYes = false;
|
|
|
|
|
+ // var cycleYes = false;
|
|
|
|
|
+ // var priceYes = false;
|
|
|
|
|
+ // $scope.canSave = false;
|
|
|
|
|
+ // $scope.validateThis = function(value, type) {
|
|
|
|
|
+ // switch(type) {
|
|
|
|
|
+ // case 'taxrate':
|
|
|
|
|
+ // var regex = /^\+?[0-9][0-9]{0,1}$/;
|
|
|
|
|
+ // if (regex.test(value)) {
|
|
|
|
|
+ // taxrateYes = true;
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // toaster.pop('warning', '警告', '税率不合法,请重新填写');
|
|
|
|
|
+ // }
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // case 'cycle':
|
|
|
|
|
+ // regex = /^\+?[1-9][0-9]*$/;
|
|
|
|
|
+ // if (regex.test(value)) {
|
|
|
|
|
+ // cycleYes = true;
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // toaster.pop('warning', '警告', '周期不合法,请重新填写');
|
|
|
|
|
+ // }
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // case 'price':
|
|
|
|
|
+ // regex = /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
|
|
+ // if (regex.test(value) && value !== 0) {
|
|
|
|
|
+ // priceYes = true;
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // if (!(value instanceof Number) || value) {
|
|
|
|
|
+ // toaster.pop('warning', '警告', '单价不合法,请重新填写');
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.emNumYes = true;
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.validEmNum = function (value) {
|
|
|
|
|
+ // var regex = /^\+?[1-9][0-9]*$/;
|
|
|
|
|
+ // if (!regex.test(value) || value == 0 || value !== null) {
|
|
|
|
|
+ // $scope.emNumYes = false;
|
|
|
|
|
+ // toaster.pop('warning', '警告', '人数不合法,请重新填写');
|
|
|
|
|
+ // }
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.validateProds = function(tenderProd) {
|
|
|
|
|
+ // // angular.forEach(tenderProds, function (tenderProd) {
|
|
|
|
|
+ // var cycleRegex = /^\+?[1-9][0-9]*$/;
|
|
|
|
|
+ // var taxrateRegex = /^\+?[0-9][0-9]{0,1}$/;
|
|
|
|
|
+ // var priceRegex = /^(([0-9]+\.[0-9]{1,6})|([0-9]*[1-9][0-9]*\.[0-9]{1,6})|([0-9]*[1-9][0-9]*))$/; // 非零最多六位小数正实数
|
|
|
|
|
+ // // /^(0|[0-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
|
|
|
|
|
+ // // 判断填写过的有为0或不符合正则式的,设置不能保存
|
|
|
|
|
+ // console.log(tenderProd.currentItem.cycle);
|
|
|
|
|
+ // if (tenderProd.currentItem.cycle !== null && (!cycleRegex.test(tenderProd.currentItem.cycle)) || (tenderProd.currentItem.taxrate !== null && !taxrateRegex.test(tenderProd.currentItem.taxrate)) || (tenderProd.currentItem.price !==null && (!priceRegex.test(tenderProd.currentItem.price) && tenderProd.currentItem.price !== 0))) {
|
|
|
|
|
+ // $scope.canSave = false;
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // $scope.canSave = true;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // // });
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // // 投标
|
|
|
|
|
+ // $scope.bidIt = function(tender, currentEnBaseInfo){
|
|
|
|
|
+ // $scope.loading = true;
|
|
|
|
|
+ // if(currentEnBaseInfo.enEstablishDate instanceof Date) {
|
|
|
|
|
+ // currentEnBaseInfo.enEstablishDate = currentEnBaseInfo.enEstablishDate.getTime();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // var saleTenderItems = [];
|
|
|
|
|
+ // if (tender.ifOpen !== 1) { // 指定投标不把投标单主表设空会报header超长
|
|
|
|
|
+ // angular.forEach(tender.purchaseTenderProds, function(tenderProd) {
|
|
|
|
|
+ // if (tenderProd.currentItem) {
|
|
|
|
|
+ // tenderProd.currentItem.saleTender = {};
|
|
|
|
|
+ // saleTenderItems.push(tenderProd.currentItem);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // angular.forEach(tender.purchaseTenderProds, function(tenderProd) {
|
|
|
|
|
+ // if (tenderProd.currentItem) {
|
|
|
|
|
+ // saleTenderItems.push(tenderProd.currentItem);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // PurcTender.reply({tenderItems: saleTenderItems, enBaseInfo: currentEnBaseInfo, attaches:$scope.attaches}, {}, function(data){
|
|
|
|
|
+ // $scope.loading = false;
|
|
|
|
|
+ // toaster.pop('info', '成功', '投标成功');
|
|
|
|
|
+ // // $window.location.reload();
|
|
|
|
|
+ // // if (tender.ifOpen) { // 根据是否公开,选择跳转
|
|
|
|
|
+ // // window.location.hash = '#/sale/opentender';
|
|
|
|
|
+ // // } else {
|
|
|
|
|
+ // window.location.hash = '#/sale/tender';
|
|
|
|
|
+ // // }
|
|
|
|
|
+ // }, function(response){
|
|
|
|
|
+ // $scope.loading = false;
|
|
|
|
|
+ // toaster.pop('error', '投标失败', '出现异常,投标失败');
|
|
|
|
|
+ // });
|
|
|
|
|
+ //
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.condition = {
|
|
|
|
|
+ // $fromOpened:false
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.getMaxDate = function() {
|
|
|
|
|
+ // return $filter('date')(new Date(), 'yyyy-MM-dd');
|
|
|
|
|
+ // };
|
|
|
|
|
+ //
|
|
|
|
|
+ // $scope.openDatePicker = function($event, item, openParam) {
|
|
|
|
|
+ // $event.preventDefault();
|
|
|
|
|
+ // $event.stopPropagation();
|
|
|
|
|
+ // item[openParam] = !item[openParam];
|
|
|
|
|
+ // };
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
return app;
|
|
return app;
|