Browse Source

Merge remote-tracking branch 'origin/dev-mysql' into feature-vendorRecommend-dongbw-180425

dongbw 8 years ago
parent
commit
c9909ed291
97 changed files with 6846 additions and 3691 deletions
  1. BIN
      jpg
  2. BIN
      pdf
  3. 6 11
      pom.xml
  4. 13 0
      src/main/java/com/uas/platform/b2c/common/account/controller/EnterpriseController.java
  5. 39 0
      src/main/java/com/uas/platform/b2c/common/account/model/Enterprise.java
  6. 8 0
      src/main/java/com/uas/platform/b2c/common/account/service/EnterpriseService.java
  7. 71 9
      src/main/java/com/uas/platform/b2c/common/account/service/impl/EnterpriseServiceImpl.java
  8. 26 3
      src/main/java/com/uas/platform/b2c/common/account/v2/service/impl/EnterpriseServiceImpl.java
  9. 1 0
      src/main/java/com/uas/platform/b2c/core/utils/PinyinUtils.java
  10. 530 484
      src/main/java/com/uas/platform/b2c/external/erp/product/util/ModelConverter.java
  11. 1 1
      src/main/java/com/uas/platform/b2c/logistics/model/DistributionRule.java
  12. 4 1
      src/main/java/com/uas/platform/b2c/logistics/service/impl/DistributionRuleServiceImpl.java
  13. 0 1
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java
  14. 19 0
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductReplaceDao.java
  15. 62 6
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductReplace.java
  16. 1 1
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java
  17. 43 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductReplaceServiceImpl.java
  18. 57 17
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java
  19. 34 20
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java
  20. 2 2
      src/main/java/com/uas/platform/b2c/prod/store/facade/impl/StoreApplyFacadeImpl.java
  21. 31 10
      src/main/java/com/uas/platform/b2c/prod/store/facade/impl/StoreInFacadeImpl.java
  22. 41 1
      src/main/java/com/uas/platform/b2c/prod/store/model/EnterpriseSimple.java
  23. 11 4
      src/main/java/com/uas/platform/b2c/prod/store/service/StoreInService.java
  24. 32 23
      src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreInServiceImpl.java
  25. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls
  26. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatchError-rmb.xls
  27. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatchError-usd.xls
  28. BIN
      src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls
  29. 14 0
      src/main/webapp/WEB-INF/spring/hessian.xml
  30. 1 0
      src/main/webapp/WEB-INF/spring/webmvc.xml
  31. 1 0
      src/main/webapp/WEB-INF/views/normal/user_center.html
  32. 1 0
      src/main/webapp/WEB-INF/views/normal/vendor_center.html
  33. 32 0
      src/main/webapp/resources/css/common/linkSaler.css
  34. 63 2
      src/main/webapp/resources/css/vendor/sell.css
  35. BIN
      src/main/webapp/resources/img/user/images/code.png
  36. BIN
      src/main/webapp/resources/img/user/images/codebg.png
  37. BIN
      src/main/webapp/resources/img/vendor/images/downicon.png
  38. 1 1
      src/main/webapp/resources/js/common/controllers/commonCtrls.js
  39. 28 16
      src/main/webapp/resources/js/common/module/chat_web_module.js
  40. 4 0
      src/main/webapp/resources/js/common/query/enterprise.js
  41. 7 1
      src/main/webapp/resources/js/common/query/material.js
  42. 91 1
      src/main/webapp/resources/js/usercenter/controllers/forstore/bom_detail_ctrl.js
  43. 8 4
      src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js
  44. 95 3
      src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js
  45. 12 2
      src/main/webapp/resources/js/usercenter/main.js
  46. 13 1
      src/main/webapp/resources/js/vendor/app.js
  47. 1 0
      src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js
  48. 37 14
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js
  49. 27 9
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_index_ctrl.js
  50. 452 3
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js
  51. 2995 2869
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js
  52. 2 1
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_apply_ctrl.js
  53. 62 2
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_maintain_ctrl.js
  54. 6 0
      src/main/webapp/resources/lib/clipboard.min.js
  55. 0 0
      src/main/webapp/resources/lib/qrcode.min.js
  56. 2 2
      src/main/webapp/resources/view/admin/store/fragments/enterprise_info.html
  57. 2 2
      src/main/webapp/resources/view/admin/store_application_maintenance.html
  58. 4 4
      src/main/webapp/resources/view/common/sidebar.html
  59. 9 0
      src/main/webapp/resources/view/common/store_header.html
  60. 6 3
      src/main/webapp/resources/view/store/default/contact.html
  61. 23 0
      src/main/webapp/resources/view/usercenter/forstore/account_manager.html
  62. 140 12
      src/main/webapp/resources/view/usercenter/forstore/bomDetail.html
  63. 42 1
      src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html
  64. 24 1
      src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html
  65. 23 0
      src/main/webapp/resources/view/usercenter/forstore/buyer_invoice_record.html
  66. 23 0
      src/main/webapp/resources/view/usercenter/forstore/buyer_no_invoice.html
  67. 65 10
      src/main/webapp/resources/view/usercenter/forstore/buyer_order.html
  68. 15 1
      src/main/webapp/resources/view/usercenter/forstore/order_detail.html
  69. 27 6
      src/main/webapp/resources/view/usercenter/forstore/order_pay.html
  70. 23 0
      src/main/webapp/resources/view/usercenter/forstore/pay_center.html
  71. 2 2
      src/main/webapp/resources/view/usercenter/forstore/query_logistics.html
  72. 249 25
      src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html
  73. 23 0
      src/main/webapp/resources/view/vendor/forstore/pay_center.html
  74. 24 1
      src/main/webapp/resources/view/vendor/forstore/purchaseOffer.html
  75. 15 1
      src/main/webapp/resources/view/vendor/forstore/purchase_detail.html
  76. 31 8
      src/main/webapp/resources/view/vendor/forstore/seekPurchase.html
  77. 23 0
      src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html
  78. 26 12
      src/main/webapp/resources/view/vendor/forstore/vendor_account_management.html
  79. 23 0
      src/main/webapp/resources/view/vendor/forstore/vendor_brand_apply.html
  80. 23 0
      src/main/webapp/resources/view/vendor/forstore/vendor_brand_apply_list.html
  81. 23 0
      src/main/webapp/resources/view/vendor/forstore/vendor_component_apply.html
  82. 56 1
      src/main/webapp/resources/view/vendor/forstore/vendor_component_applylist.html
  83. 24 0
      src/main/webapp/resources/view/vendor/forstore/vendor_component_batchapply.html
  84. 56 1
      src/main/webapp/resources/view/vendor/forstore/vendor_component_batchapplylist.html
  85. 15 1
      src/main/webapp/resources/view/vendor/forstore/vendor_delivery.html
  86. 30 2
      src/main/webapp/resources/view/vendor/forstore/vendor_delivery_rule.html
  87. 23 0
      src/main/webapp/resources/view/vendor/forstore/vendor_distributor.html
  88. 23 0
      src/main/webapp/resources/view/vendor/forstore/vendor_logistics.html
  89. 414 22
      src/main/webapp/resources/view/vendor/forstore/vendor_material.html
  90. 70 21
      src/main/webapp/resources/view/vendor/forstore/vendor_material_person.html
  91. 24 1
      src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html
  92. 96 14
      src/main/webapp/resources/view/vendor/forstore/vendor_order.html
  93. 13 11
      src/main/webapp/resources/view/vendor/forstore/vendor_store_apply.html
  94. 57 2
      src/main/webapp/resources/view/vendor/forstore/vendor_store_maintain.html
  95. 23 0
      src/main/webapp/resources/view/vendor/forstore/vendor_take_self.html
  96. 24 1
      src/main/webapp/resources/view/vendor/forstore/vendor_undercarriage.html
  97. 23 0
      src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

BIN
jpg


BIN
pdf


+ 6 - 11
pom.xml

@@ -73,11 +73,6 @@
 			<artifactId>b2c-erp-api</artifactId>
 			<version>0.0.2-SNAPSHOT</version>
 		</dependency>
-		<dependency>
-			<groupId>com.uas.api</groupId>
-			<artifactId>b2c-manage-api</artifactId>
-			<version>0.0.1</version>
-		</dependency>
 		<dependency>
 			<groupId>com.caucho</groupId>
 			<artifactId>hessian</artifactId>
@@ -408,12 +403,6 @@
 				</exclusion>
 			</exclusions>
 		</dependency>
-
-        <dependency>
-            <groupId>net.sourceforge.pinyin4j</groupId>
-            <artifactId>pinyin4j</artifactId>
-			<version>1.1.0</version>
-        </dependency>
         <!-- security -->
 		<dependency>
 			<groupId>org.springframework.security</groupId>
@@ -474,6 +463,12 @@
 			<artifactId>ps-entity</artifactId>
 			<version>0.0.1-SNAPSHOT</version>
 		</dependency>
+		<dependency>
+			<groupId>net.sourceforge.pinyin4j</groupId>
+			<artifactId>pinyin4j</artifactId>
+			<version>1.1.0</version>
+		</dependency>
+
 		<!--Hutool POI工具类(对MS Office操作)-->
 		<!--<dependency>
 			<groupId>org.apache.poi</groupId>

+ 13 - 0
src/main/java/com/uas/platform/b2c/common/account/controller/EnterpriseController.java

@@ -340,4 +340,17 @@ public class EnterpriseController {
         }
         return auditApply;
     }
+
+
+	/**
+	 * 返回企业电话号码和管理员电话号码;
+	 * @param enuu
+	 */
+	@RequestMapping(value = "/{enuu}/tels", method = RequestMethod.GET)
+	public ResultMap getEntelAndAdmintel(@PathVariable Long enuu){
+		if (enuu == null) {
+			throw new IllegalArgumentException("企业uu没有传值!");
+		}
+		return enterpriseService.getEntelAndAdmintel(enuu);
+	}
 }

+ 39 - 0
src/main/java/com/uas/platform/b2c/common/account/model/Enterprise.java

@@ -75,6 +75,21 @@ public class Enterprise implements Serializable {
 	 */
 	@Column(name = "en_fax")
 	private String enFax;
+	/**
+	 * 手机
+	 */
+	@Column(name = "en_phone")
+	private String enPhone;
+	/**
+	 * 微信
+	 */
+	@Column(name = "en_weixin")
+	private String enWeixin;
+	/**
+	 * QQ
+	 */
+	@Column(name = "en_qq")
+	private String enQQ;
 	/**
 	 * 公司邮箱
 	 */
@@ -360,6 +375,30 @@ public class Enterprise implements Serializable {
 		this.enValidCode = enValidCode;
 	}
 
+	public String getEnPhone() {
+		return enPhone;
+	}
+
+	public void setEnPhone(String enPhone) {
+		this.enPhone = enPhone;
+	}
+
+	public String getEnWeixin() {
+		return enWeixin;
+	}
+
+	public void setEnWeixin(String enWeixin) {
+		this.enWeixin = enWeixin;
+	}
+
+	public String getEnQQ() {
+		return enQQ;
+	}
+
+	public void setEnQQ(String enQQ) {
+		this.enQQ = enQQ;
+	}
+
 	@Override
 	public int hashCode() {
 		final int prime = 31;

+ 8 - 0
src/main/java/com/uas/platform/b2c/common/account/service/EnterpriseService.java

@@ -74,4 +74,12 @@ public interface EnterpriseService {
 	Enterprise openVendor(Long enUU , boolean isRead , boolean isOpen);
 
 
+	/**
+	 * 根据传来的企业uu查找其entel和admin电话(验证营业执照)
+	 * @return 店铺信息
+	 */
+	ResultMap getEntelAndAdmintel(Long enUU);
+
+
+
 }

+ 71 - 9
src/main/java/com/uas/platform/b2c/common/account/service/impl/EnterpriseServiceImpl.java

@@ -15,26 +15,23 @@ import com.uas.platform.b2c.logistics.model.Receipt;
 import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 import com.uas.platform.b2c.prod.store.model.EnterpriseSimple;
 import com.uas.platform.b2c.prod.store.model.StoreIn;
-import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2c;
 import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.exception.SystemException;
 import com.uas.platform.core.model.Status;
-import com.uas.sso.entity.UserSpaceDetail;
 import com.uas.sso.entity.UserSpaceView;
 import com.uas.sso.entity.UserView;
 import com.uas.sso.util.AccountUtils;
 import org.apache.commons.collections.CollectionUtils;
-import org.hibernate.loader.custom.Return;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.stereotype.Service;
-import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 
-import java.lang.reflect.Array;
-import java.util.*;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Service
 public class EnterpriseServiceImpl implements EnterpriseService{
@@ -125,8 +122,54 @@ public class EnterpriseServiceImpl implements EnterpriseService{
 		//更新店铺中的企业信息
 		List<StoreIn> storeIns = storeInDao.findByEnUU(enterprise.getUu());
 		for (StoreIn storeIn : storeIns) {
-            EnterpriseSimple enterpriseSimple = EnterpriseSimple.translateSimple(enterprise);
-			storeIn.setEnterprise(enterpriseSimple);
+			EnterpriseSimple newEnterprise;
+			newEnterprise = new EnterpriseSimple();
+			EnterpriseSimple enterpriseOld = storeIn.getEnterprise();
+			BeanUtils.copyProperties(enterpriseOld,newEnterprise);
+			if (enterpriseOld != null) {
+				if (enterprise.getEnName() !=null) {
+					newEnterprise.setEnName(enterprise.getEnName());
+				}
+				if (enterprise.getEnAddress() !=null) {
+					newEnterprise.setEnAddress(enterprise.getEnAddress());
+				}
+				if (enterprise.getEnFax() !=null) {
+					newEnterprise.setEnFax(enterprise.getEnFax());
+				}
+				if (enterprise.getEnTel() !=null) {
+					newEnterprise.setEnTel(enterprise.getEnTel());
+				}
+				if (enterprise.getEnType() !=null) {
+					newEnterprise.setEnType(enterprise.getEnType());
+				}
+				if (enterprise.getEnBussinessCode() !=null) {
+					newEnterprise.setEnBusinessCode(enterprise.getEnBussinessCode());
+				}
+				if (enterprise.getEnDate() !=null) {
+					newEnterprise.setEnDate(enterprise.getEnDate());
+				}
+				if (enterprise.getEnUrl() !=null) {
+					newEnterprise.setEnUrl(enterprise.getEnUrl());
+				}
+				if (enterprise.getEnLogoUrl() !=null) {
+					newEnterprise.setEnLogoUrl(enterprise.getEnLogoUrl());
+				}
+				if (enterprise.getEnEmail() !=null) {
+					newEnterprise.setEnLogoUrl(enterprise.getEnEmail());
+				}
+				if (enterprise.getEnPhone() !=null) {
+					newEnterprise.setEnLogoUrl(enterprise.getEnPhone());
+				}
+				if (enterprise.getEnWeixin() !=null) {
+					newEnterprise.setEnLogoUrl(enterprise.getEnWeixin());
+				}
+				if (enterprise.getEnQQ() !=null) {
+					newEnterprise.setEnLogoUrl(enterprise.getEnQQ());
+				}
+			} else {
+				newEnterprise = EnterpriseSimple.translateSimple(enterprise);
+			}
+			storeIn.setEnterprise(newEnterprise);
 			storeInDao.save(storeIn);
 		}
 		if (existEnterprise == null)
@@ -270,4 +313,23 @@ public class EnterpriseServiceImpl implements EnterpriseService{
 		Enterprise enterprise = enterpriseDao.save(existEnterprise);
 		return null;
 	}
+
+	@Override
+	public ResultMap getEntelAndAdmintel(Long enUU) {
+		ResultMap resultMap = new ResultMap();
+		HashMap<String, String> tels = new HashMap<>();
+		Enterprise enterprise = enterpriseDao.findOne(enUU);
+		if (enterprise != null && enterprise.getEnAdminuu() != null) {
+			UserBaseInfo userBaseInfo = userBaseInfoDao.findUserByUserUU(enterprise.getEnAdminuu());
+			if (!StringUtils.isEmpty(userBaseInfo.getUserTel())) {
+				tels.put("adminTel", userBaseInfo.getUserTel());
+			}
+		}
+		if (enterprise != null && !StringUtils.isEmpty(enterprise.getEnTel())) {
+			tels.put("entel", enterprise.getEnTel());
+			tels.put("enuu", enterprise.getUu()+"");
+		}
+		resultMap.setData(tels);
+		return resultMap;
+	}
 }

+ 26 - 3
src/main/java/com/uas/platform/b2c/common/account/v2/service/impl/EnterpriseServiceImpl.java

@@ -9,6 +9,10 @@ import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.common.account.v2.service.EnterpriseService;
 import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
+import com.uas.platform.b2c.fa.payment.utils.StringUtils;
+import com.uas.platform.b2c.prod.store.dao.StoreInDao;
+import com.uas.platform.b2c.prod.store.model.EnterpriseSimple;
+import com.uas.platform.b2c.prod.store.model.StoreIn;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.sso.entity.UserSpaceView;
 import org.apache.commons.collections.CollectionUtils;
@@ -29,6 +33,8 @@ public class EnterpriseServiceImpl implements EnterpriseService {
 
 	@Autowired
     private UserDao userDao;
+    @Autowired
+	private StoreInDao storeInDao;
 
     private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
@@ -52,12 +58,21 @@ public class EnterpriseServiceImpl implements EnterpriseService {
         if (enterprise == null || enterprise.getUu() == null) {
             enterprise = new Enterprise();
         }
+        if (!StringUtils.isEmpty(userSpaceView.getAccessSecret())) {
+            enterprise.setAccessSecret(userSpaceView.getAccessSecret());
+        }
         enterprise.setEnAddress(userSpaceView.getRegAddress());
         //enterprise.setEnArea(userSpaceView.get());
         enterprise.setEnCorporation(userSpaceView.getCorporation());
         enterprise.setEnBussinessCode(userSpaceView.getBusinessCode());
        // enterprise.setEnFax(userSpaceView.);
-        enterprise.setEnTel(userSpaceView.getTelephone());
+        String enTel = enterprise.getEnTel();
+        if (enTel == null) {
+            enterprise.setEnTel(userSpaceView.getTelephone());
+            if (userSpaceView.getTelephone() == null) {
+                enterprise.setEnTel(userSpaceView.getAdmin().getMobile());
+            }
+        }
         //enterprise.setEnEmail(userSpaceView.get());
         //enterprise.setEnIndustry(userSpaceView.());
         enterprise.setEnName(userSpaceView.getSpaceName());
@@ -77,14 +92,22 @@ public class EnterpriseServiceImpl implements EnterpriseService {
                 adminUser = users.get(0);
             }
         }
-
         // 保存新注册企业与用户的关联关系
         if (adminUser != null) {
             adminUser.addEnterprise(newEn);
             userDao.save(adminUser);
         }
-
         if(oldenterprise != null && oldenterprise.getUu() != null) {
+            try {
+                List<StoreIn> storeIns = storeInDao.findByEnUU(enterprise.getUu());
+                if (storeIns != null && storeIns.size() > 0) {
+                    storeIns.get(0).setEnterprise(EnterpriseSimple.translateSimple(enterprise));
+                    storeIns.get(0).setStoreName(enterprise.getEnName());
+                    storeInDao.save(storeIns.get(0));
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
             logger.log("更新企业信息", enterprise.getUu()+"time: " + sdf.format(new Date()), enterprise.getUu(), 0L);
         } else {
             logger.log("新增企业信息", enterprise.getUu()+"time: " + sdf.format(new Date()), enterprise.getUu(), 0L);

+ 1 - 0
src/main/java/com/uas/platform/b2c/core/utils/PinyinUtils.java

@@ -5,6 +5,7 @@ import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
 import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
 import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
 
+
 /**
  * 拼音处理工具
  * Created by wangyc on 2017/3/22.

+ 530 - 484
src/main/java/com/uas/platform/b2c/external/erp/product/util/ModelConverter.java

@@ -4,13 +4,14 @@ import com.uas.api.b2c_erp.baisc.model.*;
 import com.uas.api.b2c_erp.operation.model.OperationInfoUas;
 import com.uas.api.b2c_erp.seller.model.GoodsSimpleUas;
 import com.uas.api.b2c_erp.seller.model.Prod;
+import com.uas.api.b2c_erp.seller.model.ProductReplaceErp;
 import com.uas.api.domain.IPage;
 import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.core.constant.Status;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.external.erp.product.model.OperationInfo;
 import com.uas.platform.b2c.prod.commodity.model.Product;
-import com.uas.platform.b2c.prod.commodity.model.ProductPrivate;
+import com.uas.platform.b2c.prod.commodity.model.ProductReplace;
 import com.uas.platform.b2c.prod.product.brand.modal.Brand;
 import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
 import com.uas.platform.b2c.prod.product.brand.modal.BrandSubmit;
@@ -30,511 +31,556 @@ import java.util.*;
 
 /**
  * erp<==>商城对象转换类
+ *
  * @author suntg
  * @version 2017年8月2日19:48:50 wangyc 完善注释
  */
 public class ModelConverter {
 
-	/**
-	 * 将UAS品牌申请转换成brandSubmit
-	 * 
-	 * @param uas UAS品牌申请
-	 * @return 商城品牌申请
-	 */
-	public static BrandSubmit getBrandSubmit(BrandSubmitUas uas) {
-		BrandSubmit brandSubmit = new BrandSubmit();
-		brandSubmit.setId(uas.getId());
-		brandSubmit.setApplication(uas.getApplication());
-		brandSubmit.setAchievement(uas.getAchievement());
-		brandSubmit.setArea(uas.getArea());
-		brandSubmit.setBrief(uas.getBrief());
-		brandSubmit.setUrl(uas.getUrl());
-		brandSubmit.setLogoUrl(uas.getLogoUrl());
-		brandSubmit.setNameCn(uas.getNameCn());
-		brandSubmit.setNameEn(uas.getNameEn());
-		brandSubmit.setSeries(uas.getSeries());
-		brandSubmit.setVendor(uas.getVendor());
-		brandSubmit.setSource("来自接口");
-		brandSubmit.setImid(uas.getImid());
-		brandSubmit.setUuid(uas.getUuid());
-		brandSubmit.setVersion(uas.getVersion());
-		brandSubmit.setModifyenuu(uas.getModifyenuu());
-		brandSubmit.setModifyuu(uas.getModifyuu());
-		return brandSubmit;
-	}
+    /**
+     * 将UAS品牌申请转换成brandSubmit
+     *
+     * @param uas UAS品牌申请
+     * @return 商城品牌申请
+     */
+    public static BrandSubmit getBrandSubmit(BrandSubmitUas uas) {
+        BrandSubmit brandSubmit = new BrandSubmit();
+        brandSubmit.setId(uas.getId());
+        brandSubmit.setApplication(uas.getApplication());
+        brandSubmit.setAchievement(uas.getAchievement());
+        brandSubmit.setArea(uas.getArea());
+        brandSubmit.setBrief(uas.getBrief());
+        brandSubmit.setUrl(uas.getUrl());
+        brandSubmit.setLogoUrl(uas.getLogoUrl());
+        brandSubmit.setNameCn(uas.getNameCn());
+        brandSubmit.setNameEn(uas.getNameEn());
+        brandSubmit.setSeries(uas.getSeries());
+        brandSubmit.setVendor(uas.getVendor());
+        brandSubmit.setSource("来自接口");
+        brandSubmit.setImid(uas.getImid());
+        brandSubmit.setUuid(uas.getUuid());
+        brandSubmit.setVersion(uas.getVersion());
+        brandSubmit.setModifyenuu(uas.getModifyenuu());
+        brandSubmit.setModifyuu(uas.getModifyuu());
+        return brandSubmit;
+    }
 
-	/**
-	 * 属性值转换为uas属性申请
-	 * @param property 属性值
-	 * @return uas属性申请
-	 */
-	public static PropertySubmitUas convertUas(PropertyValue property) {
-		PropertySubmitUas uas = new PropertySubmitUas();
-		uas.setPropertyId(property.getPropertyid());
-		uas.setStringValue(property.getValue());
-		uas.setMax(property.getMax());
-		uas.setMin(property.getMin());
-		uas.setNumberic(property.getNumberic());
-		uas.setDetno(property.getDetno());
-		return uas;
-	}
+    /**
+     * 属性值转换为uas属性申请
+     *
+     * @param property 属性值
+     * @return uas属性申请
+     */
+    public static PropertySubmitUas convertUas(PropertyValue property) {
+        PropertySubmitUas uas = new PropertySubmitUas();
+        uas.setPropertyId(property.getPropertyid());
+        uas.setStringValue(property.getValue());
+        uas.setMax(property.getMax());
+        uas.setMin(property.getMin());
+        uas.setNumberic(property.getNumberic());
+        uas.setDetno(property.getDetno());
+        return uas;
+    }
 
-	/**
-	 * 品牌转换为uas品牌申请
-	 * @param brand 品牌
-	 * @return uas品牌申请
-	 */
-	public static BrandSubmitUas convertUas(Brand brand) {
-		BrandSubmitUas uas = new BrandSubmitUas();
-		uas.setId(brand.getId());
-		uas.setApplication(brand.getApplication());
-		uas.setAchievement(brand.getAchievement());
-		uas.setArea(brand.getArea());
-		uas.setBrief(brand.getBrief());
-		uas.setUrl(brand.getUrl());
-		uas.setLogoUrl(brand.getLogoUrl());
-		uas.setNameCn(brand.getNameCn());
-		uas.setNameEn(brand.getNameEn());
-		uas.setSeries(brand.getSeries());
-		uas.setUuid(brand.getUuid());
-		uas.setVendor(brand.getVendor());
-		uas.setVersion(brand.getVersion());
-		return uas;
-	}
+    /**
+     * 品牌转换为uas品牌申请
+     *
+     * @param brand 品牌
+     * @return uas品牌申请
+     */
+    public static BrandSubmitUas convertUas(Brand brand) {
+        BrandSubmitUas uas = new BrandSubmitUas();
+        uas.setId(brand.getId());
+        uas.setApplication(brand.getApplication());
+        uas.setAchievement(brand.getAchievement());
+        uas.setArea(brand.getArea());
+        uas.setBrief(brand.getBrief());
+        uas.setUrl(brand.getUrl());
+        uas.setLogoUrl(brand.getLogoUrl());
+        uas.setNameCn(brand.getNameCn());
+        uas.setNameEn(brand.getNameEn());
+        uas.setSeries(brand.getSeries());
+        uas.setUuid(brand.getUuid());
+        uas.setVendor(brand.getVendor());
+        uas.setVersion(brand.getVersion());
+        return uas;
+    }
 
-	/**
-	 * 器件信息转换为uas器件申请
-	 * @param component 器件信息
-	 * @return uas器件申请
-	 */
-	public static ComponentSubmitUas convertUas(Component component) {
-		ComponentSubmitUas uas = new ComponentSubmitUas();
-		uas.setUuid(component.getUuid());
-		uas.setAttach(component.getAttach());
-		uas.setUnit(component.getUnit());
-		uas.setWeight(component.getWeight());
-		uas.setCode(component.getCode());
-		uas.setBrandid(component.getBrandid());
-		uas.setKindid(component.getKindid());
-		uas.setDescription(component.getDescription());
-		uas.setImg(component.getImg());
-		uas.setPackaging(component.getEncapsulation());
-		uas.setVersion(component.getVersion());
-		uas.setBrandName(component.getBrand().getNameCn());
-		uas.setKindNameCn(component.getKind().getNameCn());
-		Set<PropertySubmitUas> uasProperties = new HashSet<PropertySubmitUas>();
-		for (PropertyValue property : component.getProperties()) {
-			PropertySubmitUas uasProperty = ModelConverter.convertUas(property);
-			uasProperties.add(uasProperty);
-		}
-		uas.setProperties(uasProperties);
-		return uas;
-	}
+    /**
+     * 器件信息转换为uas器件申请
+     *
+     * @param component 器件信息
+     * @return uas器件申请
+     */
+    public static ComponentSubmitUas convertUas(Component component) {
+        ComponentSubmitUas uas = new ComponentSubmitUas();
+        uas.setUuid(component.getUuid());
+        uas.setAttach(component.getAttach());
+        uas.setUnit(component.getUnit());
+        uas.setWeight(component.getWeight());
+        uas.setCode(component.getCode());
+        uas.setBrandid(component.getBrandid());
+        uas.setKindid(component.getKindid());
+        uas.setDescription(component.getDescription());
+        uas.setImg(component.getImg());
+        uas.setPackaging(component.getEncapsulation());
+        uas.setVersion(component.getVersion());
+        uas.setBrandName(component.getBrand().getNameCn());
+        uas.setKindNameCn(component.getKind().getNameCn());
+        Set<PropertySubmitUas> uasProperties = new HashSet<PropertySubmitUas>();
+        for (PropertyValue property : component.getProperties()) {
+            PropertySubmitUas uasProperty = ModelConverter.convertUas(property);
+            uasProperties.add(uasProperty);
+        }
+        uas.setProperties(uasProperties);
+        return uas;
+    }
 
-	/**
-	 * uas器件申请转换为商城器件申请
-	 * @param uas uas器件申请
-	 * @return 商城器件申请
-	 */
-	public static ComponentSubmit getComponentSubmit(ComponentSubmitUas uas) {
-		ComponentSubmit componentSubmit = new ComponentSubmit();
-		componentSubmit.setId(uas.getId());
-		componentSubmit.setCode(uas.getCode());
-		componentSubmit.setEncapsulation(uas.getPackaging());
-		componentSubmit.setKindid(uas.getKindid());
-		componentSubmit.setKindName(uas.getKindNameCn());
-		componentSubmit.setBrandid(uas.getBrandid());
-		componentSubmit.setBrandName(uas.getBrandName());
-		componentSubmit.setUuid(uas.getUuid());
-		componentSubmit.setVersion(uas.getVersion());
-		componentSubmit.setImg(uas.getImg());
-		componentSubmit.setDescription(uas.getDescription());
-		componentSubmit.setImid(uas.getImid());
-		componentSubmit.setWeight(uas.getWeight());
-		componentSubmit.setUnit(uas.getUnit());
-		componentSubmit.setAttach(uas.getAttach());
-		componentSubmit.setSource("来自接口");
-		componentSubmit.setModifyenuu(uas.getModifyenuu());
-		componentSubmit.setModifyuu(uas.getModifyuu());
-		Set<PropertySubmitUas> propertiesUas = uas.getProperties();
-		Set<PropertyValueSubmit> properties = new HashSet<PropertyValueSubmit>();
-		for (PropertySubmitUas propertyUas : propertiesUas) {
-			PropertyValueSubmit property = new PropertyValueSubmit();
-			property.setPropertyid(propertyUas.getPropertyId());
-			property.setDetno(propertyUas.getDetno());
-			property.setStringValue(propertyUas.getStringValue());
-			property.setNumberic(propertyUas.getNumberic());
-			property.setUnit(propertyUas.getUnit());
-			property.setMin(propertyUas.getMin());
-			property.setMax(propertyUas.getMax());
-			properties.add(property);
-		}
-		componentSubmit.setProperties(properties);
-		return componentSubmit;
-	}
+    /**
+     * uas器件申请转换为商城器件申请
+     *
+     * @param uas uas器件申请
+     * @return 商城器件申请
+     */
+    public static ComponentSubmit getComponentSubmit(ComponentSubmitUas uas) {
+        ComponentSubmit componentSubmit = new ComponentSubmit();
+        componentSubmit.setId(uas.getId());
+        componentSubmit.setCode(uas.getCode());
+        componentSubmit.setEncapsulation(uas.getPackaging());
+        componentSubmit.setKindid(uas.getKindid());
+        componentSubmit.setKindName(uas.getKindNameCn());
+        componentSubmit.setBrandid(uas.getBrandid());
+        componentSubmit.setBrandName(uas.getBrandName());
+        componentSubmit.setUuid(uas.getUuid());
+        componentSubmit.setVersion(uas.getVersion());
+        componentSubmit.setImg(uas.getImg());
+        componentSubmit.setDescription(uas.getDescription());
+        componentSubmit.setImid(uas.getImid());
+        componentSubmit.setWeight(uas.getWeight());
+        componentSubmit.setUnit(uas.getUnit());
+        componentSubmit.setAttach(uas.getAttach());
+        componentSubmit.setSource("来自接口");
+        componentSubmit.setModifyenuu(uas.getModifyenuu());
+        componentSubmit.setModifyuu(uas.getModifyuu());
+        Set<PropertySubmitUas> propertiesUas = uas.getProperties();
+        Set<PropertyValueSubmit> properties = new HashSet<PropertyValueSubmit>();
+        for (PropertySubmitUas propertyUas : propertiesUas) {
+            PropertyValueSubmit property = new PropertyValueSubmit();
+            property.setPropertyid(propertyUas.getPropertyId());
+            property.setDetno(propertyUas.getDetno());
+            property.setStringValue(propertyUas.getStringValue());
+            property.setNumberic(propertyUas.getNumberic());
+            property.setUnit(propertyUas.getUnit());
+            property.setMin(propertyUas.getMin());
+            property.setMax(propertyUas.getMax());
+            properties.add(property);
+        }
+        componentSubmit.setProperties(properties);
+        return componentSubmit;
+    }
 
-	/**
-	 * 商城器件申请转换为uas器件申请
-	 * @param componentSubmit 商城器件申请
-	 * @return uas器件申请
-	 */
-	public static ComponentSubmitUasInfo convertUasInfo(ComponentSubmit componentSubmit) {
-		ComponentSubmitUasInfo uas = new ComponentSubmitUasInfo();
-		uas.setId(componentSubmit.getId());
-		uas.setUuid(componentSubmit.getUuid());
-		uas.setCode(componentSubmit.getCode());
-		uas.setKindid(componentSubmit.getKindid());
-		uas.setBrandid(componentSubmit.getBrandid());
-		uas.setImg(componentSubmit.getImg());
-		uas.setStatus(componentSubmit.getStatus());
-		uas.setAuditOpinion(componentSubmit.getAuditOpinion());
-		return uas;
-	}
+    /**
+     * 商城器件申请转换为uas器件申请
+     *
+     * @param componentSubmit 商城器件申请
+     * @return uas器件申请
+     */
+    public static ComponentSubmitUasInfo convertUasInfo(ComponentSubmit componentSubmit) {
+        ComponentSubmitUasInfo uas = new ComponentSubmitUasInfo();
+        uas.setId(componentSubmit.getId());
+        uas.setUuid(componentSubmit.getUuid());
+        uas.setCode(componentSubmit.getCode());
+        uas.setKindid(componentSubmit.getKindid());
+        uas.setBrandid(componentSubmit.getBrandid());
+        uas.setImg(componentSubmit.getImg());
+        uas.setStatus(componentSubmit.getStatus());
+        uas.setAuditOpinion(componentSubmit.getAuditOpinion());
+        return uas;
+    }
 
-	/**
-	 * 商城器件申请转换为uas器件申请
-	 * @param componentSubmit 商城器件申请
-	 * @return uas器件申请
-	 */
-	public static ComponentSubmitUas convertUas(ComponentSubmit componentSubmit) {
-		ComponentSubmitUas uas = new ComponentSubmitUas();
-		uas.setId(componentSubmit.getId());
-		uas.setUuid(componentSubmit.getUuid());
-		uas.setStatus(componentSubmit.getStatus());
-		uas.setCode(componentSubmit.getCode());
-		uas.setVersion(componentSubmit.getVersion());
-		uas.setPackaging(componentSubmit.getEncapsulation());
-		uas.setBrandid(componentSubmit.getBrandid());
-		uas.setKindid(componentSubmit.getKindid());
-		uas.setImid(componentSubmit.getImid());
-		uas.setImg(componentSubmit.getImg());
-		uas.setWeight(componentSubmit.getWeight());
-		uas.setUnit(componentSubmit.getUnit());
-		uas.setAttach(componentSubmit.getAttach());
-		uas.setDescription(componentSubmit.getDescription());
-		uas.setModifyenuu(componentSubmit.getModifyenuu());
-		uas.setModifyuu(componentSubmit.getModifyuu());
-		Set<PropertySubmitUas> propertiesUas = new HashSet<PropertySubmitUas>();
-		for (PropertyValueSubmit property : componentSubmit.getProperties()) {
-			PropertySubmitUas propertyUas = new PropertySubmitUas();
-			propertyUas.setPropertyId(property.getPropertyid());
-			propertyUas.setDetno(property.getDetno());
-			propertyUas.setStringValue(property.getStringValue());
-			propertyUas.setPropertyName(property.getProperty().getLabelCn());
-			propertyUas.setNumberic(property.getNumberic());
-			propertyUas.setMin(property.getMin());
-			propertyUas.setMax(property.getMax());
-			propertyUas.setUnit(property.getUnit());
-			propertiesUas.add(propertyUas);
-		}
-		uas.setProperties(propertiesUas);
-		return uas;
-	}
+    /**
+     * 商城器件申请转换为uas器件申请
+     *
+     * @param componentSubmit 商城器件申请
+     * @return uas器件申请
+     */
+    public static ComponentSubmitUas convertUas(ComponentSubmit componentSubmit) {
+        ComponentSubmitUas uas = new ComponentSubmitUas();
+        uas.setId(componentSubmit.getId());
+        uas.setUuid(componentSubmit.getUuid());
+        uas.setStatus(componentSubmit.getStatus());
+        uas.setCode(componentSubmit.getCode());
+        uas.setVersion(componentSubmit.getVersion());
+        uas.setPackaging(componentSubmit.getEncapsulation());
+        uas.setBrandid(componentSubmit.getBrandid());
+        uas.setKindid(componentSubmit.getKindid());
+        uas.setImid(componentSubmit.getImid());
+        uas.setImg(componentSubmit.getImg());
+        uas.setWeight(componentSubmit.getWeight());
+        uas.setUnit(componentSubmit.getUnit());
+        uas.setAttach(componentSubmit.getAttach());
+        uas.setDescription(componentSubmit.getDescription());
+        uas.setModifyenuu(componentSubmit.getModifyenuu());
+        uas.setModifyuu(componentSubmit.getModifyuu());
+        Set<PropertySubmitUas> propertiesUas = new HashSet<PropertySubmitUas>();
+        for (PropertyValueSubmit property : componentSubmit.getProperties()) {
+            PropertySubmitUas propertyUas = new PropertySubmitUas();
+            propertyUas.setPropertyId(property.getPropertyid());
+            propertyUas.setDetno(property.getDetno());
+            propertyUas.setStringValue(property.getStringValue());
+            propertyUas.setPropertyName(property.getProperty().getLabelCn());
+            propertyUas.setNumberic(property.getNumberic());
+            propertyUas.setMin(property.getMin());
+            propertyUas.setMax(property.getMax());
+            propertyUas.setUnit(property.getUnit());
+            propertiesUas.add(propertyUas);
+        }
+        uas.setProperties(propertiesUas);
+        return uas;
+    }
 
-	/**
-	 * 将brandSubmit转换此UAS品牌申请
-	 * 
-	 * @param brandSubmit 商城品牌申请
-	 * @return uas品牌申请
-	 */
-	public static BrandSubmitUas convertUas(BrandSubmit brandSubmit) {
-		BrandSubmitUas uas = new BrandSubmitUas();
-		uas.setId(brandSubmit.getId());
-		uas.setUuid(brandSubmit.getUuid());
-		uas.setApplication(brandSubmit.getApplication());
-		uas.setAchievement(brandSubmit.getAchievement());
-		uas.setArea(brandSubmit.getArea());
-		uas.setBrief(brandSubmit.getBrief());
-		uas.setUrl(brandSubmit.getUrl());
-		uas.setLogoUrl(brandSubmit.getLogoUrl());
-		uas.setNameCn(brandSubmit.getNameCn());
-		uas.setNameEn(brandSubmit.getNameEn());
-		uas.setSeries(brandSubmit.getSeries());
-		uas.setVendor(brandSubmit.getVendor());
-		uas.setStatus(brandSubmit.getStatus());
-		uas.setAuditOpinion(brandSubmit.getAuditOpinion());
-		uas.setImid(brandSubmit.getImid());
-		uas.setUuid(brandSubmit.getUuid());
-		uas.setVersion(brandSubmit.getVersion());
-		uas.setModifyenuu(brandSubmit.getModifyenuu());
-		uas.setModifyuu(brandSubmit.getModifyuu());
-		return uas;
-	}
+    /**
+     * 将brandSubmit转换此UAS品牌申请
+     *
+     * @param brandSubmit 商城品牌申请
+     * @return uas品牌申请
+     */
+    public static BrandSubmitUas convertUas(BrandSubmit brandSubmit) {
+        BrandSubmitUas uas = new BrandSubmitUas();
+        uas.setId(brandSubmit.getId());
+        uas.setUuid(brandSubmit.getUuid());
+        uas.setApplication(brandSubmit.getApplication());
+        uas.setAchievement(brandSubmit.getAchievement());
+        uas.setArea(brandSubmit.getArea());
+        uas.setBrief(brandSubmit.getBrief());
+        uas.setUrl(brandSubmit.getUrl());
+        uas.setLogoUrl(brandSubmit.getLogoUrl());
+        uas.setNameCn(brandSubmit.getNameCn());
+        uas.setNameEn(brandSubmit.getNameEn());
+        uas.setSeries(brandSubmit.getSeries());
+        uas.setVendor(brandSubmit.getVendor());
+        uas.setStatus(brandSubmit.getStatus());
+        uas.setAuditOpinion(brandSubmit.getAuditOpinion());
+        uas.setImid(brandSubmit.getImid());
+        uas.setUuid(brandSubmit.getUuid());
+        uas.setVersion(brandSubmit.getVersion());
+        uas.setModifyenuu(brandSubmit.getModifyenuu());
+        uas.setModifyuu(brandSubmit.getModifyuu());
+        return uas;
+    }
 
-	/**
-	 * 商城品牌申请转换为uas简易品牌申请
-	 * @param brandSubmit 商城品牌
-	 * @return uas简易品牌申请
-	 */
-	public static BrandSubmitUasInfo covertUas(BrandSubmit brandSubmit) {
-		BrandSubmitUasInfo info = new BrandSubmitUasInfo();
-		info.setId(brandSubmit.getId());
-		info.setArea(brandSubmit.getArea());
-		info.setAuditOpinion(brandSubmit.getAuditOpinion());
-		info.setImid(brandSubmit.getImid());
-		info.setLogoUrl(brandSubmit.getLogoUrl());
-		info.setNameCn(brandSubmit.getNameCn());
-		info.setNameEn(brandSubmit.getNameEn());
-		info.setStatus(brandSubmit.getStatus());
-		info.setUuid(brandSubmit.getUuid());
-		info.setVendor(brandSubmit.getVendor());
-		return info;
-	}
+    /**
+     * 商城品牌申请转换为uas简易品牌申请
+     *
+     * @param brandSubmit 商城品牌
+     * @return uas简易品牌申请
+     */
+    public static BrandSubmitUasInfo covertUas(BrandSubmit brandSubmit) {
+        BrandSubmitUasInfo info = new BrandSubmitUasInfo();
+        info.setId(brandSubmit.getId());
+        info.setArea(brandSubmit.getArea());
+        info.setAuditOpinion(brandSubmit.getAuditOpinion());
+        info.setImid(brandSubmit.getImid());
+        info.setLogoUrl(brandSubmit.getLogoUrl());
+        info.setNameCn(brandSubmit.getNameCn());
+        info.setNameEn(brandSubmit.getNameEn());
+        info.setStatus(brandSubmit.getStatus());
+        info.setUuid(brandSubmit.getUuid());
+        info.setVendor(brandSubmit.getVendor());
+        return info;
+    }
 
-	/**
-	 * 商城产品批次信息转换为uas批次简易信息
-	 * @param simle  商城产品批次信息
-	 * @return uas批次简易信息
-	 */
-	public static GoodsSimpleUas convertUas(ComponentGoods simle) {
-		GoodsSimpleUas uas = new GoodsSimpleUas();
-		uas.setCode(simle.getCode());
-		uas.setUnit(simle.getUnit());
-		uas.setBatchCode(simle.getBatchCode());
-		uas.setMinBuyQty(simle.getMinBuyQty());
-		uas.setMinPackQty(simle.getMinPackQty());
-		uas.setOriginal(simle.getOriginal());
-		uas.setCurrencyName(simle.getCurrencyName());
-		uas.setQtyPrice(simle.getQtyPrice());
-		uas.setPackaging(simle.getPackaging());
-		uas.setProduceDate(simle.getProduceDate());
-		uas.setReserve(simle.getReserve());
-		uas.setB2cDeliveryHKMaxTime(simle.getB2cMaxDelivery());
-		uas.setB2cDeliveryHKMinTime(simle.getB2cMinDelivery());
-		uas.setB2cDeliveryDemMaxTime(simle.getB2cMaxDelivery());
-		uas.setB2cDeliveryDemMinTime(simle.getB2cMinDelivery());
-		uas.setSampleQty(simle.getSampleQty());
-		uas.setUuid(simle.getUuid());
-		return uas;
-	}
+    /**
+     * 商城产品批次信息转换为uas批次简易信息
+     *
+     * @param simle 商城产品批次信息
+     * @return uas批次简易信息
+     */
+    public static GoodsSimpleUas convertUas(ComponentGoods simle) {
+        GoodsSimpleUas uas = new GoodsSimpleUas();
+        uas.setCode(simle.getCode());
+        uas.setUnit(simle.getUnit());
+        uas.setBatchCode(simle.getBatchCode());
+        uas.setMinBuyQty(simle.getMinBuyQty());
+        uas.setMinPackQty(simle.getMinPackQty());
+        uas.setOriginal(simle.getOriginal());
+        uas.setCurrencyName(simle.getCurrencyName());
+        uas.setQtyPrice(simle.getQtyPrice());
+        uas.setPackaging(simle.getPackaging());
+        uas.setProduceDate(simle.getProduceDate());
+        uas.setReserve(simle.getReserve());
+        uas.setB2cDeliveryHKMaxTime(simle.getB2cMaxDelivery());
+        uas.setB2cDeliveryHKMinTime(simle.getB2cMinDelivery());
+        uas.setB2cDeliveryDemMaxTime(simle.getB2cMaxDelivery());
+        uas.setB2cDeliveryDemMinTime(simle.getB2cMinDelivery());
+        uas.setSampleQty(simle.getSampleQty());
+        uas.setUuid(simle.getUuid());
+        return uas;
+    }
 
-	/**
-	 * 商城类目转换为uas类目信息
-	 * @param kind 商城类目
-	 * @return uas类目信息
-	 */
-	public static KindUas convertUas(Kind kind) {
-		KindUas uas = new KindUas();
-		uas.setComponentPrefix(kind.getComponentPrefix());
-		uas.setComponentsuffix(kind.getComponentsuffix());
-		uas.setCount(kind.getCount());
-		uas.setDetno(kind.getDetno());
-		uas.setId(kind.getId());
-		uas.setIsLeaf(kind.getIsLeaf());
-		uas.setLevel(kind.getLevel());
-		uas.setNameCn(kind.getNameCn());
-		uas.setNameEn(kind.getNameEn());
-		uas.setParentid(kind.getParentid());
-		return uas;
-	}
+    /**
+     * 商城类目转换为uas类目信息
+     *
+     * @param kind 商城类目
+     * @return uas类目信息
+     */
+    public static KindUas convertUas(Kind kind) {
+        KindUas uas = new KindUas();
+        uas.setComponentPrefix(kind.getComponentPrefix());
+        uas.setComponentsuffix(kind.getComponentsuffix());
+        uas.setCount(kind.getCount());
+        uas.setDetno(kind.getDetno());
+        uas.setId(kind.getId());
+        uas.setIsLeaf(kind.getIsLeaf());
+        uas.setLevel(kind.getLevel());
+        uas.setNameCn(kind.getNameCn());
+        uas.setNameEn(kind.getNameEn());
+        uas.setParentid(kind.getParentid());
+        return uas;
+    }
 
-	/**
-	 * 商城器件简易信息转换为uas器件简易信息
-	 * @param info 商城器件简易信息
-	 * @return uas器件简易信息
-	 */
-	public static ComponentInfoUas convertUas(ComponentInfo info) {
-		ComponentInfoUas uas = new ComponentInfoUas();
-		uas.setAttach(info.getAttach());
-		uas.setBrandid(info.getBrandid());
-		uas.setCode(info.getCode());
-		uas.setInactionStockQty(info.getInactionStockQty());
-		// uas.setWastageQty(info.getWastageQty());
-		uas.setId(info.getId());
-		uas.setImg(info.getImg());
-		uas.setKindid(info.getKindid());
-		uas.setMaxDelivery(info.getMaxDelivery());
-		uas.setMinBuyQty(info.getMinBuyQty());
-		uas.setMinDelivery(info.getMinDelivery());
-		uas.setMinPrice(info.getMinPrice());
-		uas.setMaxPrice(info.getMaxPrice());
-		uas.setOrderNumber(info.getOrderNumber());
-		uas.setOrderQty(info.getOrderQty());
-		uas.setOriginalQty(info.getOriginalQty());
-		uas.setPackaging(info.getEncapsulation());
-		uas.setReserve(info.getReserve());
-		uas.setReserveType(info.getReserveType());
-		uas.setSampleQty(info.getSampleQty());
-		uas.setSpec(info.getEncapsulation());
-		uas.setUnit(info.getUnit());
-		uas.setUuid(info.getUuid());
-		uas.setVersion(info.getVersion());
-		uas.setWeight(info.getWeight());
-		if (info.getBrand() != null) {
-			uas.setBrand(convertUas(info.getBrand()));
-		}
-		return uas;
-	}
+    /**
+     * 商城器件简易信息转换为uas器件简易信息
+     *
+     * @param info 商城器件简易信息
+     * @return uas器件简易信息
+     */
+    public static ComponentInfoUas convertUas(ComponentInfo info) {
+        ComponentInfoUas uas = new ComponentInfoUas();
+        uas.setAttach(info.getAttach());
+        uas.setBrandid(info.getBrandid());
+        uas.setCode(info.getCode());
+        uas.setInactionStockQty(info.getInactionStockQty());
+        // uas.setWastageQty(info.getWastageQty());
+        uas.setId(info.getId());
+        uas.setImg(info.getImg());
+        uas.setKindid(info.getKindid());
+        uas.setMaxDelivery(info.getMaxDelivery());
+        uas.setMinBuyQty(info.getMinBuyQty());
+        uas.setMinDelivery(info.getMinDelivery());
+        uas.setMinPrice(info.getMinPrice());
+        uas.setMaxPrice(info.getMaxPrice());
+        uas.setOrderNumber(info.getOrderNumber());
+        uas.setOrderQty(info.getOrderQty());
+        uas.setOriginalQty(info.getOriginalQty());
+        uas.setPackaging(info.getEncapsulation());
+        uas.setReserve(info.getReserve());
+        uas.setReserveType(info.getReserveType());
+        uas.setSampleQty(info.getSampleQty());
+        uas.setSpec(info.getEncapsulation());
+        uas.setUnit(info.getUnit());
+        uas.setUuid(info.getUuid());
+        uas.setVersion(info.getVersion());
+        uas.setWeight(info.getWeight());
+        if (info.getBrand() != null) {
+            uas.setBrand(convertUas(info.getBrand()));
+        }
+        return uas;
+    }
 
-	/**
-	 * 商城品牌简易信息转换为uas品牌简易信息
-	 * @param info 商城品牌简易信息
-	 * @return uas品牌简易信息
-	 */
-	public static BrandInfoUas convertUas(BrandInfo info) {
-		BrandInfoUas uas = new BrandInfoUas();
-		uas.setId(info.getId());
-		uas.setLogoUrl(info.getLogoUrl());
-		uas.setNameCn(info.getNameCn());
-		uas.setNameEn(info.getNameEn());
-		uas.setUuid(info.getUuid());
-		uas.setVersion(info.getVersion());
-		uas.setVenodr(info.getVendor());
-		uas.setWeight(info.getWeight());
-		return uas;
-	}
+    /**
+     * 商城品牌简易信息转换为uas品牌简易信息
+     *
+     * @param info 商城品牌简易信息
+     * @return uas品牌简易信息
+     */
+    public static BrandInfoUas convertUas(BrandInfo info) {
+        BrandInfoUas uas = new BrandInfoUas();
+        uas.setId(info.getId());
+        uas.setLogoUrl(info.getLogoUrl());
+        uas.setNameCn(info.getNameCn());
+        uas.setNameEn(info.getNameEn());
+        uas.setUuid(info.getUuid());
+        uas.setVersion(info.getVersion());
+        uas.setVenodr(info.getVendor());
+        uas.setWeight(info.getWeight());
+        return uas;
+    }
 
-	/**
-	 * 分页转换
-	 * @param page
-	 * @param <T>
-	 * @return
-	 */
-	public static <T> IPage<T> convertPage(final Page<T> page) {
-		IPage<T> iPage = new IPage<>();
-		iPage.setContent(page.getContent());
-		iPage.setFirst(page.isFirst());
-		iPage.setLast(page.isLast());
-		iPage.setNumber(page.getNumber());
-		iPage.setNumberOfElements(page.getNumberOfElements());
-		iPage.setSize(page.getSize());
-		iPage.setTotalElements(page.getTotalElements());
-		return iPage;
-	}
+    /**
+     * 分页转换
+     *
+     * @param page
+     * @param <T>
+     * @return
+     */
+    public static <T> IPage<T> convertPage(final Page<T> page) {
+        IPage<T> iPage = new IPage<>();
+        iPage.setContent(page.getContent());
+        iPage.setFirst(page.isFirst());
+        iPage.setLast(page.isLast());
+        iPage.setNumber(page.getNumber());
+        iPage.setNumberOfElements(page.getNumberOfElements());
+        iPage.setSize(page.getSize());
+        iPage.setTotalElements(page.getTotalElements());
+        return iPage;
+    }
 
-	/**
-	 * 商城属性信息转换为uas属性信息
-	 * @param property 商城属性信息
-	 * @return uas属性信息
-	 */
-	public static PropertyUas convertUas(Property property) {
-		PropertyUas propertyUas = new PropertyUas();
-		propertyUas.setId(property.getId());
-		propertyUas.setLabelCn(property.getLabelCn());
-		propertyUas.setLabelEn(property.getLabelEn());
-		return propertyUas;
-	}
+    /**
+     * 商城属性信息转换为uas属性信息
+     *
+     * @param property 商城属性信息
+     * @return uas属性信息
+     */
+    public static PropertyUas convertUas(Property property) {
+        PropertyUas propertyUas = new PropertyUas();
+        propertyUas.setId(property.getId());
+        propertyUas.setLabelCn(property.getLabelCn());
+        propertyUas.setLabelEn(property.getLabelEn());
+        return propertyUas;
+    }
 
-	/**
-	 * 商城标准参数信息转换为uas标准参数信息
-	 * @param kindProperty 商城标准参数信息
-	 * @return uas标准参数信息
-	 */
-	public static KindPropertyUas convertUas(KindProperty kindProperty) {
-		KindPropertyUas kindPropertyUas = new KindPropertyUas();
-		kindPropertyUas.setId(kindProperty.getId());
-		kindPropertyUas.setDetno(kindProperty.getDetno());
-		kindPropertyUas.setKindId(kindProperty.getKindId());
-		kindPropertyUas.setPropertyId(kindProperty.getPropertyId());
-		kindPropertyUas.setType(kindProperty.getType());
-		kindPropertyUas.setUnit(kindProperty.getUnit());
-		kindPropertyUas.setProperty(convertUas(kindProperty.getProperty()));
-		// 所有可能值
-		if ("A".equals(kindProperty.getType()) && !CollectionUtils.isEmpty(kindProperty.getValues())) {
-			List<String> values = new ArrayList<String>();
-			int i = 0;
-			for (KindPropertyValues value : kindProperty.getValues()) {
-				i++;
-				if (i > 50)
-					break;
-				values.add(value.getValue());
-			}
-			kindPropertyUas.setValues(values);
-		}
-		// 所有单位
-		if (!CollectionUtils.isEmpty(kindProperty.getMultiUnits())) {
-			List<KindPropertyUnitUas> kindPropertyUnitUas = new ArrayList<KindPropertyUnitUas>();
-			for (KindPropertyUnit kindPropertyUnit : kindProperty.getMultiUnits()) {
-				kindPropertyUnitUas.add(convertUas(kindPropertyUnit));
-			}
-			kindPropertyUas.setMultiUnits(kindPropertyUnitUas);
-		}
-		// 所有可选项
-		if (!CollectionUtils.isEmpty(kindProperty.getOptions())) {
-			List<KindPropertyOptionUas> kindPropertyOptionUas = new ArrayList<KindPropertyOptionUas>();
-			for (KindPropertyOption kindPropertyOption : kindProperty.getOptions()) {
-				kindPropertyOptionUas.add(convertUas(kindPropertyOption));
-			}
-			kindPropertyUas.setOptions(kindPropertyOptionUas);
-		}
-		return kindPropertyUas;
-	}
+    /**
+     * 商城标准参数信息转换为uas标准参数信息
+     *
+     * @param kindProperty 商城标准参数信息
+     * @return uas标准参数信息
+     */
+    public static KindPropertyUas convertUas(KindProperty kindProperty) {
+        KindPropertyUas kindPropertyUas = new KindPropertyUas();
+        kindPropertyUas.setId(kindProperty.getId());
+        kindPropertyUas.setDetno(kindProperty.getDetno());
+        kindPropertyUas.setKindId(kindProperty.getKindId());
+        kindPropertyUas.setPropertyId(kindProperty.getPropertyId());
+        kindPropertyUas.setType(kindProperty.getType());
+        kindPropertyUas.setUnit(kindProperty.getUnit());
+        kindPropertyUas.setProperty(convertUas(kindProperty.getProperty()));
+        // 所有可能值
+        if ("A".equals(kindProperty.getType()) && !CollectionUtils.isEmpty(kindProperty.getValues())) {
+            List<String> values = new ArrayList<String>();
+            int i = 0;
+            for (KindPropertyValues value : kindProperty.getValues()) {
+                i++;
+                if (i > 50)
+                    break;
+                values.add(value.getValue());
+            }
+            kindPropertyUas.setValues(values);
+        }
+        // 所有单位
+        if (!CollectionUtils.isEmpty(kindProperty.getMultiUnits())) {
+            List<KindPropertyUnitUas> kindPropertyUnitUas = new ArrayList<KindPropertyUnitUas>();
+            for (KindPropertyUnit kindPropertyUnit : kindProperty.getMultiUnits()) {
+                kindPropertyUnitUas.add(convertUas(kindPropertyUnit));
+            }
+            kindPropertyUas.setMultiUnits(kindPropertyUnitUas);
+        }
+        // 所有可选项
+        if (!CollectionUtils.isEmpty(kindProperty.getOptions())) {
+            List<KindPropertyOptionUas> kindPropertyOptionUas = new ArrayList<KindPropertyOptionUas>();
+            for (KindPropertyOption kindPropertyOption : kindProperty.getOptions()) {
+                kindPropertyOptionUas.add(convertUas(kindPropertyOption));
+            }
+            kindPropertyUas.setOptions(kindPropertyOptionUas);
+        }
+        return kindPropertyUas;
+    }
 
-	/**
-	 * 商城标准参数单位转换为uas标准参数单位
-	 * @param kindPropertyUnit 商城标准参数单位
-	 * @return uas标准参数单位
-	 */
-	public static KindPropertyUnitUas convertUas(KindPropertyUnit kindPropertyUnit) {
-		KindPropertyUnitUas kindPropertyUnitUas = new KindPropertyUnitUas();
-		kindPropertyUnitUas.setId(kindPropertyUnit.getId());
-		kindPropertyUnitUas.setDetno(kindPropertyUnit.getNumber());
-		kindPropertyUnitUas.setUnit(kindPropertyUnit.getUnit());
-		kindPropertyUnitUas.setRadix(kindPropertyUnit.getRadix());
-		return kindPropertyUnitUas;
-	}
+    /**
+     * 商城标准参数单位转换为uas标准参数单位
+     *
+     * @param kindPropertyUnit 商城标准参数单位
+     * @return uas标准参数单位
+     */
+    public static KindPropertyUnitUas convertUas(KindPropertyUnit kindPropertyUnit) {
+        KindPropertyUnitUas kindPropertyUnitUas = new KindPropertyUnitUas();
+        kindPropertyUnitUas.setId(kindPropertyUnit.getId());
+        kindPropertyUnitUas.setDetno(kindPropertyUnit.getNumber());
+        kindPropertyUnitUas.setUnit(kindPropertyUnit.getUnit());
+        kindPropertyUnitUas.setRadix(kindPropertyUnit.getRadix());
+        return kindPropertyUnitUas;
+    }
 
-	/**
-	 * 商城标准参数选项转换为uas标准参数选项
-	 * @param kindPropertyOption 商城标准参数选项
-	 * @return uas标准参数选项
-	 */
-	public static KindPropertyOptionUas convertUas(KindPropertyOption kindPropertyOption) {
-		KindPropertyOptionUas kindPropertyOptionUas = new KindPropertyOptionUas();
-		kindPropertyOptionUas.setId(kindPropertyOption.getId());
-		kindPropertyOptionUas.setDetno(kindPropertyOption.getNumber());
-		kindPropertyOptionUas.setOption(kindPropertyOption.getOption());
-		return kindPropertyOptionUas;
-	}
+    /**
+     * 商城标准参数选项转换为uas标准参数选项
+     *
+     * @param kindPropertyOption 商城标准参数选项
+     * @return uas标准参数选项
+     */
+    public static KindPropertyOptionUas convertUas(KindPropertyOption kindPropertyOption) {
+        KindPropertyOptionUas kindPropertyOptionUas = new KindPropertyOptionUas();
+        kindPropertyOptionUas.setId(kindPropertyOption.getId());
+        kindPropertyOptionUas.setDetno(kindPropertyOption.getNumber());
+        kindPropertyOptionUas.setOption(kindPropertyOption.getOption());
+        return kindPropertyOptionUas;
+    }
 
-	/**
-	 * 商城业务消息转换为uas业务消息
-	 * 
-	 * @author hejq
-	 * @param operationInfo 商城业务消息
-	 * @return uas业务消息
-	 */
-	public static OperationInfoUas convertUas(OperationInfo operationInfo) {
-		OperationInfoUas operationInfoUas = new OperationInfoUas();
-		operationInfoUas.setB2cId(operationInfo.getB2cid());
-		operationInfoUas.setOperationRemark(operationInfo.getOperationRemark());
-		operationInfoUas.setOperationResult(operationInfo.getOperationResult());
-		operationInfoUas.setServiceCode(operationInfo.getServiceCode());
-		operationInfoUas.setUuid(operationInfo.getUuid());
-		return operationInfoUas;
-	}
+    /**
+     * 商城业务消息转换为uas业务消息
+     *
+     * @param operationInfo 商城业务消息
+     * @return uas业务消息
+     * @author hejq
+     */
+    public static OperationInfoUas convertUas(OperationInfo operationInfo) {
+        OperationInfoUas operationInfoUas = new OperationInfoUas();
+        operationInfoUas.setB2cId(operationInfo.getB2cid());
+        operationInfoUas.setOperationRemark(operationInfo.getOperationRemark());
+        operationInfoUas.setOperationResult(operationInfo.getOperationResult());
+        operationInfoUas.setServiceCode(operationInfo.getServiceCode());
+        operationInfoUas.setUuid(operationInfo.getUuid());
+        return operationInfoUas;
+    }
 
-	/**
-	 * 转为平台的产品
-	 *
-	 * @return
-	 */
-	public static Product convert(Prod prod) {
-		Product product = new Product();
-		product.setProdNum(prod.getPr_code());
-		product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
-		product.setUserUU(SystemSession.getUser().getUserUU());
-		product.setProdName(prod.getPr_detail());
-		product.setSpec(prod.getPr_spec());
-		product.setUnit(prod.getPr_unit());
-		product.setSourceId(prod.getPr_id());
-		product.setBrand(prod.getPr_brand());
-		if (prod.getPr_orispeccode() != null) {
-			product.setCmpCode(prod.getPr_orispeccode());
-		} else {
-			product.setCmpCode(prod.getPr_spec());
-		}
-		int i = Constant.NO;
-		product.setStandard(i);// 默认设置为非标准,到平台做匹配更新
-		Enterprise enter = SystemSession.getUser().getEnterprise();
-		// erp上传的数据默认赋值给标准信息
-		product.setPbranden(product.getBrand());
-		product.setPbrand(product.getBrand());
-		product.setPcmpcode(product.getCmpCode());
-		product.setKind(product.getProdName());
-		product.setSourceApp("ERP");
-		product.setErpDate(new Date());
-		product.setB2cDownStatus(Status.NOT_UPLOAD.value());
-		return product;
-	}
+    /**
+     * 转为平台的产品
+     *
+     * @return
+     */
+    public static Product convert(Prod prod) {
+        Product product = new Product();
+        product.setProdNum(prod.getPr_code());
+        product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
+        product.setUserUU(SystemSession.getUser().getUserUU());
+        product.setProdName(prod.getPr_detail());
+        product.setSpec(prod.getPr_spec());
+        product.setUnit(prod.getPr_unit());
+        product.setSourceId(prod.getPr_id());
+        product.setBrand(prod.getPr_brand());
+        if (prod.getPr_orispeccode() != null) {
+            product.setCmpCode(prod.getPr_orispeccode());
+        } else {
+            product.setCmpCode(prod.getPr_spec());
+        }
+        int i = Constant.NO;
+        product.setStandard(i);// 默认设置为非标准,到平台做匹配更新
+        Enterprise enter = SystemSession.getUser().getEnterprise();
+        // erp上传的数据默认赋值给标准信息
+        product.setPbranden(product.getBrand());
+        product.setPbrand(product.getBrand());
+        product.setPcmpcode(product.getCmpCode());
+        product.setKind(product.getProdName());
+        product.setSourceApp("ERP");
+        product.setErpDate(new Date());
+        product.setB2cDownStatus(Status.NOT_UPLOAD.value());
+        return product;
+    }
+
+    /**
+     * 替代料转换
+     * @param replace
+     * @return
+     */
+    public static ProductReplace convert(ProductReplaceErp replace) {
+        ProductReplace productReplace = new ProductReplace();
+        //设置ERPid
+        productReplace.setErpId(replace.getBPR_ID());
+        //设置替代关系状态
+        productReplace.setStatus(replace.getBPR_STATUSCODE());
+        //TODO 设置物料号
+        productReplace.setProductId(Long.parseLong(replace.getBPR_PRODCODE()));
+        //设置替代料号
+        productReplace.setReplaceId(replace.getBPR_REPCODE());
+        //设置原品牌
+        productReplace.setpBranden(replace.getBPR_PRODBRAND());
+        //设置替代品牌
+        productReplace.setPtrBranden(replace.getBPR_REPBAND());
+        //设置原型号
+        productReplace.setpCmpcode(replace.getBPR_PRODOSCODE());
+        //设置替代型号
+        productReplace.setpCmpcode(replace.getBPR_REPOSCODE());
+        //设置更新时间
+        productReplace.setTime(replace.getBPR_DATE());
+        return productReplace;
+    }
 }

+ 1 - 1
src/main/java/com/uas/platform/b2c/logistics/model/DistributionRule.java

@@ -89,7 +89,7 @@ public class DistributionRule {
 
 	/**
 	 * 计费方式
-	 * 1-统一规定运费,2-按总金额计算, 3-到付,到付设置为统一运费0
+	 * 1-统一规定运费,2-按总金额计算, 3-到付,到付设置为统一运费0, 4-包邮,到付设置为统一运费0
 	 */
 	@Column(name = "rule_fare_type")
 	private Short fareType;

+ 4 - 1
src/main/java/com/uas/platform/b2c/logistics/service/impl/DistributionRuleServiceImpl.java

@@ -144,6 +144,9 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 				}
 			}
 		}
+		if (rule.getFareType() == 4) {
+			rule.setUniformPrice((double) 0);
+		}
 		distributionRuleDao.save(rule);
 		return ResultMap.success(null);
 	}
@@ -438,7 +441,7 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 	 */
 	public Double getFareOfRule(DistributionRule rule, Double price){
 		Double needFare = null;
-		if (rule.getFareType() == 1 || rule.getFareType() == 3){
+		if (rule.getFareType() == 1 || rule.getFareType() == 3 || rule.getFareType() == 4){
 			needFare = rule.getUniformPrice();
 		}else {
 			if (CollectionUtils.isEmpty(rule.getFares())){

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

@@ -278,7 +278,6 @@ public class ProductController {
 		return productService.getProductCount(isPerson);
 	}
 
-
 	/**
 	 * 批量删除所有的非标的产品
 	 */

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

@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.query.Param;
 
+import javax.persistence.ManyToOne;
 import javax.transaction.Transactional;
 import java.util.List;
 
@@ -20,4 +21,22 @@ public interface ProductReplaceDao extends JpaRepository<ProductReplace, Long>,
     @Transactional
     @Modifying
     void deleteByProductId(Long productId);
+
+    /**
+     * 查找表中是否已有该条erp传来的数据
+     * @param erpId
+     * @return
+     */
+    ProductReplace findByErpId(Long erpId);
+
+    /**
+     * 更新替代料替代关系
+     * @param erpId
+     * @param status
+     * @return
+     */
+    @Transactional
+    @Modifying
+    @Query(nativeQuery = true,value = "update product$replace set ptr_status = :status where ptr_erpid = :erpId")
+    void update(@Param("status")String status,@Param("erpId") Long erpId);
 }

+ 62 - 6
src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductReplace.java

@@ -1,25 +1,43 @@
 package com.uas.platform.b2c.prod.commodity.model;
 
-import com.uas.platform.b2c.common.account.model.Role;
 import com.uas.platform.b2c.core.support.SystemSession;
-import org.apache.commons.collections.CollectionUtils;
 
 import javax.persistence.*;
+import java.io.Serializable;
 import java.util.Date;
-import java.util.Set;
 
 /**
  * 存贮商城替代物料
  */
 @Entity
 @Table(name = "product$replace")
-public class ProductReplace {
+public class ProductReplace implements Serializable{
 
     @Id
     @GeneratedValue
     @Column(name = "id")
     private Long id;
 
+    /**
+     * erp数据库主键id
+     */
+    @Column(name = "ptr_erpid")
+    private Long erpId;
+
+    /**
+     * 替代关系状态
+     * ON/OFF
+     */
+    @Column(name = "ptr_status")
+    private String status;
+
+    /**
+     * 下载状态
+     */
+    @Column(name="ptr_downstatus")
+    private String downStatus;
+
+
     /**
      * 用户uu
      */
@@ -32,14 +50,20 @@ public class ProductReplace {
     @Column(name = "ptr_prid")
     private Long productId;
 
+    /***
+     * 替代料号
+     */
+    @Column(name = "ptr_replaceid")
+    private String replaceId;
+
     /**
-     * 原型号型号(冗余p字段)
+     * 原型号型号
      */
     @Column(name = "p_cmpcode" ,length = 800)
     private String pCmpcode;
 
     /**
-     * 原品牌品牌(冗余p字段)
+     * 原品牌品牌
      */
     @Column(name = "p_pbranden")
     private String pBranden;
@@ -83,6 +107,14 @@ public class ProductReplace {
     @Column(name = "ptr_detno", nullable = false)
     private Short detno;
 
+    public String getReplaceId() {
+        return replaceId;
+    }
+
+    public void setReplaceId(String replaceId) {
+        this.replaceId = replaceId;
+    }
+
     public Long getId() {
         return id;
     }
@@ -91,6 +123,30 @@ public class ProductReplace {
         this.id = id;
     }
 
+    public Long getErpId() {
+        return erpId;
+    }
+
+    public void setErpId(Long erpId) {
+        this.erpId = erpId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getDownStatus() {
+        return downStatus;
+    }
+
+    public void setDownStatus(String downStatus) {
+        this.downStatus = downStatus;
+    }
+
     public Long getUserUU() {
         return userUU;
     }

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -41,7 +41,7 @@ public class ReleaseProductByBatch implements Serializable {
 
 	static {
 		String[] array = {"Bulk-散装", "Reel-卷装", "Tape/Reel-编带", "Tray-盘装",
-				"Tube-管装", "盒装", "袋装", "罐装", "瓶装", "桶装", "箱装"};
+				"Tube-管装", "盒装", "袋装", "罐装", "瓶装", "桶装", "箱装", "其他"};
 		PACKAGING_LIST = Arrays.asList(array);
 	}
 

+ 43 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductReplaceServiceImpl.java

@@ -0,0 +1,43 @@
+package com.uas.platform.b2c.prod.commodity.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.uas.api.b2c_erp.seller.model.ProductReplaceErp;
+import com.uas.api.b2c_erp.seller.service.ProductReplaceService;
+import com.uas.platform.b2c.external.erp.product.util.ModelConverter;
+import com.uas.platform.b2c.prod.commodity.dao.ProductReplaceDao;
+import com.uas.platform.b2c.prod.commodity.model.ProductReplace;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 替代料传输接口实现类
+ * created by shicr on 2018/4/26
+ **/
+@Service
+public class ProductReplaceServiceImpl implements ProductReplaceService {
+
+    @Autowired
+    private ProductReplaceDao dao;
+
+    /**
+     * 更新替代料
+     *
+     * @param jsonStr
+     * @return
+     */
+    @Override
+    public void update(String jsonStr) {
+        List<ProductReplaceErp> list = (List<ProductReplaceErp>)JSONArray.parseArray(jsonStr,ProductReplaceErp.class);
+        for(ProductReplaceErp replace : list){
+            ProductReplace replace1 = ModelConverter.convert(replace);
+            ProductReplace p = dao.findByErpId(replace1.getErpId());
+            if(p == null){
+                dao.save(replace1);
+            }else{
+                dao.update(replace1.getStatus(),replace1.getErpId());
+            }
+        }
+    }
+}

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

@@ -12,15 +12,48 @@ import com.uas.platform.b2c.core.constant.IntegerConstant;
 import com.uas.platform.b2c.core.constant.ShortConstant;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.constant.Status;
-import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.NumberUtil;
 import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
-import com.uas.platform.b2c.prod.commodity.dao.*;
-import com.uas.platform.b2c.prod.commodity.model.*;
-import com.uas.platform.b2c.prod.commodity.service.*;
+import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
+import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
+import com.uas.platform.b2c.prod.commodity.dao.MatchModelDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductDetailDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductMatchResultDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductModifyHistoryDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductPersonDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductPrivateDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductReplaceDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductStandardPutOnInfoDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductStoreStatusDao;
+import com.uas.platform.b2c.prod.commodity.dao.StockInOutHistDao;
+import com.uas.platform.b2c.prod.commodity.dao.V_ProductPersonDao;
+import com.uas.platform.b2c.prod.commodity.dao.V_ProductPrivateDao;
+import com.uas.platform.b2c.prod.commodity.model.Goods;
+import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
+import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
+import com.uas.platform.b2c.prod.commodity.model.MatchModel;
+import com.uas.platform.b2c.prod.commodity.model.Product;
+import com.uas.platform.b2c.prod.commodity.model.ProductDetail;
+import com.uas.platform.b2c.prod.commodity.model.ProductMatchResult;
+import com.uas.platform.b2c.prod.commodity.model.ProductModifyHistory;
+import com.uas.platform.b2c.prod.commodity.model.ProductPerson;
+import com.uas.platform.b2c.prod.commodity.model.ProductPrivate;
+import com.uas.platform.b2c.prod.commodity.model.ProductReplace;
+import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
+import com.uas.platform.b2c.prod.commodity.model.ProductStoreStatus;
+import com.uas.platform.b2c.prod.commodity.model.StockInOutHist;
+import com.uas.platform.b2c.prod.commodity.model.UASBatchPutOnProperty;
+import com.uas.platform.b2c.prod.commodity.model.V_ProductPerson;
+import com.uas.platform.b2c.prod.commodity.model.V_ProductPrivate;
+import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
+import com.uas.platform.b2c.prod.commodity.service.GoodsService;
+import com.uas.platform.b2c.prod.commodity.service.ProductService;
+import com.uas.platform.b2c.prod.commodity.service.ReleaseProductByBatchService;
+import com.uas.platform.b2c.prod.commodity.service.UASBatchPutOnPropertyService;
 import com.uas.platform.b2c.prod.commodity.type.ProductConstant;
 import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
 import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
@@ -45,7 +78,6 @@ import com.uas.platform.b2c.trade.order.status.OrderStatus;
 import com.uas.platform.b2c.trade.presale.dao.CartDao;
 import com.uas.platform.b2c.trade.presale.dao.GoodsBrowsingHistoryDao;
 import com.uas.platform.b2c.trade.presale.model.Cart;
-import com.uas.platform.b2c.trade.presale.model.Collection;
 import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
 import com.uas.platform.b2c.trade.presale.service.CartService;
 import com.uas.platform.b2c.trade.support.CodeType;
@@ -57,6 +89,24 @@ import com.uas.platform.core.model.Type;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
+import java.lang.reflect.Field;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
 import org.apache.commons.beanutils.ConvertUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.log4j.Logger;
@@ -75,17 +125,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import org.springframework.web.client.RestTemplate;
 
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import java.lang.reflect.Field;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-
 /**
  * Created by wangyc on 2017/5/26.
  */
@@ -383,7 +422,8 @@ public class ProductServiceImpl implements ProductService {
         }
         Date date = new Date();
         // 删除原有的替代料数据
-        productReplaceDao.deleteByProductId(productId);
+        List<ProductReplace> existReplaces = productReplaceDao.findByProductIdOrderByDetno(productId);
+        productReplaceDao.delete(existReplaces);
         for (ProductReplace productReplace : productReplaceList) {
             if (productReplace.getUserUU() == null) {
                 productReplace.setUserUU(SystemSession.getUser().getUserUU());

+ 34 - 20
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -1,5 +1,7 @@
 package com.uas.platform.b2c.prod.commodity.service.impl;
 
+import static com.uas.platform.b2c.core.utils.NumberUtil.fractionNumCeil;
+
 import com.alibaba.fastjson.JSON;
 import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.common.account.service.EnterpriseService;
@@ -20,7 +22,12 @@ import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
 import com.uas.platform.b2c.prod.commodity.dao.ProductPersonDao;
 import com.uas.platform.b2c.prod.commodity.dao.ProductPrivateDao;
 import com.uas.platform.b2c.prod.commodity.dao.ReleaseProductByBatchDao;
-import com.uas.platform.b2c.prod.commodity.model.*;
+import com.uas.platform.b2c.prod.commodity.model.Goods;
+import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
+import com.uas.platform.b2c.prod.commodity.model.Product;
+import com.uas.platform.b2c.prod.commodity.model.ProductPerson;
+import com.uas.platform.b2c.prod.commodity.model.ProductPrivate;
+import com.uas.platform.b2c.prod.commodity.model.ReleaseProductByBatch;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.commodity.service.ReleaseProductByBatchService;
 import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
@@ -34,10 +41,33 @@ import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.persistence.criteria.CriterionExpression;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
+import java.math.BigDecimal;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFDateUtil;
-import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.DateUtil;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.dao.DataAccessException;
@@ -50,22 +80,6 @@ import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 import org.springframework.web.client.RestTemplate;
 
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import java.math.BigDecimal;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import static com.uas.platform.b2c.core.utils.NumberUtil.fractionNumCeil;
-
 @Service
 public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchService {
 
@@ -378,11 +392,11 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			} else {
 				String title = StringUtilB2C.replaceLineBreak(priceCellObj.toString());
 				if (Currency.USD.equals(currency)) {
-					if (!title.equals("USD单价1")) {
+					if (!title.equals("USD/PCS单价1")) {
 						throw new IllegalOperatorException("您上传的文件表头与美金模板不符");
 					}
 				} else {
-					if (!title.equals("RMB单价1")) {
+					if (!title.equals("RMB/PCS单价1")) {
 						throw new IllegalOperatorException("您上传的文件表头与人民币模板不符");
 					}
 				}

+ 2 - 2
src/main/java/com/uas/platform/b2c/prod/store/facade/impl/StoreApplyFacadeImpl.java

@@ -116,9 +116,9 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 
 		storeApplyService.handlerApply(storeApply);
 		//自动确认开通店铺;
-	/*	if (StoreApply.ApplyStatus.PASS == status) {
+		if (StoreApply.ApplyStatus.PASS == status) {
 			this.autoConfirmOpenStore(uuid, storeApply);
-		}*/
+		}
 		return ResultMap.success(null);
 	}
 

+ 31 - 10
src/main/java/com/uas/platform/b2c/prod/store/facade/impl/StoreInFacadeImpl.java

@@ -1,5 +1,7 @@
 package com.uas.platform.b2c.prod.store.facade.impl;
 
+import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
+import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 import com.uas.platform.b2c.prod.store.facade.StoreInFacade;
 import com.uas.platform.b2c.prod.store.model.EnterpriseSimple;
@@ -33,11 +35,14 @@ public class StoreInFacadeImpl implements StoreInFacade {
 
 	private final QualificationService qualificationService;
 
+	private final EnterpriseDao enterpriseDao;
+
 	@Autowired
-	public StoreInFacadeImpl(StoreInDao storeInDao, StoreInService storeInService, QualificationService qualificationService) {
+	public StoreInFacadeImpl(StoreInDao storeInDao, StoreInService storeInService, QualificationService qualificationService, EnterpriseDao enterpriseDao) {
 		this.storeInDao = storeInDao;
 		this.storeInService = storeInService;
 		this.qualificationService = qualificationService;
+		this.enterpriseDao = enterpriseDao;
 	}
 
 	@Override
@@ -56,14 +61,13 @@ public class StoreInFacadeImpl implements StoreInFacade {
 		if (store == null) {
 			return new ResultMap(CodeType.ERROR_STATE, String.format("编号%s对应的店铺不存在", uuid));
 		}
-
+//		store.setEnterpriseJson(newStoreInfo.getEnterpriseJson());
+//		store.setEnterprise(newStoreInfo.getEnterprise());
 		ResultMap resultMap = setStoreInfoByKind(store, newStoreInfo, kind);
 		if (resultMap != null) {
 			return resultMap;
 		}
-
 		Set<Qualification> qualifications = store.getQualifications();
-
 		if (!CollectionUtils.isEmpty(qualifications)) {
 			Iterator<Qualification> iterator = qualifications.iterator();
 			while (iterator.hasNext()) {
@@ -75,8 +79,21 @@ public class StoreInFacadeImpl implements StoreInFacade {
 			}
 		}
 		store.setQualifications(qualifications);
-
-		store = storeInDao.save(store);
+        if ("BASIC_INFO".equals(kind)) {
+            Enterprise enter = enterpriseDao.findByUu(store.getEnUU());
+            enter.setEnAddress(store.getEnterprise().getEnAddress());
+            enter.setEnTel(store.getEnterprise().getEnTel());
+            enter.setEnFax(store.getEnterprise().getEnFax());
+            enter.setEnPhone(store.getEnterprise().getEnPhone());
+            enter.setEnWeixin(store.getEnterprise().getEnWeixin());
+            enter.setEnQQ(store.getEnterprise().getEnQQ());
+            enterpriseDao.save(enter);
+        }
+        store = storeInDao.save(store);
+		Set<Qualification> qualificationsSort = storeInService.getQualificationsSort();
+		Set<Qualification> qualificationsPo= store.getQualifications();
+		qualificationsSort.addAll(qualificationsPo);
+		store.setQualifications(qualificationsSort);
 		return ResultMap.success(store);
 	}
 
@@ -96,10 +113,14 @@ public class StoreInFacadeImpl implements StoreInFacade {
 			store.setStoreName(StringUtils.hasText(newStoreInfo.getStoreName()) ? newStoreInfo.getStoreName() : null);
 			store.setDescription(newStoreInfo.getDescription());
 			EnterpriseSimple enterprise = store.getEnterprise();
-			enterprise.setEnUrl(newStoreInfo.getEnterprise().getEnUrl());
-			enterprise.setAddress(newStoreInfo.getEnterprise().getAddress());
-			enterprise.setEnTel(newStoreInfo.getEnterprise().getEnTel());
-			enterprise.setEnFax(newStoreInfo.getEnterprise().getEnFax());
+            EnterpriseSimple newEnterprise = newStoreInfo.getEnterprise();
+			enterprise.setEnUrl(newEnterprise.getEnUrl());
+			enterprise.setAddress(newEnterprise.getAddress());
+			enterprise.setEnTel(newEnterprise.getEnTel());
+			enterprise.setEnFax(newEnterprise.getEnFax());
+            enterprise.setEnPhone(newEnterprise.getEnPhone());
+            enterprise.setEnWeixin(newEnterprise.getEnWeixin());
+            enterprise.setEnQQ(newEnterprise.getEnQQ());
 			store.setEnterprise(enterprise);
 			return null;
 		}

+ 41 - 1
src/main/java/com/uas/platform/b2c/prod/store/model/EnterpriseSimple.java

@@ -70,6 +70,19 @@ public class EnterpriseSimple {
 	 */
 	private String enUrl;
 
+	/**
+	 * 手机
+	 */
+	private String enPhone;
+	/**
+	 * 微信
+	 */
+	private String enWeixin;
+	/**
+	 * QQ
+	 */
+	private String enQQ;
+
 	/**
 	 * Logo
 	 */
@@ -187,13 +200,37 @@ public class EnterpriseSimple {
 		this.enLogoUrl = enLogoUrl;
 	}
 
+	public String getEnPhone() {
+		return enPhone;
+	}
+
+	public void setEnPhone(String enPhone) {
+		this.enPhone = enPhone;
+	}
+
+	public String getEnWeixin() {
+		return enWeixin;
+	}
+
+	public void setEnWeixin(String enWeixin) {
+		this.enWeixin = enWeixin;
+	}
+
+	public String getEnQQ() {
+		return enQQ;
+	}
+
+	public void setEnQQ(String enQQ) {
+		this.enQQ = enQQ;
+	}
+
 	public static EnterpriseSimple translateSimple(Enterprise enterprise) {
 		EnterpriseSimple simple = new EnterpriseSimple();
 		simple.uu = enterprise.getUu();
 		simple.enName = enterprise.getEnName();
 		simple.enShortname = enterprise.getEnShortname();
 		simple.enAddress = enterprise.getEnAddress();
-		simple.address = enterprise.getEnAddress();
+		//simple.address = enterprise.getEnAddress();
 		simple.enFax = enterprise.getEnFax();
 		simple.enTel = enterprise.getEnTel();
 		simple.enType = enterprise.getEnType();
@@ -202,6 +239,9 @@ public class EnterpriseSimple {
 		simple.enUrl = enterprise.getEnUrl();
 		simple.enLogoUrl = enterprise.getEnLogoUrl();
 		simple.enEmail = StringUtils.isEmpty(enterprise.getEnEmail()) ? " " : enterprise.getEnEmail();
+		simple.enPhone = enterprise.getEnPhone();
+		simple.enWeixin = enterprise.getEnWeixin();
+		simple.enQQ = enterprise.getEnQQ();
 		return simple;
 	}
 

+ 11 - 4
src/main/java/com/uas/platform/b2c/prod/store/service/StoreInService.java

@@ -2,10 +2,7 @@ package com.uas.platform.b2c.prod.store.service;
 
 import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2c.advertise.ad.model.StoreAdsType;
-import com.uas.platform.b2c.prod.store.model.StoreApply;
-import com.uas.platform.b2c.prod.store.model.StoreIn;
-import com.uas.platform.b2c.prod.store.model.StoreStatus;
-import com.uas.platform.b2c.prod.store.model.StoreType;
+import com.uas.platform.b2c.prod.store.model.*;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
 import org.springframework.data.domain.Page;
@@ -13,6 +10,7 @@ import org.springframework.data.domain.Pageable;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public interface StoreInService {
 
@@ -190,4 +188,13 @@ public interface StoreInService {
 	 * @return
 	 */
 	Map<String, JSONObject> getContactInfo(List<String> storeids);
+
+	/**
+	 * 给企业资质排序;
+	 * @param
+	 * @return
+	 */
+	Set<Qualification> getQualificationsSort();
+
+
 }

+ 32 - 23
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreInServiceImpl.java

@@ -168,22 +168,50 @@ public class StoreInServiceImpl implements StoreInService {
 		if (enUU == null) {
 			return null;
 		}
-
 		List<StoreIn> storeIns = storeDao.findByEnUU(enUU);
 		if(CollectionUtils.isEmpty(storeIns)) {
 			return null;
 		}else {
+			StoreIn returnStoreIn;
 			StoreIn storeInsOne = storeIns.get(0);
 			EnterpriseSimple enterpriseSimple = EnterpriseSimple.translateSimple(SystemSession.getUser().getEnterprise());
 			if (enterpriseSimple.getEnName().equals(storeInsOne.getEnterprise().getEnName())) {
-				return storeInsOne;
+				returnStoreIn = storeInsOne;
 			} else {
 				storeInsOne.setEnterprise(enterpriseSimple);
-				return storeDao.save(storeInsOne);
+				returnStoreIn = storeDao.save(storeInsOne);
 			}
+			Set<Qualification> qualifications = returnStoreIn.getQualifications();
+			Set<Qualification> qualificationsSort = getQualificationsSort();
+			qualificationsSort.addAll(qualifications);
+			returnStoreIn.setQualifications(qualificationsSort);
+			return returnStoreIn;
 		}
 	}
 
+	public Set<Qualification> getQualificationsSort() {
+		return new TreeSet<Qualification>(new Comparator()
+            {
+                public int compare(Object o1, Object o2) {
+                    Qualification time1 = (Qualification)o1;
+                    Qualification time2 = (Qualification)o2;
+                    if (time1.getId().intValue() > time2.getId().intValue())
+                    {
+                        return 1;
+                    }
+                    else if (time1.getId().intValue() == time2.getId().intValue())
+                    {
+                        return 0;
+                    }
+                    else
+                    {
+                        return -1;
+                    }
+                }
+
+            });
+	}
+
 	@Override
 	public String findUUidByEnUU(Long enUU) {
 		if (enUU == null) {
@@ -212,26 +240,7 @@ public class StoreInServiceImpl implements StoreInService {
 		logger.info("Start to execute find.");
 		StoreIn store = storeDao.findByUuid(uuid);
 		// 为了给前端返回一致的顺序
-		Set<Qualification> qualifications = new TreeSet<Qualification>(new Comparator()
-		{
-			public int compare(Object o1, Object o2) {
-				Qualification time1 = (Qualification)o1;
-				Qualification time2 = (Qualification)o2;
-				if (time1.getId().intValue() > time2.getId().intValue())
-				{
-					return 1;
-				}
-				else if (time1.getId().intValue() == time2.getId().intValue())
-				{
-					return 0;
-				}
-				else
-				{
-					return -1;
-				}
-			}
-
-		});
+		Set<Qualification> qualifications = getQualificationsSort();
 		if (!CollectionUtils.isEmpty(store.getQualifications())) {
 			qualifications.addAll(store.getQualifications());
 		}

BIN
src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-usd.xls


BIN
src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls


+ 14 - 0
src/main/webapp/WEB-INF/spring/hessian.xml

@@ -17,6 +17,8 @@
 	<!-- ERP物料接口 -->
 	<bean id="api.ProdService" class="com.uas.platform.b2c.external.erp.prod.service.impl.ProdServiceImpl" />
 
+	<bean id="prodReplaceService" class="com.uas.platform.b2c.prod.commodity.service.impl.ProductReplaceServiceImpl"/>
+
 	<bean name="/api/service/seller/prod" class="com.uas.api.crypto.hessian.PermittedServiceExporter">
 		<property name="secretKeyService" ref="apiSecretKeyService" />
 		<property name="handlerInterceptor" ref="apiHandlerInterceptor" />
@@ -25,6 +27,14 @@
 				  value="com.uas.api.b2c_erp.seller.service.ProdService" />
 	</bean>
 
+	<bean name="/erp/productReplace/update" class="com.uas.api.crypto.hessian.PermittedServiceExporter">
+		<property name="secretKeyService" ref="apiSecretKeyService" />
+		<property name="handlerInterceptor" ref="apiHandlerInterceptor" />
+		<property name="service" ref="prodReplaceService" />
+		<property name="serviceInterface"
+				  value="com.uas.api.b2c_erp.seller.service.ProductReplaceService" />
+	</bean>
+
 	<!-- ERP库存接口 -->
 	<bean id="api.ProductDetailERPService" class="com.uas.platform.b2c.external.erp.commodity.service.impl.ProductDetailERPServiceImpl" />
 
@@ -213,4 +223,8 @@
 		<property name="serviceInterface"
 				  value="com.uas.api.b2c_erp.seller.service.BankInfoService"/>
 	</bean>
+	<!--获取ERP替代料-->
+	<bean  name="productreplace" class="com.uas.api.crypto.hessian.PermittedServiceExporter">
+
+	</bean>
 </beans>

+ 1 - 0
src/main/webapp/WEB-INF/spring/webmvc.xml

@@ -116,6 +116,7 @@
 			<mvc:exclude-mapping path="/seek/getSeekPageInfo"/>
 			<mvc:exclude-mapping path="/seek/getSeekRanking"/>
 			<mvc:exclude-mapping path="/seek/release/template"/>
+			<mvc:exclude-mapping path="/erp/productReplace/update"/>
 			<bean class="com.uas.platform.b2c.core.filter.SSOInterceptor"></bean>
 		</mvc:interceptor>
 		<!-- 对所有的请求拦截,将Session中的User信息设置进SystemSession -->

+ 1 - 0
src/main/webapp/WEB-INF/views/normal/user_center.html

@@ -23,6 +23,7 @@
 <link rel="stylesheet" type="text/css" href="static/lib/keyboard/css/softkeys-0.0.1.css">
 <link rel="stylesheet" href="static/lib/angular/ng-table.css">
     <link rel="stylesheet" href="static/css/commonComponent.css" />
+	<link rel="stylesheet" href="static/css/common/linkSaler.css" />
 </head>
 <body>
 

+ 1 - 0
src/main/webapp/WEB-INF/views/normal/vendor_center.html

@@ -20,6 +20,7 @@
 <link rel="stylesheet" href="static/lib/angular/ng-table.css">
 <link rel="stylesheet" type="text/css" href="static/lib/keyboard/css/softkeys-0.0.1.css">
 <link rel="stylesheet" href="static/css/commonComponent.css" />
+	<link rel="stylesheet" href="static/css/common/linkSaler.css" />
 </head>
 <body>
 	<!-- 消息提示框  Start-->

+ 32 - 0
src/main/webapp/resources/css/common/linkSaler.css

@@ -0,0 +1,32 @@
+
+.link-saler-box {
+    width: 289px;
+    height: auto;
+    min-height: auto;
+    border-radius: 2px;
+}
+.link-saler-box .title {
+    background-color: #4290f7;
+    height: 22px;
+    line-height: 22px;
+    margin-bottom: 20px;
+}
+.link-saler-box .content p {
+    line-height: 20px;
+    padding-top: 0;
+}
+.link-saler-box .content p i {
+    color: #4290f7;
+    margin-right: 4px;
+}
+.link-saler-box .content p span {
+    color: #f62d37;
+    width: auto !important;
+    float: none;
+}
+.link-saler-box .content a {
+    width: 78px !important;
+    background: #4290f7 !important;
+    margin: 18px 0 13px 0;
+    border-radius: 2px;
+}

+ 63 - 2
src/main/webapp/resources/css/vendor/sell.css

@@ -3453,7 +3453,7 @@ body {
     display: inline-block;
 }
 .com_tab ul li.active a {
-    color: #5078cb;
+    color: #f15601;
     border-bottom: 3px #5078cb solid;
 }
 .com_tab ul li:hover a {
@@ -3464,7 +3464,68 @@ body {
     color: #e64040;
 }
 .com_tab ul li.active a,.oder01 ul li.active a em {
-    color: #5078cb;
+    color: #f15601;
+}
+
+.com_tab:nth-of-type(1) ul li{
+    margin-left: 0px;
+    position: relative;
+}
+.com_tab:nth-of-type(1) ul li.active a{
+    border-bottom: #fff;
+    background: #5078cb;
+    color: #fff !important;
+}
+.com_tab:nth-of-type(1) ul li::after{
+    background: url('../../img/vendor/images/downicon.png');
+    width: 11px;
+    height: 6px;
+    position: absolute;
+    bottom: 0px;
+    left: 50%;
+    content: ' ';
+    margin-left: -5px;
+    display: none;
+}
+.com_tab ul li.active::after{
+    display: block;
+}
+.com_tab:nth-of-type(1) ul li.active:hover a{
+    color: #fff !important;
+}
+.com_tab:nth-of-type(2) ul li a {
+    color: #666 !important;
+}
+.com_tab:nth-of-type(2) ul li.active a,.com_tab:nth-of-type(2) ul li.active a em{
+    color: #f15601 !important;
+}
+.com_tab:nth-of-type(2) ul li:hover a,.com_tab:nth-of-type(2) ul li:hover a em{
+    color: #f15601 !important;
+}
+.com_tab:nth-of-type(2) ul li a{
+    border-top: 3px solid #fff;
+}
+.com_tab:nth-of-type(2) ul li.active a{
+    border-top: 3px solid #f15601;
+    border-left: 1px solid #f15601;
+    border-right: 1px solid #f15601;
+    border-bottom: 1px solid #fff
+}
+.com_tab:nth-of-type(2) ul{
+    /*border-top: 3px solid #f15601;*/
+    border-bottom: 1px solid #f15601;
+}
+.com_tab:nth-of-type(2) ul li{
+    margin-left: 0px !important;
+}
+.com_tab:nth-of-type(2) ul li:first-child{
+    margin-left: 0px
+}
+
+
+
+.:nth-of-type(1) ul li.active:after{
+    display: block
 }
 .log_company dl span.wd01 {
     width:10%;

BIN
src/main/webapp/resources/img/user/images/code.png


BIN
src/main/webapp/resources/img/user/images/codebg.png


BIN
src/main/webapp/resources/img/vendor/images/downicon.png


+ 1 - 1
src/main/webapp/resources/js/common/controllers/commonCtrls.js

@@ -990,7 +990,7 @@ define([ 'app/app' ], function(app) {
 				if (data && data.data) {
 					$scope.userInfo = data.data;
 					$scope.param = ChatBusinessLayer.getParamsFromUserInfo(data.data);
-					accessRealTimeData($scope.param);
+					// accessRealTimeData($scope.param);
 				}
 			}, function () {
 			});

+ 28 - 16
src/main/webapp/resources/js/common/module/chat_web_module.js

@@ -30,10 +30,10 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
 				return;
 			});
 */
-			var promise = Enterprise.getEnterpriseAdminInfo({enuu : enUU}, {}).$promise;
+			var promise = Enterprise.getEnterPriseTelOrAdminTel({enuu : enUU}, {}).$promise;
 
 			return promise.then(function (data) {
-				return data.userTel;
+				return data.data.entel || data.data.adminTel;
 			}, function () {
 				return 0;
 			});
@@ -58,7 +58,7 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
 			return promise.then(function (enterprise) {
 				return {
 					enUU: enterprise.uu,
-					name: enterprise.enName
+					name: enterprise.ehnName
 				}
 			});
 		}
@@ -113,7 +113,7 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
 		this.getAdminInfo = getAdminInfo;
 	}]);
 
-	module.controller('ChatContactCtrl', ['$rootScope', 'ChatBusinessLayer', 'toaster','Enterprise', function ($rootScope, ChatBusinessLayer, toaster, Enterprise) {
+	module.controller('ChatContactCtrl', ['$rootScope', '$scope', 'ChatBusinessLayer', 'toaster','Enterprise', function ($rootScope, $scope, ChatBusinessLayer, toaster, Enterprise) {
 
 		var vm = this;
 		vm.param = {};
@@ -134,26 +134,38 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
 		 * @param userType	联系人用户类型
 		 */
 		function contactWithOther(phone, enUU, userType) {
-			//获得窗口的垂直位置
-			var iTop = (window.screen.availHeight - 30 - 780) / 2;
-			//获得窗口的水平位置
-			var iLeft = (window.screen.availWidth - 10 - 1030) / 2;
-			if (!/^1\d{10}$/.test(phone)){
-				ChatBusinessLayer.getAdminInfo(enUU).then(function (userTel) {
-					phone = userTel;
+			// //获得窗口的垂直位置
+			// var iTop = (window.screen.availHeight - 30 - 780) / 2;
+			// //获得窗口的水平位置
+			// var iLeft = (window.screen.availWidth - 10 - 1030) / 2;
+			// if (!/^1\d{10}$/.test(phone)){
+			if (!phone){
+				ChatBusinessLayer.getAdminInfo(enUU).then(function (tel) {
+					phone = tel;
 					/*if (!/^1\d{10}$/.test(phone)){
 						toaster.pop('warning', '该店铺暂无管理员电话号码!');
 						return;
 					}*/
-					console.log(phone, enUU, userType,iTop,iLeft);
-					startChat(phone,enUU,userType,iTop,iLeft);
+					openChatBox(phone);
+					// startChat(phone,enUU,userType,iTop,iLeft);
 				});
 			}else {
-                startChat(phone,enUU,userType,iTop,iLeft);
+				openChatBox(phone);
+                // startChat(phone,enUU,userType,iTop,iLeft);
 			}
 		}
 
-		var startChat= function (phone,enUU,userType,iTop,iLeft) {
+		$scope.showLinkBox = false;
+		var openChatBox = function (phone) {
+			$scope.phone = phone || '-';
+			$scope.showLinkBox = true;
+			console.log(phone);
+		}
+		$scope.setShowLinkBox = function (flag) {
+			$scope.showLinkBox = flag;
+		}
+
+		/*var startChat= function (phone,enUU,userType,iTop,iLeft) {
             if ($rootScope.newTab){
                 $rootScope.newTab.close();
             }
@@ -182,7 +194,7 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
                 toaster.pop('warning', '对方没有开通客服系统,请联系官方客服!');
             });
             $rootScope.newTab = newTab;
-        }
+        }*/
 
 	}]);
 

+ 4 - 0
src/main/webapp/resources/js/common/query/enterprise.js

@@ -157,6 +157,10 @@ define([ 'angular', 'ui-bootstrap', 'ngResource' ], function(angular) {
                 url : 'basic/enterprise/:enuu/admin',
                 method : 'GET'
             },
+			getEnterPriseTelOrAdminTel: {
+				url : 'basic/enterprise/:enuu/tels',
+				method : 'GET'
+			},
 			getAllUsersByEnuu : {
 				url : 'basic/user/enterprise/info',
 				method : 'GET'

+ 7 - 1
src/main/webapp/resources/js/common/query/material.js

@@ -115,7 +115,13 @@ define([ 'ngResource' ], function() {
             batchPutOn: {
                 url: 'trade/products/batch',
                 method: 'PUT'
-            }
+            },
+            //根据物料id获取替换物料列表
+            getGoodsListByProductId : {
+                url: 'trade/products/:id/replaces',
+                method: 'GET',
+                isArray: true
+            },
         });
     }]);
 });

+ 91 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/bom_detail_ctrl.js

@@ -2,7 +2,7 @@
  * Created by yujia on 2017/3/19.
  *  求购的控制器
  */
-define(['app/app'], function (app) {
+define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
     'use strict';
     app.register.controller('bomDetailCtrl',
         ['$scope', '$rootScope', 'seekPurchase', 'toaster', 'BaseService',
@@ -15,6 +15,7 @@ define(['app/app'], function (app) {
 
                 // BOM名称
                 $scope.bomName = '';
+              $scope.ShaRETimer = {}
               seekPurchase.getSeekUrl({}, function(data) {
                 var seekUrl = data.url;
                 var getBomInfo = function () {
@@ -691,6 +692,95 @@ define(['app/app'], function (app) {
                   }).error(function (response) {
                   });
                 };
+                // 分享移入
+                $scope.setShowShare = function(seek, index) {
+
+                  clearTimeout($scope.ShaRETimer[index] ? $scope.ShaRETimer[index]: '')
+
+
+                  angular.element('.sharescancode').eq(index).css({
+                    display: 'block'
+                  })
+                  var canvas = document.getElementsByClassName('qrccode-canvas_' + index)[0]
+
+                  var shareMurl =  window.location.protocol +'//' + window.location.host + '/mobile/share/purChase/' + seek.id
+                  if($(canvas).children().length> 1){
+                    return false
+                  }
+                  console.log(QRCode)
+                  // QRCode.toCanvas(shareMurl, canvas, function (error) {
+                  //   if (error){ console.error(error);return;}
+                  //   console.log('success!');
+                  // });
+                  var qrcode = new QRCode(canvas, {
+                    text: shareMurl,
+                    width: 98,
+                    height: 98,
+                    colorDark : '#000000',
+                    colorLight : '#ffffff',
+                    correctLevel : QRCode.CorrectLevel.H
+                  });
+
+
+                  copyurl(index,seek)
+                }
+                // 分享移出
+                $scope.hideShare = function(index){
+                  $scope.ShaRETimer[index] = setTimeout(function(){
+                    angular.element('.sharescancode').eq(index).css({
+                      display: 'none'
+                    })
+                  },300)
+
+                }
+                // 父元素移入
+                $scope.pauseTimer = function(index) {
+                  clearTimeout($scope.ShaRETimer[index] ? $scope.ShaRETimer[index]: '')
+                }
+                // 父元素出
+                $scope.startTimer = function(index) {
+                  clearTimeout($scope.ShaRETimer[index] ? $scope.ShaRETimer[index]: '')
+                  $scope.ShaRETimer[index] = setTimeout(function(){
+                    angular.element('.sharescancode').eq(index).css({
+                      display: 'none'
+                    })
+                  },300)
+                };
+
+
+                $scope.caleUrl = function(seek){
+                  return window.location.protocol + '//' +  window.location.host + '/mobile/share/purChase/' + seek.id
+                };
+
+                // 针对tr 标签不允许 相对定位的情况,作以下处理,兼容性目前不知
+                $scope.caleTop = function(index){
+                  if( index == 0) {
+                    return {
+                      top: '130' * (index + 1) + 'px'
+                    }
+                  } else {
+                    return {
+                      top: 120 * (index + 1) + 'px'
+                    }
+                  }
+                }
+
+                function copyurl (index,seek){
+                  var s = window.location.protocol + '//' +  window.location.host + '/mobile/share/purChase/' + seek.id
+                  var _clipboard = new clipboard('.copyLink_' + index, {
+                    text: s
+                  });
+                  _clipboard.on('success', function (e) {
+                    toaster.pop('success', '复制成功')
+                  });
+                  _clipboard.on('error',  function (e) {
+                    toaster.pop('error', '浏览器不支持自动复制,请手动复制')
+                    _clipboard.destroy()
+                  });
+                  document.addEventListener('click', function() {
+                    // _this.showShare = false
+                  })
+                }
 
                 $scope.bomTableParams = new ngTableParams({
                   page: 1,

+ 8 - 4
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -244,12 +244,16 @@ define(['app/app'], function(app) {
 		 * 计算运费和店铺费用合计
 		 */
 		$scope.calculateFare = function () {
-			var fare = 0;
-			angular.forEach($scope.fareList, function (v) {
+            var fare = 0;
+            angular.forEach($scope.fareList, function (v) {
 				fare = NumberService.add(v, fare);
 			});
-			$scope.order.ensurePrice = NumberService.add($scope.order.totalprice, fare);
-		};
+            $scope.order.ensurePrice = NumberService.add($scope.order.totalprice, fare);
+            if ($scope.deliveryList[$scope.order.storeid].fareType == 4) {
+                $scope.order.ensurePrice = $scope.order.ensurePrice - $scope.deliveryList[$scope.order.storeid].fare;
+                $scope.deliveryList[$scope.order.storeid].fare = 0;
+            }
+        };
 
 
 		/**

+ 95 - 3
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -2,7 +2,7 @@
  * Created by yujia on 2017/3/19.
  *  求购的控制器
  */
-define(['app/app'], function (app) {
+define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
   'use strict';
   app.register.controller('seekPurchaseCtrl',
       ['$scope', '$rootScope', 'seekPurchase', 'toaster', 'BaseService',
@@ -16,6 +16,7 @@ define(['app/app'], function (app) {
             clearSeekStatus();
             $scope.activeType = type;
           }
+          $rootScope.ShaRETimer = {}
 
           var clearSeekStatus = function () {
             angular.forEach($scope.seekListData.content, function (item) {
@@ -366,7 +367,6 @@ define(['app/app'], function (app) {
               inquiry.endDate = $scope.applyObj.deadline;
               inquiry.sourceapp = "MALL";
               inquiry.amount = 1;
-              inquiryItem.prodTitle = $scope.applyObj.code;
               inquiryItem.userUU = $scope.userInfo.userUU;
               inquiryItem.source = "MALL";
               if ($scope.userInfo.enterprise) {
@@ -379,7 +379,7 @@ define(['app/app'], function (app) {
               inquiryItem.needquantity = $scope.applyObj.amount;
               inquiryItem.inbrand = $scope.applyObj.brand;
               inquiryItem.currency = $scope.applyObj.unitPrice ? $scope.applyObj.currency : null;
-              inquiryItem.cmpCode = ($scope.applyObj.code).toUpperCase();
+              inquiryItem.cmpCode = $scope.applyObj.code.toUpperCase();
               inquiryItem.unitPrice = $scope.applyObj.unitPrice;
               inquiryItem.produceDate = $scope.applyObj.produceDate;
               inquiryItem.date = new Date();
@@ -902,6 +902,98 @@ define(['app/app'], function (app) {
           $scope.setLinkBoxIndex = function (index) {
             $scope.linkBoxIndex = index;
           }
+
+          $scope.toBomdetail = function(id) {
+            window.location.href = 'user#/bomDetail/' + id
+          }
+          // 分享移入
+          $scope.setShowShare = function(seek, index) {
+
+            clearTimeout($rootScope.ShaRETimer[index] ? $rootScope.ShaRETimer[index]: '')
+
+
+            angular.element('.sharescancode').eq(index).css({
+              display: 'block'
+            })
+            var canvas = document.getElementsByClassName('qrccode-canvas_' + index)[0]
+
+            var shareMurl =  window.location.protocol +'//' + window.location.host + '/mobile/share/purChase/' + seek.id
+            if($(canvas).children().length> 1){
+              return false
+            }
+            console.log(QRCode)
+            // QRCode.toCanvas(shareMurl, canvas, function (error) {
+            //   if (error){ console.error(error);return;}
+            //   console.log('success!');
+            // });
+            var qrcode = new QRCode(canvas, {
+              text: shareMurl,
+              width: 98,
+              height: 98,
+              colorDark : '#000000',
+              colorLight : '#ffffff',
+              correctLevel : QRCode.CorrectLevel.H
+            });
+
+
+            copyurl(index,seek)
+          }
+          // 分享移出
+          $scope.hideShare = function(index){
+            $rootScope.ShaRETimer[index] = setTimeout(function(){
+              angular.element('.sharescancode').eq(index).css({
+                display: 'none'
+              })
+            },300)
+
+          }
+          // 父元素移入
+          $scope.pauseTimer = function(index) {
+            clearTimeout($rootScope.ShaRETimer[index] ? $rootScope.ShaRETimer[index]: '')
+          }
+          // 父元素出
+          $scope.startTimer = function(index) {
+            clearTimeout($rootScope.ShaRETimer[index] ? $rootScope.ShaRETimer[index]: '')
+            $rootScope.ShaRETimer[index] = setTimeout(function(){
+              angular.element('.sharescancode').eq(index).css({
+                display: 'none'
+              })
+            },300)
+          };
+
+          $scope.caleUrl = function(seek){
+            return window.location.protocol + '//' +  window.location.host + '/mobile/share/purChase/' + seek.id
+          };
+
+          // 针对tr 标签不允许 相对定位的情况,作以下处理,兼容性目前不知
+          $scope.caleTop = function(index){
+            if( index == 0) {
+              return {
+                top: '120' * (index + 1) + 'px'
+              }
+            } else {
+              return {
+                top: 120 * (index + 1) + 'px'
+              }
+            }
+          }
+
+          function copyurl (index,seek){
+            var s = window.location.protocol + '//' +  window.location.host + '/mobile/share/purChase/' + seek.id
+            var _clipboard = new clipboard('.copyLink_' + index, {
+              text: s
+            });
+            _clipboard.on('success', function (e) {
+              toaster.pop('success', '复制成功')
+            });
+            _clipboard.on('error',  function (e) {
+              toaster.pop('error', '浏览器不支持自动复制,请手动复制')
+              _clipboard.destroy()
+            });
+            document.addEventListener('click', function() {
+              // _this.showShare = false
+            })
+          }
           });
         }]);
 });

+ 12 - 2
src/main/webapp/resources/js/usercenter/main.js

@@ -26,7 +26,9 @@ require.config({
 		'showdown' : 'lib/showdown/showdown.min',
 		'calendar': 'lib/calendar/calendar',
 		'big': 'lib/decimal/big.min',
-		'angular-filter' : 'lib/angular/angular-filter.min'
+		'angular-filter' : 'lib/angular/angular-filter.min',
+		'clipboard': 'lib/clipboard.min',
+    'QRCode': 'lib/qrcode.min'
 	},
 	shim : {
 		'angular' : {
@@ -62,7 +64,15 @@ require.config({
 		},
 		'calendar': ['jquery'],
 		'big' : ['jquery'],
-		'angular-filter' : ['angular']
+		'angular-filter' : ['angular'],
+		'clipboard': {
+      'exports' : 'clipboard',
+      'deps' : [ 'jquery' ]
+		},
+    'QRCode': {
+      'exports' : 'QRCode',
+      'deps' : [ 'jquery' ]
+    }
 	}
 });
 require([ 'app/app', 'common/controllers/commonCtrls', 'common/controllers/GoodsPickUpCtrl' ], function(app) {

+ 13 - 1
src/main/webapp/resources/js/vendor/app.js

@@ -8,7 +8,19 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		return this.length > 0 ? this[this.length - 1] : null;
 	};
 
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','common.query.product', 'ui.tour', 'seekPurchaseServices', 'UASBatchPutOnPropertyModule']);
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','common.query.product', 'ui.tour', 'seekPurchaseServices', 'UASBatchPutOnPropertyModule'])
+  app.directive('onFinishRender', function ($timeout) {
+    return {
+      restrict: 'A',
+      link: function (scope) {
+        if (scope.$last === true) {
+          $timeout(function () {
+            scope.$emit('ngRepeatFinished');
+          });
+        }
+      }
+    }
+  })
 	//初始化,启动时载入app
 	app.init = function() {
 		angularAMD.bootstrap(app);

+ 1 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js

@@ -25,6 +25,7 @@ define(['app/app'], function(app) {
                 filter.endDate = $scope.endDate ? $scope.endDate.getTime()
                   : null;
                 param._state = "done";
+                param.overdue = 1;
                 param.filter = filter;
                 param.pageNumber = param.page;
                 param.pageSize = param.count;

+ 37 - 14
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js

@@ -35,29 +35,52 @@ define(['app/app'], function(app) {
                     }
                     //param.page = param.page;
                     param.size = param.count;
-                    param.spaceUU = $scope.userInfo.enterprise.uu;
+                    param.speaceUU = $scope.userInfo.enterprise.uu;
                     if (!($scope.searchParams.keyword.trim() == '')) {
                         param.keyword = $scope.searchParams.keyword.trim();
                     }
                     // 状态为申请中
                     param.status = 311;
-                    Enterprise.findApplyToMall(param, {}, function (page) {
-                        $defer.resolve(page.content || []);
-                        params.total(page.totalElements);
-                        $scope.page = page;
-                        $scope.totalPages = page.totalPages;
-                        $scope.content = page.content;
-                    }, function (error) {
-                        console.log(error);
-                        $defer.resolve([]);
-                        params.total(0);
-                        $scope.totalPages = 0;
-                        toaster.pop('error', '数据获取失败,请重新刷新页面!');
+                    $http({
+                        method: 'get',
+                        dataType: 'json',
+                        url: $scope.urlPrex + '/api/userspace/apply/info/mall',
+                        params: {speaceUU: param.speaceUU, page: param.page, size: param.size, status: param.status, keyword: param.keyword}
+                    }).success(function (page) {
+                        params.total(page.content.totalElements);
+                        $scope.page = page.content;
+                        $scope.totalPages = page.content.totalPages;
+                        $scope.content = page.content.content;
+                        $scope.totalElements = page.content.totalElements;
+                    }).error(function (response) {
+                        toaster.pop('error', '获取未处理审批数据失败');
                     });
+                    // Enterprise.findApplyToMall(param, {}, function (page) {
+                    //     $defer.resolve(page.content || []);
+                    //     params.total(page.totalElements);
+                    //     $scope.page = page;
+                    //     $scope.totalPages = page.totalPages;
+                    //     $scope.content = page.content;
+                    // }, function (error) {
+                    //     console.log(error);
+                    //     $defer.resolve([]);
+                    //     params.total(0);
+                    //     $scope.totalPages = 0;
+                    //     toaster.pop('error', '数据获取失败,请重新刷新页面!');
+                    // });
                 }
             });
         };
-        applyToEnterpriseTableParams();
+
+        if ($scope.isAdmin) {
+                User.isDevOrProd(null, function (data) {
+                    // $scope.isProd = data.data;
+                    $scope.urlPrex = data.data == 'success' ? 'https://sso.ubtob.com' : 'http://192.168.253.6:32323';
+                    applyToEnterpriseTableParams();
+                }, function (response) {
+                    toaster.pop('error', '获取运行环境失败');
+                });
+        }
         // 申请
         $scope.auditApply = function (status, id, UU) {
             var param = {

+ 27 - 9
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_index_ctrl.js

@@ -36,19 +36,34 @@ define(['app/app', 'calendar'], function(app) {
             var param = {};
             param.page = params.page;
             param.size = params.count;
-            param.spaceUU = $scope.userInfo.enterprise.uu;
+            param.speaceUU = $scope.userInfo.enterprise.uu;
             // 状态为申请中
             param.status = 311;
-            Enterprise.findApplyToMall(param, {}, function (page) {
-                $scope.totalPages = page.totalPages;
-                $scope.content = page.content;
-                $scope.totalElements = page.totalElements;
-            }, function (error) {
-                $scope.totalPages = 0;
-                toaster.pop('error', '数据获取失败,请重新刷新页面!');
+
+            $http({
+                method: 'get',
+                dataType: 'json',
+                url: $scope.urlPrex + '/api/userspace/apply/info/mall',
+                params: {speaceUU: param.speaceUU, page: param.page, size: param.size, status: param.status, keyword: null}
+            }).success(function (data) {
+                $scope.totalPages = data.content.totalPages;
+                $scope.content = data.content.content;
+                $scope.totalElements = data.content.totalElements;
+            }).error(function (response) {
+                toaster.pop('error', '获取未处理审批数据失败');
             });
+
+
+            // Enterprise.findApplyToMall(param, {}, function (page) {
+            //     $scope.totalPages = page.totalPages;
+            //     $scope.content = page.content;
+            //     $scope.totalElements = page.totalElements;
+            // }, function (error) {
+            //     $scope.totalPages = 0;
+            //     toaster.pop('error', '数据获取失败,请重新刷新页面!');
+            // });
         }
-        applyToEnterpriseTableParams();
+        // applyToEnterpriseTableParams();
 
         $scope.findMore = function () {
             window.location.href = '#/account/management/';
@@ -110,6 +125,9 @@ define(['app/app', 'calendar'], function(app) {
                 }).error(function (response) {
                     toaster.pop('error', '获取未处理审批数据失败');
                 });
+
+                // 查询企业绑定列表
+                applyToEnterpriseTableParams();
                 // VendorService.getNotDealApplyCount({spaceUU: $scope.userInfo.enterprise.uu}, function (data) {
                 //     console.log(data);
                 //     $scope.count = data.content[311];

+ 452 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -1,6 +1,18 @@
 define([ 'app/app', 'jquery-uploadify' ], function(app) {
 	'use strict';
 	app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', '$location', '$stateParams', 'Search', '$modal', 'ComponentActiveAPI', 'BrandSubmit', 'BrandActiveAPI', 'DistributionRule', 'prodRepositoryService', 'AuthenticationService', 'StoreInfo', 'ProductServiceQuery', 'StoreCms', 'ByteCountService', 'Goods', 'UASBatchPutOnPropertyServices', '$filter', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, $location, $stateParams, Search, $modal, ComponentActiveAPI, BrandSubmit, BrandActiveAPI, DistributionRule, prodRepositoryService, AuthenticationService, StoreInfo, ProductServiceQuery, StoreCms, ByteCountService, Goods, UASBatchPutOnPropertyServices, $filter) {
+    app.directive('onFinishRender', function ($timeout) {
+      return {
+        restrict: 'A',
+        link: function (scope) {
+          if (scope.$last === true) {
+            $timeout(function () {
+              scope.$emit('ngRepeatFinished');
+            });
+          }
+        }
+      }
+    })
 		$rootScope.active = 'vendor_material';
 		document.title = '卖家产品库-优软商城';
 		$scope.tab = 'material';
@@ -39,8 +51,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		 */
 		$scope.maxReserve = 999999999;
 
-		$scope.packageArray = ["请选择", "Bulk-散装", "Reel-卷装", "Tape/Reel-编带", "Tray-盘装",
-			"Tube-管装", "盒装", "袋装", "罐装", "瓶装", "桶装", "箱装"];
+    $scope.packageArray = ["请选择", "Bulk-散装", "Reel-卷装", "Tape/Reel-编带", "Tray-盘装", "Tube-管装", "盒装", "袋装", "罐装", "瓶装", "桶装", "箱装", "其他"];
 
 		$scope.showText = function (item) {
 			$scope.goods.editPackaging = item;
@@ -2883,8 +2894,446 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		$scope.deleteAttach = function () {
 			$scope.attachNameInfo = '';
 		};
+    $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.errorObj = [];
+    $scope.ShowReminfo = false
+    $scope.setProductReplacesByPerson = function(productReplaceList) {
+      for (var i = 0; i < productReplaceList.length; i++) {
+        $scope.errorObj[i] = {
+          code: 0,
+          brand: 0
+        };
 
-	}]);
+        if (!productReplaceList[i].ptrCmpcode && !productReplaceList[i].ptrBranden) {
+        	// 都为空的情况下
+          $scope.errorObj[i].code = 0;
+          $scope.errorObj[i].brand = 0;
+          productReplaceList[i]['index'] = 1
+
+				} else {
+          if (!productReplaceList[i].ptrCmpcode) {
+            $scope.errorObj[i].code = 1;
+          }
+					else if (!productReplaceList[i].ptrBranden) {
+            $scope.errorObj[i].brand = 1;
+          }
+          // productReplaceList[i].detno = i + 1;
+        }
+
+        if ($scope.errorObj[i].code == 1 || $scope.errorObj[i].brand == 1) {
+          toaster.pop('error', '请填完整信息');
+          return;
+        }
+      }
+
+      var _productReplaceList = productReplaceList.filter(function(item) {
+        return !item['index']
+			})
+
+      for(var j = 0; j < _productReplaceList.length; j++) {
+        _productReplaceList[j].detno = j + 1;
+			}
+			console.log(_productReplaceList)
+
+
+      //提交
+      Material.setProductReplacesByPerson({
+        productId: $scope.replaceMaterialId
+      }, _productReplaceList, function(data) {
+        $scope.setActiveIndex(-1);
+        // loadDataReload();
+        toaster.pop('success', '保存成功');
+      }, function(response) {
+        toaster.pop('error', '保存失败');
+      })
+    }
+    $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._material = material;
+        // if ($scope.resultDatalistArray[material.id]) {
+        //   getChangeList($scope.resultDatalistArray[material.id].arr, material)
+        // } else {
+				Material.getGoodsListByProductId({
+					id: material.id
+				}, function(data) {
+					getChangeList(data, material)
+				})
+        // }
+      } else {
+        $scope.errorObj = [{
+          code: 0,
+          brand: 0
+        }];
+        $scope.isInCodeList = [false];
+        $scope.isInBrandList = [false];
+      }
+    }
+    // 获取数据
+    var getChangeList = function(data, material) {
+      $scope.LookShowReminfo = false
+      var _changelistArr = normalChangeArr(angular.copy(data || []));
+      $scope.replaceMaterialList = _changelistArr.arr
+      $scope.linearLength = _changelistArr.headlength
+      $scope.resultDatalistArray[material.id] = _changelistArr
+      $scope.replaceMaterialId = material.id;
+      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,
+          editable: true
+        }];
+        $scope.linearLength = 1
+        $scope.errorObj = [{
+          code: 0,
+          brand: 0
+        }];
+        $scope.isInCodeList = [false];
+        $scope.isInBrandList = [false];
+      } else if ($scope.linearLength == 0) {
+        $scope.replaceMaterialList.splice(0, 0, {
+          ptrCmpcode: '',
+          ptrBranden: '',
+          showSimilarCodeList: false,
+          showSimilarBrandList: false,
+          editable: true,
+          productId: $scope.replaceMaterialList[0].productId
+        })
+        $scope.errorObj.splice(0, 0, {
+          code: 0,
+          brand: 0
+        });
+        $scope.isInCodeList.splice(0, 0, false);
+        $scope.isInBrandList.splice(0, 0, false);
+        $scope.linearLength++;
+
+        if ($scope.replaceMaterialList.length > 5) {
+          $scope.ngLastFinished = true
+        }
+      }
+    }
+
+    $scope.replaceMaterialList = [{
+      ptrBranden: '',
+      ptrCmpcode: '',
+      showSimilarCodeList: false,
+      showSimilarBrandList: false
+    }]
+    $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.canAdd = true;
+    $scope.setReplies = function(type, index) {
+      if (type === 'add') {
+        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,
+            editable: true,
+            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);
+          $scope.linearLength++;
+          $scope.ngLastFinished = true
+        } else {
+          toaster.pop('error', '请填完整信息');
+          return
+        }
+      } else if (type === 'sub' && $scope.replaceMaterialList.length > 0 && $scope.linearLength > 0) {
+        var _productId = $scope.replaceMaterialList[0].productId
+        $scope.linearLength--;
+        $scope.replaceMaterialList.splice(index, 1);
+        $scope.errorObj.splice(index, 1);
+        $scope.isInCodeList.splice(index, 1);
+        $scope.isInBrandList.splice(index, 1);
+
+        if($scope.linearLength === 0) {
+          $scope.replaceMaterialList.splice(0, 0, {
+            ptrCmpcode: '',
+            ptrBranden: '',
+            showSimilarCodeList: false,
+            showSimilarBrandList: false,
+            editable: true,
+            productId: _productId
+          })
+          $scope.errorObj.splice(0, 0, {
+            code: 0,
+            brand: 0
+          });
+          $scope.linearLength++
+          console.log($scope.replaceMaterialList)
+        }
+      }
+      // $scope.resultDatalistArray[$scope._material.id].arr = $scope.replaceMaterialList
+      // $scope.resultDatalistArray[$scope._material.id].headlength = $scope.linearLength
+    }
+
+    $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);
+        }
+      }
+    }
+    // 品牌change事件
+    $scope.onBrandChange = function(brand, index) {
+      if (brand && getRealLen(brand) > 50) {
+        $scope.replaceMaterialList[index].ptrBranden = cutOutString(brand, 50);
+      } else 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) {
+          $scope.setShowSimilarBrandList(false, index);
+        } else {
+          $scope.getSimilarBrand(brand, index);
+        }
+      }
+    }
+    $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.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.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.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.setIsInCodeList = function(flag, index) {
+      $scope.isInCodeList[index] = flag;
+    }
+    $scope.setIsInBrandList = function(flag, index) {
+      $scope.isInBrandList[index] = flag;
+    }
+    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;
+    }
+
+    /* 企业个人库相关操作 */
+    $scope.setShowActive = -1;
+    $scope.lookCmp = '';
+    $scope.lookBrand ='';
+    //查看列表数据
+    $scope.resultDatalist = []
+    //本地储存已从服务器获取到的列表数据
+    $scope.resultDatalistArray = {}
+    //存储当前所点击的数据
+    $scope._material = {}
+    // 是否显示 备注文本
+    $scope.LookShowReminfo = false
+    // 查看事件
+    $scope.lookActiveIndex = function(index, material) {
+      $scope.LookShowReminfo = false
+      $scope.setShowActive = index;
+      if (!material) {
+        return false
+      }
+      $scope._material = material
+      $scope.lookCmp = material.pcmpcode;
+      $scope.lookBrand = material.pbranden;
+
+      // if ($scope.resultDatalistArray[material.id]) {
+      //   $scope.resultDatalist = $scope.resultDatalistArray[material.id].arr
+      //   console.log($scope.resultDatalist)
+      //   $scope.linearLength = $scope.resultDatalistArray[material.id].headlength
+      // } else {
+			Material.getGoodsListByProductId({
+				id: material.id
+			}, function(data) {
+				$scope.resultDatalistArray[material.id] = normalChangeArr(data)
+				console.log(data)
+        $scope.resultDatalist = data
+				// $scope.resultDatalist = $scope.resultDatalistArray[material.id].arr
+				$scope.linearLength = $scope.resultDatalistArray[material.id].headlength
+			})
+      // }
+    }
+    //编辑按钮
+    $scope.updateIndex = function() {
+      $scope.setActiveIndex($scope.setShowActive, $scope._material)
+      $scope.setShowActive = -1;
+    }
+    // 计算下拉的ul 位置
+    $scope.ulEl = null
+    $scope.ultype = ''
+    $scope.inputEl = null
+    $scope.inputkey = null
+    $scope.onFocus = function($event, index, type, key) {
+      $scope.ulEl = angular.element('.'+index);
+      $scope.ultype = type
+      $scope.inputEl = $event
+      key+=1
+      $scope.inputkey = key
+      caleUllist($scope.inputEl,$scope.ultype,$scope.inputkey,$scope.ulEl)
+    }
+    // 针对当前人员权限重组list
+    var normalChangeArr = function(arr) {
+      $scope.ShowReminfo = false
+      var _arr = arr.slice()
+      var _headArr = [];
+      var _lastArr = [];
+      _arr.forEach(function(obj, index){
+        if (!obj.editable) {
+          _lastArr.push(obj)
+          $scope.ShowReminfo = true
+        } else {
+          _headArr.push(obj)
+        }
+      })
+      return {
+        arr:_headArr.concat(_lastArr),
+        headlength: _headArr.length
+      }
+    }
+
+    angular.element(window).resize(function() {
+      if(!$scope.inputEl){ return false}
+      caleUllist($scope.inputEl,$scope.ultype,$scope.inputkey,$scope.ulEl)
+    })
+
+    function caleUllist($event,type,key,el){
+      var _scrollTop = angular.element('.edit-replace-box .content').scrollTop()
+      var Y, X;
+      var _hl = angular.element('.edit-replace-box .content .content-line')[key] ? angular.element('.edit-replace-box .content .content-line')[key].offsetTop : 0
+      var _wl = (angular.element('body').width() - angular.element('.edit-replace-box').width()) / 2
+      var _bl = angular.element(window).height() * 0.2  + angular.element('.edit-replace-box .title').height()
+      var Y = _bl + _hl + 28 - _scrollTop
+      if(type == 'brand') {
+        X = _wl + $event.currentTarget.offsetLeft - 11
+        el.css({
+          right: X,
+          top: Y
+        })
+      }else {
+        X = _wl + $event.currentTarget.offsetLeft
+        el.css({
+          left: X,
+          top: Y
+        })
+      }
+    }
+
+    $scope.$on('ngRepeatFinished', function(ngRepeatFinishedEvent) {
+      if ($scope.replaceMaterialList.length > 5 && $scope.ngLastFinished == true) {
+        var el = angular.element('.edit-replace-box .content2')
+        el.scrollTop(el.scrollTop() + 42)
+        $scope.ngLastFinished = false
+      }
+    })
+  }]);
 
 	//类目选择模态框
 	app.register.controller('KindChooseCtrl', ['$scope', 'KindAPI', 'actives', 'toaster', '$modalInstance', function($scope, KindAPI, actives, toaster, $modalInstance) {

+ 2995 - 2869
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js

@@ -1,2917 +1,3043 @@
 define([ 'app/app', 'jquery-uploadify' ], function(app) {
-	'use strict';
-	app.register.controller('vendor_materialPersonCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', '$location', '$stateParams', 'Search', '$modal', 'ComponentActiveAPI', 'BrandSubmit', 'BrandActiveAPI', 'DistributionRule', 'prodRepositoryService', 'AuthenticationService', 'StoreInfo', 'ProductServiceQuery', 'StoreCms', 'ByteCountService', 'Goods', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, $location, $stateParams, Search, $modal, ComponentActiveAPI, BrandSubmit, BrandActiveAPI, DistributionRule, prodRepositoryService, AuthenticationService, StoreInfo, ProductServiceQuery, StoreCms, ByteCountService, Goods) {
-		$rootScope.active = 'vendor_material';
-		document.title = '卖家产品库-优软商城';
-		$scope.tab = 'material_person';
-		$scope.standard_tab = $stateParams.standardParam ? $stateParams.standardParam : 'unstandard';
-		$scope.choosedIds = [];
-		$scope.showTip = true;
-		$scope.resultTip = true;
-		$scope.$$nonProduct = {};
-        $scope.$$nonProduct.deleteDiv = false;
-		$scope.$$nonProduct.deleteGoods = false;
-		$scope.$$nonProduct.deleteMaterial = false;
-		$scope.$$nonProduct.selfTagNoticeShow = false;
-		$scope.$$nonProduct.count = 10;
-
-		$scope.$$nonProduct.enterSaveButton = false;
-		/**
-		 * 最大
-		 * @type {number}
-		 */
-		$scope.maxReserve = 999999999;
-		/**
-		 * 最小包装量的最大值
-		 */
-		$scope.maxPackQty = 999999;
-		$scope.minReserve = 1;
-
-		//只包含中文和英文的字符
-		var pattern = /^[\u4e00-\u9fa5a-zA-Z]+$/;
-		$scope.deleteDiv = false;
-
-		//数字的正则表达式
-		var intPattern = /^[1-9]+$/;
-
-		$scope.isInt = /^[0-9]*[1-9][0-9]*$/;
-
-		$scope.param = {
-			page : 1,
-			count : 10,
-			sorting : {
-				id : 'DESC'
-			},
-			isStandard : true,
-			type : "all"
-		};
-
-		$scope.goods = { editBreakUp: false, editSelfSale: 2, editPrices: [{}] };
-
-        $scope.sortByERP = 'none';
-        $scope.sortByERPReserve = function () {
-			if ($scope.sortByERP == 'none') {
-				$scope.sortByERP = 'DESC'
-			} else if ($scope.sortByERP == 'DESC') {
-				$scope.sortByERP = 'ASC'
-			} else {
-				$scope.sortByERP = 'none'
-			}
-			$scope.param.sorting = $scope.sortByERP == 'none' ? {id : 'DESC'} : {'erpReserve': $scope.sortByERP};
-			// $scope.sortByERP = type == $scope.sortByERP ? 'none' : type;
-			loadData();
-		}
-
-		$scope.goods = { breakUp: 1, isSelfSupport: 1, prices: [{}] };
-		$scope.isSelfSupport = true;
-		$scope.showShelfArea = showShelfArea;
-		$scope.closeShelArea = closeShelArea;
-
-		$scope.setPriceMinAmount = setPriceMinAmount;
-		$scope.setPriceMaxAmount = setPriceMaxAmount;
-		$scope.setPriceMinPackAmount = setPriceMinPackAmount;
-
-		$scope.checkMinDelivery = checkMinDelivery;
-		$scope.checkMaxDelivery = checkMaxDelivery;
-
-		$scope.isRecommendGoods = isRecommendGoods;
-		$scope.editGoods = editGoods;
-
-		$scope.closeEditGoods = closeEditGoods;
-
-		//添加产品
-		$scope.addGoods = addGoods;
-		//上架
-		$scope.putOn = putOn;
-		//更新库存信息
-		$scope.updateGoods = updateGoods;
-
-		$scope.error = {};
-
-		//获取币别信息
-		var deferred = $q.defer();
-		Enterprise.getCurrencyByRegisterAddress(null, function (data) {
-			deferred.resolve(data);
-		}, function (response) {
-			deferred.reject(response);
-		});
-
-        //获取登录的信息
-        var getAuthentication = function () {
-            return AuthenticationService.getAuthentication().success(function(data) {
-                if(data && data.enterprises) {
-                    data.enterprise = data.enterprises[data.enterprises.length - 1];
-                    if(data.enterprises.length > 1) {
-                        var enSelect = [];
-                        angular.forEach(data.enterprises, function(e){
-                            if(e.current)
-                                data.enterprise = e;
-                            else
-                                enSelect.push(e);
-                        });
-                        data.enSelect = enSelect;
-                    }
-                }
-                $rootScope.userInfo = data;
-            }).error(function(response) {
-                toaster.pop('info', '获取定单的信息' + response);
+  'use strict';
+  app.register.controller('vendor_materialPersonCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', '$location', '$stateParams', 'Search', '$modal', 'ComponentActiveAPI', 'BrandSubmit', 'BrandActiveAPI', 'DistributionRule', 'prodRepositoryService', 'AuthenticationService', 'StoreInfo', 'ProductServiceQuery', 'StoreCms', 'ByteCountService', 'Goods', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, $location, $stateParams, Search, $modal, ComponentActiveAPI, BrandSubmit, BrandActiveAPI, DistributionRule, prodRepositoryService, AuthenticationService, StoreInfo, ProductServiceQuery, StoreCms, ByteCountService, Goods) {
+    $rootScope.active = 'vendor_material';
+    document.title = '卖家产品库-优软商城';
+    $scope.tab = 'material_person';
+    $scope.standard_tab = $stateParams.standardParam ? $stateParams.standardParam : 'unstandard';
+    $scope.choosedIds = [];
+    $scope.showTip = true;
+    $scope.resultTip = true;
+    $scope.$$nonProduct = {};
+    $scope.$$nonProduct.deleteDiv = false;
+    $scope.$$nonProduct.deleteGoods = false;
+    $scope.$$nonProduct.deleteMaterial = false;
+    $scope.$$nonProduct.selfTagNoticeShow = false;
+    $scope.$$nonProduct.count = 10;
+
+    $scope.$$nonProduct.enterSaveButton = false;
+    /**
+     * 最大
+     * @type {number}
+     */
+    $scope.maxReserve = 999999999;
+    /**
+     * 最小包装量的最大值
+     */
+    $scope.maxPackQty = 999999;
+    $scope.minReserve = 1;
+
+    //只包含中文和英文的字符
+    var pattern = /^[\u4e00-\u9fa5a-zA-Z]+$/;
+    $scope.deleteDiv = false;
+
+    //数字的正则表达式
+    var intPattern = /^[1-9]+$/;
+
+    $scope.isInt = /^[0-9]*[1-9][0-9]*$/;
+
+    $scope.param = {
+      page : 1,
+      count : 10,
+      sorting : {
+        id : 'DESC'
+      },
+      isStandard : true,
+      type : "all"
+    };
+
+    $scope.goods = { editBreakUp: false, editSelfSale: 2, editPrices: [{}] };
+
+    $scope.sortByERP = 'none';
+    $scope.sortByERPReserve = function () {
+      if ($scope.sortByERP == 'none') {
+        $scope.sortByERP = 'DESC'
+      } else if ($scope.sortByERP == 'DESC') {
+        $scope.sortByERP = 'ASC'
+      } else {
+        $scope.sortByERP = 'none'
+      }
+      $scope.param.sorting = $scope.sortByERP == 'none' ? {id : 'DESC'} : {'erpReserve': $scope.sortByERP};
+      // $scope.sortByERP = type == $scope.sortByERP ? 'none' : type;
+      loadData();
+    }
+
+    $scope.goods = { breakUp: 1, isSelfSupport: 1, prices: [{}] };
+    $scope.isSelfSupport = true;
+    $scope.showShelfArea = showShelfArea;
+    $scope.closeShelArea = closeShelArea;
+
+    $scope.setPriceMinAmount = setPriceMinAmount;
+    $scope.setPriceMaxAmount = setPriceMaxAmount;
+    $scope.setPriceMinPackAmount = setPriceMinPackAmount;
+
+    $scope.checkMinDelivery = checkMinDelivery;
+    $scope.checkMaxDelivery = checkMaxDelivery;
+
+    $scope.isRecommendGoods = isRecommendGoods;
+    $scope.editGoods = editGoods;
+
+    $scope.closeEditGoods = closeEditGoods;
+
+    //添加产品
+    $scope.addGoods = addGoods;
+    //上架
+    $scope.putOn = putOn;
+    //更新库存信息
+    $scope.updateGoods = updateGoods;
+
+    $scope.ShowReminfo = false //是否显示提示语,默认为否
+    $scope.error = {};
+
+    //获取币别信息
+    var deferred = $q.defer();
+    Enterprise.getCurrencyByRegisterAddress(null, function (data) {
+      deferred.resolve(data);
+    }, function (response) {
+      deferred.reject(response);
+    });
+
+    //获取登录的信息
+    var getAuthentication = function () {
+      return AuthenticationService.getAuthentication().success(function(data) {
+        if(data && data.enterprises) {
+          data.enterprise = data.enterprises[data.enterprises.length - 1];
+          if(data.enterprises.length > 1) {
+            var enSelect = [];
+            angular.forEach(data.enterprises, function(e){
+              if(e.current)
+                data.enterprise = e;
+              else
+                enSelect.push(e);
             });
-        };
+            data.enSelect = enSelect;
+          }
+        }
+        $rootScope.userInfo = data;
+      }).error(function(response) {
+        toaster.pop('info', '获取定单的信息' + response);
+      });
+    };
+
+    //判断是否是商城管理公司,是否可以选择自营。
+    $q.all([getAuthentication()]).then(function() {
+      //获取店铺的信息
+      StoreInfo.getStoreInfoByEnuu({enUU : $rootScope.userInfo.enterprise.uu}, function(data) {
+        $scope.storeInfo = data;
+        if(!$scope.storeInfo || $scope.storeInfo.status != 'OPEN' || $scope.storeInfo.storeName.indexOf('优软测试二') > 0 || $scope.storeInfo.storeName.indexOf('优软商城') > 0) {
+          $scope.$$nonProduct.canSelfSale = false;
+        }else {
+          $scope.$$nonProduct.canSelfSale = true;
+        }
+      }, function(response) {
+        toaster.pop('error', '获取店铺的信息失败, ' + response.data);
+      });
+    });
+
+    $scope.cancelTip = function () {
+      $scope.showTip = false;
+    };
+
+    $scope.deleteImg = function (obj) {
+      delete obj.editPic;
+    };
+
+    var currencyPromise = deferred.promise;
+
+    $q.all([currencyPromise, $rootScope.storePromise]).then(function (result) {
+      console.log(result);
+      var curData = result[0];
+      if(!$scope.store) {
+        $scope.store = {};
+      }
+      if((curData != null) && (curData.code == 1)) {
+        if(curData.data == 'USD') {
+          $scope.store.enType = 'HK'
+        }else {
+          $scope.store.enType = 'MAINLAND'
+        }
+      }else {
+        $scope.store.enType = 'MAINLAND';
+        toaster.pop('info', '提示', '您公司的注册地址为空,无法确定币别,系统默认为人民币');
+        // $scope.onsale.currency = 'RMB';
+      }
+    })['catch'](function (error) {
+      if(!$scope.store) {
+        $scope.store = {};
+      }
+      var curData = error[0];
+      if((curData != null) && (curData.code == 1)) {
+        if(curData.data == 'USD') {
+          $scope.store.enType = 'HK';
+        }else {
+          $scope.store.enType = 'MAINLAND';
+        }
+      }else {
+        $scope.store.enType = 'MAINLAND';
+      }
+    });
+
+    /**
+     * 切换标准/非标准
+     * @param isStandard
+     */
+    $scope.toggleStandard = function (isStandard) {
+      $scope.standard_tab = isStandard;
+      $scope.param.keyword = '';
+      if (isStandard == 'standard')
+        $scope.param.type = "standard";
+      if (isStandard == 'unstandard')
+        $scope.param.type = "nStandard";
+      $scope.isBatch = false;
+      $scope.param.count = 10;
+      loadDataReload();
+    };
+
+    var updateTagCount = function () {
+      Material.getCountOfProduct({isPerson :1}, {}, function (data) {
+        if (data){
+          $scope.sCount = data.standard;
+          $scope.nCount = data.nStandard;
+        }
+      }, function (error) {
+        toaster.pop("error", error.data);
+      })
+    };
+
+    // 进入批量操作
+    $scope.enterBatch = function () {
+      closeAllEditStatus();
+      $scope.isBatch = true;
+      $scope.isChoosedAll = false;
+    };
+
+    // 取消批量操作
+    $scope.exitBatch =function () {
+      $scope.isBatch = false;
+      $scope.choosedIds = [];
+      $scope.isChoosedAll = false;
+      angular.forEach($scope.currenctMaterial, function (material) {
+        material.isChoosed = false;
+      });
+    };
+
+    // 全选
+    $scope.chooseAll = function () {
+      $scope.isChoosedAll = !$scope.isChoosedAll;
+      angular.forEach($scope.currenctMaterial, function (material) {
+        material.isChoosed = $scope.isChoosedAll;
+      });
+    };
+
+    // 检查是否全选
+    var checkChoosedAll = function () {
+      $scope.isChoosedAll = true;
+      angular.forEach($scope.currenctMaterial, function (material) {
+        if (!material.isChoosed) {
+          $scope.isChoosedAll = false;
+        }
+      });
+    };
+
+    // 单选
+    $scope.chooseOne = function (material) {
+      if (typeof material.isChoosed == 'undefined' || !material.isChoosed) {
+        material.isChoosed = true;
+      } else {
+        material.isChoosed = false;
+      }
+      checkChoosedAll();
+    };
+
+    var initRuleCount = function () {
+      return DistributionRule.findCountOfActiveRule({},{},function (data) {
+        if (data.success){
+          $scope.needShowTip = data.data;
+        }
+      }, function (error) {
+        toaster.pop("error", error.data);
+      })
+    };
+
+    //获取选中之后的信息
+    $scope.getChoosedInfo = function () {
+      angular.forEach($scope.currenctMaterial, function (material) {
+        if (material.isChoosed) {
+          $scope.choosedIds.push(material.id);
+        }
+      });
+    };
+
+    // 确认删除
+    $scope.confirmDelete = function (ids) {
+      if ($scope.isChoosedAll) {
+
+        Material.deleteStandardAll(null, null, function (data) {
+          $scope.deleteDiv = false;
+          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 {
+            toaster.pop('success', data.message);
+          }
+        }, function (response) {
+          toaster.pop('error', '批量删除信息失败');
+        });
 
-        //判断是否是商城管理公司,是否可以选择自营。
-        $q.all([getAuthentication()]).then(function() {
-            //获取店铺的信息
-            StoreInfo.getStoreInfoByEnuu({enUU : $rootScope.userInfo.enterprise.uu}, function(data) {
-                $scope.storeInfo = data;
-				if(!$scope.storeInfo || $scope.storeInfo.status != 'OPEN' || $scope.storeInfo.storeName.indexOf('优软测试二') > 0 || $scope.storeInfo.storeName.indexOf('优软商城') > 0) {
-					$scope.$$nonProduct.canSelfSale = false;
-				}else {
-					$scope.$$nonProduct.canSelfSale = true;
-				}
-            }, function(response) {
-                toaster.pop('error', '获取店铺的信息失败, ' + response.data);
-            });
+      } else {
+        var ids = $scope.choosedIds.join(',');
+        Material.deleteBatch({ids: ids, isPerson: 1}, function (data) {
+          toaster.pop('success', '删除成功');
+          $scope.choosedIds = [];
+          $scope.deleteDiv = false;
+          loadDataReload();
+        }, function (response) {
+          toaster.pop('error', response.data);
+          $scope.choosedIds = [];
+          $scope.deleteDiv = false;
         });
+      }
+    };
+
+    /**
+     * 对自定义的标签说明做隐藏或显示
+     */
+    $scope.selfTagTaggle = function (status) {
+      $scope.$$nonProduct.selfTagNoticeShow = status;
+    };
+
+    // 取消删除
+    $scope.cancleDelete = function () {
+      $scope.$$nonProduct.deleteDiv = false;
+    };
+
+    /**
+     * 关闭所有的编辑和展开状态
+     */
+    var closeAllEditStatus = function (goods) {
+      angular.forEach($scope.currenctMaterial, function (material) {
+        if(goods) {
+          if(goods.productid != material.id) {
+            delete material.selected;
+            material.addGoodsOper = false;
+            material.exPandOper = false;
+          }
+        }else {
+          delete material.selected;
+          material.addGoodsOper = false;
+          material.exPandOper = false;
+        }
 
-		$scope.cancelTip = function () {
-			$scope.showTip = false;
-		};
-
-		$scope.deleteImg = function (obj) {
-			delete obj.editPic;
-		};
-
-		var currencyPromise = deferred.promise;
-
-		$q.all([currencyPromise, $rootScope.storePromise]).then(function (result) {
-			console.log(result);
-			var curData = result[0];
-			if(!$scope.store) {
-				$scope.store = {};
-			}
-			if((curData != null) && (curData.code == 1)) {
-				if(curData.data == 'USD') {
-					$scope.store.enType = 'HK'
-				}else {
-					$scope.store.enType = 'MAINLAND'
-				}
-			}else {
-				$scope.store.enType = 'MAINLAND';
-				toaster.pop('info', '提示', '您公司的注册地址为空,无法确定币别,系统默认为人民币');
-				// $scope.onsale.currency = 'RMB';
-			}
-		})['catch'](function (error) {
-			if(!$scope.store) {
-				$scope.store = {};
-			}
-			var curData = error[0];
-			if((curData != null) && (curData.code == 1)) {
-				if(curData.data == 'USD') {
-					$scope.store.enType = 'HK';
-				}else {
-					$scope.store.enType = 'MAINLAND';
-				}
-			}else {
-				$scope.store.enType = 'MAINLAND';
-			}
-		});
-
-		/**
-		 * 切换标准/非标准
-		 * @param isStandard
-		 */
-		$scope.toggleStandard = function (isStandard) {
-			$scope.standard_tab = isStandard;
-			$scope.param.keyword = '';
-			if (isStandard == 'standard')
-				$scope.param.type = "standard";
-			if (isStandard == 'unstandard')
-				$scope.param.type = "nStandard";
-			$scope.isBatch = false;
-			$scope.param.count = 10;
-			loadDataReload();
-		};
-
-		var updateTagCount = function () {
-			Material.getCountOfProduct({isPerson :1}, {}, function (data) {
-				if (data){
-					$scope.sCount = data.standard;
-					$scope.nCount = data.nStandard;
-				}
-			}, function (error) {
-				toaster.pop("error", error.data);
-			})
-		};
-
-		// 进入批量操作
-		$scope.enterBatch = function () {
-			closeAllEditStatus();
-			$scope.isBatch = true;
-			$scope.isChoosedAll = false;
-		};
-
-		// 取消批量操作
-		$scope.exitBatch =function () {
-			$scope.isBatch = false;
-			$scope.choosedIds = [];
-			$scope.isChoosedAll = false;
-			angular.forEach($scope.currenctMaterial, function (material) {
-				material.isChoosed = false;
-			});
-		};
-
-		// 全选
-		$scope.chooseAll = function () {
-			$scope.isChoosedAll = !$scope.isChoosedAll;
-			angular.forEach($scope.currenctMaterial, function (material) {
-				material.isChoosed = $scope.isChoosedAll;
-			});
-		};
-
-		// 检查是否全选
-		var checkChoosedAll = function () {
-			$scope.isChoosedAll = true;
-			angular.forEach($scope.currenctMaterial, function (material) {
-				if (!material.isChoosed) {
-					$scope.isChoosedAll = false;
-				}
-			});
-		};
-
-		// 单选
-		$scope.chooseOne = function (material) {
-			if (typeof material.isChoosed == 'undefined' || !material.isChoosed) {
-				material.isChoosed = true;
-			} else {
-				material.isChoosed = false;
-			}
-			checkChoosedAll();
-		};
-
-		var initRuleCount = function () {
-			return DistributionRule.findCountOfActiveRule({},{},function (data) {
-				if (data.success){
-					$scope.needShowTip = data.data;
-				}
-			}, function (error) {
-				toaster.pop("error", error.data);
-			})
-		};
-
-		//获取选中之后的信息
-		$scope.getChoosedInfo = function () {
-			angular.forEach($scope.currenctMaterial, function (material) {
-				if (material.isChoosed) {
-					$scope.choosedIds.push(material.id);
-				}
-			});
-		};
-
-		// 确认删除
-		$scope.confirmDelete = function (ids) {
-			if ($scope.isChoosedAll) {
-
-					Material.deleteStandardAll(null, null, function (data) {
-						$scope.deleteDiv = false;
-                        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 {
-							toaster.pop('success', data.message);
-						}
-					}, function (response) {
-						toaster.pop('error', '批量删除信息失败');
-					});
-
-			} else {
-				var ids = $scope.choosedIds.join(',');
-				Material.deleteBatch({ids: ids, isPerson: 1}, function (data) {
-					toaster.pop('success', '删除成功');
-					$scope.choosedIds = [];
-					$scope.deleteDiv = false;
-					loadDataReload();
-				}, function (response) {
-					toaster.pop('error', response.data);
-					$scope.choosedIds = [];
-					$scope.deleteDiv = false;
-				});
-			}
-		};
-
-		/**
-		 * 对自定义的标签说明做隐藏或显示
-		 */
-		$scope.selfTagTaggle = function (status) {
-			$scope.$$nonProduct.selfTagNoticeShow = status;
-		};
-
-		// 取消删除
-		$scope.cancleDelete = function () {
-            $scope.$$nonProduct.deleteDiv = false;
-		};
-
-		/**
-		 * 关闭所有的编辑和展开状态
-		 */
-		var closeAllEditStatus = function (goods) {
-			angular.forEach($scope.currenctMaterial, function (material) {
-				if(goods) {
-					if(goods.productid != material.id) {
-						delete material.selected;
-						material.addGoodsOper = false;
-						material.exPandOper = false;
-					}
-				}else {
-					delete material.selected;
-					material.addGoodsOper = false;
-					material.exPandOper = false;
-				}
-
-				angular.forEach(material.goodsArr, function (g) {
-					if(goods) {
-						if(goods.id != g.id) {
-							goods.edit = false;
-						}
-					}
-				});
-			});
-		};
-		// 批量删除
-		$scope.deleteBatch = function () {
-            $scope.getChoosedInfo();
-            if(!$scope.choosedIds || $scope.choosedIds.length == 0) {
-                toaster.pop('warning', '提示','请选择要删除的信息');
-                return ;
+        angular.forEach(material.goodsArr, function (g) {
+          if(goods) {
+            if(goods.id != g.id) {
+              goods.edit = false;
             }
-            closeAllEditStatus();
-            $scope.$$nonProduct.deleteDiv = true;
-            $scope.$$nonProduct.deleteGoods = false;
-            $scope.$$nonProduct.deleteMaterial = true;
-            $scope.$$nonProduct.deleteMessage = '';
-            $scope.opendeleteModal();
-		};
-
-		// 单个删除
-		$scope.deleteMaterial = function(material) {
-			if(!material || !material.id) {
-				return ;
-			}
-			Goods.getDeleteProductMessage({productid: material.id}, function (data) {
-				console.log(data);
-				if(data.code == 1) {
-					$scope.$$nonProduct.deleteMessage = data.message;
-					$scope.choosedIds = [];
-					$scope.choosedIds.push(material.id);
-					$scope.$$nonProduct.deleteGoods = false;
-					$scope.$$nonProduct.deleteMaterial = true;
-					$scope.opendeleteModal();
-				}else {
-					toaster.pop('warning', '提示', data.message);
-				}
-			}, function (response) {
-				toaster.pop('error', '错误', response.data);
-			});
-		};
-
-		/**
-		 * 打开删除的模态框
-		 */
-		$scope.opendeleteModal = function () {
-			var modalInstance = $modal.open({
-				animation: true,
-				templateUrl: 'static/view/common/modal/delete_modal.html',
-				controller: 'vendor_delete_person_ctrl',
-				resolve: {
-					ids: function() {
-						return $scope.choosedIds;
-					},
-					deleteMaterial: function () {
-						return $scope.$$nonProduct.deleteMaterial;
-					},
-					deleteGoods: function () {
-						return $scope.$$nonProduct.deleteGoods;
-					},
-					selectAll : function () {
-						return $scope.isChoosedAll;
-					},
-					standard_tab : function () {
-						return $scope.standard_tab;
-					},
-					message : function () {
-						return $scope.$$nonProduct.deleteMessage;
-					}
-
-				}
-			});
-			modalInstance.result.then(function(response){
-				if($scope.$$nonProduct.deleteMaterial) {
-					$scope.choosedIds = [];
-					loadDataReload();
-				}else if($scope.$$nonProduct.deleteGoods) {
-					if(!response || !response.id) {
-						loadData();
-					}
-					for(var i = 0; i < $scope.currenctMaterial.length; i++) {
-						if($scope.currenctMaterial[i].id == response.id) {
-							$scope.currenctMaterial.splice(i, 1, response);
-							if(response.batchCount > 0) {
-								$scope.expandGoods($scope.currenctMaterial[i]);
-							}else {
-								$scope.currenctMaterial[i].exPandOper = false;
-							}
-						}
-					}
-				}
-			}, function(){
-			});
-		};
-
-		//获取该物料的产品信息
-		$scope.expandGoods = function (material, addGoods) {
-			if(!material || !material.id) {
-				return ;
-			}
-			Material.getGoodsByProductId({id: material.id}, function (data) {
-                material.goodsArr = data;
-				angular.forEach($scope.currenctMaterial, function (material) {
-					if(material.selected){
-						delete material.selected;
-					}
-					material.exPandOper = false;
-					material.addGoodsOper = false;
-				});
-				material.exPandOper = true;
-				material.selected = true;
-				if(addGoods) {
-					material.addGoodsOper = true;
-				}
-            }, function (response) {
-				toaster.pop('error', '错误', response.data);
-            });
-		};
-
-        /**
-         * 监听点击的事件,关闭删除的对话框
-         * @param event
-         */
-        // document.onclick = function (event) {
-        //     if(event) {
-        //         var tag = event.target;
-        //         while (tag && tag.nodeName != 'SECTION') {
-        //             var name = tag.getAttribute('name');
-        //             if(name && (name == 'delete-modal' || name == 'delete-material')) {
-        //                 return ;
-        //             }
-        //             console.log(name);
-        //             tag = tag.parentElement;
-        //         }
-        //         $scope.$apply(function () {
-			// 		$scope.cancleDelete();
-			// 	});
-        //     }
-        // };
-
-		/**
-		 * 在售产品信息收起
-		 */
-		$scope.disExpandGoods = function (material) {
-			if (!material) {
-				return ;
-			}
-			if (material.selected) {
-				delete material.selected;
-			}
-			material.exPandOper = false;
-			material.addGoodsOper = false;
-
-		};
-
-		/**
-		 * 是否被推荐
-		 * @param goods
-		 */
-		function isRecommendGoods(goods) {
-			if(!goods) {
-				return ;
-			}
-            $scope.$$nonProduct.deleteMessage = '';
-			closeAllEditStatus(goods);
-			$scope.choosedIds = [];
-			Goods.isRecommendGoods({id: goods.id}, null, function (data) {
-				$scope.$$nonProduct.deleteGoods = true;
-				$scope.$$nonProduct.deleteMaterial = false;
-                $scope.$$nonProduct.deleteDiv = true;
-				if(data.code == 1) {
-					if(goods.status == '601' || goods.status == '602') {
-						$scope.$$nonProduct.deleteMessage = '该产品已上架';
-					}
-				}else {
-					$scope.$$nonProduct.deleteMessage = data.message;
-				}
-				$scope.choosedIds.push(goods.id);
-				$scope.opendeleteModal();
-			}, function (response) {
-				toaster.pop('error', '错误', response.data);
-			});
-		};
-
-		/**
-		 * 编辑在售产品的信息
-		 * @param goods
-		 */
-		function editGoods(material, goods) {
-			angular.forEach(material.goodsArr, function (g) {
-				g.edit = false;
-			});
-            $scope.$$nonProduct.editGoods = angular.copy(goods);
-			goods.edit = true;
-
-            goods.editTag = goods.tag;
-            goods.editTagInvalid = false;
-            goods.editTagPre = goods.tag;
-
-            goods.editPackaging = goods.packaging;
-            goods.editPackagingInvalid = false;
-            goods.editPackaginPre = goods.packaging;
-
-            goods.editProduceDate = goods.produceDate;
-            goods.editProduceDateInvalid = false;
-            goods.editProduceDatePre = goods.produceDate;
-
-            goods.editReserve = goods.reserve;
-            goods.editReserveInvalid = false;
-            goods.editReservePre = goods.reserve;
-
-            goods.editMinPackQty = goods.minPackQty;
-            goods.editMinPackQtyPre = goods.minPackQty;
-            goods.editMinPackQtyInValid = false;
-
-            goods.editMinBuyQty = goods.minBuyQty;
-            goods.editMinBuyQtyPre = goods.minBuyQty;
-            goods.editMinBuyQtyInValid = false;
-
-            goods.editMinDelivery = goods.minDelivery;
-            goods.editMinDeliveryPre = goods.minDelivery;
-            goods.editMinDeliveryinValid = false;
-
-            goods.editMaxDelivery = goods.maxDelivery;
-            goods.editMaxDeliveryPre = goods.maxDelivery;
-            goods.editMaxDeliveryinValid = false;
-
-            goods.editSelfSale = $scope.storeInfo.uuid != 'undefind' && goods.storeid == $scope.storeInfo.uuid && $scope.storeInfo.storeName.indexOf('优软测试二') < 0 && $scope.storeInfo.storeName.indexOf('优软商城') < 0 ? 1 : 2;
-            goods.editBreakUp = goods.breakUp;
-            goods.editPrices = angular.copy(goods.prices);
-            angular.forEach(goods.editPrices, function (price) {
-                price.startPre = price.start;
-                price.startDirty = false;
-
-                price.endPre = price.end;
-                price.endDirty = false;
-
-                price.rMBPricePre = price.rMBPrice;
-                price.rMBPriceDirty = false;
+          }
+        });
+      });
+    };
+    // 批量删除
+    $scope.deleteBatch = function () {
+      $scope.getChoosedInfo();
+      if(!$scope.choosedIds || $scope.choosedIds.length == 0) {
+        toaster.pop('warning', '提示','请选择要删除的信息');
+        return ;
+      }
+      closeAllEditStatus();
+      $scope.$$nonProduct.deleteDiv = true;
+      $scope.$$nonProduct.deleteGoods = false;
+      $scope.$$nonProduct.deleteMaterial = true;
+      $scope.$$nonProduct.deleteMessage = '';
+      $scope.opendeleteModal();
+    };
+
+    // 单个删除
+    $scope.deleteMaterial = function(material) {
+      if(!material || !material.id) {
+        return ;
+      }
+      Goods.getDeleteProductMessage({productid: material.id}, function (data) {
+        console.log(data);
+        if(data.code == 1) {
+          $scope.$$nonProduct.deleteMessage = data.message;
+          $scope.choosedIds = [];
+          $scope.choosedIds.push(material.id);
+          $scope.$$nonProduct.deleteGoods = false;
+          $scope.$$nonProduct.deleteMaterial = true;
+          $scope.opendeleteModal();
+        }else {
+          toaster.pop('warning', '提示', data.message);
+        }
+      }, function (response) {
+        toaster.pop('error', '错误', response.data);
+      });
+    };
+
+    /**
+     * 打开删除的模态框
+     */
+    $scope.opendeleteModal = function () {
+      var modalInstance = $modal.open({
+        animation: true,
+        templateUrl: 'static/view/common/modal/delete_modal.html',
+        controller: 'vendor_delete_person_ctrl',
+        resolve: {
+          ids: function() {
+            return $scope.choosedIds;
+          },
+          deleteMaterial: function () {
+            return $scope.$$nonProduct.deleteMaterial;
+          },
+          deleteGoods: function () {
+            return $scope.$$nonProduct.deleteGoods;
+          },
+          selectAll : function () {
+            return $scope.isChoosedAll;
+          },
+          standard_tab : function () {
+            return $scope.standard_tab;
+          },
+          message : function () {
+            return $scope.$$nonProduct.deleteMessage;
+          }
 
-                price.uSDPricePre = price.uSDPrice;
-                price.uSDPriceDirty = false;
-            });
-			goods.editPic = goods.img;
-		};
-
-		/**
-		 * 取消编辑
-		 * @param goods
-		 */
-		function closeEditGoods(material, goods) {
-            //替换之前的信息
-            if(!material || !material.goodsArr || !goods || !$scope.$$nonProduct.editGoods) {
-                return ;
-            }
-            for(var i = 0; i < material.goodsArr.length; i++) {
-                if(material.goodsArr[i].id == goods.id) {
-                    material.goodsArr.splice(i, 1, $scope.$$nonProduct.editGoods);
-                    break;
-                }
-            };
-		}
-
-		/**
-		 * 更新非标的匹配信息
-		 */
-		$scope.updateNStandardOne = function (product) {
-			if (product.matchresults.length > 0) {
-				if (product.canMatch) {
-					var matchProducts = {
-						matchId: product.id,
-						detailId: product.cmpId
-					};
-				}
-			}
-			prodRepositoryService.saveMatchInfo(null, matchProducts, function (data) {
-				if (data.code == 1 && data.data) {
-					$scope.backData = data.data;
-					$scope.repeatList = data.data.repeatList;
-					$scope.haveRepeat = true;
-					// loadData();
-					$scope.standard_tab = 'matchResult';
-				} else {
-					$scope.haveRepeat = false;
-					$scope.matchSuccess = $scope.matchSuccess + 1;
-					$scope.matchFail = $scope.matchFail - 1;
-					loadData();
-				}
-			}, function () {
-				toaster.pop("error", "匹配失败")
-			});
-		};
-
-		$scope.cancelChoose = function () {
-			angular.forEach($scope.repeatList, function (item) {
-				if (item.selected){
-					delete item.selected;
-				}
-			});
-			$scope.haveRepeat = false;
-		};
-
-		$scope.deleteIdArray = [];
-		$scope.ensureDeleteRepeat = function () {
-			for (var i = 0; i < $scope.repeatList.length; i++) {
-				if (!$scope.repeatList[i].selected) {
-					toaster.pop("info", "请选择要保留的产品信息");
-					return ;
-				} else {
-					angular.forEach($scope.repeatList[i], function (goods) {
-						if (goods.id != $scope.repeatList[i].selected){
-							$scope.deleteIdArray.push(goods.id);
-						}
-					});
-				}
-			}
-			if ($scope.deleteIdArray.length != $scope.repeatList.length) {
-				toaster.pop("info", "请选择要保留的产品信息");
-				return ;
-			}
-
-			Material.updateInfoAfterChoose({beforeId:$scope.backData.beforeId, afterId:$scope.backData.afterId, resultId:$scope.backData.resultId}, $scope.deleteIdArray, function (data) {
-				if (data.success) {
-					$scope.haveRepeat = false;
-					$scope.matchSuccess = $scope.matchSuccess + 1;
-					$scope.matchFail = $scope.matchFail - 1;
-					$scope.deleteIdArray = [];
-					loadData();
-				}
-			}, function (error) {
-				toaster.pop("error", error.data);
-			})
-		};
-		/**
-		 * 修改图片信息
-		 */
-		$scope.editGoodsPicture = function(pic, material) {
-			var modalInstance = $modal.open({
-				templateUrl : 'static/view/vendor/modal/edit_goods_modal.html',
-				size : 'md',
-				controller : 'editPictureCtrl',
-				resolve : {
-					pic : function() {
-						return pic;
-					}
-				}
-			});
-			modalInstance.result.then(function (editPic) {
-				if(editPic) {
-					material.editPic = editPic;
-				}
-			}, function() {
-
-			});
-		}
-
-		// 单个匹配
-		$scope.match = function (material) {
-			if (!material.cmpCode) {
-				toaster.pop('info', '该产品尚无产品型号,无法匹配');
-				return;
-			}
-			if (!material.brand) {
-				toaster.pop('info', '该产品尚无品牌信息,无法匹配');
-				return;
-			}
-
-			Material.match({id : material.id}, function (data) {
-				toaster.pop('success', '匹配成功, 可前往“标准产品”中 , 编辑上架。');
-				loadDataReload();
-			}, function (response) {
-				toaster.pop('info', response.data);
-			});
-		};
-
-		$scope.fitCountToTable = function (count) {
-			console.log($scope.$$nonProduct.count);
-			$scope.$$nonProduct.count = count;
-			$scope.param.count = $scope.$$nonProduct.count;
-			loadData();
-		};
-
-		$scope.toggleTab = function (status) {
-			$scope.param.type = 'nStandard';
-			$scope.param.count = $scope.$$nonProduct.count;
-			loadData();
-			$scope.standard_tab = status;
-		};
-
-		$scope.closeResultFrame = function (status) {
-			$scope.standard_tab = status;
-			$scope.resultFrame = false;
-		};
-
-		$scope.closeTip = function () {
-			$scope.resultTip = false;
-		};
-
-		// 一键匹配
-		$scope.matchAll = function () {
-			Material.matchNonProduct({}, {}, function (data) {
-				if (data.success){
-					$scope.resultFrame = true;
-					$scope.matchTotal = data.data.total;
-					$scope.matchSuccess = data.data.success;
-					$scope.matchFail = data.data.fail;
-					$scope.standard_tab = 'matchResult';
-					$scope.param.type = "nStandard";
-					loadData();
-				}else {
-					toaster.pop("info", data.message);
-				}
-			}, function (error) {
-				toaster.pop("error", "匹配操作失败!")
-			});
-
-			// Material.matchAll({}, function (data) {
-			// 	if (data.updateCount > 0) {
-			// 		toaster.pop('success', '匹配完成, 本次匹配成功 ' + data.updateCount +' 个,可前往“标准产品”中 , 编辑上架。');
-			// 	}
-			// 	else {
-			// 		toaster.pop('success', '匹配完成, 暂无匹配成功产品,可前往“品牌申请/器件申请”中 , 提出申请。');
-			// 	}
-			// 	loadDataReload();
-			// }, function (response) {
-			// 	toaster.pop('info', response.data);
-			// });
-		};
-
-		function downloadByJs(url, keyword, type) {
-			var form = $("<form>");   //定义一个form表单
-			form.attr('style', 'display:none');   //在form表单中添加查询参数
-			form.attr('target', '');
-			form.attr('method', 'get');
-			form.attr('action', url);
-
-			var input1 = $('<input>');
-			input1.attr('type', 'hidden');
-			input1.attr('name', 'keyword');
-			input1.attr('value', keyword);
-
-			var input2 = $('<input>');
-			input1.attr('type', 'hidden');
-			input1.attr('name', 'type');
-			input1.attr('value', type);
-
-			$('body').append(form);  //将表单放置在web中
-			form.append(input1);   //将查询参数控件提交到表单上
-			form.append(input2);   //将类型参数控件提交到表单上
-			form.submit();
-		}
-
-		// 下载模板
-		$scope.download = function() {
-			if ($scope.currenctMaterial && $scope.currenctMaterial.length == 0) {
-				toaster.pop('info', '当前产品列表为空,无法下载');
-				return;
-			}
-			if ('standard' == $scope.standard_tab)
-				downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'standard');
-			if ('unstandard' == $scope.standard_tab)
-				downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'nStandard');
-		};
-
-		//初始化页数信息
-		$scope.initPages = function (totalElementPages) {
-			var pageNum = [];
-			if(totalElementPages == 1) {
-				return ;
-			}else if(totalElementPages < 10) {
-				for(var i = 0; i < totalElementPages + 2; i++) {
-					pageNum.push(i);
-				}
-			}else {
-				pageNum = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
-			}
-			angular.forEach(pageNum, function (number) {
-				var page = {active : true, type : 'page', number : number};
-				if(number == 0) {
-					page.type = 'prev';
-				}else if(number == 1) {
-					page.type = 'first';
-				}else if(number == pageNum.length - 2) {
-					page.type = 'last';
-					page.number = totalElementPages;
-				}else if(number == pageNum.length - 1){
-					page.type = 'next';
-				}
-				$scope.pages.push(page);
-			});
-		};
-
-		//当前页在前段的计算方式
-		$scope.frontSegment = function (currentPage, totalElementPages) {
-			angular.forEach($scope.pages, function (page) {
-				switch (page.number) {
-					case 8:
-						page.type = 'more';
-						page.active = false;
-						break;
-					case 0:
-						if(currentPage == 1) {
-							page.active = false;
-						}
-					default : {
-						page.current = (currentPage == page.number);
-					}
-				}
-			});
-		};
-
-		//当前页在后端计算方式
-		$scope.endSegment = function (currentPage, totalElementPages) {
-			angular.forEach($scope.pages, function (page) {
-				switch (page.number) {
-					case 2:
-						page.active = false;
-						page.type = 'more';
-						break;
-					case 10:
-						if(currentPage == totalElementPages) {
-							page.active = false;
-						}
-						break;
-					case 0:
-					case 1:
-						break;
-					default:
-						if(page.number != totalElementPages) {
-							page.number = totalElementPages - 9 + page.number;
-						}
-						page.current = (currentPage == page.number);
-						break;
-				}
-			});
-		};
-
-		//当前页在中间计算方式
-		$scope.middleSegment = function (currentPage) {
-			angular.forEach($scope.pages, function (page) {
-				switch (page.number) {
-					case 2:
-					case 8:
-						page.type ='more';
-						page.active = false;
-						break;
-					case 3:
-						page.number = currentPage - 2;
-						break;
-					case 4:
-						page.number = currentPage - 1;
-						break;
-					case 5:
-						page.number = currentPage;
-						page.current = true;
-						break;
-					case 6:
-						page.number = currentPage + 1;
-						break;
-					case 7:
-						page.number = currentPage + 2;
-						break;
-				}
-			});
-		};
-
-		//计算页数的方式。
-		$scope.acculatePages = function(currentPage, totalElementPages) {
-			$scope.pages = [];
-			if(totalElementPages < 1)  {
-				return ;
-			}
-			//初始化页面数据
-			$scope.initPages(totalElementPages);
-
-			if(totalElementPages < 10) {
-				angular.forEach($scope.pages, function (page) {
-					if(page.number == currentPage) {
-						page.current = true;
-					}
-				});
-			}else if(currentPage < 6) {//当期页小于6
-				$scope.frontSegment(currentPage, totalElementPages);
-			}else if(currentPage > totalElementPages - 5) { //当期页在后面
-				$scope.endSegment(currentPage, totalElementPages);
-			}else { //当期页在中间
-				$scope.middleSegment(currentPage);
-			}
-		};
-
-		//输入框监听Enter事件
-		$scope.listenEnter = function () {
-			if($scope.param.currentPage) {
-				if(!intPattern.test($scope.param.currentPage)) {
-					$scope.param.currentPage = $scope.param.page;
-					return ;
-				}
-				if(parseInt($scope.param.currentPage) < 1) {
-					$scope.param.currentPage = $scope.param.page;
-					return ;
-				}
-			}
-			if(event.keyCode == 13) {
-				$scope.setPage("page", $scope.param.currentPage);
-			}
-		};
-
-		$scope.setPage = function(type, number) {
-			if(type != 'prev' &&  type != 'page' && type != 'next' && type != 'last' && type != 'first') {
-				return ;
-			};
-			var page = -1;
-			switch (type) {
-				case "page":
-					if(number < 1) {
-						page = 1;
-					}else if(number > $scope.materialAll.totalPages) {
-						page = $scope.materialAll.totalPages;
-					}else {
-						page = number;
-					};
-					break;
-				case "prev":
-					if($scope.param.page <= 1) {
-						page = 1;
-					}else {
-						page =$scope.param.page - 1;
-					};
-					break;
-				case "next":
-					if($scope.param.page >= $scope.materialAll.totalPages) {
-						page = $scope.materialAll.totalPages
-					}else {
-						page =$scope.param.page + 1;
-					}
-					break;
-				case "first":
-					page = 1;
-					break;
-				case "last":
-					page = $scope.materialAll.totalPages;
-					break;
-			}
-			if(page == $scope.param.page || page < 1 || page > $scope.materialAll.totalPages) {
-				$scope.param.currentPage = $scope.param.page;
-				return ;
-			}
-			$scope.param.page = page;
-			loadData();
-		};
-
-		var loadData = function () {
-			Material.getAllByPerson($scope.param, function (data) {
-				$scope.materialAll = data;
-				$scope.currenctMaterial = data.content;
-				updateTagCount();
-				angular.forEach($scope.currenctMaterial, function (material, index) {
-					material.isChoosed = false;
-					material.showMoreReplace = false;
-					material.submitProduct = {
-						brand: {},
-						commponent: {},
-						kind: {}
-					}
-					//第一个自动展开
-					if (index == 0 && $stateParams.standardParam && ($stateParams.standardParam =='standard' || $stateParams.standardParam =='unstandard')) {
-						material.selected = true;
-						if ('ERP' == material.sourceApp)
-							getProductDetail(material);
-					}
-				});
-				$scope.param.currentPage = data.number;
-				$scope.acculatePages(data.number, data.totalPages);
-				$scope.isChoosedAll = false;
-				$scope.choosedIds = [];
-			}, function (response) {
-
-			})
-		};
-        $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;
-			}
-            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({productId:$scope.replaceMaterialId}, productReplaceList , function (data) {
-				loadDataReload();
-				$scope.setActiveIndex(-1);
-            }, function (response) {
-            })
-        }
-
-		$scope.onSearch = function () {
-			loadDataReload();
-		};
-
-		var loadDataReload = function () {
-			$scope.param.page = 1;
-			loadData();
-		};
-
-		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";
-			// }
-			$scope.isBatch = false;
-			$scope.param.count = 10;
-		};
-
-		init();
-
-		loadData();
-
-		var saveNoSaleInfo = function (product) {
-			// $scope.goods.breakUp = 1 === $scope.goods.breakUp;
-
-		};
-
-		var saveSoldInfo = function (product) {
-			Goods.updateGoods(null, $scope.goods, function(data){
-				if(data.code == 1) {
-					product.exPandOper = true;
-					toaster.pop('success', '修改成功');
-				}else {
-					toaster.pop('warning', '失败', data.message);
-				}
-			}, function(response){
-				toaster.pop('error', '修改失败', response.data);
-			});
-		};
-
-        /**
-         * 	验证库存信息的正确性,
-         * @param goods 需要验证的GOODS信息
-         * @returns {boolean}
-         * 返回false 代表验证不通过。
-         * 返回true  代表验证成功。
-         */
-        $scope.checkGoodsInfo = function (goods) {
-            var result = false;
-            if (!goods) {
-                toaster.pop('warning', '提示', '库存信息丢失,请重新操作');
-                return result;
-            }
-            if (!goods.editTag) {
-                goods.editTagInvalid = true;
-                toaster.pop('warning', '提示', '请填写标签信息');
-                return result;
-            }
-            if (goods.editTag.length > 20) {
-                goods.editTagInvalid = true;
-                toaster.pop('warning', '提示', '标签信息超过了20个字符');
-                return result;
-            }
-            if (!goods.editPackaging) {
-                goods.editPackagingInvalid = true;
-                toaster.pop('warning', '提示', '请填写包装方式');
-                return result;
-            }
-            if (!pattern.test(goods.editPackaging)) {
-                goods.editPackagingInvalid = true;
-                toaster.pop('warning', '提示', '包装方式仅能包含中文和英文字符');
-                return result;
-            }
-            if (goods.editPackaging.length > 10) {
-                goods.editPackagingInvalid = true;
-                toaster.pop('warning', '提示', '包装方式不能超过10个字符');
-                return result;
-            }
-            if (!goods.editProduceDate) {
-                goods.editProduceDateInvalid = true;
-                toaster.pop('warning', '提示', '请填写生产日期');
-                return result;
-            }
-            if (goods.editProduceDate.length > 11) {
-                goods.editProduceDateInvalid = true;
-                toaster.pop('warning', '提示', '生产日期不能超过12个字符');
-                return result;
-            }
-            if (!goods.editReserve) {
-                goods.editReserveInvalid  = true;
-                toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
-                return result;
-            }
-            if (isNaN(goods.editReserve)) {
-                goods.editReserveInvalid  = true;
-                toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
-                return result;
+        }
+      });
+      modalInstance.result.then(function(response){
+        if($scope.$$nonProduct.deleteMaterial) {
+          $scope.choosedIds = [];
+          loadDataReload();
+        }else if($scope.$$nonProduct.deleteGoods) {
+          if(!response || !response.id) {
+            loadData();
+          }
+          for(var i = 0; i < $scope.currenctMaterial.length; i++) {
+            if($scope.currenctMaterial[i].id == response.id) {
+              $scope.currenctMaterial.splice(i, 1, response);
+              if(response.batchCount > 0) {
+                $scope.expandGoods($scope.currenctMaterial[i]);
+              }else {
+                $scope.currenctMaterial[i].exPandOper = false;
+              }
             }
-            if (goods.editReserve < $scope.minReserve) {
-                goods.editReserveInvalid  = true;
-                toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
-                return result;
+          }
+        }
+      }, function(){
+      });
+    };
+
+    //获取该物料的产品信息
+    $scope.expandGoods = function (material, addGoods) {
+      if(!material || !material.id) {
+        return ;
+      }
+      Material.getGoodsByProductId({id: material.id}, function (data) {
+        material.goodsArr = data;
+        angular.forEach($scope.currenctMaterial, function (material) {
+          if(material.selected){
+            delete material.selected;
+          }
+          material.exPandOper = false;
+          material.addGoodsOper = false;
+        });
+        material.exPandOper = true;
+        material.selected = true;
+        if(addGoods) {
+          material.addGoodsOper = true;
+        }
+      }, function (response) {
+        toaster.pop('error', '错误', response.data);
+      });
+    };
+
+    /**
+     * 监听点击的事件,关闭删除的对话框
+     * @param event
+     */
+    // document.onclick = function (event) {
+    //     if(event) {
+    //         var tag = event.target;
+    //         while (tag && tag.nodeName != 'SECTION') {
+    //             var name = tag.getAttribute('name');
+    //             if(name && (name == 'delete-modal' || name == 'delete-material')) {
+    //                 return ;
+    //             }
+    //             console.log(name);
+    //             tag = tag.parentElement;
+    //         }
+    //         $scope.$apply(function () {
+    // 		$scope.cancleDelete();
+    // 	});
+    //     }
+    // };
+
+    /**
+     * 在售产品信息收起
+     */
+    $scope.disExpandGoods = function (material) {
+      if (!material) {
+        return ;
+      }
+      if (material.selected) {
+        delete material.selected;
+      }
+      material.exPandOper = false;
+      material.addGoodsOper = false;
+
+    };
+
+    /**
+     * 是否被推荐
+     * @param goods
+     */
+    function isRecommendGoods(goods) {
+      if(!goods) {
+        return ;
+      }
+      $scope.$$nonProduct.deleteMessage = '';
+      closeAllEditStatus(goods);
+      $scope.choosedIds = [];
+      Goods.isRecommendGoods({id: goods.id}, null, function (data) {
+        $scope.$$nonProduct.deleteGoods = true;
+        $scope.$$nonProduct.deleteMaterial = false;
+        $scope.$$nonProduct.deleteDiv = true;
+        if(data.code == 1) {
+          if(goods.status == '601' || goods.status == '602') {
+            $scope.$$nonProduct.deleteMessage = '该产品已上架';
+          }
+        }else {
+          $scope.$$nonProduct.deleteMessage = data.message;
+        }
+        $scope.choosedIds.push(goods.id);
+        $scope.opendeleteModal();
+      }, function (response) {
+        toaster.pop('error', '错误', response.data);
+      });
+    };
+
+    /**
+     * 编辑在售产品的信息
+     * @param goods
+     */
+    function editGoods(material, goods) {
+      angular.forEach(material.goodsArr, function (g) {
+        g.edit = false;
+      });
+      $scope.$$nonProduct.editGoods = angular.copy(goods);
+      goods.edit = true;
+
+      goods.editTag = goods.tag;
+      goods.editTagInvalid = false;
+      goods.editTagPre = goods.tag;
+
+      goods.editPackaging = goods.packaging;
+      goods.editPackagingInvalid = false;
+      goods.editPackaginPre = goods.packaging;
+
+      goods.editProduceDate = goods.produceDate;
+      goods.editProduceDateInvalid = false;
+      goods.editProduceDatePre = goods.produceDate;
+
+      goods.editReserve = goods.reserve;
+      goods.editReserveInvalid = false;
+      goods.editReservePre = goods.reserve;
+
+      goods.editMinPackQty = goods.minPackQty;
+      goods.editMinPackQtyPre = goods.minPackQty;
+      goods.editMinPackQtyInValid = false;
+
+      goods.editMinBuyQty = goods.minBuyQty;
+      goods.editMinBuyQtyPre = goods.minBuyQty;
+      goods.editMinBuyQtyInValid = false;
+
+      goods.editMinDelivery = goods.minDelivery;
+      goods.editMinDeliveryPre = goods.minDelivery;
+      goods.editMinDeliveryinValid = false;
+
+      goods.editMaxDelivery = goods.maxDelivery;
+      goods.editMaxDeliveryPre = goods.maxDelivery;
+      goods.editMaxDeliveryinValid = false;
+
+      goods.editSelfSale = $scope.storeInfo.uuid != 'undefind' && goods.storeid == $scope.storeInfo.uuid && $scope.storeInfo.storeName.indexOf('优软测试二') < 0 && $scope.storeInfo.storeName.indexOf('优软商城') < 0 ? 1 : 2;
+      goods.editBreakUp = goods.breakUp;
+      goods.editPrices = angular.copy(goods.prices);
+      angular.forEach(goods.editPrices, function (price) {
+        price.startPre = price.start;
+        price.startDirty = false;
+
+        price.endPre = price.end;
+        price.endDirty = false;
+
+        price.rMBPricePre = price.rMBPrice;
+        price.rMBPriceDirty = false;
+
+        price.uSDPricePre = price.uSDPrice;
+        price.uSDPriceDirty = false;
+      });
+      goods.editPic = goods.img;
+    };
+
+    /**
+     * 取消编辑
+     * @param goods
+     */
+    function closeEditGoods(material, goods) {
+      //替换之前的信息
+      if(!material || !material.goodsArr || !goods || !$scope.$$nonProduct.editGoods) {
+        return ;
+      }
+      for(var i = 0; i < material.goodsArr.length; i++) {
+        if(material.goodsArr[i].id == goods.id) {
+          material.goodsArr.splice(i, 1, $scope.$$nonProduct.editGoods);
+          break;
+        }
+      };
+    }
+
+    /**
+     * 更新非标的匹配信息
+     */
+    $scope.updateNStandardOne = function (product) {
+      if (product.matchresults.length > 0) {
+        if (product.canMatch) {
+          var matchProducts = {
+            matchId: product.id,
+            detailId: product.cmpId
+          };
+        }
+      }
+      prodRepositoryService.saveMatchInfo(null, matchProducts, function (data) {
+        if (data.code == 1 && data.data) {
+          $scope.backData = data.data;
+          $scope.repeatList = data.data.repeatList;
+          $scope.haveRepeat = true;
+          // loadData();
+          $scope.standard_tab = 'matchResult';
+        } else {
+          $scope.haveRepeat = false;
+          $scope.matchSuccess = $scope.matchSuccess + 1;
+          $scope.matchFail = $scope.matchFail - 1;
+          loadData();
+        }
+      }, function () {
+        toaster.pop("error", "匹配失败")
+      });
+    };
+
+    $scope.cancelChoose = function () {
+      angular.forEach($scope.repeatList, function (item) {
+        if (item.selected){
+          delete item.selected;
+        }
+      });
+      $scope.haveRepeat = false;
+    };
+
+    $scope.deleteIdArray = [];
+    $scope.ensureDeleteRepeat = function () {
+      for (var i = 0; i < $scope.repeatList.length; i++) {
+        if (!$scope.repeatList[i].selected) {
+          toaster.pop("info", "请选择要保留的产品信息");
+          return ;
+        } else {
+          angular.forEach($scope.repeatList[i], function (goods) {
+            if (goods.id != $scope.repeatList[i].selected){
+              $scope.deleteIdArray.push(goods.id);
             }
-            if (goods.editReserve > $scope.maxReserve) {
-                goods.editReserveInvalid  = true;
-                toaster.pop('warning', '库存须填写小于10亿的正整数');
-                return result;
+          });
+        }
+      }
+      if ($scope.deleteIdArray.length != $scope.repeatList.length) {
+        toaster.pop("info", "请选择要保留的产品信息");
+        return ;
+      }
+
+      Material.updateInfoAfterChoose({beforeId:$scope.backData.beforeId, afterId:$scope.backData.afterId, resultId:$scope.backData.resultId}, $scope.deleteIdArray, function (data) {
+        if (data.success) {
+          $scope.haveRepeat = false;
+          $scope.matchSuccess = $scope.matchSuccess + 1;
+          $scope.matchFail = $scope.matchFail - 1;
+          $scope.deleteIdArray = [];
+          loadData();
+        }
+      }, function (error) {
+        toaster.pop("error", error.data);
+      })
+    };
+    /**
+     * 修改图片信息
+     */
+    $scope.editGoodsPicture = function(pic, material) {
+      var modalInstance = $modal.open({
+        templateUrl : 'static/view/vendor/modal/edit_goods_modal.html',
+        size : 'md',
+        controller : 'editPictureCtrl',
+        resolve : {
+          pic : function() {
+            return pic;
+          }
+        }
+      });
+      modalInstance.result.then(function (editPic) {
+        if(editPic) {
+          material.editPic = editPic;
+        }
+      }, function() {
+
+      });
+    }
+
+    // 单个匹配
+    $scope.match = function (material) {
+      if (!material.cmpCode) {
+        toaster.pop('info', '该产品尚无产品型号,无法匹配');
+        return;
+      }
+      if (!material.brand) {
+        toaster.pop('info', '该产品尚无品牌信息,无法匹配');
+        return;
+      }
+
+      Material.match({id : material.id}, function (data) {
+        toaster.pop('success', '匹配成功, 可前往“标准产品”中 , 编辑上架。');
+        loadDataReload();
+      }, function (response) {
+        toaster.pop('info', response.data);
+      });
+    };
+
+    $scope.fitCountToTable = function (count) {
+      console.log($scope.$$nonProduct.count);
+      $scope.$$nonProduct.count = count;
+      $scope.param.count = $scope.$$nonProduct.count;
+      loadData();
+    };
+
+    $scope.toggleTab = function (status) {
+      $scope.param.type = 'nStandard';
+      $scope.param.count = $scope.$$nonProduct.count;
+      loadData();
+      $scope.standard_tab = status;
+    };
+
+    $scope.closeResultFrame = function (status) {
+      $scope.standard_tab = status;
+      $scope.resultFrame = false;
+    };
+
+    $scope.closeTip = function () {
+      $scope.resultTip = false;
+    };
+
+    // 一键匹配
+    $scope.matchAll = function () {
+      Material.matchNonProduct({}, {}, function (data) {
+        if (data.success){
+          $scope.resultFrame = true;
+          $scope.matchTotal = data.data.total;
+          $scope.matchSuccess = data.data.success;
+          $scope.matchFail = data.data.fail;
+          $scope.standard_tab = 'matchResult';
+          $scope.param.type = "nStandard";
+          loadData();
+        }else {
+          toaster.pop("info", data.message);
+        }
+      }, function (error) {
+        toaster.pop("error", "匹配操作失败!")
+      });
+
+      // Material.matchAll({}, function (data) {
+      // 	if (data.updateCount > 0) {
+      // 		toaster.pop('success', '匹配完成, 本次匹配成功 ' + data.updateCount +' 个,可前往“标准产品”中 , 编辑上架。');
+      // 	}
+      // 	else {
+      // 		toaster.pop('success', '匹配完成, 暂无匹配成功产品,可前往“品牌申请/器件申请”中 , 提出申请。');
+      // 	}
+      // 	loadDataReload();
+      // }, function (response) {
+      // 	toaster.pop('info', response.data);
+      // });
+    };
+
+    function downloadByJs(url, keyword, type) {
+      var form = $("<form>");   //定义一个form表单
+      form.attr('style', 'display:none');   //在form表单中添加查询参数
+      form.attr('target', '');
+      form.attr('method', 'get');
+      form.attr('action', url);
+
+      var input1 = $('<input>');
+      input1.attr('type', 'hidden');
+      input1.attr('name', 'keyword');
+      input1.attr('value', keyword);
+
+      var input2 = $('<input>');
+      input1.attr('type', 'hidden');
+      input1.attr('name', 'type');
+      input1.attr('value', type);
+
+      $('body').append(form);  //将表单放置在web中
+      form.append(input1);   //将查询参数控件提交到表单上
+      form.append(input2);   //将类型参数控件提交到表单上
+      form.submit();
+    }
+
+    // 下载模板
+    $scope.download = function() {
+      if ($scope.currenctMaterial && $scope.currenctMaterial.length == 0) {
+        toaster.pop('info', '当前产品列表为空,无法下载');
+        return;
+      }
+      if ('standard' == $scope.standard_tab)
+        downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'standard');
+      if ('unstandard' == $scope.standard_tab)
+        downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'nStandard');
+    };
+
+    //初始化页数信息
+    $scope.initPages = function (totalElementPages) {
+      var pageNum = [];
+      if(totalElementPages == 1) {
+        return ;
+      }else if(totalElementPages < 10) {
+        for(var i = 0; i < totalElementPages + 2; i++) {
+          pageNum.push(i);
+        }
+      }else {
+        pageNum = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
+      }
+      angular.forEach(pageNum, function (number) {
+        var page = {active : true, type : 'page', number : number};
+        if(number == 0) {
+          page.type = 'prev';
+        }else if(number == 1) {
+          page.type = 'first';
+        }else if(number == pageNum.length - 2) {
+          page.type = 'last';
+          page.number = totalElementPages;
+        }else if(number == pageNum.length - 1){
+          page.type = 'next';
+        }
+        $scope.pages.push(page);
+      });
+    };
+
+    //当前页在前段的计算方式
+    $scope.frontSegment = function (currentPage, totalElementPages) {
+      angular.forEach($scope.pages, function (page) {
+        switch (page.number) {
+          case 8:
+            page.type = 'more';
+            page.active = false;
+            break;
+          case 0:
+            if(currentPage == 1) {
+              page.active = false;
             }
-            if (typeof goods.editMinBuyQty == 'undefined') {
-				goods.editMinBuyQtyInValid  = true;
-				toaster.pop('warning', '提示', '起订量不能为空');
-				return result;
-			}
-            // if(!goods.editMinBuyQty) {
-            //     goods.editMinBuyQtyInValid  = true;
-            //     toaster.pop('warning', '提示', '起订量必须填写');
-            //     return result;
-            // }
-            if (!$scope.isInt.test(goods.editMinBuyQty)) {
-                goods.editMinBuyQtyInValid  = true;
-                toaster.pop('warning', '提示', '起订量必须是大于0的整数');
-                return result;
+          default : {
+            page.current = (currentPage == page.number);
+          }
+        }
+      });
+    };
+
+    //当前页在后端计算方式
+    $scope.endSegment = function (currentPage, totalElementPages) {
+      angular.forEach($scope.pages, function (page) {
+        switch (page.number) {
+          case 2:
+            page.active = false;
+            page.type = 'more';
+            break;
+          case 10:
+            if(currentPage == totalElementPages) {
+              page.active = false;
             }
-            // if(goods.editReserve < goods.editMinBuyQty) {
-            //     goods.editReserveInvalid  = true;
-            //     goods.editMinBuyQtyInValid = true;
-            //     toaster.pop('warning', '提示', '库存必须是大于等于起订量的整数');
-            //     return result;
-            // }
-            if (!goods.editMinPackQty) {
-                goods.editMinPackQtyInValid = true;
-                toaster.pop('warning', '提示', '包装数量必须填写');
-                return result;
+            break;
+          case 0:
+          case 1:
+            break;
+          default:
+            if(page.number != totalElementPages) {
+              page.number = totalElementPages - 9 + page.number;
             }
-            if (!$scope.isInt.test(goods.editMinPackQty)) {
-                goods.editMinPackQtyInValid  = true;
-                toaster.pop('warning', '提示', '包装数必须是正整数');
-                return result;
+            page.current = (currentPage == page.number);
+            break;
+        }
+      });
+    };
+
+    //当前页在中间计算方式
+    $scope.middleSegment = function (currentPage) {
+      angular.forEach($scope.pages, function (page) {
+        switch (page.number) {
+          case 2:
+          case 8:
+            page.type ='more';
+            page.active = false;
+            break;
+          case 3:
+            page.number = currentPage - 2;
+            break;
+          case 4:
+            page.number = currentPage - 1;
+            break;
+          case 5:
+            page.number = currentPage;
+            page.current = true;
+            break;
+          case 6:
+            page.number = currentPage + 1;
+            break;
+          case 7:
+            page.number = currentPage + 2;
+            break;
+        }
+      });
+    };
+
+    //计算页数的方式。
+    $scope.acculatePages = function(currentPage, totalElementPages) {
+      $scope.pages = [];
+      if(totalElementPages < 1)  {
+        return ;
+      }
+      //初始化页面数据
+      $scope.initPages(totalElementPages);
+
+      if(totalElementPages < 10) {
+        angular.forEach($scope.pages, function (page) {
+          if(page.number == currentPage) {
+            page.current = true;
+          }
+        });
+      }else if(currentPage < 6) {//当期页小于6
+        $scope.frontSegment(currentPage, totalElementPages);
+      }else if(currentPage > totalElementPages - 5) { //当期页在后面
+        $scope.endSegment(currentPage, totalElementPages);
+      }else { //当期页在中间
+        $scope.middleSegment(currentPage);
+      }
+    };
+
+    //输入框监听Enter事件
+    $scope.listenEnter = function () {
+      if($scope.param.currentPage) {
+        if(!intPattern.test($scope.param.currentPage)) {
+          $scope.param.currentPage = $scope.param.page;
+          return ;
+        }
+        if(parseInt($scope.param.currentPage) < 1) {
+          $scope.param.currentPage = $scope.param.page;
+          return ;
+        }
+      }
+      if(event.keyCode == 13) {
+        $scope.setPage("page", $scope.param.currentPage);
+      }
+    };
+
+    $scope.setPage = function(type, number) {
+      if(type != 'prev' &&  type != 'page' && type != 'next' && type != 'last' && type != 'first') {
+        return ;
+      };
+      var page = -1;
+      switch (type) {
+        case "page":
+          if(number < 1) {
+            page = 1;
+          }else if(number > $scope.materialAll.totalPages) {
+            page = $scope.materialAll.totalPages;
+          }else {
+            page = number;
+          };
+          break;
+        case "prev":
+          if($scope.param.page <= 1) {
+            page = 1;
+          }else {
+            page =$scope.param.page - 1;
+          };
+          break;
+        case "next":
+          if($scope.param.page >= $scope.materialAll.totalPages) {
+            page = $scope.materialAll.totalPages
+          }else {
+            page =$scope.param.page + 1;
+          }
+          break;
+        case "first":
+          page = 1;
+          break;
+        case "last":
+          page = $scope.materialAll.totalPages;
+          break;
+      }
+      if(page == $scope.param.page || page < 1 || page > $scope.materialAll.totalPages) {
+        $scope.param.currentPage = $scope.param.page;
+        return ;
+      }
+      $scope.param.page = page;
+      loadData();
+    };
+
+    var loadData = function () {
+      Material.getAllByPerson($scope.param, function (data) {
+        $scope.materialAll = data;
+        $scope.currenctMaterial = data.content;
+        updateTagCount();
+        angular.forEach($scope.currenctMaterial, function (material, index) {
+          material.isChoosed = false;
+          material.showMoreReplace = false;
+          material.submitProduct = {
+            brand: {},
+            commponent: {},
+            kind: {}
+          }
+          //第一个自动展开
+          if (index == 0 && $stateParams.standardParam && ($stateParams.standardParam =='standard' || $stateParams.standardParam =='unstandard')) {
+            material.selected = true;
+            if ('ERP' == material.sourceApp)
+              getProductDetail(material);
+          }
+        });
+        $scope.param.currentPage = data.number;
+        $scope.acculatePages(data.number, data.totalPages);
+        $scope.isChoosedAll = false;
+        $scope.choosedIds = [];
+      }, function (response) {
+
+      })
+    };
+    $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 && !productReplaceList[i].ptrBranden) {
+          // 都为空的情况下
+          $scope.errorObj[i].code = 0;
+          $scope.errorObj[i].brand = 0;
+          productReplaceList[i]['index'] = 1
+
+        } else {
+          if (!productReplaceList[i].ptrCmpcode) {
+            $scope.errorObj[i].code = 1;
+          }
+          if (!productReplaceList[i].ptrBranden) {
+            $scope.errorObj[i].brand = 1;
+          }
+          productReplaceList[i].detno = i + 1;
+        }
+        if ($scope.errorObj[i].code == 1 || $scope.errorObj[i].brand == 1) {
+          toaster.pop('error', '请填完整信息');
+          return;
+        }
+      }
+      var _productReplaceList = productReplaceList.filter(function(item, index) {
+        return !item['index']
+      })
+
+      for(var j = 0; j < _productReplaceList.length; j++) {
+        _productReplaceList[j].detno = j + 1;
+      }
+
+      console.log(_productReplaceList)
+      Material.setProductReplacesByPerson({productId:$scope.replaceMaterialId}, _productReplaceList , function (data) {
+        $scope.setActiveIndex(-1);
+        loadDataReload();
+        toaster.pop('success', '保存成功');
+      }, function (response) {
+        toaster.pop('error', '保存失败');
+      })
+    }
+
+    $scope.onSearch = function () {
+      loadDataReload();
+    };
+
+    var loadDataReload = function () {
+      $scope.param.page = 1;
+      loadData();
+    };
+
+    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";
+      // }
+      $scope.isBatch = false;
+      $scope.param.count = 10;
+    };
+
+    init();
+
+    loadData();
+
+    var saveNoSaleInfo = function (product) {
+      // $scope.goods.breakUp = 1 === $scope.goods.breakUp;
+
+    };
+
+    var saveSoldInfo = function (product) {
+      Goods.updateGoods(null, $scope.goods, function(data){
+        if(data.code == 1) {
+          product.exPandOper = true;
+          toaster.pop('success', '修改成功');
+        }else {
+          toaster.pop('warning', '失败', data.message);
+        }
+      }, function(response){
+        toaster.pop('error', '修改失败', response.data);
+      });
+    };
+
+    /**
+     * 	验证库存信息的正确性,
+     * @param goods 需要验证的GOODS信息
+     * @returns {boolean}
+     * 返回false 代表验证不通过。
+     * 返回true  代表验证成功。
+     */
+    $scope.checkGoodsInfo = function (goods) {
+      var result = false;
+      if (!goods) {
+        toaster.pop('warning', '提示', '库存信息丢失,请重新操作');
+        return result;
+      }
+      if (!goods.editTag) {
+        goods.editTagInvalid = true;
+        toaster.pop('warning', '提示', '请填写标签信息');
+        return result;
+      }
+      if (goods.editTag.length > 20) {
+        goods.editTagInvalid = true;
+        toaster.pop('warning', '提示', '标签信息超过了20个字符');
+        return result;
+      }
+      if (!goods.editPackaging) {
+        goods.editPackagingInvalid = true;
+        toaster.pop('warning', '提示', '请填写包装方式');
+        return result;
+      }
+      if (!pattern.test(goods.editPackaging)) {
+        goods.editPackagingInvalid = true;
+        toaster.pop('warning', '提示', '包装方式仅能包含中文和英文字符');
+        return result;
+      }
+      if (goods.editPackaging.length > 10) {
+        goods.editPackagingInvalid = true;
+        toaster.pop('warning', '提示', '包装方式不能超过10个字符');
+        return result;
+      }
+      if (!goods.editProduceDate) {
+        goods.editProduceDateInvalid = true;
+        toaster.pop('warning', '提示', '请填写生产日期');
+        return result;
+      }
+      if (goods.editProduceDate.length > 11) {
+        goods.editProduceDateInvalid = true;
+        toaster.pop('warning', '提示', '生产日期不能超过12个字符');
+        return result;
+      }
+      if (!goods.editReserve) {
+        goods.editReserveInvalid  = true;
+        toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+        return result;
+      }
+      if (isNaN(goods.editReserve)) {
+        goods.editReserveInvalid  = true;
+        toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+        return result;
+      }
+      if (goods.editReserve < $scope.minReserve) {
+        goods.editReserveInvalid  = true;
+        toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+        return result;
+      }
+      if (goods.editReserve > $scope.maxReserve) {
+        goods.editReserveInvalid  = true;
+        toaster.pop('warning', '库存须填写小于10亿的正整数');
+        return result;
+      }
+      if (typeof goods.editMinBuyQty == 'undefined') {
+        goods.editMinBuyQtyInValid  = true;
+        toaster.pop('warning', '提示', '起订量不能为空');
+        return result;
+      }
+      // if(!goods.editMinBuyQty) {
+      //     goods.editMinBuyQtyInValid  = true;
+      //     toaster.pop('warning', '提示', '起订量必须填写');
+      //     return result;
+      // }
+      if (!$scope.isInt.test(goods.editMinBuyQty)) {
+        goods.editMinBuyQtyInValid  = true;
+        toaster.pop('warning', '提示', '起订量必须是大于0的整数');
+        return result;
+      }
+      // if(goods.editReserve < goods.editMinBuyQty) {
+      //     goods.editReserveInvalid  = true;
+      //     goods.editMinBuyQtyInValid = true;
+      //     toaster.pop('warning', '提示', '库存必须是大于等于起订量的整数');
+      //     return result;
+      // }
+      if (!goods.editMinPackQty) {
+        goods.editMinPackQtyInValid = true;
+        toaster.pop('warning', '提示', '包装数量必须填写');
+        return result;
+      }
+      if (!$scope.isInt.test(goods.editMinPackQty)) {
+        goods.editMinPackQtyInValid  = true;
+        toaster.pop('warning', '提示', '包装数必须是正整数');
+        return result;
+      }
+      if (Number(goods.editMinPackQty) > $scope.maxPackQty) {
+        goods.editMinPackQtyInValid = true;
+        toaster.pop('warning', '提示', '包装量数量必须小于' + $scope.maxPackQty);
+        return result;
+      }
+      if (!goods.editBreakUp) {
+        $scope.isNotBreakUp(goods);
+      }
+      var lastEnd = -1;
+      for (var i = 0; i < goods.editPrices.length; i++) {
+        if (isNaN(goods.editPrices[i].start)) {
+          goods.editPrices[i].startInValid = true;
+          toaster.pop('warning', '提示', '分段数量必须是数字');
+          return result;
+        }
+        if (goods.editPrices[i].start <= lastEnd) {
+          goods.editPrices[i].startInValid = true;
+          toaster.pop('warning', '提示', "存在分段的起始值小于等于上一个分段的结束值");
+          return result;
+        }
+        if (!goods.editPrices[i].end) {
+          goods.editPrices[i].endInValid = true;
+          toaster.pop('warning', '提示', '分段数量必须填写');
+          return result;
+        }
+        if (isNaN(goods.editPrices[i].end)) {
+          goods.editPrices[i].endInValid = true;
+          toaster.pop('warning', '提示', '分段数量必须是数字');
+          return result;
+        }
+        if (goods.editPrices[i].start > goods.editPrices[i].end) {
+          goods.editPrices[i].startInValid = true;
+          goods.editPrices[i].endInValid = true;
+          toaster.pop('warning', '提示', "存在分段的起始值大于分段的结束值");
+          return result;
+        }
+        if (goods.currencyName.indexOf('USD') > -1) {
+          if (!goods.editPrices[i].uSDPrice) {
+            goods.editPrices[i].priceInvalid = true;
+            toaster.pop('warning', '提示', "单价必须是大于0的数字");
+            return result;
+          } else if (isNaN(goods.editPrices[i].uSDPrice)) {
+            goods.editPrices[i].priceInvalid = true;
+            toaster.pop('warning', '提示', "单价必须是大于0的数字");
+            return result;
+          } else if (Number(goods.editPrices[i].uSDPrice) <= 0) {
+            goods.editPrices[i].priceInvalid = true;
+            toaster.pop('warning', '提示', "单价必须是大于0的数字");
+            return result;
+          }
+        }
+        if (goods.currencyName.indexOf('RMB') > -1) {
+          if (!goods.editPrices[i].rMBPrice) {
+            goods.editPrices[i].priceInvalid = true;
+            toaster.pop('warning', '提示', "单价必须是大于0的数字");
+            return result;
+          } else if (isNaN(goods.editPrices[i].rMBPrice)) {
+            goods.editPrices[i].priceInvalid = true;
+            toaster.pop('warning', '提示', "单价必须是大于0的数字");
+            return result;
+          } else if (Number(goods.editPrices[i].rMBPrice) <= 0) {
+            goods.editPrices[i].priceInvalid = true;
+            toaster.pop('warning', '提示', "单价必须是大于0的数字");
+            return result;
+          }
+        }
+      }
+      if (goods.currencyName.indexOf('USD') > -1 && !$scope.compareNum(goods.editMinDelivery, goods.editMaxDelivery, 2, goods)) {
+        return result;
+      }
+
+      if (goods.currencyName.indexOf('RMB') > -1 && !$scope.compareNum(goods.editMinDelivery, goods.editMaxDelivery, 1, goods)) {
+        return result;
+      }
+
+      result = true;
+      return result;
+    }
+
+    /**
+     * 比较交货周期的大小
+     * @param min 本来是最小值
+     * @param max 本来是最大值
+     * @param type 2 表示当前验证的香港交期, 1表示当前验证的是大陆交期
+     * @param commodity 批次信息
+     * @returns {boolean} true 表示验证通过,false 表示验证失败。
+     */
+    $scope.compareNum = function(min, max, type, goods) {
+      if(!min) {
+        goods.editMinDeliveryinValid = true;
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+        return false;
+      }else if(!max) {
+        goods.editMaxDeliveryinValid = true;
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+        return false;
+      }
+      if(!$scope.isInt.test(min)) {
+        goods.editMinDeliveryinValid = true;
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+        return false;
+      }
+      if(!$scope.isInt.test(max)) {
+        goods.editMaxDeliveryinValid = true;
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+        return false;
+      }
+      if(min < 1 || min > 31) {
+        goods.editMinDeliveryinValid = true;
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
+        return false;
+      }
+      if(max < 1 || max > 31) {
+        goods.editMaxDeliveryinValid = true;
+        toaster.pop('warning', '提示', '交期的时间必须是1-31之内');
+        return false;
+      }
+      if(Number(min) > Number(max)) {
+        goods.editMaxDeliveryinValid = true;
+        goods.editMinDeliveryinValid = true;
+        toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
+        return false;
+      }
+      return true;
+    }
+
+    /**
+     * 编辑状态下的产品字段转成与后台对应的字段
+     */
+    function inverseGoods(goods) {
+      goods.packaging = goods.editPackaging;
+      goods.produceDate = goods.editProduceDate;
+      goods.oldReserve =  goods.reserve;
+      goods.reserve =  goods.editReserve;
+      goods.minBuyQty = goods.editMinBuyQty;
+      goods.prices = goods.editPrices;
+      goods.minDelivery = goods.editMinDelivery;
+      goods.maxDelivery = goods.editMaxDelivery;
+      goods.selfSale = goods.editSelfSale;
+      goods.minPackQty = goods.editMinPackQty;
+      goods.img = goods.editPic;
+      goods.breakUp = typeof goods.editBreakUp == 'undefined' ? false : goods.editBreakUp;
+      goods.tag = goods.editTag;
+    }
+
+    /**
+     * 鼠标移入到保存按钮
+     */
+    $scope.impedeBlur = function () {
+      $scope.$$nonProduct.enterSaveButton = true;
+    }
+
+    /**
+     * 鼠标移出保存按钮
+     */
+    $scope.recoveryBlur = function () {
+      $scope.$$nonProduct.enterSaveButton = false;
+    }
+
+    /**
+     * 添加产品失败
+     * @param currenctMaterial
+     * @param goods
+     */
+    function addGoods(currenctMaterial) {
+      if (!$scope.checkGoodsInfo($scope.goods)) {
+        return ;
+      }
+      inverseGoods($scope.goods);
+      $scope.goods.productid = currenctMaterial.id;
+      Goods.addGoods(null, $scope.goods, function (result) {
+        if (result.success) {
+          ProductServiceQuery.getProductById({id: currenctMaterial.id}, function (response) {
+            if(!response || !response.id) {
+              loadData();
             }
-            if (Number(goods.editMinPackQty) > $scope.maxPackQty) {
-                goods.editMinPackQtyInValid = true;
-                toaster.pop('warning', '提示', '包装量数量必须小于' + $scope.maxPackQty);
-                return result;
+            for(var i = 0; i < $scope.currenctMaterial.length; i++) {
+              if($scope.currenctMaterial[i].id == response.id) {
+                $scope.currenctMaterial.splice(i, 1, response);
+                if(response.batchCount > 0) {
+                  $scope.expandGoods($scope.currenctMaterial[i]);
+                }else {
+                  $scope.currenctMaterial[i].exPandOper = false;
+                }
+              }
             }
-            if (!goods.editBreakUp) {
-                $scope.isNotBreakUp(goods);
+          }, function (response) {
+            $scope.expandGoods(currenctMaterial);
+            closeShelArea(currenctMaterial);
+          });
+        } else {
+          toaster.pop('error', '错误', "添加产品失败" + result.message);
+        }
+      }, function (error) {
+        toaster.pop('error', '错误', error.data);
+      });
+    }
+
+    /**
+     * 更新产品信息
+     */
+    function updateGoods(material, goods) {
+      if(!goods || !material) {
+        return ;
+      }
+      if (!$scope.checkGoodsInfo(goods)) {
+        return ;
+      }
+      inverseGoods(goods);
+      //不需要更新状态
+      Goods.updateGoods(null, goods, function(data){
+        if(data.code == 1) {
+          toaster.pop('success', '修改成功');
+          for(var i = 0; i < material.goodsArr.length; i++) {
+            if(material.goodsArr[i].id == data.data.id) {
+              material.goodsArr.splice(i, 1, data.data);
+              break;
             }
-            var lastEnd = -1;
-            for (var i = 0; i < goods.editPrices.length; i++) {
-                if (isNaN(goods.editPrices[i].start)) {
-                    goods.editPrices[i].startInValid = true;
-                    toaster.pop('warning', '提示', '分段数量必须是数字');
-                    return result;
-                }
-                if (goods.editPrices[i].start <= lastEnd) {
-                    goods.editPrices[i].startInValid = true;
-                    toaster.pop('warning', '提示', "存在分段的起始值小于等于上一个分段的结束值");
-                    return result;
-                }
-                if (!goods.editPrices[i].end) {
-					goods.editPrices[i].endInValid = true;
-					toaster.pop('warning', '提示', '分段数量必须填写');
-					return result;
-				}
-                if (isNaN(goods.editPrices[i].end)) {
-                    goods.editPrices[i].endInValid = true;
-                    toaster.pop('warning', '提示', '分段数量必须是数字');
-                    return result;
-                }
-                if (goods.editPrices[i].start > goods.editPrices[i].end) {
-                    goods.editPrices[i].startInValid = true;
-                    goods.editPrices[i].endInValid = true;
-                    toaster.pop('warning', '提示', "存在分段的起始值大于分段的结束值");
-                    return result;
-                }
-                if (goods.currencyName.indexOf('USD') > -1) {
-                    if (!goods.editPrices[i].uSDPrice) {
-                        goods.editPrices[i].priceInvalid = true;
-                        toaster.pop('warning', '提示', "单价必须是大于0的数字");
-                        return result;
-                    } else if (isNaN(goods.editPrices[i].uSDPrice)) {
-                        goods.editPrices[i].priceInvalid = true;
-                        toaster.pop('warning', '提示', "单价必须是大于0的数字");
-                        return result;
-                    } else if (Number(goods.editPrices[i].uSDPrice) <= 0) {
-                        goods.editPrices[i].priceInvalid = true;
-                        toaster.pop('warning', '提示', "单价必须是大于0的数字");
-                        return result;
-                    }
-                }
-                if (goods.currencyName.indexOf('RMB') > -1) {
-                    if (!goods.editPrices[i].rMBPrice) {
-                        goods.editPrices[i].priceInvalid = true;
-                        toaster.pop('warning', '提示', "单价必须是大于0的数字");
-                        return result;
-                    } else if (isNaN(goods.editPrices[i].rMBPrice)) {
-                        goods.editPrices[i].priceInvalid = true;
-                        toaster.pop('warning', '提示', "单价必须是大于0的数字");
-                        return result;
-                    } else if (Number(goods.editPrices[i].rMBPrice) <= 0) {
-                        goods.editPrices[i].priceInvalid = true;
-                        toaster.pop('warning', '提示', "单价必须是大于0的数字");
-                        return result;
-                    }
+          }
+        }else {
+          toaster.pop('error', '失败', data.message);
+        }
+      }, function(response){
+        toaster.pop('error', '失败', response.data);
+      });
+    }
+
+    /**
+     * 上架在售产品信息
+     */
+    function putOn(material, goods) {
+      if(!goods || !material) {
+        return ;
+      }
+      Goods.putOn({id : goods.id}, null ,function (data) {
+        toaster.pop('success', '提示', '上架成功');
+        for(var i = 0; i < material.goodsArr.length; i++) {
+          if(material.goodsArr[i].id == goods.id) {
+            material.goodsArr.splice(i, 1, data.data);
+            break;
+          }
+        }
+      }, function (response) {
+        toaster.pop('error', '提示', '上架失败:' + response.data);
+      });
+    }
+
+    /**
+     * 上架只是修改Goods的状态
+     */
+    $scope.publishGoods = function (product) {
+      if (!validateGoods($scope.goods)) return ;
+
+      $q.all([initRuleCount().$promise]).then(function (data) {
+        if (data){
+          if ($scope.needShowTip){
+            $modal.open({
+              templateUrl: 'static/view/common/modal/delivery_rule_modal.html',
+              controller: 'rule_tip_ctrl',
+              resolve : {
+                type : function() {
+                  return 'product';
+                },
+                tipModal : function() {
+                  return true;
+                },
+                success : function () {
+                  return false;
+                },
+                uuid: function () {
+                  return null;
                 }
+              }
+            });
+            return ;
+          }
+          $scope.goods.breakUp = 1 === $scope.goods.breakUp;
+          $scope.isSelfSupport = 1 === $scope.goods.isSelfSupport;
+          if (product.sourceApp == 'ERP') {
+            if ($scope.goods.erpReserve < $scope.goods.b2cReserve + $scope.goods.reserve) {
+              toaster.pop('error', '本次上架数量和已上架数量之和不可超过ERP空闲库存数量');
+              return;
             }
-            if (goods.currencyName.indexOf('USD') > -1 && !$scope.compareNum(goods.editMinDelivery, goods.editMaxDelivery, 2, goods)) {
-                return result;
+          }
+          Material.newStockByStandardProduct({ id: product.id, isSelfSupport: $scope.isSelfSupport}, $scope.goods, function (result) {
+            if (result.success) {
+              toaster.pop('success', '商品上架成功');
+              closeShelArea(product);
+            } else {
+              toaster.pop('error', result.message);
             }
+          }, function (error) {
+            toaster.pop('error', error.data);
+          });
+        }
+      });
+    };
+
+    // 保存物料详细信息
+    $scope.saveDetail = function(material) {
+      console.log('product',$scope.goods);
+      console.log(material);
+      Material.saveDetail({productId: material.id}, $scope.goods, function (data) {
+        toaster.pop('success', '保存成功');
+      }, function (response) {
+        toaster.pop('error', response.data);
+      })
+    };
+
+    $scope.fitBrandToProduct = function (product) {
+      if (product.selectBrandId){
+        if (product.pbranden != product.selectBrandId){
+          product.cmpId = product.selectBrandId;
+          product.canMatch = true;
+        }else {
+          product.cmpId = null;
+          product.canMatch = false;
+        }
+      }
+    };
+
+    // $scope.onFocus = function (product) {
+    // 	angular.forEach($scope.currenctMaterial, function (item) {
+    // 		item.isFocus = false;
+    // 	});
+    // 	product.isFocus = true;
+    // 	$scope.showBrand = true;
+    // };
+    //
+    // $scope.onItemBlur = function () {
+    // 	if ($scope.time){
+    // 		clearTimeout($scope.time);
+    // 	}
+    // 	$scope.time = setTimeout(function () {
+    // 		$scope.$apply(function () {
+    // 			$scope.showBrand = false;
+    // 		});
+    // 	}, 200);
+    // };
+
+    // 保存物料详细信息
+    $scope.saveDetail = function(material) {
+      console.log('product',$scope.goods);
+      console.log(material);
+      Material.saveDetail({productId: material.id}, $scope.goods, function (data) {
+        toaster.pop('success', '保存成功');
+      }, function (response) {
+        toaster.pop('error', response.data);
+      })
+    };
+
+    /**
+     * 验证商品信息
+     *
+     * @param goods		商品信息
+     */
+    function validateGoods(goods) {
+      if(!goods.tag) {
+        toaster.pop('warning', '提示', '产品的自定义标签为空');
+        return false;
+      }
+      if(goods.tag.length > 20) {
+        toaster.pop('warning', '提示', '产品的自定义标签超过了20个字符');
+        return false;
+      }
+      // if(!pattern.test(goods.tag)) {
+      // 	toaster.pop('warning', '提示', '产品的自定义标签只能包含中英文字符');
+      // 	return false;
+      // }
+      if(!goods.packaging || goods.packaging === '') {
+        toaster.pop('warning', '提示', '产品包装方式不能为空');
+        return false;
+      }
+      if(!pattern.test(goods.packaging)) {
+        toaster.pop('warning', '提示', '产品包装方式只能包含中文和英文字符');
+        return false;
+      }
+      if(goods.packaging.length > 10) {
+        toaster.pop('warning', '提示', '产品包装方式不能超过10个字符');
+        return false;
+      }
+      if (!goods.produceDate || goods.produceDate === '') {
+        toaster.pop('warning', '提示',  '产品生产日期不能为空');
+        return false;
+      }
+      if(goods.produceDate.length > 11) {
+        toaster.pop('warning', '提示', '产品生产日期不能超过11个字符');
+        return false;
+      }
+      if (!goods.reserve || goods.reserve === '') {
+        toaster.pop('warning', '提示', '产品库存信息不能为空');
+        return false;
+      }
+      if (!goods.minBuyQty || goods.minBuyQty === '') {
+        toaster.pop('warning', '提示', '产品的起拍数量不能为空');
+        return false;
+      }
+      if(!goods.minPackQty || goods.minPackQty === '') {
+        goods.minPackQty = 1;
+      }
+      if(!goods.breakUp) {
+        $scope.isNotBreakUp(goods);
+      }
+
+      //console.log($scope.store.enType);
+      // 根据价格生成币别
+      if (!$scope.store || !$scope.store.enType || $scope.store.enType === '') {
+        var rmbFlag = false;
+        var usdFlag = false;
+        var price = {};
+        for (var i = 0; i < goods.prices.length; i++) {
+          price = goods.prices[i];
+          if (price.rMBPrice && price.rMBPrice !== '') {
+            rmbFlag = true;
+          }
+          if (price.uSDPrice && price.uSDPrice !== '') {
+            usdFlag = true;
+          }
+        }
+        if (rmbFlag && usdFlag) {
+          goods.currencyName = 'RMB-USD';
+        } else if (rmbFlag && !usdFlag) {
+          goods.currencyName = 'RMB';
+        } else if (!rmbFlag && usdFlag) {
+          goods.currencyName = 'USD';
+        } else {
+          delete goods.currencyName;
+        }
+      } else {
+        if ($scope.store.enType === 'MAINLAND') {
+          goods.currencyName = 'RMB';
+        }
+        if ($scope.store.enType === 'HK') {
+          goods.currencyName = 'USD';
+        }
+      }
 
-            if (goods.currencyName.indexOf('RMB') > -1 && !$scope.compareNum(goods.editMinDelivery, goods.editMaxDelivery, 1, goods)) {
-                return result;
-            }
 
-            result = true;
-            return result;
+      for (i = 0; i < goods.prices.length; i++) {
+        price = goods.prices[i];
+        if (!price.start || price.start === '') {
+          toaster.pop('warning', '提示', '产品价格梯度的起始数量不能为空');
+          return false;
         }
-
-        /**
-         * 比较交货周期的大小
-         * @param min 本来是最小值
-         * @param max 本来是最大值
-         * @param type 2 表示当前验证的香港交期, 1表示当前验证的是大陆交期
-         * @param commodity 批次信息
-         * @returns {boolean} true 表示验证通过,false 表示验证失败。
-         */
-        $scope.compareNum = function(min, max, type, goods) {
-            if(!min) {
-                goods.editMinDeliveryinValid = true;
-                toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
-                return false;
-            }else if(!max) {
-                goods.editMaxDeliveryinValid = true;
-                toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
-                return false;
-            }
-            if(!$scope.isInt.test(min)) {
-                goods.editMinDeliveryinValid = true;
-                toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
-                return false;
-            }
-            if(!$scope.isInt.test(max)) {
-                goods.editMaxDeliveryinValid = true;
-                toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
-                return false;
-            }
-            if(min < 1 || min > 31) {
-                goods.editMinDeliveryinValid = true;
-                toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
-                return false;
-            }
-            if(max < 1 || max > 31) {
-                goods.editMaxDeliveryinValid = true;
-                toaster.pop('warning', '提示', '交期的时间必须是1-31之内');
-                return false;
+        if (!price.end || price.end === '') {
+          toaster.pop('warning', '提示', '产品价格梯度的终止数量不能为空');
+          return false;
+        }
+        if (!goods.currencyName || goods.currencyName === '') {
+          if ((!price.rMBPrice || price.rMBPrice === '') && (!price.uSDPrice || price.uSDPrice === '')) {
+            toaster.pop('warning', '提示', '产品的人民币和美元价格不能同时为空');
+            return false;
+          }
+        } else {
+          if (goods.currencyName.indexOf('RMB') > -1) {
+            if (!price.rMBPrice || price.rMBPrice === '') {
+              toaster.pop('warning', '提示', '产品的人民币价格不能为空');
+              return false;
             }
-            if(Number(min) > Number(max)) {
-                goods.editMaxDeliveryinValid = true;
-                goods.editMinDeliveryinValid = true;
-                toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
-                return false;
+            if (price.rMBPrice <= 0) {
+              toaster.pop('warning', '提示', '产品的人民币价格不能小于0');
+              return false;
             }
-            return true;
-        }
-
-        /**
-         * 编辑状态下的产品字段转成与后台对应的字段
-         */
-		function inverseGoods(goods) {
-            goods.packaging = goods.editPackaging;
-            goods.produceDate = goods.editProduceDate;
-            goods.oldReserve =  goods.reserve;
-            goods.reserve =  goods.editReserve;
-            goods.minBuyQty = goods.editMinBuyQty;
-            goods.prices = goods.editPrices;
-            goods.minDelivery = goods.editMinDelivery;
-            goods.maxDelivery = goods.editMaxDelivery;
-            goods.selfSale = goods.editSelfSale;
-            goods.minPackQty = goods.editMinPackQty;
-            goods.img = goods.editPic;
-            goods.breakUp = typeof goods.editBreakUp == 'undefined' ? false : goods.editBreakUp;
-            goods.tag = goods.editTag;
-        }
-
-		/**
-		 * 鼠标移入到保存按钮
-		 */
-		$scope.impedeBlur = function () {
-			$scope.$$nonProduct.enterSaveButton = true;
-		}
-
-		/**
-		 * 鼠标移出保存按钮
-		 */
-		$scope.recoveryBlur = function () {
-			$scope.$$nonProduct.enterSaveButton = false;
-		}
-
-		/**
-		 * 添加产品失败
-		 * @param currenctMaterial
-		 * @param goods
-		 */
-		function addGoods(currenctMaterial) {
-			if (!$scope.checkGoodsInfo($scope.goods)) {
-				return ;
-			}
-            inverseGoods($scope.goods);
-			$scope.goods.productid = currenctMaterial.id;
-			Goods.addGoods(null, $scope.goods, function (result) {
-				if (result.success) {
-                    ProductServiceQuery.getProductById({id: currenctMaterial.id}, function (response) {
-                        if(!response || !response.id) {
-                            loadData();
-                        }
-                        for(var i = 0; i < $scope.currenctMaterial.length; i++) {
-                            if($scope.currenctMaterial[i].id == response.id) {
-                                $scope.currenctMaterial.splice(i, 1, response);
-                                if(response.batchCount > 0) {
-                                    $scope.expandGoods($scope.currenctMaterial[i]);
-                                }else {
-                                    $scope.currenctMaterial[i].exPandOper = false;
-                                }
-                            }
-                        }
-                    }, function (response) {
-                        $scope.expandGoods(currenctMaterial);
-                        closeShelArea(currenctMaterial);
-                    });
-				} else {
-					toaster.pop('error', '错误', "添加产品失败" + result.message);
-				}
-			}, function (error) {
-				toaster.pop('error', '错误', error.data);
-			});
-		}
-
-		/**
-		 * 更新产品信息
-		 */
-		function updateGoods(material, goods) {
-			if(!goods || !material) {
-				return ;
-			}
-            if (!$scope.checkGoodsInfo(goods)) {
-                return ;
+          }
+          if (goods.currencyName.indexOf('USD') > -1) {
+            if (!price.uSDPrice || price.uSDPrice === '') {
+              toaster.pop('warning', '提示', '产品的美元价格不能为空');
+              return false;
             }
-            inverseGoods(goods);
-			//不需要更新状态
-			Goods.updateGoods(null, goods, function(data){
-				if(data.code == 1) {
-					toaster.pop('success', '修改成功');
-					for(var i = 0; i < material.goodsArr.length; i++) {
-						if(material.goodsArr[i].id == data.data.id) {
-							material.goodsArr.splice(i, 1, data.data);
-							break;
-						}
-					}
-				}else {
-					toaster.pop('error', '失败', data.message);
-				}
-			}, function(response){
-				toaster.pop('error', '失败', response.data);
-			});
-		}
-
-		/**
-		 * 上架在售产品信息
-		 */
-		function putOn(material, goods) {
-			if(!goods || !material) {
-				return ;
-			}
-			Goods.putOn({id : goods.id}, null ,function (data) {
-				toaster.pop('success', '提示', '上架成功');
-				for(var i = 0; i < material.goodsArr.length; i++) {
-					if(material.goodsArr[i].id == goods.id) {
-						material.goodsArr.splice(i, 1, data.data);
-						break;
-					}
-				}
-			}, function (response) {
-				toaster.pop('error', '提示', '上架失败:' + response.data);
-			});
-		}
-
-		/**
-		 * 上架只是修改Goods的状态
-		 */
-		$scope.publishGoods = function (product) {
-			if (!validateGoods($scope.goods)) return ;
-
-			$q.all([initRuleCount().$promise]).then(function (data) {
-				if (data){
-					if ($scope.needShowTip){
-						$modal.open({
-							templateUrl: 'static/view/common/modal/delivery_rule_modal.html',
-							controller: 'rule_tip_ctrl',
-							resolve : {
-								type : function() {
-									return 'product';
-								},
-								tipModal : function() {
-									return true;
-								},
-                                success : function () {
-                                    return false;
-                                },
-                                uuid: function () {
-                                    return null;
-                                }
-							}
-						});
-						return ;
-					}
-					$scope.goods.breakUp = 1 === $scope.goods.breakUp;
-					$scope.isSelfSupport = 1 === $scope.goods.isSelfSupport;
-					if (product.sourceApp == 'ERP') {
-						if ($scope.goods.erpReserve < $scope.goods.b2cReserve + $scope.goods.reserve) {
-							toaster.pop('error', '本次上架数量和已上架数量之和不可超过ERP空闲库存数量');
-							return;
-						}
-					}
-					Material.newStockByStandardProduct({ id: product.id, isSelfSupport: $scope.isSelfSupport}, $scope.goods, function (result) {
-						if (result.success) {
-							toaster.pop('success', '商品上架成功');
-							closeShelArea(product);
-						} else {
-							toaster.pop('error', result.message);
-						}
-					}, function (error) {
-						toaster.pop('error', error.data);
-					});
-				}
-			});
-		};
-
-		// 保存物料详细信息
-		$scope.saveDetail = function(material) {
-			console.log('product',$scope.goods);
-			console.log(material);
-			Material.saveDetail({productId: material.id}, $scope.goods, function (data) {
-				toaster.pop('success', '保存成功');
-			}, function (response) {
-				toaster.pop('error', response.data);
-			})
-		};
-
-		$scope.fitBrandToProduct = function (product) {
-			if (product.selectBrandId){
-				if (product.pbranden != product.selectBrandId){
-					product.cmpId = product.selectBrandId;
-					product.canMatch = true;
-				}else {
-					product.cmpId = null;
-					product.canMatch = false;
-				}
-			}
-		};
-
-		// $scope.onFocus = function (product) {
-		// 	angular.forEach($scope.currenctMaterial, function (item) {
-		// 		item.isFocus = false;
-		// 	});
-		// 	product.isFocus = true;
-		// 	$scope.showBrand = true;
-		// };
-        //
-		// $scope.onItemBlur = function () {
-		// 	if ($scope.time){
-		// 		clearTimeout($scope.time);
-		// 	}
-		// 	$scope.time = setTimeout(function () {
-		// 		$scope.$apply(function () {
-		// 			$scope.showBrand = false;
-		// 		});
-		// 	}, 200);
-		// };
-
-		// 保存物料详细信息
-		$scope.saveDetail = function(material) {
-			console.log('product',$scope.goods);
-			console.log(material);
-			Material.saveDetail({productId: material.id}, $scope.goods, function (data) {
-				toaster.pop('success', '保存成功');
-			}, function (response) {
-				toaster.pop('error', response.data);
-			})
-		};
-
-		/**
-		 * 验证商品信息
-		 *
-		 * @param goods		商品信息
-		 */
-		function validateGoods(goods) {
-			if(!goods.tag) {
-				toaster.pop('warning', '提示', '产品的自定义标签为空');
-				return false;
-			}
-			if(goods.tag.length > 20) {
-				toaster.pop('warning', '提示', '产品的自定义标签超过了20个字符');
-				return false;
-			}
-			// if(!pattern.test(goods.tag)) {
-			// 	toaster.pop('warning', '提示', '产品的自定义标签只能包含中英文字符');
-			// 	return false;
-			// }
-			if(!goods.packaging || goods.packaging === '') {
-				toaster.pop('warning', '提示', '产品包装方式不能为空');
-				return false;
-			}
-			if(!pattern.test(goods.packaging)) {
-				toaster.pop('warning', '提示', '产品包装方式只能包含中文和英文字符');
-				return false;
-			}
-			if(goods.packaging.length > 10) {
-				toaster.pop('warning', '提示', '产品包装方式不能超过10个字符');
-				return false;
-			}
-			if (!goods.produceDate || goods.produceDate === '') {
-				toaster.pop('warning', '提示',  '产品生产日期不能为空');
-				return false;
-			}
-			if(goods.produceDate.length > 11) {
-				toaster.pop('warning', '提示', '产品生产日期不能超过11个字符');
-				return false;
-			}
-			if (!goods.reserve || goods.reserve === '') {
-				toaster.pop('warning', '提示', '产品库存信息不能为空');
-				return false;
-			}
-			if (!goods.minBuyQty || goods.minBuyQty === '') {
-				toaster.pop('warning', '提示', '产品的起拍数量不能为空');
-				return false;
-			}
-			if(!goods.minPackQty || goods.minPackQty === '') {
-				goods.minPackQty = 1;
-			}
-			if(!goods.breakUp) {
-				$scope.isNotBreakUp(goods);
-			}
-
-			//console.log($scope.store.enType);
-			// 根据价格生成币别
-			if (!$scope.store || !$scope.store.enType || $scope.store.enType === '') {
-				var rmbFlag = false;
-				var usdFlag = false;
-				var price = {};
-				for (var i = 0; i < goods.prices.length; i++) {
-					price = goods.prices[i];
-					if (price.rMBPrice && price.rMBPrice !== '') {
-						rmbFlag = true;
-					}
-					if (price.uSDPrice && price.uSDPrice !== '') {
-						usdFlag = true;
-					}
-				}
-				if (rmbFlag && usdFlag) {
-					goods.currencyName = 'RMB-USD';
-				} else if (rmbFlag && !usdFlag) {
-					goods.currencyName = 'RMB';
-				} else if (!rmbFlag && usdFlag) {
-					goods.currencyName = 'USD';
-				} else {
-					delete goods.currencyName;
-				}
-			} else {
-				if ($scope.store.enType === 'MAINLAND') {
-					goods.currencyName = 'RMB';
-				}
-				if ($scope.store.enType === 'HK') {
-					goods.currencyName = 'USD';
-				}
-			}
-
-
-			for (i = 0; i < goods.prices.length; i++) {
-				price = goods.prices[i];
-				if (!price.start || price.start === '') {
-					toaster.pop('warning', '提示', '产品价格梯度的起始数量不能为空');
-					return false;
-				}
-				if (!price.end || price.end === '') {
-					toaster.pop('warning', '提示', '产品价格梯度的终止数量不能为空');
-					return false;
-				}
-				if (!goods.currencyName || goods.currencyName === '') {
-					if ((!price.rMBPrice || price.rMBPrice === '') && (!price.uSDPrice || price.uSDPrice === '')) {
-						toaster.pop('warning', '提示', '产品的人民币和美元价格不能同时为空');
-						return false;
-					}
-				} else {
-					if (goods.currencyName.indexOf('RMB') > -1) {
-						if (!price.rMBPrice || price.rMBPrice === '') {
-							toaster.pop('warning', '提示', '产品的人民币价格不能为空');
-							return false;
-						}
-						if (price.rMBPrice <= 0) {
-							toaster.pop('warning', '提示', '产品的人民币价格不能小于0');
-							return false;
-						}
-					}
-					if (goods.currencyName.indexOf('USD') > -1) {
-						if (!price.uSDPrice || price.uSDPrice === '') {
-							toaster.pop('warning', '提示', '产品的美元价格不能为空');
-							return false;
-						}
-						if (price.uSDPrice <= 0) {
-							toaster.pop('warning', '提示', '产品的美元价格不能小于0');
-							return false;
-						}
-					}
-				}
-			}
-			if((!goods.minDelivery || goods.minDelivery === '') || (!goods.maxDelivery || goods.maxDelivery === '')) {
-				toaster.pop('warning', '提示', '交期不能为空');
-				return false;
-			}
-			if ((goods.minDelivery < 1 || goods.minDelivery > 31) || (goods.maxDelivery < 0 || goods.maxDelivery > 31)) {
-				toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
-				return false;
-			}
-			return true;
-		}
-
-		/**
-		 * 获取物料交易信息
-		 * @param product
-		 */
-		var getProductDetail = function (product) {
-			Material.getProductDetail({id : product.id}, function (data) {
-				// $scope.goods.erpReserve = typeof data.reserve == 'undefined' ? 0 : data.reserve;
-				// $scope.goods.b2cReserve = typeof data.b2cReserve == 'undefined' ? 0 : data.b2cReserve;
-				// $scope.goods.packaging = data.packaging;
-				// $scope.goods.produceDate = data.produceDate;
-				// $scope.goods.minPackQty = data.minPackQty;
-				// $scope.goods.breakUp = data.breakUp;
-				// $scope.goods.minBuyQty = data.minBuyQty;
-				// $scope.goods.minDelivery = data.minDelivery;
-				// $scope.goods.maxDelivery = data.maxDelivery;
-				// $scope.goods.prices = [];
-				// product.selected = true;
-				// if ('MAINLAND' == $scope.store.enType)
-				// 	$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve, rMBPrice: data.price});
-				// if ('HK' == $scope.store.enType)
-				// 	$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve, uSDPrice: data.price});
-
-			});
-		}
-
-		/**
-		 * 获取物料交易信息
-		 * @param product
-		 */
-		function showShelfArea(material) {
-			// ComponentActive.getComponentListByUuid({ uuids: material.cmpUuId}, function (components) {
-			// 	if (components.length > 0) {
-			// 		var component = components[0];
-			// 		angular.forEach($scope.currenctMaterial, function (product) {
-			// 			delete product.selected;
-			// 		});
-			// 		$scope.goods = { isBreakUp: 1, isSelfSupport: 1, prices: [{}] };
-			// 		$scope.goods.prices = [];
-			// 		$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve});
-			// 		$scope.goods.isSelfSupport = $scope.store.status == 'OPENED' ? 1 : 0;
-			// 		material.img = component.img || null;
-			// 		if ('ERP' == product.sourceApp) {// 如果是erp上传物料获取物料交易信息
-			// 			getProductDetail(product);
-			// 		} else {
-			// 			product.selected = true;
-			// 		}
-			// 	} else {
-			// 		$scope.goods = { editBreakUp: false, editSelfSale: 2};
-			// 		if($scope.store.enType === 'HK') {
-			// 			$scope.goods.currencyName = 'USD';
-			// 		}else {
-			// 			$scope.goods.currencyName = 'RMB';
-			// 		}
-			// 		// 先保存产品id,方便去获取tag是否重复
-			// 		$scope.goods.productid = material.id;
-			// 		$scope.goods.prodNum = material.prodNum;
-			// 		$scope.goods.editPrices = [];
-			// 		$scope.goods.editPrices.push({start : $scope.minReserve, end : $scope.maxReserve});
-			// 		// $scope.goods.isSelfSupport = $scope.store.status == 'OPENED' ? 1 : 0;
-			// 		material.selected = true;
-			// 	}
-			// }, function (error) {
-			// 	toaster.pop('error', '当前产品对应的器件[' + material.cmpUuId + ']已失效');
-			// 	console.log(error);
-			// });
-
-			angular.forEach($scope.currenctMaterial, function (material) {
-				delete material.selected;
-				material.exPandOper = false;
-				material.addGoodsOper = false;
-			});
-			material.addGoodsOper = true;
-			material.exPandOper = true;
-			$scope.expandGoods(material, material.addGoodsOper);
-			// if ('ERP' == material.sourceApp) {// 如果是erp上传物料获取物料交易信息
-			// 	getProductDetail(material);
-			// } else {
-				$scope.goods = { editBreakUp: false, editSelfSale: 2};
-				if($scope.store.enType === 'HK') {
-					$scope.goods.currencyName = 'USD';
-				}else {
-					$scope.goods.currencyName = 'RMB';
-				}
-				// 先保存产品id,方便去获取tag是否重复
-				$scope.goods.productid = material.id;
-				$scope.goods.prodNum = material.prodNum;
-				$scope.goods.editPrices = [];
-				$scope.goods.editPrices.push({start : $scope.minReserve, end : $scope.maxReserve});
-				// $scope.goods.isSelfSupport = $scope.store.status == 'OPENED' ? 1 : 0;
-				material.selected = true;
-			// }
-		}
-
-		/**
-		 * 关闭上架商品填写区域
-		 *
-		 * @param product		产品信息
-		 */
-		function closeShelArea(product) {
-			// 初始化商品信息
-			angular.forEach($scope.currenctMaterial, function (material) {
-				material.addGoodsOper = false;
-				material.exPandOper = false;
-			});
-			$scope.goods = { editBreakUp: false, editSelfSale: 2};
-			if (product.selected){
-				delete product.selected;
-			}
-		}
-
-		/**
-		 * 设置最小起订量
-		 *
-		 * @param goods		商品信息
-		 */
-		function setPriceMinAmount(goods, edit) {
-            // goods.editMinBuyQtyInValid = false;
-			// if (typeof goods.editMinBuyQty == 'undefined') {
-			// 	goods.editMinBuyQtyInValid = true;
-			// 	return false;
-			// }
-            if (!$scope.isInt.test(goods.editMinBuyQty) || parseInt(goods.editMinBuyQty) < 1) {
-                // goods.editMinBuyQtyInValid = true;
-				if (goods.editBreakUp) {
-					goods.editMinBuyQty = 1;
-					goods.editPrices[0].start = goods.editMinBuyQty;
-				} else {
-					if (goods.editMinPackQty) {
-						goods.editMinBuyQty = goods.editMinPackQty;
-						goods.editPrices[0].start = goods.editMinBuyQty;
-					}
-				}
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					toaster.pop('warning', '提示', '起订量必须是大于0的整数');
-				}
-                return false;
+            if (price.uSDPrice <= 0) {
+              toaster.pop('warning', '提示', '产品的美元价格不能小于0');
+              return false;
             }
-            goods.editMinBuyQtyPre = goods.editMinBuyQty;
-            if (!goods.editBreakUp) {
-                $scope.isNotBreakUp(goods, edit);
-            }
-		}
-
-		$scope.updateStartNumber = function (goods) {
-			goods.editPrices[0].start = goods.editMinBuyQty;
-		};
-
-		/**
-		 * 设置最小包数量
-		 *
-		 * @param goods		商品信息
-		 */
-		function setPriceMinPackAmount(goods) {
-            goods.editMinPackQtyInValid = false;
-			if (typeof goods.editMinPackQty == 'undefined') {
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
-				}
-				return false;
-			}
-            if (!$scope.isInt.test(goods.editMinPackQty)) {
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					goods.editMinPackQtyInValid = true;
-					toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
-				}
-                return false;
+          }
+        }
+      }
+      if((!goods.minDelivery || goods.minDelivery === '') || (!goods.maxDelivery || goods.maxDelivery === '')) {
+        toaster.pop('warning', '提示', '交期不能为空');
+        return false;
+      }
+      if ((goods.minDelivery < 1 || goods.minDelivery > 31) || (goods.maxDelivery < 0 || goods.maxDelivery > 31)) {
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
+        return false;
+      }
+      return true;
+    }
+
+    /**
+     * 获取物料交易信息
+     * @param product
+     */
+    var getProductDetail = function (product) {
+      Material.getProductDetail({id : product.id}, function (data) {
+        // $scope.goods.erpReserve = typeof data.reserve == 'undefined' ? 0 : data.reserve;
+        // $scope.goods.b2cReserve = typeof data.b2cReserve == 'undefined' ? 0 : data.b2cReserve;
+        // $scope.goods.packaging = data.packaging;
+        // $scope.goods.produceDate = data.produceDate;
+        // $scope.goods.minPackQty = data.minPackQty;
+        // $scope.goods.breakUp = data.breakUp;
+        // $scope.goods.minBuyQty = data.minBuyQty;
+        // $scope.goods.minDelivery = data.minDelivery;
+        // $scope.goods.maxDelivery = data.maxDelivery;
+        // $scope.goods.prices = [];
+        // product.selected = true;
+        // if ('MAINLAND' == $scope.store.enType)
+        // 	$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve, rMBPrice: data.price});
+        // if ('HK' == $scope.store.enType)
+        // 	$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve, uSDPrice: data.price});
+
+      });
+    }
+
+    /**
+     * 获取物料交易信息
+     * @param product
+     */
+    function showShelfArea(material) {
+      // ComponentActive.getComponentListByUuid({ uuids: material.cmpUuId}, function (components) {
+      // 	if (components.length > 0) {
+      // 		var component = components[0];
+      // 		angular.forEach($scope.currenctMaterial, function (product) {
+      // 			delete product.selected;
+      // 		});
+      // 		$scope.goods = { isBreakUp: 1, isSelfSupport: 1, prices: [{}] };
+      // 		$scope.goods.prices = [];
+      // 		$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve});
+      // 		$scope.goods.isSelfSupport = $scope.store.status == 'OPENED' ? 1 : 0;
+      // 		material.img = component.img || null;
+      // 		if ('ERP' == product.sourceApp) {// 如果是erp上传物料获取物料交易信息
+      // 			getProductDetail(product);
+      // 		} else {
+      // 			product.selected = true;
+      // 		}
+      // 	} else {
+      // 		$scope.goods = { editBreakUp: false, editSelfSale: 2};
+      // 		if($scope.store.enType === 'HK') {
+      // 			$scope.goods.currencyName = 'USD';
+      // 		}else {
+      // 			$scope.goods.currencyName = 'RMB';
+      // 		}
+      // 		// 先保存产品id,方便去获取tag是否重复
+      // 		$scope.goods.productid = material.id;
+      // 		$scope.goods.prodNum = material.prodNum;
+      // 		$scope.goods.editPrices = [];
+      // 		$scope.goods.editPrices.push({start : $scope.minReserve, end : $scope.maxReserve});
+      // 		// $scope.goods.isSelfSupport = $scope.store.status == 'OPENED' ? 1 : 0;
+      // 		material.selected = true;
+      // 	}
+      // }, function (error) {
+      // 	toaster.pop('error', '当前产品对应的器件[' + material.cmpUuId + ']已失效');
+      // 	console.log(error);
+      // });
+
+      angular.forEach($scope.currenctMaterial, function (material) {
+        delete material.selected;
+        material.exPandOper = false;
+        material.addGoodsOper = false;
+      });
+      material.addGoodsOper = true;
+      material.exPandOper = true;
+      $scope.expandGoods(material, material.addGoodsOper);
+      // if ('ERP' == material.sourceApp) {// 如果是erp上传物料获取物料交易信息
+      // 	getProductDetail(material);
+      // } else {
+      $scope.goods = { editBreakUp: false, editSelfSale: 2};
+      if($scope.store.enType === 'HK') {
+        $scope.goods.currencyName = 'USD';
+      }else {
+        $scope.goods.currencyName = 'RMB';
+      }
+      // 先保存产品id,方便去获取tag是否重复
+      $scope.goods.productid = material.id;
+      $scope.goods.prodNum = material.prodNum;
+      $scope.goods.editPrices = [];
+      $scope.goods.editPrices.push({start : $scope.minReserve, end : $scope.maxReserve});
+      // $scope.goods.isSelfSupport = $scope.store.status == 'OPENED' ? 1 : 0;
+      material.selected = true;
+      // }
+    }
+
+    /**
+     * 关闭上架商品填写区域
+     *
+     * @param product		产品信息
+     */
+    function closeShelArea(product) {
+      // 初始化商品信息
+      angular.forEach($scope.currenctMaterial, function (material) {
+        material.addGoodsOper = false;
+        material.exPandOper = false;
+      });
+      $scope.goods = { editBreakUp: false, editSelfSale: 2};
+      if (product.selected){
+        delete product.selected;
+      }
+    }
+
+    /**
+     * 设置最小起订量
+     *
+     * @param goods		商品信息
+     */
+    function setPriceMinAmount(goods, edit) {
+      // goods.editMinBuyQtyInValid = false;
+      // if (typeof goods.editMinBuyQty == 'undefined') {
+      // 	goods.editMinBuyQtyInValid = true;
+      // 	return false;
+      // }
+      if (!$scope.isInt.test(goods.editMinBuyQty) || parseInt(goods.editMinBuyQty) < 1) {
+        // goods.editMinBuyQtyInValid = true;
+        if (goods.editBreakUp) {
+          goods.editMinBuyQty = 1;
+          goods.editPrices[0].start = goods.editMinBuyQty;
+        } else {
+          if (goods.editMinPackQty) {
+            goods.editMinBuyQty = goods.editMinPackQty;
+            goods.editPrices[0].start = goods.editMinBuyQty;
+          }
+        }
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          toaster.pop('warning', '提示', '起订量必须是大于0的整数');
+        }
+        return false;
+      }
+      goods.editMinBuyQtyPre = goods.editMinBuyQty;
+      if (!goods.editBreakUp) {
+        $scope.isNotBreakUp(goods, edit);
+      }
+    }
+
+    $scope.updateStartNumber = function (goods) {
+      goods.editPrices[0].start = goods.editMinBuyQty;
+    };
+
+    /**
+     * 设置最小包数量
+     *
+     * @param goods		商品信息
+     */
+    function setPriceMinPackAmount(goods) {
+      goods.editMinPackQtyInValid = false;
+      if (typeof goods.editMinPackQty == 'undefined') {
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+        }
+        return false;
+      }
+      if (!$scope.isInt.test(goods.editMinPackQty)) {
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          goods.editMinPackQtyInValid = true;
+          toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+        }
+        return false;
+      }
+      if (parseInt(goods.editMinPackQty) < 1) {
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          goods.editMinPackQtyInValid = true;
+          toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+        }
+        return false;
+      }
+      if (parseInt(goods.editMinPackQty) > $scope.maxPackQty) {
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          toaster.pop('warning', '提示', '包装数量必须小于' + $scope.maxPackQty);
+          goods.editMinPackQtyInValid = true;
+        }
+        return false;
+      }
+      if (goods.editMinBuyQty) {
+        if(!goods.editBreakUp) {
+          $scope.isNotBreakUp(goods);
+        }
+      }
+      goods.editMinPackQtyPre = goods.editMinPackQty;
+      goods.editMinPackQtyInValid = false;
+    }
+
+    /**
+     * 设置价格梯度的最大数量
+     *
+     * @param goods		商品信息
+     */
+    function setPriceMaxAmount(goods, edit) {
+      if (!goods.editReserve) {
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          goods.editReserveInvalid = true;
+          toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+        }
+        return false;
+      }
+      if (!$scope.isInt.test(goods.editReserve)) {
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          goods.editReserveInvalid = true;
+          toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+        }
+        return false;
+      }
+      // if(goods.editMinBuyQty) {
+      //     if(parseInt(goods.editReserve) < parseInt(goods.editMinBuyQty)) {
+      //         goods.editReserveInvalid = true;
+      //         toaster.pop('warning', '提示', '库存必须是大于等于起订量的整数');
+      //         return false;
+      //     }
+      // }
+      if (parseInt(goods.editReserve) > $scope.maxReserve || goods.editReserve < $scope.minReserve) {
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          goods.editReserveInvalid = true;
+          toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+        }
+        return false;
+      }
+      goods.editReservePre = goods.editReserve;
+      goods.editReserveInvalid = false;
+      if (!goods.breakUp) {
+        $scope.isNotBreakUp(goods, edit);
+      }
+    }
+
+    var countLength = function (string) {
+      return string.replace(/[^\x00-\xff]/g,'**').length;
+    };
+
+    var cutOutString = function (str, length) {
+      for (var i = 1; i <= str.length; i++) {
+        if (countLength(str.substr(0, i)) > length){
+          str = str.substr(0, i-1);
+          break;
+        }
+      }
+      return str;
+    };
+
+    /**
+     * 编辑包装方式的信息
+     * @param goods
+     * @param edit
+     */
+    $scope.editPackaging = function(goods) {
+      goods.editPackagingInvalid = false;
+      if (goods.editPackaging) {
+        if (!pattern.test(goods.editPackaging)) {
+          toaster.pop('warning', '提示', '包装方式只能填写中英文');
+          goods.editPackagingInvalid = true;
+        }
+      }
+    };
+
+    $scope.changePackaging = function (goods) {
+      if (goods.editPackaging) {
+        goods.editPackaging = cutOutString(goods.editPackaging, 10);
+      }
+    };
+
+    /**
+     * 编辑生产日期
+     * @param commodity
+     */
+    $scope.editProduceDateFa = function(goods) {
+      if($scope.$$nonProduct.enterSaveButton) {
+        return ;
+      }
+      goods.editProduceDateInvalid = false;
+      if(goods.editProduceDate) {
+        goods.editProduceDate = cutOutString(goods.editProduceDate, 12);
+        // if(goods.editProduceDate.length > 11) {
+        //     goods.editProduceDateInvalid = true;
+        //     toaster.pop('warning', '提示', '生产日期不能超过十一个字符');
+        // }
+      }
+    };
+
+    /**
+     * 判断价格是否合理,只设置验证的结果
+     * @param prices 分段价格
+     * @param price 对应的价格
+     * @param index 索引
+     */
+    $scope.changePrices = function (prices, price, index) {
+      prices[index].priceInvalid = false;
+      if(!prices || !prices[index] || !price) {
+        return ;
+      }
+      if(isNaN(price)) {
+        prices[index].priceInvalid = true;
+        toaster.pop('warning', '提示', '单价必须是大于0的数字');
+        return;
+      }
+      if(new Number(price) <= 0) {
+        prices[index].priceInvalid = true;
+        toaster.pop('warning', '提示', '单价必须是大于0的数字');
+        return;
+      }
+      if(price.indexOf('.') > -1) {
+        var arr = price.split(".");
+        if(arr[0].length > 4 || arr[1].length > 6) {
+          prices[index].priceInvalid = true;
+          return ;
+        }
+      }else {
+        if(price.toString().length > 4) {
+          prices[index].priceInvalid = true;
+          return ;
+        }
+      }
+    };
+
+    /**
+     * 修改分段的数量
+     * @param commodity 批次信息
+     * @param index 索引值
+     * @param isEnd 是否是结束值
+     */
+    $scope.editQty = function (goods, index, isEnd, num) {
+      goods.editPrices[index].endInValid = false;
+      goods.editPrices[index].startInValid = false;
+      if (goods.editPrices.length < index || index < 0) {
+        return ;
+      }
+      if (typeof num == 'undefined') {
+        return ;
+      }
+      if (!$scope.isInt.test(num)) {
+        if (!$scope.$$nonProduct.enterSaveButton) {
+          if (isEnd) {
+            //goods.editPrices[index].endInValid = true;
+            delete goods.editPrices[index].end;
+          } else {
+            //goods.editPrices[index].startInValid = true;
+            delete goods.editPrices[index].start;
+          }
+          toaster.pop('warning', '提示', '输入值必须为正整数');
+        }
+        return ;
+      }
+      if (isEnd) {
+        if (index < goods.editPrices.length - 1) {
+          if (parseInt(goods.editPrices[index].end) < parseInt(goods.editPrices[index].start)) {
+            if (!$scope.$$nonProduct.enterSaveButton) {
+              toaster.pop('warning', '提示', '输入值必须大于' + goods.editPrices[index].start);
+              //goods.editPrices[index].endInValid = true;
+              delete goods.editPrices[index].end;
             }
-            if (parseInt(goods.editMinPackQty) < 1) {
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					goods.editMinPackQtyInValid = true;
-					toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
-				}
-                return false;
+          } else if ((goods.editPrices[index + 1].end) && (parseInt(goods.editPrices[index].end) + 1) >= parseInt(goods.editPrices[index + 1].end)) {
+            if (!$scope.$$nonProduct.enterSaveButton) {
+              toaster.pop('warning', '提示', '输入值必须小于'+(parseInt(goods.editPrices[index + 1].end) - 1));
+              //goods.editPrices[index].endInValid = true;
+              delete goods.editPrices[index].end;
             }
-            if (parseInt(goods.editMinPackQty) > $scope.maxPackQty) {
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					toaster.pop('warning', '提示', '包装数量必须小于' + $scope.maxPackQty);
-					goods.editMinPackQtyInValid = true;
-				}
-                return false;
+          } else {
+            goods.editPrices[index + 1].start = parseInt(goods.editPrices[index].end) + 1;
+            goods.editPrices[index + 1].startInValid = false;
+            goods.editPrices[index].endPre = goods.editPrices[index].end;
+            goods.editPrices[index + 1].startPre = goods.editPrices[index + 1].start;
+          }
+        }
+        // else {
+        //     if(commodity.editPrices[index].end > commodity.editMinBuyQty) {
+        //         if(commodity.editPrices[index].end > commodity.reserve) {
+        //             toaster.pop('warning', '提示', '修改最后一个分段的结束值之后,新的库存量大于原有的库存量');
+        //             commodity.editPrices[index].end = commodity.editPrices[index].endPre;
+        //         }else {
+        //             commodity.editReserve = commodity.editPrices[index].end;
+        //             commodity.editPrices[index].endPre = commodity.editPrices[index].end;
+        //             commodity.editReservePre = commodity.editReserve;
+        //         }
+        //     }else {
+        //         toaster.pop('warning', '提示', '修改最后一个分段的结束值之后导致库存量小于起拍量');
+        //         commodity.editPrices[index].end = commodity.editPrices[index].endPre;
+        //     }
+        // }
+      } else {
+        if (index != 0) {
+          if (parseInt(goods.editPrices[index].start) > parseInt(goods.editPrices[index].end)) {
+            // toaster.pop('warning', '提示', '修改本分段之后,会导致分段的起始值' + goods.editPrices[index ].start + '大于结束值' + parseInt(goods.editPrices[index].end));
+            //goods.editPrices[index].startInValid = true;
+            if (!$scope.$$nonProduct.enterSaveButton) {
+              toaster.pop('warning', '提示', '输入值必须小于'+ + goods.editPrices[index].end);
+              delete goods.editPrices[index].start;
             }
-            if (goods.editMinBuyQty) {
-                if(!goods.editBreakUp) {
-                    $scope.isNotBreakUp(goods);
-                }
+          } else if ((parseInt(goods.editPrices[index].start) - 1) < goods.editPrices[index - 1].start) {
+            // toaster.pop('warning', '提示', '修改本分段之后,会导致前一个分段的起始值' + goods.editPrices[index - 1].start + '大于结束值' + (parseInt(goods.editPrices[index].start) - 1));
+            //goods.editPrices[index].startInValid = true;
+            if (!$scope.$$nonProduct.enterSaveButton) {
+              toaster.pop('warning', '提示', '输入值会导致梯度重叠,请重新修改');
+              delete goods.editPrices[index].start;
             }
-            goods.editMinPackQtyPre = goods.editMinPackQty;
-            goods.editMinPackQtyInValid = false;
-		}
-
-		/**
-		 * 设置价格梯度的最大数量
-		 *
-		 * @param goods		商品信息
-		 */
-		function setPriceMaxAmount(goods, edit) {
-			if (!goods.editReserve) {
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					goods.editReserveInvalid = true;
-					toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
-				}
-				return false;
-			}
-			if (!$scope.isInt.test(goods.editReserve)) {
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					goods.editReserveInvalid = true;
-					toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
-				}
-                return false;
-			}
-            // if(goods.editMinBuyQty) {
-            //     if(parseInt(goods.editReserve) < parseInt(goods.editMinBuyQty)) {
-            //         goods.editReserveInvalid = true;
-            //         toaster.pop('warning', '提示', '库存必须是大于等于起订量的整数');
-            //         return false;
-            //     }
-            // }
-            if (parseInt(goods.editReserve) > $scope.maxReserve || goods.editReserve < $scope.minReserve) {
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					goods.editReserveInvalid = true;
-					toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
-				}
-                return false;
+          } else {
+            goods.editPrices[index - 1].end = parseInt(goods.editPrices[index].start) - 1;
+            goods.editPrices[index - 1].endInValid = false;
+            goods.editPrices[index].startPre = goods.editPrices[index].start;
+            goods.editPrices[index - 1].endPre = goods.editPrices[index - 1].end;
+          }
+        }//else {
+        //     if(commodity.editMinPackQty) {
+        //         if(commodity.editPrices[index].start % commodity.editMinPackQty != 0) {
+        //             commodity.editPrices[index].startInValid = false;
+        //             commodity.editPrices[index].start = commodity.editMinBuyQty;
+        //             commodity.editPrices[index].startPre = commodity.editMinBuyQty;
+        //             toaster.pop('warning', '提示', '第一个分段的起始量必须是倍数(' + commodity.editMinPackQty + ")的整数倍");
+        //         }else {
+        //             commodity.editMinBuyQty = commodity.editPrices[index].start;
+        //             commodity.editMinBuyQtyPre = commodity.editPrices[index].start;
+        //             commodity.editMinBuyQtyInValid = false;
+        //         }
+        //     }else {
+        //         commodity.editMinBuyQty = commodity.editPrices[index].start;
+        //         commodity.editMinBuyQtyPre = commodity.editMinBuyQty;
+        //         commodity.editPrices[index].startPre = commodity.editPrices[index].start;
+        //         commodity.editMinBuyQtyInValid = false;
+        //     }
+        // }
+      }
+    };
+
+    /**
+     * 删除对应的分段.
+     * @param commodity
+     */
+    $scope.deleteFragment = function(goods, index) {
+      if (index > -1 && index < goods.editPrices.length) {
+        if (goods.editPrices.length < 2) {
+          toaster.pop('warning', "提示", "商品至少需要一个分段");
+          return ;
+        }
+        if (index < goods.editPrices.length - 1) { //不是最后一个分段
+          var price = goods.editPrices.splice(index, 1);
+          goods.editPrices[index].start = price[0].start;
+        } else if (index == goods.editPrices.length - 1) { //如果删除的是最后一个分段,
+          var price = goods.editPrices.splice(index, 1);
+          goods.editPrices[index -1].end = price[0].end;
+        }
+        if (goods.editMinBuyQty && $scope.isInt.test(goods.editMinBuyQty) &&
+            parseInt(goods.editPrices[0].end) >= parseInt(goods.editMinBuyQty)) {
+          if (goods.editMinBuyQtyInValid) {
+            goods.editMinBuyQtyInValid = false;
+            goods.editPrices[0].start = goods.editMinBuyQty;
+          }
+        }
+      }
+    };
+
+    /**
+     * 增加对应的分段。
+     * @param commodity
+     */
+    $scope.addFragment = function (goods) {
+      if(goods.editPrices.length > 2) {
+        toaster.pop('warning', "提示", "商品最多只能有三个分段");
+        return ;
+      }
+      var price = {};
+      price.start = null;
+      price.startPre = null;
+      price.end = goods.editPrices[goods.editPrices.length - 1].end;
+      price.endPre = price.end;
+      price.uSDPrice = null;
+      price.uSDPricePre = null;
+      price.rMBPrice = null;
+      price.rMBPricePre = null;
+      goods.editPrices[goods.editPrices.length - 1].end = null;
+      goods.editPrices[goods.editPrices.length - 1].endPre = null;
+      goods.editPrices.push(price);
+    }
+
+    /**
+     * 修改字符串信息
+     */
+    $scope.blurTag = function (goods) {
+      if (!goods.editTag) {
+        toaster.pop("warning", "自定义标签不能为空");
+      }
+      if (goods.editTag) {
+        Goods.getRepeatByTagAndProductId({goodId:goods.id, productId:goods.productid, tag:goods.editTag}, function (data) {
+          if (data.success) {
+            if (data.data) {
+              toaster.pop("warning", "该产品下已存在相同的自定义标签");
             }
-            goods.editReservePre = goods.editReserve;
-            goods.editReserveInvalid = false;
-			if (!goods.breakUp) {
-				$scope.isNotBreakUp(goods, edit);
-			}
-		}
-
-		var countLength = function (string) {
-			return string.replace(/[^\x00-\xff]/g,'**').length;
-		};
-
-		var cutOutString = function (str, length) {
-			for (var i = 1; i <= str.length; i++) {
-				if (countLength(str.substr(0, i)) > length){
-					str = str.substr(0, i-1);
-					break;
-				}
-			}
-			return str;
-		};
-
-        /**
-         * 编辑包装方式的信息
-         * @param goods
-         * @param edit
-         */
-        $scope.editPackaging = function(goods) {
-            goods.editPackagingInvalid = false;
-            if (goods.editPackaging) {
-                if (!pattern.test(goods.editPackaging)) {
-                    toaster.pop('warning', '提示', '包装方式只能填写中英文');
-                    goods.editPackagingInvalid = true;
-                }
+          } else {
+            toaster.pop("error", data.message);
+          }
+        }, function (error) {
+          toaster.pop("error","判断标签重复请求错误" + error.date);
+        })
+      }
+    };
+
+    /**
+     * 修改字符串信息,失去焦点
+     */
+    $scope.changeTag = function (goods) {
+      var length = ByteCountService.strByteLength(goods.editTag);
+      if (length > 20) {
+        goods.editTag = goods.editTagPre;
+      } else {
+        goods.editTagPre = goods.editTag;
+      }
+    };
+
+
+    /**
+     * @param min 最小值
+     * @param max 最大值
+     * @param isMin 传入的是否是最小值
+     * @param commodity 批次信息
+     */
+    $scope.changeDelivery = function(min, max, isMin, goods) {
+      if(isMin) {
+        goods.editMinDeliveryinValid = false;
+      }else {
+        goods.editMaxDeliveryinValid = false;
+      }
+      var day = -1;
+      if(isMin) {
+        if(min && $scope.isInt.test(min)) {
+          day = min;
+        }else {
+          if(typeof min == 'undefined') {
+            return ;
+          }
+          if(!$scope.isInt.test(min)) {
+            if(!$scope.$$nonProduct.enterSaveButton) {
+              toaster.pop('warning', '提示', '交期请输入1-31的整数');
+              goods.editMinDeliveryinValid = true;
             }
-        };
+          }
+          return ;
+        }
 
-        $scope.changePackaging = function (goods) {
-			if (goods.editPackaging) {
-				goods.editPackaging = cutOutString(goods.editPackaging, 10);
-			}
-		};
-
-        /**
-         * 编辑生产日期
-         * @param commodity
-         */
-        $scope.editProduceDateFa = function(goods) {
-			if($scope.$$nonProduct.enterSaveButton) {
-				return ;
-			}
-            goods.editProduceDateInvalid = false;
-            if(goods.editProduceDate) {
-				goods.editProduceDate = cutOutString(goods.editProduceDate, 12);
-                // if(goods.editProduceDate.length > 11) {
-                //     goods.editProduceDateInvalid = true;
-                //     toaster.pop('warning', '提示', '生产日期不能超过十一个字符');
-                // }
+      }else {
+        if(max && $scope.isInt.test(max)) {
+          day = max;
+        }else {
+          if(typeof max == 'undefined') {
+            return ;
+          }
+          if(!$scope.isInt.test(max)) {
+            if(!$scope.$$nonProduct.enterSaveButton) {
+              toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+              goods.editMaxDeliveryinValid = true;
             }
-        };
+          }
+          return ;
+        }
 
-		/**
-		 * 判断价格是否合理,只设置验证的结果
-		 * @param prices 分段价格
-		 * @param price 对应的价格
-		 * @param index 索引
-		 */
-		$scope.changePrices = function (prices, price, index) {
-			prices[index].priceInvalid = false;
-			if(!prices || !prices[index] || !price) {
-				return ;
-			}
-			if(isNaN(price)) {
-				prices[index].priceInvalid = true;
-				toaster.pop('warning', '提示', '单价必须是大于0的数字');
-				return;
-			}
-			if(new Number(price) <= 0) {
-				prices[index].priceInvalid = true;
-				toaster.pop('warning', '提示', '单价必须是大于0的数字');
-				return;
-			}
-			if(price.indexOf('.') > -1) {
-				var arr = price.split(".");
-				if(arr[0].length > 4 || arr[1].length > 6) {
-					prices[index].priceInvalid = true;
-					return ;
-				}
-			}else {
-				if(price.toString().length > 4) {
-					prices[index].priceInvalid = true;
-					return ;
-				}
-			}
-		};
-
-        /**
-         * 修改分段的数量
-         * @param commodity 批次信息
-         * @param index 索引值
-         * @param isEnd 是否是结束值
-         */
-        $scope.editQty = function (goods, index, isEnd, num) {
-            goods.editPrices[index].endInValid = false;
-            goods.editPrices[index].startInValid = false;
-            if (goods.editPrices.length < index || index < 0) {
-                return ;
-            }
-            if (typeof num == 'undefined') {
-				return ;
-			}
-            if (!$scope.isInt.test(num)) {
-				if (!$scope.$$nonProduct.enterSaveButton) {
-					if (isEnd) {
-						//goods.editPrices[index].endInValid = true;
-						delete goods.editPrices[index].end;
-					} else {
-						//goods.editPrices[index].startInValid = true;
-						delete goods.editPrices[index].start;
-					}
-					toaster.pop('warning', '提示', '输入值必须为正整数');
-				}
-                return ;
-            }
-            if (isEnd) {
-                if (index < goods.editPrices.length - 1) {
-                    if (parseInt(goods.editPrices[index].end) < parseInt(goods.editPrices[index].start)) {
-						if (!$scope.$$nonProduct.enterSaveButton) {
-							toaster.pop('warning', '提示', '输入值必须大于' + goods.editPrices[index].start);
-							//goods.editPrices[index].endInValid = true;
-							delete goods.editPrices[index].end;
-						}
-                    } else if ((goods.editPrices[index + 1].end) && (parseInt(goods.editPrices[index].end) + 1) >= parseInt(goods.editPrices[index + 1].end)) {
-						if (!$scope.$$nonProduct.enterSaveButton) {
-							toaster.pop('warning', '提示', '输入值必须小于'+(parseInt(goods.editPrices[index + 1].end) - 1));
-							//goods.editPrices[index].endInValid = true;
-							delete goods.editPrices[index].end;
-						}
-                    } else {
-                        goods.editPrices[index + 1].start = parseInt(goods.editPrices[index].end) + 1;
-						goods.editPrices[index + 1].startInValid = false;
-						goods.editPrices[index].endPre = goods.editPrices[index].end;
-						goods.editPrices[index + 1].startPre = goods.editPrices[index + 1].start;
-                    }
-                }
-                // else {
-                //     if(commodity.editPrices[index].end > commodity.editMinBuyQty) {
-                //         if(commodity.editPrices[index].end > commodity.reserve) {
-                //             toaster.pop('warning', '提示', '修改最后一个分段的结束值之后,新的库存量大于原有的库存量');
-                //             commodity.editPrices[index].end = commodity.editPrices[index].endPre;
-                //         }else {
-                //             commodity.editReserve = commodity.editPrices[index].end;
-                //             commodity.editPrices[index].endPre = commodity.editPrices[index].end;
-                //             commodity.editReservePre = commodity.editReserve;
-                //         }
-                //     }else {
-                //         toaster.pop('warning', '提示', '修改最后一个分段的结束值之后导致库存量小于起拍量');
-                //         commodity.editPrices[index].end = commodity.editPrices[index].endPre;
-                //     }
-                // }
-            } else {
-                if (index != 0) {
-                    if (parseInt(goods.editPrices[index].start) > parseInt(goods.editPrices[index].end)) {
-                        // toaster.pop('warning', '提示', '修改本分段之后,会导致分段的起始值' + goods.editPrices[index ].start + '大于结束值' + parseInt(goods.editPrices[index].end));
-						//goods.editPrices[index].startInValid = true;
-						if (!$scope.$$nonProduct.enterSaveButton) {
-							toaster.pop('warning', '提示', '输入值必须小于'+ + goods.editPrices[index].end);
-							delete goods.editPrices[index].start;
-						}
-                    } else if ((parseInt(goods.editPrices[index].start) - 1) < goods.editPrices[index - 1].start) {
-                        // toaster.pop('warning', '提示', '修改本分段之后,会导致前一个分段的起始值' + goods.editPrices[index - 1].start + '大于结束值' + (parseInt(goods.editPrices[index].start) - 1));
-						//goods.editPrices[index].startInValid = true;
-						if (!$scope.$$nonProduct.enterSaveButton) {
-							toaster.pop('warning', '提示', '输入值会导致梯度重叠,请重新修改');
-							delete goods.editPrices[index].start;
-						}
-                    } else {
-                        goods.editPrices[index - 1].end = parseInt(goods.editPrices[index].start) - 1;
-						goods.editPrices[index - 1].endInValid = false;
-                        goods.editPrices[index].startPre = goods.editPrices[index].start;
-                        goods.editPrices[index - 1].endPre = goods.editPrices[index - 1].end;
-                    }
-                }//else {
-                //     if(commodity.editMinPackQty) {
-                //         if(commodity.editPrices[index].start % commodity.editMinPackQty != 0) {
-                //             commodity.editPrices[index].startInValid = false;
-                //             commodity.editPrices[index].start = commodity.editMinBuyQty;
-                //             commodity.editPrices[index].startPre = commodity.editMinBuyQty;
-                //             toaster.pop('warning', '提示', '第一个分段的起始量必须是倍数(' + commodity.editMinPackQty + ")的整数倍");
-                //         }else {
-                //             commodity.editMinBuyQty = commodity.editPrices[index].start;
-                //             commodity.editMinBuyQtyPre = commodity.editPrices[index].start;
-                //             commodity.editMinBuyQtyInValid = false;
-                //         }
-                //     }else {
-                //         commodity.editMinBuyQty = commodity.editPrices[index].start;
-                //         commodity.editMinBuyQtyPre = commodity.editMinBuyQty;
-                //         commodity.editPrices[index].startPre = commodity.editPrices[index].start;
-                //         commodity.editMinBuyQtyInValid = false;
-                //     }
-                // }
-            }
-        };
+      }
+      if(day > 31 || day < 1) {
+        if(!$scope.$$nonProduct.enterSaveButton) {
+          if(isMin) {
+            goods.editMinDeliveryinValid = true;
+          }else {
+            goods.editMaxDeliveryinValid = true;
+          }
+          toaster.pop('warning', '提示', '交期的值必须在1-31天');
+        }
+        return ;
+      }
+      if(Number(min) > Number(max)) {
+        if(!$scope.$$nonProduct.enterSaveButton) {
+          goods.editMinDeliveryinValid = true;
+          goods.editMaxDeliveryinValid = true;
+          toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
+        }
+        return ;
+      }
+      goods.editMinDeliveryinValid = false;
+      goods.editMaxDeliveryinValid = false;
+    };
+
+    /**
+     * 切换销售模式
+     */
+    $scope.changeSaleMode = function (goods) {
+      if(!goods || !goods.batchCode) {
+        return ;
+      }
+      StoreCms.validCommdityisAdvantageCommodity({batchcode : goods.batchCode}, function (data) {
+        if(data.code != 1) {
+          toaster.pop('warning', '提示', data.message);
+        }
+      }, function (response) {
+      });
+
+    };
+
+    /**
+     * 验证最短交期数据
+     *
+     * @param goods			商品信息
+     * @param type			交期类型
+     */
+    function checkMinDelivery(goods, type) {
+      if (goods.minDelivery == null) {
+        return ;
+      }
+      if (goods.minDelivery < 0 || goods.minDelivery > 31) {
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
+        return ;
+      }
+      if (goods.minDelivery && goods.minDelivery > goods.maxDelivery) {
+        toaster.pop('warning', '提示', '最短交期必须小于最长交期');
+        return ;
+      }
+      return true;
+    }
+
+    /**
+     * 验证最长交期数据
+     *
+     * @param goods			商品信息
+     * @param type			交期类型
+     */
+    function checkMaxDelivery(goods, type) {
+      if (goods.maxDelivery == null) {
+        return ;
+      }
+      if (goods.maxDelivery < 0 || goods.maxDelivery > 31) {
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
+        return ;
+      }
+      if (goods.maxDelivery && goods.minDelivery > goods.maxDelivery) {
+        toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
+        return ;
+      }
+      return true;
+    }
+    /**
+     * 是否可拆卖
+     * @param commodity
+     */
+    $scope.toggleIsBreadUp = function(goods, edit) {
+      goods.editBreakUp = !goods.editBreakUp;
+      if(!goods.editBreakUp) {
+        $scope.isNotBreakUp(goods);
+      }
+    };
+
+    /**
+     * 如果不拆分需要重新计算最小起订量的信息
+     * @param goods
+     */
+    $scope.isNotBreakUp = function (goods, edit) {
+      if (goods.editMinPackQty && goods.editMinBuyQty) {
+        var remainder = goods.editMinBuyQty % goods.editMinPackQty;
+        if (remainder != 0) {
+          toaster.pop('warning', '提示', '不可拆卖时,起订量必须是包装数量的倍数');
+          if (parseInt(goods.editMinBuyQty) > parseInt(goods.editMinPackQty)) {
+            goods.editMinBuyQty = Number(NumberService.sub(goods.editMinBuyQty, remainder));
+          } else {
+            goods.editMinBuyQty = goods.editMinPackQty;
+          }
+          goods.editPrices[0].start = goods.editMinBuyQty;
+        }
+      }
+    }
+
+    // 获取品牌联想词
+    $scope.getSimilarBrands = function(keyword) {
+      if (keyword) {
+        return Search.getSimilarBrands({keyword : keyword}).$promise.then(function(data) {
+          return data.map(function(item) {
+            return item;
+          });
+        });
+      }
+    };
+
+    // 选择品牌
+    $scope.onAssociateClickBrand = function (material, brand) {
+      BrandActiveAPI.getBrand({uuid: brand.uuid}, {} , function (data) {
+        material.submitProduct.brand = data;
+      }, function (response) {
+        toaster.pop('error', response.data);
+      });
+    };
+
+    // 获取器件联想词
+    $scope.getSimilarCmps = function(code) {
+      if (code) {
+        return Search.getSimilarComponents({keyword : code}).$promise.then(function(data) {
+          return data.map(function(item) {
+            return item;
+          })
+        });
+      }
+    };
+    // 选择器件
+    $scope.onAssociateClickCmp = function (material, cmp) {
+      $scope.submitProduct.component = cmp;
+      ComponentActiveAPI.get({uuid : cmp.uuid}, {}, function(data) {
+        var component = data;
+        $scope.submitProduct.brand = component.brand;
+        $scope.submitProduct.kind = component.kind;
+      });
+    };
+
+    // 获取末级类目联想词
+    $scope.getSimilarKinds = function(name) {
+      if (name) {
+        return Search.getSimilarLeafKinds({keyword: name}).$promise.then(function(data) {
+          return data.map(function(item) {
+            return item;
+          })
+        })
+      }
+    };
+
+    $scope.onAssociateClickKind = function (material, kind) {
+      $scope.submitProduct.kind = kind;
+    };
+
+    // 选择类目
+    $scope.selectKind = function() {
+      $modal.open({
+        animation: true,
+        size: 'lg',
+        templateUrl: 'static/view/prod/product_kindChoose_modal.html',
+        controller: 'KindChooseCtrl',
+        resolve: {
+          actives: function() {
+            return $scope.actives;
+          }
+        }
+      }).result.then(function(data){
+        $scope.submitProduct.kind = data.actives[data.actives.length - 1];
+      }, function(){
+
+      });
+    };
+
+    // 提交申请
+    $scope.submit = function (material) {
+      if (typeof material.submitProduct.brand == 'undefined' || material.submitProduct.brand.nameEn == null) {
+        toaster.pop('warning', '请填写品牌英文名');
+        return;
+      }
+      if (typeof material.submitProduct.brand.url == 'undefined' || material.submitProduct.brand.url == null) {
+        toaster.pop('warning', '请填写品牌官网');
+        return;
+      }
+      if (!material.pbranduuid) { // 品牌申请
+        if (typeof material.submitProduct.brand.brief == 'undefined' || material.submitProduct.brand.brief == null) {
+          toaster.pop('warning', '请填写品牌简介');
+          return;
+        }
+        if (typeof material.submitProduct.brand.series == 'undefined' || material.submitProduct.brand.series == null) {
+          toaster.pop('warning', '请填写主要产品');
+          return;
+        }
+        BrandSubmit.unstandardSubmit({}, material.submitProduct, function (data) {
 
-        /**
-         * 删除对应的分段.
-         * @param commodity
-         */
-        $scope.deleteFragment = function(goods, index) {
-            if (index > -1 && index < goods.editPrices.length) {
-                if (goods.editPrices.length < 2) {
-                    toaster.pop('warning', "提示", "商品至少需要一个分段");
-                    return ;
-                }
-                if (index < goods.editPrices.length - 1) { //不是最后一个分段
-                    var price = goods.editPrices.splice(index, 1);
-                    goods.editPrices[index].start = price[0].start;
-                } else if (index == goods.editPrices.length - 1) { //如果删除的是最后一个分段,
-                    var price = goods.editPrices.splice(index, 1);
-                    goods.editPrices[index -1].end = price[0].end;
-                }
-				if (goods.editMinBuyQty && $scope.isInt.test(goods.editMinBuyQty) &&
-					parseInt(goods.editPrices[0].end) >= parseInt(goods.editMinBuyQty)) {
-					if (goods.editMinBuyQtyInValid) {
-						goods.editMinBuyQtyInValid = false;
-						goods.editPrices[0].start = goods.editMinBuyQty;
-					}
-				}
-            }
-        };
+        }, function (response) {
 
-        /**
-         * 增加对应的分段。
-         * @param commodity
-         */
-        $scope.addFragment = function (goods) {
-            if(goods.editPrices.length > 2) {
-                toaster.pop('warning', "提示", "商品最多只能有三个分段");
-                return ;
-            }
-            var price = {};
-            price.start = null;
-            price.startPre = null;
-            price.end = goods.editPrices[goods.editPrices.length - 1].end;
-            price.endPre = price.end;
-            price.uSDPrice = null;
-            price.uSDPricePre = null;
-            price.rMBPrice = null;
-            price.rMBPricePre = null;
-            goods.editPrices[goods.editPrices.length - 1].end = null;
-            goods.editPrices[goods.editPrices.length - 1].endPre = null;
-            goods.editPrices.push(price);
-        }
-
-		/**
-		 * 修改字符串信息
-		 */
-		$scope.blurTag = function (goods) {
-			if (!goods.editTag) {
-				toaster.pop("warning", "自定义标签不能为空");
-			}
-			if (goods.editTag) {
-				Goods.getRepeatByTagAndProductId({goodId:goods.id, productId:goods.productid, tag:goods.editTag}, function (data) {
-					if (data.success) {
-						if (data.data) {
-							toaster.pop("warning", "该产品下已存在相同的自定义标签");
-						}
-					} else {
-						toaster.pop("error", data.message);
-					}
-				}, function (error) {
-					toaster.pop("error","判断标签重复请求错误" + error.date);
-				})
-			}
-		};
-
-		/**
-		 * 修改字符串信息,失去焦点
-		 */
-		$scope.changeTag = function (goods) {
-			var length = ByteCountService.strByteLength(goods.editTag);
-			if (length > 20) {
-				goods.editTag = goods.editTagPre;
-			} else {
-				goods.editTagPre = goods.editTag;
-			}
-		};
-
-
-        /**
-         * @param min 最小值
-         * @param max 最大值
-         * @param isMin 传入的是否是最小值
-         * @param commodity 批次信息
-         */
-        $scope.changeDelivery = function(min, max, isMin, goods) {
-			if(isMin) {
-				goods.editMinDeliveryinValid = false;
-			}else {
-				goods.editMaxDeliveryinValid = false;
-			}
-            var day = -1;
-            if(isMin) {
-                if(min && $scope.isInt.test(min)) {
-                    day = min;
-                }else {
-					if(typeof min == 'undefined') {
-						return ;
-					}
-                    if(!$scope.isInt.test(min)) {
-						if(!$scope.$$nonProduct.enterSaveButton) {
-							toaster.pop('warning', '提示', '交期请输入1-31的整数');
-							goods.editMinDeliveryinValid = true;
-						}
-                    }
-                    return ;
-                }
+        })
+      } else {
+        toaster.pop('enter component submit');
+        if (typeof material.submitProduct.component == 'undefined' || material.submitProduct.component.code == null) {
+          toaster.pop('warning', '请填写原厂型号');
+          return;
+        }
 
-            }else {
-                if(max && $scope.isInt.test(max)) {
-                    day = max;
-                }else {
-					if(typeof max == 'undefined') {
-						return ;
-					}
-                    if(!$scope.isInt.test(max)) {
-						if(!$scope.$$nonProduct.enterSaveButton) {
-							toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
-							goods.editMaxDeliveryinValid = true;
-						}
-                    }
-                    return ;
-                }
+        if (typeof material.submitProduct.kind == 'undefined' || material.submitProduct.kind.id == null) {
+          toaster.pop('warning', '请填写或选择商城已有类目');
+          return;
+        }
+        if ($scope.attachName == '') {
+          toaster.pop('warning', '请填上传规格书');
+          return;
+        } else {
+          material.submitProduct.attach = $scope.attachName;
+        }
 
-            }
-            if(day > 31 || day < 1) {
-				if(!$scope.$$nonProduct.enterSaveButton) {
-					if(isMin) {
-						goods.editMinDeliveryinValid = true;
-					}else {
-						goods.editMaxDeliveryinValid = true;
-					}
-					toaster.pop('warning', '提示', '交期的值必须在1-31天');
-				}
-                return ;
-            }
-            if(Number(min) > Number(max)) {
-				if(!$scope.$$nonProduct.enterSaveButton) {
-					goods.editMinDeliveryinValid = true;
-					goods.editMaxDeliveryinValid = true;
-					toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
-				}
-                return ;
-            }
-			goods.editMinDeliveryinValid = false;
-			goods.editMaxDeliveryinValid = false;
+        Material.submitProduct({}, material.submitProduct, function (data) {
+          if (data.data == '已存在此器件') {
+            toaster.pop('info',  '已存在此器件');
+          } else {
+            toaster.pop('info', data.data);
+          }
+        }, function (response) {
+          toaster.pop('error', response.data);
+        })
+      }
+    };
+
+    $scope.attachNameInfo = '';
+    //上传规格书
+    $scope.onAttachInput = function (event) {
+      $scope.attachNameInfo = event.target.files[0].name;
+    };
+    $scope.deleteAttach = function () {
+      $scope.attachNameInfo = '';
+    };
+
+    $scope.activeIndex = -1;
+
+    $scope.setActiveIndex = function (index,material) {
+      $scope.errorObj = [];
+      $scope.isInCodeList = [];
+      $scope.isInBrandList = [];
+      $scope.activeIndex = index;
+      if (material) {
+        $scope.ShowReminfo = false
+        $scope.editCmp = material.pcmpcode;
+        $scope.editBrand = material.pbranden;
+        var _arr =  normalChangeArr(angular.copy(material.productReplaceList));
+        $scope.replaceMaterialList = _arr.arr;
+        $scope.linearLength = _arr.headlength
+        $scope.replaceMaterialId = material.id;
+        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,editable: true}];
+          $scope.errorObj = [{
+            code: 0,
+            brand: 0
+          }];
+          $scope.linearLength = 1
+          $scope.isInCodeList = [false];
+          $scope.isInBrandList = [false];
+        } else if ($scope.linearLength == 0) {
+          $scope.replaceMaterialList.splice(0, 0, {
+            ptrCmpcode: '',
+            ptrBranden: '',
+            showSimilarCodeList: false,
+            showSimilarBrandList: false,
+            editable: true,
+            productId: $scope.replaceMaterialList[0].productId
+          })
+          $scope.errorObj.splice(0, 0, {
+            code: 0,
+            brand: 0
+          });
+          $scope.isInCodeList.splice(0, 0, false);
+          $scope.isInBrandList.splice(0, 0, false);
+          $scope.linearLength++;
+
+          if ($scope.replaceMaterialList.length > 5) {
+            $scope.ngLastFinished = true
+          }
+        }
+      } 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') {
+        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,
+            editable: true,
+            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);
+          $scope.linearLength++;
+          $scope.ngLastFinished = true
+        } else {
+          toaster.pop('error', '请填完整信息');
+        }
+      } else if (type === 'sub' && $scope.replaceMaterialList.length > 0 && $scope.linearLength > 0) {
+        var _productId = $scope.replaceMaterialList[0].productId
+        $scope.linearLength--;
+        $scope.replaceMaterialList.splice(index, 1);
+        $scope.errorObj.splice(index, 1);
+        $scope.isInCodeList.splice(index, 1);
+        $scope.isInBrandList.splice(index, 1);
+
+        if($scope.linearLength === 0) {
+          $scope.replaceMaterialList.splice(0, 0, {
+            ptrCmpcode: '',
+            ptrBranden: '',
+            showSimilarCodeList: false,
+            showSimilarBrandList: false,
+            editable: true,
+            productId: _productId
+          })
+          $scope.errorObj.splice(0, 0, {
+            code: 0,
+            brand: 0
+          });
+          $scope.linearLength++
+          console.log($scope.replaceMaterialList)
+        }
 
-        /**
-         * 切换销售模式
-         */
-        $scope.changeSaleMode = function (goods) {
-            if(!goods || !goods.batchCode) {
-                return ;
-            }
-            StoreCms.validCommdityisAdvantageCommodity({batchcode : goods.batchCode}, function (data) {
-                if(data.code != 1) {
-                    toaster.pop('warning', '提示', data.message);
-                }
-            }, function (response) {
-            });
-
-        };
+      }
+    }
 
-		/**
-		 * 验证最短交期数据
-		 *
-		 * @param goods			商品信息
-		 * @param type			交期类型
-		 */
-		function checkMinDelivery(goods, type) {
-			if (goods.minDelivery == null) {
-				return ;
-			}
-			if (goods.minDelivery < 0 || goods.minDelivery > 31) {
-				toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
-				return ;
-			}
-			if (goods.minDelivery && goods.minDelivery > goods.maxDelivery) {
-				toaster.pop('warning', '提示', '最短交期必须小于最长交期');
-				return ;
-			}
-			return true;
-		}
-
-		/**
-		 * 验证最长交期数据
-		 *
-		 * @param goods			商品信息
-		 * @param type			交期类型
-		 */
-		function checkMaxDelivery(goods, type) {
-			if (goods.maxDelivery == null) {
-				return ;
-			}
-			if (goods.maxDelivery < 0 || goods.maxDelivery > 31) {
-				toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
-				return ;
-			}
-			if (goods.maxDelivery && goods.minDelivery > goods.maxDelivery) {
-				toaster.pop('warning', '提示', '交期只能填写1-31之间的值');
-				return ;
-			}
-			return true;
-		}
-		/**
-		 * 是否可拆卖
-		 * @param commodity
-		 */
-		$scope.toggleIsBreadUp = function(goods, edit) {
-            goods.editBreakUp = !goods.editBreakUp;
-            if(!goods.editBreakUp) {
-                $scope.isNotBreakUp(goods);
-            }
-		};
-
-		/**
-		 * 如果不拆分需要重新计算最小起订量的信息
-		 * @param goods
-		 */
-		$scope.isNotBreakUp = function (goods, edit) {
-            if (goods.editMinPackQty && goods.editMinBuyQty) {
-                var remainder = goods.editMinBuyQty % goods.editMinPackQty;
-                if (remainder != 0) {
-					toaster.pop('warning', '提示', '不可拆卖时,起订量必须是包装数量的倍数');
-					if (parseInt(goods.editMinBuyQty) > parseInt(goods.editMinPackQty)) {
-						goods.editMinBuyQty = Number(NumberService.sub(goods.editMinBuyQty, remainder));
-					} else {
-						goods.editMinBuyQty = goods.editMinPackQty;
-					}
-					goods.editPrices[0].start = goods.editMinBuyQty;
-                }
-            }
-		}
-
-		// 获取品牌联想词
-		$scope.getSimilarBrands = function(keyword) {
-			if (keyword) {
-				return Search.getSimilarBrands({keyword : keyword}).$promise.then(function(data) {
-					return data.map(function(item) {
-						return item;
-					});
-				});
-			}
-		};
-
-		// 选择品牌
-		$scope.onAssociateClickBrand = function (material, brand) {
-			BrandActiveAPI.getBrand({uuid: brand.uuid}, {} , function (data) {
-				material.submitProduct.brand = data;
-			}, function (response) {
-				toaster.pop('error', response.data);
-			});
-		};
-
-		// 获取器件联想词
-		$scope.getSimilarCmps = function(code) {
-			if (code) {
-				return Search.getSimilarComponents({keyword : code}).$promise.then(function(data) {
-					return data.map(function(item) {
-						return item;
-					})
-				});
-			}
-		};
-		// 选择器件
-		$scope.onAssociateClickCmp = function (material, cmp) {
-			$scope.submitProduct.component = cmp;
-			ComponentActiveAPI.get({uuid : cmp.uuid}, {}, function(data) {
-				var component = data;
-				$scope.submitProduct.brand = component.brand;
-				$scope.submitProduct.kind = component.kind;
-			});
-		};
-
-		// 获取末级类目联想词
-		$scope.getSimilarKinds = function(name) {
-			if (name) {
-				return Search.getSimilarLeafKinds({keyword: name}).$promise.then(function(data) {
-					return data.map(function(item) {
-						return item;
-					})
-				})
-			}
-		};
-
-		$scope.onAssociateClickKind = function (material, kind) {
-			$scope.submitProduct.kind = kind;
-		};
-
-		// 选择类目
-		$scope.selectKind = function() {
-			$modal.open({
-				animation: true,
-				size: 'lg',
-				templateUrl: 'static/view/prod/product_kindChoose_modal.html',
-				controller: 'KindChooseCtrl',
-				resolve: {
-					actives: function() {
-						return $scope.actives;
-					}
-				}
-			}).result.then(function(data){
-				$scope.submitProduct.kind = data.actives[data.actives.length - 1];
-			}, function(){
-
-			});
-		};
-
-		// 提交申请
-		$scope.submit = function (material) {
-			if (typeof material.submitProduct.brand == 'undefined' || material.submitProduct.brand.nameEn == null) {
-				toaster.pop('warning', '请填写品牌英文名');
-				return;
-			}
-			if (typeof material.submitProduct.brand.url == 'undefined' || material.submitProduct.brand.url == null) {
-				toaster.pop('warning', '请填写品牌官网');
-				return;
-			}
-			if (!material.pbranduuid) { // 品牌申请
-				if (typeof material.submitProduct.brand.brief == 'undefined' || material.submitProduct.brand.brief == null) {
-					toaster.pop('warning', '请填写品牌简介');
-					return;
-				}
-				if (typeof material.submitProduct.brand.series == 'undefined' || material.submitProduct.brand.series == null) {
-					toaster.pop('warning', '请填写主要产品');
-					return;
-				}
-				BrandSubmit.unstandardSubmit({}, material.submitProduct, function (data) {
-
-				}, function (response) {
-
-				})
-			} else {
-				toaster.pop('enter component submit');
-				if (typeof material.submitProduct.component == 'undefined' || material.submitProduct.component.code == null) {
-					toaster.pop('warning', '请填写原厂型号');
-					return;
-				}
-
-				if (typeof material.submitProduct.kind == 'undefined' || material.submitProduct.kind.id == null) {
-					toaster.pop('warning', '请填写或选择商城已有类目');
-					return;
-				}
-				if ($scope.attachName == '') {
-					toaster.pop('warning', '请填上传规格书');
-					return;
-				} else {
-					material.submitProduct.attach = $scope.attachName;
-				}
-
-				Material.submitProduct({}, material.submitProduct, function (data) {
-					if (data.data == '已存在此器件') {
-						toaster.pop('info',  '已存在此器件');
-					} else {
-						toaster.pop('info', data.data);
-					}
-				}, function (response) {
-					toaster.pop('error', response.data);
-				})
-			}
-		};
-
-		$scope.attachNameInfo = '';
-		//上传规格书
-		$scope.onAttachInput = function (event) {
-			$scope.attachNameInfo = event.target.files[0].name;
-		};
-		$scope.deleteAttach = function () {
-			$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);
-				$scope.replaceMaterialId = material.id;
-				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 > 0) {
-				$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;
+    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 (brand && getRealLen(brand) > 50) {
+        $scope.replaceMaterialList[index].ptrBranden = cutOutString(brand, 50);
+      } else 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) {
+          $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);
+    }
+
+    // 计算下拉的ul 位置
+    $scope.ulEl = null
+    $scope.ultype = ''
+    $scope.inputEl = null
+    $scope.inputkey = null
+    $scope.onFocus = function($event, index, type, key) {
+      $scope.ulEl = angular.element('.'+index);
+      $scope.ultype = type
+      $scope.inputEl = $event
+      key+=1
+      $scope.inputkey = key
+      caleUllist($scope.inputEl,$scope.ultype,$scope.inputkey,$scope.ulEl)
+    }
+    // 针对当前人员权限重组list
+    var normalChangeArr = function(arr) {
+      $scope.ShowReminfo = false
+      var _arr = arr.slice()
+      var _headArr = [];
+      var _lastArr = [];
+      _arr.forEach(function(obj, index){
+        if (!obj.editable) {
+          _lastArr.push(obj)
+          $scope.ShowReminfo = true
+        } else {
+          _headArr.push(obj)
+        }
+      })
+      return {
+        arr:_headArr.concat(_lastArr),
+        headlength: _headArr.length
+      }
+    }
+
+    angular.element(window).resize(function() {
+      if(!$scope.inputEl){ return false}
+      caleUllist($scope.inputEl,$scope.ultype,$scope.inputkey,$scope.ulEl)
+    })
+
+    function caleUllist($event,type,key,el){
+      var _scrollTop = angular.element('.edit-replace-box .content').scrollTop()
+      var _hl = angular.element('.edit-replace-box .content .content-line')[key] ? angular.element('.edit-replace-box .content .content-line')[key].offsetTop : 0
+      var _wl = (angular.element('body').width() - angular.element('.edit-replace-box').width()) / 2
+      var _bl = angular.element(window).height() * 0.2  + angular.element('.edit-replace-box .title').height()
+      var Y = _bl + _hl + 28 - _scrollTop, X
+      if(type == 'brand') {
+        X = _wl + $event.currentTarget.offsetLeft - 11
+        el.css({
+          right: X,
+          top: Y
+        })
+      }else {
+        X = _wl + $event.currentTarget.offsetLeft
+        el.css({
+          left: X,
+          top: Y
+        })
+      }
+    }
+
+    $scope.$on('ngRepeatFinished', function(ngRepeatFinishedEvent) {
+      if ($scope.replaceMaterialList.length > 5 && $scope.ngLastFinished == true) {
+        var el = angular.element('.edit-replace-box .content')
+        el.scrollTop(el.scrollTop() + 42)
+        $scope.ngLastFinished = false
+      }
+    })
+  }])
+
+  //类目选择模态框
+  app.register.controller('KindChooseCtrl', ['$scope', 'KindAPI', 'actives', 'toaster', '$modalInstance', function($scope, KindAPI, actives, toaster, $modalInstance) {
+    $scope.actives = actives;
+    $scope.kinds = [[], [], [], []];
+    // 获取子类目
+    var getChildren = function(pid, deep) {
+      KindAPI.getChildren({parentId: pid}, function(data) {
+        $scope.kinds[deep] = data;
+      }, function(response) {
+        toaster.pop('error', '获取子类目失败', response.data);
+      });
+    };
+
+    // 改变节点选中状态
+    var changeStatus = function(item, deep) {
+      var actives = [], level = 0;
+      angular.forEach($scope.kinds, function(ks, i) {
+        if(i > deep) {
+          $scope.kinds[i] = [];
+        } else {
+          angular.forEach(ks, function(k, j) {
+            if(i == deep) {
+              if(k.id == item.id) {
+                $scope.kinds[i][j].$active = true;
+                actives.push(k);
+              } else {
+                k.$active = null;
+              }
+            } else {
+              if(k.$active) {
+                actives.push(k);
+              }
             }
-			$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 (brand && getRealLen(brand) > 50) {
-				$scope.replaceMaterialList[index].ptrBranden = cutOutString(brand, 50);
-			} else 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) {
-					$scope.setShowSimilarBrandList(false, index);
-				} else {
-					$scope.getSimilarBrand(brand, index);
-				}
-			}
-		}
-		$scope.onCodeBlur = function (index) {
-            if ($scope.replaceMaterialList[index].ptrCmpcode) {
-				$scope.errorObj[index].code = 0;
+          });
+        }
+      });
+      // 选择的节点
+      $scope.actives = actives;
+      $scope.active = item;
+      // 当前可操作的层级
+      if(deep < 3) {
+        $scope.activeDeep = deep + 1;
+      }
+    };
+
+    // 节点点击后获取子类目,节点被选中
+    $scope.onItemClick = function(item, deep) {
+      changeStatus(item, deep);
+      if (!item.isLeaf) {
+        getChildren(item.id, deep + 1);
+      }
+    };
+
+    // 重新加载数据
+    function reload(deep) {
+      var pid;
+      if(deep) {
+        pid = $scope.actives[deep - 1].id;
+      } else {
+        pid = 0;
+        deep = 0;
+      }
+      getChildren(pid, deep);
+    }
+
+    // 初始加载数据,获取第一层的类目
+    if($scope.actives) {
+      angular.forEach($scope.actives, function(v, k) {
+        KindAPI.getChildren({parentId: v.parentid}, function(data) {
+          $scope.kinds[k] = data;
+          angular.forEach($scope.kinds[k], function(kind, i){
+            if(kind.id == v.id) {
+              $scope.kinds[k][i].$active = true;
+              $scope.actives[k] = $scope.kinds[k][i];
             }
-			$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;
-		// 		}
-		// 	}
-		// }
-	}]);
-
-	//类目选择模态框
-	app.register.controller('KindChooseCtrl', ['$scope', 'KindAPI', 'actives', 'toaster', '$modalInstance', function($scope, KindAPI, actives, toaster, $modalInstance) {
-		$scope.actives = actives;
-		$scope.kinds = [[], [], [], []];
-		// 获取子类目
-		var getChildren = function(pid, deep) {
-			KindAPI.getChildren({parentId: pid}, function(data) {
-				$scope.kinds[deep] = data;
-			}, function(response) {
-				toaster.pop('error', '获取子类目失败', response.data);
-			});
-		};
-
-		// 改变节点选中状态
-		var changeStatus = function(item, deep) {
-			var actives = [], level = 0;
-			angular.forEach($scope.kinds, function(ks, i) {
-				if(i > deep) {
-					$scope.kinds[i] = [];
-				} else {
-					angular.forEach(ks, function(k, j) {
-						if(i == deep) {
-							if(k.id == item.id) {
-								$scope.kinds[i][j].$active = true;
-								actives.push(k);
-							} else {
-								k.$active = null;
-							}
-						} else {
-							if(k.$active) {
-								actives.push(k);
-							}
-						}
-					});
-				}
-			});
-			// 选择的节点
-			$scope.actives = actives;
-			$scope.active = item;
-			// 当前可操作的层级
-			if(deep < 3) {
-				$scope.activeDeep = deep + 1;
-			}
-		};
-
-		// 节点点击后获取子类目,节点被选中
-		$scope.onItemClick = function(item, deep) {
-			changeStatus(item, deep);
-			if (!item.isLeaf) {
-				getChildren(item.id, deep + 1);
-			}
-		};
-
-		// 重新加载数据
-		function reload(deep) {
-			var pid;
-			if(deep) {
-				pid = $scope.actives[deep - 1].id;
-			} else {
-				pid = 0;
-				deep = 0;
-			}
-			getChildren(pid, deep);
-		}
-
-		// 初始加载数据,获取第一层的类目
-		if($scope.actives) {
-			angular.forEach($scope.actives, function(v, k) {
-				KindAPI.getChildren({parentId: v.parentid}, function(data) {
-					$scope.kinds[k] = data;
-					angular.forEach($scope.kinds[k], function(kind, i){
-						if(kind.id == v.id) {
-							$scope.kinds[k][i].$active = true;
-							$scope.actives[k] = $scope.kinds[k][i];
-						}
-					})
-				}, function(response) {
-					toaster.pop('error', '获取子类目失败', response.data);
-				});
-			});
-		} else {
-			reload();
-		}
-
-		// 取消
-		$scope.cancel = function() {
-			$modalInstance.dismiss();
-		};
-
-		// 确认选择
-		$scope.check = function() {
-			var a = {
-				active: $scope.active,
-				actives: $scope.actives
-			};
-			$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;
-		}
-	}]);
-
-
-
-	//批量删除信息
-	app.register.controller('vendor_delete_person_ctrl', ['$scope', 'ids', 'Goods', 'Material', 'toaster', 'deleteMaterial', 'deleteGoods', 'selectAll', 'ProductServiceQuery', 'standard_tab', '$modalInstance', 'message', function ($scope, ids, Goods, Material, toaster, deleteMaterial, deleteGoods, selectAll, ProductServiceQuery, standard_tab, $modalInstance, message) {
-		$scope.deleteModal = true;
-        $scope.message = message;
-
-        $scope.ids = ids;
-
-        // 确认删除
-        $scope.confirmDelete = function () {
-            if(deleteMaterial) {
-                if(selectAll) {
-
-                        Material.deleteStandardAll({isPerson: 1}, function (data) {
-                            if(data.code != 1) {
-                                toaster.pop('error','错误' ,data.message);
-                            }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);
-                                    }
-                                }, function (response) {
-                                    toaster.pop('error', '错误', response.data);
-                                });
-                            }
-                        }, function (response) {
-                            toaster.pop('error', '错误', response.data);
-                        });
+          })
+        }, function(response) {
+          toaster.pop('error', '获取子类目失败', response.data);
+        });
+      });
+    } else {
+      reload();
+    }
+
+    // 取消
+    $scope.cancel = function() {
+      $modalInstance.dismiss();
+    };
+
+    // 确认选择
+    $scope.check = function() {
+      var a = {
+        active: $scope.active,
+        actives: $scope.actives
+      };
+      $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;
+    }
+  }]);
 
+
+
+  //批量删除信息
+  app.register.controller('vendor_delete_person_ctrl', ['$scope', 'ids', 'Goods', 'Material', 'toaster', 'deleteMaterial', 'deleteGoods', 'selectAll', 'ProductServiceQuery', 'standard_tab', '$modalInstance', 'message', function ($scope, ids, Goods, Material, toaster, deleteMaterial, deleteGoods, selectAll, ProductServiceQuery, standard_tab, $modalInstance, message) {
+    $scope.deleteModal = true;
+    $scope.message = message;
+
+    $scope.ids = ids;
+
+    // 确认删除
+    $scope.confirmDelete = function () {
+      if(deleteMaterial) {
+        if(selectAll) {
+
+          Material.deleteStandardAll({isPerson: 1}, function (data) {
+            if(data.code != 1) {
+              toaster.pop('error','错误' ,data.message);
+            }else {
+              Material.deleteUnstandardAll({isPerson: 1}, function (data) {
+                if(data.code != 1) {
+                  toaster.pop('error', '错误', data.message);
                 }else {
-                    if(!$scope.ids || $scope.ids.length == 0) {
-                        toaster.pop('warning', '提示','请选择要删除的信息');
-                        return ;
-                    }
-                    var idStr = $scope.ids.join(',');
-                    Material.deleteBatch({ids : idStr, isPerson: 1}, function (data) {
-                        toaster.pop('success', '删除成功');
-						$scope.deleteModal = false;
-                        $modalInstance.close(data);
-                    }, function (response) {
-                        toaster.pop('error', response.data);
-                    });
+                  toaster.pop('success', '删除成功');
+                  $scope.deleteModal = false;
+                  $modalInstance.close(data);
                 }
-            }else if(deleteGoods){
-                if(!$scope.ids || $scope.ids.length < 1) {
-                    return ;
-                }
-                Goods.deleteGoodsById({id: $scope.ids[0]}, function (data) {
-                    ProductServiceQuery.getProductById({id: data.productid}, function (response) {
-						$scope.deleteModal = false;
-                        $modalInstance.close(response);
-                        toaster.pop('success', '提示', '删除成功');
-                    }, function (response) {
-                        toaster.pop('error', '错误', response.data);
-                    });
-                }, function (response) {
-                    toaster.pop('error',  '错误', response.data);
-                });
+              }, function (response) {
+                toaster.pop('error', '错误', response.data);
+              });
             }
-        };
-
-
-        $scope.cancleDelete = function () {
-			$scope.deleteModal = false;
+          }, function (response) {
+            toaster.pop('error', '错误', response.data);
+          });
+
+        }else {
+          if(!$scope.ids || $scope.ids.length == 0) {
+            toaster.pop('warning', '提示','请选择要删除的信息');
+            return ;
+          }
+          var idStr = $scope.ids.join(',');
+          Material.deleteBatch({ids : idStr, isPerson: 1}, function (data) {
+            toaster.pop('success', '删除成功');
+            $scope.deleteModal = false;
+            $modalInstance.close(data);
+          }, function (response) {
+            toaster.pop('error', response.data);
+          });
+        }
+      }else if(deleteGoods){
+        if(!$scope.ids || $scope.ids.length < 1) {
+          return ;
+        }
+        Goods.deleteGoodsById({id: $scope.ids[0]}, function (data) {
+          ProductServiceQuery.getProductById({id: data.productid}, function (response) {
+            $scope.deleteModal = false;
+            $modalInstance.close(response);
+            toaster.pop('success', '提示', '删除成功');
+          }, function (response) {
+            toaster.pop('error', '错误', response.data);
+          });
+        }, function (response) {
+          toaster.pop('error',  '错误', response.data);
+        });
+      }
+    };
+
+
+    $scope.cancleDelete = function () {
+      $scope.deleteModal = false;
+      $modalInstance.dismiss();
+    };
+
+    /**
+     * 监听点击的事件
+     */
+    document.onclick = function (event) {
+      if($scope.deleteModal) {
+        if(event) {
+          var tag = event.target;
+          if(tag) {
+            var attribute = tag.getAttribute("name");
+            while(tag.nodeName != 'BODY') {
+              if((attribute == 'comfirm-delete-modal') ||
+                  attribute == 'delete-material' || attribute == 'delete-goods') {
+                return ;
+              }
+              tag = tag.parentElement;
+              attribute = tag.getAttribute("name");
+            }
+            $scope.deleteModal = false;
             $modalInstance.dismiss();
-        };
-
-        /**
-         * 监听点击的事件
-         */
-        document.onclick = function (event) {
-			if($scope.deleteModal) {
-				if(event) {
-					var tag = event.target;
-					if(tag) {
-						var attribute = tag.getAttribute("name");
-						while(tag.nodeName != 'BODY') {
-							if((attribute == 'comfirm-delete-modal') ||
-								attribute == 'delete-material' || attribute == 'delete-goods') {
-								return ;
-							}
-							tag = tag.parentElement;
-							attribute = tag.getAttribute("name");
-						}
-						$scope.deleteModal = false;
-						$modalInstance.dismiss();
-					}
-				}
-			}
-        };
-	}]);
-});
+          }
+        }
+      }
+    };
+  }]);
+})

+ 2 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_apply_ctrl.js

@@ -469,7 +469,8 @@ define(['app/app', 'jquery-uploadify'], function (app) {
 					toaster.pop('success', '感谢您对优软商城的支持,我们会尽快对您提交的信息进行审核,预计审核时间为3个工作日,审核结果将以站内消息及邮件形式通知您!');
 					$rootScope.applyStatus = 'PREPARE';
 					$timeout(function () {
-						window.location.reload();
+						//window.location.href=$scope.rootPath+'/vendor#/store-apply/wait';
+                        $state.go('vendor_store_wait');
 					}, 1000);
 				} else {
 					if (result.code == 6) {

+ 62 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_maintain_ctrl.js

@@ -75,8 +75,13 @@ define(['app/app'], function (app) {
 			$scope.sampleStore.storeShortName = $scope.storeInfo.storeShortName;
             $scope.sampleStore.storeName = $scope.storeInfo.storeName;
 			$scope.sampleStore.description = $scope.storeInfo.description;
+
+            $scope.sampleStore.enPhone = '';
+            $scope.sampleStore.enWeixin = '';
+            $scope.sampleStore.enQQ = '';
+
 			$scope.sampleStore.enterprise = angular.copy($scope.storeInfo.enterprise);
-			$scope.sampleStore.enterprise.address = $scope.sampleStore.enterprise.address || $scope.storeInfo.enterprise.enAddress;
+			$scope.sampleStore.enterprise.address = $scope.sampleStore.enterprise.address;
 			qulifications = angular.copy($scope.storeInfo.qualifications);
 			$scope.sampleStore.qualifications = qulifications.filter(function (qualification) {
 				return qualification && qualification.type == 'APTITUDE';
@@ -160,7 +165,7 @@ define(['app/app'], function (app) {
                 $scope.sampleStore.storeName = $scope.storeInfo.storeName;
 				$scope.sampleStore.description = $scope.storeInfo.description;
 				$scope.sampleStore.enterprise = angular.copy($scope.storeInfo.enterprise);
-				$scope.sampleStore.enterprise.address = $scope.sampleStore.enterprise.address || $scope.storeInfo.enterprise.enAddress;
+				$scope.sampleStore.enterprise.address = $scope.sampleStore.enterprise.address;
 				return $scope.closeEdit(module);
 			}
 			if (module == 'QUALIFICATIONS') {
@@ -205,10 +210,49 @@ define(['app/app'], function (app) {
 			});
 		};
 
+        /**
+		 * 验证手机号
+         */
+		$scope.checkPhone = function () {
+            var enPhone = angular.element('.enPhone').val();
+            if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(enPhone) && enPhone) {
+                toaster.pop('error', '请输入正确的手机号码');
+                return false;
+            }
+
+        }
+
+        /**
+         * 验证微信号
+         */
+        $scope.checkWeixin = function () {
+            var enWeixin = angular.element('.enWeixin').val();
+            if (!/^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/.test(enWeixin) && enWeixin) {
+                toaster.pop('error', '请输入正确的微信号');
+                return false;
+            }
+
+        }
+
+        /**
+         * 验证QQ号
+         */
+        $scope.checkQQ = function () {
+            var enQQ = angular.element('.enQQ').val();
+            if (!/^[1-9][0-9]{4,10}$/.test(enQQ) && enQQ) {
+                toaster.pop('error', '请输入正确的QQ号');
+                return false;
+            }
+
+        }
+
 		/**
 		 * 验证修改的基础信息
 		 */
 		var validateBasicInfo = function () {
+            var enPhone = angular.element('.enPhone').val();
+            var enWeixin = angular.element('.enWeixin').val();
+            var enQQ = angular.element('.enQQ').val();
 			if (!$scope.sampleStore) {
 				toaster.pop('error', '店铺信息不能为空');
 				return false;
@@ -233,6 +277,21 @@ define(['app/app'], function (app) {
 				toaster.pop('error', '请输入正确的电话号码');
 				return false;
 			}
+
+
+            if (!/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(enPhone) && enPhone) {
+                toaster.pop('error', '请输入正确的手机号码');
+                return false;
+            }
+
+            if (!/^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/.test(enWeixin) && enWeixin) {
+                toaster.pop('error', '请输入正确的微信号');
+                return false;
+            }
+            if (!/^[1-9][0-9]{4,10}$/.test(enQQ) && enQQ) {
+                toaster.pop('error', '请输入正确的QQ号');
+                return false;
+            }
 			/*if (!$scope.sampleStore.enterprise.enFax || $scope.sampleStore.enterprise.enFax == '') {
 				toaster.pop('error', '请输入正确的企业传真');
 				return false;
@@ -690,6 +749,7 @@ define(['app/app'], function (app) {
 			$scope.recommendProducts[$scope.selectedOneProductIndex] = { exist: false, order: $scope.selectedOneProductIndex + 1 };
 			cancelDeleteOneProduct();
 		}
+
 	}]);
 
 });

File diff suppressed because it is too large
+ 6 - 0
src/main/webapp/resources/lib/clipboard.min.js


File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/resources/lib/qrcode.min.js


+ 2 - 2
src/main/webapp/resources/view/admin/store/fragments/enterprise_info.html

@@ -223,8 +223,8 @@
 			<div class="col-md-4" ng-bind="store.auditInfo.representative"></div>
 		</div>
 		<div class="row">
-			<div class="col-md-2">企业简称</div>
-			<div class="col-md-4" ng-bind="store.enterprise.enShortname">优软商城</div>
+		<!--	<div class="col-md-2">企业简称</div>
+			<div class="col-md-4" ng-bind="store.enterprise.enShortname">优软商城</div>-->
 			<div class="col-md-2">信用代码</div>
 			<div class="col-md-4" ng-bind="store.auditInfo.creditCode">231313654541521313</div>
 		</div>

+ 2 - 2
src/main/webapp/resources/view/admin/store_application_maintenance.html

@@ -202,7 +202,7 @@
 			<tr>
 				<th width="50">序号</th>
 				<th>店铺名称</th>
-				<th>店铺简称</th>
+			<!--	<th>店铺简称</th>-->
 				<th>店铺类型</th>
 				<th>
 					<p ng-click="changeShorting()" style="margin: 0;">申请日期
@@ -220,7 +220,7 @@
 			<tr ng-repeat="application in $data ">
 				<td ng-bind="$index + (applicationTableParams.page()-1 )* 10 + 1"></td>
 				<td ng-bind="application.storeName" class="text-left"></td>
-				<td ng-bind="application.storeShortName"></td>
+				<!--<td ng-bind="application.storeShortName"></td>-->
 				<td ng-bind="application.type | storeType"></td>
 				<td>{{application.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
 				<td>

+ 4 - 4
src/main/webapp/resources/view/common/sidebar.html

@@ -379,12 +379,12 @@
 			</div>
 		</li>
 		<!-- TODO huxz IM暂时不放出 -->
-		<li ng-controller="WebChatCtrl">
-			<a href="javascript:void(0)" ng-click="goWebChat()" style="width: 36px; height: 38px; line-height: 30px;"><i class="fa fa-comments-o" aria-hidden="true" style="font-size: 18px;color: #FFFFFF;"></i><!--ng-class="{ 'fa-comments': countData > 0, 'fa-comments-o': countData <= 0 }"-->
-				<i class="remind-point" ng-if="countData > 0"></i><!--<img src="static/img/icon/talk.png"/>-->
+	<!--	<li ng-controller="WebChatCtrl">
+			<a href="javascript:void(0)" ng-click="goWebChat()" style="width: 36px; height: 38px; line-height: 30px;"><i class="fa fa-comments-o" aria-hidden="true" style="font-size: 18px;color: #FFFFFF;"></i>&lt;!&ndash;ng-class="{ 'fa-comments': countData > 0, 'fa-comments-o': countData <= 0 }"&ndash;&gt;
+				<i class="remind-point" ng-if="countData > 0"></i>&lt;!&ndash;<img src="static/img/icon/talk.png"/>&ndash;&gt;
 			</a>
 			<div class="massage sidebar-menu" style="width: 100px;" title="优软客服">优软互联<em><span ng-if="userInfo">(<span ng-bind="countData || 0 | number"></span>)</span></em></div>
-		</li>
+		</li>-->
 		<!--<li ng-controller="ScrollToTopCtrl">-->
 			<!--<a href="javascript:void(0)" ng-click="scrollToTop()"><img src="static/img/icon/top.png"/></a>-->
 			<!--<div class="sidebar-menu" style="width: 100px">返回顶部</div>-->

+ 9 - 0
src/main/webapp/resources/view/common/store_header.html

@@ -330,6 +330,15 @@
 							<li ng-if="storeInfo.enterprise.enFax.length > 0">
 								<span>传真:</span><span ng-bind="storeInfo.enterprise.enFax"></span>
 							</li>
+							<li ng-if="storeInfo.enterprise.enPhone.length > 0">
+								<span>手机:</span><span ng-bind="storeInfo.enterprise.enPhone"></span>
+							</li>
+							<li ng-if="storeInfo.enterprise.enWeixin.length > 0">
+								<span>微信:</span><span ng-bind="storeInfo.enterprise.enWeixin"></span>
+							</li>
+							<li ng-if="storeInfo.enterprise.enQQ.length > 0">
+								<span>QQ:</span><span ng-bind="storeInfo.enterprise.enQQ"></span>
+							</li>
 							<li ng-if="storeInfo.enterprise.enAddress.length > 0">
 								<span>地址:</span><span ng-bind="storeInfo.enterprise.enAddress"></span>
 							</li>

+ 6 - 3
src/main/webapp/resources/view/store/default/contact.html

@@ -22,10 +22,13 @@
 		<div ng-if="storeInfo.enterprise">
 			<div class="contact-text">
 				<div ng-bind="storeInfo.enterprise.enName">深圳市华商龙商务互联科技有限公司</div>
-				<div ng-if="storeInfo.enterprise.enAddress.length >0">地址:<span ng-bind="storeInfo.enterprise.enAddress">深圳市南山区科技园科技南五路英唐大厦一楼</span></div>
 				<div ng-if="storeInfo.enterprise.enTel.length >0">电话:<span ng-bind="storeInfo.enterprise.enTel">0755-26038000/26038047/26038008/86140880</span></div>
-				<div ng-if="storeInfo.enterprise.enFax.length > 0">传真:<span ng-bind="storeInfo.enterprise.enFax">0755-26038111</span></div>
-			</div>
+                <div ng-if="storeInfo.enterprise.enFax.length > 0">传真:<span ng-bind="storeInfo.enterprise.enFax">0755-26038111</span></div>
+                <div ng-if="storeInfo.enterprise.enPhone.length > 0">手机:<span ng-bind="storeInfo.enterprise.enPhone"></span></div>
+                <div ng-if="storeInfo.enterprise.enWeixin.length > 0">微信:<span ng-bind="storeInfo.enterprise.enWeixin"></span></div>
+                <div ng-if="storeInfo.enterprise.enQQ.length > 0">QQ:<span ng-bind="storeInfo.enterprise.enQQ"></span></div>
+                <div ng-if="storeInfo.enterprise.enAddress.length >0">地址:<span ng-bind="storeInfo.enterprise.enAddress">深圳市南山区科技园科技南五路英唐大厦一楼</span></div>
+            </div>
 		</div>
 	</div>
 </div>

+ 23 - 0
src/main/webapp/resources/view/usercenter/forstore/account_manager.html

@@ -160,6 +160,29 @@
 	 .empty .empty-info i{
 		margin-right:5px;
 	}
+	.oder01 ul li{
+		margin-left: 0px;
+		position: relative;
+	}
+	.oder01 ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.oder01 ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.oder01 ul li.active:after{
+		display: block
+	}
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr" id="account_manager">

+ 140 - 12
src/main/webapp/resources/view/usercenter/forstore/bomDetail.html

@@ -96,6 +96,7 @@
     .seek-purchase .seek-purchase-content >table {
         width: 1000px;
         margin: 0 auto;
+        position: relative;
     }
     .seek-purchase .seek-purchase-content >table >thead {
         background: #89aefa;
@@ -120,26 +121,36 @@
         left: 10px;
     }
     .seek-purchase .seek-purchase-content >table >tbody {
+        border-right: 1px solid #dae5fd;
         border-left: 1px solid #dae5fd;
         border-bottom: 1px solid #dae5fd;
     }
-    .seek-purchase .seek-purchase-content >table >tbody tr.default-row td:last-child {
-        border-right: 1px solid #dae5fd;
-    }
     .seek-purchase .seek-purchase-content >table >tbody >tr.default-row {
         border-bottom: 1px solid #dae5fd;
+        position: relative;
     }
     .seek-purchase .seek-purchase-content >table >tbody >tr.default-row:hover {
         background: #f1f5ff;
     }
+    .seek-purchase .seek-purchase-content >table >tbody >tr.default-row:hover  .sharecode{
+        display: block
+    }
     .seek-purchase .seek-purchase-content >table >tbody >tr.default-row td {
         font-size: 14px;
         text-align: center;
         height: 100%;
     }
+    .seek-purchase .seek-purchase-content >table >tbody >tr.default-row td.operate-seek{
+        text-align: left;
+        text-indent: 12px;
+        border-right: 1px solid #dae5fd;
+        line-height: 68px;
+    }
     .seek-purchase .seek-purchase-content >table >tbody >tr.default-row td.operate-seek >span {
         color: #4290f7;
         cursor: pointer;
+        margin-left: 12px;
+        text-align: left;
     }
     .seek-purchase .red-text {
         color: #f62d37;
@@ -324,9 +335,6 @@
         margin: 0 0 18px 0;
     }
     /*提示框样式 end*/
-    .seek-purchase .seek-purchase-content >table >tbody.pager-tbody {
-        border: none;
-    }
     .seek-purchase .seek-purchase-content >table >tbody tr.pager-row td div {
         text-align: right;
         padding-right: 15px;
@@ -432,6 +440,108 @@
         width: 414px;
         margin-left: 50px;
     }
+    .seek-purchase .sharecode {
+        /*position: absolute;*/
+        display: none;
+        right: 0;
+        top: 0;
+        /*z-index: 99;*/
+        text-indent: 0 !important;
+        text-align: center;
+        float: right
+    }
+    .seek-purchase .sharecode .sharecodeBtn {
+        width: 28px;
+        height: 28px;
+        margin-top: 2px;
+    }
+    .seek-purchase .sharecode .sharecodeBtn img {
+        float: left;
+    }
+    .seek-purchase .sharecode .sharecodeBtn::after {
+        content: ' ';
+        clear: both;
+        display: inline;
+        visibility: hidden;
+    }
+    .seek-purchase .sharecode .sharecodeT {
+        padding-top: 2px;
+        margin-top: 2px;
+        width: 28px;
+        height: 34px;
+        background-color: #3c7cf5;
+        border-radius: 2px;
+        color: #ffffff;
+        font-size: 14px;
+        word-wrap: break-word;
+        white-space: pre-wrap;
+        line-height: 14px;
+    }
+    .seek-purchase .sharescancodekuang {
+        width: 100%;
+        height: 220px;
+        position: absolute;
+        top: 110px;
+        left: 0px;
+        background: rgba(0, 0, 0, 0);
+        height: 220px !important;
+
+    }
+    .seek-purchase .sharescancode {
+        position: absolute;
+        background: url('static/img/user/images/codebg.png');
+        width: 248px;
+        height: 207px;
+        top: 0px;
+        right: 0px;
+        z-index: 98;
+        display: none;
+        line-height: 14px;
+    }
+    .seek-purchase .sharescancode canvas {
+        display: block;
+        text-align: center;
+        margin: 0 auto;
+        line-height: 14px;
+    }
+    .seek-purchase .sharescancode .title {
+        color: #3c7cf5;
+        font-size: 16px;
+        margin: 21px auto;
+        margin-bottom: 0px;
+        text-align: center;
+        line-height: 14px;
+    }
+    .seek-purchase .sharescancode div input {
+        display: inline-block;
+        width: 140px;
+        overflow: hidden;
+        height: 35px;
+        vertical-align: middle;
+        margin-left: 14px;
+        line-height: 35px;
+    }
+    .seek-purchase .sharescancode div span {
+        display: inline-block;
+        color: #fff;
+        background: #4290f7;
+        height: 36px;
+        line-height: 36px;
+        width: 70px;
+        font-style: normal;
+        vertical-align: middle;
+        cursor: pointer;
+        text-align: center;
+        text-indent: 0px;
+    }
+    .seek-purchase .sharescancode img{
+        margin: 0 auto;
+        text-align: center;
+    }
+    .seek-purchase .sharescancode .qrccode{
+        margin: 15px auto;
+        margin-bottom: 10px
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
@@ -524,9 +634,9 @@
             <thead>
             <tr>
                 <th width="102">发布时间</th>
-                <th width="670">产品信息</th>
-                <th width="132">截止时间</th>
-                <th width="96">状态</th>
+                <th width="650">产品信息</th>
+                <th width="112">截止时间</th>
+                <th width="136">状态</th>
                     <!--
                     <select class="select-adder form-control" ng-model="searchStatus" ng-change="onSearch(searchStatus)">
                         <option value="0">全部</option>
@@ -535,6 +645,8 @@
                         <option value="202">已采纳</option>
                     </select>
                     -->
+                    <!--状态-->
+                </th>
                 <!--
                 <th width="92">操作</th>
                 -->
@@ -566,9 +678,25 @@
                 </td>
                 <td class="left-time" ng-if="seek.remainingTime > 0">剩余&nbsp;<span ng-bind="getDay(seek.remainingTime)" ng-if="getDay(seek.remainingTime) > 0" class="red-text"></span><i ng-if="getDay(seek.remainingTime) > 0">&nbsp;天&nbsp;</i><span ng-if="getDay(seek.remainingTime) <= 0" ng-bind="getHours(seek.remainingTime)" class="red-text">5</span><i ng-if="getDay(seek.remainingTime) <= 0">&nbsp;小时</i></td>
                 <td class="left-time" ng-if="seek.remainingTime <= 0"><span style="color: red;">已截止</span></td>
-                <td>
+                <td class="operate-seek">
                     <span ng-if="seek.offerAmount == 0" style="color:red;">待报价</span>
                     <span ng-if="seek.offerAmount > 0">已报价</span>
+                    <div class="sharecode" ng-mouseover="setShowShare(seek,$index)" ng-mouseleave="hideShare($index)">
+                        <div class="sharecodeT">分<br/>享</div>
+                        <div class="sharecodeBtn">
+                            <img src="static/img/user/images/code.png" />
+                        </div>
+                    </div>
+                    <div ng-style="caleTop($index)" class="sharescancode icon-style" ref="sharescancode" ng-mouseover="setShowShare(seek,$index)" ng-mouseleave="hideShare($index)">
+                        <div class="share">
+                            <div>
+                                <div class="title">求购分享</div>
+                                <div class="qrccode" ng-class="'qrccode-canvas_'+$index" width="98" height="98"></div>
+                                <input readonly ng-value="caleUrl(seek)" ng-class="'qrccode_'+$index" >
+                                <span ng-class="'copyLink_'+$index" ng-attr-data-clipboard-text={{caleUrl(seek)}}>复制链接</span>
+                            </div>
+                        </div>
+                    </div>
                     <!--<span ng-switch-when="202" style="color:green;">已采纳</span>-->
                 </td>
                 <!--
@@ -661,7 +789,7 @@
                                         <td width="186"><span>{{of.currency + of.unitPrice | currencyStr}}</span></td>
                                         <td width="195" ng-bind="of.produceDate || '-'"></td>
                                         <td width="221" class="operate">
-                                            <a href = "of.user.usertTel">联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
+                                            <a>联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
                                             <img ng-if="of.status == 202" src="static/img/seekPurchase/recieved.png" alt="" class="ng-scope">
                                             <span ng-if="seek.status != 202" ng-click="setShowUseFlag(true, of)">采纳报价</span>
                                         </td>
@@ -674,7 +802,7 @@
                 </td>
             </tr>
             </tbody>
-            <tbody class="pager-tbody">
+            <tbody class="pager-tbody" style="border:0px">
             <tr class="pager-row">
                 <td colspan="10">
                     <div>

+ 42 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html

@@ -546,6 +546,33 @@
 	.com-del-box .title i{
 		background: none;
 	}
+	.oder01 ul li{
+		margin-left: 0px;
+		position: relative;
+		min-width: 110px
+	}
+	.oder01 ul li a {
+		min-width: 110px
+	}
+	.oder01 ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.oder01 ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.oder01 ul li.active:after{
+		display: block
+	}
 </style>
 <div class="user_right fr" id="buyer_cart">
 	<!--订单中心-->
@@ -596,7 +623,21 @@
 							</a>
 						</span>
 						<span style="width: 22%; text-align: left; position: relative;"><img src="static/img/common/songguo.png">
-							<a name="{{store.arr[0].id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(store.arr[0].sellPhone, store.arr[0].storeEnterprise.enUU, chat.UserType.STORE)">联系卖家</a>
+							<div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+							<a name="{{store.arr[0].id}}" href="javascript:void(0)" class="contact_btn" ng-click="chat.contactWithOther(null, store.arr[0].storeEnterprise.enUU, chat.UserType.STORE)">联系卖家</a>
+								<div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+									<div class="title">
+									  <i ng-click="setShowLinkBox(false)"></i>
+									</div>
+									<div class="content">
+									  <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>
+									  <p>卖家联系电话:<span ng-bind="phone"></span></p>
+									  <div>
+										<a ng-click="setShowLinkBox(false)">我知道了</a>
+									  </div>
+									</div>
+								  </div>
+							</div>
 							<!--<a name="{{store.arr[0].id}}" href="javascript:void(0)" class="contact_btn" ng-click="showContact(store.arr[0])">联系卖家</a>-->
 							<div name="{{store.arr[0].id}}" class="buyer-contact" ng-if="store.arr[0].contactSeller">
 									 <div class="contact-title">

+ 24 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html

@@ -472,6 +472,29 @@
     .ticket_record .empty .empty-info i{
         margin-right:5px;
     }
+    .oder01 ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .oder01 ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .oder01 ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .oder01 ul li.active:after{
+        display: block
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr u_c_invoice">
@@ -479,7 +502,7 @@
     <div class="ticket_record oder">
         <div class="oder01">
             <ul ng-class="{'active': changeBillStatusFlag}">
-                <li ng-class="{'active': tab == 'buyer_invoice' && !changeBillStatusFlag}" style="margin-left: 15px;"><a ng-click="changeBillStatusFlag = false" ui-sref="buyer_invoice">开票信息</a></li>
+                <li ng-class="{'active': tab == 'buyer_invoice' && !changeBillStatusFlag}"><a ng-click="changeBillStatusFlag = false" ui-sref="buyer_invoice">开票信息</a></li>
                 <li ng-class="{'active': tab == 'buyer_no_invoice'}"><a ui-sref="buyer_no_invoice">未开票</a></li>
                 <li ng-class="{'active': tab == 'buyer_invoice-record'}"><a ui-sref="buyer_invoice-record">开票记录</a></li>
             </ul>

+ 23 - 0
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice_record.html

@@ -122,6 +122,29 @@
     .ng-table-pagination .page-a:hover {
         background: #5078cb!important;
     }
+    .oder01 ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .oder01 ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .oder01 ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .oder01 ul li.active:after{
+        display: block
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr u_c_invoice">

+ 23 - 0
src/main/webapp/resources/view/usercenter/forstore/buyer_no_invoice.html

@@ -181,6 +181,29 @@ body div.ng-table-pager a.page-a {
 .no-invoice .no-invoice-content .empty .empty-info i{
     margin-right:5px;
 }
+.oder01 ul li{
+    margin-left: 0px;
+    position: relative;
+}
+.oder01 ul li.active a{
+    border-bottom: #fff;
+    background: #5078cb;
+    color: #fff;
+}
+.oder01 ul li::after{
+    background: url('static/img/vendor/images/downicon.png');
+    width: 11px;
+    height: 6px;
+    position: absolute;
+    bottom: 0px;
+    left: 50%;
+    content: ' ';
+    margin-left: -5px;
+    display: none;
+}
+.oder01 ul li.active:after{
+    display: block
+}
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr u_c_invoice">

+ 65 - 10
src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

@@ -433,6 +433,12 @@
 	}
 
 	/*搜索时间筛选*/
+	.screen{
+		background: #fff;
+		padding-top: 16px;
+		padding-bottom: 16px;
+		height: 66px;
+	}
 	.screen .sreach input{
 		border: #dfdfdf 1px solid;
 		height: 34px;
@@ -701,25 +707,59 @@
 	.oder01 ul li a {
 		font-size: 13px;
 		font-weight: bold;
+		min-width: 110px;
+	}
+	.oder01 ul li{
+		position: relative;
+		margin-left: 10px;
+		min-width: 110px;
+	}
+	.oder01 ul li:nth-child(1){
+		margin-left: 0px
+	}
+	.oder01 ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.oder01 ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.oder01 ul li.active:after{
+		display: block
+	}
+	.oder01 ul li.active a, .oder01 ul li.active a em {
+		color: #fff !important;
+	}
+	.oder01 ul li:hover a em {
+		color: #5078cb !important;
 	}
-
 </style>
 <div class="user_right fr">
 	<!--订单中心-->
 	<div class="oder">
-		<div class="oder01" style="margin-bottom: 16px;">
+		<div class="oder01" style="margin-bottom: 0px;">
 			<ul>
 				<li ng-class="{'active' : status == 'all'}" ng-click="toggleStatus('all')"><a> 所有订单(<em ng-class="{'color-black': !AllOrderInfo['all']}" ng-bind="AllOrderInfo['all'] || 0"></em>)</a></li>
-				<li ng-class="{'active' : status == 'tobepaid'}" ng-click="toggleStatus('tobepaid')"><a>待付款(<em ng-class="{'color-black': !AllOrderInfo['tobepaid']}" ng-bind="AllOrderInfo['tobepaid'] || 0"></em>)</a></li>
-				<li ng-class="{'active' : status == 'tobedeliver'}" ng-click="toggleStatus('tobedeliver')"><a>待卖家发货(<em ng-class="{'color-black': !AllOrderInfo['tobedeliver']}" ng-bind="AllOrderInfo['tobedeliver'] || 0"></em>)</a></li>
-				<li ng-class="{'active' : status == 'tobereceive'}" ng-click="toggleStatus('tobereceive')"><a>待收货(<em ng-class="{'color-black': !AllOrderInfo['tobereceive']}" ng-bind="AllOrderInfo['tobereceive'] || 0"></em>)</a></li>
-				<li ng-class="{'active' : status == 'success'}" ng-click="toggleStatus('success')"><a>成功的订单(<em ng-class="{'color-black': !AllOrderInfo['success']}" ng-bind="AllOrderInfo['success'] || 0"></em>)</a></li>
-				<li ng-class="{'active' : status == 'unavailable'}" ng-click="toggleStatus('unavailable')"><a>取消的订单(<em ng-class="{'color-black': !AllOrderInfo['unavailable']}" ng-bind="AllOrderInfo['unavailable'] || 0"></em>)</a></li>
-				<li ng-class="{'active' : status == 'tobecomment'}" ng-click="toggleStatus('tobecomment')"><a>待评价(<em ng-class="{'color-black': !AllOrderInfo['tobecomment']}" ng-bind="AllOrderInfo['tobecomment'] || 0"></em>)</a></li>
+				<li ng-class="{'active' : status == 'tobepaid'}" ng-click="toggleStatus('tobepaid')"><a>待付款(<em ng-class="{'color-black': !AllOrderInfo['tobepaid']}" ng-bind="AllOrderInfo['tobepaid'] || 0"></em>)</a></li>
+				<li ng-class="{'active' : status == 'tobedeliver'}" ng-click="toggleStatus('tobedeliver')"><a>待卖家发货(<em ng-class="{'color-black': !AllOrderInfo['tobedeliver']}" ng-bind="AllOrderInfo['tobedeliver'] || 0"></em>)</a></li>
+				<li ng-class="{'active' : status == 'tobereceive'}" ng-click="toggleStatus('tobereceive')"><a>待收货(<em ng-class="{'color-black': !AllOrderInfo['tobereceive']}" ng-bind="AllOrderInfo['tobereceive'] || 0"></em>)</a></li>
+				<li ng-class="{'active' : status == 'success'}" ng-click="toggleStatus('success')"><a>成功的订单(<em ng-class="{'color-black': !AllOrderInfo['success']}" ng-bind="AllOrderInfo['success'] || 0"></em>)</a></li>
+				<li ng-class="{'active' : status == 'unavailable'}" ng-click="toggleStatus('unavailable')"><a>取消的订单(<em ng-class="{'color-black': !AllOrderInfo['unavailable']}" ng-bind="AllOrderInfo['unavailable'] || 0"></em>)</a></li>
+				<li ng-class="{'active' : status == 'tobecomment'}" ng-click="toggleStatus('tobecomment')"><a>待评价(<em ng-class="{'color-black': !AllOrderInfo['tobecomment']}" ng-bind="AllOrderInfo['tobecomment'] || 0"></em>)</a></li>
 			</ul>
 		</div>
+		<!--<p class="height16">&nbsp</p>-->
 		<!--搜索时间筛选-->
-		<div class="screen">
+		<div class="screen" style="margin-top: 16px">
 			<div class="sreach fr">
 				<div class="date fl">
 					<div class="data-input">
@@ -754,6 +794,7 @@
 				</div>
 			</div>
 		</div>
+		<p class="height16">&nbsp</p>
 		<div class="oder_list" style="margin-top: 0;">
 			<dl style="display: inline-block;" class="all_oder">
 				<dt>
@@ -811,7 +852,21 @@
                         </span>
 						<span style="position: relative; width: 10%;">
                             <img src="static/img/common/songguo.png"/>
-                            <a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.sellPhone, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>
+							<div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+                            	<a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-click="chat.contactWithOther(null, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>
+								<div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+									<div class="title">
+									  <i ng-click="setShowLinkBox(false)"></i>
+									</div>
+									<div class="content">
+									  <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>
+									  <p>卖家联系电话:<span ng-bind="phone"></span></p>
+									  <div>
+										<a ng-click="setShowLinkBox(false)">我知道了</a>
+									  </div>
+									</div>
+								  </div>
+							</div>
 							<!--<a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactSeller(order)">联系卖家</a>-->
                              <div name="{{order.id}}" class="seller-contact" ng-if="order.active" ng-class="{true : 'seller-contact-info', false : 'display-none'}[order.active]">
                                  <div class="contact-title">

+ 15 - 1
src/main/webapp/resources/view/usercenter/forstore/order_detail.html

@@ -419,7 +419,21 @@
 								<a ng-href="store/{{order.orderDetails[0].storeid}}" ng-bind="order.storeName" class="hover-color" target="_blank"></a>
 							</i>
 							<img src="static/img/common/songguo.png" style="margin-right:0; ">
-							<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.buyerTel, order.buyerenuu, chat.UserType.STORE)">联系卖家</a>
+                            <div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+							    <a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-click="chat.contactWithOther(null, order.buyerenuu, chat.UserType.STORE)">联系卖家</a>
+								<div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+									<div class="title">
+									  <i ng-click="setShowLinkBox(false)"></i>
+									</div>
+									<div class="content">
+									  <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>
+									  <p>卖家联系电话:<span ng-bind="phone"></span></p>
+									  <div>
+										<a ng-click="setShowLinkBox(false)">我知道了</a>
+									  </div>
+									</div>
+								  </div>
+							</div>
 							<!--<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-click="contactSeller()">联系卖家</a>-->
 							<div class="contact-box" ng-if="contactBNox">
 								<div class="title"><i class="fa fa-close fa-lg" ng-click="closeBox()"></i></div>

+ 27 - 6
src/main/webapp/resources/view/usercenter/forstore/order_pay.html

@@ -695,13 +695,27 @@
 						<span>物料编码</span>
 						<span>备注</span>
 					</dt>
-					<div ng-repeat="(key, details) in $$orderDetailsMap">
+					<div ng-repeat="(key, details) in $$orderDetailsMap track by $index">
 						<dd style="height: 50px; line-height: 50px;">
                         <span style="white-space: nowrap; width: 100%; text-align: left; line-height: 50px; position: relative;">
                             &nbsp;&nbsp;<img src="static/img/user/images/shop_home01.png"/>
 							店铺:<a ng-href="store/{{details[0].storeid}}" ng-bind="::key" class="hover-color" target="_blank"></a>
 							<img src="static/img/common/songguo.png" style="margin-left: 110px; margin-right:0; ">
-							<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.buyerTel, order.buyerenuu, chat.UserType.STORE)">联系卖家</a>
+							<div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+								<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-click="chat.contactWithOther(null, order.orderDetails[$index].supEnUU, chat.UserType.STORE)">联系卖家</a>
+								<div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+									<div class="title">
+									  <i ng-click="setShowLinkBox(false)"></i>
+									</div>
+									<div class="content">
+									  <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>
+									  <p>卖家联系电话:<span ng-bind="phone"></span></p>
+									  <div>
+										<a ng-click="setShowLinkBox(false)">我知道了</a>
+									  </div>
+									</div>
+								  </div>
+							</div>
 							<!--<a class="contact_btn" title="联系卖家" name="{{key}}" ng-click="contactSeller(key)">联系卖家</a>-->
 							<!--<a class="contact_btn" title="联系卖家" ng-click="contactSeller(details[0])">联系卖家</a>-->
 							<div class="contact-box" ng-if="storeContactInfos[key].contactSeller" name="{{key}}">
@@ -834,16 +848,20 @@
 							<span class="total-price">
 								<p><strong>运费:</strong>
 									<em ng-if="order.status==501 && deliveryList[details[0].storeid].fareType == 3" style="font-weight: bold;color:#e64040">到付</em>
-									<em ng-if="order.status==501 && deliveryList[details[0].storeid].fareType != 3" ng-bind="fareList[details[0].storeid] | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+									<em ng-if="order.status==501 && deliveryList[details[0].storeid].fareType == 4" ng-bind="deliveryList[details[0].storeid].fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3) " style="font-weight: bold;color:#e64040"></em>
+									<em ng-if="order.status==501 && deliveryList[details[0].storeid].fareType != 3 && deliveryList[details[0].storeid].fareType != 4" ng-bind="fareList[details[0].storeid] | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
 									<em ng-if="order.status!=501">
-										<em ng-if="!deliveryList && rule.fareType != 3" ng-bind="order.fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+										<em ng-if="!deliveryList && rule.fareType != 3 && rule.fareType != 4" ng-bind="order.fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
 										<em ng-if="!deliveryList && rule.fareType == 3" style="font-weight: bold;color:#e64040">到付</em>
-										<em ng-if="deliveryList && deliveryList[details[0].storeid].fareType != 3" ng-bind="deliveryList[details[0].storeid].fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+										<em ng-if="!deliveryList && rule.fareType == 4" style="font-weight: bold;color:#e64040">包邮</em>
+										<em ng-if="deliveryList && deliveryList[details[0].storeid].fareType != 3 && deliveryList[details[0].storeid].fareType != 4" ng-bind="deliveryList[details[0].storeid].fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
 										<em ng-if="deliveryList && deliveryList[details[0].storeid].fareType == 3" style="font-weight: bold;color:#e64040">到付</em>
+										<em ng-if="deliveryList && deliveryList[details[0].storeid].fareType == 4" style="font-weight: bold;color:#e64040">包邮</em>
 									</em>
 								</p>
 								<p><strong>店铺合计:</strong>
 									<em ng-if="order.status==501" ng-bind="storePrice[key] + fareList[details[0].storeid] | formateNumber :2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+
 									<em ng-if="order.status!=501" style="font-weight: bold">
 										<em ng-if="storeArray.length == 1" ng-bind="order.ensurePrice | formateNumber :2 | currencySysmbol : order.currency.substring(0,3)"></em>
 										<em ng-if="storeArray.length != 1" ng-bind="storePrice[key] + deliveryList[details[0].storeid].fare | formateNumber :2 | currencySysmbol : order.currency.substring(0,3)"></em>
@@ -892,7 +910,10 @@
 					</div>
 					<dd class="pay_price">
 						<div>
-							<h4>总计:<em ng-bind="order.ensurePrice | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3) "></em></h4>
+							<h4>总计:
+								<em ng-bind="order.ensurePrice | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3) "></em>
+
+							</h4>
 							<h6 ng-if="payment.address.area"><strong>地址:</strong>{{formatArea}} {{payment.address.detailAddress}}</h6>
 							<h6 ng-if="payment.address.tel"><strong>收货人:</strong>{{payment.address.tel}}&nbsp;&nbsp;{{payment.address.name}}(收)</h6>
 						</div>

+ 23 - 0
src/main/webapp/resources/view/usercenter/forstore/pay_center.html

@@ -385,6 +385,29 @@
 		display: inline;
 		float: left;
 	}
+	.oder01 ul li{
+		margin-left: 0px;
+		position: relative;
+	}
+	.oder01 ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.oder01 ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.oder01 ul li.active:after{
+		display: block
+	}
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr" id="pay_center">

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/query_logistics.html

@@ -199,7 +199,7 @@
                         <span style="margin-right: 0;">订单号:</span>
                         <span style="margin-left: 0; margin-right: 30px;" ng-bind="order.orderid"></span>
                         <span style="margin-right: 0px;"><img src="static/img/user/images/shop_home.png" />&nbsp;<a ng-bind="order.storeName" style="margin-left: 0;margin-right: 20px;" href="store/{{::order.storeid}}" target="_blank"></a></span>
-                        <span><img src="static/img/common/songguo.png"/><a href="#" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.sellPhone, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>
+                        <span><img src="static/img/common/songguo.png"/><a href="#" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(null, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>
                             <!--<a class="contact_btn" ng-click="contactSeller()">联系卖家</a>-->
                             <div class="contact-box" ng-if="contactBNox">
 								<div class="title"><i class="fa fa-close fa-lg" ng-click="closeBox()"></i></div>
@@ -267,7 +267,7 @@
                                 </p>
                                 <div class="empty-info">
                                     <p class="grey" ng-if="order.deliverytype == 1301">暂时获取不到物流信息,请到快递公司官网进行查询</p>
-                                    <p class="grey" ng-if="order.deliverytype != 1301">暂无物流信息,请<a style="color: #5078cb;" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.sellPhone, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>咨询</p>
+                                    <p class="grey" ng-if="order.deliverytype != 1301">暂无物流信息,请<a style="color: #5078cb;" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(null, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>咨询</p>
                                     <!--<a href="user#/order"><i class="fa fa-mail-reply fa-xs"></i>返回上一页</a>-->
                                 </div>
                             </div>

+ 249 - 25
src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html

@@ -157,6 +157,10 @@
     .seek-purchase .screen .sreach .date input:hover{
         cursor: pointer;
     }
+    .seek-purchase .seek-purchase-content >table >tbody >tr.default-row .operate-seek .row-wrap >span {
+        float: left;
+        margin-left: 7px
+    }
     .seek-purchase .screen .sreach .date em{
         float: left;
         line-height: 32px;
@@ -201,6 +205,7 @@
     .seek-purchase .seek-purchase-content >table {
         width: 1000px;
         margin: 0 auto;
+        position: relative;
     }
     .seek-purchase .seek-purchase-content >table >thead {
         background: #89aefa;
@@ -231,6 +236,7 @@
     }
     .seek-purchase .seek-purchase-content >table >tbody >tr.default-row {
         border-bottom: 1px solid #dae5fd;
+        position: relative;
     }
     .seek-purchase .seek-purchase-content >table >tbody.active {
         border: 2px solid #f7a986;
@@ -245,13 +251,31 @@
     .seek-purchase .seek-purchase-content >table >tbody >tr.default-row:hover {
         background: #f1f5ff;
     }
+    .seek-purchase .seek-purchase-content >table >tbody >tr.default-row:hover  .sharecode{
+        display: block
+    }
     .seek-purchase .seek-purchase-content >table >tbody >tr.default-row td {
         font-size: 14px;
         text-align: center;
         height: 117px;
     }
+    .seek-purchase .seek-purchase-content >table >tbody >tr.default-row td.operate-seek{
+        text-align: left;
+        text-indent: 12px;
+        border-right: 1px solid #dae5fd;
+        line-height: 68px
+    }
     .seek-purchase .seek-purchase-content >table >tbody >tr .row-wrap {
-        height: 117px;
+        height: 117px
+    }
+    .seek-purchase .seek-purchase-content >table >tbody >tr.default-row td.operate-seek >span {
+        color: #4290f7;
+        cursor: pointer;
+        text-indent: 12px;
+        text-align: left
+    }
+    .seek-purchase .seek-purchase-content >table >tbody >tr.default-row td.operate-seek >span i{
+        text-indent: 0px
     }
     .seek-purchase .red-text {
         color: #f62d37;
@@ -323,11 +347,11 @@
         top: 12px;
         right: -5px;
     }
-    .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.operate a {
+    .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.operate > div > a {
         color: #5078cb;
         font-size: 12px;
     }
-    .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.operate span {
+    .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.operate > span {
         display: inline-block;
         width: 64px;
         height: 24px;
@@ -575,6 +599,7 @@
     .seek-purchase .bom-manage > table tbody tr:hover {
         background: #fdf8f5;
         border: 1px solid #fce8df;
+        cursor:pointer
     }
     .seek-purchase .seek-purchase-content .BOM-header {
         height: 164px;
@@ -673,11 +698,166 @@
         width: 414px;
         margin-left: 50px;
     }
+    .seek-purchase .sharecode {
+        /*position: absolute;*/
+        display: none;
+        right: 0;
+        top: 0;
+        /*z-index: 99;*/
+        text-indent: 0 !important;
+        text-align: center;
+        float: right
+    }
+    .seek-purchase .sharecode .sharecodeBtn {
+        width: 28px;
+        height: 28px;
+        margin-top: 2px;
+    }
+    .seek-purchase .sharecode .sharecodeBtn img {
+        float: left;
+    }
+    .seek-purchase .sharecode .sharecodeBtn::after {
+         content: ' ';
+         clear: both;
+         display: inline;
+         visibility: hidden;
+     }
+    .seek-purchase .sharecode .sharecodeT {
+        padding-top: 2px;
+        margin-top: 2px;
+        width: 28px;
+        height: 34px;
+        background-color: #3c7cf5;
+        border-radius: 2px;
+        color: #ffffff;
+        font-size: 14px;
+        word-wrap: break-word;
+        white-space: pre-wrap;
+        line-height: 14px;
+    }
+    .seek-purchase .sharescancodekuang {
+        width: 100%;
+        height: 220px;
+        position: absolute;
+        top: 110px;
+        left: 0px;
+        background: rgba(0, 0, 0, 0);
+        height: 220px !important;
+
+    }
+    .seek-purchase .sharescancode {
+        position: absolute;
+        background: url('static/img/user/images/codebg.png');
+        width: 248px;
+        height: 207px;
+        top: 0px;
+        right: 0px;
+        z-index: 98;
+        display: none;
+        line-height: 14px;
+    }
+    .seek-purchase .sharescancode canvas {
+        display: block;
+        text-align: center;
+        margin: 0 auto;
+        line-height: 14px;
+    }
+    .seek-purchase .sharescancode .title {
+        color: #3c7cf5;
+        font-size: 16px;
+        margin: 21px auto;
+        margin-bottom: 0px;
+        text-align: center;
+        line-height: 14px;
+    }
+    .seek-purchase .sharescancode div input {
+        display: inline-block;
+        width: 140px;
+        overflow: hidden;
+        height: 35px;
+        vertical-align: middle;
+        margin-left: 14px;
+        line-height: 35px;
+    }
+    .seek-purchase .sharescancode div span {
+        display: inline-block;
+        color: #fff;
+        background: #4290f7;
+        height: 36px;
+        line-height: 36px;
+        width: 70px;
+        font-style: normal;
+        vertical-align: middle;
+        cursor: pointer;
+        text-align: center;
+        text-indent: 0px;
+    }
+    .seek-purchase .sharescancode img{
+        margin: 0 auto;
+        text-align: center;
+    }
+    .seek-purchase .sharescancode .qrccode{
+        margin: 15px auto;
+        margin-bottom: 10px
+    }
+    .oder011 ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .oder011 ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .oder011 ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .oder011 ul li.active:after{
+        display: block
+    }
+    .oder012 ul li.active a{
+        border-top: 3px solid #f15601;
+        border-left: 1px solid #f15601;
+        border-right: 1px solid #f15601;
+    }
+    .oder012 ul li.active:hover a{
+        color: #f15601;
+    }
+    .oder012 ul{
+        /*border-top: 3px solid #f15601;*/
+        border-bottom: 1px solid #f15601;
+    }
+    .oder012 ul li:nth-child(1){
+        margin-left: 0px
+    }
+    .oder012 ul li:hover a{
+        /*padding-top: 15px;*/
+        /*width: 112px;*/
+        color: #f15601;
+    }
+    .oder012 ul li{
+        margin-left: 0px
+    }
+    .oder012 ul li a{
+        border-top: 3px solid rgba(0,0,0,0)
+    }
+    .oder012 ul li.active a{
+        color: #f15601;
+        border-bottom: 1px solid #fff;
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
     <div class="oder" style="margin-top: 10px;">
-        <div class="oder01">
+        <div class="oder01 oder011">
             <ul>
                 <li ng-class="{'active': activeType == 'seekManage'}"><a href="javascript:void(0)" ng-click="toogleType('seekManage')">单个求购</a></li>
                 <li ng-class="{'active': activeType == 'bomManage'}"><a href="javascript:void(0)" ng-click="toogleType('bomManage')">BOM求购</a></li>
@@ -685,14 +865,14 @@
         </div>
     </div>
     <div class="oder" style="margin-top: 10px;" ng-show="activeType == 'seekManage'">
-        <div class="oder01">
+        <div class="oder01 oder012">
             <ul>
                 <li ng-class="{'active': tab == 'waitOffer'}"><a href="javascript:void(0)" ng-click="toogleTab('waitOffer')">待报价</a></li>
                 <li ng-class="{'active': tab == 'offered'}"><a href="javascript:void(0)" ng-click="toogleTab('offered')">已报价</a></li>
             </ul>
         </div>
     </div>
-    <div class="seek-purchase-content" ng-show="activeType == 'seekManage'">
+    <div class="seek-purchase-content" ng-show="activeType == 'seekManage'" style="margin-top:0px">
         <div class="publish-purchase">
             <div class="fl">
                 <p>单个发布</p>
@@ -814,13 +994,13 @@
             <thead>
             <tr>
                 <th width="102">发布时间</th>
-                <th width="670">产品信息</th>
-                <th width="132">状态/截止时间</th>
-                <th width="96">操作</th>
+                <th width="650">产品信息</th>
+                <th width="112">状态/截止时间</th>
+                <th width="136">操作</th>
             </tr>
             </thead>
             <tbody ng-repeat="seek in seekListData.content" ng-class="{'active': seek.$status && (seek.$status == 1 || seek.$status == 2)}">
-            <tr class="default-row">
+            <tr class="default-row" ng-mouseover="pauseTimer($index)" ng-mouseleave="startTimer($index)">
                 <td>
                     <div class="row-wrap">
                         <div ng-bind="seek.date | date:'yyyy-MM-dd'"></div>
@@ -858,6 +1038,22 @@
                         <span ng-if="seek.offerAmount > 0" ng-show="!seek.$status || seek.$status == 0" ng-click="setSeekStatus(seek, 2)">查看报价&nbsp;<i class="fa fa-angle-double-down"></i></span>
                         <span ng-if="seek.goodsAmount > 0" ng-show="!seek.$status || seek.$status == 0" ng-click="setSeekStatus(seek, 1)">商城现货&nbsp;<i class="fa fa-angle-double-down"></i></span>
                         <span ng-show="seek.$status && (seek.$status == 1 || seek.$status == 2)" ng-click="setSeekStatus(seek, 0)">收起&nbsp;<i class="fa fa-angle-double-up"></i></span>
+                        <div class="sharecode" ng-mouseover="setShowShare(seek,$index)" ng-mouseleave="hideShare($index)">
+                            <div class="sharecodeT">分<br/>享</div>
+                            <div class="sharecodeBtn">
+                                <img src="static/img/user/images/code.png" />
+                            </div>
+                        </div>
+                        <div ng-style="caleTop($index)" class="sharescancode icon-style" ng-mouseover="setShowShare(seek,$index)" ng-mouseleave="hideShare($index)">
+                            <div class="share">
+                                <div>
+                                    <div class="title">求购分享</div>
+                                    <div class="qrccode" ng-class="'qrccode-canvas_'+$index" width="98" height="98"></div>
+                                    <input readonly ng-value="caleUrl(seek)" ng-class="'qrccode_'+$index" >
+                                    <span ng-class="'copyLink_'+$index" ng-attr-data-clipboard-text={{caleUrl(seek)}}>复制链接</span>
+                                </div>
+                            </div>
+                        </div>
                     </div>
                 </td>
             </tr>
@@ -906,7 +1102,21 @@
                                             </div>
                                         </td>
                                         <td width="186" class="operate">
-                                            <a href="javascript:void(0)" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther('12345', go.enUU, chat.UserType.ENTERPRISE)">联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
+                                            <div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+                                                <a href="javascript:void(0)" ng-click="chat.contactWithOther(null, go.enUU, chat.UserType.ENTERPRISE)">联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
+                                                <div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+                                                    <div class="title">
+                                                        <i ng-click="setShowLinkBox(false)"></i>
+                                                    </div>
+                                                    <div class="content">
+                                                        <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>
+                                                        <p>卖家联系电话:<span ng-bind="phone"></span></p>
+                                                        <div>
+                                                            <a ng-click="setShowLinkBox(false)">我知道了</a>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
                                             <span ng-click = "purchase(go, $index)">立即购买</span>
                                         </td>
                                     </tr>
@@ -955,7 +1165,21 @@
                                         </td>
                                         <!--<td width="195" ng-bind="of.produceDate || '-'"></td>-->
                                         <td width="221" class="operate">
-                                            <a ng-click="setLinkBoxIndex($index)">联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
+                                            <div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+                                                <a href="javascript:void(0)" ng-click="chat.contactWithOther(null, currentSeek.qutations[$index].enterprise.uu, chat.UserType.ENTERPRISE)">联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
+                                                <div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+                                                    <div class="title">
+                                                        <i ng-click="setShowLinkBox(false)"></i>
+                                                    </div>
+                                                    <div class="content">
+                                                        <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>
+                                                        <p>卖家联系电话:<span ng-bind="phone"></span></p>
+                                                        <div>
+                                                            <a ng-click="setShowLinkBox(false)">我知道了</a>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
 
                                             <img ng-if="of.agreed == 1" src="static/img/seekPurchase/recieved.png" alt="" class="ng-scope">
                                             <span ng-if="seek.agreed != 1" ng-click="adopt(of.id)">采纳报价</span>
@@ -1039,7 +1263,7 @@
         <table ng-table="bomTableParams">
             <tbody>
             <tr ng-repeat="bom in $data">
-                <td>
+                <td ng-click="toBomdetail(bom.id)">
                     <img src="static/img/seekPurchase/Excel.png" alt="">
                     <div>
                         <p ng-bind="bom.remark"></p>
@@ -1074,16 +1298,16 @@
             </div>
         </div>
     </div>
-    <div class="com-mall-del-box link-saler-box" ng-if="linkBoxIndex > -1">
-        <div class="title">
-            <i ng-click="setLinkBoxIndex(-1)"></i>
-        </div>
-        <div class="content">
-            <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>
-            <p>卖家联系电话:<span ng-bind="currentSeek.qutations[linkBoxIndex].userTel"></span></p>
-            <div>
-                <a ng-click="setLinkBoxIndex(-1)">我知道了</a>
-            </div>
-        </div>
-    </div>
+    <!--<div class="com-mall-del-box link-saler-box" ng-if="linkBoxIndex > -1">-->
+        <!--<div class="title">-->
+            <!--<i ng-click="setLinkBoxIndex(-1)"></i>-->
+        <!--</div>-->
+        <!--<div class="content">-->
+            <!--<p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与卖家在线沟通!</p>-->
+            <!--<p>卖家联系电话:<span ng-bind="currentSeek.qutations[linkBoxIndex].userTel || '-'"></span></p>-->
+            <!--<div>-->
+                <!--<a ng-click="setLinkBoxIndex(-1)">我知道了</a>-->
+            <!--</div>-->
+        <!--</div>-->
+    <!--</div>-->
 </div>

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/pay_center.html

@@ -602,6 +602,29 @@
     div.ng-table-pager a.page-a{
         color:#fff!important;
     }
+    .oder01 ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .oder01 ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .oder01 ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .oder01 ul li.active:after{
+        display: block
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr" id="pay_center">

+ 24 - 1
src/main/webapp/resources/view/vendor/forstore/purchaseOffer.html

@@ -549,6 +549,29 @@
         color: #999;
         margin-left: 10px;
     }
+    .oder01 ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .oder01 ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .oder01 ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .oder01 ul li.active:after{
+        display: block
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
@@ -736,7 +759,7 @@
         </div>
         <div class="content">
             <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与买家在线沟通!</p>
-            <p>买家联系电话:<span ng-bind="(seekListData.content)[linkBoxIndex].userTel"></span></p>
+            <p>买家联系电话:<span ng-bind="seekListData.content[linkBoxIndex].userTel || '-'"></span></p>
             <div>
                 <a ng-click="setLinkBoxIndex(-1)">我知道了</a>
             </div>

+ 15 - 1
src/main/webapp/resources/view/vendor/forstore/purchase_detail.html

@@ -471,7 +471,21 @@
 								<!--<a ng-if="purchase.pu_buyentername" name="{{purchase.id}}" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">|{{purchase.pu_buyentername}}</a>-->
 							</i>
 							<img src="static/img/common/songguo.png" style="margin-right:0; ">
-							<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+							<div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+								<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="chat.contactWithOther(!purchase.buyerenuu ? purchase.buyPhone : null, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+								<div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+									<div class="title">
+									  <i ng-click="setShowLinkBox(false)"></i>
+									</div>
+									<div class="content">
+									  <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与买家在线沟通!</p>
+									  <p>买家联系电话:<span ng-bind="phone"></span></p>
+									  <div>
+										<a ng-click="setShowLinkBox(false)">我知道了</a>
+									  </div>
+									</div>
+								  </div>
+							</div>
 							<!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactSeller()">联系买家</a>-->
 							<div class="contact-box" ng-if="contactBNox">
 								<div class="title"><i class="fa fa-close fa-lg" ng-click="closeBox()"></i></div>

+ 31 - 8
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -581,6 +581,29 @@
         margin: 18px 0 13px 0;
         border-radius: 2px;
     }
+    .oder01 ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .oder01 ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .oder01 ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .oder01 ul li.active:after{
+        display: block
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
@@ -710,14 +733,14 @@
                 </tr>
             </tbody>
             <tbody ng-if="seekListData.length == 0">
-            <tr class="empty">
-                <td colspan="10">
-                    <div>
-                        <img src="static/img/all/empty-cart.png">
-                        <span>暂无求购信息</span>
-                    </div>
-                </td>
-            </tr>
+                <tr class="empty">
+                    <td colspan="10">
+                        <div>
+                            <img src="static/img/all/empty-cart.png">
+                            <span>暂无求购信息</span>
+                        </div>
+                    </td>
+                </tr>
             </tbody>
         </table>
     </div>

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html

@@ -254,6 +254,29 @@
     #checkAll[disabled] + label {
         cursor: not-allowed;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .com_tab ul li.active:after{
+        display: block
+    }
 </style>
 <div class="count user_right fr">
     <div class="count_center">

+ 26 - 12
src/main/webapp/resources/view/vendor/forstore/vendor_account_management.html

@@ -440,6 +440,29 @@
   .white {
     background-color: white;
   }
+  .com_tab ul li{
+    margin-left: 0px;
+    position: relative;
+  }
+  .com_tab ul li.active a{
+    border-bottom: #fff;
+    background: #5078cb;
+    color: #fff;
+  }
+  .com_tab ul li::after{
+    background: url('static/img/vendor/images/downicon.png');
+    width: 11px;
+    height: 6px;
+    position: absolute;
+    bottom: 0px;
+    left: 50%;
+    content: ' ';
+    margin-left: -5px;
+    display: none;
+  }
+  .com_tab ul li.active:after{
+    display: block
+  }
 </style>
 <!--右侧主体部分-->
 <div class="count user_right fr">
@@ -471,12 +494,7 @@
             <ul>
               <li>
                 <div class="fl">企业名称</div>
-                <div class="col-sm-10" ng-if="updateState"><input type="text" class="form-control"
-                                                                  title="企业全称"
-                                                                  ng-disabled=" !updateState"
-                                                                  ng-model="enterpriseInfo.enName"/>
-                </div>
-                <div class="fr" ng-if="!updateState"><span
+                <div class="fr"><span
                     ng-bind="enterpriseInfo.enName || '暂无信息'"></span>
                 </div>
               </li>
@@ -496,18 +514,14 @@
               </li>-->
               <li>
                 <div class="fl">营业执照号</div>
-                <div class="col-sm-10" ng-if="updateState"><input type="text" class="form-control"
-                                                                  title="营业执照号" disabled="disable"
-                                                                  ng-model="enterpriseInfo.enBussinessCode"/>
-                </div>
-                <div class="fr" ng-if="!updateState"><span
+                <div class="fr"><span
                     ng-bind="enterpriseInfo.enBussinessCode || '暂无信息'"></span></div>
               </li>
               <li>
                 <div class="fl">注册地址</div>
                 <div class="col-sm-10" ng-if="updateState"><input type="text" class="form-control"
                                                                   title="企业地址"
-                                                                  ng-disabled=" !updateState"
+                                                                  ng-disabled="enterpriseInfo.enValidCode == 2"
                                                                   ng-model="enterpriseInfo.enAddress"/>
                 </div>
                 <div class="fr" ng-if="!updateState"><span

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_brand_apply.html

@@ -99,6 +99,29 @@
     .brand .add_brand .choose_list div.fr p:hover{
         cursor: pointer;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .com_tab ul li.active:after{
+        display: block
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr">

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_brand_apply_list.html

@@ -66,6 +66,29 @@
         position: relative;
         top: 7px;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .com_tab ul li.active:after{
+        display: block
+    }
 </style>
 <div class="user_right fr">
     <div class="brand wanted">

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_component_apply.html

@@ -98,6 +98,29 @@
         margin-right: 5px;
         font-size: 16px;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .com_tab ul li.active:after{
+        display: block
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr">

+ 56 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_component_applylist.html

@@ -35,6 +35,61 @@
     .table .tr-default th{
         color: #555;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .com_tab2 ul li {
+        margin-left: 10px
+    }
+    .com_tab2 ul li:nth-child(1){
+        margin-left:0px
+    }
+    .com_tab2 ul li a,.com_tab2 ul li a:active{
+        border-top: 3px solid #fff;
+    }
+    .com_tab ul li.active:after{
+        display: block
+    }
+    .com_tab2 ul li::after{
+        background: url('');
+    }
+    .com_tab2 ul li a:hover{
+        color: #f15601
+    }
+    .com_tab2 ul li.active a{
+        border-top: 3px solid #f15601;
+        border-left: 1px solid #f15601;
+        border-right: 1px solid #f15601;
+        background: #fff;
+        color: #f15601
+    }
+    .com_tab2 ul li.active:hover a{
+        color: #f15601;
+    }
+    .com_tab2 ul{
+        /*border-top: 3px solid #f15601;*/
+        border-bottom: 1px solid #f15601;
+    }
+    .com_tab2 ul li::after{
+        background: url('');
+    }
 </style>
 <div class="user_right fr">
     <!--器件申请-->
@@ -46,7 +101,7 @@
                 <li class="active"><a ui-sref="vendor_component_applylist">申请记录</a></li>
             </ul>
         </div>
-        <div class="com_tab">
+        <div class="com_tab com_tab2" style="margin-bottom: 0px">
             <ul class="fl" style="width: 100%">
                 <li class="active"><a ui-sref="vendor_component_applylist">单个申请记录</a></li>
                 <li><a ui-sref="vendor_component_batchapplylist">批量申请记录</a></li>

+ 24 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_component_batchapply.html

@@ -32,6 +32,30 @@
         color: #999;
         line-height: 20px;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .com_tab ul li.active:after{
+        display: block
+    }
+
 </style>
 
 <div class="user_right fr">

+ 56 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_component_batchapplylist.html

@@ -26,6 +26,61 @@
     .table .tr-default th{
         color: #555;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .com_tab ul li.active:after{
+        display: block
+    }
+    .com_tab2 ul li::after{
+        background: url('');
+    }
+    .com_tab2 ul li.active a{
+        border-top: 3px solid #fff;
+    }
+    .com_tab2 ul li a:hover{
+        color: #f15601
+    }
+    .com_tab2 ul li.active a{
+        border-top: 3px solid #f15601;
+        border-left: 1px solid #f15601;
+        border-right: 1px solid #f15601;
+        background: #fff;
+        color: #f15601
+    }
+    .com_tab2 ul li.active:hover a{
+        color: #f15601;
+    }
+    .com_tab2 ul{
+        /*border-top: 3px solid #f15601;*/
+        border-bottom: 1px solid #f15601;
+    }
+    .com_tab2 ul li {
+        margin-left: 10px
+    }
+    .com_tab2 ul li:nth-child(1){
+        margin-left:0px
+    }
+    .com_tab2 ul li a{
+        border-top: 3px solid #fff
+    }
 </style>
 <div class="user_right fr">
     <!--器件申请-->
@@ -37,7 +92,7 @@
                 <li class="active"><a ui-sref="vendor_component_applylist">申请记录</a></li>
             </ul>
         </div>
-        <div class="com_tab" style="margin-bottom: 0;">
+        <div class="com_tab com_tab2" style="margin-bottom: 0;">
             <ul class="fl" style="width: 100%">
                 <li><a ui-sref="vendor_component_applylist">单个申请记录</a></li>
                 <li class="active"><a ui-sref="vendor_component_batchapplylist">批量申请记录</a></li>

+ 15 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_delivery.html

@@ -598,7 +598,21 @@
 								<!--<a ng-if="purchase.pu_buyentername" name="{{purchase.id}}" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">|{{purchase.pu_buyentername}}</a>-->
 							</i>
 							<img src="static/img/common/songguo.png" style="margin-right:0; ">
-                            <a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+                            <div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+                                <a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="chat.contactWithOther(!checkinvoice.buyerenuu ? checkinvoice.buyPhone : null, checkinvoice.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+								<div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+									<div class="title">
+									  <i ng-click="setShowLinkBox(false)"></i>
+									</div>
+									<div class="content">
+									  <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与买家在线沟通!</p>
+									  <p>买家联系电话:<span ng-bind="phone"></span></p>
+									  <div>
+										<a ng-click="setShowLinkBox(false)">我知道了</a>
+									  </div>
+									</div>
+								  </div>
+							</div>
 							<!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" >联系买家</a>-->
 						</span>
                     </dd>

+ 30 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_delivery_rule.html

@@ -468,6 +468,29 @@
 	.no-record-list .empty .empty-info i{
 		margin-right:5px;
 	}
+	.com_tab ul li{
+		margin-left: 0px;
+		position: relative;
+	}
+	.com_tab ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.com_tab ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.com_tab ul li.active:after{
+		display: block
+	}
 </style>
 <script src="static/lib/ui-tour/tour.js"></script>
 <!--右侧主体部分-->
@@ -712,6 +735,11 @@
 						<label for="style03"></label>
 						到付
 					</label>
+					<label class="check-act" ng-click="checkTab(4)">
+						<input type="radio" id="style04" name="radio2" ng-checked="modifyRule.fareType==4"/>
+						<label for="style04"></label>
+						包邮
+					</label>
 				</div>
 				<!--统一规定运费-->
 				<div class="style-regulations common-style" ng-if="modifyRule.fareType==1">
@@ -946,7 +974,7 @@
 	}
 	.addRule-menu span.active{
 		background: #fff;
-		border: #82d2fa 1px solid;
+		border: #f15601 1px solid;
 		border-bottom: #fff 1px solid;
 	}
 	.addRule-menu span.active a{
@@ -960,7 +988,7 @@
 		color: #5078cb;
 	}
 	.com_tab.rule-act ul {
-		border-bottom: #82d2fa 1px solid;
+		border-bottom: 1px solid #f15601;
 	}
 	.com_tab.rule-act{
 		margin-bottom: 0;

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_distributor.html

@@ -171,6 +171,29 @@
 	.distributor-content .empty .empty-info i{
 		margin-right:5px;
 	}
+	.com_tab ul li{
+		margin-left: 0px;
+		position: relative;
+	}
+	.com_tab ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.com_tab ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.com_tab ul li.active:after{
+		display: block
+	}
 </style>
 <!--右侧主体部分-->
 <div class="count user_right fr">

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_logistics.html

@@ -38,6 +38,29 @@
 	.logistic-content .empty .empty-info i{
 		margin-right:5px;
 	}
+	.com_tab ul li{
+		margin-left: 0px;
+		position: relative;
+	}
+	.com_tab ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.com_tab ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.com_tab ul li.active:after{
+		display: block
+	}
 </style>
 <!--右侧主体部分-->
 <div class="count user_right fr">

+ 414 - 22
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -30,6 +30,37 @@
 	label[disabled] {
 		cursor: not-allowed;
 	}
+	.pro_management .com_tab ul li {
+		margin-left: 0px;
+		position: relative
+	}
+	.pro_management .com_tab:nth-of-type(1) ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.pro_management .com_tab ul li.active:after{
+		display: block
+	}
+	.pro_management .com_tab ul li.active a {
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff
+	}
+	.pro_management .com_tab2 ul li.active a {
+		background: #fff;
+		color: #666
+	}
+	.pro_management .com_tab ul.distance li {
+		margin-left: 0px;
+		color: #fff
+	}
 	.com_tab ul li.down-goods span:hover {
 		cursor: pointer;
 		text-decoration: underline;
@@ -138,6 +169,9 @@
 		background: #5078cb;
 		border-radius: 2px;
 	}
+	.public-tab.table>tbody>tr>td.edit {
+		color: #5078cb;
+	}
 	.public-tab.table>tbody>tr>td.edit span span{
 		padding: 0 8px;
 		display: inline-block;
@@ -674,7 +708,7 @@
 		line-height: 23px;
 		position: absolute;
 		top: 40px;
-		border-top: 1px solid #82d2fa;
+		/*border-top: 1px solid #82d2fa;*/
 	}
 	.match-menu span{
 		display: inline-block;
@@ -686,7 +720,7 @@
 		border-top-right-radius: 3px;
 		margin-left: 390px;
 		line-height: 23px;
-		border: 1px solid #82d2fa;
+		border: 1px solid #f15601;
 		border-bottom: none;
 		position: relative;
 		bottom: 23px;
@@ -907,8 +941,8 @@
 		/*background: #c7ebfd*/
 	}
 	/*限制非标和标准数量显示过多换行的问题*/
-	.com_tab ul.distance li {
-		width: 100px;
+	.com_tab2 ul.distance li {
+		width: 120px;
 		height: 40px;
 		line-height: 12px;
 		text-align: center;
@@ -917,28 +951,50 @@
 		margin-left: 25px;
 	}
 	.com_tab ul.distance li:first-child {
-		margin-right: 20px;
+		margin-right: 0px;
 	}
 	.com_tab ul.distance li a.standard{
-		padding-top: 15px;
-		width: 112px;
+		width: 120px;
 		color: #666;
+		line-height: 40px;
+		border-top: 3px solid #fff
 	}
 	.com_tab ul.distance li a.standard em{
-		display: inline-block;
 		max-width: 45px;
 		overflow: hidden;
 		text-overflow: ellipsis;
 		white-space: nowrap;
 		color: #666;
 	}
-	.com_tab ul.distance li:hover a.standard em.count,.com_tab ul.distance li.active a.standard em.count{
-		color: #5078cb;
+	.com_tab ul.distance li:hover a.standard em.count{
+		color: #f15601;
 	}
-	.com_tab ul.distance li.active a.standard,.com_tab ul.distance li:hover a.standard{
-		padding-top: 15px;
-		width: 112px;
-		color: #5078cb;
+	.com_tab ul.distance li.active a.standard em.count,.com_tab ul.distance li.active a.standard{
+		color: #fff;
+	}
+	.com_tab2 ul.distance li.active a.standard em.count, .com_tab2 ul.distance li.active a.standard{
+		color: #f15601
+	}
+	.com_tab2 ul.distance li.active a.standard{
+		border-top: 3px solid #f15601;
+		border-left: 1px solid #f15601;
+		border-right: 1px solid #f15601;
+	}
+	.com_tab ul.distance li.active:hover a.standard{
+		color: #f15601;
+
+	}
+	.com_tab2 ul.distance li a.standard{
+		transition: 0s all;
+	}
+	.com_tab2 ul.distance{
+		/*border-top: 3px solid #f15601;*/
+		border-bottom: 1px solid #f15601;
+	}
+	.com_tab ul.distance li:hover a.standard{
+		/*padding-top: 15px;*/
+		/*width: 112px;*/
+		color: #f15601;
 	}
 	.wanted_list01 .tab table tr.gre-bg{
 		width: 100%;
@@ -1598,11 +1654,187 @@
 	.wanted_list01 .tab table th {
 		color: #333 !important;
 	}
+
+	.edit-replace-box {
+		position: fixed;
+		width: 510px;
+		top: 20%;
+		left: 50%;
+		margin-left: -255px;
+		/*-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;
+		/*overflow-y: scroll;*/
+    max-height: 280px;
+		position: relative;
+		z-index: 11
+	}
+  .edit-replace-box .content2 {
+    overflow-y: scroll;
+    max-height: 240px;
+  }
+	.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 .reminfo {
+		font-size: 12px;
+		color: #333;
+		text-align: left;
+		text-indent: 12px;
+		margin-bottom: 12px;
+	}
+	.edit-replace-box .reminfo a {
+		color: #fa4701
+	}
+	.edit-replace-box .operate {
+		background: #fff;
+		text-align: center;
+		padding-top: 15px;
+		border-top: 1px solid #e4e5e6;
+		border-bottom-left-radius: 5px;
+		border-bottom-right-radius: 5px;
+		padding-bottom: 20px;
+	}
+	.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: fixed;
+		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;
+		z-index: 10;
+	}
+	.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;
+	}
 </style>
 <div class="user_right fr">
 	<!--货品管理-->
 	<div class="pro_management device">
-		<div class="com_tab">
+		<div class="com_tab" style="margin-bottom: 10px">
 			<ul class="fl" style="width: 100%">
 				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">企业产品库</a></li>
 				<li ng-class="{'active': tab == 'material_person'}"><a ui-sref="vendor_material_person">个人产品库</a></li>
@@ -1610,7 +1842,7 @@
 				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
 			</ul>
 		</div>
-		<div class="com_tab">
+		<div class="com_tab com_tab2" style="margin-bottom: 0px">
 			<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>
@@ -1668,13 +1900,13 @@
 								<span>全选</span>
 							</label>
 						</th>
-						<th width="80">序号</th>
-						<th width="180">产品名称(类目)</th>
-						<th width="200">产品型号</th>
-						<th width="150">品牌</th>
+						<th width="50">序号</th>
+						<th width="140">产品名称(类目)</th>
+						<th width="170">产品型号</th>
+						<th width="120">品牌</th>
 						<th width="100">单位</th>
 						<!--<th width="80">封装</th>-->
-						<th width="180">操作</th>
+						<th width="310">操作</th>
 					</tr>
 					</thead>
 					<tbody class="bg-show">
@@ -1731,6 +1963,7 @@
 							<!--<span ng-bind="material.encapsulation || '-'" title="{{material.encapsulation || '-'}}"></span>-->
 						<!--</td>-->
 						<td class="edit">
+							<span ng-click="lookActiveIndex($index, material)"><span>查看</span></span>/<span ng-click="setActiveIndex($index,material)"><span>编辑可替代型号</span></span>
 							<span name="delete-material" ng-show="!isBatch && !material.exPandOper && !material.addGoodsOper" ng-click="deleteMaterial(material)"><span>删除</span></span>
 							<span ng-show="!isBatch && !material.exPandOper && !material.addGoodsOper" ng-click="showShelfArea(material)">
 								<span ng-if="material.batchCount">添加产品</span>
@@ -2274,6 +2507,80 @@
 		</div>
 	</div>
 </div>
+<div class="com-modal-wrap" ng-if="setShowActive > -1">
+  <div class="edit-replace-box">
+    <div class="title">
+      <div>型号:<span>{{lookCmp}}</span></div>
+      <div>品牌:<span>{{lookBrand}}</span></div>
+      <i class="fa fa-close" ng-click="lookActiveIndex(-1)"></i>
+    </div>
+    <div class="content content3">
+      <div class="content-line content-line2">
+        <div class="leftline"></div>
+        <p class="toptitle">可替代型号:</p>
+        <div class="rightline"></div>
+      </div>
+			<div class="no-resulte" ng-if="resultDatalist.length == 0">暂无可替代型号,赶快去<a ng-click="updateIndex()">编辑</a>吧</div>
+      <div class="content_top" ng-if="resultDatalist.length > 0">
+        <div class="content_toptitle">型号</div>
+        <div class="content_toptitle">品牌</div>
+        <div class="line"></div>
+      </div>
+      <ul ng-if="resultDatalist.length > 0">
+        <li ng-repeat="list in resultDatalist">
+          <div class="sort">{{list.detno}}</div>
+          <div class="text">{{list.ptrCmpcode}}</div>
+          <div class="text">{{list.ptrBranden}}</div>
+        </li>
+      </ul>
+    </div>
+
+		<div class="reminfo" style="background: #fff;text-align: right;margin: 0px;padding-right: 20px;padding-top:5px;padding-bottom: 10px" ng-if="resultDatalist.length > 0">共<span style="color: #5078cb">{{resultDatalist.length}}</span>个可替代型号</div>
+    <div class="operate">
+      <span ng-click="lookActiveIndex(-1)" style="background: #5078cb">关闭</span>
+    </div>
+  </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 content2">
+			<div class="content-line">
+				<p>可替代型号:</p>
+			</div>
+			<div class="content-line" ng-repeat="(key, mate) in replaceMaterialList" on-finish-render="ngRepeatFinished">
+				<div class="form-item form-left">
+					<span><i>{{key + 1}}</i><em>*</em>型号:</span>
+					<input type="text" class="form-control" ng-readonly="mate.editable == false" ng-model="mate.ptrCmpcode" ng-focus="onFocus($event, 'similar-list1_'+ key, 'code', key)" ng-change="onCodeChange(mate.ptrCmpcode, key, $event)" ng-blur="onCodeBlur(key)" ng-class="{'error': errorObj[key].code == 1}" placeholder="请输入型号名称">
+					<ul class="similar-list" ng-class="'similar-list1_'+ key" 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-readonly="mate.editable == false" ng-model="mate.ptrBranden" ng-focus="onFocus($event, 'similar-list2_'+ key, 'brand', key)" ng-change="onBrandChange(mate.ptrBranden, key)" ng-blur="onBrandBlur(key)" ng-class="{'error': errorObj[key].brand == 1}" placeholder="请输入品牌名称">
+					<ul class="similar-list" ng-class="'similar-list2_'+ key" 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 && mate.editable != false" ng-click="setReplies('sub', key)"></i>
+					<i class="fa fa-plus-circle" ng-if="key == linearLength - 1 && mate.editable != false" ng-click="setReplies('add', key)"></i>
+				</div>
+			</div>
+		</div>
+
+		<div class="operate">
+			<div class="reminfo">
+				<a>*</a>您无权编辑和删除的替代型号,请联系贵公司管理员进行处理。
+			</div>
+			<span ng-click="setProductReplacesByPerson(replaceMaterialList)">确定</span>
+			<span ng-click="setActiveIndex(-1)">取消</span>
+		</div>
+	</div>
+</div>
 <!--一键匹配弹出框-->
 <div class="matchPop" ng-if="haveRepeat">
 	<div class="title">
@@ -2326,6 +2633,7 @@
 			</div>
 		</div>
 	</div>
+
 	<div class="footer">
 		<a ng-click="cancelChoose()">取消</a><a ng-click="ensureDeleteRepeat()">确认</a>
 	</div>
@@ -2360,10 +2668,94 @@
         width: 18px;
         height: 18px;
         margin-right: 5px;
-        background: url('static/img/vendor/images/upload-icon.png')no-repeat 0px 0px;
+        background: url('static/img/vendor/images/upload-icon.png') no-repeat 0px 0px;
         position: relative;
         top: 7px;
     }
+    .edit-replace-box .content .content-line2{
+      width: 409px;
+      margin: 0 auto
+    }
+    .edit-replace-box .content .content-line .leftline, .edit-replace-box .content .content-line .rightline{
+      height: 1px;
+      width: 150px;
+      background: #5078cb;
+      display: inline-block;
+      vertical-align: top;
+      margin-top: 8px;
+    }
+    .edit-replace-box .content .content-line p.toptitle{
+      text-align: center;
+      display: inline-block;
+      vertical-align: top;
+    }
+    .edit-replace-box .content .content_top {
+      font-size: 0;
+      margin: 0 20px;
+      position: relative;
+    }
+    .edit-replace-box .content .content_top div.content_toptitle {
+      font-size: 14px;
+      color: #333333;
+      text-align: center;
+      width: 50%;
+      display: inline-block;
+      margin-top: 12px;
+      height: 32px;
+      line-height: 32px;
+      background: #d9e3fa
+    }
+    .edit-replace-box .content .content_top div.line {
+      background: #bdd1fc;
+      width: 1px;
+      height: 24px;
+      position: absolute;
+      left: 50%;
+      top: 17px
+    }
+    .edit-replace-box .content3 ul{
+      margin: 0 20px;
+      overflow-y: auto;
+      max-height: 160px
+    }
+    .edit-replace-box .content3 ul li {
+      height: 32px;
+      line-height: 32px;
+      color: #333333;
+      font-size: 0;
+    }
+    .edit-replace-box .content3 ul li:nth-child(odd){
+      background: #eef2fd
+    }
+    .edit-replace-box .content3 ul li:nth-child(even) {
+      background: #f8f9fe
+    }
+    .edit-replace-box .content3 ul li .text{
+      font-size: 14px;
+      display: inline-block;
+      width: 40%;
+      text-align: center;
+    }
+    .edit-replace-box .content3 ul li div:nth-child(3){
+      width: 50%;
+    }
+    .edit-replace-box .content3 ul li .sort{
+      font-size: 14px;
+      display: inline-block;
+      width: 10%;
+      text-align: center;
+    }
+	  .edit-replace-box .content3 .no-resulte {
+			text-align: center;
+			padding: 15px 0;
+			color: #666
+		}
+		.edit-replace-box .content3 .no-resulte a {
+			color: #5078cb
+		}
+		.edit-replace-box .content3 .no-resulte a:hover {
+			text-decoration: underline !important;
+		}
 </style>
 
 <!--

+ 70 - 21
src/main/webapp/resources/view/vendor/forstore/vendor_material_person.html

@@ -34,6 +34,29 @@
 		cursor: pointer;
 		text-decoration: underline;
 	}
+	.com_tab ul li{
+		margin-left: 0px;
+		position: relative;
+	}
+	.pro_management .com_tab ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.pro_management .com_tab ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.pro_management .com_tab ul li.active:after{
+		display: block
+	}
 	.materrial-list span.length01{
 		width: 10% !important;
 	}
@@ -824,7 +847,7 @@
 		margin-left: 25px;
 	}
 	.com_tab ul.distance li:first-child {
-		margin-right: 20px;
+		margin-right: 0px;
 	}
 	.com_tab ul.distance li a.standard{
 		padding-top: 15px;
@@ -1500,13 +1523,17 @@
 		width: 884px;
 	}
 	.replace-row td > div > div .replace-item {
-		display: inline-block;
+		/*display: inline-block;*/
 		width: 50%;
 		text-align: left;
 		background: #f6fbfe;
 		float: left;
 		height: 32px;
 	}
+	.replace-row td > div > .Scrollactive {
+		max-height: 160px;
+		overflow-y: auto;
+	}
 	.replace-row td > div > div .replace-item:nth-child(2n-1) {
 		border-right: 1px solid #dde9fc;
 	}
@@ -1537,8 +1564,9 @@
 	.edit-replace-box {
 		position: fixed;
 		width: 510px;
-		top: 10%;
-		left: 33%;
+		top: 20%;
+		left: 50%;
+		margin-left: -255px;
 		/*-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);*/
@@ -1571,6 +1599,9 @@
 	.edit-replace-box .content {
 		padding: 9px 0;
 		background: #fff;
+		overflow-y: scroll;
+		max-height: 240px;
+		position: relative;
 	}
 	.edit-replace-box .content .content-line {
 		margin: 0 0 14px 0;
@@ -1633,14 +1664,24 @@
 	.edit-replace-box .content .content-line .form-item.form-right i {
 		cursor: pointer;
 	}
+	.edit-replace-box .reminfo {
+		font-size: 12px;
+		color: #333;
+		text-align: left;
+		text-indent: 12px;
+		margin-bottom: 12px;
+	}
+	.edit-replace-box .reminfo a {
+		color: #fa4701
+	}
 	.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;
+		padding-bottom: 20px;
 	}
 	.edit-replace-box .operate span {
 		display: inline-block;
@@ -1658,9 +1699,7 @@
 	}
 
 	.edit-replace-box .content .content-line .form-item ul.similar-list {
-		position: absolute;
-		top: 27px;
-		left: 89px;
+		position: fixed;
 		background: #fff;
 		border: 1px solid #b5b5b5;
 		z-index: 1;
@@ -1673,7 +1712,7 @@
 	}
 	.edit-replace-box .content .content-line .form-item.form-right ul.similar-list {
 		width: 140px;
-		left: 65px;
+		/*left: 65px;*/
 	}
 	.edit-replace-box .content .content-line .form-item ul.similar-list li {
 		height: 30px;
@@ -1714,7 +1753,7 @@
 		line-height: 15px;
 		text-decoration: none;
 		position: relative;
-		top: -3px;
+		top: -4px;
 		z-index: 1;
 	}
 	.open-more a i{
@@ -1759,6 +1798,12 @@
 	.device .wanted_list01 .open-more a:hover {
 		border-bottom: 1px dashed !important;
 	}
+	.result{
+		line-height: 35px;
+	}
+	.result span {
+		margin-left: 330px
+	}
 </style>
 <div class="user_right fr">
 	<!--货品管理-->
@@ -2223,7 +2268,7 @@
 						<td colspan="6">
 							<div>
 								<p>可替代型号:</p>
-								<div class="replace-list">
+								<div class="replace-list"  ng-class="{'Scrollactive': material.showMoreReplace} ">
 									<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>
@@ -2330,7 +2375,7 @@
 			</div>
 			<div class="wanted_list01">
 				<div style="width: 96%; margin: 0 auto">
-					<div class="com-result-line" ng-if="resultTip"><span class="fl"><em>*</em>匹配成为标准产品方可通过器件选型、参数搜索展示</span><a ng-click="closeTip()" class="fr">&times;</a></div>
+					<div class="result" ng-if="resultTip"><span class="fl"><em>*</em>匹配成为标准产品方可通过器件选型、参数搜索展示</span><a ng-click="closeTip()" class="fr">&times;</a></div>
 					<div class="tab-head">匹配失败的产品</div>
 					<table class="fail-tab public-tab table public-tabs">
 						<thead>
@@ -2478,26 +2523,30 @@
 			<div class="content-line">
 				<p>可替代型号:</p>
 			</div>
-			<div class="content-line" ng-repeat="(key, mate) in replaceMaterialList">
+			<div class="content-line" ng-repeat="(key, mate) in replaceMaterialList" on-finish-render="ngRepeatFinished">
 				<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>
+					<input type="text"  ng-readonly="mate.editable == false"  class="form-control" ng-model="mate.ptrCmpcode" ng-focus="onFocus($event, 'similar-list3_'+ key, 'code', key)" ng-change="onCodeChange(mate.ptrCmpcode, key)" ng-blur="onCodeBlur(key)" ng-class="{'error': errorObj[key].code == 1}" placeholder="请输入型号名称">
+					<ul class="similar-list" ng-class="'similar-list3_'+ key"  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)">
+					<input type="text"  ng-readonly="mate.editable == false"  class="form-control" ng-model="mate.ptrBranden" ng-focus="onFocus($event, 'similar-list4_'+ key, 'brand', key)" ng-change="onBrandChange(mate.ptrBranden, key)" ng-blur="onBrandBlur(key)" ng-class="{'error': errorObj[key].brand == 1}" placeholder="请输入品牌名称">
+                    <ul class="similar-list" ng-class="'similar-list4_'+ key" 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>
+					<i class="fa fa-minus-circle" ng-if="replaceMaterialList.length >= 1 && mate.editable != false" ng-click="setReplies('sub', key)"></i>
+					<i class="fa fa-plus-circle" ng-if="key == linearLength - 1 && mate.editable != false" ng-click="setReplies('add', key)"></i>
 				</div>
 			</div>
 		</div>
+
 		<div class="operate">
+			<div class="reminfo">
+				<a>*</a>您无权编辑和删除的替代型号,请联系贵公司管理员进行处理。
+			</div>
 			<span ng-click="setProductReplacesByPerson(replaceMaterialList)">确定</span>
 			<span ng-click="setActiveIndex(-1)">取消</span>
 		</div>

+ 24 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html

@@ -835,6 +835,29 @@
         line-height: 40px;
         text-align: center;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .pro_management .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .pro_management .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .pro_management .com_tab ul li.active:after{
+        display: block
+    }
 </style>
 <div class="user_right fr">
     <!--货品管理-->
@@ -858,7 +881,7 @@
         <div class="search-check">
             <div class="search fl check">
                 <input type="text" class="form-control" ng-model="keyword" ng-search="onSearch()" placeholder="产品型号/品牌/产品编码"/>
-                <button ng-click="onSearch()">搜索</button>
+                <button ng-click="onSearch()" style="float: left;">搜索</button>
                 <!--<a ng-click="downGoods()" class="down-goods-btn">批量导出</a>-->
                 <div class="operate-btn more-operate">
                     <span>更多操作</span>

+ 96 - 14
src/main/webapp/resources/view/vendor/forstore/vendor_order.html

@@ -1111,19 +1111,84 @@
 	.oder_list dl b.total{
 		margin-right: 0;
 	}
-
+	.oder01 ul {
+		border-bottom: 1px solid #f15601
+	}
+	.oder01 ul li {
+		margin-left: 10px;
+	}
 	.oder01 ul li a {
 		font-size: 13px;
 		font-weight: bold;
 	}
-	.oder01 ul li {
-		margin-left: 20px;
+
+	.com_tab ul li {
+		margin-left: 0px;
+		position: relative;
+		min-width: 110px
+	}
+	.com_tab ul li a {
+		min-width: 110px
+	}
+
+	.com_tab ul li::after{
+		background: url('static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.com_tab ul li.active:after{
+		display: block
+	}
+	.com_tab ul li.active a {
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.oder01 ul li a{
+		border-top: 3px solid #fff;
+		/*padding: 0 8px*/
+		min-width: 110px;
+	}
+	.oder01 ul li:nth-child(1){
+		margin-left: 0px
+	}
+	.oder01 ul li.active a{
+		border-top: 3px solid #f15601;
+		border-left: 1px solid #f15601;
+		border-right: 1px solid #f15601;
+		border-bottom: 1px solid #fff;
+		/*padding: 0 8px;*/
+		color: #f15601
+	}
+	.oder01 ul li a em{
+		color: #323232
+	}
+	.oder01 ul li.active a em{
+		color: #f15601 !important;
+	}
+	.oder01 ul li:hover a em {
+		color: #5078cb !important;
+	}
+	.oder01 ul li.active:hover a em {
+		color: #f15601 !important;
+	}
+	.screen{
+		background: #fff;
+		padding-top: 16px;
+		padding-bottom: 16px;
+		height: 66px;
 	}
 </style>
 <div class="user_right fr">
 	<!--订单中心-->
 	<div class="sellOder oder" id="sellOder">
-		<div class="com_tab">
+		<div class="com_tab" style="margin-bottom: 10px">
 			<ul class="fl" style="width: 100%">
 				<li ng-class="{'active': storeType=='other'}" ng-if="!isYrscStore && !isCONSIGNMENT"><a ng-click="setStoreType('other')">自营店铺</a></li>
 				<li ng-class="{'active': storeType=='mall'}"><a ng-click="setStoreType('mall')">库存寄售</a></li>
@@ -1137,16 +1202,16 @@
 				</li>
 			</ul>
 		</div>
-		<div class="oder01">
+		<div class="oder01" style="margin-bottom: 0px">
 			<ul>
 				<li ng-class="{'active': status=='all'}" ng-click="setActive('all')"><a> 所有订单(<em ng-class="{'color-black': !counts['all']}" ng-bind="counts['all'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='tobeconfirmed'}" ng-click="setActive('tobeconfirmed')"><a>待买家付款(<em ng-class="{'color-black': !counts['tobeconfirmed']}" ng-bind="counts['tobeconfirmed'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='comfirmed'}" ng-click="setActive('comfirmed')"><a>待发货(<em ng-class="{'color-black': !counts['comfirmed']}" ng-bind="counts['comfirmed'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='inbound'}" ng-click="setActive('inbound')"><a>待买家收货(<em ng-class="{'color-black': !counts['inbound']}" ng-bind="counts['inbound'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='tobepaid'}" ng-click="setActive('tobepaid')"><a>待收款(<em ng-class="{'color-black': !counts['tobepaid']}" ng-bind="counts['tobepaid'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='completed'}" ng-click="setActive('completed')"><a>成功的订单(<em ng-class="{'color-black': !counts['completed']}" ng-bind="counts['completed'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='unavailable'}" ng-click="setActive('unavailable')"><a>取消的订单(<em ng-class="{'color-black': !counts['unavailable']}" ng-bind="counts['unavailable'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='toBeReviewed'}" ng-click="setActive('toBeReviewed')"><a>售后中(<em ng-class="{'color-black': !counts['toBeReviewed']}" ng-bind="counts['toBeReviewed'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='tobeconfirmed'}" ng-click="setActive('tobeconfirmed')"><a>待买家付款(<em ng-class="{'color-black': !counts['tobeconfirmed']}" ng-bind="counts['tobeconfirmed'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='comfirmed'}" ng-click="setActive('comfirmed')"><a>待发货(<em ng-class="{'color-black': !counts['comfirmed']}" ng-bind="counts['comfirmed'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='inbound'}" ng-click="setActive('inbound')"><a>待买家收货(<em ng-class="{'color-black': !counts['inbound']}" ng-bind="counts['inbound'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='tobepaid'}" ng-click="setActive('tobepaid')"><a>待收款(<em ng-class="{'color-black': !counts['tobepaid']}" ng-bind="counts['tobepaid'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='completed'}" ng-click="setActive('completed')"><a>成功的订单(<em ng-class="{'color-black': !counts['completed']}" ng-bind="counts['completed'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='unavailable'}" ng-click="setActive('unavailable')"><a>取消的订单(<em ng-class="{'color-black': !counts['unavailable']}" ng-bind="counts['unavailable'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='toBeReviewed'}" ng-click="setActive('toBeReviewed')"><a>售后中(<em ng-class="{'color-black': !counts['toBeReviewed']}" ng-bind="counts['toBeReviewed'] || 0"></em>)</a></li>
 			</ul>
 		</div>
 		<!--<div class="screen">-->
@@ -1166,6 +1231,7 @@
 		<!--</div>-->
 		<!--</div>-->
 		<!--搜索时间筛选-->
+		<p class="height16">&nbsp;</p>
 		<div class="screen">
 			<div class="sreach fr">
 				<div class="date fl">
@@ -1203,6 +1269,7 @@
 				</div>
 			</div>
 		</div>
+		<p class="height16">&nbsp;</p>
 		<div class="oder_list" style="margin-top: 0px;">
 			<!--所有订单-->
 			<dl style="display: inline-block;" class="all_oder">
@@ -1255,11 +1322,26 @@
 						<span style="width: 25%;text-align: left;">订单号:<a class="hover-col" href="vendor#/purchase/detail/{{purchase.purchaseid | EncryptionFilter}}" target="_blank"><em ng-bind="purchase.orderid"></em></a></span>
 						<span style="width: 30%; text-align: center;">
                             <img src="static/img/user/images/shop_home.png">
-							<i ng-bind="purchase.buyentername" href="store/{{::purchase.storeid}}"></i>&nbsp;&nbsp;
+							<a ng-if="purchase.buyentername" ng-bind="purchase.buyentername" href="store/{{::purchase.storeid}}"></a>
+							<i ng-if="!purchase.buyentername" ng-bind="purchase.buyername"></i>&nbsp;&nbsp;
                         </span>
 						<span style="position: relative;">
                             <img src="static/img/common/songguo.png">
-                            <a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+							<div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
+                            	<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="chat.contactWithOther(!purchase.buyerenuu ? purchase.buyPhone : null, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+								<div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
+									<div class="title">
+									  <i ng-click="setShowLinkBox(false)"></i>
+									</div>
+									<div class="content">
+									  <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与买家在线沟通!</p>
+									  <p>买家联系电话:<span ng-bind="phone"></span></p>
+									  <div>
+										<a ng-click="setShowLinkBox(false)">我知道了</a>
+									  </div>
+									</div>
+								  </div>
+							</div>
 							<!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactBuyer(purchase)">联系买家</a>
                              <div name="{{purchase.id}}" class="buyer-contact" ng-if="purchase.active" ng-class="{true : 'buyer-contact-info', false : 'display-none'}[purchase.active]">
                                  <div class="contact-title">

+ 13 - 11
src/main/webapp/resources/view/vendor/forstore/vendor_store_apply.html

@@ -395,6 +395,7 @@
 	}
 	.com-result-line span {
 		margin-left: 160px;
+		line-height: 30px
 	}
 </style>
 <div class="container vendor_store_apply user_right">
@@ -412,14 +413,14 @@
 				<span>{{enterprise.enName}}</span>
 			</div>
 		</div>
-		<div class="row com_row">
+	<!--	<div class="row com_row">
 			<div class="col-md-2 custom_col">
 				<span>企业简称</span>
 			</div>
 			<div class="col-md-10 custom_col">
 				<span>{{enterprise.enShortname}}</span>
 			</div>
-		</div>
+		</div>-->
 		<!--<div class="row com_row" style="min-height: 40px; max-height: 240px;">
 			<div class="col-md-2 custom_col">
 				<span>营业执照</span>
@@ -504,15 +505,16 @@
 						<div class="row" style="margin: 0;">
 							<div class="col-md-5 col-md-offset-1 show_image_area show_image">
 								<div ng-if="qualifications[qType.businessLicense]">
-									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf" ng-src="{{qualifications[qType.businessLicense].resourceUrl}}"/>
+									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf && qualifications[qType.businessLicense].resourceUrl" ng-src="{{qualifications[qType.businessLicense].resourceUrl}}"/>
 									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && qualifications[qType.businessLicense].isPdf" src="static/img/vendor/store/timg.png"/>
 									<div class="hover-show" ng-if="qualifications[qType.businessLicense] && qualifications[qType.businessLicense].isPdf">
 										<span class="delete" ng-click="triggerDeleteTip(qType.businessLicense)" title="删除"><i class="fa fa-trash"></i></span>
 										<a target="_blank" ng-href="{{qualifications[qType.businessLicense].resourceUrl || 'javascript:void(0);'}}"><i class="fa fa-search"></i>查看</a>
 									</div>
+
 								</div>
-								<div image-upload data-src="static/img/example/upload-apply.png" on-success="onUploadQualification($data, qType.businessLicense)" ng-if="!qualifications[qType.businessLicense]" non-preview="true"></div>
-								<div class="hover-show" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf">
+								<div image-upload data-src="static/img/example/upload-apply.png" on-success="onUploadQualification($data, qType.businessLicense)" ng-if="!qualifications[qType.businessLicense].resourceUrl" non-preview="true"></div>
+								<div class="hover-show" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf && qualifications[qType.businessLicense].resourceUrl">
 									<span class="delete" ng-click="triggerDeleteTip(qType.businessLicense)" title="删除"><i class="fa fa-trash"></i></span>
 									<a ng-click="showQualification(qualifications[qType.businessLicense], true)"><i class="fa fa-search"></i>查看</a>
 								</div>
@@ -679,15 +681,15 @@
 						<div class="row" style="margin: 0;">
 							<div class="col-md-5 col-md-offset-1 show_image_area show_image">
 								<div ng-if="qualifications[qType.businessLicense]">
-									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf" ng-src="{{qualifications[qType.businessLicense].resourceUrl}}"/>
+									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf && qualifications[qType.businessLicense].resourceUrl" ng-src="{{qualifications[qType.businessLicense].resourceUrl}}"/>
 									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && qualifications[qType.businessLicense].isPdf" src="static/img/vendor/store/timg.png"/>
 									<div class="hover-show" ng-if="qualifications[qType.businessLicense] && qualifications[qType.businessLicense].isPdf">
 										<span class="delete" ng-click="triggerDeleteTip(qType.businessLicense)" title="删除"><i class="fa fa-trash"></i></span>
 										<a target="_blank" ng-href="{{qualifications[qType.businessLicense].resourceUrl || 'javascript:void(0);'}}" ><i class="fa fa-search"></i>查看</a>
 									</div>
 								</div>
-								<div image-upload data-src="static/img/example/upload-apply.png" on-success="onUploadQualification($data, qType.businessLicense)" ng-if="!qualifications[qType.businessLicense]" non-preview="true"></div>
-								<div class="hover-show" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf">
+								<div image-upload data-src="static/img/example/upload-apply.png" on-success="onUploadQualification($data, qType.businessLicense)" ng-if="!qualifications[qType.businessLicense].resourceUrl" non-preview="true"></div>
+								<div class="hover-show" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf && qualifications[qType.businessLicense].resourceUrl">
 									<span class="delete" ng-click="triggerDeleteTip(qType.businessLicense)" title="删除"><i class="fa fa-trash"></i></span>
 									<a ng-click="showQualification(qualifications[qType.businessLicense], true)"><i class="fa fa-search"></i>查看</a>
 								</div>
@@ -853,15 +855,15 @@
 						<div class="row" style="margin: 0;">
 							<div class="col-md-5 col-md-offset-1 show_image_area show_image">
 								<div ng-if="qualifications[qType.businessLicense]">
-									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf" ng-src="{{qualifications[qType.businessLicense].resourceUrl}}"/>
+									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf && qualifications[qType.businessLicense].resourceUrl" ng-src="{{qualifications[qType.businessLicense].resourceUrl}}"/>
 									<img class="previewImage" ng-if="qualifications[qType.businessLicense] && qualifications[qType.businessLicense].isPdf" src="static/img/vendor/store/timg.png"/>
 									<div class="hover-show" ng-if="qualifications[qType.businessLicense] && qualifications[qType.businessLicense].isPdf">
 										<span class="delete" ng-click="triggerDeleteTip(qType.businessLicense)" title="删除"><i class="fa fa-trash"></i></span>
 										<a target="_blank" ng-href="{{qualifications[qType.businessLicense].resourceUrl || 'javascript:void(0);'}}"><i class="fa fa-search"></i>查看</a>
 									</div>
 								</div>
-								<div image-upload data-src="static/img/example/upload-apply.png" on-success="onUploadQualification($data, qType.businessLicense)" ng-if="!qualifications[qType.businessLicense]" non-preview="true"></div>
-								<div class="hover-show" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf">
+								<div image-upload data-src="static/img/example/upload-apply.png" on-success="onUploadQualification($data, qType.businessLicense)" ng-if="!qualifications[qType.businessLicense].resourceUrl" non-preview="true"></div>
+								<div class="hover-show" ng-if="qualifications[qType.businessLicense] && !qualifications[qType.businessLicense].isPdf && qualifications[qType.businessLicense].resourceUrl">
 									<span class="delete" ng-click="triggerDeleteTip(qType.businessLicense)" title="删除"><i class="fa fa-trash"></i></span>
 									<a ng-click="showQualification(qualifications[qType.businessLicense], true)"><i class="fa fa-search"></i>查看</a>
 								</div>

+ 57 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_store_maintain.html

@@ -737,7 +737,32 @@
 					<input type="text" class="form-control" style="border-radius: inherit;" title="enFax" ng-pattern="/^[\d-]{0,20}$/" ng-model="sampleStore.enterprise.enFax" maxlength="20"/>
 				</div>
 			</div>
-		</div><!-- 店铺基础信息输入 end -->
+			<div class="row com_row" style="margin-top: 10px;">
+				<div class="col-md-2 custom_col">
+					<span>手&nbsp;&nbsp;&nbsp;&nbsp;机</span>
+				</div>
+				<div class="col-md-10 custom_col">
+					<input type="text" class="form-control enPhone" style="border-radius: inherit;" title="enPhone" ng-pattern="/^1[3|4|5|6|7|8|9][0-9]{9}$/" ng-blur="checkPhone()" ng-model="sampleStore.enterprise.enPhone" maxlength="11"/>
+				</div>
+			</div>
+			<div class="row com_row" style="margin-top: 10px;">
+				<div class="col-md-2 custom_col">
+					<span>微&nbsp;&nbsp;&nbsp;&nbsp;信</span>
+				</div>
+				<div class="col-md-10 custom_col">
+					<input type="text" class="form-control enWeixin" style="border-radius: inherit;" title="enWeixin" ng-pattern="/^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}$/" ng-blur="checkWeixin()" ng-model="sampleStore.enterprise.enWeixin"/>
+				</div>
+			</div>
+			<div class="row com_row" style="margin-top: 10px;">
+				<div class="col-md-2 custom_col">
+					<span>Q&nbsp;&nbsp;&nbsp;&nbsp;Q</span>
+				</div>
+				<div class="col-md-10 custom_col">
+					<input type="text" class="form-control enQQ" style="border-radius: inherit;" title="enQQ" ng-pattern="/^[1-9][0-9]{4,10}$/" ng-blur="checkQQ()" ng-model="sampleStore.enterprise.enQQ" maxlength="11"/>
+				</div>
+			</div>
+		</div>
+		<!-- 店铺基础信息输入 end -->
 		<!-- 店铺基础信息展示 start -->
 		<div style="margin-bottom: 20px;" ng-if="!editBasicInfo" class="width120">
 			<div class="row com_row title_row">
@@ -792,7 +817,7 @@
 			</div>-->
 			<div class="row com_row" style="margin-top: 10px;">
 				<div class="col-md-2 custom_col">
-					<span>地&nbsp;&nbsp;&nbsp;&nbsp;址</span>
+					<span>企业地址</span>
 				</div>
 				<div class="col-md-10 custom_col show_info">
 					<div>
@@ -820,6 +845,36 @@
 					</div>
 				</div>
 			</div>
+			<div class="row com_row" style="margin-top: 10px;">
+				<div class="col-md-2 custom_col">
+					<span>手&nbsp;&nbsp;&nbsp;&nbsp;机</span>
+				</div>
+				<div class="col-md-10 custom_col show_info">
+					<div>
+						{{sampleStore.enterprise.enPhone || '暂无信息'}}
+					</div>
+				</div>
+			</div>
+			<div class="row com_row" style="margin-top: 10px;">
+				<div class="col-md-2 custom_col">
+					<span>微&nbsp;&nbsp;&nbsp;&nbsp;信</span>
+				</div>
+				<div class="col-md-10 custom_col show_info">
+					<div>
+						{{sampleStore.enterprise.enWeixin || '暂无信息'}}
+					</div>
+				</div>
+			</div>
+			<div class="row com_row" style="margin-top: 10px;">
+				<div class="col-md-2 custom_col">
+					<span>Q&nbsp;&nbsp;&nbsp;&nbsp;Q</span>
+				</div>
+				<div class="col-md-10 custom_col show_info">
+					<div>
+						{{sampleStore.enterprise.enQQ || '暂无信息'}}
+					</div>
+				</div>
+			</div>
 		</div><!-- 店铺基础信息展示 end -->
 	</div>
 	<!-- 资质证明输入 start -->

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_take_self.html

@@ -235,6 +235,29 @@
 	.takeSelf .empty .empty-info i{
 		margin-right:5px;
 	}
+	.com_tab ul li{
+		margin-left: 0px;
+		position: relative;
+	}
+	.com_tab ul li.active a{
+		border-bottom: #fff;
+		background: #5078cb;
+		color: #fff;
+	}
+	.com_tab ul li::after{
+		background: url('/static/img/vendor/images/downicon.png');
+		width: 11px;
+		height: 6px;
+		position: absolute;
+		bottom: 0px;
+		left: 50%;
+		content: ' ';
+		margin-left: -5px;
+		display: none;
+	}
+	.com_tab ul li.active:after{
+		display: block
+	}
 </style>
 <!--右侧主体部分-->
 <div class="count user_right fr">

+ 24 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_undercarriage.html

@@ -547,6 +547,29 @@
     .device .wanted_list01 a.page-a:hover{
         color: #fff!important;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .pro_management .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .pro_management .com_tab ul li.active:after{
+        display: block
+    }
+    .pro_management .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
 </style>
 <div class="user_right fr">
     <!--货品管理-->
@@ -563,7 +586,7 @@
             <div class="search fl">
                 <input type="text" class="form-control" ng-model="keyword" ng-search="onSearch()" placeholder="类目/品牌/型号"/>
                 <button ng-click="onSearch()">搜索</button>
-                <a ng-click="downGoods()" class="down-goods-btn">批量导出</a>
+                <a ng-click="downGoods()" class="down-goods-btn" style="margin-top:0px">批量导出</a>
                 <form style="display: none;" id="down-load-goods" method="get">
                     <input type="hidden" name="ids" ng-value="localInfo.ids">
                 </form>

+ 23 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

@@ -494,6 +494,29 @@
         border: 1px solid #337ab7 !important;
         border-bottom: none !important;
     }
+    .com_tab ul li{
+        margin-left: 0px;
+        position: relative;
+    }
+    .com_tab ul li.active a{
+        border-bottom: #fff;
+        background: #5078cb;
+        color: #fff;
+    }
+    .com_tab ul li::after{
+        background: url('static/img/vendor/images/downicon.png');
+        width: 11px;
+        height: 6px;
+        position: absolute;
+        bottom: 0px;
+        left: 50%;
+        content: ' ';
+        margin-left: -5px;
+        display: none;
+    }
+    .com_tab ul li.active:after{
+        display: block
+    }
 </style>
 <div class="user_right fr">
     <!--货品管理-->

Some files were not shown because too many files changed in this diff