Browse Source

交易流程中扣仓库数的逻辑暂时隐藏。

yujia 8 years ago
parent
commit
b35e08ab18
22 changed files with 1496 additions and 783 deletions
  1. 4 4
      src/main/java/com/uas/platform/b2c/logistics/service/impl/InvoiceFPurchaseServiceImpl.java
  2. 13 0
      src/main/java/com/uas/platform/b2c/prod/commodity/constant/IntegerConstant.java
  3. 5 3
      src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/ProductFacadeImpl.java
  4. 129 0
      src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsHistory.java
  5. 16 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsHistoryService.java
  6. 11 12
      src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java
  7. 23 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java
  8. 21 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductStandardPutOnInfoService.java
  9. 67 8
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsHistoryServiceImpl.java
  10. 125 131
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java
  11. 46 1
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java
  12. 49 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductStandardPutOnInfoServiceImpl.java
  13. 8 3
      src/main/java/com/uas/platform/b2c/trade/presale/service/BrowsingHistoryService.java
  14. 2 2
      src/main/java/com/uas/platform/b2c/trade/presale/service/CartService.java
  15. 15 5
      src/main/java/com/uas/platform/b2c/trade/presale/service/impl/BrowsingHistoryServiceImpl.java
  16. 4 6
      src/main/java/com/uas/platform/b2c/trade/presale/service/impl/CartServiceImpl.java
  17. 11 11
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js
  18. 639 189
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_onSaleCtrl.js
  19. 1 1
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_undercarriageCtrl.js
  20. 10 12
      src/main/webapp/resources/view/vendor/forstore/vendor_material.html
  21. 295 393
      src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html
  22. 2 2
      src/main/webapp/resources/view/vendor/forstore/vendor_undercarriage.html

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

@@ -340,10 +340,10 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
 		}
 
 		//从标准品中做出库动作
-		ResultMap resultMap = productService.deductRepositoryQty(purchase);
-		if(resultMap.getCode() != CodeType.OK.code()) {
-			return resultMap;
-		}
+//		ResultMap resultMap = productService.deductRepositoryQty(purchase);
+//		if(resultMap.getCode() != CodeType.OK.code()) {
+//			return resultMap;
+//		}
 
 		return ResultMap.success(inFpu);
 	}

+ 13 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/constant/IntegerConstant.java

@@ -0,0 +1,13 @@
+package com.uas.platform.b2c.prod.commodity.constant;
+
+/**
+ * integer 的常量
+ *
+ * @author yuj 2017-09-02 22:48
+ */
+public class IntegerConstant {
+
+    public static final Integer B2C_SALE = 2;
+
+    public static final Integer SELF_SALE = 1;
+}

+ 5 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/ProductFacadeImpl.java

@@ -1,17 +1,18 @@
 package com.uas.platform.b2c.prod.commodity.facade.impl;
 
 import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
 import com.uas.platform.b2c.prod.commodity.facade.ProductFacade;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.Product;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
 import com.uas.platform.b2c.prod.product.component.modal.Component;
 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.service.StoreInService;
-import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -68,7 +69,8 @@ public class ProductFacadeImpl implements ProductFacade {
 		if (isSelfSupport) {
 			Enterprise enterprise = SystemSession.getUser().getEnterprise();
 			assert enterprise != null;
-			store = storeInService.findByEnUU(enterprise.getUu());
+			StoreIn storeIn = storeInService.findByEnUU(enterprise.getUu());
+			store = storeIn.getStatus() == StoreStatus.OPENED ? storeIn : null;
 		} else {
 			store = storeInService.findByUuid(sysConf.getStoreid());
 		}

+ 129 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsHistory.java

@@ -307,6 +307,54 @@ public class GoodsHistory {
 	@Column(name = "go_b2cmindelivery")
 	private Short b2cMinDelivery;
 
+	/**
+	 * 自己送货到大陆最短时间
+	 */
+	@Column(name = "go_selfdeliverydemintime")
+	private Short selfDeliveryDemMinTime;
+
+	/**
+	 * 自己送货到大陆最长时间
+	 */
+	@Column(name = "go_selfdeliverydemaxtime")
+	private Short selfDeliveryDemMaxTime;
+
+	/**
+	 * 自己送货到香港最长时间
+	 */
+	@Column(name = "go_selfdeliveryhkmaxtime")
+	private Short selfDeliveryHKMaxTime;
+
+	/**
+	 * 自己送货到香港最短时间
+	 */
+	@Column(name = "go_selfdeliveryhkmintime")
+	private Short selftDeliveryHKMinTime;
+
+	/**
+	 * 商城送货到大陆最长时间
+	 */
+	@Column(name = "go_b2cdeliverydemaxtime")
+	private Short b2cDeliveryDemMaxTime;
+
+	/**
+	 * 商城送货到大陆最短时间
+	 */
+	@Column(name = "go_b2cdeliverydemintime")
+	private Short b2cDeliveryDemMinTime;
+
+	/**
+	 * 商城送货到香港最长时间
+	 */
+	@Column(name = "go_b2cdeliveryhkmaxtime")
+	private Short b2cDeliveryHKMaxTime;
+
+	/**
+	 * 商城送货到香港最短时间
+	 */
+	@Column(name = "go_b2cdeliveryhkmintime")
+	private Short b2cDeliveryHKMinTime;
+
 	/**
 	 * 产品主键
 	 */
@@ -930,5 +978,86 @@ public class GoodsHistory {
 		this.productid = goods.getProductid();
 		this.standprodid = goods.getStandprodid();
 		this.lastReserve = goods.getLastReserve();
+		this.b2cDeliveryDemMaxTime = goods.getB2cDeliveryDemMaxTime();
+		this.b2cDeliveryDemMinTime = goods.getB2cDeliveryDemMinTime();
+		this.b2cDeliveryHKMaxTime = goods.getB2cDeliveryHKMaxTime();
+		this.b2cDeliveryHKMinTime = goods.getB2cDeliveryHKMinTime();
+		this.selfDeliveryDemMaxTime = goods.getSelfDeliveryDemMaxTime();
+		this.selfDeliveryDemMinTime = goods.getSelfDeliveryDemMinTime();
+		this.selfDeliveryHKMaxTime = goods.getSelfDeliveryHKMaxTime();
+		this.selftDeliveryHKMinTime = goods.getSelfDeliveryHKMinTime();
+		this.updateDate = new Date();
     }
+
+	public Short getSelfDeliveryDemMinTime() {
+		return selfDeliveryDemMinTime;
+	}
+
+	public GoodsHistory setSelfDeliveryDemMinTime(Short selfDeliveryDemMinTime) {
+		this.selfDeliveryDemMinTime = selfDeliveryDemMinTime;
+		return this;
+	}
+
+	public Short getSelfDeliveryDemMaxTime() {
+		return selfDeliveryDemMaxTime;
+	}
+
+	public GoodsHistory setSelfDeliveryDemMaxTime(Short selfDeliveryDemMaxTime) {
+		this.selfDeliveryDemMaxTime = selfDeliveryDemMaxTime;
+		return this;
+	}
+
+	public Short getSelfDeliveryHKMaxTime() {
+		return selfDeliveryHKMaxTime;
+	}
+
+	public GoodsHistory setSelfDeliveryHKMaxTime(Short selfDeliveryHKMaxTime) {
+		this.selfDeliveryHKMaxTime = selfDeliveryHKMaxTime;
+		return this;
+	}
+
+	public Short getSelftDeliveryHKMinTime() {
+		return selftDeliveryHKMinTime;
+	}
+
+	public GoodsHistory setSelftDeliveryHKMinTime(Short selftDeliveryHKMinTime) {
+		this.selftDeliveryHKMinTime = selftDeliveryHKMinTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryDemMaxTime() {
+		return b2cDeliveryDemMaxTime;
+	}
+
+	public GoodsHistory setB2cDeliveryDemMaxTime(Short b2cDeliveryDemMaxTime) {
+		this.b2cDeliveryDemMaxTime = b2cDeliveryDemMaxTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryDemMinTime() {
+		return b2cDeliveryDemMinTime;
+	}
+
+	public GoodsHistory setB2cDeliveryDemMinTime(Short b2cDeliveryDemMinTime) {
+		this.b2cDeliveryDemMinTime = b2cDeliveryDemMinTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryHKMaxTime() {
+		return b2cDeliveryHKMaxTime;
+	}
+
+	public GoodsHistory setB2cDeliveryHKMaxTime(Short b2cDeliveryHKMaxTime) {
+		this.b2cDeliveryHKMaxTime = b2cDeliveryHKMaxTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryHKMinTime() {
+		return b2cDeliveryHKMinTime;
+	}
+
+	public GoodsHistory setB2cDeliveryHKMinTime(Short b2cDeliveryHKMinTime) {
+		this.b2cDeliveryHKMinTime = b2cDeliveryHKMinTime;
+		return this;
+	}
 }

+ 16 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsHistoryService.java

@@ -84,4 +84,20 @@ public interface GoodsHistoryService {
      * @return result map
      */
     ResultMap modifyGoodsHitory();
+
+    /**
+     * 通过库存初始化历史库存
+     * @param goods
+     * @return
+     */
+    GoodsHistory initByGoods(Goods goods, GoodsHistory.OperateType type);
+
+
+    /**
+     * 对比批次变化并记录批次改动信息
+     *
+     * @param goodsHistory
+     * @return
+     */
+    String compareGoodsHistory(GoodsHistory goodsHistory);
 }

+ 11 - 12
src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java

@@ -2,10 +2,10 @@ package com.uas.platform.b2c.prod.commodity.service;
 
 import com.uas.api.b2c_erp.seller.model.GoodsFUas;
 import com.uas.api.b2c_erp.seller.model.GoodsSimpleUas;
-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.GoodsInfo;
-import com.uas.platform.b2c.prod.commodity.model.GoodsSimple;
+import com.uas.platform.b2c.prod.commodity.model.*;
+import com.uas.platform.b2c.trade.order.model.Order;
+import com.uas.platform.b2c.trade.presale.model.Cart;
+import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
@@ -243,14 +243,6 @@ public interface GoodsService {
      */
     void setB2CDelayTime(Goods goods);
 
-    /**
-     * 对比批次变化并记录批次改动信息
-     *
-     * @param goodsHistory the goods history
-     * @return string
-     */
-    String compareGoodsHistory(GoodsHistory goodsHistory);
-
     /**
      * 添加或修改商品价格信息
      *
@@ -539,4 +531,11 @@ public interface GoodsService {
      * @return
      */
     ResultMap validGoodsIsChange(String batchCode, String storeuuid);
+
+
+    /**
+     * 更新库存的相关信息
+     * @return
+     */
+    ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, ProductStandardPutOnInfo putOnInfo, GoodsHistory goodsHistory, Goods goods);
 }

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

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.prod.commodity.service;
 
 import com.uas.platform.b2c.prod.commodity.model.Product;
+import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
 import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
@@ -79,6 +80,14 @@ public interface ProductService {
      */
     public String updateProduct(Product product);
 
+    /**
+     * 根据库存信息 保存对产品包装,包装数量,生产日期的修改
+     *
+     * @param putOnInfo the putOnInfo
+     * @return the string
+     */
+    Product updateProduct(ProductStandardPutOnInfo putOnInfo);
+
     /**
      * 扣减库存
      *
@@ -86,4 +95,18 @@ public interface ProductService {
      * @return result map
      */
     ResultMap deductRepositoryQty(Purchase purchase);
+
+    /**
+     * 保存产品库信息
+     * @param product
+     * @return
+     */
+    Product save(Product product);
+
+    /**
+     * 批量保存产品库信息
+     * @param products
+     * @return
+     */
+    List<Product> save(List<Product> products);
 }

+ 21 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductStandardPutOnInfoService.java

@@ -35,6 +35,13 @@ public interface ProductStandardPutOnInfoService {
      */
     ResultMap updateProductStandardPutOnInfoByBatch();
 
+    /**
+     * 根据库存信息更新标准上架信息
+     * @param goods 库存
+     * @return
+     */
+    ProductStandardPutOnInfo updateProductStandardPutOnInfoByGoods(Goods goods);
+
     /**
      * 一键更新标准上架信息,将可上架数变为在售数量
      *
@@ -91,4 +98,18 @@ public interface ProductStandardPutOnInfoService {
      * @return result map
      */
     public ResultMap updateAvailableQty(Long id, Double qty);
+
+    /**
+     * 单个保存标准上架信息
+     * @param putOnInfo 上架信息
+     * @return
+     */
+    ProductStandardPutOnInfo save(ProductStandardPutOnInfo putOnInfo);
+
+    /**
+     * 批量保存标准上架信息
+     * @param putOnInfos 标准上架信息
+     * @return
+     */
+    List<ProductStandardPutOnInfo> save(List<ProductStandardPutOnInfo> putOnInfos);
 }

+ 67 - 8
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsHistoryServiceImpl.java

@@ -3,15 +3,14 @@ package com.uas.platform.b2c.prod.commodity.service.impl;
 
 import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
 import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.utils.FastjsonUtils;
 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.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.service.GoodsHistoryService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
@@ -42,13 +41,10 @@ public class GoodsHistoryServiceImpl implements GoodsHistoryService {
 
 	@Autowired
 	private EnterpriseDao enterpriseDao;
-	
-	@Autowired
-	private GoodsService goodsService;
 
 	@Autowired
 	private GoodsDao goodsDao;
-	
+
 	@Override
 	public GoodsHistory save(GoodsHistory goodsHistory) {
 		return goodsHistoryDao.save(goodsHistory);
@@ -136,7 +132,7 @@ public class GoodsHistoryServiceImpl implements GoodsHistoryService {
 		goodsHistory.setOperateDate(new Date());
 		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
 		goodsHistory.setOperateType(type);
-		goodsHistory.setMessage(goodsService.compareGoodsHistory(goodsHistory));
+		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
 		return goodsHistory;
 	}
 
@@ -236,4 +232,67 @@ public class GoodsHistoryServiceImpl implements GoodsHistoryService {
 		List<GoodsHistory> histories = goodsHistoryDao.save(goodsHistories);
 		return ResultMap.success(histories);
 	}
+
+
+	/**
+	 * 通过库存初始化历史库存
+	 *
+	 * @param goods
+	 * @param type
+	 * @return
+	 */
+	@Override
+	public GoodsHistory initByGoods(Goods goods, GoodsHistory.OperateType type) {
+		// 记录批此历史信息
+		GoodsHistory goodsHistory = new GoodsHistory(goods);
+		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
+		goodsHistory.setOperateType(GoodsHistory.OperateType.Update.getPhrase());
+		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
+		return goodsHistory;
+	}
+
+	/**
+	 * 对比批次变化并记录批次改动信息
+	 *
+	 * @param goodsHistory
+	 * @return
+	 */
+	@Override
+	public String compareGoodsHistory(GoodsHistory goodsHistory) {
+		String message = "";
+		GoodsHistory oldgoodGoodsHistory = goodsHistoryDao.findNewByBatchCode(goodsHistory.getBatchCode());
+		if (oldgoodGoodsHistory == null) {
+			return message;
+		}
+		if (oldgoodGoodsHistory.getReserve() > goodsHistory.getReserve()
+				|| oldgoodGoodsHistory.getReserve() < goodsHistory.getReserve()) {
+			message += "库存变化:" + oldgoodGoodsHistory.getReserve() + "-->" + goodsHistory.getReserve() + ";";
+		}
+		if (oldgoodGoodsHistory.getMinBuyQty() > goodsHistory.getMinBuyQty()
+				|| oldgoodGoodsHistory.getMinBuyQty() < goodsHistory.getMinBuyQty()) {
+			message += "最小起订量变化:" + oldgoodGoodsHistory.getMinBuyQty() + "-->" + goodsHistory.getMinBuyQty() + ";";
+		}
+		if (oldgoodGoodsHistory.getMinPackQty() > goodsHistory.getMinPackQty()
+				|| oldgoodGoodsHistory.getMinPackQty() < goodsHistory.getMinPackQty()) {
+			message += "最小包装量变化:" + oldgoodGoodsHistory.getMinPackQty() + "-->" + goodsHistory.getMinPackQty() + ";";
+		}
+		if (oldgoodGoodsHistory.getPackaging() != goodsHistory.getPackaging()) {
+			message += "包装变化:" + oldgoodGoodsHistory.getPackaging() + "-->" + goodsHistory.getPackaging() + ";";
+		}
+		if (oldgoodGoodsHistory.getProduceDate() != goodsHistory.getProduceDate()) {
+			message += "生产日期变化:" + oldgoodGoodsHistory.getProduceDate() + "-->" + goodsHistory.getProduceDate() + ";";
+		}
+		if (!oldgoodGoodsHistory.getQtyPrice().equals(goodsHistory.getQtyPrice())) {
+			message += "价格变化 ;";
+		}
+		// TODO huxz 交货周期
+		if (oldgoodGoodsHistory.getMaxDelivery() != goodsHistory.getMaxDelivery() || oldgoodGoodsHistory.getMinDelivery() != goodsHistory.getMinDelivery()) {
+			message += "交货周期变化:" + oldgoodGoodsHistory.getMaxDelivery() + "-->"+ goodsHistory.getMaxDelivery() + "," +
+					oldgoodGoodsHistory.getMinDelivery() + "->" + goodsHistory.getMinDelivery();
+		}
+		if (!Objects.equals(oldgoodGoodsHistory.getRemark(), goodsHistory.getRemark())) {
+			message += "备注变化:" + oldgoodGoodsHistory.getRemark() + "-->" + goodsHistory.getRemark() + ";";
+		}
+		return message;
+	}
 }

+ 125 - 131
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -14,13 +14,11 @@ import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.DoubleArith;
 import com.uas.platform.b2c.core.utils.NumberUtil;
 import com.uas.platform.b2c.external.erp.commodity.util.ModelConverter;
+import com.uas.platform.b2c.prod.commodity.constant.IntegerConstant;
 import com.uas.platform.b2c.prod.commodity.dao.*;
 import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.model.GoodsHistory.OperateType;
-import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsPriceInfoService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.prod.commodity.service.ProductStandardPutOnInfoService;
+import com.uas.platform.b2c.prod.commodity.service.*;
 import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
@@ -29,6 +27,8 @@ import com.uas.platform.b2c.prod.product.kind.model.Kind;
 import com.uas.platform.b2c.prod.product.kind.service.KindService;
 import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 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.service.StoreInService;
 import com.uas.platform.b2c.trade.order.dao.OrderDao;
 import com.uas.platform.b2c.trade.order.dao.OrderDetailDao;
 import com.uas.platform.b2c.trade.order.dao.ProofingDao;
@@ -39,6 +39,8 @@ import com.uas.platform.b2c.trade.order.service.OrderDetailService;
 import com.uas.platform.b2c.trade.order.service.OrderService;
 import com.uas.platform.b2c.trade.order.type.ResultMapType;
 import com.uas.platform.b2c.trade.presale.dao.TradeDeliveryDelayTimeDao;
+import com.uas.platform.b2c.trade.presale.model.Cart;
+import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
 import com.uas.platform.b2c.trade.presale.model.TradeDeliveryDelayTime;
 import com.uas.platform.b2c.trade.presale.service.BrowsingHistoryService;
 import com.uas.platform.b2c.trade.presale.service.CartService;
@@ -99,6 +101,8 @@ public class GoodsServiceImpl implements GoodsService {
 
     private final KindService kindService;
     private final StoreInDao storeInDao;
+
+	private final StoreInService storeInService;
     /**
      * 控制任务提交速度的线程池
      */
@@ -156,6 +160,9 @@ public class GoodsServiceImpl implements GoodsService {
 
 	private final ProductDao productDao;
 
+	@Autowired
+	private ProductService productService;
+
 	private final BrowsingHistoryService browsingHistoryService;
 
     @Autowired
@@ -173,9 +180,10 @@ public class GoodsServiceImpl implements GoodsService {
 	private OrderDetailService detailService;
 
 	@Autowired
-	public GoodsServiceImpl(KindService kindService, StoreInDao storeInDao, ProductStandardPutOnInfoDao productStandardPutOnInfoDao, ProductDao productDao, BrowsingHistoryService browsingHistoryService, RecommendProductService recommendProductService) {
+	public GoodsServiceImpl(KindService kindService, StoreInDao storeInDao, StoreInService storeInService, ProductStandardPutOnInfoDao productStandardPutOnInfoDao, ProductDao productDao, BrowsingHistoryService browsingHistoryService, RecommendProductService recommendProductService) {
 		this.kindService = kindService;
 		this.storeInDao = storeInDao;
+		this.storeInService = storeInService;
 		this.productStandardPutOnInfoDao = productStandardPutOnInfoDao;
 		this.productDao = productDao;
 		this.browsingHistoryService = browsingHistoryService;
@@ -248,21 +256,21 @@ public class GoodsServiceImpl implements GoodsService {
         if(StringUtils.isEmpty(currencyName)) {
 			throw new IllegalOperatorException("库存的币别信息缺失");
         }
-        Double end = -1d;
+        Double end = Double.MIN_VALUE;
         for (GoodsQtyPrice price : prices) {
-            if(price.getStart().longValue() >= price.getEnd().longValue()) {
+            if(NumberUtil.compare(price.getStart(), price.getEnd()) > - 1) {
 				throw new IllegalOperatorException("分段价格中存在分段起始值大于分段结束值");
             }
-            if(end.longValue() >= price.getStart().longValue()) {
+            if(NumberUtil.compare(end, price.getStart()) > -1) {
 				throw new IllegalOperatorException("分段价格中存在前一个分段结束值大于等于分段起始值");
             }
             if(currencyName.contains("USD")) {
-                if(price.getUSDPrice() == null || price.getUSDPrice().longValue() < 0) {
+                if(price.getUSDPrice() == null || price.getUSDPrice() < 0) {
 					throw new IllegalOperatorException("库存的币别信息包含美金,而分段价格中的美金价格不存在或小于0");
                 }
             }
             if(currencyName.contains("RMB")) {
-                if(price.getRMBPrice() == null || price.getRMBPrice().longValue() < 0) {
+                if(price.getRMBPrice() == null || price.getRMBPrice() < 0) {
 					throw new IllegalOperatorException("库存的币别信息包含人民币,而分段价格中的人民币价格不存在或小于0");
                 }
             }
@@ -308,51 +316,6 @@ public class GoodsServiceImpl implements GoodsService {
 		return goods;
 	}
 
-	/**
-	 * 对比批次变化并记录批次改动信息
-	 * 
-	 * @param goodsHistory
-	 * @return
-	 */
-	@Override
-	public String compareGoodsHistory(GoodsHistory goodsHistory) {
-		String message = "";
-		GoodsHistory oldgoodGoodsHistory = goodsHistoryDao.findNewByBatchCode(goodsHistory.getBatchCode());
-		if (oldgoodGoodsHistory == null) {
-			return message;
-		}
-		if (oldgoodGoodsHistory.getReserve() > goodsHistory.getReserve()
-				|| oldgoodGoodsHistory.getReserve() < goodsHistory.getReserve()) {
-			message += "库存变化:" + oldgoodGoodsHistory.getReserve() + "-->" + goodsHistory.getReserve() + ";";
-		}
-		if (oldgoodGoodsHistory.getMinBuyQty() > goodsHistory.getMinBuyQty()
-				|| oldgoodGoodsHistory.getMinBuyQty() < goodsHistory.getMinBuyQty()) {
-			message += "最小起订量变化:" + oldgoodGoodsHistory.getMinBuyQty() + "-->" + goodsHistory.getMinBuyQty() + ";";
-		}
-		if (oldgoodGoodsHistory.getMinPackQty() > goodsHistory.getMinPackQty()
-				|| oldgoodGoodsHistory.getMinPackQty() < goodsHistory.getMinPackQty()) {
-			message += "最小包装量变化:" + oldgoodGoodsHistory.getMinPackQty() + "-->" + goodsHistory.getMinPackQty() + ";";
-		}
-		if (oldgoodGoodsHistory.getPackaging() != goodsHistory.getPackaging()) {
-			message += "包装变化:" + oldgoodGoodsHistory.getPackaging() + "-->" + goodsHistory.getPackaging() + ";";
-		}
-		if (oldgoodGoodsHistory.getProduceDate() != goodsHistory.getProduceDate()) {
-			message += "生产日期变化:" + oldgoodGoodsHistory.getProduceDate() + "-->" + goodsHistory.getProduceDate() + ";";
-		}
-		if (!oldgoodGoodsHistory.getQtyPrice().equals(goodsHistory.getQtyPrice())) {
-			message += "价格变化 ;";
-		}
-		// TODO huxz 交货周期
-		if (oldgoodGoodsHistory.getMaxDelivery() != goodsHistory.getMaxDelivery() || oldgoodGoodsHistory.getMinDelivery() != goodsHistory.getMinDelivery()) {
-			message += "交货周期变化:" + oldgoodGoodsHistory.getMaxDelivery() + "-->"+ goodsHistory.getMaxDelivery() + "," +
-					oldgoodGoodsHistory.getMinDelivery() + "->" + goodsHistory.getMinDelivery();
-		}
-		if (!Objects.equals(oldgoodGoodsHistory.getRemark(), goodsHistory.getRemark())) {
-			message += "备注变化:" + oldgoodGoodsHistory.getRemark() + "-->" + goodsHistory.getRemark() + ";";
-		}
-		return message;
-	}
-
 	@Override
 	public List<Goods> findGoodsByUuid(String uuid) {
 		return goodsDao.findByUuid(uuid);
@@ -450,12 +413,12 @@ public class GoodsServiceImpl implements GoodsService {
 		}
 		Double reserve = goods.getReserve() - number;
 		//更新相应标准上架和标准产品信息
-		if(goods.getSourceId() == null) {
-			ResultMap resultMap = productStandardPutOnInfoService.updateOnSaleQty(goods, reserve);
-			if(resultMap.getCode() != CodeType.OK.code()) {
-				return resultMap;
-			}
-		}
+//		if(goods.getSourceId() == null) {
+//			ResultMap resultMap = productStandardPutOnInfoService.updateOnSaleQty(goods, reserve);
+//			if(resultMap.getCode() != CodeType.OK.code()) {
+//				return resultMap;
+//			}
+//		}
 
 		goods.setReserve(reserve);
 		// 检查是否小于最小发货量
@@ -464,11 +427,7 @@ public class GoodsServiceImpl implements GoodsService {
 		}
 		goodsDao.modifyReserve(goods.getBatchCode(), goods.getUuid(), goods.getReserve(), goods.getStatus().intValue());
 		// 每次批次保存同时保存一遍历史信息
-		GoodsHistory goodsHistory = new GoodsHistory(goods);
-		goodsHistory.setOperateDate(new Date());
-		goodsHistory.setOperateType(GoodsHistory.OperateType.DeductReserve.getPhrase());
-		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
-		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
+		GoodsHistory goodsHistory = goodsHistoryService.initByGoods(goods, GoodsHistory.OperateType.DeductReserve);
 		goodsHistoryService.save(goodsHistory);
 		// 更新器件属性的库存
 		updateComponentTradeInfos(goods.getUuid());
@@ -508,11 +467,7 @@ public class GoodsServiceImpl implements GoodsService {
 
 		goodsDao.modifyReserve(goods.getBatchCode(), goods.getUuid(), goods.getReserve(), goods.getStatus().intValue());
 		// 每次批次保存同时保存一遍历史信息
-		GoodsHistory goodsHistory = new GoodsHistory(goods);
-		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
-		goodsHistory.setOperateDate(new Date());
-		goodsHistory.setOperateType(GoodsHistory.OperateType.ReleaseReserve.getPhrase());
-		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
+		GoodsHistory goodsHistory = goodsHistoryService.initByGoods(goods, GoodsHistory.OperateType.ReleaseReserve);
 		goodsHistoryService.save(goodsHistory);
 		// 更新器件属性的库存
 		updateComponentTradeInfos(goods.getUuid());
@@ -572,7 +527,12 @@ public class GoodsServiceImpl implements GoodsService {
 
 		if(!StringUtils.isEmpty(goods.getStoreid())) {
 			StoreIn storeIn = storeInDao.findByUuid(goods.getStoreid());
-			goods.setStoreName(storeIn.getStoreName());
+			if(storeIn.getStatus() == StoreStatus.OPENED) {
+				goods.setStoreName(storeIn.getStoreName());
+			}else {
+				throw new IllegalOperatorException("该公司还为开店铺,不能选择自营销售");
+			}
+
 		}
 	}
 
@@ -1100,12 +1060,15 @@ public class GoodsServiceImpl implements GoodsService {
 		if (nowGoods.getSourceId() != null) {
 			return new ResultMap(CodeType.NOT_PERMIT.code(), "该库存的信息属于UAS上架,平台不能修改。");
 		}
-		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(goods.getProductid());
-		if(putOnInfo != null) {
-			if(nowGoods.validProductStandardPutOnInfoAndGoodsSameData(putOnInfo)) {
-				return new ResultMap(CodeType.INFO_UPDATE.code(), "数据已经被更新了请刷新之后重新操作");
-			}
+		if(nowGoods.getReserve().doubleValue() != goods.getOldReserve().doubleValue()) {
+			return new ResultMap(CodeType.INFO_UPDATE.code(), "该库存的信息已经被修改了,请刷新界面之后重新操作。");
 		}
+//		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
+//		if(putOnInfo != null) {
+//			if(nowGoods.validProductStandardPutOnInfoAndGoodsSameData(putOnInfo)) {
+//				return new ResultMap(CodeType.INFO_UPDATE.code(), "数据已经被更新了请刷新之后重新操作");
+//			}
+//		}
 		resultGoods = updateGoods(nowGoods, goods);
 		updateComponentTradeInfos(nowGoods.getUuid());
 		return ResultMap.success(resultGoods);
@@ -1121,15 +1084,21 @@ public class GoodsServiceImpl implements GoodsService {
 	@Transactional
 	public Goods updateGoods(Goods nowGoods, Goods oldGoods) {
 		Goods resultGoods = null;
-		GoodsHistory goodsHistory = null;
 		nowGoods.setMaxDelivery(oldGoods.getMaxDelivery());
 		nowGoods.setMinDelivery(oldGoods.getMinDelivery());
+		nowGoods.setSelfDeliveryDemMaxTime(oldGoods.getSelfDeliveryDemMaxTime());
+		nowGoods.setSelfDeliveryDemMinTime(oldGoods.getSelfDeliveryDemMinTime());
+		nowGoods.setSelfDeliveryHKMaxTime(oldGoods.getSelfDeliveryHKMaxTime());
+		nowGoods.setSelfDeliveryHKMinTime(oldGoods.getSelfDeliveryHKMinTime());
 		// 设置货到香港,货到大陆的延长时间
 		setB2CDelayTime(nowGoods);
 
 		nowGoods.setUpdateDate(new Date());
 		nowGoods.setImg(oldGoods.getImg());
 		nowGoods.setMinBuyQty(oldGoods.getMinBuyQty());
+		nowGoods.setMinPackQty(oldGoods.getMinPackQty());
+		nowGoods.setReserve(oldGoods.getReserve());
+		nowGoods.setPackaging(oldGoods.getPackaging());
 		// 用含税单价同步未含税单价
 		oldGoods.setWithOutTaxRMBPrice();
 		oldGoods.setWithOutTaxUSDPrice();
@@ -1150,37 +1119,33 @@ public class GoodsServiceImpl implements GoodsService {
 		if(resultMap.getCode() != CodeType.OK.code()) {
 			return null;
 		}
-		// 记录批此历史信息
-		goodsHistory = new GoodsHistory(nowGoods);
-		goodsHistory.setOperateDate(new Date());
-		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
-		goodsHistory.setOperateType(GoodsHistory.OperateType.Update.getPhrase());
-		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
-		resultGoods = goodsDao.save(nowGoods);
 
-		List<Order> orders = detailService.updateOrderDetailsByGoods(resultGoods);
-		orderService.save(orders);
+		if(Integer.valueOf(oldGoods.getSelfSale()).equals(IntegerConstant.B2C_SALE)) {
+			nowGoods.setStoreid(sysConf.getStoreid());
+			nowGoods.setStoreName(sysConf.getEnName());
+		}else if(Integer.valueOf(oldGoods.getSelfSale()).equals(IntegerConstant.SELF_SALE)){
+			StoreIn storeIn = storeInService.findByEnUU(nowGoods.getEnUU());
+			if(storeIn.getStatus() == StoreStatus.OPENED) {
+				nowGoods.setStoreid(storeIn.getUuid());
+				nowGoods.setStoreName(storeIn.getStoreName());
+			}else {
+				throw new IllegalOperatorException("您还未开店铺,不能选择自营");
+			}
+		}else {
+			throw new IllegalOperatorException("您选择的销售方式不存在");
+		}
 
-		goodsHistoryService.save(goodsHistory);
 
+		GoodsHistory history = goodsHistoryService.initByGoods(nowGoods, OperateType.Update);
+		List<Order> orders = detailService.updateOrderDetailsByGoods(nowGoods);
 		//更新购物车信息
-		cartService.updateCartByGoods(resultGoods);
-
+		List<Cart> cartList = cartService.updateCartByGoods(nowGoods);
 		//更新浏览历史
-		browsingHistoryService.updateGoodsBrowsingHistoryByGoods(resultGoods);
-
-		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(nowGoods.getStandprodid());
-		if(putOnInfo != null) {
-			putOnInfo.setMinBuyQty(nowGoods.getMinBuyQty());
-			putOnInfo.setMaxDelivery(nowGoods.getMaxDelivery());
-			putOnInfo.setMinDelivery(nowGoods.getMinDelivery());
-			putOnInfo.setQtyPrice(nowGoods.getQtyPrice());
-			putOnInfo.setImg(nowGoods.getImg());
-			productStandardPutOnInfoDao.save(putOnInfo);
-		}else {
-			throw new IllegalOperatorException("找不到对应的标准上架信息");
-		}
-		return resultGoods;
+		List<GoodsBrowsingHistory> browsingHistories = browsingHistoryService.updateGoodsBrowsingHistoryByGoods(nowGoods);
+//		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoService.updateProductStandardPutOnInfoByGoods(nowGoods);
+//		Product product = productService.updateProduct(putOnInfo);
+		updateGoodsRelateInfo(orders, cartList, browsingHistories, null, null, history, nowGoods);
+		return nowGoods;
 	}
 
 	/**
@@ -1390,25 +1355,27 @@ public class GoodsServiceImpl implements GoodsService {
 	@Override
 	public void setB2CDelayTime(Goods goods) {
 		if(goods.getStoreid().equals(sysConf.getStoreid())) { //如果是库存寄售
-			TradeDeliveryDelayTime delivery = null;
-			if ("RMB".equalsIgnoreCase(goods.getCurrencyName())) {
+			if (goods.getCurrencyName().indexOf("RMB") > -1) {
 				List<TradeDeliveryDelayTime> delayTime3 = tradeDeliveryDelayTimeDao.getByType(3);
 				if (CollectionUtils.isEmpty(delayTime3)) {
 					throw new IllegalOperatorException("请联系商城,您供应商交货延长时间 国内发往国内没设置。");
 				}
-				delivery = delayTime3.get(0);
-			} else if ("USD".equalsIgnoreCase(goods.getCurrencyName())) {
+				goods.setB2cDeliveryDemMaxTime((short) (delayTime3.get(0).getMaxTime() + goods.getSelfDeliveryDemMaxTime()));
+				goods.setB2cDeliveryDemMinTime((short) (delayTime3.get(0).getMinTime() + goods.getSelfDeliveryDemMinTime()));
+			}
+			if (goods.getCurrencyName().indexOf("USD") > -1) {
 				List<TradeDeliveryDelayTime> delayTime1 = tradeDeliveryDelayTimeDao.getByType(2);
 				if (CollectionUtils.isEmpty(delayTime1)) {
 					throw new IllegalOperatorException("请联系商城,您供应商交货延长时间 国外发往国外没设置。");
 				}
-				delivery = delayTime1.get(0);
+				goods.setB2cDeliveryHKMaxTime((short) (delayTime1.get(0).getMaxTime() + goods.getSelfDeliveryHKMaxTime()));
+				goods.setB2cDeliveryHKMinTime((short) (delayTime1.get(0).getMinTime() + goods.getSelfDeliveryHKMinTime()));
 			}
-			goods.setB2cMaxDelivery((short) (delivery.getMaxTime() + goods.getMaxDelivery()));
-			goods.setB2cMinDelivery((short) (delivery.getMinTime() + goods.getMinDelivery()));
 		}else { //如果是店铺自营
-			goods.setB2cMaxDelivery(goods.getMaxDelivery());
-			goods.setB2cMinDelivery(goods.getMinDelivery());
+			goods.setB2cDeliveryDemMaxTime(goods.getSelfDeliveryDemMaxTime());
+			goods.setB2cDeliveryDemMinTime(goods.getSelfDeliveryDemMinTime());
+			goods.setB2cDeliveryHKMaxTime(goods.getSelfDeliveryHKMaxTime());
+			goods.setB2cDeliveryHKMinTime(goods.getSelfDeliveryHKMinTime());
 		}
 	}
 
@@ -1921,18 +1888,18 @@ public class GoodsServiceImpl implements GoodsService {
 		goodsHist.setMessage(goodsHist.getMessage() + "该批次下架");
 		goodsHistoryService.save(goodsHist);
 
-		ProductStandardPutOnInfo standardPutOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
-		if(standardPutOnInfo != null) {
-			standardPutOnInfo.setStatus(Status.REMOVED.value());
-			standardPutOnInfo.setAvailableOnSale(NumberUtil.add(standardPutOnInfo.getAvailableOnSale(), standardPutOnInfo.getOnSaleQty()));
-			standardPutOnInfo.setOnSaleQty(0.0d);
-			productStandardPutOnInfoDao.save(standardPutOnInfo);
-
-			Product product = productDao.findOne(standardPutOnInfo.getProductid());
-			product.setAvailableOnSale(standardPutOnInfo.getAvailableOnSale());
-			product.setOnSaleQty(standardPutOnInfo.getOnSaleQty());
-			productDao.save(product);
-		}
+//		ProductStandardPutOnInfo standardPutOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
+//		if(standardPutOnInfo != null) {
+//			standardPutOnInfo.setStatus(Status.REMOVED.value());
+//			standardPutOnInfo.setAvailableOnSale(NumberUtil.add(standardPutOnInfo.getAvailableOnSale(), standardPutOnInfo.getOnSaleQty()));
+//			standardPutOnInfo.setOnSaleQty(0.0d);
+//			productStandardPutOnInfoDao.save(standardPutOnInfo);
+//
+//			Product product = productDao.findOne(standardPutOnInfo.getProductid());
+//			product.setAvailableOnSale(standardPutOnInfo.getAvailableOnSale());
+//			product.setOnSaleQty(standardPutOnInfo.getOnSaleQty());
+//			productDao.save(product);
+//		}
 
 		//下架对应的批次
 		goodsDao.deleteByBatchCode(goods.getBatchCode());
@@ -2023,12 +1990,15 @@ public class GoodsServiceImpl implements GoodsService {
 	}
 
 	public static void validDeliveryTime(Goods goods) {
-        if ((goods.getMaxDelivery() == null || goods.getMinDelivery() == null)) {
-            throw new IllegalOperatorException("交货周期为空");
-        }
-
-		if(goods.getMinDelivery().shortValue() > goods.getMaxDelivery().shortValue()) {
-			throw new IllegalOperatorException("最短交期大于最长交期");
+		if(goods.getCurrencyName().indexOf("RMB") > -1) {
+			if((goods.getB2cDeliveryDemMaxTime() == null || goods.getB2cDeliveryDemMinTime() == null)&&(goods.getMaxDelivery() == null || goods.getMinDelivery() == null)) {
+				throw new IllegalOperatorException("产品包含人民币,但是大陆交期为空");
+			}
+		}
+		if(goods.getCurrencyName().indexOf("USD") > -1) {
+			if((goods.getB2cDeliveryHKMaxTime() == null || goods.getB2cDeliveryHKMinTime() == null)&&(goods.getMaxDelivery() == null || goods.getMinDelivery() == null)) {
+				throw new IllegalOperatorException("产品包含美金,但是香港交期为空");
+			}
 		}
     }
 
@@ -2318,4 +2288,28 @@ public class GoodsServiceImpl implements GoodsService {
 		}
 		return ResultMap.success(null);
 	}
+
+	/**
+	 * 更新库存的相关信息
+	 *
+	 * @param orders 订单
+	 * @param carts 购物车信息
+	 * @param browsingHistoryList 浏览历史
+	 * @param product 产品
+	 * @param putOnInfo 标准信息
+	 * @return
+	 */
+	@Transactional
+	@Override
+	public ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, ProductStandardPutOnInfo putOnInfo, GoodsHistory goodsHistory, Goods goods) {
+		goodsDao.save(goods);
+		orderDao.save(orders);
+		orderService.save(orders);
+		cartService.saveCart(carts);
+		browsingHistoryService.saveGoodsBrowsingHistoryList(browsingHistoryList);
+//		productStandardPutOnInfoService.save(putOnInfo);
+//		productService.save(product);
+		goodsHistoryService.save(goodsHistory);
+		return ResultMap.success(null);
+	}
 }

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

@@ -119,7 +119,7 @@ public class ProductServiceImpl implements ProductService {
         }
         if(type.contains("standard")) {
             page.filter("standard", (short)1);
-            page.filter("b2cEnabled", (short) 1);
+//            page.filter("b2cEnabled", (short) 1);
         }else if(type.contains("nStandard")){
             page.filter("standard", (short)0);
         }else if(type.contains("all")) {
@@ -396,6 +396,29 @@ public class ProductServiceImpl implements ProductService {
         return "success";
     }
 
+    /**
+     * 根据标准上架信息 保存对产品包装,包装数量,生产日期的修改
+     *
+     * @param putOnInfo the Goods
+     * @return the string
+     */
+    @Override
+    public Product updateProduct(ProductStandardPutOnInfo putOnInfo) {
+        if(putOnInfo == null) {
+            throw new IllegalOperatorException("传入的信息信息为空");
+        }
+        if(StringUtils.isEmpty(putOnInfo.getProductid())) {
+            throw new IllegalOperatorException("标准上架信息关联的标准产品信息为空");
+        }
+        Product product = productDao.findOne(putOnInfo.getProductid());
+        if(product == null) {
+            throw new IllegalOperatorException("标准上架信息关联的标准产品信息为空");
+        }
+        product.setAvailableOnSale(putOnInfo.getAvailableOnSale());
+        product.setOnSaleQty(putOnInfo.getOnSaleQty());
+        return product;
+    }
+
     /**
      * 用户选择对应的品牌和类目,更新非标产品为标准产品
      * @param json
@@ -497,5 +520,27 @@ public class ProductServiceImpl implements ProductService {
         }
         return ResultMap.success(null);
     }
+
+    /**
+     * 保存产品库信息
+     *
+     * @param product
+     * @return
+     */
+    @Override
+    public Product save(Product product) {
+        return productDao.save(product);
+    }
+
+    /**
+     * 批量保存产品库信息
+     *
+     * @param products
+     * @return
+     */
+    @Override
+    public List<Product> save(List<Product> products) {
+        return productDao.save(products);
+    }
 }
 

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

@@ -159,6 +159,33 @@ public class ProductStandardPutOnInfoServiceImpl implements ProductStandardPutOn
         return ResultMap.success(putOnInfos.size());
     }
 
+
+    /**
+     * 根据库存信息更新标准上架信息
+     *
+     * @param goods 库存
+     * @return
+     */
+    @Override
+    public ProductStandardPutOnInfo updateProductStandardPutOnInfoByGoods(Goods goods) {
+        if(goods == null) {
+            throw new IllegalOperatorException("传入的信息丢失");
+        }
+        if(StringUtils.isEmpty(goods.getStandprodid())) {
+            throw new IllegalOperatorException("库存信息关联的标准上架信息为空");
+        }
+        ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
+        if(putOnInfo == null) {
+            throw new IllegalOperatorException("商品关联的标准上架信息不存在");
+        }
+        putOnInfo.setMinBuyQty(goods.getMinBuyQty());
+        putOnInfo.setMaxDelivery(goods.getMaxDelivery());
+        putOnInfo.setMinDelivery(goods.getMinDelivery());
+        putOnInfo.setQtyPrice(goods.getQtyPrice());
+        putOnInfo.setImg(goods.getImg());
+        return putOnInfo;
+    }
+
     /**
      * 一键更新标准上架信息,将可上架数变为在售数量
      *
@@ -339,4 +366,26 @@ public class ProductStandardPutOnInfoServiceImpl implements ProductStandardPutOn
 
         return ResultMap.success(product);
     }
+
+    /**
+     * 单个保存标准上架信息
+     *
+     * @param putOnInfo 上架信息
+     * @return
+     */
+    @Override
+    public ProductStandardPutOnInfo save(ProductStandardPutOnInfo putOnInfo) {
+        return productStandardPutOnInfoDao.save(putOnInfo);
+    }
+
+    /**
+     * 批量保存标准上架信息
+     *
+     * @param putOnInfos 标准上架信息
+     * @return
+     */
+    @Override
+    public List<ProductStandardPutOnInfo> save(List<ProductStandardPutOnInfo> putOnInfos) {
+        return productStandardPutOnInfoDao.save(putOnInfos);
+    }
 }

+ 8 - 3
src/main/java/com/uas/platform/b2c/trade/presale/service/BrowsingHistoryService.java

@@ -2,7 +2,6 @@ package com.uas.platform.b2c.trade.presale.service;
 
 import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
-import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
 import org.springframework.data.domain.Page;
 
@@ -26,6 +25,12 @@ public interface BrowsingHistoryService {
      */
     List<GoodsBrowsingHistory> getGoodsBrowsingHistoryList();
 
+    /**
+     * 批量保存浏览历史
+     * @return  List<GoodsBrowsingHistory> 返回浏览历史
+     */
+    List<GoodsBrowsingHistory> saveGoodsBrowsingHistoryList(List<GoodsBrowsingHistory> browsingHistories);
+
     /**
      * 分页获取当前用户的产品浏览记录
      *
@@ -51,7 +56,7 @@ public interface BrowsingHistoryService {
     /**
      * 更新浏览的历史记录
      * @param goods 对应的goods
-     * @return ResultMap 返回结果ResultMap
+     * @return List<GoodsBrowsingHistory> 返回结果ResultMap
      */
-    ResultMap updateGoodsBrowsingHistoryByGoods(Goods goods);
+    List<GoodsBrowsingHistory> updateGoodsBrowsingHistoryByGoods(Goods goods);
 }

+ 2 - 2
src/main/java/com/uas/platform/b2c/trade/presale/service/CartService.java

@@ -131,7 +131,7 @@ public interface CartService {
 	/**
 	 * 更新购物车信息,因为Goods信息修改。
 	 * @param goods 更新的goods信息
-	 * @return ResultMap 返回ResultMap对象
+	 * @return List<Cart>
 	 */
-	ResultMap updateCartByGoods(Goods goods);
+	List<Cart> updateCartByGoods(Goods goods);
 }

+ 15 - 5
src/main/java/com/uas/platform/b2c/trade/presale/service/impl/BrowsingHistoryServiceImpl.java

@@ -6,8 +6,7 @@ import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.trade.presale.dao.GoodsBrowsingHistoryDao;
 import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
 import com.uas.platform.b2c.trade.presale.service.BrowsingHistoryService;
-import com.uas.platform.b2c.trade.support.CodeType;
-import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Type;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -95,6 +94,17 @@ public class BrowsingHistoryServiceImpl implements BrowsingHistoryService {
         return list;
     }
 
+    /**
+     * 批量保存浏览历史
+     *
+     * @param browsingHistories
+     * @return List<GoodsBrowsingHistory> 返回浏览历史
+     */
+    @Override
+    public List<GoodsBrowsingHistory> saveGoodsBrowsingHistoryList(List<GoodsBrowsingHistory> browsingHistories) {
+        return goodsBrowsingHistoryDao.save(browsingHistories);
+    }
+
     @Override
     public Page<GoodsBrowsingHistory> getGoodsBrowsingHistoryPage(final PageInfo info) {
         if (SystemSession.getUser().getEnterprise() != null) {
@@ -150,15 +160,15 @@ public class BrowsingHistoryServiceImpl implements BrowsingHistoryService {
      * @return
      */
     @Override
-    public ResultMap updateGoodsBrowsingHistoryByGoods(Goods goods) {
+    public List<GoodsBrowsingHistory> updateGoodsBrowsingHistoryByGoods(Goods goods) {
         if(goods == null) {
-            return new ResultMap(CodeType.NO_INFO, "没有对应的数据");
+            throw new IllegalOperatorException("库存信息丢失,请重新操作");
         }
         List<GoodsBrowsingHistory> historyByBatch = goodsBrowsingHistoryDao.findGoodsBrowsingHistoryByBatch(goods.getBatchCode());
         for (GoodsBrowsingHistory browsingHistory : historyByBatch) {
             browsingHistory.updateGoodsBrowsingHistoryByGoods(goods);
         }
         List<GoodsBrowsingHistory> browsingHistories = goodsBrowsingHistoryDao.save(historyByBatch);
-        return ResultMap.success(browsingHistories);
+        return browsingHistories;
     }
 }

+ 4 - 6
src/main/java/com/uas/platform/b2c/trade/presale/service/impl/CartServiceImpl.java

@@ -476,11 +476,10 @@ public class CartServiceImpl implements CartService {
 	 * @return
 	 */
 	@Override
-	public ResultMap updateCartByGoods(Goods goods) {
+	public List<Cart> updateCartByGoods(Goods goods) {
 		if(goods == null) {
-			return new ResultMap(CodeType.NO_INFO.code(), "信息缺失");
+			throw  new IllegalOperatorException("库存信息缺失");
 		}
-		List<Cart> carts = new ArrayList<>();
 		List<Cart> cartList = cartDao.findCartByBatch(goods.getBatchCode());
 		StoreIn storeIn = storeInDao.findByUuid(goods.getStoreid());
 		Enterprise enterprise = enterpriseDao.findByUu(storeIn.getEnUU());
@@ -488,14 +487,13 @@ public class CartServiceImpl implements CartService {
 			cart.updateCartByGoods(goods);
 			cart.setNumber(goods);
 			cart.setMinPackQty(goods.getMinPackQty());
-			cart.setStoreName(storeIn.getStoreName());
+			cart.setStoreName(goods.getStoreName());
 			cart.setStoreType(storeIn.getType());
 			cart.setSellPhone(enterprise.getEnTel());
 			cart.setSellEmail(enterprise.getEnEmail());
 			cart.setSellCompanyArea(enterprise.getEnArea());
 			cart.setSellCompanyAddress(enterprise.getEnAddress());
 		}
-		cartDao.save(cartList);
-		return ResultMap.success(carts);
+		return cartList;
 	}
 }

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

@@ -1,7 +1,7 @@
 define([ 'app/app' ], function(app) {
 	'use strict';
 	app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', function ($scope, $rootScope, Material, toaster, ComponentActive) {
-		$rootScope.active = 'vendor_goods';
+		$rootScope.active = 'vendor_material';
 
 		$scope.tab = 'material';
 		$scope.standard_tab = 'standard';
@@ -12,7 +12,7 @@ define([ 'app/app' ], function(app) {
 			page : 1,
 			count : 10,
 			sorting : {
-				code : 'ASC'
+				id : 'DESC'
 			},
 			isStandard : true
 		};
@@ -43,10 +43,10 @@ define([ 'app/app' ], function(app) {
 		$scope.toggleStandard = function (isStandard) {
 			$scope.standard_tab = isStandard;
 			if (isStandard == 'standard')
-				$scope.param.isStandard = true;
+				$scope.param.type = "standard";
 			// $scope.param.sorting = {matchingTime : 'DESC'};
 			if (isStandard == 'unstandard')
-				$scope.param.isStandard = false;
+				$scope.param.type = "nStandard";
 			// $scope.param.sorting = {code : 'ASC'};
 			$scope.isBatch = false;
 			loadDataReload();
@@ -751,7 +751,7 @@ define([ 'app/app' ], function(app) {
 				if (Number(price.start) >= Number(price.end)) {
 					toaster.pop('error', '当前价格区间的起始数量必须小于终止数量');
 					if (prePrice.end && prePrice.end !== '') {
-						price.start = prePrice.end;
+						price.start = prePrice.end + 1;
 					} else {
 						delete price.start
 					}
@@ -762,14 +762,14 @@ define([ 'app/app' ], function(app) {
 				if (Number(prePrice.start) >= Number(price.start)) {
 					toaster.pop('error', '当前价格区间的起始数量必须大于上一区间的起始数量');
 					if (prePrice.end && prePrice.end !== '') {
-						price.start = prePrice.end;
+						price.start = prePrice.end + 1;
 					} else {
 						delete price.start
 					}
 					return ;
 				}
 			}
-			prePrice.end = price.start;
+			prePrice.end = price.start - 1;
 		}
 
 		/**
@@ -803,7 +803,7 @@ define([ 'app/app' ], function(app) {
 			var nextPrice = goods.prices[index + 1];
 			if (!price.end || price.end === '') {
 				if (nextPrice.start && nextPrice.start !== '') {
-					price.end = nextPrice.start;
+					price.end = nextPrice.start - 1;
 				} else {
 					delete price.end
 				}
@@ -813,7 +813,7 @@ define([ 'app/app' ], function(app) {
 				if (Number(price.start) >= Number(price.end)) {
 					toaster.pop('error', '当前价格区间的终止数量必须大于起始数量');
 					if (nextPrice.start && nextPrice.start !== '') {
-						price.end = nextPrice.start;
+						price.end = nextPrice.start - 1;
 					} else {
 						delete price.end
 					}
@@ -824,14 +824,14 @@ define([ 'app/app' ], function(app) {
 				if (Number(price.end) >= Number(nextPrice.end)) {
 					toaster.pop('error', '当前价格区间的终止数量必须小于下一区间的终止数量');
 					if (nextPrice.start && nextPrice.start !== '') {
-						price.end = nextPrice.start;
+						price.end = nextPrice.start - 1;
 					} else {
 						delete price.end
 					}
 					return ;
 				}
 			}
-			nextPrice.start = price.end;
+			nextPrice.start = price.end + 1;
 		}
 
 		/**

+ 639 - 189
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_onSaleCtrl.js

@@ -1,9 +1,10 @@
 define([ 'app/app' ], function(app) {
     'use strict';
-    app.register.controller('vendor_onSaleCtrl', ['$scope', '$rootScope', 'Goods', '$modal', 'toaster', 'Loading', 'StoreInfo', 'AuthenticationService', '$q', 'StoreCms', 'Enterprise', function ($scope, $rootScope, Goods, $modal, toaster, Loading, StoreInfo, AuthenticationService, $q, StoreCms, Enterprise) {
+    app.register.controller('vendor_onSaleCtrl', ['$scope', '$rootScope', 'Goods', '$modal', 'toaster', 'Loading', 'StoreInfo', 'AuthenticationService', '$q', 'StoreCms', function ($scope, $rootScope, Goods, $modal, toaster, Loading, StoreInfo, AuthenticationService, $q, StoreCms) {
         $rootScope.active = 'vendor_goods';
         $scope.keyword = '';
         $scope.tab = 'onSale';
+        $scope.isInt = /^[0-9]*[1-9][0-9]*$/;
 
         $scope.param = {
             page : 1,
@@ -11,21 +12,9 @@ define([ 'app/app' ], function(app) {
             sorting : {
                 createdDate: 'DESC'
             },
-            status : '601-602'
+            status : 601
         };
 
-        $scope.$$onSale = {};
-
-        Enterprise.getCurrencyByRegisterAddress(null, function (data) {
-            if(data.code == 1) {
-                $scope.$$onSale.currency = data.data;
-            }else {
-                toaster.pop('warning', '提示', data.message);
-            }
-        }, function (response) {
-            toaster.pop('error', '根据注册地址确定的币别失败');
-        });
-
         // 商品分页数据
         $scope.goodsPageParams = {};
         $scope.selfSupportType = {
@@ -55,52 +44,7 @@ define([ 'app/app' ], function(app) {
             }).error(function(response) {
                 toaster.pop('info', '获取定单的信息' + response);
             });
-        };
-
-        /**
-         * 根据数量增加一个分段
-         */
-        $scope.addFragment = function (commodity) {
-            if(!$scope.$$onSale.qty) {
-                toaster.pop('warning', '提示', '请输入插入的分段');
-                return ;
-            }
-            var fragmentPrices = commodity.editPrices;
-            if(fragmentPrices.length > 2) {
-                toaster.pop('warning', '提示', '分段数不能超过三个');
-                return ;
-            }
-            if(isNaN($scope.$$onSale.qty)) {
-                toaster.pop('warning', '提示', '输入的分段数量中包含了不是数字的字符');
-                return ;
-            }
-            var qty = Number($scope.$$onSale.qty);
-            if(qty <= fragmentPrices[0].start) {
-                toaster.pop('warning', '提示', '输入的分段数量小于等于第一个分段的起始值');
-                return ;
-            }
-            if(qty >= fragmentPrices[fragmentPrices.length - 1].end) {
-                toaster.pop('warning', '提示', '输入的分段数量大于等于最后一个分段的结束值');
-                return ;
-            }
-            for(var i = 0; i< fragmentPrices.length; i++) {
-                var price = fragmentPrices[i];
-                if(qty == price.start) {
-                    toaster.pop('warning', '提示', '输入的分段数量等于第'+ (i+1)+'分段的起始值');
-                    return ;
-                }else if(qty == price.end) {
-                    toaster.pop('warning', '提示', '输入的分段数量等于第'+ (i+1)+'分段的结束值');
-                    return ;
-                }else if(qty < price.end) {
-                    var end = price.end;
-                    price.end = qty - 1;
-                    var obj = {start : qty, end : end, rMBPrice : null, uSDPrice : null};
-                    commodity.editPrices.splice(i + 1 , 0 , obj);
-                    $scope.$$onSale.qty = null;
-                    return ;
-                }
-            }
-        };
+        }
 
         //判断是否是商城管理公司,是否可以选择自营。
         $q.all([getAuthentication()]).then(function() {
@@ -387,6 +331,28 @@ define([ 'app/app' ], function(app) {
                 }
             }
         }
+        /**
+         * 增加对应的分段。
+         * @param commodity
+         */
+        $scope.addFragment = function (commodity) {
+            if(commodity.editPrices.length > 2) {
+                toaster.pop('warning', "提示", "批次最多只能有三个分段");
+                return ;
+            }
+            var price = {};
+            price.start = null;
+            price.startPre = null;
+            price.end = commodity.editPrices[commodity.editPrices.length - 1].end;
+            price.endPre = price.end;
+            price.uSDPrice = null;
+            price.uSDPricePre = null;
+            price.rMBPrice = null;
+            price.rMBPricePre = null;
+            commodity.editPrices[commodity.editPrices.length - 1].end = null;
+            commodity.editPrices[commodity.editPrices.length - 1].endPre = null;
+            commodity.editPrices.push(price);
+        }
 
         /**
          * 删除对应的分段.
@@ -398,13 +364,13 @@ define([ 'app/app' ], function(app) {
                     toaster.pop('warning', "提示", "批次至少需要一个分段");
                     return ;
                 }
-               if(index < commodity.editPrices.length - 1) { //不是最后一个分段
-                   var price = commodity.editPrices.splice(index, 1);
-                   commodity.editPrices[index].start = price[0].start;
-               }else if(index == commodity.editPrices.length - 1) { //如果删除的是最后一个分段,
-                   var price = commodity.editPrices.splice(index, 1);
-                   commodity.editPrices[index -1].end = price[0].end;
-               }
+                if(index < commodity.editPrices.length - 1) { //不是最后一个分段
+                    var price = commodity.editPrices.splice(index, 1);
+                    commodity.editPrices[index].start = price[0].start;
+                }else if(index == commodity.editPrices.length - 1) { //如果删除的是最后一个分段,
+                    var price = commodity.editPrices.splice(index, 1);
+                    commodity.editPrices[index -1].end = price[0].end;
+                }
             }
         };
 
@@ -423,88 +389,258 @@ define([ 'app/app' ], function(app) {
             commodity.edit = true;
             commodity.editPic = commodity.img;
             commodity.editPrices = angular.copy(commodity.prices);
+            angular.forEach(commodity.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;
+            });
+            commodity.editPrices[commodity.editPrices.length - 1].end = commodity.reserve;
+            commodity.editPrices[commodity.editPrices.length - 1].endPre = commodity.reserve;
+
+            commodity.editReserve = commodity.reserve;
+            commodity.editReservePre = commodity.reserve;
+            commodity.editReserveDirty = false;
+
             commodity.editMinBuyQty = commodity.minBuyQty;
-            commodity.editMaxDelivery = commodity.maxDelivery;
-            commodity.editMinDelivery = commodity.minDelivery;
-            $scope.$$onSale.qty = null;
+            commodity.editMinBuyQtyPre = commodity.minBuyQty;
+            commodity.editMinBuyQtyDirty = false;
+
+            commodity.editMinPackQty = commodity.minPackQty;
+            commodity.editMinPackQtyPre = commodity.minPackQty;
+            commodity.editMinPackQtyDirty = false;
+
+            commodity.editPackaging = commodity.packaging;
+            commodity.editPackagingPre = commodity.packaging;
+            commodity.editPackagingDirty = false;
+
+            commodity.editProduceDate = new String(commodity.produceDate);
+            commodity.editProduceDatePre = commodity.produceDate;
+            commodity.editProduceDateDirty = false;
+
+            commodity.editSelfDeliveryHKMinTime = commodity.selfDeliveryHKMinTime;
+            commodity.editSelfDeliveryHKMinTimePre = commodity.selfDeliveryHKMinTime;
+            commodity.editSelfDeliveryHKMinTimeDirty = false;
+
+            commodity.editSelfDeliveryHKMaxTime = commodity.selfDeliveryHKMaxTime;
+            commodity.editSelfDeliveryHKMaxTimePre = commodity.selfDeliveryHKMaxTime;
+            commodity.editSelfDeliveryHKMaxTimeDirty = false;
+
+            commodity.editSelfDeliveryDemMinTime = commodity.selfDeliveryDemMinTime;
+            commodity.editSelfDeliveryDemMinTimePre = commodity.selfDeliveryDemMinTime;
+            commodity.editSelfDeliveryDemMinTimeDirty = false;
+
+            commodity.editSelfDeliveryDemMaxTime = commodity.selfDeliveryDemMaxTime;
+            commodity.editSelfDeliveryDemMaxTimePre = commodity.selfDeliveryDemMaxTime;
+            commodity.editSelfDeliveryDemMaxTimeDirty = false;
+
+            commodity.editSelfSale = $scope.storeInfo.uuid != 'undefind' && commodity.storeid == $scope.storeInfo.uuid && $scope.storeInfo.storeName.indexOf('优软测试二') < 0 && $scope.storeInfo.storeName.indexOf('优软商城') < 0 ? 1 : 2;
         };
 
+        /**
+         * 修改commodity的系列的dirty属性 为true;
+         * @param commodity
+         */
+        $scope.initDirtyTrue = function(commodity) {
+            angular.forEach(commodity.editPrices, function (price) {
+                price.startDirty = false;
+                price.endDirty = false;
+                price.rMBPriceDirty = false;
+                price.uSDPriceDirty = false;
+            });
+            commodity.editReserveDirty = false;
+            commodity.editMinBuyQtyDirty = false;
+            commodity.editMinPackQtyDirty = false;
+            commodity.editPackagingDirty = false;
+            commodity.editProduceDateDirty = false;
+            commodity.editSelfDeliveryHKMinTimeDirty = false;
+            commodity.editSelfDeliveryHKMaxTimeDirty = false;
+            commodity.editSelfDeliveryDemMinTimeDirty = false;
+            commodity.editSelfDeliveryDemMaxTimeDirty = false;
+        };
+
+        /**
+         * 修改分段的数量
+         * @param commodity 批次信息
+         * @param index 索引值
+         * @param isEnd 是否是结束值
+         */
+        $scope.editQty = function (commodity, index, isEnd, num) {
+            commodity.editPrices[index].endInValid = false;
+            commodity.editPrices[index].startInValid = false;
+            if(commodity.editPrices.length < index || index < 0) {
+                return ;
+            }
+            if(!num) {
+                return ;
+            }
+            if(!$scope.isInt.test(num)) {
+                if(isEnd) {
+                    commodity.editPrices[index].end = commodity.editPrices[index].endPre;
+                }else {
+                    commodity.editPrices[index].start = commodity.editPrices[index].startPre;
+                }
+                toaster.pop('warning', '提示', '分段数量必须为正整数');
+                return ;
+            }
+            if(isEnd) {
+                if(index < commodity.editPrices.length - 1) {
+                    if(commodity.editPrices[index].end <= commodity.editPrices[index].start) {
+                        toaster.pop('warning', '提示', '修改之后当前分段的结束值' + parseInt(commodity.editPrices[index].end) + '小于' + commodity.editPrices[index].start);
+                        commodity.editPrices[index].end = commodity.editPrices[index].endPre;
+                    }else if((commodity.editPrices[index + 1].end)&&(parseInt(commodity.editPrices[index].end) + 1) >= parseInt(commodity.editPrices[index + 1].end)) {
+                        toaster.pop('warning', '提示', '修改本分段之后,导致后面一个分段起始值'+(parseInt(commodity.editPrices[index].end) + 1)+'大于结束值' + commodity.editPrices[index + 1].end);
+                        commodity.editPrices[index].end = commodity.editPrices[index].endPre;
+                    } else {
+                        commodity.editPrices[index + 1].start = parseInt(commodity.editPrices[index].end) + 1;
+                        commodity.editPrices[index].endPre = commodity.editPrices[index].end;
+                        commodity.editPrices[index + 1].startPre = commodity.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(commodity.editPrices[index].start) >= parseInt(commodity.editPrices[index].end)) {
+                        toaster.pop('warning', '提示', '修改本分段之后,会导致分段的起始值' + commodity.editPrices[index ].start + '大于等于结束值' + parseInt(commodity.editPrices[index].end));
+                        commodity.editPrices[index].start = commodity.editPrices[index].startPre;
+                    }else if((parseInt(commodity.editPrices[index].start) - 1) <= commodity.editPrices[index - 1].start) {
+                        toaster.pop('warning', '提示', '修改本分段之后,会导致前一个分段的起始值' + commodity.editPrices[index - 1].start + '大于等于结束值' + (parseInt(commodity.editPrices[index].start) - 1));
+                        commodity.editPrices[index].start = commodity.editPrices[index].startPre;
+                    }else {
+                        commodity.editPrices[index - 1].end = parseInt(commodity.editPrices[index].start) - 1;
+                        commodity.editPrices[index].startPre = commodity.editPrices[index].start;
+                        commodity.editPrices[index - 1].endPre = commodity.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 需要验证的批次的信息
          * @returns {boolean}
          */
         var changeQtyPrice = function(commodity) {
-            var result = false;
-            var lastEnd = -1;
-            for (var i = 0; i < commodity.editPrices.length; i++) {
-                var price = commodity.editPrices[i];
-                if(isNaN(price.start)) {
-                    toaster.pop('warning', '第' +(i + 1)+'个分段的起始值必须是数字');
-                    return result;
-                }
-                if(Number(price.start) <= lastEnd) {
-                    toaster.pop('warning', "存在分段的起始值小于等于上一个分段的结束值");
-                    return result;
+            var price = commodity.editPrices;
+            var previousEnd = -1;
+            for(var i = 0; i < price.length; i++){
+                price[i].startInValid = false;
+                price[i].endInValid = false;
+                if(isNaN(price[i].start)) {
+                    price[i].startInValid = true;
+                    toaster.pop('warning', "提示", "分段数量必须是数字");
+                    return false;
                 }
-                if(isNaN(price.end)) {
-                    toaster.pop('warning', '第' +(i + 1)+'个分段的结束值必须是数字');
-                    return result;
+                if(parseInt(price[i].start) <= previousEnd) {
+                    price[i].startInValid = true;
+                    toaster.pop('warning', "提示", "存在上一个分段的结束值大于下一个分段的起始值");
+                    return false;
                 }
-                if(Number(price.start) >= Number(price.end)) {
-                    toaster.pop('warning', '第' +(i + 1)+'个分段的起始值大于等于分段的结束值');
-                    return result;
+                if(isNaN(price[i].end)) {
+                    price[i].endInValid = true;
+                    toaster.pop('warning', "提示", "分段数量必须是数字");
+                    return false;
                 }
-                //目前系统中存在双币别,与现有的逻辑冲突,暂时先用企业地址确定币别
-                if($scope.$$onSale.currency.indexOf('USD') > -1) {
-                    if(!price.uSDPrice) {
-                        toaster.pop('warning', '第' +(i + 1)+'个分段的单价($)为空,请填写后再次提交!');
-                        return result;
-                    }else if(isNaN(price.uSDPrice)){
-                        toaster.pop('warning', '第' +(i + 1)+'个分段的单价($)信息必须是数字');
-                        return result;
-                    }
+                if(parseInt(price[i].start) >= parseInt(price[i].end)) {
+                    price[i].startInValid = true;
+                    toaster.pop('warning', "提示", "存在分段的起始值大于等于分段的结束值");
+                    return false;
                 }
-                if($scope.$$onSale.currency.indexOf('RMB') > -1) {
-                    if(!price.rMBPrice) {
-                        toaster.pop('warning', '第' +(i + 1)+'个分段的单价(¥)为空,请填写后再次提交!');
-                        return result;
-                    }else if(isNaN(price.rMBPrice)){
-                        toaster.pop('warning', '第' +(i + 1)+'个分段的单价(¥)信息必须是数字');
-                        return result;
-                    }
+                if(parseInt(price[i].end) > parseInt(commodity.editReserve)){
+                    price[i].endInValid = true;
+                    toaster.pop('warning', "提示", "存在分段的结束值大于新库存数量");
+                    return false;
                 }
+                previousEnd = price[i].end;
             }
-
+            commodity.editPrices[0].start = commodity.editMinBuyQty || 0;
             return true;
         };
 
         /**
-         * 验证是否合理
-         * @param num 需要验证的数据
-         * @param price 当前的分段
-         * @param isRMB 是否是人民币
+         * commodity,
+         * 验证库存量是否大于原有的库存量
          */
-        $scope.validPrice = function (price, num ,isRMB) {
-            if(!num) {
-                return ;
-            }else if(isNaN(num)){
-                toaster.pop('warning', '价格的信息必须只能包含数字');
-                if(isRMB) {
-                    price.rMBPrice = null;
-                }else {
-                    price.uSDPrice = null;
-                }
-                return ;
-            }else if(Number(num) <= 0) {
-                toaster.pop('warning', '价格的信息必须是大于零的数字');
-                if(isRMB) {
-                    price.rMBPrice = null;
-                }else {
-                    price.uSDPrice = null;
-                }
-                return ;
+        $scope.changeReserve = function (commodity) {
+            commodity.editReserveInvalid = true;
+            if(!commodity.editReserve) {
+                commodity.editReserveInvalid = false;
+                return false;
             }
-        };
+            if(!$scope.isInt.test(commodity.editReserve)) {
+                commodity.editReserve = commodity.editReservePre;
+                commodity.editReserveInvalid = false;
+                toaster.pop('warning', '提示', '库存量必须是正整数');
+                return false;
+            }
+            if(parseInt(commodity.editReserve) > parseInt(commodity.reserve)) {
+                commodity.editReserve = commodity.editReservePre;
+                commodity.editReserveInvalid = false;
+                toaster.pop('warning', '提示', '修改的库存只能减少库存量');
+                return false;
+            }
+            if(parseInt(commodity.editReserve) <= parseInt(commodity.editMinBuyQty)) {
+                commodity.editReserve = commodity.editReservePre;
+                commodity.editReserveInvalid = false;
+                toaster.pop('warning', '提示', '起拍量不能大于库存量');
+                return false;
+            }
+            if(parseInt(commodity.editReserve) > 99999999 || commodity.editReserve < 1) {
+                commodity.editReserve = commodity.editReservePre;
+                commodity.editReserveInvalid = false;
+                toaster.pop('warning', '提示', '总库存量的数量必须介于1 ~ 99999999');
+                return false;
+            }
+            if(parseInt(commodity.editPrices[commodity.editPrices.length - 1].start) >= parseInt(commodity.editReserve)) {
+                commodity.editReserve = commodity.editReservePre;
+                commodity.editReserveInvalid = false;
+                toaster.pop('warning', '提示', '最新库存量必须要大于最后一个分段的起始量。');
+                return false;
+            }else {
+                commodity.editPrices[commodity.editPrices.length - 1].end = commodity.editReserve;
+                commodity.editPrices[commodity.editPrices.length - 1].endPre = commodity.editPrices[commodity.editPrices.length - 1].end;
+                commodity.editReservePre = commodity.editReserve;
+                commodity.editReserveInvalid = false;
+                return true;
+            }
+        }
 
         /**
          *
@@ -512,116 +648,235 @@ define([ 'app/app' ], function(app) {
          * 验证库存的最小起订量是否大于库存量
          */
         $scope.changeMinBuyQty = function (commodity) {
+            commodity.editMinBuyQtyInValid = true;
             if(!commodity.editMinBuyQty) {
+                commodity.editMinBuyQtyInValid = false;
                 return false;
             }
-            if(isNaN(commodity.editMinBuyQty)) {
-                commodity.editMinBuyQty = commodity.minPackQty;
-                toaster.pop('warning', '提示', '起订量必须是数字');
+            if(!$scope.isInt.test(commodity.editMinBuyQty)) {
+                commodity.editMinBuyQty = null;
+                toaster.pop('warning', '提示', '起拍量必须是数字');
+                return false;
+            }
+            if(commodity.editMinBuyQty > commodity.editReserve) {
+                commodity.editMinBuyQty = null;
+                toaster.pop('warning', '提示', '起拍量不能大于库存量');
+                return false;
+            }
+            if(commodity.editMinBuyQty < 1) {
+                commodity.editMinBuyQty = null;
+                toaster.pop('warning', '提示', '起拍量必须大于0');
+                return false;
+            }
+
+            if(commodity.editMinPackQty) {
+                if(commodity.editMinBuyQty % commodity.editMinPackQty != 0) {
+                    commodity.editMinBuyQty = null;
+                    toaster.pop('warning', '提示', '起拍量必须是倍数的整数倍');
+                    return false;
+                }
+            }
+            if(!commodity.editPrices[0].end || commodity.editMinBuyQty < commodity.editPrices[0].end) {
+                commodity.editPrices[0].start = commodity.editMinBuyQty;
+                commodity.editPrices[0].startPre = commodity.editPrices[0].start;
+                commodity.editMinBuyQtyPre = commodity.editMinBuyQty;
+                commodity.editMinBuyQtyInValid = false;
+            }else {
+                toaster.pop('warning', '提示', '修改起拍量之后导致第一个分段的起始值'+ commodity.editMinBuyQty +'大于结束值' + commodity.editPrices[0].end);
+                commodity.editMinBuyQty = commodity.editMinBuyQtyPre;
+                commodity.editMinBuyQtyInValid = false;
+            }
+        }
+
+        /**
+         * 修改批次信息的包装个数
+         * @param commodity
+         */
+        $scope.changeMinPackQty = function(commodity) {
+            commodity.editMinPackQtyInValid = true;
+            if(!commodity.editMinPackQty) {
+                commodity.editMinPackQtyInValid = false;
                 return false;
             }
-            if(Number(commodity.editMinBuyQty) <= 0) {
-                commodity.editMinBuyQty = commodity.minPackQty;
-                toaster.pop('warning', '提示', '起订量必须大于0');
+            if(!$scope.isInt.test(commodity.editMinPackQty)) {
+                commodity.editMinPackQty = null;
+                toaster.pop('warning', '提示', '倍数必须是正整数');
+                return false;
+            }
+            if(commodity.editMinPackQty < 1) {
+                commodity.editMinPackQty = null;
+                toaster.pop('warning', '提示', '倍数必须大于0');
+                return false;
+            }
+            if(commodity.editMinPackQty > commodity.editReserve) {
+                commodity.editMinPackQty = null;
+                toaster.pop('warning', '提示', '倍数必须是起拍量的整数倍且小于起拍量。');
                 return false;
             }
 
-            if((Number(commodity.editMinBuyQty) % Number(commodity.minPackQty)) != 0) {
-                var i = Math.floor(Number(commodity.editMinBuyQty) / Number(commodity.minPackQty));
-                i = (i  == 0 ? 1 : i);
-                commodity.editMinBuyQty = (i * commodity.minPackQty);
-                toaster.pop('warning','提示', '起订量必须是包装数的倍数');
+            if(commodity.editMinBuyQty) {
+                if(commodity.editMinBuyQty % commodity.editMinPackQty != 0) {
+                    commodity.editMinPackQty = null;
+                    toaster.pop('warning', '提示', '倍数必须是起拍量的整数倍且小于起拍量。');
+                    return false;
+                }
             }
+            commodity.editMinPackQtyPre = commodity.editMinPackQty;
+            commodity.editMinPackQtyInValid = false;
         }
 
         /**
          * 比较交货周期的大小
          * @param min 本来是最小值
          * @param max 本来是最大值
-         * @param standard 批次信息
+         * @param type 2 表示当前验证的香港交期, 1表示当前验证的是大陆交期
+         * @param commodity 批次信息
          * @returns {boolean} true 表示验证通过,false 表示验证失败。
          */
-        $scope.compareNum = function(min, max) {
-            if(!min || !max) {
-                toaster.pop('warning', '交期存在空值,请填写对应的信息');
+        $scope.compareNum = function(min, max, type, commodity) {
+            if(!min) {
+                if(type == 1) {
+                    commodity.selfDemMinTimeinValid = true;
+                    toaster.pop('warning', '大陆交期存在空值,请重新操作');
+                }else if(type == 2){
+                    commodity.selfHkMinTimeinValid = true;
+                    toaster.pop('warning', '香港交期存在空值,请重新操作');
+                }
+                return false;
+            }else if(!max) {
+                if(type == 1) {
+                    commodity.selfDemMaxTimeinValid = true;
+                    toaster.pop('warning', '大陆交期存在空值,请重新操作');
+                }else if(type == 2){
+                    commodity.selfHkMaxTimeinValid = true;
+                    toaster.pop('warning', '香港交期存在空值,请重新操作');
+                }
                 return false;
             }
             if(isNaN(min)) {
+                if(type == 1) {
+                    commodity.selfDemMinTimeinValid = true;
+                }else {
+                    commodity.selfHkMinTimeinValid = true;
+                }
                 toaster.pop('warning', '最小交期必须是数字');
                 return false;
             }
             if(isNaN(max)) {
+                if(type == 1) {
+                    commodity.selfDemMaxTimeinValid = true;
+                }else {
+                    commodity.selfHkMaxTimeinValid = true;
+                }
                 toaster.pop('warning', '最大交期必须是数字');
                 return false;
             }
-            if(Number(min) < 1 || Number(max) < 1) {
-                toaster.pop('warning', '交期的时间必须大于0');
+            if(min < 1 || min > 9) {
+                if(type == 1) {
+                    commodity.selfDemMinTimeinValid = true;
+                }else {
+                    commodity.selfHkMinTimeinValid = true;
+                }
+                toaster.pop('warning', '交期的时间必须是1-9天之内');
                 return false;
             }
-           /* if(Number(min) > Number(max)) {
-                toaster.pop('warning', '最短交期必须小于等于最大交期');
+            if(max < 1 || max > 9) {
+                if(type == 1) {
+                    commodity.selfDemMaxTimeinValid = true;
+                }else {
+                    commodity.selfHkMaxTimeinValid = true;
+                }
+                toaster.pop('warning', '交期的时间必须是1-9天之内');
                 return false;
-            }*/
+            }
+            if(min > max) {
+                if(type == 1) {
+                    commodity.selfDemMaxTimeinValid = true;
+                    commodity.selfDemMinTimeinValid = true;
+                    toaster.pop('warning', '大陆交期最短交期大于最大交期');
+                }else if(type == 2){
+                    commodity.selfHkMaxTimeinValid = true;
+                    commodity.selfHkMinTimeinValid = true;
+                    toaster.pop('warning', '香港交期最短交期大于最大交期');
+                }
+                return false;
+            }
             return true;
-        };
+        }
 
         /**
          * @param min 最小值
          * @param max 最大值
          * @param isMin 传入的是否是最小值
+         * @param isHk 是否是香港交货周期
+         * @param commodity 批次信息
          */
-        $scope.blurDelivery = function(min, max, isMin, commodity) {
+        $scope.changeDelivery = function(min, max, isMin, isHk, commodity) {
+            commodity.selfDemMinTimeinValid = false;
+            commodity.selfDemMaxTimeinValid = false;
+            commodity.selfHkMinTimeinValid = false;
+            commodity.selfHkMaxTimeinValid = false;
             var day = -1;
             if(isMin) {
                 if(min && !isNaN(min)) {
                     day = min;
                 }else {
-                    if(!min) {
-                        return ;
+                    if(isNaN(min)) {
+                        toaster.pop('warning', '提示', '交期请输入1~9的数字');
+                    }
+                    if(isHk) {
+                        commodity.selfHkMinTimeinValid = true;
                     }else {
-                        if(isMin) {
-                            commodity.editMinDelivery = null;
-                        }else {
-                            commodity.editMaxDelivery = null;
-                        }
-                        toaster.pop('warning', '提示', '交期必须为大于0数字');
-                        return ;
+                        commodity.selfDemMinTimeinValid = true;
                     }
+                    return ;
                 }
 
             }else {
                 if(max && !isNaN(max)) {
                     day = max;
                 }else {
-                    if(!max) {
-                        return
+                    if(isNaN(max)) {
+                        toaster.pop('warning', '提示', '交期请输入1~9的数字');
+                    }
+                    if(isHk) {
+                        commodity.selfHkMaxTimeinValid = true;
                     }else {
-                        if(isMin) {
-                            commodity.editMinDelivery = null;
-                        }else {
-                            commodity.editMaxDelivery = null;
-                        }
-                        toaster.pop('warning', '提示', '交期必须为大于0数字');
-                        return ;
+                        commodity.selfDemMaxTimeinValid = true;
                     }
+                    return ;
                 }
+
             }
-            if(day < 1) {
-                if(isMin) {
-                    commodity.editMinDelivery = null;
+            if(day > 9 || day < 1) {
+                if(isHk) {
+                    if(isMin) {
+                        commodity.selfHkMinTimeinValid = true;
+                    }else {
+                        commodity.selfHkMaxTimeinValid = true;
+                    }
                 }else {
-                    commodity.editMaxDelivery = null;
+                    if(isMin) {
+                        commodity.selfDemMinTimeinValid = true;
+                    }else {
+                        commodity.selfDemMaxTimeinValid = true;
+                    }
                 }
-                toaster.pop('warning', '提示', '交期必须为大于0数字');
+                toaster.pop('warning', '提示', '交期的值必须在1~9天');
                 return ;
             }
-            if((min && !isNaN(min)) && (max && !isNaN(max))) {
-                if(Number(min) > Number(max)) {
-                    toaster.pop('warning', '提示', '最小交期必须小于最大交期');
-                    return ;
+            if(min > max) {
+                if(isHk) {
+                    commodity.selfHkMinTimeinValid = true;
+                    commodity.selfHkMaxTimeinValid = true;
+                }else {
+                    commodity.selfDemMinTimeinValid = true;
+                    commodity.selfDemMaxTimeinValid = true;
                 }
+                toaster.pop('warning', '提示', '最小交期必须小于最大交期');
+                return ;
             }
-        };
+        }
 
         /**
          * 	验证库存信息的正确性,
@@ -636,25 +891,125 @@ define([ 'app/app' ], function(app) {
                 toaster.pop('warning', '库存信息丢失,请重新操作');
                 return result;
             }
-            if(!commodity.editMinBuyQty) {
-                toaster.pop('warning', '请填写起订量');
+
+            if(!commodity.editPackaging) {
+                commodity.editPackagingInvalid = true;
+                toaster.pop('warning', '请填写包装方式');
+                return result;
+            }
+            if(!commodity.editProduceDate) {
+                commodity.editProduceDateInvalid = true;
+                toaster.pop('warning', '请填写生产日期');
+                return result;
+            }
+            if(isNaN(commodity.editReserve)) {
+                commodity.editReserveInvalid  = true;
+                toaster.pop('warning', '最新库存必须是数字');
+                return result;
+            }
+            if(commodity.editReserve < 1) {
+                commodity.editReserveInvalid  = true;
+                toaster.pop('warning', '最新库存必须大于0');
+                return result;
+            }
+            if(commodity.editReserve > commodity.reserve) {
+                commodity.editReserveInvalid  = true;
+                toaster.pop('warning', '最新库存量只能小于原有库存');
+                return result;
+            }
+            if(commodity.editReserve > 99999999) {
+                commodity.editReserveInvalid  = true;
+                toaster.pop('warning', '最新库存量不能大于99999999');
                 return result;
             }
             if(isNaN(commodity.editMinBuyQty)) {
+                commodity.editMinBuyQtyInValid  = true;
                 toaster.pop('warning', '最小起拍量必须是数字');
                 return result;
             }
-            if(commodity.editMinBuyQty % commodity.minPackQty != 0) {
-                toaster.pop('warning', '起订量必须是倍数的整数倍');
+            if(commodity.editReserve < commodity.editMinBuyQty) {
+                commodity.editReserveInvalid  = true;
+                commodity.editMinBuyQtyInValid = true;
+                toaster.pop('warning', '最新库存必须大于最小起拍量');
                 return result;
             }
-            if(!changeQtyPrice(commodity)) {
+            if(isNaN(commodity.editMinPackQty)) {
+                commodity.editMinPackQtyInValid  = true;
+                toaster.pop('warning', '倍数必须是数字');
                 return result;
             }
-            if(!$scope.compareNum(commodity.editMinDelivery, commodity.editMaxDelivery)) {
+            if(!commodity.editMinBuyQty) {
+                commodity.editMinBuyQtyInValid = true;
+                toaster.pop('warning', '请填写起拍量之后再提交');
                 return result;
             }
-            return true;
+            if(!commodity.editMinPackQty) {
+                commodity.editMinPackQtyInValid = true;
+                toaster.pop('warning', '请填写倍数之后再提交');
+                return result;
+            }
+            if(commodity.editMinBuyQty % commodity.editMinPackQty != 0) {
+                commodity.editMinBuyQtyInValid = true;
+                commodity.editMinPackQtyInValid = true;
+                toaster.pop('warning', '起拍量必须是倍数的整数倍');
+                return result;
+            }
+            var lastEnd = -1;
+            for (var i = 0; i < commodity.editPrices.length; i++) {
+                if(isNaN(commodity.editPrices[i].start)) {
+                    commodity.editPrices[i].startInValid = true;
+                    toaster.pop('warning', '分段数量必须是数字');
+                    return result;
+                }
+                if(commodity.editPrices[i].start <= lastEnd) {
+                    commodity.editPrices[i].startInValid = true;
+                    toaster.pop('warning', "存在分段的起始值小于等于上一个分段的结束值");
+                    return result;
+                }
+                if(isNaN(commodity.editPrices[i].end)) {
+                    commodity.editPrices[i].endInValid = true;
+                    toaster.pop('warning', '分段数量必须是数字');
+                    return result;
+                }
+                if(commodity.editPrices[i].start >= commodity.editPrices[i].end) {
+                    commodity.editPrices[i].startInValid = true;
+                    commodity.editPrices[i].endInValid = true;
+                    toaster.pop('warning', "存在分段的起始值大于等于分段的结束值");
+                    return result;
+                }
+                if(commodity.currencyName.indexOf('USD') > -1) {
+                    if(!commodity.editPrices[i].uSDPrice) {
+                        commodity.editPrices[i].usdPriceInvalid = true;
+                        toaster.pop('warning', "香港交货($)为空,请填写后再次提交!");
+                        return result;
+                    }else if(isNaN(commodity.editPrices[i].uSDPrice)){
+                        commodity.editPrices[i].usdPriceInvalid = true;
+                        toaster.pop('warning', "香港交货($)信息必须是数字");
+                        return result;
+                    }
+                }
+                if(commodity.currencyName.indexOf('RMB') > -1) {
+                    if(!commodity.editPrices[i].rMBPrice) {
+                        commodity.editPrices[i].rmbPriceInvalid = true;
+                        toaster.pop('warning', "大陆交货(¥)为空,请填写后再次提交!");
+                        return result;
+                    }else if(isNaN(commodity.editPrices[i].rMBPrice)){
+                        commodity.editPrices[i].rmbPriceInvalid = true;
+                        toaster.pop('warning', "大陆交货(¥)信息必须是数字");
+                        return result;
+                    }
+                }
+            }
+            if(commodity.currencyName.indexOf('USD') > -1 && !$scope.compareNum(commodity.editSelfDeliveryHKMinTime, commodity.editSelfDeliveryHKMaxTime, 2, commodity)) {
+                return result;
+            }
+
+            if(commodity.currencyName.indexOf('RMB') > -1 && !$scope.compareNum(commodity.editSelfDeliveryDemMinTime, commodity.editSelfDeliveryDemMaxTime, 1, commodity)) {
+                return result;
+            }
+
+            result = true;
+            return result;
         }
 
         /**
@@ -666,6 +1021,12 @@ define([ 'app/app' ], function(app) {
             if(!$scope.checkGoodsInfo(commodity)) {
                 return ;
             }
+            //更新分段信息
+            if(!changeQtyPrice(commodity)) {
+                return ;
+            };
+
+
 
             //将修改的信息映射到对应的字段
             inserseCommodity(commodity);
@@ -682,13 +1043,85 @@ define([ 'app/app' ], function(app) {
         };
 
         var inserseCommodity = function (commodity) {
+            commodity.packaging = commodity.editPackaging;
+            commodity.produceDate = commodity.editProduceDate;
+            commodity.oldReserve =  commodity.reserve;
+            commodity.reserve =  commodity.editReserve;
             commodity.minBuyQty = commodity.editMinBuyQty;
             commodity.prices = commodity.editPrices;
-            commodity.maxDelivery = commodity.editMaxDelivery;
-            commodity.minDelivery = commodity.editMinDelivery;
+            commodity.selfDeliveryHKMinTime = commodity.editSelfDeliveryHKMinTime;
+            commodity.selfDeliveryHKMaxTime = commodity.editSelfDeliveryHKMaxTime;
+            commodity.selfDeliveryDemMinTime = commodity.editSelfDeliveryDemMinTime;
+            commodity.selfDeliveryDemMaxTime = commodity.editSelfDeliveryDemMaxTime;
+            commodity.selfSale = commodity.editSelfSale;
+            commodity.minPackQty = commodity.editMinPackQty;
             commodity.img = commodity.editPic;
         }
 
+        /**
+         * 验证价格是否是合理的,
+         * @param price 当前的分段,
+         * @param isUsd 是美金吗?
+         */
+        $scope.priceValid = function (price, isUsd) {
+            if(isUsd) {
+                price.usdPriceInvalid = false;
+                if(this.usdForm) {
+                    var viewValue = this.usdForm.usd.$viewValue;
+                    if(viewValue) {
+                        if(validPriceDotBeforeAndAfter(viewValue)) {
+                            this.usdForm.usd.$viewValue = this.usdForm.usd.$modelValue;
+                            this.usdForm.usd.$render();
+                        }
+                        if(isNaN(viewValue)) {
+                            price.usdPriceInvalid = true;
+                        }
+                    }
+
+                }
+            }else {
+                price.rmbPriceInvalid = false;
+                if(this.rmbForm) {
+                    var viewValue = this.rmbForm.rmb.$viewValue;
+                    if(viewValue) {
+                        if(validPriceDotBeforeAndAfter(viewValue)) {
+                            this.rmbForm.rmb.$viewValue = this.rmbForm.rmb.$modelValue;
+                            this.rmbForm.rmb.$render();
+                        }
+                        if(isNaN(viewValue)) {
+                            price.rmbPriceInvalid = true;
+                        }
+                    }
+
+                }
+            }
+        };
+
+        /**
+         * 输入value 如果超过了数据长度,则不能添加
+         * @param value
+         * @returns {boolean}
+         */
+        var validPriceDotBeforeAndAfter = function(value) {
+            if(!value) {
+                return false;
+            }
+            if(value.indexOf('.') > -1) {
+                var arr = value.split(".");
+                if(arr[0].length > 4) {
+                    return true;
+                }
+                if(arr[1].length > 6) {
+                    return true;
+                }
+            }else {
+                if(value.length > 4) {
+                    return true;
+                }
+            }
+            return false;
+        };
+
         /**
          * 修改批次信息的图片
          */
@@ -832,7 +1265,7 @@ define([ 'app/app' ], function(app) {
                 sorting : {
                     createdDate: 'DESC'
                 },
-                status : '601-602'
+                status : 601
             };
             loadData();
         };
@@ -850,4 +1283,21 @@ define([ 'app/app' ], function(app) {
             loadDataReload();
         };
     }]);
+
+    app.register.controller('editPictureCtrl', ['$scope', 'pic', '$modalInstance', function ($scope, pic, $modalInstance) {
+        console.log('log')
+        $scope.pic = pic;
+        $scope.cancel = function () {
+            $modalInstance.close();
+        };
+
+        // 图片上传成功之后
+        $scope.onUploadSuccess = function(data){
+            $scope.pic = data.path;
+        };
+
+        $scope.confirm = function() {
+            $modalInstance.close($scope.pic);
+        }
+    }]);
 });

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

@@ -1,7 +1,7 @@
 define([ 'app/app' ], function(app) {
     'use strict';
     app.register.controller('vendor_undercarriageCtrl', ['$scope', '$rootScope', '$q', 'Goods', 'Enterprise', 'toaster', 'Loading', 'StoreInfo', 'AuthenticationService', function ($scope, $rootScope, $q, Goods, Enterprise, toaster, Loading, StoreInfo, AuthenticationService) {
-        $rootScope.active = 'vendor_goods';
+        $rootScope.active = 'vendor_material';
 
         $scope.tab = 'undercarriage';
         $scope.keyword = '';

+ 10 - 12
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -412,8 +412,8 @@
 	<div class="pro_management device">
 		<div class="com_tab">
 			<ul class="fl" style="width: 100%">
-				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">标准上架管理</a></li>
-				<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品维护</a></li>
+				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">产品库</a></li>
+				<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
 				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架产品</a></li>
 			</ul>
 		</div>
@@ -469,21 +469,19 @@
 							<span ng-show="isBatch"><input type="checkbox" ng-checked="material.isChoosed"  ng-click="chooseOne(material)"  id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>
 							<span ng-show="!isBatch" ng-bind="(param.currentPage - 1) * 10 + $index + 1"></span>
 						</td>
-						<td ng-bind="material.code" title="{{material.code}}"></td>
+						<td ng-bind="material.prodNum" title="{{material.prodNum}}"></td>
 						<td>
-							<span ng-if="!material.cmpUuId" ng-bind="material.title" title="{{material.title}}"></span>
-							<span ng-if="material.cmpUuId" ng-bind="material.kindCn" title="{{material.kindCn}}"></span>
-							<span ng-if="material.cmpUuId && !material.kindCn" ng-bind="material.kindEn" title="{{material.kindEn}}"></span>
+							<span ng-if="material.kind" ng-bind="material.kind" title="{{material.kind}}"></span>
+							<span ng-if="!material.kind" ng-bind="material.kinden" title="{{material.kinden}}"></span>
 						</td>
 						<td>
-							<div ng-if="!material.cmpUuId" ng-bind="material.brand" title="{{material.brand}}"></div>
-							<div class="ellipsis-div" ng-if="material.cmpUuId && material.b2cBrandEn" ng-bind="material.b2cBrandEn" title="{{material.b2cBrandEn}}"></div>
-							<div class="ellipsis-div" ng-if="material.cmpUuId && material.b2cBrandCn && material.b2cBrandCn != material.b2cBrandEn" ng-bind="material.b2cBrandCn" title="{{material.b2cBrandCn}}"></div>
+							<div class="ellipsis-div" ng-if="material.pbranden" ng-bind="material.pbranden" title="{{material.pbranden}}"></div>
+							<div class="ellipsis-div" ng-if="!material.pbranden" ng-bind="material.pbrand" title="{{material.pbrand}}"></div>
 						</td>
-						<td ng-bind="material.unit" title="{{material.unit}}"></td>
+						<td ng-bind="material.unit || 'PCS'" title="{{material.unit  || 'PCS'}}"></td>
 						<td>
-							<a ng-if="material.cmpUuId" ng-href="product/component/{{material.cmpUuId}}/" ng-bind="material.b2cCode" title="{{material.b2cCode}}" style="color: #333;"></a>
-							<span ng-if="!material.cmpUuId" ng-bind="material.cmpCode" title="{{material.cmpCode}}"></span>
+							<a ng-if="material.cmpUuId" ng-href="product/component/{{material.cmpUuId}}/" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}" style="color: #333;"></a>
+							<span ng-if="!material.cmpUuId" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}"></span>
 						</td>
 						<td>
 							<a ng-show="!isBatch && standard_tab == 'standard'" ng-click="showShelfArea(material)"><span ng-show="!isBatch">编辑</span></a>

+ 295 - 393
src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html

@@ -273,14 +273,13 @@
         white-space: nowrap;
         overflow: hidden;
         text-overflow: ellipsis;
-        line-height: 28px;
     }
     .vendor-tab.table td p{
         font-size: 14px;
         text-align: left;
     }
     /*.vendor-tab.table>tbody>tr{*/
-        /*height: 252px;*/
+    /*height: 252px;*/
     /*}*/
     .public-tab.table>tbody>tr>td{
         /*border-bottom: #cfcfcf 1px dashed;*/
@@ -339,7 +338,7 @@
         float: left;
     }
     .edit-form td div span:first-child{
-        /*margin-right: 2px;*/
+        margin-right: 2px;
     }
     .filter{
         position: relative;
@@ -460,181 +459,74 @@
         margin-top: 15px;
     }
 
-    .edit-form .error{
-        border: #f00 1px solid !important;
-    }
-
-    .edit-form .error:focus{
-        box-shadow: none;
-    }
-    .public-tab.table>tbody>tr>td div:last-child a.add[disabled], .public-tab.table>tbody>tr>td div:last-child a.reduce[disabled]{
-        color: #c7c7c7 !important;
-    }
-    .text-left{
-        text-align: left !important;
-    }
-    .width82{
-        width: 82px !important;
-    }
-    .public-tab.table>tbody>tr>td a.delete{
-        margin: 0;
-        width: 16px;
-        height: 16px;
-        border-radius:100%;
-        background: #fff;
-        display: inline-block;
-        line-height: 14px;
-        text-align: center;
-        margin-left: 3px;
-    }
-    .public-tab.table>tbody>tr>td a.delete i{
-        font-size: 10px;
-        line-height: 16px;
-    }
-    .public-tab.table>tbody>tr>td a.delete:hover i{
-        color: #5078cb;
-    }
-    .public-tab.table>tbody>tr>td button.add{
-        width: 83px;
-        height: 24px;
-        background: #dff3fd;
-        text-align: center;
-        border-radius: 3px;
-        font-size: 12px;
-        color: #333 !important;
-    }
-    .public-tab.table>tbody>tr>td button.add i{
-        color: #fc5901;
-        margin-right: 3px;
+    /* 预览框 end */
+    #image-box .x-floating-wrap {
+        position: fixed;
+        z-index: 99998;
+        background: #000;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        opacity: 0.5;
     }
-    .public-tab.table>tbody>tr>td div.step span{
-        display: inline-block;
-        background: #b5b3b3;
-        font-size: 12px;
-        color: #fff;
+    #image-box .x-floating {
+        position: fixed;
+        z-index: 99999;
+        width: 970px;
+        height: 600px;
+        top: 50%;
+        left: 50%;
+        margin-left: -485px;
+        margin-top: -300px;
+        line-height: 560px;
         text-align: center;
+        vertical-align: middle;
     }
-    .public-tab.table>tbody>tr>td div.step span i{
-        font-size: 12px;
-        line-height: 24px;
+    #image-box .x-floating img {
+        margin: auto auto;
+        max-width: 970px !important;
+        max-height: 600px !important;
+        -webkit-user-select: none;
+        -moz-user-select: none;
+        -ms-user-select: none;
+        user-select: none
     }
-    .public-tab.table>tbody>tr>td div.step span.dot{
-        margin: 0 1px;
-    }
-    .public-tab.table>tbody>tr>td div.step .first,.public-tab.table>tbody>tr>td div.step .last{
-        width: 42px;
-        height: 24px;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-    }
-    .public-tab.table>tbody>tr>td div.step .first{
-        border-top-left-radius: 2px;
-        border-bottom-left-radius: 2px;
-        margin-left: 10px;
-    }
-    .public-tab.table>tbody>tr>td div.step .last{
-        border-top-right-radius: 2px;
-        border-bottom-right-radius: 2px;
-    }
-    .public-tab.table>tbody>tr>td div.step span.dot{
-        width: 18px;
-        height: 24px;
-    }
-    .public-tab.table>tbody>tr>td div.dot01,.public-tab.table>tbody>tr>td div.dot01 span{
-        margin-top: 0;
-        height: 10px;
-        text-align: center;
-        position: relative;
+
+    #image-box .x-close-wrap {
+        position: fixed;
+        top: 0;
+        right: 0;
+        z-index: 100000;
+        width: 120px;
+        height: 120px;
+        margin: -60px -60px 0 0;
+        border-radius: 100%;
+        background: #000;
+        opacity: .3
     }
-    .public-tab.table>tbody>tr>td div.dot01 i{
+
+    #image-box .x-close-wrap a {
         position: absolute;
-       left: 55px;
-        color: #b5b3b3;
-        top:-3px;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1{
-        line-height: 85px;
-        margin: 0;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a{
-        margin: 0;
-        width: 16px;
-        height: 16px;
-        border-radius:100%;
-        background: #fff;
-        display: inline-block;
-        line-height: 14px;
-        text-align: center;
-        font-size: 12px;
+        left: 25px;
+        bottom: 25px;
+        font-size: 42px;
+        color: #fff
     }
-    .public-tab.table>tbody>tr>td div.icon-1 a.edit ,.public-tab.table>tbody>tr>td div.icon-1 a.ok i{
-        color: #36ba02;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.load ,.public-tab.table>tbody>tr>td div.icon-1 a.off{
-        margin-left: 5px;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.load ,.public-tab.table>tbody>tr>td div.icon-1 a.off i{
-        color: #fc5901;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.edit:hover,.public-tab.table>tbody>tr>td div.icon-1 a.ok:hover{
-        background: #36ba02;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.edit:hover i,.public-tab.table>tbody>tr>td div.icon-1 a.ok:hover i{
-        color: #fff;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.load:hover,.public-tab.table>tbody>tr>td div.icon-1 a.off:hover{
-        background: #fc5901;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.load:hover i,.public-tab.table>tbody>tr>td div.icon-1 a.off:hover i{
-        color: #fff;
-    }
-    .public-tab.table>tbody tr.tr-bg:hover{
-      background: #c7ebfd;
-    }
-    .public-tab.table>tbody tr.tr-bg td div.icon-1{
-        display: none;
-    }
-    .public-tab.table>tbody tr.tr-bg:hover td div.icon-1{
-        display: block;
-    }
-    .span100{
-        width: 100% !important;
-        text-align: center !important;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-    }
-    div.ng-table-pager div.page-go-block{
-        margin-top: 15px !important;
-    }
-    .public-tab.table>tbody>tr>td button.add.disabled{
-        background: #cdcccc;
-        color: #999 !important;
-    }
-    .public-tab.table>tbody>tr>td button.add.disabled i{
-        color: #999;
-    }
-    .edit-form td div.price:nth-child(1){
-        margin-bottom: 5px;
-    }
-    .edit-form td div.price:nth-child(2){
-        margin-bottom: 5px;
-    }
-    .edit-form td div.step:nth-child(2){
-        margin-top: 10px;
-    }
-    .edit-form td div.step:nth-child(3){
-        margin-top: 10px;
+
+    #image-box .x-close-wrap:hover {
+        opacity: .7
     }
-    .text-more-80{
-        float: left;
+
+    .edit-form .error{
+        border: #f00 1px solid !important;
     }
-    .text-more-80 span:first-child{
-        float: left;
+
+    .edit-form .error:focus{
+        box-shadow: none;
     }
-    .text-more-80 span.text-more{
-        width: 50px;
+    .public-tab.table>tbody>tr>td div:last-child a.add[disabled], .public-tab.table>tbody>tr>td div:last-child a.reduce[disabled]{
+        color: #c7c7c7 !important;
     }
 </style>
 <div class="user_right fr">
@@ -642,9 +534,9 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li ng-class="{'active': tab == 'vendor_standardPutOn'}"><a ui-sref="vendor_standardPutOn">标库上架管理</a></li>
-                <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品维护</a></li>
-                <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
+                <li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">产品库</a></li>
+                <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
+                <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">下架产品</a></li>
                 <li class="down-goods">
                     <!--<span ng-click="downGoods()">
                         <i class="fa fa-file-excel-o fa-fw"></i>导出Excel
@@ -657,7 +549,7 @@
         </div>
         <div class="search-check">
             <div class="search fl">
-                <input type="text" class="form-control" ng-model="keyword" ng-search="onSearch()" placeholder="类目/品牌/型号"/>
+                <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>
                 <form style="display: none;" id="down-load-goods" method="get">
@@ -665,17 +557,17 @@
                 </form>
             </div>
             <!--<div class="check fr">-->
-                <!--<a  ng-click="">批量操作</a>-->
-                <!--<span class="check-btn">-->
-                    <!--<label class="check-active">-->
-                        <!--<input type="checkbox" id="AllChoose"/>-->
-                        <!--<label for="AllChoose"></label>-->
-                        <!--<span>全选</span>-->
-                    <!--</label>-->
-                    <!--<a href="#">下架</a>-->
-                    <!--<a href="#">取消</a>-->
-                    <!--<a href="#">确定</a>-->
-                <!--</span>-->
+            <!--<a  ng-click="">批量操作</a>-->
+            <!--<span class="check-btn">-->
+            <!--<label class="check-active">-->
+            <!--<input type="checkbox" id="AllChoose"/>-->
+            <!--<label for="AllChoose"></label>-->
+            <!--<span>全选</span>-->
+            <!--</label>-->
+            <!--<a href="#">下架</a>-->
+            <!--<a href="#">取消</a>-->
+            <!--<a href="#">确定</a>-->
+            <!--</span>-->
             <!--</div>-->
         </div>
         <!--搜索 批量操作-->
@@ -704,219 +596,230 @@
             <div class="tab">
                 <table class="vendor-tab public-tab table">
                     <thead>
-                        <tr>
-                            <th width="45" style="padding:8px 0;">序号</th>
-                            <th>产品信息</th>
-                            <th width="85" style="padding:8px 0;">&nbsp;</th>
-                            <th width="110" class="text-left">生产日期</th>
-                            <th width="80">起订量</th>
-                            <th width="140">梯度</th>
-                            <th width="110">单价</th>
-                            <th width="115">交期(天)</th>
-                            <th width="90">在售数量</th>
-                            <th width="60" class="padding0">操作</th>
-                        </tr>
+                    <tr>
+                        <th width="45" style="padding:8px 0;">序号</th>
+                        <th>产品信息</th>
+                        <th width="110">包装/生产日期</th>
+                        <th width="100">库存</th>
+                        <th width="105">数量</th>
+                        <th width="90">香港交货<b style="font-size: 12px;font-weight: 600">($)</b></th>
+                        <th width="116">大陆交货<b style="font-size: 12px;font-weight: 600">(¥)</b></th>
+                        <th width="120">交期</th>
+                        <th class="filter" width="90">
+                            <a>{{selfSupport}}<i class="fa fa-angle-double-down angle-hover-up" aria-hidden="true"></i></a>
+                            <div class="hover-show">
+                                <a ng-click="changeSupportType(selfSupportType.ALL)" title="自营/寄售">自营/寄售</a>
+                                <a ng-click="changeSupportType(selfSupportType.SELF_SUPPORT)" title="自营">自营</a>
+                                <a ng-click="changeSupportType(selfSupportType.CONSIGNMENT)" title="寄售">寄售</a>
+                            </div>
+                        </th>
+                        <th width="60" class="padding0">操作</th>
+                    </tr>
                     </thead>
                     <tbody class="bottom-no">
-                        <tr style="height: 14px;">
-                            <td colspan="10" class="hei16"></td>
-                        </tr>
+                    <tr style="height: 14px;">
+                        <td colspan="10" class="hei16"></td>
+                    </tr>
                     </tbody>
                     <tbody ng-repeat="commodity in currenctGoods">
-                        <tr class="edit-form tr-bg" ng-if="!commodity.edit">
-                            <td class="middle padding0 check-input">
-                               <!-- <span><input type="checkbox" id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>-->
-                                <div>{{$index + 1}}</div>
-                            </td>
-                            <td class="middle"  style="vertical-align: top !important;">
-                                <div class="fl img">
-                                    <a><img ng-src="{{commodity.img ? commodity.img : 'static/img/store/common/default.png'}}"/></a>
-                                    <div class="hover-show">
-                                        <a ng-click="showImg(commodity.img || 'static/img/store/common/default.png')" title="查看大图"><i class="fa fa-search"></i>查看</a>
-                                    </div>
-                                </div>
-                                <div class="fr wid135">
-                                    <p>类目: <em ng-bind="commodity.kindNameCn" title="{{commodity.kindNameCn}}">CPU</em></p>
-                                    <p>型号: <em ng-bind="commodity.code" title="{{commodity.code}}">LPC1112</em></p>
-                                    <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>
-                                </div>
-                            </td>
-                            <td style="padding: 8px 0;">
-                                <div class="text-more-80">
-                                    <span>包装: </span>
-                                    <span ng-bind="commodity.packaging || '-'" title="{{commodity.packaging}}" class="text-more"></span>
+                    <tr class="edit-form" ng-if="!commodity.edit">
+                        <td class="middle padding0 check-input">
+                            <!-- <span><input type="checkbox" id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>-->
+                            <div>{{$index + 1}}</div>
+                        </td>
+                        <td class="middle"  style="vertical-align: top !important;">
+                            <div class="fl img">
+                                <a><img ng-src="{{commodity.img ? commodity.img : 'static/img/store/common/default.png'}}"/></a>
+                                <div class="hover-show">
+                                    <a ng-click="showImg(commodity.img || 'static/img/store/common/default.png')" title="查看大图"><i class="fa fa-search"></i>查看</a>
                                 </div>
-                                <div class="text-more-80">
-                                    <span>单位: </span>
-                                    <span ng-bind="commodity.unit || 'PCS'" title="{{commodity.unit || 'PCS'}}" class="text-more">PCS</span>
+                            </div>
+                            <div class="fr wid135">
+                                <p>型号: <em ng-bind="commodity.code" title="{{commodity.code}}">LPC1112</em></p>
+                                <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>
+                                <p>批次: <em ng-bind="commodity.batchCode" title="{{commodity.batchCode}}">100008</em></p>
+                            </div>
+                        </td>
+                        <td style="white-space: inherit;">
+                            <div>
+                                <span ng-bind="commodity.packaging || '无包装信息'"></span><br/>
+                            </div>
+                            <div>
+                                <span ng-bind="commodity.produceDate"></span>
+                            </div>
+                        </td>
+                        <td style="padding: 8px 0;">
+                            <div>
+                                <span>库存: </span>
+                                <span ng-bind="commodity.reserve" title="{{commodity.reserve}}"></span>
+                            </div>
+                            <div>
+                                <span>起拍: </span>
+                                <span ng-bind="commodity.minBuyQty" title="{{commodity.minBuyQty}}"></span>
+                            </div>
+                            <div>
+                                <span>倍数: </span>
+                                <span ng-bind="commodity.minPackQty" title="{{commodity.minPackQty}}"></span>
+                            </div>
+                            <!--<div>-->
+                            <!--<span>可拆卖</span>-->
+                            <!--</div>-->
+                        </td>
+                        <td>
+                            <div ng-repeat="price in commodity.prices" >
+                                <span ng-bind="price.start + '+'" style="margin-left: 20px;"></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div  ng-repeat="price in commodity.prices" ng-if="price.uSDPrice" >
+                                <span ng-bind="price.uSDPrice | formateNumber : 6"></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div ng-repeat="price in commodity.prices" ng-if="price.rMBPrice">
+                                <span ng-bind="price.rMBPrice | formateNumber : 6" style="margin-left: 10px;"></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div ng-if="commodity.b2cDeliveryDemMinTime">
+                                <span  ng-bind="'国内:' + commodity.b2cDeliveryDemMinTime + '-' + commodity.b2cDeliveryDemMaxTime"></span>
+                            </div>
+                            <div ng-if="commodity.b2cDeliveryHKMinTime">
+                                <span  ng-bind="'香港:' + commodity.b2cDeliveryHKMinTime + '-' + commodity.b2cDeliveryHKMaxTime"></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div>
+                                <span ng-bind="(storeInfo.uuid != 'undefind' && commodity.storeid == storeInfo.uuid && storeInfo.storeName.indexOf('优软测试二') < 0 && storeInfo.storeName.indexOf('优软商城') < 0) ? '自营' : '寄售'"  style="text-align: center; width: 100%;"></span>
+                            </div>
+                        </td>
+                        <td class="padding0">
+                            <div ng-if="!commodity.sourceId"><a class="edit" ng-click="editCommodity(commodity)">修改</a></div><!--updateCommodityInfo(commodity, false)-->
+                            <div ng-if="commodity.sourceId"><a style="margin: 0;">来源UAS</a></div>
+                            <div ng-if="!commodity.sourceId"><a ng-click="soldOut(commodity)">下架</a></div>
+                        </td>
+                    </tr>
+                    <tr class="edit-form" ng-if="commodity.edit">
+                        <td class="middle padding0 check-input">
+                            <div>{{$index + 1}}</div>
+                        </td>
+                        <td class="middle"  style="vertical-align: top !important;">
+                            <div class="fl img">
+                                <a><img ng-src="{{commodity.editPic ? commodity.editPic : 'static/img/store/common/default.png'}}"/></a>
+                                <div class="edit-img">
+                                    <a ng-click="editGoodsPicture(commodity.editPic || 'static/img/store/common/default.png', commodity)" title="修改图片"><img src="static/img/icon/update-img.png" /></a>
                                 </div>
-                                <div class="text-more-80">
-                                    <span>封装: </span>
-                                    <span ng-bind="commodity.encapsulation || '-'" title="{{commodity.encapsulation || '-'}}" class="textmore" style="width:50px;">BGA</span>
-                                </div>
-                                <!--<div>-->
-                                <!--<span>可拆卖</span>-->
-                                <!--</div>-->
-                            </td>
-                            <td style="white-space: inherit; padding-right: 0;">
-                                <div>
-                                    <span ng-bind="commodity.produceDate" class="text-more" style="width: 100px;" title="{{commodity.produceDate}}">2017-07-10</span>
-                                </div>
-                                <div class="text-more-80">
-                                    <span>包装数量: </span>
-                                    <span ng-bind="commodity.minPackQty" title="{{commodity.minPackQty}}" class="text-more" style="width: 40px;"></span>
-                                </div>
-                                <div>
-                                    <span ng-bind="((storeInfo.uuid != 'undefind')&&(commodity.storeid == storeInfo.uuid)&&(storeInfo.storeName.indexOf('优软测试二') < 0)&&(storeInfo.storeName.indexOf('优软商城') < 0)) ? '自营' : '寄售'">自营</span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                    <span class="span100" ng-bind="commodity.minBuyQty" title="{{commodity.minBuyQty}}">5000</span>
-                                </div>
-                            </td>
-                            <td>
-                                <div ng-repeat="price in commodity.prices">
-                                    <span style="margin-left: 40px;" ng-bind="price.start + '+'">11+</span>
-                                </div>
-                            </td>
-                            <td>
-                                <div ng-repeat="price in commodity.prices">
-                                    <span ng-if="$$onSale.currency == 'RMB'" style="margin-left: 20px;" ng-bind="price.rMBPrice | formateNumber : 6 | currencySysmbol : $$onSale.currency">0.52</span>
-                                    <span ng-if="$$onSale.currency == 'USD'" style="margin-left: 20px;" ng-bind="price.uSDPrice | formateNumber : 6 | currencySysmbol : $$onSale.currency">0.52</span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                    <span  ng-if = "commodity.b2cMinDelivery!= commodity.b2cMaxDelivery" ng-bind="commodity.b2cMinDelivery + '-' + commodity.b2cMaxDelivery" style="margin-left: 35px;"></span>
-                                    <span  ng-if = "commodity.b2cMinDelivery == commodity.b2cMaxDelivery" ng-bind="commodity.b2cMinDelivery" style="margin-left: 35px;"></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                   <span class="span100" ng-bind="commodity.reserve" title="{{commodity.reserve}}">121313</span>
-                                   <span class="span100 f12"  style="color: #999" ng-if="commodity.status == 602"><i class="fa fa-exclamation-circle" style="font-size: 12px; color: #5078cb; margin-right: 3px;"></i>已失效</span>
-                                </div>
-                            </td>
-                            <td class="padding0">
-                                <div ng-if="!commodity.sourceId" class="icon-1">
-                                    <a ng-click="editCommodity(commodity)" class="edit" title="编辑"><i class="fa fa-pencil"></i></a>
-                                    <a ng-click="soldOut(commodity)" class="load" title="下架"><i class="fa fa-download"></i></a>
-                                </div>
-                                <div ng-if="commodity.sourceId"><a style="margin: 0;">来源UAS</a></div>
-                            </td>
-                        </tr>
-                        <tr class="edit-form" ng-if="commodity.edit" style="background: #c7ebfd;">
-                            <td class="middle padding0 check-input">
-                                <div>{{$index + 1}}</div>
-                            </td>
-                            <td class="middle"  style="vertical-align: top !important; padding: 8px 0;">
-                                <div class="fl img">
-                                    <a><img ng-src="{{commodity.editPic ? commodity.editPic : 'static/img/store/common/default.png'}}"/></a>
-                                    <div class="edit-img">
-                                        <a ng-click="editGoodsPicture(commodity.editPic || 'static/img/store/common/default.png', commodity)" title="修改图片"><img src="static/img/icon/update-img.png" /></a>
-                                    </div>
-                                </div>
-                                <div class="fr wid135">
-                                    <p>类目: <em ng-bind="commodity.kindNameCn" title="commodity.kindNameCn" >CPU</em></p>
-                                    <p>型号: <em ng-bind="commodity.code" title="{{commodity.code}}">LPC1112</em></p>
-                                    <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>
-                                </div>
-                            </td>
-                            <td style="padding: 8px 0;">
-                                <div  class="text-more-80">
-                                    <span>包装: </span>
-                                    <span ng-bind="commodity.packaging || '-'" title="{{commodity.packaging}}" class="text-more"></span>
-                                </div>
-                                <div  class="text-more-80">
-                                    <span>单位: </span>
-                                    <span title="{{commodity.unit || 'PCS'}}" ng-bind="commodity.unit || 'PCS'" class="text-more">PCS</span>
-                                </div>
-                                <div  class="text-more-80">
-                                    <span>封装: </span>
-                                    <span title="{{commodity.encapsulation || '-'}}" ng-bind="commodity.encapsulation || '-'" class="text-more">BGA</span>
-                                </div>
-                            </td>
-                            <td style="white-space: inherit; padding-right: 0;">
-                                <div>
-                                    <span ng-bind="commodity.produceDate" title="{{commodity.produceDate}}" style="width: 100px;"></span>
-                                </div>
-                                <div class="text-more-80">
-                                    <span>包装数量: </span>
-                                    <span ng-bind="commodity.minPackQty" title="{{commodity.minPackQty}}" class="text-more" style="width: 40px;"></span>
-                                </div>
-                                <div>
-                                    <span ng-bind="((storeInfo.uuid != 'undefind')&&(commodity.storeid == storeInfo.uuid)&&(storeInfo.storeName.indexOf('优软测试二') < 0)&&(storeInfo.storeName.indexOf('优软商城') < 0)) ? '自营' : '寄售'">自营</span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                    <span style="margin-right: 0;"><input type="text" ng-blur="changeMinBuyQty(commodity)" placeholder="起订量"  ng-model="commodity.editMinBuyQty" class="wid68 form-control"/></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div class="step" ng-repeat="price in commodity.editPrices">
-                                    <span class="first" ng-bind="price.start" title="{{price.start}}">100</span>
-                                    <span class="dot"><i class="fa fa-long-arrow-right"></i></span>
-                                    <span class="last" ng-bind="price.end" title="{{price.end}}">300</span>
-                                </div>
-                                <div class="dot01" ng-if="commodity.editPrices.length < 3">
-                                    <span><i class="fa fa-chevron-up"></i></span>
-                                </div>
-                                <div style="margin-top: 0;" ng-if="commodity.editPrices.length < 3">
-                                    <span style="margin-left: 10px;"><input type="text" placeholder="分段数量"  ng-model="$$onSale.qty" class="form-control" style="width: 104px;"/></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div ng-repeat="price in commodity.editPrices" class="price">
+                            </div>
+                            <div class="fr wid135">
+                                <p>型号: <em ng-bind="commodity.code" title="{{commodity.code}}">LPC1112</em></p>
+                                <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>
+                                <p>批次: <em ng-bind="commodity.batchCode" title="{{commodity.batchCode}}">100008</em></p>
+                            </div>
+                        </td>
+                        <td>
+                            <div>
+                                <span><input type="text" ng-blur="editPackaging(commodity)" placeholder="包装方式" maxlength="10" ng-model="commodity.editPackaging" ng-class="{'error' : commodity.editPackagingInvalid}" class="wid88 form-control"/></span>
+                            </div>
+                            <div>
+                                <span><input type="text" ng-blur="editProduceDateFa(commodity)" placeholder="生产日期" maxlength="11" ng-model="commodity.editProduceDate" ng-class="{'error' : commodity.editProduceDateInvalid}" class="wid88 form-control"/></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div>
+                                <span>库存: </span>
+                                <span><input type="text" ng-blur="changeReserve(commodity)" ng-class="{'error' : commodity.editReserveInvalid}" placeholder="库存" ng-model="commodity.editReserve" class="wid48 form-control"/></span>
+                            </div>
+                            <div>
+                                <span>起拍: </span>
+                                <span><input type="text" ng-blur="changeMinBuyQty(commodity)" ng-class="{'error' : commodity.editMinBuyQtyInValid}" placeholder="起拍" ng-model="commodity.editMinBuyQty" class="wid48 form-control"/></span>
+                            </div>
+                            <div>
+                                <span>倍数: </span>
+                                <span><input type="text" ng-blur="changeMinPackQty(commodity)" ng-class="{'error' : commodity.editMinPackQtyInValid}" placeholder="倍数" ng-model="commodity.editMinPackQty" class="wid48 form-control"/></span>
+                            </div>
+                            <!--<div>-->
+                            <!--<span>-->
+                            <!--<select class="wid85 select-adder form-control" style="width: 81px;">-->
+                            <!--<option value="1">可拆卖</option>-->
+                            <!--<option value="2">不可拆卖</option>-->
+                            <!--</select>-->
+                            <!--</span>-->
+                            <!--</div>-->
+                        </td>
+                        <td>
+                            <div ng-repeat="price in commodity.editPrices">
+                                <span style="margin-right: 0;"><input type="text" ng-blur="editQty(commodity, $index, false, price.start)" ng-class="{'error' : price.startInValid}" placeholder="数量"  ng-model="price.start" class="wid40 form-control"/></span>
+                                <span>-</span>
+                                <span><input type="text" ng-blur="editQty(commodity, $index, true, price.end)" ng-class="{'error' : price.endInValid}" placeholder="数量" ng-model="price.end" class="wid40 form-control"/></span>
+                            </div>
+                        </td>
+                        <td><!--ng-pattern="^\d{1,4}.\d{0,6}$"-->
+                            <div style="width: 99px;" ng-repeat="price in commodity.editPrices">
+                                    <span ng-if="commodity.currencyName.indexOf('USD') > -1">
+                                        <form name="usdForm">
+                                            <input type="text" name="usd" ng-keyup="priceValid(price, true)" ng-class="{'error' : price.usdPriceInvalid}" placeholder="香港交货($)" autocomplete="off" ng-model="price.uSDPrice" ng-model-options="{debounce : 100}" class="wid85 form-control"/>
+                                        </form>
+                                    </span>
+                            </div>
+                        </td>
+                        <td>
+                            <div style="width: 99px;" ng-repeat="price in commodity.editPrices">
+                                    <span ng-if="commodity.currencyName.indexOf('RMB') > -1">
+                                        <form name="rmbForm">
+                                            <input type="text" name="rmb" ng-keyup="priceValid(price, false)" ng-class="{'error' : price.rmbPriceInvalid}" placeholder="大陆交货(¥)" autocomplete="off" ng-model="price.rMBPrice" ng-model-options="{debounce : 100}" class="wid85 form-control"/>
+                                        </form>
+                                    </span>
+                                <a class="reduce" ng-disabled="commodity.editPrices.length < 2" ng-click="deleteFragment(commodity, $index)"><i class="fa fa-minus-circle"></i></a>
+                                <a class="add" ng-disabled="commodity.editPrices.length >= 3" ng-click="addFragment(commodity)"><i class="fa fa-plus-circle"></i></a>
+                            </div>
+                        </td>
+                        <td>
+                            <div ng-if="commodity.currencyName.indexOf('USD') >  -1">
+                                <span>香港:</span>
+                                <span><input type="text" placeholder="香港最短交期" ng-class="{'error' : commodity.selfHkMinTimeinValid}" ng-blur="changeDelivery(commodity.editSelfDeliveryHKMinTime, commodity.editSelfDeliveryHKMaxTime, true, true, commodity)" ng-model="commodity.editSelfDeliveryHKMinTime" class="wid25 form-control"/></span>
+                                <span>-</span>
+                                <span><input type="text" placeholder="香港最长交期" ng-class="{'error' : commodity.selfHkMaxTimeinValid}" ng-blur="changeDelivery(commodity.editSelfDeliveryHKMinTime, commodity.editSelfDeliveryHKMaxTime, false, true, commodity)" ng-model="commodity.editSelfDeliveryHKMaxTime" class="wid25 form-control"/></span>
+                            </div>
+                            <div ng-if="commodity.currencyName.indexOf('RMB') >  -1">
+                                <span>大陆:</span>
+                                <span><input type="text" ng-class="{'error' : commodity.selfDemMinTimeinValid}" ng-blur="changeDelivery(commodity.editSelfDeliveryDemMinTime, commodity.editSelfDeliveryDemMaxTime, true, false, commodity)" placeholder="大陆最短交期" ng-model="commodity.editSelfDeliveryDemMinTime" class="wid25 form-control"/></span>
+                                <span>-</span>
+                                <span><input type="text" ng-class="{'error' : commodity.selfDemMaxTimeinValid}" ng-blur="changeDelivery(commodity.editSelfDeliveryDemMinTime, commodity.editSelfDeliveryDemMaxTime, false, false, commodity)" placeholder="大陆最长交期" ng-model="commodity.editSelfDeliveryDemMaxTime" class="wid25 form-control"/></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div>
                                     <span>
-                                        <input ng-if="$$onSale.currency == 'RMB'" type="text" placeholder="单价(含税)¥)" ng-blur="validPrice(price, price.rMBPrice, true)" ng-model="price.rMBPrice" class="width82 form-control"/>
-                                        <input ng-if="$$onSale.currency == 'USD'" type="text" placeholder="单价($)" ng-blur="validPrice(price, price.uSDPrice, false)" ng-model="price.uSDPrice" class="width82 form-control"/>
+                                        <select ng-change="changeSaleMode(commodity)" class="wid68 select-adder form-control" ng-model="commodity.editSelfSale">
+                                            <option value="1">自营</option>
+                                            <option value="2">寄售</option>
+                                        </select>
                                     </span>
-                                    <a class="delete" title="删除" ng-click="deleteFragment(commodity, $index)" ng-if="commodity.editPrices.length != 1"><i class="fa fa-trash"></i></a>
-                                </div>
-                                <div ng-if="commodity.editPrices.length < 3">
-                                    <span><button class="add" ng-class="{'disabled':!$$onSale.qty || commodity.editPrices.length == 3}" ng-disabled="!$$onSale.qty || commodity.editPrices.length == 3" ng-click="addFragment(commodity)"><i class="fa fa-plus"></i>插入分段</button></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div style="margin-left: 25px;">
-                                    <span><input type="text" ng-blur="blurDelivery(commodity.editMinDelivery, commodity.editMaxDelivery, true, commodity)" placeholder="最小交期" ng-model="commodity.editMinDelivery" class="wid25 form-control"/></span>
-                                    <span>-</span>
-                                    <span><input type="text" ng-blur="blurDelivery(commodity.editMinDelivery, commodity.editMaxDelivery, false, commodity)" placeholder="最大交期" ng-model="commodity.editMaxDelivery" class="wid25 form-control"/></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                    <span ng-bind="commodity.reserve" class="span100" title="{{commodity.reserve}}">1313</span>
+                            </div>
+                        </td>
+                        <td class="padding0">
+                            <div>
+                                <span><button class="off" ng-click="commodity.edit = false;">取消</button></span>
+                            </div>
+                            <div>
+                                <span><button class="ok" ng-click="updateGoods(commodity, $index)">保存</button></span>
+                            </div>
+                        </td>
+                    </tr>
+                    </tbody>
+                    <tbody ng-if="!currenctGoods || currenctGoods.length <= 0">
+                    <tr style="height: 252px;">
+                        <td colspan="10" style="padding: 74px 0;">
+                            <div style="line-height: 106px;">
+                                <div class="col-xs-2" style="margin-left: 35%;">
+                                    <img src="static/img/all/empty-cart.png">
                                 </div>
-                            </td>
-                            <td class="padding0">
-                                <div ng-if="!commodity.sourceId" class="icon-1">
-                                    <a ng-click="updateGoods(commodity, $index)" class="ok" title="保存" ><i class="fa fa-check"></i></a>
-                                    <a ng-click="commodity.edit = false;" class="off" title="取消" ><i class="fa fa-remove"></i></a>
+                                <div class="col-xs-4" style="line-height: 124px;">
+                                    <p class="grey f16">暂无在售产品信息</p>
                                 </div>
-                            </td>
-                        </tr>
-                    </tbody>
-                    <!--<tbody ng-if="!currenctGoods || currenctGoods.length <= 0">
-                         <tr style="height: 252px;">
-                             <td colspan="10" style="padding: 74px 0;">
-                                 <div style="line-height: 106px;">
-                                     <div class="col-xs-2" style="margin-left: 35%;">
-                                         <img src="static/img/all/empty-cart.png">
-                                     </div>
-                                     <div class="col-xs-4" style="line-height: 124px;">
-                                         <p class="grey f16">暂无在售产品信息</p>
-                                     </div>
-                                 </div>
-                             </td>
-                        </tr>
-                    </tbody>-->
-                    <tbody class="no-record-list" ng-if="!currenctGoods || currenctGoods.length <= 0">
-                        <tr class="height200">
-                            <td colspan="10"><img src="static/img/all/empty-cart.png"><span>暂无在售产品信息!</span></td>
-                        </tr>
+                            </div>
+                        </td>
+                    </tr>
                     </tbody>
                 </table>
                 <div class="record-line text-right" ng-if="currenctGoods.length != 0">显示1-<span ng-bind="goodsAll.size"></span>个,共:<span ng-bind="goodsAll.totalElements" cl style="color: #5078cb;"></span>个</div>
@@ -936,29 +839,28 @@
                         <a class="page-a" ng-click="setPage('page', param.currentPage)" href="">GO</a>
                     </div>
                 </div>
+            </div>
         </div>
     </div>
 </div>
-</div>
 <!--下架操作-->
 <div class="com-out-box" ng-if="isSoldOut">
     <div class="title">
         <a ng-click="cancleSoldOut()"><i class="fa fa-close fa-lg"></i></a>
     </div>
     <div class="content">
-        <p><i class="fa fa-exclamation-circle"></i>是否要下架此产品?</p>
-        <b ng-if="soldOutCommodity.isRecommond">*此产品已被推荐到店铺首页</b>
+        <p><i class="fa fa-exclamation-circle"></i>确认下架?</p>
         <div><a ng-click="cancleSoldOut()">取消</a><a ng-click="updateCommodityInfo(soldOutCommodity, true)">确认</a></div>
     </div>
 </div>
 
 <!--查看大图-->
 <div id="image-box" style="display: none">
+    <div class="x-close-wrap" title="关闭">
+        <a href="javascript:void(0);">&times;</a>
+    </div>
     <div class="x-floating-wrap"></div>
     <div class="x-floating">
-        <div id="item-content">
-            <div class="x-close-wrap"><a href="javascript:void(0);">&times;</a></div>
-            <div class="img"><img/></div>
-        </div>
+        <img/>
     </div>
 </div>

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

@@ -539,8 +539,8 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li ng-class="{'active': tab == 'vendor_standardPutOn'}"><a ui-sref="vendor_standardPutOn">标库上架管理</a></li>
-                <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品维护</a></li>
+                <li ng-class="{'active': tab == 'vendor_material'}"><a ui-sref="vendor_material">产品库</a></li>
+                <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
             </ul>
         </div>