Browse Source

平台新增采购单时,更新获取供应商物料方法,增加加载状态

hejq 7 years ago
parent
commit
a9425661df

+ 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<>();

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