Browse Source

公共询价增加全部询价信息,时间筛选格式调整

hejq 7 years ago
parent
commit
fc1e4808e4

+ 23 - 6
src/main/webapp/resources/js/index/app.js

@@ -5400,6 +5400,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     $scope.remind = false;
                 } else if ($scope.active == 'remind') {
                     $scope.remind = true;
+                } else if ($scope.active == 'all') {
+                    $scope.distribute = null;
+                    $scope.remind = false;
                 }
                 if ($scope.tableParams.page() == 1) {
                     $scope.tableParams.reload();
@@ -5417,9 +5420,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             page: 1,
             count: 20,
             sorting: {
-//                'tender.endDate': 'desc',
-//                'tender.enterprise.enName': 'asc',
-//                'tender.code': 'asc'
             }
         }, {
             total: 0,
@@ -5427,7 +5427,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             getData: function ($defer, params) {
                 $scope.loading = true;
                 var pageParams = params.url();
-//                var realActive = {};
                 pageParams.searchFilter = { // 筛选条件
                     keyword: $scope.keyword,
                     fromDate: getDateTime($scope.condition.dateFrom),
@@ -5438,7 +5437,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                    $scope.currentEn = data;
                     publicInquiry.getUrl({}, function(data) {
                         $scope.url = data.url;
-                        if (!$scope.remind) {// 企业商机
+                        if ($scope.active == 'enterprise') {// 企业商机
                             AuthenticationService.getAuthentication().success(function (data) {
                                 $scope.loading = false;
                                 $scope.thisUser = data;
@@ -5467,7 +5466,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                                     toaster.pop('error', '数据加载失败', err);
                                 });
                             });
-                        } else {// 推荐报价信息
+                        } else if ($scope.active == 'remind') {// 推荐报价信息
                             AuthenticationService.getAuthentication().success(function (data) {
                                 $scope.loading = false;
                                 $scope.thisUser = data;
@@ -5489,6 +5488,24 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                                     toaster.pop('error', '数据加载失败', err);
                                 });
                             });
+                        } else if ($scope.active == 'all') {// 全部
+                            $http({
+                                method: 'get',
+                                dataType: 'json',
+                                url: $scope.url + '/inquiry/public',
+                                params: {pageNumber: pageParams.page, pageSize: pageParams.count, enUU: $scope.currentEn.uu, keyword: $scope.keyword,
+                                    fromDate: getDateTime($scope.condition.dateFrom), endDate: getDateTime($scope.condition.dateTo), distribute: $scope.distribute, remind: $scope.remind}
+                            }).success(function (response) {
+                                $scope.loading = false;
+                                if (response) {
+                                    params.total(response.totalElements);
+                                    $defer.resolve(response.content);
+                                    $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
+                                }
+                            }).error(function (err) {
+                                $scope.loading = false;
+                                toaster.pop('error', '数据加载失败', err);
+                            });
                         }
 
                         // 顶部滚动消息

+ 6 - 4
src/main/webapp/resources/tpl/index/baseInfo/inquiry_list.html

@@ -334,18 +334,20 @@
                             <div class="count">共<em ng-bind="tableParams.total()"></em>条</div>
                             <div class="all">
                                 <span class="history">
-                                     <span ng-click="changeDateZone(-1)" title="" ng-class="{'active': condition.dateZone == '-1'}" ><img src="static/img/all/bar.png" alt="" class="first"/>全部</span>
+                                     <span><img src="static/img/all/bar.png" alt="" class="first"/>时间筛选</span>
                                      <ul>
                                         <li ng-click="changeDateZone(7)" title="" ng-class="{'active': condition.dateZone == '7'}">一周内</li>
                                         <li ng-click="changeDateZone(1)" title="" ng-class="{'active': condition.dateZone == '1'}">一个月内</li>
                                         <li ng-click="changeDateZone(3)" title="" ng-class="{'active': condition.dateZone == '3'}">三个月内</li>
                                         <li ng-click="changeDateZone(6)" title="" ng-class="{'active': condition.dateZone == '6'}">半年内</li>
                                         <li ng-click="changeDateZone()" title="" ng-class="{'active': condition.dateZone == null}">一年内</li>
+                                        <li ng-click="changeDateZone(-1)" title="" ng-class="{'active': condition.dateZone == '-1'}" >全部</li>
                                     </ul>
                                 </span>
                                 <span class="history">
                                     <span><img src="static/img/all/bar.png" alt=""/>商机类型</span>
                                     <ul>
+                                        <li ng-click="setActive('all')" title="" ng-class="{'active': active == 'all'}">全部</li>
                                         <li ng-click="setActive('remind')" title="" ng-class="{'active': active == 'remind'}">我的商机</li>
                                         <li ng-click="setActive('enterprise')" title="" ng-class="{'active': active == 'enterprise'}">公司商机</li>
                                     </ul>
@@ -368,7 +370,7 @@
                                    <th width="70" class="line"><em></em>报价</th>
                                </tr>
                                </thead>
-                               <!--<tbody ng-if="active != 'remind'">
+                               <tbody ng-if="active == 'all'">
                                     <tr ng-repeat="inquiryItem in $data">
                                         <td ng-click="toDetail(inquiryItem)" title="查看详情" ng-bind="inquiryItem.inquiry.date| date: 'yyyy-MM-dd'"></td>
                                         <td ng-click="toDetail(inquiryItem)" title="查看详情" ng-bind="inquiryItem.inbrand || inquiryItem.product.brand || '无'"></td>
@@ -388,8 +390,8 @@
                                             <a class="offer" ng-if="inquiryItem.remainingTime <= 0 || inquiryItem.overdue == 1 || !isOverDue(inquiryItem.inquiry.endDate)" ng-click="">已结束</a>
                                         </td>
                                     </tr>
-                               </tbody>-->
-                               <tbody >
+                               </tbody>
+                               <tbody ng-if="active == 'remind' || active == 'enterprise'">
                                    <tr ng-repeat="remind in $data">
                                        <td ng-click="remindDetail(remind)" title="查看详情" ng-bind="remind.reDate| date: 'yyyy-MM-dd'"></td>
                                        <td ng-click="remindDetail(remind)" title="查看详情" ng-bind="remind.brand || '无'"></td>