ソースを参照

Merge branch 'dev-mysql' into feature_release-tomysql

wangdy 8 年 前
コミット
15319e2124

+ 1 - 0
src/main/java/com/uas/platform/b2c/common/account/service/impl/UserServiceImpl.java

@@ -330,6 +330,7 @@ public class UserServiceImpl implements UserService {
 		model.put("userTel", user.getUserTel());
 		model.put("rootpath", AgentUtils.getHost(request));
 		if (user.getUserEmail() != null) {
+			//mailService.send("a4c45a22-436a-430c-9667-4edfd7d04a27", newUserEmail, data);
 			//mailService.send(messageConf.getTplInvitationForB2B(), user.getUserEmail(), model);
 		}
 		return user;

+ 14 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2c.prod.commodity.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.support.SystemSession;
@@ -29,6 +30,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static com.alibaba.fastjson.JSON.parseArray;
+
 /**
  *  产品控制器
  *
@@ -101,6 +104,17 @@ public class ProductController {
 		return ResultMap.success("success");
 	}
 
+	/**
+	 * 批量保存个人替代物料信息
+	 * @param productReplaceList 替代物料数组
+	 */
+	@RequestMapping(value = "/productReplace", method = RequestMethod.POST)
+	ResultMap setProductReplacesByPerson(@RequestBody String productReplaceList) {
+		List<ProductReplace> productReplaces = JSON.parseArray(productReplaceList,ProductReplace.class);
+		productService.setProductReplacesByPerson(productReplaces);
+		return ResultMap.success("success");
+	}
+
     /**
      * 批量导出产品表
      *

+ 15 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductReplaceDao.java

@@ -0,0 +1,15 @@
+package com.uas.platform.b2c.prod.commodity.dao;
+
+import com.uas.platform.b2c.prod.commodity.model.ProductReplace;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+public interface ProductReplaceDao extends JpaRepository<ProductReplace, Long>, JpaSpecificationExecutor<ProductReplace> {
+
+    @Query(nativeQuery = true, value = "select * from product$replace where ptr_useruu = :userUU and ptr_prid = :prid")
+    List<ProductReplace> findByUserUUAndProductId(@Param("userUU") Long userUU, @Param("prid") Long prId);
+}

+ 5 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductReplace.java

@@ -28,13 +28,13 @@ public class ProductReplace {
     private Long productId;
 
     /**
-     * 原型号型号
+     * 原型号型号(冗余p字段)
      */
     @Column(name = "p_cmpcode" ,length = 800)
     private String pCmpcode;
 
     /**
-     * 原品牌品牌
+     * 原品牌品牌(冗余p字段)
      */
     @Column(name = "p_pbranden")
     private String pBranden;
@@ -67,13 +67,15 @@ public class ProductReplace {
     /**
      * 创建时间
      */
+    @Temporal(TemporalType.TIMESTAMP)
+    @org.hibernate.annotations.CreationTimestamp
     @Column(name = "ptr_createtime")
     private Date time;
 
     /**
      * 序号
      */
-    @Column(name = "ptr_detno")
+    @Column(name = "ptr_detno", nullable = false)
     private Short detno;
 
     public Long getId() {

+ 15 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/V_ProductPerson.java

@@ -7,6 +7,7 @@ import com.uas.platform.core.persistence.UserUU;
 import javax.persistence.*;
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 import java.util.Set;
 
 @Entity
@@ -273,6 +274,12 @@ public class V_ProductPerson implements Serializable{
     @Column(name = "user_uu")
     private Long ppUserUU;
 
+    /**
+     * 该物料的所有替代物料
+     */
+    @Transient
+    private List<ProductReplace> productReplaceList;
+
     public Long getPpId() {
         return ppId;
     }
@@ -592,4 +599,12 @@ public class V_ProductPerson implements Serializable{
     public void setPpUserUU(Long ppUserUU) {
         this.ppUserUU = ppUserUU;
     }
+
+    public List<ProductReplace> getProductReplaceList() {
+        return productReplaceList;
+    }
+
+    public void setProductReplaceList(List<ProductReplace> productReplaceList) {
+        this.productReplaceList = productReplaceList;
+    }
 }

+ 6 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java

@@ -42,6 +42,12 @@ public interface ProductService {
      */
     boolean setAllProductsByProductIds(String ids, Integer isAll, Integer isStardand);
 
+    /**
+     * 批量保存个人替代物料信息
+     * @param productReplaceList 替代物料数组
+     */
+    boolean setProductReplacesByPerson(List<ProductReplace> productReplaceList);
+
 
     /**
      * 下载产品资料

+ 22 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -198,6 +198,9 @@ public class ProductServiceImpl implements ProductService {
     @Autowired
     private MatchModelDao matchModelDao;
 
+    @Autowired
+    private ProductReplaceDao productReplaceDao;
+
     @Value("#{sys.productServiceIp}")
     private String productServiceIp;
 
@@ -287,7 +290,7 @@ public class ProductServiceImpl implements ProductService {
             SimpleExpression standard = PredicateUtils.eq("standard", (short) 0, false);
             page.orExpression(standard);
             page.orExpression(logicalExpression);
-            page.sorting("standard", Sort.Direction.DESC);
+            page.sorting("createTime", Sort.Direction.DESC);
         }
 
         if (StringUtils.hasText(keyword)) {
@@ -324,8 +327,9 @@ public class ProductServiceImpl implements ProductService {
                     product.setProductDetail(productDetail);
                 }
             }
+            List<ProductReplace> productReplaceList = productReplaceDao.findByUserUUAndProductId(SystemSession.getUser().getUserUU(),product.getId());
+            product.setProductReplaceList(productReplaceList);
         }
-
         return new PageImpl<V_ProductPerson>(productList, page, productPage.getTotalElements());
     }
 
@@ -354,6 +358,22 @@ public class ProductServiceImpl implements ProductService {
         return true;
     }
 
+    @Override
+    public boolean setProductReplacesByPerson(List<ProductReplace> productReplaceList) {
+        if (CollectionUtils.isEmpty(productReplaceList)) {
+            return false;
+        }
+        Date date = new Date(System.currentTimeMillis());
+        List<ProductReplace> productReplacesOld = productReplaceDao.findByUserUUAndProductId(SystemSession.getUser().getUserUU(),productReplaceList.get(0).getProductId());
+        productReplaceDao.delete(productReplacesOld);
+        for (ProductReplace productReplace : productReplaceList) {
+            productReplace.setUserUU(SystemSession.getUser().getUserUU());
+            productReplace.setTime(date);
+        }
+        productReplaceDao.save(productReplaceList);
+        return true;
+    }
+
     @Override
     public List<Goods> getProductsGoods(String type, String keyword) {
         final PageInfo page = new PageInfo();

+ 296 - 38
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js

@@ -43,7 +43,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 				id : 'DESC'
 			},
 			isStandard : true,
-			type : "nStandard"
+			type : "all"
 		};
 
 		$scope.goods = { editBreakUp: false, editSelfSale: 2, editPrices: [{}] };
@@ -270,22 +270,21 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		// 确认删除
 		$scope.confirmDelete = function (ids) {
 			if ($scope.isChoosedAll) {
-				if ($scope.standard_tab == 'standard') {
+
 					Material.deleteStandardAll(null, null, function (data) {
 						$scope.deleteDiv = false;
-						loadDataReload();
-						if (data.code != 1) {
-							toaster.pop('error', data.message);
-						} else {
-							toaster.pop('success', data.message);
-						}
-					}, function (response) {
-						toaster.pop('error', '批量删除信息失败');
-					});
-				} else {
-					Material.deleteUnstandardAll(null, null, function (data) {
-						$scope.deleteDiv = false;
-						loadDataReload();
+                        Material.deleteUnstandardAll(null, null, function (data) {
+                            $scope.deleteDiv = false;
+                            loadDataReload();
+                            if (data.code != 1) {
+                                toaster.pop('error', data.message);
+                            } else {
+                                toaster.pop('success', data.message);
+                            }
+                        }, function (response) {
+                            toaster.pop('error', '批量删除信息失败');
+                        });
+
 						if (data.code != 1) {
 							toaster.pop('error', data.message);
 						} else {
@@ -294,7 +293,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 					}, function (response) {
 						toaster.pop('error', '批量删除信息失败');
 					});
-				}
+
 			} else {
 				var ids = $scope.choosedIds.join(',');
 				Material.deleteBatch({ids: ids, isPerson: 1}, function (data) {
@@ -1001,6 +1000,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 				updateTagCount();
 				angular.forEach($scope.currenctMaterial, function (material, index) {
 					material.isChoosed = false;
+					material.showMoreReplace = false;
 					material.submitProduct = {
 						brand: {},
 						commponent: {},
@@ -1021,6 +1021,31 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 
 			})
 		};
+        $scope.errorObj = [];
+		$scope.setProductReplacesByPerson = function (productReplaceList) {
+			for (var i = 0; i < productReplaceList.length; i++) {
+                $scope.errorObj[i] = {code : 0, brand : 0};
+                if (!productReplaceList[i].ptrCmpcode) {
+                    $scope.errorObj[i].code = 1;
+                }
+                if (!productReplaceList[i].ptrBranden) {
+                    $scope.errorObj[i].brand = 1;
+                }
+				productReplaceList[i].detno = i + 1;
+			}
+            console.log($scope.errorObj);
+            for (var i = 0; i < productReplaceList.length; i++) {
+                if ($scope.errorObj[i].code == 1 || $scope.errorObj[i].brand == 1) {
+                    toaster.pop('error', '请填完整信息');
+                    return;
+                }
+			}
+			Material.setProductReplacesByPerson(productReplaceList , function (data) {
+				loadDataReload();
+				$scope.setActiveIndex(-1);
+            }, function (response) {
+            })
+        }
 
 		$scope.onSearch = function () {
 			loadDataReload();
@@ -1033,11 +1058,11 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 
 		var init = function () {
 			$scope.param.keyword = '';
-			if ($scope.standard_tab == 'standard') {
-				$scope.param.type = "standard";
-			} else if ($scope.standard_tab == 'unstandard') {
-				$scope.param.type = "nStandard";
-			}
+			// if ($scope.standard_tab == 'standard') {
+			// 	$scope.param.type = "standard";
+			// } else if ($scope.standard_tab == 'unstandard') {
+			// 	$scope.param.type = "nStandard";
+			// }
 			$scope.isBatch = false;
 			$scope.param.count = 10;
 		};
@@ -2449,6 +2474,232 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			$scope.attachNameInfo = '';
 		};
 
+		$scope.activeIndex = -1;
+
+		$scope.setActiveIndex = function (index,material) {
+            $scope.errorObj = [];
+			$scope.isInCodeList = [];
+			$scope.isInBrandList = [];
+			$scope.activeIndex = index;
+			if (material) {
+                $scope.editCmp = material.pcmpcode;
+                $scope.editBrand = material.pbranden;
+                $scope.replaceMaterialList = angular.copy(material.productReplaceList);
+				for (var i = 0; i < $scope.replaceMaterialList.length; i++) {
+					$scope.errorObj.push({
+						code: 0,
+						brand: 0
+					});
+					$scope.isInCodeList.push(false);
+					$scope.isInBrandList.push(false);
+				}
+                if ($scope.replaceMaterialList.length == 0) {
+                    $scope.replaceMaterialList = [{detno : 1, productId : material.id}];
+					$scope.errorObj = [{
+						code: 0,
+						brand: 0
+					}];
+					$scope.isInCodeList = [false];
+					$scope.isInBrandList = [false];
+				}
+			} else {
+				$scope.errorObj = [{
+					code: 0,
+					brand: 0
+				}];
+				$scope.isInCodeList = [false];
+				$scope.isInBrandList = [false];
+			}
+		};
+
+		$scope.replaceMaterialList = [
+			{
+				ptrBranden: '',
+				ptrCmpcode: '',
+				showSimilarCodeList: false,
+				showSimilarBrandList: false
+			}
+		]
+		$scope.canAdd = true;
+		$scope.setReplies = function (type, index) {
+			if (type === 'add' && $scope.replaceMaterialList.length < 10) {
+				for (var i = 0; i < $scope.replaceMaterialList.length; i ++) {
+					$scope.errorObj[i] = {code : 0, brand : 0};
+					$scope.isInCodeList[i] = false;
+					$scope.isInBrandList[i] = false;
+					if (!$scope.replaceMaterialList[i].ptrCmpcode) {
+						$scope.errorObj[i].code = 1;
+					}
+					if (!$scope.replaceMaterialList[i].ptrBranden) {
+						$scope.errorObj[i].brand = 1;
+					}
+					if ($scope.replaceMaterialList[i].ptrBranden && $scope.replaceMaterialList[i].ptrCmpcode) {
+						$scope.canAdd = true;
+					} else {
+						$scope.canAdd = false;
+						break;
+					}
+				};
+				if ($scope.canAdd) {
+					$scope.replaceMaterialList.splice(index + 1, 0, {
+						ptrCmpcode: '',
+						ptrBranden: '',
+						showSimilarCodeList: false,
+						showSimilarBrandList: false,
+						productId: $scope.replaceMaterialList[0].productId
+					})
+					$scope.errorObj.splice(index + 1, 0, {
+						code: 0,
+						brand: 0
+					});
+					$scope.isInCodeList.splice(index + 1, 0, false);
+					$scope.isInBrandList.splice(index + 1, 0, false);
+				} else {
+					toaster.pop('error', '请填完整信息');
+				}
+			} else if (type === 'sub' && $scope.replaceMaterialList.length > 1) {
+				$scope.replaceMaterialList.splice(index, 1);
+				$scope.errorObj.splice(index, 1);
+				$scope.isInCodeList.splice(index, 1);
+				$scope.isInBrandList.splice(index, 1);
+			}
+		}
+
+		var getRealLen = function (str) {
+			var len = 0;
+			for (var i = 0; i < str.length; i++) {
+				if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+					len += 2;
+				} else {
+					len++;
+				}
+			}
+			return len;
+		};
+
+		var cutOutString = function (str, length) {
+			for (var i = 1; i <= str.length; i++) {
+				if (getRealLen(str.substr(0, i)) > length){
+					str = str.substr(0, i-1);
+					break;
+				}
+			}
+			return str;
+		};
+
+		// $scope.showSimilarCodeList = false;
+		// $scope.isInCodeList = true;
+		// $scope.showSimilarBrandList = false;
+		// $scope.isInBrandList = true;
+
+		$scope.getSimilarCode = function (keyword, index) {
+			if (keyword) {
+				Search.getSimilarComponents({keyword : keyword}, function (data) {
+					$scope.similarCode = data || [];
+					$scope.setShowSimilarCodeList(data && data.length, index);
+				}, function (error) {
+				})
+			}
+		}
+		$scope.getSimilarBrand = function (keyword, index) {
+			if (keyword) {
+				Search.getSimilarBrands({keyword : keyword}, function (data) {
+					$scope.similarBrand = data || [];
+					$scope.setShowSimilarBrandList(data && data.length, index);
+				}, function (error) {
+				})
+			}
+		}
+		$scope.setShowSimilarCodeList = function (flag, index) {
+            if (!$scope.replaceMaterialList[index].ptrCmpcode || !$scope.similarCode || !$scope.similarCode.length) {
+				$scope.replaceMaterialList[index].showSimilarCodeList = false;
+				return;
+            }
+			$scope.replaceMaterialList[index].showSimilarCodeList = flag;
+		}
+		$scope.setShowSimilarBrandList = function (flag, index) {
+			if (!$scope.replaceMaterialList[index].ptrBranden || !$scope.similarBrand || !$scope.similarBrand.length) {
+				$scope.replaceMaterialList[index].showSimilarBrandList = false;
+				return;
+			}
+			$scope.replaceMaterialList[index].showSimilarBrandList = flag;
+		}
+		$scope.setIsInCodeList = function (flag, index) {
+			$scope.isInCodeList[index] = flag;
+		}
+		$scope.setIsInBrandList = function (flag, index) {
+			$scope.isInBrandList[index] = flag;
+		}
+		$scope.onCodeChange = function (code, index) {
+			if ((/[^\x00-\xff]/g).test(code)) {
+				var chineseIndex = -1;
+				for (var i = 0; i < code.length; i++) {
+					if ((/[^\x00-\xff]/g).test(code.charAt(i))) {
+						chineseIndex = i;
+						break;
+					}
+				}
+				$scope.replaceMaterialList[index].ptrCmpcode = cutOutString(code, chineseIndex);
+			} else if (code && getRealLen(code) > 100) {
+				$scope.replaceMaterialList[index].ptrCmpcode = cutOutString(code, 100);
+			} else {
+				if (!code) {
+					$scope.setShowSimilarCodeList(false, index);
+				} else {
+					$scope.getSimilarCode(code, index);
+				}
+			}
+		}
+		$scope.onBrandChange = function (brand, index) {
+			if ((/[^\x00-\xff]/g).test(brand)) {
+				var chineseIndex = -1;
+				for (var i = 0; i < brand.length; i++) {
+					if ((/[^\x00-\xff]/g).test(brand.charAt(i)) && !(/[\u4e00-\u9fa5]/).test(brand.charAt(i))) {
+						chineseIndex = i;
+						break;
+					}
+				}
+				if (chineseIndex > -1) {
+					$scope.replaceMaterialList[index].ptrBranden = brand.substring(0, chineseIndex);
+				}
+			} else if (brand && getRealLen(brand) > 50) {
+				$scope.replaceMaterialList[index].ptrBranden = cutOutString(brand, 50);
+			} else {
+				if (!brand) {
+					$scope.setShowSimilarBrandList(false, index);
+				} else {
+					$scope.getSimilarBrand(brand, index);
+				}
+			}
+		}
+		$scope.onCodeBlur = function (index) {
+            if ($scope.replaceMaterialList[index].ptrCmpcode) {
+				$scope.errorObj[index].code = 0;
+            }
+			$scope.setShowSimilarCodeList($scope.isInCodeList[index], index);
+		}
+		$scope.onBrandBlur = function (index) {
+			if ($scope.replaceMaterialList[index].ptrBranden) {
+                $scope.errorObj[index].brand = 0;
+			}
+			$scope.setShowSimilarBrandList($scope.isInBrandList[index], index);
+		}
+		$scope.setCode = function (index, code) {
+			$scope.replaceMaterialList[index].ptrCmpcode = code;
+			$scope.setShowSimilarCodeList(false, index);
+		}
+		$scope.setBrand = function (index, brand) {
+			$scope.replaceMaterialList[index].ptrBranden = brand;
+			$scope.setShowSimilarBrandList(false, index);
+		}
+		// $scope.resetSimilar = function (index, type) {
+		// 	for (var i = 0; i < $scope.replaceMaterialList.length; i++) {
+		// 		if (index != i) {
+		// 			$scope.replaceMaterialList[i].showSimilarCodeList = false;
+		// 			$scope.replaceMaterialList[i].showSimilarBrandList = false;
+		// 		}
+		// 	}
+		// }
 	}]);
 
 	//类目选择模态框
@@ -2548,6 +2799,17 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			};
 			$modalInstance.close(a);
 		};
+		var getRealLen = function (str) {
+			var len = 0;
+			for (var i = 0; i < str.length; i++) {
+				if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+					len += 2;
+				} else {
+					len++;
+				}
+			}
+			return len;
+		}
 	}]);
 
 
@@ -2563,31 +2825,27 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
         $scope.confirmDelete = function () {
             if(deleteMaterial) {
                 if(selectAll) {
-                    if(standard_tab == 'standard') {
+
                         Material.deleteStandardAll({isPerson: 1}, function (data) {
                             if(data.code != 1) {
                                 toaster.pop('error','错误' ,data.message);
                             }else {
-                                toaster.pop('success', '删除成功');
-								$scope.deleteModal = false;
-                                $modalInstance.close(data);
-                            }
-                        }, function (response) {
-                            toaster.pop('error', '错误', response.data);
-                        });
-                    }else {
-                        Material.deleteUnstandardAll({isPerson: 1}, function (data) {
-                            if(data.code != 1) {
-                                toaster.pop('error', '错误', data.message);
-                            }else {
-                                toaster.pop('success', '删除成功');
-								$scope.deleteModal = false;
-                                $modalInstance.close(data);
+                                Material.deleteUnstandardAll({isPerson: 1}, function (data) {
+                                    if(data.code != 1) {
+                                        toaster.pop('error', '错误', data.message);
+                                    }else {
+                                        toaster.pop('success', '删除成功');
+                                        $scope.deleteModal = false;
+                                        $modalInstance.close(data);
+                                    }
+                                }, function (response) {
+                                    toaster.pop('error', '错误', response.data);
+                                });
                             }
                         }, function (response) {
                             toaster.pop('error', '错误', response.data);
                         });
-                    }
+
                 }else {
                     if(!$scope.ids || $scope.ids.length == 0) {
                         toaster.pop('warning', '提示','请选择要删除的信息');

+ 3 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -1544,6 +1544,9 @@
 		background: #fdd6d6;
 		line-height: 30px;
 	}
+	.wanted_list01 .tab table th {
+		color: #333 !important;
+	}
 </style>
 <div class="user_right fr">
 	<!--货品管理-->

+ 376 - 12
src/main/webapp/resources/view/vendor/forstore/vendor_material_person.html

@@ -109,6 +109,10 @@
 	.public-tab.table>tbody>tr>td{
 		border-top: none;
 		border-bottom: #e8e8e8 1px solid;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		padding: 0 10px;
 	}
 	.public-tab.table>tbody>tr>td a{
 		margin: 0;
@@ -125,14 +129,14 @@
 	.public-tab.table>tbody>tr>td span{
 		margin: 0;
 	}
-	.public-tab.table>tbody>tr>td span.brand-type{
+	/*.public-tab.table>tbody>tr>td span.brand-type{
 		display: inline-block;
 		margin: 0;
-		width: 80%;
+		width: 180px;
 		overflow: hidden;
 		text-overflow: ellipsis;
 		white-space: nowrap;
-	}
+	}*/
 	.public-tab.table>tbody>tr>td span:hover span {
 		color: #fff;
 		background: #5078cb;
@@ -237,6 +241,9 @@
 	.search-check .check .check-active label{
 		margin-right: 0 !important;
 	}
+	.check-input {
+		position: relative;
+	}
 	.check-input input{
 		display: none;
 	}
@@ -256,6 +263,11 @@
 	.check-input input[type="checkbox"]:checked + label{
 		background-position: -15px 0;
 	}
+	.check-input .standard {
+		position: absolute;
+		top: 0;
+		left: 0;
+	}
 	.record-line{
 		min-height: 30px;
 		font-size: 12px;
@@ -269,6 +281,9 @@
 	.wanted_list01 .pagination{
 		margin: 0;
 	}
+	.wanted_list01 .tab table th {
+		color: #333 !important;
+	}
 	.ng-table-pager{
 		padding-bottom: 20px;
 	}
@@ -492,7 +507,7 @@
 		background: url("static/img/icon/check-ok.png") no-repeat center;
 	}
 	/*分页鼠标悬停效果*/
-	.device .wanted_list01 a:hover {
+	.device .wanted_list01 .pagination a:hover {
 		 border-bottom: 1px solid #ddd!important;
 	}
 	.device .wanted_list01 a.page-a:hover{
@@ -1490,6 +1505,289 @@
 		position: absolute;
 		top: 45px;
 	}
+	.replace-row:hover {
+		background: #fff !important;
+	}
+	.replace-row td {
+		padding: 0 21px !important;
+	}
+	.replace-row td > div {
+		/*height: 67px;*/
+	}
+	.replace-row td > div > p {
+		display: inline-block;
+		float: left;
+		font-size: 14px;
+		height: 32px;
+		line-height: 32px;
+		padding-left: 10px;
+	}
+	.replace-row td > div > div {
+		display: inline-block;
+		float: left;
+		line-height: 32px;
+		width: 884px;
+	}
+	.replace-row td > div > div .replace-item {
+		display: inline-block;
+		width: 50%;
+		text-align: left;
+		background: #f6fbfe;
+		float: left;
+		height: 32px;
+	}
+	.replace-row td > div > div .replace-item:nth-child(2n-1) {
+		border-right: 1px solid #dde9fc;
+	}
+	.replace-row td > div > div .replace-item:nth-child(4n-1),
+	.replace-row td > div > div .replace-item:nth-child(4n) {
+		background: #eff4fd;
+	}
+	.replace-row td > div > div .replace-item i {
+		width: 18px;
+		height: 18px;
+		display: inline-block;
+		border-radius: 100%;
+		background: #9fd4ff;
+		color: #fff;
+		text-align: center;
+		line-height: 18px;
+		margin-left: 10px;
+		font-size: 12px;
+	}
+	.replace-row td > div > div .replace-item span {
+		display: inline-block;
+		width: 200px;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		vertical-align: middle;
+	}
+	.edit-replace-box {
+		position: fixed;
+		width: 510px;
+		top: 10%;
+		left: 33%;
+		/*-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+		/*-moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+		/*box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+		z-index: 1;
+		font-size: 14px;
+	}
+	.edit-replace-box .title {
+		position: relative;
+		height: 44px;
+		background: #5078cb;
+		line-height: 44px;
+		color: #fff;
+		border-top-right-radius: 5px;
+		border-top-left-radius: 5px;
+	}
+	.edit-replace-box .title > div {
+		display: inline-block;
+		padding-left: 57px;
+		width: 47%;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+	}
+	.edit-replace-box .title i {
+		position: absolute;
+		right: 10px;
+		top: 8px;
+		cursor: pointer;
+	}
+	.edit-replace-box .content {
+		padding: 9px 0;
+		background: #fff;
+	}
+	.edit-replace-box .content .content-line {
+		margin: 0 0 14px 0;
+		position: relative;
+	}
+	.edit-replace-box .content .content-line p {
+		margin-left: 16px;
+		font-size: 14px;
+	}
+	.edit-replace-box .content .content-line .form-item {
+		display: inline-block;
+		width: 49%;
+	}
+	.edit-replace-box .content .content-line .form-item span em {
+		color: #e30e16
+	}
+	/*.edit-replace-box .content .content-line .form-item > span i {*/
+		/*color: #fd2637;*/
+		/*margin-right: 4px;*/
+	/*}*/
+	.edit-replace-box .content .content-line .form-item input {
+		border: 1px solid #bfbfbf;
+		border-radius: 2px;
+		height: 28px;
+		padding: 0 8px;
+		display: inline-block;
+		width: 140px;
+		padding: 0 8px;
+	}
+	.edit-replace-box .content .content-line .form-item.form-left span {
+		display: inline-block;
+		width: 85px;
+		text-align: right;
+	}
+	.edit-replace-box .content .content-line .form-item.form-left span i {
+		width: 18px;
+		height: 18px;
+		display: inline-block;
+		border-radius: 100%;
+		background: #9fd4ff;
+		color: #fff;
+		text-align: center;
+		line-height: 18px;
+		margin-left: 10px;
+		font-size: 12px;
+		margin-right: 4px;
+	}
+	/*.edit-replace-box .content .content-line .form-item.form-left input {
+		width: 140px;
+		padding: 0 8px;
+	}*/
+	.edit-replace-box .content .content-line .form-item.form-right {
+		padding-left: 13px;
+		position: relative;
+	}
+	/*.edit-replace-box .content .content-line .form-item.form-right input {*/
+		/*width: 101px;*/
+		/*padding: 0 8px;*/
+	/*}*/
+	.edit-replace-box .content .content-line .form-item.form-right i {
+		cursor: pointer;
+	}
+	.edit-replace-box .operate {
+		background: #fff;
+		height: 62px;
+		text-align: center;
+		padding-top: 15px;
+		border-top: 1px solid #e4e5e6;
+		border-bottom-left-radius: 5px;
+		border-bottom-right-radius: 5px;
+	}
+	.edit-replace-box .operate span {
+		display: inline-block;
+		width: 64px;
+		height: 28px;
+		line-height: 28px;
+		text-align: center;
+		background: #5078cb;
+		color: #fff;
+		cursor: pointer;
+	}
+	.edit-replace-box .operate span:last-child {
+		margin-left: 15px;
+		background: #acabab;
+	}
+
+	.edit-replace-box .content .content-line .form-item ul.similar-list {
+		position: absolute;
+		top: 27px;
+		left: 89px;
+		background: #fff;
+		border: 1px solid #b5b5b5;
+		z-index: 1;
+		max-height: 120px;
+		overflow-y: auto;
+		overflow-x: hidden;
+		border-radius: 3px;
+		width: 141px;
+		font-size: 14px;
+	}
+	.edit-replace-box .content .content-line .form-item.form-right ul.similar-list {
+		width: 140px;
+		left: 65px;
+	}
+	.edit-replace-box .content .content-line .form-item ul.similar-list li {
+		height: 30px;
+		line-height: 30px;
+		cursor: pointer;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		padding: 0 5px;
+	}
+	.edit-replace-box .content .content-line .form-item ul.similar-list li:hover {
+		background: #5078cb;
+		color: #fff;
+	}
+	.edit-replace-box .content .content-line .form-item input.error {
+		border-color: #e30e16;
+	}
+	.open-more{
+		text-align: center;
+		background: #f6f9ff;
+		clear: both;
+		height: 27px;
+		line-height: normal !important;
+		margin-right: 7px;
+		margin-left: 94px;
+	}
+	.open-more a{
+		font-size: 12px;
+		width: 200px;
+		height: 15px;
+		display: inline-block;
+		border: #5e9fcb 1px dashed;
+		border-top: 0;
+		font-weight: inherit;
+		background: #f6f9ff;
+		border-bottom-left-radius: 50px;
+		border-bottom-right-radius: 50px;
+		line-height: 15px;
+		text-decoration: none;
+		position: relative;
+		top: -3px;
+		z-index: 1;
+	}
+	.open-more a i{
+		margin-right: 5px;
+		font-size: 20px;
+		vertical-align: middle;
+		position: relative;
+		top: -5px;
+		color: #4290f7;
+	}
+	.open-more div {
+		position: relative;
+		height: 27px;
+		border-top: 1px dashed #5e9fcb;
+		top: 9px;
+	}
+	.open-more div.active {
+		top: 19px;
+	}
+	.open-more div.active a{
+		border-top-left-radius: 50px;
+		border-top-right-radius: 50px;
+		position: relative;
+		top: -12px;
+		border-bottom: none;
+		border-top: #5e9fcb 1px dashed;
+		border-bottom-left-radius: 0;
+		border-bottom-right-radius: 0;
+		background: #f1f6ff;
+	}
+	.open-more div.active em{
+		top: 3px;
+	}
+	.open-more div.active i{
+		top: 0;
+	}
+	.open-more a em{
+		position: relative;
+		top: -4px;
+		color: #5078cb;
+	}
+	.device .wanted_list01 .open-more a:hover {
+		border-bottom: 1px dashed !important;
+	}
 </style>
 <div class="user_right fr">
 	<!--货品管理-->
@@ -1502,26 +1800,26 @@
 				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
 			</ul>
 		</div>
-		<div class="com_tab">
-			<ul class="fl distance" style="width: 100%">
+		<!--<div class="com_tab">
+			&lt;!&ndash;<ul class="fl distance" style="width: 100%">
 				<li ng-class="{active : standard_tab == 'unstandard'}"  ng-click="toggleStandard('unstandard')" title="非标产品({{nCount}})"><a href="" class="standard">非标产品(<em class="count">{{nCount}}</em>)</a></li>
 				<li ng-class="{active : standard_tab =='standard'}" ng-click="toggleStandard('standard')" title="标准产品({{sCount}})"><a href="" class="standard">标准产品(<em class="count">{{sCount}}</em>)</a></li>
-			</ul>
-			<!--匹配结果导航-->
+			</ul>&ndash;&gt;
+			&lt;!&ndash;匹配结果导航&ndash;&gt;
 			<div class="match-menu" ng-if="resultFrame">
                 <span>
                     <a ng-click="toggleTab('matchResult')">匹配结果</a>
                     <i class="fa fa-remove" ng-click="closeResultFrame('unstandard')"></i>
                 </span>
 			</div>
-		</div>
+		</div>-->
 		<!--非标和标准产品列表页-->
 		<div ng-if="standard_tab == 'unstandard' || standard_tab =='standard'">
 			<div class="search-check">
 				<div class="search fl">
 					<input type="text" class="form-control" ng-model="param.keyword" ng-search="onSearch()" placeholder="类目/型号/品牌"/>
 					<button ng-click="onSearch()">搜索</button>
-					<a ng-click="download()">批量导出</a>
+					<!--<a ng-click="download()">批量导出</a>-->
 				</div>
 				<div class="check fr">
 					<!--<a ng-show="!isBatch && standard_tab == 'unstandard'" ng-click="matchAll()"><span ng-show="!isBatch && standard_tab == 'unstandard'">一键匹配</span></a>-->
@@ -1569,20 +1867,24 @@
 						</td>
 					</tr>
 					</tbody>-->
-					<tbody ng-repeat="material in currenctMaterial">
+					<tbody ng-repeat="material in currenctMaterial track by $index">
 					<!--<tr ng-class="{ 'active': material.selected }" class="gre-bg">-->
 					<tr ng-class="{ 'active': material.selected, 'gre-bg' : material.exPandOper}">
 						<td class="check-input">
 							<span ng-show="isBatch"><input type="checkbox" ng-checked="material.isChoosed"  ng-click="chooseOne(material)"  id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>
 							<span
 									ng-show="!isBatch" ng-bind="(param.page - 1) * 10 + $index + 1"></span>
+							<img ng-if="material.standard == 0" src="static/img/store/common/nonstandard.png" alt="" class="standard"/>
+							<img ng-if="material.standard != 0" src="static/img/store/common/standard.png" alt="" class="standard"/>
 						</td>
 						<td>
 							<span ng-if="material.kind" ng-bind="material.kind" title="{{material.kind}}"></span>
 							<span ng-if="!material.kind" ng-bind="material.kinden || '-'" title="{{material.kinden || '-'}}"></span>
 						</td>
 						<td>
-                            <a class="brand-type" ng-if="material.cmpUuId" ng-href="product/component/{{material.cmpUuId}}/" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}" target="_blank"></a>
+							<span ng-if="material.cmpUuId">
+								<a class="brand-type" ng-bind="material.pcmpcode" ng-href="product/component/{{material.cmpUuId}}/" title="{{material.pcmpcode}}" target="_blank"></a>
+							</span>
                             <span class="brand-type" ng-if="!material.cmpUuId" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}"></span>
 						</td>
 						<td>
@@ -1599,6 +1901,7 @@
 							<!--<span ng-if="material.batchCount" ng-show="!isBatch && !material.exPandOper && !material.addGoodsOper" ng-click="expandGoods(material)"><span>展开<i class="fa fa-angle-down" style="margin-left:2px;"></i></span></span>-->
 							<!--收起-->
 							<span ng-show="!isBatch && material.exPandOper" ng-click="disExpandGoods(material)" class="packUp"><span>收起<i class="fa fa-angle-up" style="margin-left:2px;"></i></span></span>
+							<span ng-click="setActiveIndex($index,material)"><span>编辑可替代型号</span></span>
 							<!--<a ng-show="!isBatch" ng-click="showShelfArea(material)"><span ng-if="!isBatch">编辑</span></a>-->
 							<!--<span ng-show="!isBatch && (material.sold == 0 && material.canSell == 1)" ng-click="publishGoods(material)"><span ng-if="!isBatch">上架</span></span>-->
 						</td>
@@ -1945,6 +2248,30 @@
 							</div>
 						</td>
 					</tr>
+					<tr class="replace-row" ng-if="material.productReplaceList.length > 0">
+						<td colspan="6">
+							<div>
+								<p>可替代型号:</p>
+								<div class="replace-list">
+									<div class="replace-item" ng-repeat="replace in material.productReplaceList" ng-if="material.showMoreReplace || (!material.showMoreReplace && replace.detno < 5) ">
+										<i>{{replace.detno}}</i>
+										<span title="{{replace.ptrCmpcode}}">型号:{{replace.ptrCmpcode}}</span>
+										<span title="{{replace.ptrBranden}}">品牌:{{replace.ptrBranden}}</span>
+									</div>
+									<div ng-if="(material.productReplaceList.length < 4 && material.productReplaceList.length % 2 !== 0) || (material.productReplaceList.length > 4 && material.showMoreReplace && material.productReplaceList.length % 2 !== 0)" class="replace-item"></div>
+								</div>
+								<div class="open-more" ng-if="material.productReplaceList.length > 4">
+									<div>
+										<a href="javascript:void(0)" ng-click="material.showMoreReplace = !material.showMoreReplace" ng-if="material.productReplaceList.length > 4" ng-class="{'active': material.showMoreReplace}">
+											<em ng-bind="!material.showMoreReplace ? '查看更多' : '收起'"></em>
+											<i class="fa fa-angle-up" ng-if="material.showMoreReplace"></i>
+											<i class="fa fa-angle-down" ng-if="!material.showMoreReplace"></i>
+										</a>
+									</div>
+								</div>
+							</div>
+						</td>
+					</tr>
 					</tbody>
 				</table>
 				<div class="empty" ng-if="currenctMaterial.length == 0">
@@ -2169,6 +2496,43 @@
 	</div>
 </div>
 
+<div class="com-modal-wrap" ng-if="activeIndex > -1">
+	<div class="edit-replace-box">
+		<div class="title">
+			<div>型号:<span>{{editCmp}}</span></div>
+			<div>品牌:<span>{{editBrand}}</span></div>
+			<i class="fa fa-close" ng-click="setActiveIndex(-1)"></i>
+		</div>
+		<div class="content">
+			<div class="content-line">
+				<p>可替代型号:</p>
+			</div>
+			<div class="content-line" ng-repeat="(key, mate) in replaceMaterialList">
+				<div class="form-item form-left">
+					<span><i>{{key + 1}}</i><em>*</em>型号:</span>
+					<input type="text" class="form-control" ng-model="mate.ptrCmpcode" ng-change="onCodeChange(mate.ptrCmpcode, key)" ng-blur="onCodeBlur(key)" ng-class="{'error': errorObj[key].code == 1}" placeholder="请输入型号名称">
+                    <ul class="similar-list" ng-show="mate.showSimilarCodeList && similarCode.length > 0 && mate.ptrCmpcode" ng-mouseenter="setIsInCodeList(true, key)" ng-mouseleave="setIsInCodeList(false, key)">
+                        <li ng-repeat="sCode in similarCode" ng-bind="sCode.code" title="{{sCode.code}}" ng-click="setCode(key, sCode.code)"></li>
+                    </ul>
+				</div>
+				<div class="form-item form-right">
+					<span><em>*</em>品牌:</span>
+					<input type="text" class="form-control" ng-model="mate.ptrBranden" ng-change="onBrandChange(mate.ptrBranden, key)" ng-blur="onBrandBlur(key)" ng-class="{'error': errorObj[key].brand == 1}" placeholder="请输入品牌名称">
+                    <ul class="similar-list" ng-show="mate.showSimilarBrandList && similarBrand.length > 0 && mate.ptrBranden" ng-mouseenter="setIsInBrandList(true, key)" ng-mouseleave="setIsInBrandList(false, key)">
+                        <li ng-repeat="sBrand in similarBrand" ng-bind="sBrand.nameEn" title="{{sBrand.nameEn}}" ng-click="setBrand(key, sBrand.nameEn)"></li>
+                    </ul>
+                    <i class="fa fa-minus-circle" ng-if="replaceMaterialList.length > 1" ng-click="setReplies('sub', key)"></i>
+					<i class="fa fa-plus-circle" ng-if="replaceMaterialList.length -1 == key && replaceMaterialList.length < 10" ng-click="setReplies('add', key)"></i>
+				</div>
+			</div>
+		</div>
+		<div class="operate">
+			<span ng-click="setProductReplacesByPerson(replaceMaterialList)">确定</span>
+			<span ng-click="setActiveIndex(-1)">取消</span>
+		</div>
+	</div>
+</div>
+
 <style>
     /**/
     .wanted_list01 .empty{