Эх сурвалжийг харах

Merge remote-tracking branch 'origin/dev' into purchaseChange

hejq 7 жил өмнө
parent
commit
c2af4d45f2

+ 1 - 23
src/main/java/com/uas/platform/b2b/controller/ProductController.java

@@ -7,7 +7,6 @@ import com.uas.platform.b2b.model.ProductMatchResult;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.ProductService;
 import com.uas.platform.b2b.support.JxlsExcelView;
-import com.uas.platform.b2b.support.SPageUtils;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.UsageBufferedLogger;
 import com.uas.platform.b2b.temporary.model.UpdateByBatchParameter;
@@ -21,19 +20,10 @@ import com.uas.search.b2b.model.SPage;
 import com.uas.search.b2b.model.Sort;
 import com.uas.search.b2b.model.Sort.Type;
 import com.uas.search.b2b.util.SearchConstants;
-import java.util.Map;
-import org.apache.commons.collections.map.HashedMap;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import java.util.ArrayList;
@@ -95,18 +85,6 @@ public class ProductController {
 	public SPage<Product> getVendorProducts(PageParams params, Long vendUU, String keyword) {
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
 		if (vendUU != null && vendUU != 0) {
-            if (StringUtils.isEmpty(keyword)) {
-                PageInfo pageInfo = new PageInfo(params);
-                Map<String, Object> mapFilter = new HashedMap();
-                mapFilter.put("enUU", vendUU);
-                mapFilter.put("isSale", Constant.YES);
-
-                pageInfo.setSort(new org.springframework.data.domain.Sort(Direction.ASC, "id"));
-                pageInfo.setFilters(mapFilter);
-                Page<Product> productPage = productService.findAllByPageInfo(pageInfo, keyword);
-                return SPageUtils.covertSPage(productPage);
-            }
-
 			pageParams.getFilters().put("pr_enuu", vendUU);
 			pageParams.getFilters().put("pr_issale", Constant.YES);
 			HashMap<String, Object> map = new HashMap<>();

+ 2 - 2
src/main/java/com/uas/platform/b2b/controller/UserController.java

@@ -496,10 +496,10 @@ public class UserController {
 
 	@RequestMapping(value = "/getUrl", method = RequestMethod.GET, params = "_operate=updatePassword")
 	@ResponseBody
-	public ModelMap getUpdatePasswordUrl(HttpServletRequest request) {
+	public ModelMap getUpdatePasswordUrl(HttpServletRequest request, String returnUrl) {
 		ModelMap map = new ModelMap();
 		try {
-			map.put("url", SSOHelper.getUpdatePasswordUrl(request));
+			map.put("url", SSOHelper.getUpdatePasswordUrl(request, returnUrl));
 		} catch (IOException e) {
 			throw new RuntimeException(e);
 		}

+ 24 - 7
src/main/webapp/resources/js/index/app.js

@@ -5408,6 +5408,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();
@@ -5425,9 +5428,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,
@@ -5435,7 +5435,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),
@@ -5446,7 +5445,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;
@@ -5475,7 +5474,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;
@@ -5497,6 +5496,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);
+                            });
                         }
 
                         // 顶部滚动消息
@@ -11397,7 +11414,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         };
         $scope.updatePassword = function () {
             var newPage = window.open("about:black");
-            AccountUser.getUpdatePasswordUrl({}, function (data) {
+            AccountUser.getUpdatePasswordUrl({returnUrl: window.location.href}, function (data) {
                 newPage.location.href = data.url;
             });
         };

+ 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>

+ 11 - 10
src/main/webapp/resources/tpl/index/purc/addOrder.html

@@ -74,8 +74,7 @@
 							<em>流水号:</em> <span>{{::order.code}}</span>
 						</div>
 						<div class="fr">
-							<em>录入时间:</em> <span>{{::order.date | date:'yyyy-MM-dd
-								HH:mm:ss'}}</span>
+							<em>录入时间:</em> <span>{{::order.date | date:'yyyy-MM-dd HH:mm:ss'}}</span>
 						</div>
 					</li>
 					<li>
@@ -217,13 +216,6 @@
 			<!-- 搜索结果列表-->
 			<div class="pro-add-data02" style="min-height: 500px;"
 				ng-if="order.vend.uu">
-				<!--<div class="pro-search">
-                 <div class="search-result fl"><img src="static/img/purc/search01.png"/>搜索“{{tip}}”,为您找到<em>{{total}}</em>个结果</div>
-                 <div class="search fr">
-                     <input type="text" placeholder="输入供应商物料关键字查询" ng-model="keyword" autofocus ng-search="onSearch(keyword)"/>
-                     <a class="seek" ng-click="onSearch(keyword)">搜索</a>
-                 </div>
-             </div>-->
 				<div class="pro-search">
 					<div class="col-xs-2 search-title fl">供应商产品库</div>
 					<div class="col-xs-8 fr">
@@ -248,7 +240,16 @@
 							<th width="80">选择</th>
 						</tr>
 					</thead>
-					<tbody ng-if="tableParams.total() == 0">
+					<tbody ng-if="loading">
+                        <tr>
+                            <td colspan="5">
+                                <div class="text-center">
+                                    <img src="static/img/all/loading.gif">
+                                </div>
+                            </td>
+                        </tr>
+					</tbody>
+					<tbody ng-if="!loading && tableParams.total() == 0">
 					<tr>
 						<td colspan="5">
 							<div id="empty">

+ 9 - 0
src/main/webapp/resources/tpl/index/purc/modal/purc_order_vendor.html

@@ -47,6 +47,15 @@
 				<th>操作</th>
 			</tr>
 		</thead>
+        <tbody ng-if="loading">
+        <tr>
+            <td colspan="5">
+                <div class="text-center">
+                    <img src="static/img/all/loading.gif">
+                </div>
+            </td>
+        </tr>
+        </tbody>
 		<tbody>
 			<tr ng-repeat="vendor in $data">
 				<td class="text-center" >