|
|
@@ -18,6 +18,37 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
}
|
|
|
$rootScope.ShaRETimer = {}
|
|
|
|
|
|
+ // 筛选
|
|
|
+ var _formatDate = function (date, fmt) {
|
|
|
+ if (!date) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (typeof date === 'string') {
|
|
|
+ date = new Date(Date.parse(date.replace(/-/g, '/')));
|
|
|
+ }
|
|
|
+ var o = {
|
|
|
+ 'M+': date.getMonth() + 1, // 月份
|
|
|
+ 'd+': date.getDate(), // 日
|
|
|
+ 'h+': date.getHours(), // 小时
|
|
|
+ 'm+': date.getMinutes(), // 分
|
|
|
+ 's+': date.getSeconds(), // 秒
|
|
|
+ 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
|
|
|
+ 'S': date.getMilliseconds() // 毫秒
|
|
|
+ }
|
|
|
+ if (/(y+)/.test(fmt)) {
|
|
|
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
|
|
+ }
|
|
|
+ for (var k in o) {
|
|
|
+ if (new RegExp('(' + k + ')').test(fmt)) {
|
|
|
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fmt;
|
|
|
+ }
|
|
|
+
|
|
|
+ var _getClearDay = function (date) {
|
|
|
+ return new Date(_formatDate(date, 'yyyy-MM-dd')).getTime() - 8 * 60 * 60 * 1000
|
|
|
+ }
|
|
|
var clearSeekStatus = function () {
|
|
|
// if ($scope.seekListData) {}
|
|
|
angular.forEach($scope.seekListData.content, function (item) {
|
|
|
@@ -32,23 +63,50 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
}
|
|
|
|
|
|
// 发布时间
|
|
|
- $scope.dateArea = 'ALL';
|
|
|
+ $scope.dateArea = 'sevenDay';
|
|
|
|
|
|
// 更换待报价状态
|
|
|
- $scope.vendorType = 'all'
|
|
|
+ $scope.vendorType = 'self'
|
|
|
$scope.onVendorTypeChange = function () {
|
|
|
$scope.keyword = '';
|
|
|
- $scope.startDate = null;
|
|
|
- $scope.endDate = null;
|
|
|
$scope.seekPurchaseTableParams.page(1);
|
|
|
$scope.seekPurchaseTableParams.reload();
|
|
|
}
|
|
|
+ $scope.setFilters = function (type, val, flag) {
|
|
|
+ $scope[type] = val;
|
|
|
+ if (type == 'dateArea') {
|
|
|
+ // 时间筛选
|
|
|
+ var currentTime = _getClearDay(new Date());
|
|
|
+ var endDate = new Date(currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
|
|
|
+ if (val == 'ALL' || val == 'autoDay') {
|
|
|
+ $scope.startDate = null;
|
|
|
+ $scope.endDate = null;
|
|
|
+ } else if (val == 'oneDay') {
|
|
|
+ $scope.startDate = new Date(currentTime - 24 * 60 * 60 * 1000);
|
|
|
+ $scope.endDate = endDate;
|
|
|
+ } else if (val == 'threeDay') {
|
|
|
+ $scope.startDate = new Date(currentTime - 3 * 24 * 60 * 60 * 1000);
|
|
|
+ $scope.endDate = endDate;
|
|
|
+ } else if (val == 'sevenDay') {
|
|
|
+ $scope.startDate = new Date(currentTime - 7 * 24 * 60 * 60 * 1000);
|
|
|
+ $scope.endDate = endDate;
|
|
|
+ } else {
|
|
|
+ $scope.startDate = null;
|
|
|
+ $scope.endDate = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag) return
|
|
|
+ $scope.seekPurchaseTableParams.page(1);
|
|
|
+ $scope.seekPurchaseTableParams.reload();
|
|
|
+ }
|
|
|
+ $scope.setFilters('dateArea', 'sevenDay', '1')
|
|
|
+
|
|
|
seekPurchase.getSeekUrl({}, function(data) {
|
|
|
var seekUrl = data.url;
|
|
|
// var seekUrl = 'http://10.1.51.82:24002';
|
|
|
/*$scope.tab = 'waitOffer';*/
|
|
|
$scope.toogleTab = function (tab) {
|
|
|
- $scope.vendorType = 'all'
|
|
|
+ $scope.vendorType = 'self'
|
|
|
$scope.tab = tab;
|
|
|
$scope.seekPurchaseTableParams = new ngTableParams({
|
|
|
page: 1,
|
|
|
@@ -77,7 +135,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
? $scope.startDate.getTime() : null;
|
|
|
param.endDate = $scope.endDate ? $scope.endDate.getTime()
|
|
|
: null;
|
|
|
- param.overdue = $scope.vendorType === 'all' ? '' : ($scope.vendorType === 'self' ? '0' : '1')
|
|
|
+ param.overdue = $scope.vendorType === 'self' ? '0' : '1'
|
|
|
$http({
|
|
|
method: 'get',
|
|
|
dataType: 'json',
|
|
|
@@ -110,7 +168,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
? $scope.startDate.getTime() : null;
|
|
|
param.endDate = $scope.endDate ? $scope.endDate.getTime()
|
|
|
: null;
|
|
|
- param.overdue = $scope.vendorType === 'all' ? '' : ($scope.vendorType === 'self' ? '0' : '1')
|
|
|
+ param.overdue =$scope.vendorType === 'self' ? '0' : '1'
|
|
|
$http({
|
|
|
method: 'get',
|
|
|
dataType: 'json',
|
|
|
@@ -543,6 +601,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
}
|
|
|
// 采纳报价
|
|
|
$scope.adopt = function (of) {
|
|
|
+ $scope.showCurrentRefuseOffer = false;
|
|
|
$http({
|
|
|
headers:{
|
|
|
'content-Type':'application/x-www-form-urlencoded'
|
|
|
@@ -1162,63 +1221,8 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
- // 筛选
|
|
|
- var _formatDate = function (date, fmt) {
|
|
|
- if (!date) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (typeof date === 'string') {
|
|
|
- date = new Date(Date.parse(date.replace(/-/g, '/')));
|
|
|
- }
|
|
|
- var o = {
|
|
|
- 'M+': date.getMonth() + 1, // 月份
|
|
|
- 'd+': date.getDate(), // 日
|
|
|
- 'h+': date.getHours(), // 小时
|
|
|
- 'm+': date.getMinutes(), // 分
|
|
|
- 's+': date.getSeconds(), // 秒
|
|
|
- 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
|
|
|
- 'S': date.getMilliseconds() // 毫秒
|
|
|
- }
|
|
|
- if (/(y+)/.test(fmt)) {
|
|
|
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
|
|
- }
|
|
|
- for (var k in o) {
|
|
|
- if (new RegExp('(' + k + ')').test(fmt)) {
|
|
|
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
|
|
|
- }
|
|
|
- }
|
|
|
- return fmt;
|
|
|
- }
|
|
|
|
|
|
- var _getClearDay = function (date) {
|
|
|
- return new Date(_formatDate(date, 'yyyy-MM-dd')).getTime() - 8 * 60 * 60 * 1000
|
|
|
- }
|
|
|
|
|
|
- $scope.setFilters = function (type, val) {
|
|
|
- $scope[type] = val;
|
|
|
- if (type == 'dateArea') {
|
|
|
- // 时间筛选
|
|
|
- var currentTime = _getClearDay(new Date());
|
|
|
- var endDate = new Date(currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
|
|
|
- if (val == 'ALL' || val == 'autoDay') {
|
|
|
- $scope.startDate = null;
|
|
|
- $scope.endDate = null;
|
|
|
- } else if (val == 'oneDay') {
|
|
|
- $scope.startDate = new Date(currentTime - 24 * 60 * 60 * 1000);
|
|
|
- $scope.endDate = endDate;
|
|
|
- } else if (val == 'threeDay') {
|
|
|
- $scope.startDate = new Date(currentTime - 3 * 24 * 60 * 60 * 1000);
|
|
|
- $scope.endDate = endDate;
|
|
|
- } else if (val == 'sevenDay') {
|
|
|
- $scope.startDate = new Date(currentTime - 7 * 24 * 60 * 60 * 1000);
|
|
|
- $scope.endDate = endDate;
|
|
|
- } else {
|
|
|
- $scope.startDate = null;
|
|
|
- $scope.endDate = null;
|
|
|
- }
|
|
|
- }
|
|
|
- $scope.seekPurchaseTableParams.page(1);
|
|
|
- $scope.seekPurchaseTableParams.reload();
|
|
|
- }
|
|
|
+
|
|
|
}]);
|
|
|
});
|