Browse Source

Merge remote-tracking branch 'origin/liusw-seekpurchase-v3.0.1.23' into liusw-seekpurchase-v3.0.1.23

yangc 8 years ago
parent
commit
88be42e222
29 changed files with 1050 additions and 614 deletions
  1. 5 0
      pom.xml
  2. 15 0
      src/main/java/com/uas/platform/b2c/core/utils/StringUtilB2C.java
  3. 1 1
      src/main/java/com/uas/platform/b2c/external/erp/prod/service/impl/ProdServiceImpl.java
  4. 32 1
      src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java
  5. 14 0
      src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsQtyPrice.java
  6. 19 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java
  7. 53 16
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java
  8. 97 46
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java
  9. 26 9
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java
  10. 75 0
      src/main/java/com/uas/platform/b2c/prod/commodity/util/GoodsUtil.java
  11. 10 0
      src/main/java/com/uas/platform/b2c/trade/order/dao/OrderDetailDao.java
  12. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatchError-person.xls
  13. 1 1
      src/main/resources/prod/sys.properties
  14. BIN
      src/main/webapp/resources/img/upload/daishou-active.png
  15. BIN
      src/main/webapp/resources/img/upload/daishou-default.png
  16. BIN
      src/main/webapp/resources/img/upload/ziying-active.png
  17. BIN
      src/main/webapp/resources/img/upload/ziying-default.png
  18. 6 6
      src/main/webapp/resources/js/common/query/seekPurchase.js
  19. 106 84
      src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js
  20. 9 4
      src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js
  21. 67 46
      src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js
  22. 28 27
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js
  23. 337 327
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js
  24. 16 11
      src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html
  25. 1 0
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_erp.html
  26. 2 1
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_unstandard_erp.html
  27. 19 11
      src/main/webapp/resources/view/vendor/forstore/purchaseOffer.html
  28. 26 18
      src/main/webapp/resources/view/vendor/forstore/seekPurchase.html
  29. 85 5
      src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

+ 5 - 0
pom.xml

@@ -457,6 +457,11 @@
 			<artifactId>ps-entity</artifactId>
 			<artifactId>ps-entity</artifactId>
 			<version>0.0.1-SNAPSHOT</version>
 			<version>0.0.1-SNAPSHOT</version>
 		</dependency>
 		</dependency>
+		<dependency>
+			<groupId>com.uas.ps</groupId>
+			<artifactId>ps-entity</artifactId>
+			<version>0.0.1-SNAPSHOT</version>
+		</dependency>
 		<!--Hutool POI工具类(对MS Office操作)-->
 		<!--Hutool POI工具类(对MS Office操作)-->
 		<!--<dependency>
 		<!--<dependency>
 			<groupId>org.apache.poi</groupId>
 			<groupId>org.apache.poi</groupId>

+ 15 - 0
src/main/java/com/uas/platform/b2c/core/utils/StringUtilB2C.java

@@ -258,4 +258,19 @@ public class StringUtilB2C {
 	public static String getStr(Object obj) {
 	public static String getStr(Object obj) {
 		return StringUtils.isEmpty(obj) ? "" : String.valueOf(obj);
 		return StringUtils.isEmpty(obj) ? "" : String.valueOf(obj);
  	}
  	}
+
+	/**
+	 * 比较两个字符串是否相等
+	 *
+	 * @param a 字符串 a
+	 * @param b 字符串 b
+	 * @return
+	 */
+ 	public static Boolean equals(String a, String b) {
+		if (a == null) {
+			return b == null;
+		} else {
+			return a.equals(b);
+		}
+	}
 }
 }

+ 1 - 1
src/main/java/com/uas/platform/b2c/external/erp/prod/service/impl/ProdServiceImpl.java

@@ -62,7 +62,7 @@ public class ProdServiceImpl implements ProdService {
         Long enuu = SystemSession.getUser().getEnterprise().getUu();
         Long enuu = SystemSession.getUser().getEnterprise().getUu();
         for (Prod prod : prods) {
         for (Prod prod : prods) {
             if (StringUtils.isEmpty(prod.getPr_orispeccode()) || StringUtils.isEmpty(prod.getPr_brand())) {
             if (StringUtils.isEmpty(prod.getPr_orispeccode()) || StringUtils.isEmpty(prod.getPr_brand())) {
-                List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enuu,prod.getPr_orispeccode(),prod.getPr_brand(),IntegerConstant.YES_SHORT);
+                List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabledAndSourceApp(enuu,prod.getPr_orispeccode(),prod.getPr_brand(),IntegerConstant.YES_SHORT,"ERP");
                 if (!CollectionUtils.isEmpty(productList)) {
                 if (!CollectionUtils.isEmpty(productList)) {
                     Product product = ModelConverter.convert(prod);
                     Product product = ModelConverter.convert(prod);
                     Product existProduct = productList.get(0);
                     Product existProduct = productList.get(0);

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

@@ -1,9 +1,12 @@
 package com.uas.platform.b2c.prod.commodity.model;
 package com.uas.platform.b2c.prod.commodity.model;
 
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.alibaba.fastjson.annotation.JSONField;
-import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.NumberUtil;
 import com.uas.platform.b2c.core.utils.NumberUtil;
+import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
+import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
+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.exception.IllegalOperatorException;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.codehaus.jackson.annotate.JsonIgnore;
@@ -1588,4 +1591,32 @@ public class Goods implements Serializable {
 		g.setUuid(product.getCmpUuId());
 		g.setUuid(product.getCmpUuId());
 		return g;
 		return g;
 	}
 	}
+
+	/**
+	 * 根据给定的最小购买量和最小包装量,做微调。
+	 * @param minPackQty 最小包装量
+	 * @param minBuyQty 最小起订量
+	 * @return
+	 */
+	public ResultMap adjustMinBuyAndMinPack(Double minPackQty, Double minBuyQty) {
+		int minPackQtyCom = NumberUtil.compare(minPackQty, DoubleConstant.zero);
+		int minBuyQtyCom = NumberUtil.compare(minBuyQty, DoubleConstant.zero);
+		if (minPackQtyCom == 0 && minBuyQtyCom == 0) {
+			return new ResultMap(CodeType.NOT_COMPLETE_INFO, "上架必填信息缺失");
+		} else {
+			if (minPackQtyCom == 0 || minBuyQtyCom == 0) {
+				minPackQty = minBuyQtyCom == 0 ? minPackQty : minBuyQty;
+				minBuyQty = minPackQty;
+			}
+			double remainder = minBuyQty % minPackQty;
+			minBuyQty = NumberUtil.sub(minBuyQty, remainder);
+			int k = NumberUtil.compare(minBuyQty, minPackQty);
+			if (k < 0) {
+				minBuyQty = minPackQty;
+			}
+		}
+		this.minPackQty = minPackQty;
+		this.minBuyQty = minBuyQty;
+		return new ResultMap(CodeType.OK, "成功");
+	}
 }
 }

+ 14 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsQtyPrice.java

@@ -1,6 +1,8 @@
 package com.uas.platform.b2c.prod.commodity.model;
 package com.uas.platform.b2c.prod.commodity.model;
 
 
 import com.uas.api.b2c_erp.seller.model.GoodsQtyPriceUas;
 import com.uas.api.b2c_erp.seller.model.GoodsQtyPriceUas;
+import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
+import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
 
 
 /**
 /**
  * 商品分段数量价格
  * 商品分段数量价格
@@ -143,6 +145,18 @@ public class GoodsQtyPrice {
 		return uasdt;
 		return uasdt;
 	}
 	}
 
 
+	public static GoodsQtyPrice createGoodsQtyPrice(String currency, Double start, Double end, Double price) {
+		GoodsQtyPrice qtyPrice = new GoodsQtyPrice();
+		qtyPrice.setStart(start);
+		qtyPrice.setEnd(end);
+		if (currency.equals(StringConstant.RMB)) {
+			qtyPrice.setRMBPrice(price);
+		} else {
+			qtyPrice.setUSDPrice(price);
+		}
+		return qtyPrice;
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return "GoodsQtyPrice{" +
 		return "GoodsQtyPrice{" +

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

@@ -200,4 +200,23 @@ public interface ProductService {
      * @return
      * @return
      */
      */
     ResultMap batchPutOn(Integer standard, String ids);
     ResultMap batchPutOn(Integer standard, String ids);
+
+
+    /**
+     * 计算还剩多少空闲库存
+     *
+     * @param erpReserve erp 的空闲库存
+     * @param goodses1 需要减去 库存的的goods 的
+     * @return
+     */
+    Double getGoodsReserveByErpReserve(Double erpReserve, List<Goods> goodses1);
+
+
+    /**
+     * 获取订单中还未上传到UAS的数量
+     *
+     * @param batches 批次信息
+     * @return
+     */
+    Double getQtyInOrderToBeUpload(List<String> batches);
 }
 }

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

@@ -1330,9 +1330,6 @@ public class GoodsServiceImpl implements GoodsService {
         if (nowGoods.getSourceId() != null) {
         if (nowGoods.getSourceId() != null) {
             return new ResultMap(CodeType.NOT_PERMIT.code(), "该库存的信息属于UAS上架,平台不能修改。");
             return new ResultMap(CodeType.NOT_PERMIT.code(), "该库存的信息属于UAS上架,平台不能修改。");
         }
         }
-        if (nowGoods.getReserve().doubleValue() != goods.getOldReserve().doubleValue()) {
-            return new ResultMap(CodeType.INFO_UPDATE.code(), "该库存的信息已经被修改了,请刷新界面之后重新操作。");
-        }
         if (StringUtils.isEmpty(goods.getTag())) {
         if (StringUtils.isEmpty(goods.getTag())) {
             return new ResultMap(CodeType.NOT_PERMIT.code(), "产品自定义标签必须填写");
             return new ResultMap(CodeType.NOT_PERMIT.code(), "产品自定义标签必须填写");
         }
         }
@@ -1363,6 +1360,19 @@ public class GoodsServiceImpl implements GoodsService {
 
 
     private ResultMap putOnGoods(Goods goods) {
     private ResultMap putOnGoods(Goods goods) {
         if (goods != null) {
         if (goods != null) {
+            if(goods.getProductid() != null) {
+                Product product = productDao.findOne(goods.getProductid());
+                if(product != null) {
+                    if (StringConstant.ERP.equals(product.getSourceApp())) {
+                        List<Goods> goodses = goodsDao.findByProductId(product.getId());
+                        Double reserve = productService.getGoodsReserveByErpReserve(product.getErpReserve(), goodses);
+                        reserve = NumberUtil.sub(reserve, goods.getReserve());
+                        if (NumberUtil.compare(reserve, DoubleConstant.zero) < 0) {
+                            throw new IllegalOperatorException("总在售库存量超过空闲库存量");
+                        }
+                    }
+                }
+            }
             setGoodsDefault(goods);
             setGoodsDefault(goods);
             ResultMap resultMap = checkGoods(goods);
             ResultMap resultMap = checkGoods(goods);
             if (resultMap.getCode() != CodeType.OK.code()) {
             if (resultMap.getCode() != CodeType.OK.code()) {
@@ -1409,6 +1419,20 @@ public class GoodsServiceImpl implements GoodsService {
         } else {
         } else {
             throw new IllegalOperatorException("您选择的销售方式不存在");
             throw new IllegalOperatorException("您选择的销售方式不存在");
         }
         }
+        Product product = null;
+        if(goods.getProductid() != null) {
+            product = productDao.findOne(goods.getProductid());
+            if(product != null) {
+                if (StringConstant.ERP.equals(product.getSourceApp())) {
+                    List<Goods> goodses = goodsDao.findByProductId(product.getId());
+                    Double reserve = productService.getGoodsReserveByErpReserve(product.getErpReserve(), goodses);
+                    reserve = NumberUtil.sub(reserve, goods.getReserve());
+                    if (NumberUtil.compare(reserve, DoubleConstant.zero) < 0) {
+                        throw new IllegalOperatorException("总在售库存量超过空闲库存量");
+                    }
+                }
+            }
+        }
         setGoodsDefault(goods);
         setGoodsDefault(goods);
         ResultMap resultMap = checkGoods(goods);
         ResultMap resultMap = checkGoods(goods);
         if (resultMap.getCode() != CodeType.OK.code()) {
         if (resultMap.getCode() != CodeType.OK.code()) {
@@ -1418,21 +1442,18 @@ public class GoodsServiceImpl implements GoodsService {
         //	updateGoodTransactional(goods);
         //	updateGoodTransactional(goods);
         GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.ADD_GOODS.getPhrase());
         GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, OperateType.ADD_GOODS.getPhrase());
         Goods persistGoods = goodsDao.save(goods);
         Goods persistGoods = goodsDao.save(goods);
-        goodsHistoryDao.save(goodsHistory);
-        if(persistGoods.getProductid() != null) {
-            Product product = productDao.findOne(persistGoods.getProductid());
-            if(product != null) {
-                ProductPrivate productPrivate = releaseProductByBatchService.findByPrId(product.getId());
-                if (productPrivate == null) {
-                    productPrivate = new ProductPrivate();
-                }
-                Integer count = productPrivate.getBatchCount();
-                productPrivate.setBatchCount(count ==
-                        null ? 1 :
-                        ++count);
-                productPrivateDao.save(productPrivate);
+        if(product != null) {
+            ProductPrivate productPrivate = releaseProductByBatchService.findByPrId(product.getId());
+            if (productPrivate == null) {
+                productPrivate = new ProductPrivate();
             }
             }
+            Integer count = productPrivate.getBatchCount();
+            productPrivate.setBatchCount(count ==
+                    null ? 1 :
+                    ++count);
+            productPrivateDao.save(productPrivate);
         }
         }
+        goodsHistoryDao.save(goodsHistory);
         return ResultMap.success(persistGoods);
         return ResultMap.success(persistGoods);
     }
     }
 
 
@@ -1477,6 +1498,22 @@ public class GoodsServiceImpl implements GoodsService {
         } else {
         } else {
             throw new IllegalOperatorException("您选择的销售方式不存在");
             throw new IllegalOperatorException("您选择的销售方式不存在");
         }
         }
+
+        if(nowGoods.getProductid() != null) {
+            Product product = productDao.findOne(nowGoods.getProductid());
+            if(product != null) {
+                if (StringConstant.ERP.equals(product.getSourceApp())) {
+                    List<Goods> goodses = goodsDao.findByProductId(product.getId());
+                    Double reserve = productService.getGoodsReserveByErpReserve(product.getErpReserve(), goodses);
+                    reserve = NumberUtil.add(reserve, nowGoods.getReserve());
+                    reserve = NumberUtil.sub(reserve, oldGoods.getReserve());
+                    if (NumberUtil.compare(reserve, DoubleConstant.zero) < 0) {
+                        throw new IllegalOperatorException("总在售库存量超过空闲库存量");
+                    }
+                }
+            }
+        }
+
         // 设置货到香港,货到大陆的延长时间
         // 设置货到香港,货到大陆的延长时间
         setB2CDelayTime(nowGoods);
         setB2CDelayTime(nowGoods);
 
 

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

@@ -8,6 +8,7 @@ import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.core.constant.IntegerConstant;
 import com.uas.platform.b2c.core.constant.IntegerConstant;
 import com.uas.platform.b2c.core.constant.ShortConstant;
 import com.uas.platform.b2c.core.constant.ShortConstant;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.constant.SplitChar;
+import com.uas.platform.b2c.core.constant.Status;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.NumberUtil;
 import com.uas.platform.b2c.core.utils.NumberUtil;
@@ -17,6 +18,7 @@ import com.uas.platform.b2c.prod.commodity.dao.*;
 import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.service.*;
 import com.uas.platform.b2c.prod.commodity.service.*;
 import com.uas.platform.b2c.prod.commodity.type.ProductConstant;
 import com.uas.platform.b2c.prod.commodity.type.ProductConstant;
+import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
 import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
 import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
 import com.uas.platform.b2c.prod.product.brand.modal.Brand;
 import com.uas.platform.b2c.prod.product.brand.modal.Brand;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
@@ -45,7 +47,6 @@ import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.Status;
 import com.uas.platform.core.model.Type;
 import com.uas.platform.core.model.Type;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
@@ -1382,7 +1383,6 @@ public class ProductServiceImpl implements ProductService {
         Long uu = SystemSession.getUser().getEnterprise().getUu();
         Long uu = SystemSession.getUser().getEnterprise().getUu();
         ResultMap registerAddress = enterpriseService.getCurrencyByRegisterAddress();
         ResultMap registerAddress = enterpriseService.getCurrencyByRegisterAddress();
         String currency = null;
         String currency = null;
-        List<Goods> goodsList = new ArrayList<>();
         Set<String> uuids = new HashSet<>();
         Set<String> uuids = new HashSet<>();
         if (registerAddress.getCode() != CodeType.OK.code()) {
         if (registerAddress.getCode() != CodeType.OK.code()) {
             currency = StringConstant.RMB;
             currency = StringConstant.RMB;
@@ -1405,11 +1405,11 @@ public class ProductServiceImpl implements ProductService {
         String sql = null;
         String sql = null;
         Map<String, Object> map = new HashMap<>();
         Map<String, Object> map = new HashMap<>();
         if ((prIdLong != null) && (prIdLong.size() != 0)) {
         if ((prIdLong != null) && (prIdLong.size() != 0)) {
-            sql = "select p.pr_id from products p left join product$private pp on pp.pr_id = p.pr_id where ifnull(pp.pr_batchcount, 0) = 0 and p.pr_sourceapp = 'ERP' and p.pr_reserve <> 0 and ifnull(pp.pr_b2cenabled, 0) = 1 and p.pr_id in (:ids) and p.pr_id not in (select DISTINCT go_productid from trade$goods where  go_productid is not null and go_status != 612);";
+            sql = "select p.pr_id from products p left join product$private pp on pp.pr_id = p.pr_id where p.pr_sourceapp = 'ERP' and p.pr_reserve <> 0 and ifnull(pp.pr_b2cenabled, 0) = 1 and p.pr_id in (:ids);";
             map.put("ids", prIdLong);
             map.put("ids", prIdLong);
         } else {
         } else {
             // 暂时不会进入当前循环,速度比较低
             // 暂时不会进入当前循环,速度比较低
-            sql = "select p.pr_id from products p left join product$private pp on pp.pr_id = p.pr_id where ifnull(pp.pr_batchcount, 0) = 0 and p.pr_sourceapp = 'ERP' and p.pr_reserve <> 0 and ifnull(pp.pr_b2cenabled,0) = 1 and if(p.pr_standard, 0) = (:standard) and p.pr_enuu = (:enuu) and p.pr_id not in (select DISTINCT go_productid from trade$goods where  go_productid is not null and go_status != 612);";
+            sql = "select p.pr_id from products p left join product$private pp on pp.pr_id = p.pr_id where p.pr_sourceapp = 'ERP' and p.pr_reserve <> 0 and ifnull(pp.pr_b2cenabled, 0) = 1 and ifnull(p.pr_standard, 0) = (:standard) and p.pr_enuu = (:enuu);";
             map.put("enuu", uu);
             map.put("enuu", uu);
             map.put("standard", standard);
             map.put("standard", standard);
         }
         }
@@ -1429,16 +1429,19 @@ public class ProductServiceImpl implements ProductService {
             }
             }
         }
         }
         List<Goods> goodses = productDetailPutOn(sourceAppNotPutOn, storeName, storeid, currency, property);
         List<Goods> goodses = productDetailPutOn(sourceAppNotPutOn, storeName, storeid, currency, property);
-        goodsList.addAll(goodses);
+        if (CollectionUtils.isEmpty(goodses)) {
+            return new ResultMap(CodeType.OK.code(), "没有可上架的信息,产品上架必填字段为空或可上架数量为0");
+        }
         List<Goods> result = new ArrayList<Goods>();
         List<Goods> result = new ArrayList<Goods>();
-        goodsService.publishERPProductByBatch(goodsList, uuids, result);
+        goodsService.publishERPProductByBatch(goodses, uuids, result);
         List<Long> prids = new ArrayList<>();
         List<Long> prids = new ArrayList<>();
         for (Goods goods : result) {
         for (Goods goods : result) {
             prids.add(goods.getProductid());
             prids.add(goods.getProductid());
         }
         }
         List<ProductPrivate> productPrivates = productPrivateDao.findByPrIds(prids);
         List<ProductPrivate> productPrivates = productPrivateDao.findByPrIds(prids);
         for (ProductPrivate productPrivate : productPrivates) {
         for (ProductPrivate productPrivate : productPrivates) {
-            productPrivate.setBatchCount(IntegerConstant.YES_SHORT);
+            Integer count = productPrivate.getBatchCount() == null ? 0 : productPrivate.getBatchCount();
+            productPrivate.setBatchCount(count + IntegerConstant.YES_SHORT);
         }
         }
         productPrivateDao.save(productPrivates);
         productPrivateDao.save(productPrivates);
         for (String uuid : uuids) {
         for (String uuid : uuids) {
@@ -1450,9 +1453,14 @@ public class ProductServiceImpl implements ProductService {
         }
         }
         if ((sourceAppNotPutOn.size() - result.size()) != 0) {
         if ((sourceAppNotPutOn.size() - result.size()) != 0) {
             if (!StringUtils.isEmpty(message)) {
             if (!StringUtils.isEmpty(message)) {
-                message = message +  " ,";
+                message = message +  ",";
+            }
+            if (StringUtils.isEmpty(ids)) {
+               // message = message + "失败" + (sourceAppNotPutOn.size() - result.size()) + "个,原因:产品必填字段为空或可上架数量为0";
+            } else {
+                message = message + "失败" + (ids.split(SplitChar.COMMA).length - result.size()) + "个,原因:产品必填字段为空或可上架数量为0";
             }
             }
-            message = "失败" + (sourceAppNotPutOn.size()-  result.size()) + "个, 失败原因:产品上架必填字段为空, 请完善";
+
         }
         }
         return new ResultMap(CodeType.OK.code(), message);
         return new ResultMap(CodeType.OK.code(), message);
     }
     }
@@ -1505,19 +1513,10 @@ public class ProductServiceImpl implements ProductService {
         g.setMaxDelivery(property.getMaxDelivery());
         g.setMaxDelivery(property.getMaxDelivery());
         g.setMinDelivery(property.getMinDelivery());
         g.setMinDelivery(property.getMinDelivery());
         g.setProdNum(product.getProdNum());
         g.setProdNum(product.getProdNum());
-        List<String> tags = goodsDao.findTagByProductid(product.getId());
-        Integer i = 1;
-        String tag = StringConstant.SELF_TAG;
-        while(tags.contains(tag + i)) {
-            i++;
-        }
-        g.setTag(tag + i);
         g.setBreakUp(Boolean.FALSE);
         g.setBreakUp(Boolean.FALSE);
-        g.setReserve(product.getErpReserve());
+
         String packaging = (detail == null || detail.getPackaging() == null) ? product.getPackaging(): detail.getPackaging();
         String packaging = (detail == null || detail.getPackaging() == null) ? product.getPackaging(): detail.getPackaging();
-        if (packaging == null) {
-            packaging = StringConstant.DEFAULTPACKAGING;
-        }
+        packaging =  packaging == null ? StringConstant.DEFAULTPACKAGING : packaging;
         g.setPackaging(packaging);
         g.setPackaging(packaging);
 
 
         String produceDate = (detail == null || detail.getProduceDate() == null) ? product.getProduceDate() : detail.getProduceDate();
         String produceDate = (detail == null || detail.getProduceDate() == null) ? product.getProduceDate() : detail.getProduceDate();
@@ -1525,38 +1524,90 @@ public class ProductServiceImpl implements ProductService {
 
 
         Double minPackQty = (detail == null || detail.getMinPackQty() == null) ? product.getMinPackQty() : detail.getMinPackQty();
         Double minPackQty = (detail == null || detail.getMinPackQty() == null) ? product.getMinPackQty() : detail.getMinPackQty();
         Double minBuyQty = detail != null ? detail.getMinBuyQty() : null;
         Double minBuyQty = detail != null ? detail.getMinBuyQty() : null;
-        int minPackQtyCom = NumberUtil.compare(minPackQty, DoubleConstant.zero);
-        int minBuyQtyCom = NumberUtil.compare(minBuyQty, DoubleConstant.zero);
-        if (minPackQtyCom == 0 && minBuyQtyCom == 0) {
-            return new ResultMap(CodeType.NOT_COMPLETE_INFO, "上架必填信息缺失");
-        } else {
-            if (minPackQtyCom == 0 || minBuyQtyCom == 0) {
-                minPackQty = minBuyQtyCom == 0 ? minPackQty : minBuyQty;
-                minBuyQty = minPackQty;
-            }
-            double remainder = minBuyQty % minPackQty;
-            minBuyQty = NumberUtil.sub(minBuyQty, remainder);
-            int k = NumberUtil.compare(minBuyQty, minPackQty);
-            if (k < 0) {
-                minBuyQty = minPackQty;
-            }
+        ResultMap resultMap = g.adjustMinBuyAndMinPack(minPackQty, minBuyQty);
+        if (resultMap.getCode() != CodeType.OK.code()) {
+            return resultMap;
         }
         }
-        g.setMinPackQty(minPackQty);
-        g.setMinBuyQty(minBuyQty);
+
         double price = NumberUtil.mul(detail.getPrice(), property.getFluctuateRate());
         double price = NumberUtil.mul(detail.getPrice(), property.getFluctuateRate());
         price = NumberUtil.fractionNumCeil(price, IntegerConstant.PRICE_FRACTION);
         price = NumberUtil.fractionNumCeil(price, IntegerConstant.PRICE_FRACTION);
+        if (NumberUtil.compare(price, DoubleConstant.zero) < 1) {
+            return new ResultMap(CodeType.NOT_PERMIT.code(), "单价为0", null);
+        }
         List<GoodsQtyPrice> list = new ArrayList<>();
         List<GoodsQtyPrice> list = new ArrayList<>();
-        GoodsQtyPrice price1 = new GoodsQtyPrice();
-        price1.setStart(g.getMinBuyQty());
-        price1.setEnd(DoubleConstant.maxReserve);
-        if (currency.equals(StringConstant.RMB)) {
-            price1.setRMBPrice(price);
+        GoodsQtyPrice qtyPrice = GoodsQtyPrice.createGoodsQtyPrice(g.getCurrencyName(), g.getMinBuyQty(), DoubleConstant.maxReserve, price);
+        list.add(qtyPrice);
+        g.setPrices(list);
+
+        List<Goods> goodses1 = goodsDao.findByProductId(g.getProductid());
+        Goods sku = GoodsUtil.sameSKU(goodses1, g);
+        GoodsUtil.setTag(goodses1, sku);
+
+        Double erpReserve = getGoodsReserveByErpReserve(product.getErpReserve(), goodses1);
+        if (NumberUtil.compare(erpReserve, DoubleConstant.zero) > 0) {
+            if (sku.getStatus() == null || sku.getStatus().intValue() == Status.REMOVED.value()) {
+                sku.setReserve(erpReserve);
+            } else {
+                sku.setReserve(NumberUtil.add(sku.getReserve(), erpReserve));
+            }
+            return new ResultMap(CodeType.OK.code(), "成功", sku);
         } else {
         } else {
-            price1.setUSDPrice(price);
+            return new ResultMap(CodeType.NOT_PERMIT.code(), "没有可上架的数量", null);
         }
         }
-        list.add(price1);
-        g.setPrices(list);
-        return new ResultMap(CodeType.OK.code(), "成功", g);
+    }
+
+    /**
+     * 计算还剩多少空闲库存
+     *
+     * @param erpReserve erp 的空闲库存
+     * @param goodses1 需要减去 库存的的goods 的
+     * @return
+     */
+    @Override
+    public Double getGoodsReserveByErpReserve(Double erpReserve, List<Goods> goodses1) {
+        List<String> batches = new ArrayList<>();
+        // 目前只统计goods 在售的库存,下架和保存状态的不做调整
+        for (Goods goods : goodses1) {
+            if (goods.getStatus().intValue() == Status.UNAVAILABLE.value() || goods.getStatus().intValue() == Status.AVAILABLE.value()) {
+                erpReserve = NumberUtil.sub(erpReserve, goods.getReserve());
+            }
+            //batches.add(goods.getBatchCode());
+        }
+        //Double qty = getQtyInOrderToBeUpload(batches);
+        // erpReserve = NumberUtil.sub(erpReserve, qty);
+        return erpReserve;
+    }
+
+    /**
+     * 获取订单中还未上传到UAS的数量
+     *
+     * @param batches 批次信息
+     * @return
+     */
+    @Override
+    public Double getQtyInOrderToBeUpload(List<String> batches) {
+        if (CollectionUtils.isEmpty(batches)) {
+            return DoubleConstant.zero;
+        } else {
+            List<Integer> statuses = new ArrayList<>();
+            statuses.add(Status.TOBEPAID.value());
+            statuses.add(Status.TOBEPAIDAGAGIN.value());
+            statuses.add(Status.CANCELTOBECONFIRMED.value());
+            Double orderDetailQty = orderDetailDao.getgetSumQtyByBatchcodesAndStatus(batches, statuses);
+
+            List<Integer> puStatus = new ArrayList<>();
+            puStatus.add(Status.CONFIRMED.value());
+            puStatus.add(Status.PAID.value());
+            //获取平台还未上传的销售单
+            String sql = "select sum(detail_number) from trade$purchase p left join trade$purchase_detail pd on p.id = pd.purchase_id where p.pu_sendstatus = 202 and pd.go_batch in (:batches) and pd.detail_status in (:status);";
+            HashMap<String, Object> map = new HashMap<>();
+            map.put("batches", batches);
+            map.put("status", puStatus);
+            Double purchaseDetailQty = namedParameterJdbcTemplate.queryForObject(sql, map, Double.class);
+            double qty = NumberUtil.add(orderDetailQty, purchaseDetailQty);
+            return qty;
+        }
+
     }
     }
 }
 }
 
 

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

@@ -16,10 +16,7 @@ import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ErrorInfoConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ErrorInfoConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ShortConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ShortConstant;
 import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
 import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductPrivateDao;
-import com.uas.platform.b2c.prod.commodity.dao.ReleaseProductByBatchDao;
+import com.uas.platform.b2c.prod.commodity.dao.*;
 import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.commodity.service.ReleaseProductByBatchService;
 import com.uas.platform.b2c.prod.commodity.service.ReleaseProductByBatchService;
@@ -106,6 +103,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	@Autowired
 	@Autowired
 	private ProductPrivateDao productPrivateDao;
 	private ProductPrivateDao productPrivateDao;
 
 
+    @Autowired
+    private ProductPersonDao productPersonDao;
+
 	@Value("#{sys.productServiceIp}")
 	@Value("#{sys.productServiceIp}")
 	private String productServiceIp;
 	private String productServiceIp;
 
 
@@ -200,14 +200,28 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				}
 				}
 			}
 			}
 		}
 		}
+		Long userUU = SystemSession.getUser().getUserUU();
+		Long enUU = SystemSession.getUser().getEnterprise().getUu();
 		List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
 		List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
 		addList.addAll(releaseProductByBatchs);
 		addList.addAll(releaseProductByBatchs);
-		if (!isAPerson) {
-			resetRepeatData(addList);
+		resetRepeatData(addList, isAPerson);
+		if (isAPerson) {
+			for (ReleaseProductByBatch releaseProductByBatch : addList) {
+				List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enUU,releaseProductByBatch.getB2cCode(),
+						releaseProductByBatch.getB2cBranden(),IntegerConstant.YES_SHORT);
+				if (!CollectionUtils.isEmpty(productList)) {
+				    List<ProductPerson> productPersonList = productPersonDao.findByProductId(productList.get(0).getId());
+				    if (!CollectionUtils.isEmpty(productPersonList)) {
+                        releaseProductByBatch.setErrmsg(ErrorInfoConstant.REPEAT_INFO.getInfo());
+                        releaseProductByBatch.setReleaseCode(ReleaseStatus.had_exists.value());
+                        releaseProductByBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
+                        total --;
+                    }
+				}
+			}
 		}
 		}
 		commonDao.save(addList, ReleaseProductByBatch.class);
 		commonDao.save(addList, ReleaseProductByBatch.class);
-		Long userUU = SystemSession.getUser().getUserUU();
-		Long enUU = SystemSession.getUser().getEnterprise().getUu();
+
 		releaseProductByBatchDao.callValidProcedure(enUU, batch);
 		releaseProductByBatchDao.callValidProcedure(enUU, batch);
 		Integer filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
 		Integer filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
 		Integer failure = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.failure.value());
 		Integer failure = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.failure.value());
@@ -224,7 +238,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	 * 判断是否重复,重复则重设状态
 	 * 判断是否重复,重复则重设状态
 	 * @param data
 	 * @param data
 	 */
 	 */
-	private void resetRepeatData(List<ReleaseProductByBatch> data) {
+	private void resetRepeatData(List<ReleaseProductByBatch> data, boolean isAPerson) {
 		Long enuu = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
 		Long enuu = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
 		if (enuu == null) {
 		if (enuu == null) {
 			throw new IllegalOperatorException("企业enuu丢失");
 			throw new IllegalOperatorException("企业enuu丢失");
@@ -235,6 +249,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				each.setB2cBranden(standardList.get(0).getPbranden());
 				each.setB2cBranden(standardList.get(0).getPbranden());
 				each.setB2cCode(standardList.get(0).getPcmpcode());
 				each.setB2cCode(standardList.get(0).getPcmpcode());
 			}
 			}
+			if (isAPerson) {
+				continue;
+			}
 			List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enuu, each.getB2cCode(), each.getB2cBranden(), IntegerConstant.YES_SHORT);
 			List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enuu, each.getB2cCode(), each.getB2cBranden(), IntegerConstant.YES_SHORT);
 			if (!CollectionUtils.isEmpty(productList)) {
 			if (!CollectionUtils.isEmpty(productList)) {
 				List<Goods> goodsList = goodsDao.findRepeatGoodsInProductId(productList.get(0).getId(), each.getProductDate(), each.getPackaging(), each.getMinPackage(), each.getMinBuyQty(), each.getSelfMaxDelivery(), each.getSelfMinDelivery(), each.getUnit());
 				List<Goods> goodsList = goodsDao.findRepeatGoodsInProductId(productList.get(0).getId(), each.getProductDate(), each.getPackaging(), each.getMinPackage(), each.getMinBuyQty(), each.getSelfMaxDelivery(), each.getSelfMinDelivery(), each.getUnit());

+ 75 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/util/GoodsUtil.java

@@ -1,7 +1,12 @@
 package com.uas.platform.b2c.prod.commodity.util;
 package com.uas.platform.b2c.prod.commodity.util;
 
 
+import com.uas.platform.b2c.core.utils.NumberUtil;
+import com.uas.platform.b2c.core.utils.StringUtilB2C;
+import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
+import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
 import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
 import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import com.uas.platform.b2c.trade.order.StringConstant.Currency;
+import com.uas.platform.core.exception.IllegalOperatorException;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.CollectionUtils;
 
 
 import java.util.List;
 import java.util.List;
@@ -140,4 +145,74 @@ public class GoodsUtil {
 		}
 		}
 		return true;
 		return true;
 	}
 	}
+
+	/**
+	 * 判断是否在数据库存在同一个sku产品, 如果存在则返回存在的Goods信息,如果不存在则返回当前的goods
+	 *
+	 * @param list 数据存中的 产品信息
+	 * @param g 新的产品信息
+	 * @return goods 返回当前需要操作的信息
+	 */
+	public static Goods sameSKU(List<Goods> list, Goods g) {
+		if (g == null) {
+			throw new IllegalOperatorException("传入的信息为空");
+		}
+		if (CollectionUtils.isEmpty(list)) {
+			return g;
+		} else {
+			for (Goods goods : list) {
+				if (!StringUtilB2C.equals(g.getProduceDate(), goods.getProduceDate())) {
+					continue;
+				}
+				if (!StringUtilB2C.equals(g.getPackaging(), goods.getPackaging())) {
+					continue;
+				}
+				if (!StringUtilB2C.equals(g.getUnit(), goods.getUnit())) {
+					continue;
+				}
+				if (NumberUtil.compare(g.getMinPackQty(), goods.getMinPackQty()) != 0) {
+					continue;
+				}
+				if (NumberUtil.compare(g.getMinBuyQty(), goods.getMinBuyQty()) != 0) {
+					continue;
+				}
+				if (!g.getMaxDelivery().equals(goods.getMaxDelivery())) {
+					continue;
+				}
+				if (!g.getMinDelivery().equals(goods.getMinDelivery())) {
+					continue;
+				}
+				if (!GoodsUtil.compareWithQtyPrice(g.getPrices(), goods.getPrices(), g.getCurrencyName())) {
+					continue;
+				}
+				return goods;
+			}
+
+			return g;
+		}
+	}
+
+	/**
+	 * 设置自定义标签
+	 *
+	 * @param goodses1
+	 */
+	public static void setTag(List<Goods> goodses1, Goods g) {
+		if (g == null || g.getTag() != null) {
+			return ;
+		}
+		String tag = StringConstant.SELF_TAG;
+		Boolean isExist = false;
+		int i = 0;
+		do {
+			isExist = false;
+			i++;
+			for (Goods goods : goodses1) {
+				if ((tag + i).equals(goods.getTag())) {
+					isExist = true;
+				}
+			}
+		} while(isExist);
+		g.setTag(tag + i);
+	}
 }
 }

+ 10 - 0
src/main/java/com/uas/platform/b2c/trade/order/dao/OrderDetailDao.java

@@ -45,4 +45,14 @@ public interface OrderDetailDao extends JpaSpecificationExecutor<OrderDetail>, J
 
 
 	@Query(value = "select sum(detail_number) from trade$order_detail where detail_sup_en_uu=:enuu and cmp_uuid=:uuid and detail_status=:status", nativeQuery = true)
 	@Query(value = "select sum(detail_number) from trade$order_detail where detail_sup_en_uu=:enuu and cmp_uuid=:uuid and detail_status=:status", nativeQuery = true)
 	Double getSumReserveBySupEnUuAndUuidAndStatus(@Param("enuu") Long enuu, @Param("uuid") String uuid, @Param("status") Integer status);
 	Double getSumReserveBySupEnUuAndUuidAndStatus(@Param("enuu") Long enuu, @Param("uuid") String uuid, @Param("status") Integer status);
+
+	/**
+	 * 查询指定批次和状态的购买的数据,
+	 *
+	 * @param batches 批次队列
+	 * @param status 状态
+	 * @return 数据
+	 */
+	@Query(value = "select sum(detail_number) from trade$order_detail where go_batch in (:batches) and detail_status in (:status)", nativeQuery = true)
+	Double getgetSumQtyByBatchcodesAndStatus(@Param("batches") List<String> batches, @Param("status") List<Integer> status);
 }
 }

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


+ 1 - 1
src/main/resources/prod/sys.properties

@@ -42,7 +42,7 @@ searchUrl=http://10.10.0.76:8081
 # message ip
 # message ip
 messageServiceIp=http://message.ubtob.com/
 messageServiceIp=http://message.ubtob.com/
 # product public ip
 # product public ip
-productServiceIp=http://192.168.253.12:24000
+productServiceIp=http://10.10.0.197:8080
 
 
 # Kafka
 # Kafka
 kafka-bootstrap-servers=10.10.100.11:9292,10.10.100.12:9292,10.10.100.13:9292,10.10.100.14:9292,10.10.100.15:9292,10.10.100.16:9292
 kafka-bootstrap-servers=10.10.100.11:9292,10.10.100.12:9292,10.10.100.13:9292,10.10.100.14:9292,10.10.100.15:9292,10.10.100.16:9292

BIN
src/main/webapp/resources/img/upload/daishou-active.png


BIN
src/main/webapp/resources/img/upload/daishou-default.png


BIN
src/main/webapp/resources/img/upload/ziying-active.png


BIN
src/main/webapp/resources/img/upload/ziying-default.png


+ 6 - 6
src/main/webapp/resources/js/common/query/seekPurchase.js

@@ -15,11 +15,11 @@ define([ 'ngResource' ], function() {
         method: 'POST'
         method: 'POST'
       },
       },
       saveOffer: {
       saveOffer: {
-        url: 'seek/offer/saveOffer',
+        url: 'http://10.1.51.88:8080/inquiry/sale/item/save',
         method: 'POST'
         method: 'POST'
       },
       },
       getUserSeekPageInfo: {
       getUserSeekPageInfo: {
-        url: 'http://10.1.51.88:8080/inquiry/public',
+        url: 'http://10.1.51.88:8080/inquiry/buyer/list',
         method: 'GET'
         method: 'GET'
       },
       },
       getMallGoodsList: {
       getMallGoodsList: {
@@ -28,7 +28,7 @@ define([ 'ngResource' ], function() {
         isArray: true
         isArray: true
       },
       },
       getSeekPurchaseOfferPageInfo: {
       getSeekPurchaseOfferPageInfo: {
-        url: 'seek/offer/getSeekPurchaseOfferPageInfo',
+        url: 'http://10.1.51.88:8080/inquiry/buyer/product/detail',
         method: 'GET'
         method: 'GET'
       },
       },
       getMyOfferPageInfo: {
       getMyOfferPageInfo: {
@@ -36,11 +36,11 @@ define([ 'ngResource' ], function() {
         method: 'GET'
         method: 'GET'
       },
       },
       updateSeekPurchaseStatus: {
       updateSeekPurchaseStatus: {
-        url: 'seek/updateSeekPurchaseStatus',
-        method: 'PUT'
+        url: 'http://10.1.51.88:8080/inquiry/buyer/decide',
+        method: 'POST'
       },
       },
       getSeekPurchaseBomListPage: {
       getSeekPurchaseBomListPage: {
-        url: 'seek/getSeekPurchaseBomListPage',
+        url: 'http://10.1.51.88:8080/inquiry/buyer/inquiryList',
         method: 'GET'
         method: 'GET'
       },
       },
       findOneBom: {
       findOneBom: {

+ 106 - 84
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -36,6 +36,78 @@ define(['app/app'], function (app) {
             deadline: true
             deadline: true
           };
           };
 
 
+          // 买家求购列表
+          $scope.searchStatus = 0;
+          $scope.seekPurchaseTableParams = new ngTableParams({
+            pageNumber: 1,
+            pageSize: 10
+          }, {
+            total: 0,
+            getData: function ($defer, params) {
+              const param = BaseService.parseParams(params.url());
+              param.userUU = $scope.userInfo.userUU;
+              if ($scope.userInfo.enterprise) {
+                param.enUU = $scope.userInfo.enterprise.uu;
+              }
+              // param.isMallGoods = $scope.isMallGoods;
+              // param.deadline = $scope.deadline;
+              param.keyword = $scope.keyWord;
+              param.state = $scope.searchStatus;
+              param.overdue = $scope.overdue;
+              param.fromDate = $scope.startDate
+                  ? $scope.startDate.getTime() : null;
+              param.endDate = $scope.endDate ? $scope.endDate.getTime()
+                  : null;
+              param.pageNumber = param.page;
+              param.pageSize = param.count;
+              if ($scope.isSearch) {
+                param.page = 1;
+                params.page(1);
+                $scope.isSearch = false;
+              }
+              seekPurchase.getUserSeekPageInfo(param, function (data) {
+                params.total(data.totalElements);
+                $defer.resolve(data.content);
+                $scope.seekListData = data;
+              }, function (response) {
+                toaster.pop('error', response.data);
+              });
+            }
+          });
+
+          $scope.bomSearch = {};
+          $scope.bomTableParams = new ngTableParams({
+            page: 1,
+            count: 10
+          }, {
+            total: 0,
+            getData: function ($defer, params) {
+              const param = BaseService.parseParams(params.url());
+              param.userUU = $scope.userInfo.userUU;
+              if ($scope.userInfo.enterprise.uu) {
+                param.enUU = $scope.userInfo.enterprise.uu;
+              }
+              // param.minReleaseDate = $scope.bomSearch.startDate
+              //     ? $scope.bomSearch.startDate.getTime() : null;
+              // param.maxReleaseDate = $scope.bomSearch.endDate ? $scope.bomSearch.endDate.getTime()
+              //     : null;
+              // param.name = $scope.bomSearch.name;
+              // 返回首页
+              if ($scope.isSearch) {
+                param.page = 1;
+                params.page(1);
+                $scope.isSearch = false;
+              }
+              seekPurchase.getSeekPurchaseBomListPage(param, function (data) {
+                params.total(data.totalElements);
+                $scope.bomTotal = data.totalElements;
+                $defer.resolve(data.content);
+              }, function (response) {
+                toaster.pop('error', response.data);
+              });
+            }
+          });
+
           var getRealLen = function (str) {
           var getRealLen = function (str) {
             var len = 0;
             var len = 0;
             for (var i = 0; i < str.length; i++) {
             for (var i = 0; i < str.length; i++) {
@@ -199,14 +271,18 @@ define(['app/app'], function (app) {
               var inquiry = {};
               var inquiry = {};
               var inquiryItem = {};
               var inquiryItem = {};
               inquiry.recorderUU = $scope.userInfo.userUU;
               inquiry.recorderUU = $scope.userInfo.userUU;
-              inquiry.enUU = $scope.userInfo.enterprise.uu;
+              if ($scope.userInfo.enterprise) {
+                inquiry.enUU = $scope.userInfo.enterprise.uu;
+              }
               inquiry.code = "MALL" + $filter('date')(new Date, 'yyyyMMddsss');
               inquiry.code = "MALL" + $filter('date')(new Date, 'yyyyMMddsss');
               inquiry.date = new Date();
               inquiry.date = new Date();
               inquiry.recorder = $scope.userInfo.userName;
               inquiry.recorder = $scope.userInfo.userName;
               inquiry.endDate = $scope.applyObj.deadline;
               inquiry.endDate = $scope.applyObj.deadline;
               inquiry.sourceapp = "MALL";
               inquiry.sourceapp = "MALL";
               inquiry.amount = 1;
               inquiry.amount = 1;
+              inquiryItem.prodTitle = $scope.applyObj.code;
               inquiryItem.userUU = $scope.userInfo.userUU;
               inquiryItem.userUU = $scope.userInfo.userUU;
+              inquiryItem.source = "MALL";
               inquiryItem.userName = $scope.userInfo.userName;
               inquiryItem.userName = $scope.userInfo.userName;
               inquiryItem.userTel = $scope.userInfo.userTel;
               inquiryItem.userTel = $scope.userInfo.userTel;
               inquiryItem.needquantity = $scope.applyObj.amount;
               inquiryItem.needquantity = $scope.applyObj.amount;
@@ -276,39 +352,6 @@ define(['app/app'], function (app) {
             }
             }
           }
           }
 
 
-          // 买家求购列表
-          $scope.searchStatus = 0;
-          $scope.seekPurchaseTableParams = new ngTableParams({
-            pageNumber: 1,
-            pageSize: 10
-          }, {
-            total: 0,
-            getData: function ($defer, params) {
-              const param = BaseService.parseParams(params.url());
-              param.userUU = $scope.userInfo.userUU;
-              param.enUU = $scope.userInfo.enterprise.uu;
-              // param.isMallGoods = $scope.isMallGoods;
-              // param.deadline = $scope.deadline;
-              param.keyword = $scope.keyWord;
-              // param.status = $scope.searchStatus;
-              param.fromDate = $scope.startDate
-                  ? $scope.startDate.getTime() : null;
-              param.endDate = $scope.endDate ? $scope.endDate.getTime()
-                  : null;
-              if ($scope.isSearch) {
-                param.page = 1;
-                params.page(1);
-                $scope.isSearch = false;
-              }
-              seekPurchase.getUserSeekPageInfo(param, function (data) {
-                params.total(data.totalElements);
-                $defer.resolve(data.content);
-                $scope.seekListData = data;
-              }, function (response) {
-                toaster.pop('error', response.data);
-              });
-            }
-          });
 
 
           // 搜索
           // 搜索
           $scope.onSearch = function (searchStatus) {
           $scope.onSearch = function (searchStatus) {
@@ -325,27 +368,32 @@ define(['app/app'], function (app) {
             }
             }
           }
           }
           // 采纳报价
           // 采纳报价
-          $scope.adopt = function () {
-            if (!$scope.purchaseQuantity) {
-              toaster.pop('error', "请输入正确的采购数量");
-              return;
-            }
-            seekPurchase.updateSeekPurchaseStatus({
-              spId: $scope.currentOffer.spId,
-              ofId: $scope.currentOffer.id,
-              purchaseQuantity: $scope.purchaseQuantity
-            }, {}, function (data) {
-              if (data.success) {
-                $scope.currentOffer = null;
-                $scope.seekPurchaseTableParams.reload();
-                $scope.showUseFlag = false;
-                toaster.pop('success', '采纳报价成功');
-              } else {
-                toaster.pop('error', data.message);
-              }
-            }, function (response) {
+          $scope.adopt = function (id) {
+            seekPurchase.updateSeekPurchaseStatus({id: id, status: 1},{},function(){
+              toaster.pop('success', '采纳报价成功');
+            }, function(response){
               toaster.pop('error', response.data);
               toaster.pop('error', response.data);
             });
             });
+            // if (!$scope.purchaseQuantity) {
+            //   toaster.pop('error', "请输入正确的采购数量");
+            //   return;
+            // }
+            // seekPurchase.updateSeekPurchaseStatus({
+            //   spId: $scope.currentOffer.spId,
+            //   ofId: $scope.currentOffer.id,
+            //   purchaseQuantity: $scope.purchaseQuantity
+            // }, {}, function (data) {
+            //   if (data.success) {
+            //     $scope.currentOffer = null;
+            //     $scope.seekPurchaseTableParams.reload();
+            //     $scope.showUseFlag = false;
+            //     toaster.pop('success', '采纳报价成功');
+            //   } else {
+            //     toaster.pop('error', data.message);
+            //   }
+            // }, function (response) {
+            //   toaster.pop('error', response.data);
+            // });
           }
           }
 
 
           $scope.offerCount = 0;
           $scope.offerCount = 0;
@@ -353,19 +401,20 @@ define(['app/app'], function (app) {
           $scope.currentSeek = {};
           $scope.currentSeek = {};
           $scope.setSeekStatus = function (seek, status) {
           $scope.setSeekStatus = function (seek, status) {
             $scope.offerCount = seek.offerAmount;
             $scope.offerCount = seek.offerAmount;
-            $scope.goodsCount = seek.goodsAmount;
+            $scope.goodsCount = 0;
             $scope.currentSeek = seek;
             $scope.currentSeek = seek;
             // 查看报价
             // 查看报价
             if (status == 2 && $scope.offerCount != 0) {
             if (status == 2 && $scope.offerCount != 0) {
               seekPurchase.getSeekPurchaseOfferPageInfo(
               seekPurchase.getSeekPurchaseOfferPageInfo(
-                  {count: 100, page: 1, spId: seek.spId}, function (data) {
-                    $scope.offer = data.content;
+                  {id: seek.id}, function (data) {
+                    $scope.offer = data.inquiryItems;
                     clearSeekStatus();
                     clearSeekStatus();
                     seek.$status = status;
                     seek.$status = status;
                   });
                   });
             } else if (status == 1 && $scope.goodsCount != 0) {// 查看现货
             } else if (status == 1 && $scope.goodsCount != 0) {// 查看现货
               seekPurchase.getMallGoodsList({spId: seek.spId}, function (data) {
               seekPurchase.getMallGoodsList({spId: seek.spId}, function (data) {
                 $scope.goods = data;
                 $scope.goods = data;
+                $scope.goodsCount = data.length;
                 clearSeekStatus();
                 clearSeekStatus();
                 initFragments();
                 initFragments();
                 seek.$status = status;
                 seek.$status = status;
@@ -719,34 +768,7 @@ define(['app/app'], function (app) {
               toaster.pop('error', response.data);
               toaster.pop('error', response.data);
             });
             });
           };
           };
-          $scope.bomSearch = {};
-          $scope.bomTableParams = new ngTableParams({
-            page: 1,
-            count: 10
-          }, {
-            total: 0,
-            getData: function ($defer, params) {
-              const param = BaseService.parseParams(params.url());
-              param.minReleaseDate = $scope.bomSearch.startDate
-                  ? $scope.bomSearch.startDate.getTime() : null;
-              param.maxReleaseDate = $scope.bomSearch.endDate ? $scope.bomSearch.endDate.getTime()
-                  : null;
-              param.name = $scope.bomSearch.name;
-              // 返回首页
-              if ($scope.isSearch) {
-                param.page = 1;
-                params.page(1);
-                $scope.isSearch = false;
-              }
-              seekPurchase.getSeekPurchaseBomListPage(param, function (data) {
-                params.total(data.totalElements);
-                $scope.bomTotal = data.totalElements;
-                $defer.resolve(data.content);
-              }, function (response) {
-                toaster.pop('error', response.data);
-              });
-            }
-          });
+
           // 搜索
           // 搜索
           $scope.onBomSearch = function () {
           $scope.onBomSearch = function () {
             $scope.isSearch = true;
             $scope.isSearch = true;

+ 9 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js

@@ -22,13 +22,18 @@ define(['app/app'], function(app) {
                 const param = BaseService.parseParams(params.url());
                 const param = BaseService.parseParams(params.url());
                 filter = {};
                 filter = {};
                 filter.vendUU = $scope.userInfo.enterprise.uu;
                 filter.vendUU = $scope.userInfo.enterprise.uu;
-                param.filter = filter;
+
                 // param.enUU = $scope.userInfo.enterprise.uu;
                 // param.enUU = $scope.userInfo.enterprise.uu;
                 // param.deadline = $scope.deadline;
                 // param.deadline = $scope.deadline;
                 // param.status = $scope.status;
                 // param.status = $scope.status;
-                // param.keyWord = $scope.keyWord;
-                // param.minReleaseDate = $scope.startDate ? $scope.startDate.getTime() : null;
-                // param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime() : null;
+                filter.keyword = $scope.keyWord;
+                filter.fromDate = $scope.startDate
+                  ? $scope.startDate.getTime() : null;
+                filter.endDate = $scope.endDate ? $scope.endDate.getTime()
+                  : null;
+                param.filter = filter;
+                param.pageNumber = param.page;
+                param.pageSize = param.count;
               if ($scope.isSearch) {
               if ($scope.isSearch) {
                 param.page = 1;
                 param.page = 1;
                 params.page(1);
                 params.page(1);

+ 67 - 46
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -1,13 +1,13 @@
 define(['app/app'], function (app) {
 define(['app/app'], function (app) {
   app.register.controller('seekPurchaseCtrl',
   app.register.controller('seekPurchaseCtrl',
       ['$scope', '$rootScope', '$stateParams', '$state', 'toaster',
       ['$scope', '$rootScope', '$stateParams', '$state', 'toaster',
-        'seekPurchase', 'BaseService', 'ngTableParams', '$modal',
+        'seekPurchase', 'BaseService', 'ngTableParams', '$modal', '$upload',
         function ($scope, $rootScope, $stateParams, $state, toaster,
         function ($scope, $rootScope, $stateParams, $state, toaster,
-            seekPurchase, BaseService, ngTableParams, $modal) {
+            seekPurchase, BaseService, ngTableParams, $modal, $upload) {
           document.title = '求购询价-优软商城';
           document.title = '求购询价-优软商城';
           $rootScope.active = 'vendor_seek_purchase';
           $rootScope.active = 'vendor_seek_purchase';
           $scope.seekPurchaseRate = {};
           $scope.seekPurchaseRate = {};
-          $scope.offer = {};
+          $scope.inquiryItem = {};
 
 
           // 获取当前卖家求购推送列表
           // 获取当前卖家求购推送列表
           $scope.seekPurchaseTableParams = new ngTableParams({
           $scope.seekPurchaseTableParams = new ngTableParams({
@@ -19,11 +19,13 @@ define(['app/app'], function (app) {
               const param = BaseService.parseParams(params.url());
               const param = BaseService.parseParams(params.url());
               // param.deadline = $scope.deadline;
               // param.deadline = $scope.deadline;
               // param.status = $scope.status;
               // param.status = $scope.status;
-              // param.keyWord = $scope.keyWord;
-              // param.minReleaseDate = $scope.startDate
-              //     ? $scope.startDate.getTime() : null;
-              // param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime()
-              //     : null;
+              param.keyword = $scope.keyWord;
+              param.fromDate = $scope.startDate
+                  ? $scope.startDate.getTime() : null;
+              param.endDate = $scope.endDate ? $scope.endDate.getTime()
+                  : null;
+              param.pageNumber = param.page;
+              param.pageSize = param.count;
               if ($scope.isSearch) {
               if ($scope.isSearch) {
                 param.page = 1;
                 param.page = 1;
                 params.page(1);
                 params.page(1);
@@ -145,44 +147,60 @@ define(['app/app'], function (app) {
             return $scope.validOffer.unitPrice && $scope.validOffer.minDay && $scope.validOffer.maxDay;
             return $scope.validOffer.unitPrice && $scope.validOffer.minDay && $scope.validOffer.maxDay;
           }
           }
 
 
+
+          // 删除一列分段报价
+          $scope.removeStep = function (inquiryItem, stepIndex) {
+            inquiryItem.replies.splice(stepIndex, 1);
+            $scope.replyPrices.splice(stepIndex, 1);
+            $scope.replylapQtys.splice(stepIndex, 1);
+          };
+
           // 保存报价
           // 保存报价
           $scope.saveOfferBtn = false;
           $scope.saveOfferBtn = false;
-          $scope.saveOffer = function (seek) {
-            if ($scope.checkAllOffer()) {
-              $scope.saveOfferBtn = true;
-              seekPurchase.saveOffer($scope.offer, function (data) {
-                if (data.success) {
-                  $scope.setSeekActive(seek, false);
-                  $scope.seekPurchaseTableParams.reload();
-                  $scope.saveOfferBtn = true;
-                  toaster.pop('success', '报价成功');
-                } else {
-                  $scope.saveOfferBtn = true;
-                  toaster.pop('error', data.message);
-                }
-              }, function (res) {
-                toaster.pop('error', res.data);
-              });
-            } else {
-              if (!$scope.validOffer.unitPrice) {
-                if (!$scope.offer.unitPrice) {
-                  toaster.pop('warning', '提示', '单价不能为空');
-                } else {
-                  toaster.pop('warning', '提示', '单价必须是大于0的数字');
-                }
-              } else if (!$scope.validOffer.minDay || !$scope.validOffer.maxDay) {
-                if ((!$scope.offer.minDay && !angular.isNumber($scope.offer.minDay)) || (!$scope.offer.maxDay && !angular.isNumber($scope.offer.maxDay))) {
-                  toaster.pop('warning', '提示', '交期不能为空');
-                } else {
-                  if ($scope.offer.minDay > 31 || $scope.offer.minDay < 1 || $scope.offer.minDay.toString().indexOf('.') !== -1
-                      || $scope.offer.maxDay > 31 || $scope.offer.maxDay < 1 || $scope.offer.maxDay.toString().indexOf('.') !== -1) {
-                    toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
-                  } else {
-                    toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
-                  }
-                }
-              }
-            }
+          $scope.saveOffer = function () {
+            $scope.inquiryItem.vendUU = $scope.userInfo.enterprise.uu;
+            $scope.inquiryItem.vendUserUU = $scope.userInfo.userUU;
+            seekPurchase.saveOffer($scope.inquiryItem,function(){
+              toaster.pop('success', '报价成功');
+              $scope.isShowSayPriceBox = false;
+            }, function (response) {
+              toaster.pop('error', response.data.message);
+            });
+            // if ($scope.checkAllOffer()) {
+            //   $scope.saveOfferBtn = true;
+            //   seekPurchase.saveOffer($scope.offer, function (data) {
+            //     if (data.success) {
+            //       $scope.setSeekActive(seek, false);
+            //       $scope.seekPurchaseTableParams.reload();
+            //       $scope.saveOfferBtn = true;
+            //       toaster.pop('success', '报价成功');
+            //     } else {
+            //       $scope.saveOfferBtn = true;
+            //       toaster.pop('error', data.message);
+            //     }
+            //   }, function (res) {
+            //     toaster.pop('error', res.data);
+            //   });
+            // } else {
+            //   if (!$scope.validOffer.unitPrice) {
+            //     if (!$scope.offer.unitPrice) {
+            //       toaster.pop('warning', '提示', '单价不能为空');
+            //     } else {
+            //       toaster.pop('warning', '提示', '单价必须是大于0的数字');
+            //     }
+            //   } else if (!$scope.validOffer.minDay || !$scope.validOffer.maxDay) {
+            //     if ((!$scope.offer.minDay && !angular.isNumber($scope.offer.minDay)) || (!$scope.offer.maxDay && !angular.isNumber($scope.offer.maxDay))) {
+            //       toaster.pop('warning', '提示', '交期不能为空');
+            //     } else {
+            //       if ($scope.offer.minDay > 31 || $scope.offer.minDay < 1 || $scope.offer.minDay.toString().indexOf('.') !== -1
+            //           || $scope.offer.maxDay > 31 || $scope.offer.maxDay < 1 || $scope.offer.maxDay.toString().indexOf('.') !== -1) {
+            //         toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+            //       } else {
+            //         toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
+            //       }
+            //     }
+            //   }
+            // }
           }
           }
 
 
           $scope.condition = {endDateOpen: false, startDateOpen: false};
           $scope.condition = {endDateOpen: false, startDateOpen: false};
@@ -261,8 +279,9 @@ define(['app/app'], function (app) {
             return Math.floor((timeStamp / (1000 * 60 * 60)) % 24);
             return Math.floor((timeStamp / (1000 * 60 * 60)) % 24);
           }
           }
 
 
+          $scope.isShowSayPriceBox = false;
           /*设置列表状态*/
           /*设置列表状态*/
-          $scope.setSeekActive = function (seek, flag) {
+          $scope.setSeekActive = function (seek, flag, index) {
             if (flag) {
             if (flag) {
               angular.forEach($scope.seekListData, function (item) {
               angular.forEach($scope.seekListData, function (item) {
                 item.$active = false;
                 item.$active = false;
@@ -272,7 +291,9 @@ define(['app/app'], function (app) {
                 spId: seek.spId
                 spId: seek.spId
               }
               }
             }
             }
-            seek.$active = flag;
+            //seek.$active = flag;
+            $scope.inquiryItem = seek;
+            $scope.isShowSayPriceBox = flag;
           }
           }
         }]);
         }]);
 });
 });

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

@@ -603,6 +603,9 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			angular.forEach(material.goodsArr, function (g) {
 			angular.forEach(material.goodsArr, function (g) {
 				g.edit = false;
 				g.edit = false;
 			});
 			});
+			if (material.sourceApp == 'ERP') {
+				material.averMonthSalePrice = (material.productDetail && material.productDetail.price) ? material.productDetail.price : 0;
+			}
             $scope.$$nonProduct.editGoods = angular.copy(goods);
             $scope.$$nonProduct.editGoods = angular.copy(goods);
 			goods.edit = true;
 			goods.edit = true;
 
 
@@ -1723,32 +1726,31 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		 * @param product
 		 * @param product
 		 */
 		 */
 		var getProductDetail = function (product) {
 		var getProductDetail = function (product) {
-			Material.getProductDetail({id : product.id}, function (data) {
-				$scope.goods.erpReserve = typeof data.reserve == 'undefined' ? 0 : data.reserve;
-				$scope.goods.editPackaging = (data && data.packaging) || product.packaging || '无';
-				$scope.goods.editProduceDate = (data && data.produceDate) || product.produceDate;
-				$scope.goods.editMinPackQty = (data && data.minPackQty) || product.minPackQty || $scope.goods.minBuyQty || 1;
-				$scope.goods.editMinBuyQty = (data && data.minBuyQty) || $scope.goods.minPackQty;
-				$scope.goods.editMinBuyQty = $scope.goods.editMinBuyQty - ($scope.goods.editMinBuyQty % $scope.goods.editMinPackQty);
-				if ($scope.goods.editMinBuyQty < $scope.goods.editMinPackQty) {
-					$scope.goods.editMinBuyQty = $scope.goods.editMinPackQty;
-				}
-				$scope.goods.editMinDelivery = (data && data.minDelivery) || $scope.uasBatchPutOnProperty.minDelivery;
-				$scope.goods.editMaxDelivery = (data && data.maxDelivery) || $scope.uasBatchPutOnProperty.maxDelivery;
-				product.selected = true;
-				product.averMonthSalePrice = (data && data.price) ? data.price : 0;
-				var goodQtyPrice = {start: $scope.goods.editMinBuyQty, end: $scope.maxReserve};
-				var price = (((data && data.price) ? data.price : 0) *
-				($scope.uasBatchPutOnProperty.fluctuateRate ? $scope.uasBatchPutOnProperty.fluctuateRate : 1));
-				if ('MAINLAND' == $scope.store.enType) {
-					goodQtyPrice.rMBPrice = $filter('formateNumber')(price, 6);
-				}
-				if ('HK' == $scope.store.enType) {
-					goodQtyPrice.uSDPrice = $filter('formateNumber')(price, 6);
-				}
-				$scope.goods.editPrices = [];
-				$scope.goods.editPrices.push(goodQtyPrice);
-			});
+			var data = product.productDetail;
+			$scope.goods.erpReserve = (!data || typeof data.reserve == 'undefined') ? 0 : data.reserve;
+			$scope.goods.editPackaging = (data && data.packaging) || product.packaging || '无';
+			$scope.goods.editProduceDate = (data && data.produceDate) || product.produceDate;
+			$scope.goods.editMinPackQty = (data && data.minPackQty) || product.minPackQty || $scope.goods.minBuyQty || 1;
+			$scope.goods.editMinBuyQty = (data && data.minBuyQty) || $scope.goods.minPackQty;
+			$scope.goods.editMinBuyQty = $scope.goods.editMinBuyQty - ($scope.goods.editMinBuyQty % $scope.goods.editMinPackQty);
+			if ($scope.goods.editMinBuyQty < $scope.goods.editMinPackQty) {
+				$scope.goods.editMinBuyQty = $scope.goods.editMinPackQty;
+			}
+			$scope.goods.editMinDelivery = (data && data.minDelivery) || $scope.uasBatchPutOnProperty.minDelivery;
+			$scope.goods.editMaxDelivery = (data && data.maxDelivery) || $scope.uasBatchPutOnProperty.maxDelivery;
+			product.selected = true;
+			product.averMonthSalePrice = (data && data.price) ? data.price : 0;
+			var goodQtyPrice = {start: $scope.goods.editMinBuyQty, end: $scope.maxReserve};
+			var price = (((data && data.price) ? data.price : 0) *
+			($scope.uasBatchPutOnProperty.fluctuateRate ? $scope.uasBatchPutOnProperty.fluctuateRate : 1));
+			if ('MAINLAND' == $scope.store.enType) {
+				goodQtyPrice.rMBPrice = $filter('formateNumber')(price, 6);
+			}
+			if ('HK' == $scope.store.enType) {
+				goodQtyPrice.uSDPrice = $filter('formateNumber')(price, 6);
+			}
+			$scope.goods.editPrices = [];
+			$scope.goods.editPrices.push(goodQtyPrice);
 		}
 		}
 
 
 		/**
 		/**
@@ -2067,7 +2069,6 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 					$scope.uasBatchPutOnProperty.editMinDelivery = $scope.uasBatchPutOnProperty.minDelivery;
 					$scope.uasBatchPutOnProperty.editMinDelivery = $scope.uasBatchPutOnProperty.minDelivery;
 					$scope.uasBatchPutOnProperty.editMaxDelivery = $scope.uasBatchPutOnProperty.maxDelivery;
 					$scope.uasBatchPutOnProperty.editMaxDelivery = $scope.uasBatchPutOnProperty.maxDelivery;
 					toaster.pop('success', '成功', "保存成功");
 					toaster.pop('success', '成功', "保存成功");
-					$scope.isBatch = false;
 				} else {
 				} else {
 					toaster.pop('error', '失败', data.message);
 					toaster.pop('error', '失败', data.message);
 				}
 				}

+ 337 - 327
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js

@@ -1,327 +1,294 @@
 define([ 'app/app' ], function(app) {
 define([ 'app/app' ], function(app) {
 	'use strict';
 	'use strict';
-	app.register.controller('vendorUploadCtrl', ['$scope', '$rootScope', 'Material', function ($scope, $rootScope, Material) {
-		$rootScope.$$productOn = {};
+	app.register.controller('vendorUploadCtrl', ['$scope', '$rootScope', 'ngTableParams', '$upload', '$q', 'AuthenticationService', 'BaseService', 'StoreInfo', 'SessionService', '$modal', 'toaster', 'ReleaseProductByBatch', 'Loading', 'Enterprise', 'DistributionRule', '$state', function ($scope, $rootScope, ngTableParams, $upload, $q, AuthenticationService, BaseService, StoreInfo, SessionService, $modal, toaster, ReleaseProductByBatch, Loading, Enterprise, DistributionRule, $state) {
+	    if (!$rootScope.$$productOn) {
+            $rootScope.$$productOn = {};
+            $rootScope.$$productOn.leadIn = 'bathOn';
+            $rootScope.$$productOn.tab = 'bathOn';
+        }
 		$rootScope.active = 'vendor_productOn';
 		$rootScope.active = 'vendor_productOn';
-		$rootScope.$$productOn.leadIn = 'bathOn';
-        $rootScope.$$productOn.tab = 'bathOn';
 		document.title = '产品导入-优软商城';
 		document.title = '产品导入-优软商城';
         //切换展示的信息
         //切换展示的信息
         $scope.toggleActive = function(active) {
         $scope.toggleActive = function(active) {
             if($scope.tab != active) {
             if($scope.tab != active) {
                 $rootScope.$$productOn.tab = active;
                 $rootScope.$$productOn.tab = active;
+                $state.reload();
             }
             }
         };
         };
-	}]);
-
-	//批量上架的Ctrl
-	app.register.controller('batchPutOnCtrl', ['$scope', '$rootScope', 'ngTableParams', '$upload', '$q', 'AuthenticationService', 'BaseService', 'StoreInfo', 'SessionService', '$modal', 'toaster', 'ReleaseProductByBatch', 'Loading', 'Enterprise', 'DistributionRule', function ($scope, $rootScope, ngTableParams, $upload, $q, AuthenticationService, BaseService, StoreInfo, SessionService, $modal, toaster, ReleaseProductByBatch, Loading, Enterprise, DistributionRule) {
-
-		$scope.deletePop = false;
+        $scope.deletePop = false;
         $scope.personMedol =false;
         $scope.personMedol =false;
         $scope.setPersonMedol = function () {
         $scope.setPersonMedol = function () {
-        	$scope.personMedol =false;
+            $scope.personMedol =false;
         };
         };
 
 
-		//获取币别信息
-		Enterprise.getCurrencyByRegisterAddress(null, function (data) {
-			if(data.code == 1) {
-				$scope.batch.currency = data.data;
-			}else {
-				toaster.pop('info', '提示', '您公司的注册地址为空,无法确定币别,系统默认为人民币');
-				$scope.batch.currency = 'RMB';
-			}
-		}, function (response) {
-			toaster.pop('info', '提示', '获取不到公司的币别信息');
-		});
+        //获取币别信息
+        Enterprise.getCurrencyByRegisterAddress(null, function (data) {
+            if(data.code == 1) {
+                $scope.batch.currency = data.data;
+            }else {
+                toaster.pop('info', '提示', '您公司的注册地址为空,无法确定币别,系统默认为人民币');
+                $scope.batch.currency = 'RMB';
+            }
+        }, function (response) {
+            toaster.pop('info', '提示', '获取不到公司的币别信息');
+        });
 
 
-		//切换展示的信息
-		$scope.toggleActive = function(active) {
-			if($scope.tab != active) {
-				$rootScope.$$productOn.tab = active;
-			}
-		};
+        $scope.batch = {};
+        $scope.batch.myFiles = null;
+        //批量发布的类型
+        $scope.batch.sellType = null;
 
 
-		$scope.batch = {};
-		$scope.batch.myFiles = null;
-		//批量发布的类型
-		$scope.batch.sellType = null;
+        //翻页的信息
+        $scope.pageParams = {};
 
 
-		//翻页的信息
-		$scope.pageParams = {};
+		// 自营店铺选择寄售提示框
+		$scope.showSelfSellRemindBox = false;
+
+		$scope.setShowSelfSellRemindBox = function (flag, type) {
+			if (type && type == 'no') {
+				$scope.sellType('self');
+			}
+			$scope.showSelfSellRemindBox = flag;
+		}
 
 
 		//选择相应的销售类型
 		//选择相应的销售类型
 		$scope.sellType = function(type) {
 		$scope.sellType = function(type) {
 			if($scope.batch.selfSellEabled) {
 			if($scope.batch.selfSellEabled) {
 				$scope.batch.sellType = type;
 				$scope.batch.sellType = type;
+				if (type == 'UAS') {
+					$scope.setShowSelfSellRemindBox(true);
+				}
 			}else {
 			}else {
 				$scope.batch.sellType = 'UAS';
 				$scope.batch.sellType = 'UAS';
 			}
 			}
 
 
-		};
+        };
 
 
-		//上架信息展示
-		$scope.relTableParams = new ngTableParams({
-			count : 10,
-			page : 1
-		}, {
-			total : 0,
-			getData : function($defer, params) {
-				var param = BaseService.parseParams(params.url());
-				if($scope.result && $scope.result.batch) {
-					param.batch = $scope.result.batch;
-					ReleaseProductByBatch.getPageBatchRelease(param, function(page) {
-						$defer.resolve(page.content);
-						params.total(page.totalElements);
-						$scope.pageParams.number = page.number;
-						$scope.pageParams.content = page.content;
-						$scope.pageParams.totalElements = page.totalElements;
-						$scope.pageParams.totalPages = page.totalPages;
-						$scope.pageParams.start = ((page.number - 1) * page.size) + 1;
-						$scope.pageParams.end =  page.number * page.size;
-						if($scope.pageParams.end > $scope.pageParams.totalElements) {
-							$scope.pageParams.end = $scope.pageParams.totalElements
-						}
-					}, function(data) {
-						toaster.pop();
-					});
-				}
-			}
-		});
+        //上架信息展示
+        $scope.relTableParams = new ngTableParams({
+            count : 10,
+            page : 1
+        }, {
+            total : 0,
+            getData : function($defer, params) {
+                var param = BaseService.parseParams(params.url());
+                if($scope.result && $scope.result.batch) {
+                    param.batch = $scope.result.batch;
+                    ReleaseProductByBatch.getPageBatchRelease(param, function(page) {
+                        $defer.resolve(page.content);
+                        params.total(page.totalElements);
+                        $scope.pageParams.number = page.number;
+                        $scope.pageParams.content = page.content;
+                        $scope.pageParams.totalElements = page.totalElements;
+                        $scope.pageParams.totalPages = page.totalPages;
+                        $scope.pageParams.start = ((page.number - 1) * page.size) + 1;
+                        $scope.pageParams.end =  page.number * page.size;
+                        if($scope.pageParams.end > $scope.pageParams.totalElements) {
+                            $scope.pageParams.end = $scope.pageParams.totalElements
+                        }
+                    }, function(data) {
+                        toaster.pop();
+                    });
+                }
+            }
+        });
 
 
-		/**
-		 * 打开删除的模态框
-		 */
-		$scope.showDelete = function (item) {
-			var modalInstance = $modal.open({
-				animation: true,
-				templateUrl: 'static/view/common/modal/delete_modal.html',
-				controller: 'product_delete_ctrl',
-				resolve: {
-					id : function() {
-						return item.id;
-					}
-				}
-			});
-			modalInstance.result.then(function(){
-				if (item.releaseCode == 112){
-					$scope.result.success = $scope.result.success - 1;
-				}else if(item.releaseCode == 113){
-					$scope.result.failure = $scope.result.failure - 1;
-				}
-				//不需要返回的第一页
-				$scope.relTableParams.reload();
-			}, function(){
-			});
-		};
+        /**
+         * 打开删除的模态框
+         */
+        $scope.showDelete = function (item) {
+            var modalInstance = $modal.open({
+                animation: true,
+                templateUrl: 'static/view/common/modal/delete_modal.html',
+                controller: 'product_delete_ctrl',
+                resolve: {
+                    id : function() {
+                        return item.id;
+                    }
+                }
+            });
+            modalInstance.result.then(function(){
+                if (item.releaseCode == 112){
+                    $scope.result.success = $scope.result.success - 1;
+                }else if(item.releaseCode == 113){
+                    $scope.result.failure = $scope.result.failure - 1;
+                }
+                //不需要返回的第一页
+                $scope.relTableParams.reload();
+            }, function(){
+            });
+        };
 
 
-		var initRuleCount = function () {
-			return DistributionRule.findCountOfActiveRule({},{},function (data) {
-				if (data.success){
-					$scope.needShowTip = data.data;
-				}
-			}, function (error) {
-				toaster.pop("error", error.data);
-			})
-		};
-		initRuleCount();
+        var initRuleCount = function () {
+            return DistributionRule.findCountOfActiveRule({},{},function (data) {
+                if (data.success){
+                    $scope.needShowTip = data.data;
+                }
+            }, function (error) {
+                toaster.pop("error", error.data);
+            })
+        };
+        initRuleCount();
 
 
-		// 查看范例
-		$scope.showImg = function() {
-			var src = '';
-			if($scope.batch.currency === 'RMB') {
-				src = $rootScope.rootPath + "/static/img/product/releaseByBatch-rmb.png";
-			}else {
-				src = $rootScope.rootPath + "/static/img/product/releaseByBatch-usd.png";
-			}
-			var box = $('#image-box');
-			box.find('img').attr('src', src);
-			box.find('a').click(function(){
-				box.hide();
-			});
-			box.dblclick(function(){
-				box.hide();
-			});
-			box.show();
-		};
+        // 查看范例
+        $scope.showImg = function() {
+            var src = '';
+            if($scope.batch.currency === 'RMB') {
+                src = $rootScope.rootPath + "/static/img/product/releaseByBatch-rmb.png";
+            }else {
+                src = $rootScope.rootPath + "/static/img/product/releaseByBatch-usd.png";
+            }
+            var box = $('#image-box');
+            box.find('img').attr('src', src);
+            box.find('a').click(function(){
+                box.hide();
+            });
+            box.dblclick(function(){
+                box.hide();
+            });
+            box.show();
+        };
 
 
-		//获取登录的信息
-		var getAuthentication = function () {
-			return AuthenticationService.getAuthentication().success(function(data) {
-				if(data && data.enterprises) {
-					data.enterprise = data.enterprises[data.enterprises.length - 1];
-					if(data.enterprises.length > 1) {
-						var enSelect = [];
-						angular.forEach(data.enterprises, function(e){
-							if(e.current)
-								data.enterprise = e;
-							else
-								enSelect.push(e);
-						});
-						data.enSelect = enSelect;
-					}
-				}
-				$rootScope.userInfo = data;
-			}).error(function(response) {
-				toaster.pop('info', '获取定单的信息' + response);
-			});
-		};
+        //获取登录的信息
+        var getAuthentication = function () {
+            return AuthenticationService.getAuthentication().success(function(data) {
+                if(data && data.enterprises) {
+                    data.enterprise = data.enterprises[data.enterprises.length - 1];
+                    if(data.enterprises.length > 1) {
+                        var enSelect = [];
+                        angular.forEach(data.enterprises, function(e){
+                            if(e.current)
+                                data.enterprise = e;
+                            else
+                                enSelect.push(e);
+                        });
+                        data.enSelect = enSelect;
+                    }
+                }
+                $rootScope.userInfo = data;
+            }).error(function(response) {
+                toaster.pop('info', '获取定单的信息' + response);
+            });
+        };
 
 
-		//判断是否是商城管理公司,是否可以选择自营。
-		$q.all([getAuthentication()]).then(function() {
-			//获取店铺的信息
-			StoreInfo.getStoreInfoByEnuu({enUU : $rootScope.userInfo.enterprise.uu}, function(data) {
-				$scope.storeInfo = data;
-				if(!data.uuid || data.storeName.indexOf('优软测试二') > -1 || data.storeName.indexOf('优软商城') > -1) {
-					$scope.batch.sellType = 'UAS';
-					$scope.batch.selfSellEabled = false;
-				}else {
-					$scope.batch.sellType = 'self';
-					$scope.batch.selfSellEabled = true;
-				}
-			}, function(response) {
-				toaster.pop('error', '获取店铺的信息失败, ' + response.data);
-			});
-		});
+        //判断是否是商城管理公司,是否可以选择自营。
+        $q.all([getAuthentication()]).then(function() {
+            //获取店铺的信息
+            StoreInfo.getStoreInfoByEnuu({enUU : $rootScope.userInfo.enterprise.uu}, function(data) {
+                $scope.storeInfo = data;
+                if(!data.uuid || data.storeName.indexOf('优软测试二') > -1 || data.storeName.indexOf('优软商城') > -1) {
+                    $scope.batch.sellType = 'UAS';
+                    $scope.batch.selfSellEabled = false;
+                }else {
+                    $scope.batch.sellType = 'self';
+                    $scope.batch.selfSellEabled = true;
+                }
+            }, function(response) {
+                toaster.pop('error', '获取店铺的信息失败, ' + response.data);
+            });
+        });
 
 
 
 
-		//选择文件
-		$scope.selectFile = function(value) {
-			if(value != null) {
-				upload_text.value = value;
-			}else {
-				var fileInput = angular.element('#uploadCommodity')[0];
-				upload_text.value = fileInput.value;
-			}
-		};
+        //选择文件
+        $scope.selectFile = function(value) {
+            if(value != null) {
+                upload_text.value = value;
+            }else {
+                var fileInput = angular.element('#uploadCommodity')[0];
+                upload_text.value = fileInput.value;
+            }
+        };
 
 
-		// 上传Excel批量发布(大量)
-		$scope.upload = function() {
-			if(($scope.batch.myFiles == null) || ($scope.batch.myFiles.length == 0)) {
-				return ;
-			}
-			var file = $scope.batch.myFiles[0];
-			if(!file) {
-				toaster.pop('info', '请选择需要上传的文件');
-				return;
-			}
-			if ($rootScope.$$productOn.tab === 'bathOnPerson') {
-				var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, isPerson : 1};
-			} else {
+        // 上传Excel批量发布(大量)
+        $scope.upload = function() {
+            if(($scope.batch.myFiles == null) || ($scope.batch.myFiles.length == 0)) {
+                return ;
+            }
+            var file = $scope.batch.myFiles[0];
+            if(!file) {
+                toaster.pop('info', '请选择需要上传的文件');
+                return;
+            }
+            if ($rootScope.$$productOn.tab === 'bathOnPerson') {
+                var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, isPerson : 1};
+            } else {
                 var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency};
                 var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency};
-			}
-			$upload.upload({
-				url: 'release/product/release/excel',
-				file: file,
-				method: 'POST',
-				params : param
-			}).success(function(data) {
-				$scope.selectFile(' ');
-				$scope.batch.myFiles = [];
-				$scope.proInfo = data.info;
-				$scope.result = data;
-				$scope.hadImport = false;
-				// var message = "";
-				// if($scope.result.success) {
-				// 	message = '标准产品' + $scope.result.success + '个';
-				// }
-				// if($scope.result.failure) {
-				// 	if(message) {
-				// 		message = message + ',非标产品' + $scope.result.failure +  '个';
-				// 	}else {
-				// 		message = '非标产品' + $scope.result.failure +  '个';
-				// 	}
-				// }
-				// if($scope.result.filter) {
-				// 	if(message) {
-				// 		message = message + ',过滤' + $scope.result.filter +  '条';
-				// 	}else {
-				// 		message = '过滤' + $scope.result.filter +  '条';
-				// 	}
-				// }
-				// if(!message) {
-				// 	message = '没有提交任何信息'
-				// }
-				toaster.pop('info', '提示', '上传完成');
-				$scope.relTableParams.page(1);
-				$scope.relTableParams.reload();
+            }
+            $upload.upload({
+                url: 'release/product/release/excel',
+                file: file,
+                method: 'POST',
+                params : param
+            }).success(function(data) {
+                $scope.selectFile(' ');
+                $scope.batch.myFiles = [];
+                $scope.proInfo = data.info;
+                $scope.result = data;
+                $scope.hadImport = false;
+                // var message = "";
+                // if($scope.result.success) {
+                // 	message = '标准产品' + $scope.result.success + '个';
+                // }
+                // if($scope.result.failure) {
+                // 	if(message) {
+                // 		message = message + ',非标产品' + $scope.result.failure +  '个';
+                // 	}else {
+                // 		message = '非标产品' + $scope.result.failure +  '个';
+                // 	}
+                // }
+                // if($scope.result.filter) {
+                // 	if(message) {
+                // 		message = message + ',过滤' + $scope.result.filter +  '条';
+                // 	}else {
+                // 		message = '过滤' + $scope.result.filter +  '条';
+                // 	}
+                // }
+                // if(!message) {
+                // 	message = '没有提交任何信息'
+                // }
+                toaster.pop('info', '提示', '上传完成');
+                $scope.relTableParams.page(1);
+                $scope.relTableParams.reload();
                 if ($rootScope.$$productOn.tab === 'bathOnPerson') {
                 if ($rootScope.$$productOn.tab === 'bathOnPerson') {
                     publicPersonProduct();
                     publicPersonProduct();
                 }
                 }
-			}).error(function(response) {
-				$scope.result = {};
-				$scope.result.total = 0;
-				$scope.pageParams.number = 0;
-				$scope.pageParams.content = null;
-				$scope.pageParams.totalElements = 0;
-				$scope.pageParams.totalPages = 0;
-				toaster.pop('error', response.data || response);
-			});
-		};
-
-		// 下载模板
-		$scope.download = function() {
-			var show = SessionService.get($scope.userInfo.userUU + "-releasetip");
-			if (!show) {
-				var modalInstance = $modal.open({
-					animation: true,
-					templateUrl : $rootScope.rootPath + '/static/view/vendor/modal/releaseProductByBatchTip.html',
-					controller : 'releaseProductByBatchTipCtrl'
-				});
-				modalInstance.result.then(function(response) {
-				}, function(res) {
-					window.location.href = $rootScope.rootPath + '/release/product/release/template?currency' + '=' + $scope.batch.currency + ($rootScope.$$productOn.tab == 'bathOnPerson' ? '&isPerson=1' : '');
-				});
-			} else {
-				window.location.href = $rootScope.rootPath + '/release/product/release/template?currency' + '=' + $scope.batch.currency + ($rootScope.$$productOn.tab == 'bathOnPerson' ? '&isPerson=1' : '');
-			}
-		};
+            }).error(function(response) {
+                $scope.result = {};
+                $scope.result.total = 0;
+                $scope.pageParams.number = 0;
+                $scope.pageParams.content = null;
+                $scope.pageParams.totalElements = 0;
+                $scope.pageParams.totalPages = 0;
+                toaster.pop('error', response.data || response);
+            });
+        };
 
 
-		//批量发布
-		$scope.publish = function(event) {
-			if ($scope.pageParams.totalElements > 0) {
-				ReleaseProductByBatch.batchRelease({batch : $scope.result.batch}, null, function(data) {
-					if ($scope.needShowTip){
-						$scope.relTableParams.page(1);
-						$scope.relTableParams.reload();
-						$scope.result.success = 0;//设置成0,让前端用户不能点击
-						$modal.open({
-							animation : true,
-							templateUrl : 'static/view/common/modal/product_upload_modal.html',
-							controller : 'rule_tip_ctrl',
-							resolve : {
-								type : function() {
-									return 'upload';
-								},
-								tipModal : function() {
-									return true;
-								}
-							}
-						});
-						return ;
-					}
-					// toaster.pop("success", "提示", "发布成功 :" + data.data + "条");
-					toaster.pop("success", "提示", "发布成功");
-					$scope.relTableParams.page(1);
-					$scope.relTableParams.reload();
-					$scope.result.success = 0;//设置成0,让前端用户不能点击
-					$scope.hadImport = true; //上架后隐藏提示语
-				}, function(res) {
-					toaster.pop("error", "发布失败", res.data);
-				});
-			} else {
-				event.stopPropagation();//阻止冒泡事件
-				event.preventDefault();//阻止默认的事件。
-				toaster.pop("info", "提示", "没有信息发布");
-			}
-		};
+        // 下载模板
+        $scope.download = function() {
+            var show = SessionService.get($scope.userInfo.userUU + "-releasetip");
+            if (!show) {
+                var modalInstance = $modal.open({
+                    animation: true,
+                    templateUrl : $rootScope.rootPath + '/static/view/vendor/modal/releaseProductByBatchTip.html',
+                    controller : 'releaseProductByBatchTipCtrl'
+                });
+                modalInstance.result.then(function(response) {
+                }, function(res) {
+                    window.location.href = $rootScope.rootPath + '/release/product/release/template?currency' + '=' + $scope.batch.currency + ($rootScope.$$productOn.tab == 'bathOnPerson' ? '&isPerson=1' : '');
+                });
+            } else {
+                window.location.href = $rootScope.rootPath + '/release/product/release/template?currency' + '=' + $scope.batch.currency + ($rootScope.$$productOn.tab == 'bathOnPerson' ? '&isPerson=1' : '');
+            }
+        };
 
 
-		function publicPersonProduct() {
-			ReleaseProductByBatch.batchReleasePerson({batch : $scope.result.batch}, null, function(data) {
+        //批量发布
+        $scope.publish = function(event) {
+            if ($scope.pageParams.totalElements > 0) {
+                ReleaseProductByBatch.batchRelease({batch : $scope.result.batch}, null, function(data) {
                     if ($scope.needShowTip){
                     if ($scope.needShowTip){
                         $scope.relTableParams.page(1);
                         $scope.relTableParams.page(1);
                         $scope.relTableParams.reload();
                         $scope.relTableParams.reload();
-                        //$scope.result.success = 0;//设置成0,让前端用户不能点击
+                        $scope.result.success = 0;//设置成0,让前端用户不能点击
                         $modal.open({
                         $modal.open({
                             animation : true,
                             animation : true,
                             templateUrl : 'static/view/common/modal/product_upload_modal.html',
                             templateUrl : 'static/view/common/modal/product_upload_modal.html',
@@ -338,61 +305,104 @@ define([ 'app/app' ], function(app) {
                         return ;
                         return ;
                     }
                     }
                     // toaster.pop("success", "提示", "发布成功 :" + data.data + "条");
                     // toaster.pop("success", "提示", "发布成功 :" + data.data + "条");
-                    $scope.personMedol = true;
+                    toaster.pop("success", "提示", "发布成功");
                     $scope.relTableParams.page(1);
                     $scope.relTableParams.page(1);
                     $scope.relTableParams.reload();
                     $scope.relTableParams.reload();
-                    //$scope.result.success = 0;//设置成0,让前端用户不能点击
-                    /*$scope.hadImport = true; //上架后隐藏提示语*/ // 个人上传不隐藏
+                    $scope.result.success = 0;//设置成0,让前端用户不能点击
+                    $scope.hadImport = true; //上架后隐藏提示语
                 }, function(res) {
                 }, function(res) {
                     toaster.pop("error", "发布失败", res.data);
                     toaster.pop("error", "发布失败", res.data);
-			});
+                });
+            } else {
+                event.stopPropagation();//阻止冒泡事件
+                event.preventDefault();//阻止默认的事件。
+                toaster.pop("info", "提示", "没有信息发布");
+            }
+        };
+
+        function publicPersonProduct() {
+            ReleaseProductByBatch.batchReleasePerson({batch : $scope.result.batch}, null, function(data) {
+                if ($scope.needShowTip){
+                    $scope.relTableParams.page(1);
+                    $scope.relTableParams.reload();
+                    //$scope.result.success = 0;//设置成0,让前端用户不能点击
+                    $modal.open({
+                        animation : true,
+                        templateUrl : 'static/view/common/modal/product_upload_modal.html',
+                        controller : 'rule_tip_ctrl',
+                        resolve : {
+                            type : function() {
+                                return 'upload';
+                            },
+                            tipModal : function() {
+                                return true;
+                            }
+                        }
+                    });
+                    return ;
+                }
+                // toaster.pop("success", "提示", "发布成功 :" + data.data + "条");
+                $scope.personMedol = true;
+                $scope.relTableParams.page(1);
+                $scope.relTableParams.reload();
+                //$scope.result.success = 0;//设置成0,让前端用户不能点击
+                /*$scope.hadImport = true; //上架后隐藏提示语*/ // 个人上传不隐藏
+            }, function(res) {
+                toaster.pop("error", "发布失败", res.data);
+            });
         }
         }
 
 
-		//下载未匹配成功的数据
-		$scope.downloadExcel = function(){
-			if ($rootScope.$$productOn.tab === 'bathOnPerson') {
+        //下载未匹配成功的数据
+        $scope.downloadExcel = function(){
+            if ($rootScope.$$productOn.tab === 'bathOnPerson') {
                 var datatem = {isAjax : true, batch : $scope.result.batch, isPerson : 1};
                 var datatem = {isAjax : true, batch : $scope.result.batch, isPerson : 1};
-			} else {
+            } else {
                 var datatem = {isAjax : true, batch : $scope.result.batch};
                 var datatem = {isAjax : true, batch : $scope.result.batch};
-			}
-			if($scope.result && $scope.result.batch && $scope.result.filter) {
-				var form = document.getElementById('load-error');
-				form.action= 'release/product/release/failure/xls';
-				form.submit();
-				Loading.show();
-				var intervalId = null;
-				var getDownLoadStatus = function () {
-					$.ajax({
-						type: 'GET',
-						url: 'release/product/release/failure/xls',
-						data : datatem,
-						dataType : 'json',
-						success: function (data) {
-							if(!data.load) {
-								$scope.$apply(function () {
-									Loading.hide();
-									/*toaster.pop('success', '数据处理完毕,正在下载文件,请稍等。');*/
-								});
-								clearInterval(intervalId);
-							}
-						},
-						error: function () {
-							Loading.hide();
-							clearInterval(intervalId);
-						}
-					});
-				};
-				intervalId= setInterval(function () {
-					getDownLoadStatus();
-				}, 500);
-			}else {
-				if(!$scope.result || !$scope.result.batch) {
-					toaster.pop('info', '提示', '您没有上传信息');
-				}else if(!$scope.result.filter) {
-					toaster.pop('info', '提示', '您没有匹配不成功的数据');
-				}
-			}
-		};
+            }
+            if($scope.result && $scope.result.batch && $scope.result.filter) {
+                var form = document.getElementById('load-error');
+                form.action= 'release/product/release/failure/xls';
+                form.submit();
+                Loading.show();
+                var intervalId = null;
+                var getDownLoadStatus = function () {
+                    $.ajax({
+                        type: 'GET',
+                        url: 'release/product/release/failure/xls',
+                        data : datatem,
+                        dataType : 'json',
+                        success: function (data) {
+                            if(!data.load) {
+                                $scope.$apply(function () {
+                                    Loading.hide();
+                                    /*toaster.pop('success', '数据处理完毕,正在下载文件,请稍等。');*/
+                                });
+                                clearInterval(intervalId);
+                            }
+                        },
+                        error: function () {
+                            Loading.hide();
+                            clearInterval(intervalId);
+                        }
+                    });
+                };
+                intervalId= setInterval(function () {
+                    getDownLoadStatus();
+                }, 500);
+            }else {
+                if(!$scope.result || !$scope.result.batch) {
+                    toaster.pop('info', '提示', '您没有上传信息');
+                }else if(!$scope.result.filter) {
+                    toaster.pop('info', '提示', '您没有匹配不成功的数据');
+                }
+            }
+        };
+	}]);
+
+	//批量上架的Ctrl
+	app.register.controller('batchPutOnCtrl', ['$scope', '$rootScope', 'ngTableParams', '$upload', '$q', 'AuthenticationService', 'BaseService', 'StoreInfo', 'SessionService', '$modal', 'toaster', 'ReleaseProductByBatch', 'Loading', 'Enterprise', 'DistributionRule', function ($scope, $rootScope, ngTableParams, $upload, $q, AuthenticationService, BaseService, StoreInfo, SessionService, $modal, toaster, ReleaseProductByBatch, Loading, Enterprise, DistributionRule) {
+
+
 	}]);
 	}]);
 
 
 	//下载表格时显示提示信息
 	//下载表格时显示提示信息

+ 16 - 11
src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html

@@ -684,16 +684,19 @@
         <!--搜索时间筛选-->
         <!--搜索时间筛选-->
         <div class="screen">
         <div class="screen">
             <div class="fl">
             <div class="fl">
+                <!--
                 <label class="com-check-box">
                 <label class="com-check-box">
                     <input type="checkbox" id="1" ng-model="isMallGoods" ng-change="onSearch()">
                     <input type="checkbox" id="1" ng-model="isMallGoods" ng-change="onSearch()">
                     <label for="1"></label>
                     <label for="1"></label>
-                </label>&nbsp;有现货&nbsp;&nbsp;
+                </label>&nbsp;有现货&nbsp;&nbsp;-->
+                <!--
                 截止时间&nbsp;
                 截止时间&nbsp;
-                <select class="form-control select-adder" ng-model="deadline" ng-change="onSearch()" ng-init="deadline='全部'">
-                    <option value="全部">全部</option>
-                    <option value="已截止">已截止</option>
+                <select class="form-control select-adder" ng-model="overdue" ng-change="onSearch()" ng-init="overdue='0'">
+                    <option value="0">全部</option>
+                    <option value="1">已截止</option>
                     <option value="正在生效">正在生效</option>
                     <option value="正在生效">正在生效</option>
                 </select>
                 </select>
+                -->
             </div>
             </div>
             <div class="sreach fr">
             <div class="sreach fr">
                 <span>发布时间&nbsp;</span>
                 <span>发布时间&nbsp;</span>
@@ -743,12 +746,14 @@
                 <th width="105">生产日期</th>
                 <th width="105">生产日期</th>
                 <th width="123">截止时间</th>
                 <th width="123">截止时间</th>
                 <th width="81">
                 <th width="81">
+                    <!--
                     <select class="select-adder form-control" ng-model="searchStatus" ng-change="onSearch(searchStatus)">
                     <select class="select-adder form-control" ng-model="searchStatus" ng-change="onSearch(searchStatus)">
                         <option value="0">全部</option>
                         <option value="0">全部</option>
-                        <option value="200">待报价</option>
-                        <option value="201">已报价</option>
+                        <option value="">待报价</option>
+                        <option value="done">已报价</option>
                         <option value="202">已采纳</option>
                         <option value="202">已采纳</option>
-                    </select>
+                    </select>-->
+                    状态
                 </th>
                 </th>
                 <th width="92">操作</th>
                 <th width="92">操作</th>
             </tr>
             </tr>
@@ -855,7 +860,7 @@
                                 <table>
                                 <table>
                                     <tbody>
                                     <tbody>
                                     <tr ng-repeat="of in offer">
                                     <tr ng-repeat="of in offer">
-                                        <td width="173" ng-bind="(of.enterprise).enName"></td>
+                                        <td width="173" ng-bind="of.userName"></td>
                                         <td width="186" class="red-text" ng-bind="of.minDay+'-'+of.maxDay">4-6</td>
                                         <td width="186" class="red-text" ng-bind="of.minDay+'-'+of.maxDay">4-6</td>
                                         <td width="186">
                                         <td width="186">
                                             <!--<span>{{of.currency + of.unitPrice | currencyStr}}</span>-->
                                             <!--<span>{{of.currency + of.unitPrice | currencyStr}}</span>-->
@@ -878,7 +883,7 @@
                                         <td width="221" class="operate">
                                         <td width="221" class="operate">
                                             <a>联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
                                             <a>联系卖家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
                                             <img ng-if="of.status == 202" src="static/img/seekPurchase/recieved.png" alt="" class="ng-scope">
                                             <img ng-if="of.status == 202" src="static/img/seekPurchase/recieved.png" alt="" class="ng-scope">
-                                            <span ng-if="seek.status != 202" ng-click="setShowUseFlag(true, of)">采纳报价</span>
+                                            <span ng-if="seek.status != 202" ng-click="adopt(of.id)">采纳报价</span>
                                         </td>
                                         </td>
                                     </tr>
                                     </tr>
                                     </tbody>
                                     </tbody>
@@ -952,8 +957,8 @@
                 <td>
                 <td>
                     <img src="static/img/seekPurchase/Excel.png" alt="">
                     <img src="static/img/seekPurchase/Excel.png" alt="">
                     <div>
                     <div>
-                        <p ng-bind="bom.name"></p>
-                        <div>共 <span class="blue-text" ng-bind="bom.productAmount || 0"></span> 个产品,<span class="red-text" ng-bind="bom.offerAmount || 0">10</span> 个有报价,<span class="red-text" ng-bind="bom.goodsAmount || 0">7</span> 个有现货</div>
+                        <p ng-bind="bom.remark"></p>
+                        <div>共 <span class="blue-text" ng-bind="bom.amount || 0"></span> 个产品<!--,<span class="red-text" ng-bind="bom.offerAmount || 0">10</span> 个有报价,<span class="red-text" ng-bind="bom.goodsAmount || 0">7</span> 个有现货--></div>
                         <div ng-bind="bom.releaseDate | date:'yyyy-MM-dd HH:mm:ss'"></div>
                         <div ng-bind="bom.releaseDate | date:'yyyy-MM-dd HH:mm:ss'"></div>
                     </div>
                     </div>
                     <a href="user#/bomDetail/{{bom.bomId}}" class="fr">查看详情</a>
                     <a href="user#/bomDetail/{{bom.bomId}}" class="fr">查看详情</a>

+ 1 - 0
src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_erp.html

@@ -180,6 +180,7 @@
 	.search-check .search{
 	.search-check .search{
 		width: 550px;
 		width: 550px;
 		margin-left: 150px;
 		margin-left: 150px;
+		margin-bottom: 10px;
 	}
 	}
 	.search-check .search .form-control{
 	.search-check .search .form-control{
 		width: 340px;
 		width: 340px;

+ 2 - 1
src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_unstandard_erp.html

@@ -180,6 +180,7 @@
 	.search-check .search{
 	.search-check .search{
 		width: 550px;
 		width: 550px;
 		margin-left: 150px;
 		margin-left: 150px;
+		margin-bottom: 10px;
 	}
 	}
 	.search-check .search .form-control{
 	.search-check .search .form-control{
 		width: 340px;
 		width: 340px;
@@ -1929,7 +1930,7 @@
 													<div class="labelling">
 													<div class="labelling">
 														<!--<em>*</em>-->
 														<!--<em>*</em>-->
 														自定义标签 : <input maxlength="20" type="text" ng-model="goods.editTag" ng-blur="blurTag(goods)" ng-change="changeTag(goods)" placeholder="请设置产品标签"></div>
 														自定义标签 : <input maxlength="20" type="text" ng-model="goods.editTag" ng-blur="blurTag(goods)" ng-change="changeTag(goods)" placeholder="请设置产品标签"></div>
-													<span>近一个月的销售平均价:<em ng-bind="material.averMonthSalePrice |  formateNumber : 6"></em></span>
+													<span>近一个月的销售平均价:<em ng-bind="material.averMonthSalePrice |  formateNumber : 6"></em></span>{{material.b2cDownStatus}}
 												</td>
 												</td>
 											</tr>
 											</tr>
 											<tr class="edit-content edits" ng-if="goods.edit">
 											<tr class="edit-content edits" ng-if="goods.edit">

+ 19 - 11
src/main/webapp/resources/view/vendor/forstore/purchaseOffer.html

@@ -442,20 +442,24 @@
         </div>
         </div>
     </div>
     </div>
     <div class="seek-purchase-content">
     <div class="seek-purchase-content">
+        <!--
         <div class="seek-purchase-title">
         <div class="seek-purchase-title">
             <div class="seek-data">采纳次数:<span ng-bind="seekPurchaseRate.acceptedAmount"></span></div>
             <div class="seek-data">采纳次数:<span ng-bind="seekPurchaseRate.acceptedAmount"></span></div>
             <div class="seek-data">报价次数:<span ng-bind="seekPurchaseRate.offerAmount"></span></div>
             <div class="seek-data">报价次数:<span ng-bind="seekPurchaseRate.offerAmount"></span></div>
             <div class="seek-rate">求购成交率<span ng-bind="seekPurchaseRate.rate+'%'"></span></div>
             <div class="seek-rate">求购成交率<span ng-bind="seekPurchaseRate.rate+'%'"></span></div>
         </div>
         </div>
+        -->
         <!--搜索时间筛选-->
         <!--搜索时间筛选-->
         <div class="screen" style="background: #f5f8fe;height: 40px;margin-bottom: 15px;margin-top: 5px;padding-top: 4px;padding-right: 11px;">
         <div class="screen" style="background: #f5f8fe;height: 40px;margin-bottom: 15px;margin-top: 5px;padding-top: 4px;padding-right: 11px;">
             <div class="fl">
             <div class="fl">
+                <!--
                 截止时间&nbsp;
                 截止时间&nbsp;
                 <select class="form-control select-adder" ng-model="deadline" ng-change="onSearch()" ng-init="deadline='全部'">
                 <select class="form-control select-adder" ng-model="deadline" ng-change="onSearch()" ng-init="deadline='全部'">
                     <option value="全部">全部</option>
                     <option value="全部">全部</option>
                     <option value="已截止">已截止</option>
                     <option value="已截止">已截止</option>
                     <option value="正在生效">正在生效</option>
                     <option value="正在生效">正在生效</option>
                 </select>
                 </select>
+                -->
                 <!--
                 <!--
                 报价状态&nbsp;
                 报价状态&nbsp;
                 <select class="form-control select-adder" ng-model="status" ng-change="onSearch()" ng-init="status=200">
                 <select class="form-control select-adder" ng-model="status" ng-change="onSearch()" ng-init="status=200">
@@ -518,33 +522,36 @@
             <tbody ng-repeat="seek in $data" ng-class="{'active': seek.$active, 'hover': seek.$hover && (seek.status == 201 || seek.status == 202)}">
             <tbody ng-repeat="seek in $data" ng-class="{'active': seek.$active, 'hover': seek.$hover && (seek.status == 201 || seek.status == 202)}">
             <tr class="default-row" ng-mouseenter="seek.$hover = true;" ng-mouseleave="seek.$hover = false;" >
             <tr class="default-row" ng-mouseenter="seek.$hover = true;" ng-mouseleave="seek.$hover = false;" >
                 <td class="release-time">
                 <td class="release-time">
-                    <span ng-bind="seek.releaseDate | date:'yyyy-MM-dd'"></span>
-                    <span ng-bind="seek.releaseDate | date:'HH:mm:ss'"></span>
+                    <span ng-bind="seek.inquiry.date | date:'yyyy-MM-dd'"></span>
+                    <span ng-bind="seek.inquiry.date | date:'HH:mm:ss'"></span>
+                    <!--
                     <div class="seek-status">
                     <div class="seek-status">
                         <div ng-show="seek.goodsEnuu" class="status">已在库</div>
                         <div ng-show="seek.goodsEnuu" class="status">已在库</div>
                         <div ng-show="!seek.goodsEnuu" class="no-grounding">未在库</div>
                         <div ng-show="!seek.goodsEnuu" class="no-grounding">未在库</div>
                         <div class="BOM-list-btn" ng-if="seek.bomId">BOM清单</div>
                         <div class="BOM-list-btn" ng-if="seek.bomId">BOM清单</div>
                         <a ng-show="!seek.goodsEnuu" target="_blank" href="vendor#/vendor_upload">产品导入>></a>
                         <a ng-show="!seek.goodsEnuu" target="_blank" href="vendor#/vendor_upload">产品导入>></a>
                     </div>
                     </div>
+                    -->
                 </td>
                 </td>
-                <td class="user-name"><div title="{{seek.userName}}" ng-bind="seek.userName"></div></td>
-                <td><div title="{{seek.code}}" ng-bind="seek.code"></div></td>
-                <td><div title="{{seek.brand}}" ng-bind="seek.brand"></div></td>
+                <td class="user-name"><div title="{{seek.userName || seek.inquiry.enterprise.enName}}" ng-bind="seek.userName || seek.inquiry.enterprise.enName"></div></td>
+                <td><div title="{{seek.cmpCode || seek.prodCode || seek.product.cmpCode}}" ng-bind="seek.cmpCode || seek.prodCode || seek.product.cmpCode"></div></td>
+                <td><div title="{{seek.inbrand}}" ng-bind="seek.inbrand || '-'"></div></td>
                 <td><div title="{{seek.encapsulation}}" ng-bind="seek.encapsulation || '--'"></div></td>
                 <td><div title="{{seek.encapsulation}}" ng-bind="seek.encapsulation || '--'"></div></td>
                 <td><div title="{{seek.produceDate}}" ng-bind="seek.produceDate || '--'"></div></td>
                 <td><div title="{{seek.produceDate}}" ng-bind="seek.produceDate || '--'"></div></td>
-                <td><div title="{{seek.amount}}" ng-bind="seek.amount || '--'"></div></td>
+                <td><div title="{{seek.needquantity}}" ng-bind="seek.amount || '--'"></div></td>
                 <td class="unit-price">
                 <td class="unit-price">
-                    <span>{{seek.spCurrency + seek.spUnitPrice | currencyStr}}</span>
+                    <span>{{seek.currency + seek.unitPrice | currencyStr}}</span>
                 </td>
                 </td>
                 <td class="left-time" ng-if="seek.remainingTime > 0">剩余&nbsp;<span ng-bind="getDay(seek.remainingTime)" ng-if="getDay(seek.remainingTime) > 0" class="red-text"></span><i ng-if="getDay(seek.remainingTime) > 0">&nbsp;天&nbsp;</i><span ng-if="getDay(seek.remainingTime) <= 0" ng-bind="getHours(seek.remainingTime)" class="red-text">5</span><i ng-if="getDay(seek.remainingTime) <= 0">&nbsp;小时</i></td>
                 <td class="left-time" ng-if="seek.remainingTime > 0">剩余&nbsp;<span ng-bind="getDay(seek.remainingTime)" ng-if="getDay(seek.remainingTime) > 0" class="red-text"></span><i ng-if="getDay(seek.remainingTime) > 0">&nbsp;天&nbsp;</i><span ng-if="getDay(seek.remainingTime) <= 0" ng-bind="getHours(seek.remainingTime)" class="red-text">5</span><i ng-if="getDay(seek.remainingTime) <= 0">&nbsp;小时</i></td>
                 <td class="left-time" ng-if="seek.remainingTime <= 0"><span>已截止</span></td>
                 <td class="left-time" ng-if="seek.remainingTime <= 0"><span>已截止</span></td>
-                <td class="operate" ng-switch="seek.status">
+                <td class="left-time" ng-if="seek.remainingTime == null"><span style="color: red;">-</span></td>
+                <td class="operate" ng-switch="seek.agreed">
                     <a>联系买家 <img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
                     <a>联系买家 <img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
-                    <div  ng-switch-when="200" ng-click="setSeekActive(seek, true)">我要报价</div>
-                    <span ng-switch-when="201">已报价 <img src="static/img/seekPurchase/check.png" alt=""></span>
-                    <img ng-switch-when="202" src="static/img/seekPurchase/recieved.png" alt="">
+                    <span ng-switch-when="0">已报价 <img src="static/img/seekPurchase/check.png" alt=""></span>
+                    <img ng-switch-when="1" src="static/img/seekPurchase/recieved.png" alt="">
                 </td>
                 </td>
             </tr>
             </tr>
+            <!--
             <tr class="expand-row">
             <tr class="expand-row">
                 <td colspan="10">
                 <td colspan="10">
                     <div style="width: 173px;">历史报价</div>
                     <div style="width: 173px;">历史报价</div>
@@ -557,6 +564,7 @@
                     <div style="width: 271px;">生产日期:{{seek.produceDate || '-'}}</div>
                     <div style="width: 271px;">生产日期:{{seek.produceDate || '-'}}</div>
                 </td>
                 </td>
             </tr>
             </tr>
+            -->
             </tbody>
             </tbody>
         </table>
         </table>
     </div>
     </div>

+ 26 - 18
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -520,12 +520,14 @@
         <!--搜索时间筛选-->
         <!--搜索时间筛选-->
         <div class="screen" style="background: #f5f8fe;height: 40px;margin-bottom: 15px;margin-top: 5px;padding-top: 4px;padding-right: 11px;">
         <div class="screen" style="background: #f5f8fe;height: 40px;margin-bottom: 15px;margin-top: 5px;padding-top: 4px;padding-right: 11px;">
             <div class="fl">
             <div class="fl">
+                <!--
                 截止时间&nbsp;
                 截止时间&nbsp;
                 <select class="form-control select-adder" ng-model="deadline" ng-change="onSearch()" ng-init="deadline='全部'">
                 <select class="form-control select-adder" ng-model="deadline" ng-change="onSearch()" ng-init="deadline='全部'">
                     <option value="全部">全部</option>
                     <option value="全部">全部</option>
                     <option value="已截止">已截止</option>
                     <option value="已截止">已截止</option>
                     <option value="正在生效">正在生效</option>
                     <option value="正在生效">正在生效</option>
                 </select>
                 </select>
+                -->
                 <!--
                 <!--
                 报价状态&nbsp;
                 报价状态&nbsp;
                 <select class="form-control select-adder" ng-model="status" ng-change="onSearch()" ng-init="status=200">
                 <select class="form-control select-adder" ng-model="status" ng-change="onSearch()" ng-init="status=200">
@@ -585,7 +587,7 @@
                     <th width="92">操作</th>
                     <th width="92">操作</th>
                 </tr>
                 </tr>
             </thead>
             </thead>
-            <tbody ng-repeat="seek in seekListData" ng-class="{'active': seek.$active}">
+            <tbody ng-repeat="seek in seekListData track by $index" ng-class="{'active': seek.$active}">
                 <tr class="default-row">
                 <tr class="default-row">
                     <td class="release-time">
                     <td class="release-time">
                         <span ng-bind="seek.date | date:'yyyy-MM-dd'"></span>
                         <span ng-bind="seek.date | date:'yyyy-MM-dd'"></span>
@@ -597,12 +599,12 @@
                         </div>
                         </div>
                         -->
                         -->
                     </td>
                     </td>
-                    <td class="user-name"><div title="{{seek.userName}}" ng-bind="seek.userName || '-'"></div></td>
-                    <td><div title="{{seek.cmpCode}}" ng-bind="seek.code || '-'"></div></td>
-                    <td><div title="{{seek.inbrand}}" ng-bind="seek.brand || '-'"></div></td>
+                    <td class="user-name"><div title="{{seek.userName || seek.inquiry.enterprise.enName}}" ng-bind="seek.userName || seek.inquiry.enterprise.enName"></div></td>
+                    <td><div title="{{seek.cmpCode}}" ng-bind="seek.cmpCode || '-'"></div></td>
+                    <td><div title="{{seek.inbrand}}" ng-bind="seek.inbrand || '-'"></div></td>
                     <td><div title="{{seek.encapsulation}}" ng-bind="seek.encapsulation || '-'"></div></td>
                     <td><div title="{{seek.encapsulation}}" ng-bind="seek.encapsulation || '-'"></div></td>
                     <td><div title="{{seek.produceDate}}" ng-bind="seek.produceDate || '-'"></div></td>
                     <td><div title="{{seek.produceDate}}" ng-bind="seek.produceDate || '-'"></div></td>
-                    <td><div title="{{seek.needquantity}}" ng-bind="seek.amount || '-'"></div></td>
+                    <td><div title="{{seek.needquantity}}" ng-bind="seek.needquantity || '-'"></div></td>
                     <td class="unit-price">
                     <td class="unit-price">
                         <span>{{seek.currency + seek.unitPrice | currencyStr}}</span>
                         <span>{{seek.currency + seek.unitPrice | currencyStr}}</span>
                     </td>
                     </td>
@@ -611,10 +613,10 @@
                     <td class="left-time" ng-if="seek.remainingTime == null"><span style="color: red;">-</span></td>
                     <td class="left-time" ng-if="seek.remainingTime == null"><span style="color: red;">-</span></td>
                     <td class="operate">
                     <td class="operate">
                         <a>联系买家 <img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
                         <a>联系买家 <img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
-                        <div ng-click="setSeekActive(seek, true)">我要报价</div>
+                        <div ng-click="setSeekActive(seek, true, index)">我要报价</div>
                     </td>
                     </td>
                 </tr>
                 </tr>
-                <tr class="say-price">
+                <!--<tr class="say-price">
                     <td colspan="10">
                     <td colspan="10">
                         <div>
                         <div>
                             <div>报价</div>
                             <div>报价</div>
@@ -641,28 +643,30 @@
                             </div>
                             </div>
                         </div>
                         </div>
                     </td>
                     </td>
-                </tr>
+                </tr>-->
             </tbody>
             </tbody>
         </table>
         </table>
     </div>
     </div>
-    <div class="say-price-box">
+    <div class="say-price-box" ng-show="isShowSayPriceBox">
         <div class="title">
         <div class="title">
-            <div>型号:<span>PMDIDASJD</span></div>
-            <div>品牌:<span>台积电</span></div>
+            <div>型号:<span ng-bind="inquiryItem.cmpCode">PMDIDASJD</span></div>
+            <div>品牌:<span ng-bind="inquiryItem.inbrand">台积电</span></div>
             <i class="fa fa-close"></i>
             <i class="fa fa-close"></i>
         </div>
         </div>
         <div class="content">
         <div class="content">
             <div class="content-line">
             <div class="content-line">
                 <div class="form-item form-left">
                 <div class="form-item form-left">
                     <span><i>*</i>交期:</span>
                     <span><i>*</i>交期:</span>
+                    <!--
                     <input type="text" class="form-control" placeholder="天数">
                     <input type="text" class="form-control" placeholder="天数">
                     -
                     -
-                    <input type="text" class="form-control" placeholder="天数">
+                    -->
+                    <input type="text" class="form-control" ng-model="inquiryItem.leadtime" placeholder="天数">
                 </div>
                 </div>
                 <div class="form-item form-upload">
                 <div class="form-item form-upload">
                     <label>
                     <label>
                         <span><i>+</i>添加附件</span>
                         <span><i>+</i>添加附件</span>
-                        <input type="file">
+                        <input type="file" ng-model="myFiles">
                     </label>
                     </label>
                     <!--<div>
                     <!--<div>
                       <span>我是Excel的名字111</span>
                       <span>我是Excel的名字111</span>
@@ -674,17 +678,20 @@
             <div class="content-line">
             <div class="content-line">
                 <div class="form-item form-left">
                 <div class="form-item form-left">
                     <span><i>*</i>价格梯度:</span>
                     <span><i>*</i>价格梯度:</span>
+                    <!--
                     <input type="text" class="form-control" placeholder="数量">
                     <input type="text" class="form-control" placeholder="数量">
                     -
                     -
-                    <input type="text" class="form-control" placeholder="数量">
+                    -->
+                    <input type="text" class="form-control" ng-model="inquiryItem.replies[0].lapQty" placeholder="数量">
                 </div>
                 </div>
                 <div class="form-item form-right">
                 <div class="form-item form-right">
                     <span><i>*</i>单价($):</span>
                     <span><i>*</i>单价($):</span>
-                    <input type="text" class="form-control" placeholder="单价">
+                    <input type="text" class="form-control"  ng-model="inquiryItem.replies[0].price" placeholder="单价">
                     <i class="fa fa-minus-circle"></i>
                     <i class="fa fa-minus-circle"></i>
                     <i class="fa fa-plus-circle"></i>
                     <i class="fa fa-plus-circle"></i>
                 </div>
                 </div>
             </div>
             </div>
+            <!--
             <div class="content-line">
             <div class="content-line">
                 <div class="form-item form-left">
                 <div class="form-item form-left">
                     <span><i>*</i>价格梯度:</span>
                     <span><i>*</i>价格梯度:</span>
@@ -694,15 +701,16 @@
                 </div>
                 </div>
                 <div class="form-item form-right">
                 <div class="form-item form-right">
                     <span><i>*</i>单价($):</span>
                     <span><i>*</i>单价($):</span>
-                    <input type="text" class="form-control" placeholder="单价">
+                    <input type="text" class="form-control" placeholder="单价" ng-model="reply.price">
                     <i class="fa fa-minus-circle"></i>
                     <i class="fa fa-minus-circle"></i>
                     <i class="fa fa-plus-circle"></i>
                     <i class="fa fa-plus-circle"></i>
                 </div>
                 </div>
             </div>
             </div>
+    -->
         </div>
         </div>
         <div class="operate">
         <div class="operate">
-            <span>确定</span>
-            <span>取消</span>
+            <span ng-click="saveOffer()">确定</span>
+            <span ng-click="setSeekActive(seek, false, index)">取消</span>
         </div>
         </div>
     </div>
     </div>
 </div>
 </div>

+ 85 - 5
src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

@@ -150,6 +150,15 @@
     .add_category .sale-label input[type="radio"] {
     .add_category .sale-label input[type="radio"] {
         display: none;
         display: none;
     }
     }
+    .add_category .sale-label span {
+        cursor: pointer;
+    }
+    .add_category .sale-label span:first-child {
+        margin-right: 15px;
+    }
+    .add_category .sale-label span[disabled] {
+        cursor: not-allowed;
+    }
     .user_right a.blue-bg{
     .user_right a.blue-bg{
         color: #fff !important;
         color: #fff !important;
         margin-top: 5px;
         margin-top: 5px;
@@ -401,6 +410,57 @@
     .com-del-box .operate a {
     .com-del-box .operate a {
         color: #5078cb;
         color: #5078cb;
     }
     }
+    .type-remind-box {
+        width: 289px;
+        height: 132px;
+        -webkit-box-shadow: none;
+        -moz-box-shadow: none;
+        box-shadow: none;
+    }
+    .type-remind-box .title {
+        height: 23px;
+        line-height: 23px;
+    }
+    .type-remind-box .result {
+        width: 239px;
+        height: 37px;
+        margin: 16px auto 18px;
+        font-size: 14px;
+        color: #666;
+        line-height: 20px;
+    }
+    .type-remind-box .result span {
+        color: #e83825;
+    }
+    .type-remind-box .operate {
+        text-align: center;
+    }
+    .type-remind-box .operate a {
+        display: inline-block;
+        width: 90px;
+        height: 28px;
+        line-height: 28px;
+        text-align: center;
+        background: #5078cb;
+        color: #fff;
+        font-size: 14px;
+        vertical-align: middle;
+    }
+    .type-remind-box .operate a:first-child {
+        margin-right: 10px;
+    }
+    .type-remind-box .operate a:last-child {
+        background: #fff;
+        color: #5078cb;
+        border: 1px solid #5078cb;
+    }
+    .type-remind-box .operate a:first-child:hover {
+        color: #fff !important;
+    }
+    .type-remind-box .operate a:last-child:hover{
+        border-bottom: 1px solid #5078cb !important;
+        color: #5078cb !important;
+    }
 </style>
 </style>
 <div class="user_right fr">
 <div class="user_right fr">
     <!--货品管理-->
     <!--货品管理-->
@@ -412,7 +472,7 @@
             </ul>
             </ul>
         </div>
         </div>
         <div class="wanted_list01">
         <div class="wanted_list01">
-            <div class="tab" ng-if="$$productOn.leadIn == 'bathOn'" ng-class="{'active': leadIn == 'bathOn'}" ng-controller="batchPutOnCtrl">
+            <div class="tab" ng-if="$$productOn.leadIn == 'bathOn'" ng-class="{'active': leadIn == 'bathOn'}" >
                 <div class="load_next" ng-class="{'border-none':open01}">
                 <div class="load_next" ng-class="{'border-none':open01}">
                     <p>第一步,下载Excel模板
                     <p>第一步,下载Excel模板
                         <em class="open-icon" ng-click="open01=!open01" ng-class="{'active': !open01}"></em>
                         <em class="open-icon" ng-click="open01=!open01" ng-class="{'active': !open01}"></em>
@@ -429,9 +489,9 @@
                         <em class="open-icon" ng-click="open02=!open02" ng-class="{'active': !open02}"></em>
                         <em class="open-icon" ng-click="open02=!open02" ng-class="{'active': !open02}"></em>
                     </p>
                     </p>
                     <div class="add_category" ng-if="!open02">
                     <div class="add_category" ng-if="!open02">
-                        <div ng-if="$$productOn.tab == 'bathOn'">1、请选择是店铺自营还是优软代售</div>
+                        <div ng-if="$$productOn.tab == 'bathOn'">1、请选择销售方式:</div>
                         <div class="sale-label" style="margin-top: -10px;" ng-if="$$productOn.tab == 'bathOn'">
                         <div class="sale-label" style="margin-top: -10px;" ng-if="$$productOn.tab == 'bathOn'">
-                            <label class="sellType">
+                           <!-- <label class="sellType">
                                 <input ng-click="sellType('UAS')" type="radio" name="487" id="sellbyUAS" ng-model="batch.sellType" ng-checked="batch.sellType == 'UAS'">
                                 <input ng-click="sellType('UAS')" type="radio" name="487" id="sellbyUAS" ng-model="batch.sellType" ng-checked="batch.sellType == 'UAS'">
                                 <label for="sellbyUAS"></label>
                                 <label for="sellbyUAS"></label>
                                 <span>优软代售</span>
                                 <span>优软代售</span>
@@ -440,7 +500,15 @@
                                 <input ng-click="sellType('self')" type="radio" name="487" id="sellbyself" ng-model="batch.sellType" ng-checked="batch.sellType == 'self'">
                                 <input ng-click="sellType('self')" type="radio" name="487" id="sellbyself" ng-model="batch.sellType" ng-checked="batch.sellType == 'self'">
                                 <label for="sellbyself" ng-disabled="!batch.selfSellEabled"></label>
                                 <label for="sellbyself" ng-disabled="!batch.selfSellEabled"></label>
                                 <span ng-disabled="!batch.selfSellEabled">店铺自营</span>
                                 <span ng-disabled="!batch.selfSellEabled">店铺自营</span>
-                            </label>
+                            </label>-->
+                            <span>
+                                <img ng-show="batch.sellType == 'self'" src="static/img/upload/daishou-default.png" alt="" ng-click="sellType('UAS')">
+                                <img ng-hide="batch.sellType == 'self'" src="static/img/upload/daishou-active.png" alt="">
+                            </span>
+                            <span ng-disabled="!batch.selfSellEabled">
+                                <img ng-show="batch.sellType == 'UAS'" src="static/img/upload/ziying-default.png" alt="" ng-click="sellType('self')">
+                                <img ng-hide="batch.sellType == 'UAS'" src="static/img/upload/ziying-active.png" alt="">
+                            </span>
                         </div>
                         </div>
                         <div><span ng-if="$$productOn.tab == 'bathOn'">2、</span>请上传已经编辑好的库存表格,选择好上传的文件之后,点击确认上传</div>
                         <div><span ng-if="$$productOn.tab == 'bathOn'">2、</span>请上传已经编辑好的库存表格,选择好上传的文件之后,点击确认上传</div>
                         <div class="upload">
                         <div class="upload">
@@ -574,7 +642,7 @@
                         <!--<div><a ng-click="cancelDelete()">取消</a><a ng-click="deleteBatch(deleteId)">确认</a></div>-->
                         <!--<div><a ng-click="cancelDelete()">取消</a><a ng-click="deleteBatch(deleteId)">确认</a></div>-->
                     <!--</div>-->
                     <!--</div>-->
                 <!--</div>-->
                 <!--</div>-->
-                <div class="com-modal-wrap" ng-if="result && result.total != 0 && !hadImport && $$productOn.tab == 'bathOnPerson' && personMedol">
+                <div class="com-modal-wrap" ng-if="result && !hadImport && $$productOn.tab == 'bathOnPerson' && personMedol">
                     <div class="com-del-box com-mall-del-box">
                     <div class="com-del-box com-mall-del-box">
                         <div class="title">
                         <div class="title">
                             <i ng-click="setPersonMedol()"></i>
                             <i ng-click="setPersonMedol()"></i>
@@ -587,6 +655,18 @@
                         </div>
                         </div>
                     </div>
                     </div>
                 </div>
                 </div>
+                <div class="com-modal-wrap" ng-if="showSelfSellRemindBox">
+                    <div class="type-remind-box com-mall-del-box">
+                        <div class="title">
+                            <i ng-click="setShowSelfSellRemindBox(false, 'no')"></i>
+                        </div>
+                        <div class="result"><span>选择寄售,</span>产品将由优软统一售卖,不会出现在您的自营店铺,是否切换?</div>
+                        <div class="operate">
+                            <a href="javascript:void(0)" ng-click="setShowSelfSellRemindBox(false)">是</a>
+                            <a href="javascript:void(0)" ng-click="setShowSelfSellRemindBox(false, 'no')">否</a>
+                        </div>
+                    </div>
+                </div>
             </div>
             </div>
         </div>
         </div>
     </div>
     </div>