Browse Source

Merge remote-tracking branch 'origin/feature-201815-liusw' into feature-201815-liusw

# Conflicts:
#	src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductAttachService.java
#	src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductAttachServiceImpl.java
yujia 7 years ago
parent
commit
665fc7da34
27 changed files with 1314 additions and 224 deletions
  1. 85 0
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductAttachSubmitController.java
  2. 62 8
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductAttachSubmit.java
  3. 42 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductAttachService.java
  4. 300 1
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductAttachServiceImpl.java
  5. 9 0
      src/main/java/com/uas/platform/b2c/prod/product/component/dao/ComponentDao.java
  6. 18 0
      src/main/java/com/uas/platform/b2c/prod/product/component/modal/Component.java
  7. 6 0
      src/main/java/com/uas/platform/b2c/prod/product/component/service/ComponentService.java
  8. 18 0
      src/main/java/com/uas/platform/b2c/prod/product/component/service/impl/ComponentServiceImpl.java
  9. 192 11
      src/main/webapp/resources/js/admin/controllers/AuditRegulpicListCtrl.js
  10. 39 7
      src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js
  11. 1 0
      src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js
  12. 57 4
      src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js
  13. 1 1
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js
  14. 3 2
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js
  15. 143 142
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js
  16. 1 1
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js
  17. 1 1
      src/main/webapp/resources/view/admin/RegulpicList.html
  18. 2 1
      src/main/webapp/resources/view/admin/audit_component.html
  19. 63 0
      src/main/webapp/resources/view/admin/modal/auditRegulpic_choose_modal.html
  20. 1 1
      src/main/webapp/resources/view/admin/modal/auditRegulpic_modal.html
  21. 135 0
      src/main/webapp/resources/view/admin/modal/auditRegulpicpass_modal.html
  22. 18 16
      src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html
  23. 20 3
      src/main/webapp/resources/view/vendor/forstore/purchaseOffer.html
  24. 79 10
      src/main/webapp/resources/view/vendor/forstore/seekPurchase.html
  25. 11 8
      src/main/webapp/resources/view/vendor/forstore/vendor_material.html
  26. 4 4
      src/main/webapp/resources/view/vendor/forstore/vendor_material_person.html
  27. 3 3
      src/main/webapp/resources/view/vendor/modal/edit_regul_modal.html

+ 85 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductAttachSubmitController.java

@@ -0,0 +1,85 @@
+package com.uas.platform.b2c.prod.commodity.controller;
+
+import com.uas.platform.b2c.prod.commodity.model.ProductAttachSubmit;
+import com.uas.platform.b2c.prod.commodity.service.ProductAttachService;
+import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.model.PageParams;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Created by wangyc on 2018/6/27.
+ *
+ * @version 2018/6/27 10:43 wangyc
+ */
+@RestController
+@RequestMapping("trade/product/attach")
+public class ProductAttachSubmitController {
+
+    private final ProductAttachService productAttachService;
+
+    @Autowired
+    public ProductAttachSubmitController(ProductAttachService productAttachService) {
+        this.productAttachService = productAttachService;
+    }
+
+    /**
+     * 分页获取申请列表
+     * @param params 分页参数
+     * @param keywords 关键词
+     * @param status 状态
+     * @return
+     */
+    @RequestMapping(method = RequestMethod.GET, produces = "application/json")
+    public Page<ProductAttachSubmit> getPageInfo(PageParams params, @RequestParam(value = "keywords", required = false) String keywords, @RequestParam(value = "status", defaultValue = "all") String status) {
+        return productAttachService.getPageInfo(params, keywords, status);
+    }
+
+    /**
+     * 获取单条申请信息
+     * @param submitId 申请id
+     * @return
+     */
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    public ProductAttachSubmit getOne(@RequestParam Long submitId) {
+        return productAttachService.getOne(submitId);
+    }
+
+    /**
+     * 审核通过
+     * @param submit 申请
+     * @return
+     */
+    @RequestMapping(value = "/auditSuccess", method = RequestMethod.POST, produces = "application/json")
+    public ResultMap auditSuccess(@RequestBody ProductAttachSubmit submit) {
+        return productAttachService.auditSuccess(submit);
+    }
+
+    /**
+     * 审核不通过
+     * @param submitId 申请id
+     * @param reason 原因
+     * @return
+     */
+    @RequestMapping(value = "/auditFailed/{id}", method = RequestMethod.POST, produces = "application/json")
+    public ResultMap auditFailed(@PathVariable("id") Long submitId, @RequestBody String reason) {
+        return productAttachService.auditFailed(submitId, reason);
+    }
+
+    /**
+     * 选择确认最终规格书并审核通过
+     * @param chooseAttach 选中规格书
+     * @param submit 申请
+     * @return
+     */
+    @RequestMapping(value = "/chooseAttach", method = RequestMethod.POST, produces = "application/json")
+    public ResultMap chooseAttach(String chooseAttach, @RequestBody ProductAttachSubmit submit) {
+        return productAttachService.chooseAttach(chooseAttach,submit);
+    }
+}

+ 62 - 8
src/main/java/com/uas/platform/b2c/prod/commodity/model/ProductAttachSubmit.java

@@ -3,13 +3,18 @@ package com.uas.platform.b2c.prod.commodity.model;
 import com.uas.platform.b2c.b2b.model.EnterpriseBaseInfo;
 import com.uas.platform.b2c.common.account.model.UserBaseInfo;
 import com.uas.platform.b2c.core.constant.Status;
+import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
+import com.uas.platform.b2c.prod.product.kind.model.KindInfo;
 import java.io.Serializable;
 import java.util.Date;
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
@@ -48,6 +53,11 @@ public class ProductAttachSubmit implements Serializable{
     @Transient
     private Product product;
 
+    /**
+     * 型号
+     */
+    private String code;
+
     /**
      * 创建时间
      */
@@ -69,13 +79,15 @@ public class ProductAttachSubmit implements Serializable{
     /**
      * 提交人信息
      */
-    @Transient
+    @OneToOne(cascade = { CascadeType.REFRESH })
+    @JoinColumn(name = "as_submituu", insertable = false, updatable = false)
     private UserBaseInfo submiter;
 
     /**
      * 提交企业
      */
-    @Transient
+    @OneToOne(cascade = { CascadeType.REFRESH })
+    @JoinColumn(name = "as_submitenuu", insertable = false, updatable = false)
     private EnterpriseBaseInfo submitEn;
 
     /**
@@ -111,9 +123,15 @@ public class ProductAttachSubmit implements Serializable{
     @Column(name = "as_auditenuu")
     private Long auditEnuu;
 
+    /**
+     * 审核人信息
+     */
     @Transient
     private UserBaseInfo auditer;
 
+    /**
+     * 审核企业信息
+     */
     @Transient
     private EnterpriseBaseInfo auditEn;
 
@@ -129,6 +147,18 @@ public class ProductAttachSubmit implements Serializable{
     @Column(name = "as_brandId")
     private Long brandId;
 
+    /**
+     * 商城品牌信息
+     */
+    @Transient
+    private BrandInfo brand;
+
+    /**
+     * 商城类目信息
+     */
+    @Transient
+    private KindInfo kind;
+
     /**
      * 商城规格
      */
@@ -179,6 +209,14 @@ public class ProductAttachSubmit implements Serializable{
         this.product = product;
     }
 
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
     public Date getCreateTime() {
         return createTime;
     }
@@ -291,6 +329,22 @@ public class ProductAttachSubmit implements Serializable{
         this.brandId = brandId;
     }
 
+    public BrandInfo getBrand() {
+        return brand;
+    }
+
+    public void setBrand(BrandInfo brand) {
+        this.brand = brand;
+    }
+
+    public KindInfo getKind() {
+        return kind;
+    }
+
+    public void setKind(KindInfo kind) {
+        this.kind = kind;
+    }
+
     public String getSpec() {
         return spec;
     }
@@ -318,11 +372,11 @@ public class ProductAttachSubmit implements Serializable{
     @Override
     public String toString() {
         return "ProductAttachSubmit{" + "id=" + id + ", productId=" + productId
-            + ", uploadAttach='" + uploadAttach + '\'' + ", product=" + product + ", createTime=" + createTime +
-            ", submitUu=" + submitUu + ", submitEnuu=" + submitEnuu + ", submiter=" + submiter
-            + ", submitEn=" + submitEn + ", uuid='" + uuid + '\'' + ", status=" + status + ", auditTime=" + auditTime +
-            ", auditUu=" + auditUu + ", auditEnuu=" + auditEnuu + ", auditer=" + auditer + ", auditEn=" + auditEn +
-            ", kindId=" + kindId + ", brandId=" + brandId + ", spec='" + spec + '\'' +
-            ", mallAttach='" + mallAttach + '\'' + ", reason='" + reason + '\'' + '}';
+            + ", uploadAttach='" + uploadAttach + '\'' + ", product=" + product + ",code=" + code
+            + ", createTime=" + createTime + ", submitUu=" + submitUu + ", submitEnuu=" + submitEnuu
+            + ", submiter=" + submiter + ", submitEn=" + submitEn + ", uuid='" + uuid + '\'' + ", status=" + status
+            + ", auditTime=" + auditTime + ", auditUu=" + auditUu + ", auditEnuu=" + auditEnuu
+            + ", auditer=" + auditer + ", auditEn=" + auditEn + ", kindId=" + kindId + ", brandId=" + brandId
+            + ", spec='" + spec + '\'' + ", mallAttach='" + mallAttach + '\'' + ", reason='" + reason + '\'' + '}';
     }
 }

+ 42 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductAttachService.java

@@ -1,6 +1,9 @@
 package com.uas.platform.b2c.prod.commodity.service;
 
 import com.uas.platform.b2c.prod.commodity.model.ProductAttachSubmit;
+import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.model.PageParams;
+import org.springframework.data.domain.Page;
 
 import java.util.List;
 
@@ -12,6 +15,22 @@ import java.util.List;
  */
 public interface ProductAttachService {
 
+    /**
+     * 分页获取申请列表
+     * @param params 分页参数
+     * @param keywords 关键词
+     * @param status 状态
+     * @return
+     */
+    Page<ProductAttachSubmit> getPageInfo(PageParams params, String keywords, String status);
+
+    /**
+     * 获取单条申请信息
+     * @param id 申请id
+     * @return
+     */
+    ProductAttachSubmit getOne(Long id);
+
     /**
      * 物料上传规格书申请
      * @param productId 物料id
@@ -28,4 +47,27 @@ public interface ProductAttachService {
      * @return
      */
     List<ProductAttachSubmit> findByProductidsAndStatus(List<Long> productids, Integer status);
+
+    /**
+     * 物料审核通过
+     * @param submit 申请内容
+     * @return
+     */
+    ResultMap auditSuccess(ProductAttachSubmit submit);
+
+    /**
+     * 物料审核不通过
+     * @param submitId 申请id
+     * @param reason 原因
+     * @return
+     */
+    ResultMap auditFailed(Long submitId, String reason);
+
+    /**
+     * 选择确认最终规格书
+     * @param attach
+     * @param productAttachSubmit
+     * @return
+     */
+    ResultMap chooseAttach(String attach, ProductAttachSubmit productAttachSubmit);
 }

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

@@ -1,5 +1,9 @@
 package com.uas.platform.b2c.prod.commodity.service.impl;
 
+import com.uas.platform.b2c.b2b.dao.EnterpriseBaseInfoDao;
+import com.uas.platform.b2c.b2b.model.EnterpriseBaseInfo;
+import com.uas.platform.b2c.common.account.dao.UserBaseInfoDao;
+import com.uas.platform.b2c.common.account.model.UserBaseInfo;
 import com.uas.platform.b2c.core.constant.Status;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.prod.commodity.dao.ProductAttachSubmitDao;
@@ -7,10 +11,39 @@ import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
 import com.uas.platform.b2c.prod.commodity.model.Product;
 import com.uas.platform.b2c.prod.commodity.model.ProductAttachSubmit;
 import com.uas.platform.b2c.prod.commodity.service.ProductAttachService;
+import com.uas.platform.b2c.prod.product.brand.dao.BrandInfoDao;
+import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
 import com.uas.platform.b2c.prod.product.component.modal.Component;
+import com.uas.platform.b2c.prod.product.component.service.ComponentService;
+import com.uas.platform.b2c.prod.product.kind.dao.KindDao;
+import com.uas.platform.b2c.prod.product.kind.dao.KindInfoDao;
+import com.uas.platform.b2c.prod.product.kind.model.Kind;
+import com.uas.platform.b2c.prod.product.kind.model.KindInfo;
+import com.uas.platform.b2c.trade.support.CodeType;
+import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.exception.IllegalOperatorException;
+import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.PageParams;
+import com.uas.platform.core.persistence.criteria.CriterionExpression;
+import com.uas.platform.core.persistence.criteria.CriterionExpression.Operator;
+import com.uas.platform.core.persistence.criteria.LogicalExpression;
+import com.uas.platform.core.persistence.criteria.PredicateUtils;
+import com.uas.platform.core.persistence.criteria.SimpleExpression;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.Sort.Direction;
+import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
@@ -31,12 +64,130 @@ public class ProductAttachServiceImpl implements ProductAttachService {
 
     private final ComponentDao componentDao;
 
+    private final BrandInfoDao brandInfoDao;
+
+    private final KindInfoDao kindInfoDao;
+
+    private final ComponentService componentService;
+
+    private final KindDao kindDao;
+
+    private final EnterpriseBaseInfoDao enterpriseBaseInfoDao;
+
+    private final UserBaseInfoDao userBaseInfoDao;
+
     @Autowired
     public ProductAttachServiceImpl(ProductDao productDao, ProductAttachSubmitDao productAttachSubmitDao,
-        ComponentDao componentDao) {
+        ComponentDao componentDao, BrandInfoDao brandInfoDao, KindInfoDao kindInfoDao, ComponentService componentService, KindDao kindDao, EnterpriseBaseInfoDao enterpriseBaseInfoDao, UserBaseInfoDao userBaseInfoDao) {
         this.productDao = productDao;
         this.productAttachSubmitDao = productAttachSubmitDao;
         this.componentDao = componentDao;
+        this.brandInfoDao = brandInfoDao;
+        this.kindInfoDao = kindInfoDao;
+        this.componentService = componentService;
+        this.kindDao = kindDao;
+        this.enterpriseBaseInfoDao = enterpriseBaseInfoDao;
+        this.userBaseInfoDao = userBaseInfoDao;
+    }
+
+    @Override
+    public Page<ProductAttachSubmit> getPageInfo(PageParams params, String keywords, String status) {
+        final PageInfo pageInfo = new PageInfo(params);
+
+        // 过滤状态
+        Integer statusCode = 0;
+        switch (status) {
+            case "all" : break;
+            case "unaudit" : statusCode = Status.UNAUDIT.value(); break;
+            case "audited" : statusCode = Status.AUDITED.value(); break;
+            case "notallow" : statusCode = Status.NOTALLOW.value(); break;
+        }
+
+        if (pageInfo.getSort() == null) {
+            pageInfo.sorting(Direction.DESC, "createTime");
+        }
+
+        if (statusCode != 0) {
+            pageInfo.expression(new SimpleExpression("status", statusCode, Operator.EQ));
+        }
+
+        // 过滤提交人姓名、企业
+        if (!StringUtils.isEmpty(keywords)) {
+            SimpleExpression submiterName = new SimpleExpression("submiter.userName", keywords, CriterionExpression.Operator.LIKE);
+            SimpleExpression submiterEnName = new SimpleExpression("submitEn.enName", keywords, CriterionExpression.Operator.LIKE);
+            SimpleExpression[] simpleExpressions = new SimpleExpression[]{submiterName, submiterEnName};
+            LogicalExpression logicalExpression = PredicateUtils.or(simpleExpressions);
+            pageInfo.expression(logicalExpression);
+        }
+
+        Page<ProductAttachSubmit> page = productAttachSubmitDao.findAll(new Specification<ProductAttachSubmit>() {
+            @Override
+            public Predicate toPredicate(Root<ProductAttachSubmit> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
+                query.where(pageInfo.getPredicates(root, query, cb));
+                return null;
+            }
+        }, pageInfo);
+
+        List<ProductAttachSubmit> submits = page.getContent();
+        if (!CollectionUtils.isEmpty(submits)) {
+            for (ProductAttachSubmit submit : submits) {
+                submit = completeReturnSubmit(submit);
+            }
+        }
+        return new PageImpl<>(submits, pageInfo, page.getTotalElements());
+    }
+
+    @Override
+    public ProductAttachSubmit getOne(Long id) {
+        ProductAttachSubmit productAttachSubmit = productAttachSubmitDao.findOne(id);
+        if (productAttachSubmit == null) {
+            throw new IllegalOperatorException("申请不存在,请重新确认申请信息");
+        } else {
+            return completeReturnSubmit(productAttachSubmit);
+        }
+    }
+
+    /**
+     * 补全返回的申请信息
+     * @param submit 申请信息
+     * @return
+     */
+    private ProductAttachSubmit completeReturnSubmit(ProductAttachSubmit submit) {
+        if (submit.getAuditEnuu() != null) {
+            EnterpriseBaseInfo enterpriseBaseInfo = enterpriseBaseInfoDao.findOne(submit.getSubmitEnuu());
+            if (enterpriseBaseInfo != null) {
+                submit.setAuditEn(enterpriseBaseInfo);
+            }
+        }
+
+        if (submit.getAuditUu() != null) {
+            UserBaseInfo userBaseInfo = userBaseInfoDao.findUserByUserUU(submit.getSubmitUu());
+            if (userBaseInfo != null) {
+                submit.setAuditer(userBaseInfo);
+            }
+        }
+
+        if (submit.getProductId() != null) {
+            Product product = productDao.findOne(submit.getProductId());
+            if (product != null) {
+                submit.setProduct(product);
+            }
+        }
+
+        if (submit.getKindId() != null) {
+            KindInfo kindInfo = kindInfoDao.findOne(submit.getKindId());
+            if (kindInfo != null) {
+                submit.setKind(kindInfo);
+            }
+        }
+
+        if (submit.getBrandId() != null) {
+            BrandInfo brandInfo = brandInfoDao.findOne(submit.getBrandId());
+            if (brandInfo != null) {
+                submit.setBrand(brandInfo);
+            }
+        }
+        return submit;
     }
 
     @Override
@@ -75,6 +226,7 @@ public class ProductAttachServiceImpl implements ProductAttachService {
         submit.setProductId(product.getId());
         submit.setProduct(product);
         submit.setCreateTime(new Date());
+        submit.setCode(product.getPcmpcode());
         if (SystemSession.getUser().getUserUU() != null && SystemSession.getUser().getEnterprise() != null) {
             submit.setSubmitUu(SystemSession.getUser().getUserUU());
             submit.setSubmitEnuu(SystemSession.getUser().getEnterprise().getUu());
@@ -103,4 +255,151 @@ public class ProductAttachServiceImpl implements ProductAttachService {
     public List<ProductAttachSubmit> findByProductidsAndStatus(List<Long> productids, Integer status) {
         return productAttachSubmitDao.findByProductIdsAndStatus(productids, status);
     }
+
+    @Override
+    public ResultMap auditSuccess(ProductAttachSubmit submit) {
+        if (submit.getId() == null) {
+            return new ResultMap(CodeType.NOT_EXiST, "此申请不存在,请重新确认申请信息");
+        }
+
+        ProductAttachSubmit exsitedSubmit = productAttachSubmitDao.findOne(submit.getId());
+        if (exsitedSubmit == null) {
+            return new ResultMap(CodeType.NOT_EXiST, "此申请不存在,请重新确认申请信息");
+        } else {
+            exsitedSubmit.setBrandId(submit.getBrandId());
+            exsitedSubmit.setKindId(submit.getKindId());
+            exsitedSubmit.setSpec(submit.getSpec());
+            if (StringUtils.isEmpty(exsitedSubmit.getUploadAttach())) {
+                return new ResultMap(CodeType.NO_INFO, "此申请规格书为空,请重新确认申请信息");
+            }
+            if (exsitedSubmit.getBrandId() == null || exsitedSubmit.getKindId() == null) {
+                return new ResultMap(CodeType.NO_INFO, "商城类目、品牌不完善,请重新确认申请信息");
+            }
+            BrandInfo brandInfo = brandInfoDao.findOne(exsitedSubmit.getBrandId());
+            if (brandInfo == null) {
+                return new ResultMap(CodeType.PARAMETER_ERROR, "商城品牌不存在,请重新填写商城品牌");
+            }
+            KindInfo kindInfo = kindInfoDao.findOne(exsitedSubmit.getKindId());
+            if (kindInfo == null) {
+                return new ResultMap(CodeType.PARAMETER_ERROR, "商城物料名称(类目)不存在,请重新填写商城物料名称(类目)");
+            }
+
+            // 标准型号
+            if (StringUtils.isEmpty(exsitedSubmit.getUuid())) {
+                Component component = componentDao.findByUuid(exsitedSubmit.getUuid());
+                // 实际为非标物料
+                if (component == null) {
+                    return new ResultMap(CodeType.ERROR_STATE, "该物料匹配的标准器件不存在,请重新确认该物料信息");
+                // 标准物料无规格书,更新规格书
+                } else if (component.getAttach() == null){
+                    component = addComponent(exsitedSubmit, component.getId());
+                    return ResultMap.success(auditSubmit(exsitedSubmit));
+                // 标准物料有规格书,返回两规格书
+                } else {
+                    return ResultMap.success(componentAttachNotNull(exsitedSubmit, component.getAttach()));
+                }
+            // 非标型号
+            } else {
+                List<Component> components = componentDao.findByBrandidAndCode(submit.getBrandId(), submit.getCode());
+                if (!CollectionUtils.isEmpty(components)) {
+                    Component component = components.get(0);
+                    if (component.getAttach() != null) {
+                        return ResultMap.success(componentAttachNotNull(exsitedSubmit, component.getAttach()));
+                    } else {
+                        component = addComponent(exsitedSubmit, component.getId());
+                        return ResultMap.success(auditSubmit(exsitedSubmit));
+                    }
+                } else {
+                    Component component = addComponent(exsitedSubmit, null);
+                    return ResultMap.success(auditSubmit(exsitedSubmit));
+                }
+            }
+        }
+    }
+
+    /**
+     * 完善审核信息
+     * @param submit
+     * @return
+     */
+    private ProductAttachSubmit auditSubmit(ProductAttachSubmit submit) {
+        submit.setStatus(Status.AUDITED.value());
+        submit.setAuditTime(new Date());
+        submit.setAuditUu(SystemSession.getUser().getUserUU());
+        submit.setAuditEnuu(SystemSession.getUser().getEnterprise().getUu());
+        return productAttachSubmitDao.save(submit);
+    }
+
+    /**
+     * 器件规格书不为空时,返回两个规格书
+     * @param submit
+     * @param attach
+     * @return
+     */
+    private Map<String, String> componentAttachNotNull(ProductAttachSubmit submit, String attach) {
+        submit.setMallAttach(attach);
+        productAttachSubmitDao.save(submit);
+
+        // 返回标准器件规格书、用户上传规格书
+        Map<String, String> map = new HashMap<>();
+        map.put("uploadAttach", submit.getUploadAttach());
+        map.put("mallAttach", attach);
+
+        return map;
+    }
+
+    @Override
+    public ResultMap auditFailed(Long submitId, String reason) {
+        ProductAttachSubmit submit = productAttachSubmitDao.findOne(submitId);
+        if (submit == null) {
+            return new ResultMap(CodeType.NOT_EXiST, "此申请不存在,请重新确认申请信息");
+        } else if (submit.getStatus() == null || Status.UNAUDIT.value() != submit.getStatus()){
+            return new ResultMap(CodeType.NOT_PERMIT, "此申请不为待审核状态,请重新确认申请信息");
+        } else {
+            submit.setStatus(Status.NOTALLOW.value());
+            submit.setAuditTime(new Date());
+            if (SystemSession.getUser() == null || SystemSession.getUser().getEnterprise() == null) {
+                return new ResultMap(CodeType.NO_AUTHORITY, "操作人员信息不可为空");
+            }
+            submit.setAuditUu(SystemSession.getUser().getUserUU());
+            submit.setAuditEnuu(SystemSession.getUser().getEnterprise().getUu());
+            submit.setReason(reason);
+            submit = productAttachSubmitDao.save(submit);
+
+            return ResultMap.success(submit);
+        }
+
+    }
+
+    @Override
+    public ResultMap chooseAttach(String attach, ProductAttachSubmit productAttachSubmit) {
+        return null;
+    }
+
+    private Component addComponent(ProductAttachSubmit submit, Long componentId) {
+        // 更新器件
+        if (componentId != null) {
+            Component component = componentDao.findOne(componentId);
+            if (component != null) {
+                component.setAttach(submit.getUploadAttach());
+                component.setVersion((short) ((component.getVersion() == null ? 0 : component.getVersion()) + 1));
+                component.setModifyTime(new Date());
+                component.setDescription(submit.getSpec());
+                return componentDao.save(component);
+            }
+            return null;
+        // 新增器件
+        } else {
+            Component component = new Component(submit);
+            component.setUuid(componentService.createUuid(component));
+            component = componentDao.save(component);
+
+            // 更新类目uuid后缀游标,以便之后生成uuid
+            Kind kind = kindDao.findOne(component.getKindid());
+            kind.setComponentsuffix(kind.getComponentsuffix() + 1);
+            kindDao.save(kind);
+
+            return component;
+        }
+    }
 }

+ 9 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/dao/ComponentDao.java

@@ -59,6 +59,15 @@ public interface ComponentDao extends JpaSpecificationExecutor<Component>, JpaRe
 	@QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value = "true") })
 	public List<Component> findByCodeAndBrandid(@Param("code") String code, @Param("brandid") Long brandid);
 
+	/**
+	 * 根据品牌id、原厂型号获取器件信息(因联合索引缘故,brandid作为前置索引)
+	 * @param brandid 品牌id
+	 * @param code 原厂型号
+	 * @return
+	 */
+	@Query("select c from Component c where c.brandid = :brandid and c.code = :code")
+	public List<Component> findByBrandidAndCode(@Param("brandid") Long brandid, @Param("code") String code);
+
 	/**
 	 * 根据原厂型号code和类目id(kindId)查找器件
 	 * 

+ 18 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/modal/Component.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2c.prod.product.component.modal;
 
+import com.uas.platform.b2c.prod.commodity.model.ProductAttachSubmit;
 import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
 import com.uas.platform.b2c.prod.product.kind.model.KindInfo;
 import com.uas.platform.b2c.prod.product.property.model.PropertyValue;
@@ -783,4 +784,21 @@ public class Component implements Serializable {
 		}
 		this.properties = propertyValues;
 	}
+
+	/**
+	 * 利用物料规格书申请生成器件
+	 * @param submit 申请信息
+	 */
+	public Component(ProductAttachSubmit submit) {
+		Component component = new Component();
+		Date now = new Date();
+		component.setBrandid(submit.getBrandId());
+		component.setAttach(submit.getUploadAttach());
+		component.setCode(submit.getCode());
+		component.setCreateTime(now);
+		component.setDescription(submit.getSpec());
+		component.setKindid(submit.getKindId());
+		component.setModifyTime(now);
+		component.setVersion((short) 1);
+	}
 }

+ 6 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/service/ComponentService.java

@@ -261,4 +261,10 @@ public interface ComponentService {
 	 */
 	Component getComponentBySome(Long brandId, String cmpCode);
 
+	/**
+	 * 创建uuid
+	 * @param component 器件信息
+	 * @return
+	 */
+	String createUuid(Component component);
 }

+ 18 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/service/impl/ComponentServiceImpl.java

@@ -587,4 +587,22 @@ public class ComponentServiceImpl implements ComponentService {
 		}
 		return null;
 	}
+
+	@Override
+	public String createUuid(Component component) {
+		if (component.getKindid() != null) {
+			Kind kind = kindDao.findOne(component.getKindid());
+			if (kind == null) {
+				throw new IllegalOperatorException("类目不存在");
+			} else {
+				String suffixStr = "";
+				for (int i = 0; i < 8 - String.valueOf(kind.getComponentsuffix()).length(); i++) {
+					suffixStr = suffixStr + "0";
+				}
+				return kind.getComponentPrefix() + suffixStr + kind.getComponentsuffix();
+			}
+		} else {
+			throw new IllegalOperatorException("器件类目为空");
+		}
+	}
 }

+ 192 - 11
src/main/webapp/resources/js/admin/controllers/AuditRegulpicListCtrl.js

@@ -1,10 +1,9 @@
 define([ 'app/app' ], function(app) {
   //品牌审批
-  app.register.controller('AuditRegulpicListCtrl', ['$scope', '$anchorScroll', '$location', '$modal', 'BaseService', 'SessionService', 'toaster', 'ngTableParams', 'StoreInfo', 'StoreCms', '$state', function ($scope, $anchorScroll, $location, $modal, BaseService, SessionService, toaster, ngTableParams, StoreInfo, StoreCms, $state) {
+  app.register.controller('AuditRegulpicListCtrl', ['$scope', '$modal', 'BaseService', 'toaster', 'ngTableParams', 'StoreInfo', function ($scope, $modal, BaseService, toaster, ngTableParams, StoreInfo) {
 
     $scope.storeType = 'ALL';
     $scope.isShow = 'ALL';
-
     $scope.storeTableParams = new ngTableParams({
       page : 1,
       count : 10,
@@ -65,18 +64,18 @@ define([ 'app/app' ], function(app) {
     /**
      * 通过
      */
-    $scope.passBtnFn = function() {}
-
-    /**
-    * 不通过
-    */
-    $scope.cancelBtnFn = auditUnpass
-
+    $scope.passBtnFn = function(item) {
+      openPassModal(item).then(function (data) {
+        passAudit(data, item)
+      }, function (error) {
+        console.log(error);
+      });
+    }
 
     /**
      * 审核未通过开铺申请
      */
-    function auditUnpass(list) {
+    $scope.cancelBtnFn = function() {
       openReasonModal().then(function (reason) {
         NopassAudit(list, reason)
       }, function (error) {
@@ -95,11 +94,61 @@ define([ 'app/app' ], function(app) {
     }
 
     /**
-     * 审核不通过
+     * 审核不通过 回调
      */
     function NopassAudit(list, reason) {
 
     }
+
+    /**
+     * 审核通过 回调
+     */
+    function passAudit(data, item) {
+      // 是否需要打开规格书选择项
+      openRegulChooseModal(data, item).then(function (reason) {
+        // 刷新页面
+        $scope.storeTableParams.page(1);
+        $scope.storeTableParams.reload();
+      }, function (error) {
+        console.log(error);
+      });
+    }
+
+    /**
+     * 打开审核通过模态框
+     */
+    function openPassModal(item) {
+      return $modal.open({
+        templateUrl: 'static/view/admin/modal/auditRegulpicpass_modal.html',
+        controller: 'auditRegulpicpassController',
+        size : 'md',
+        resolve : {
+          item : function() {
+            return item;
+          }
+        }
+      }).result;
+    }
+
+
+    /**
+     * 打开规格书选择模态框
+     */
+    function openRegulChooseModal(data,item) {
+      return $modal.open({
+        templateUrl: 'static/view/admin/modal/auditRegulpic_choose_modal.html',
+        controller: 'auditRegulpicChooseController',
+        size : 'md',
+        resolve : {
+          item : function() {
+            return item;
+          },
+          responseData: function() {
+            return data;
+          }
+        }
+      }).result;
+    }
   }]);
 
   /**
@@ -128,4 +177,136 @@ define([ 'app/app' ], function(app) {
       $modalInstance.dismiss();
     }
   }]);
+
+  /**
+   * 审核通过模态框控制器
+   */
+  app.register.controller('auditRegulpicpassController', ['$scope', '$modalInstance', 'toaster', 'Commodity', 'Search','item', function ($scope, $modalInstance, toaster, Commodity, Search, item) {
+
+    $scope.kindPojo = {
+      first: '请选择一级类目',
+      second: '请选择二级类目',
+      third: '请选择三级类目'
+    }
+    $scope.saveReason = saveReason;
+    $scope.dismiss = dismiss;
+    $scope.BrandList = []
+    $scope.reason = null;
+    $scope.keyword = ''
+    $scope.spec = ''
+    $scope.item = item
+    /**
+     * 品牌联想词
+     */
+    $scope.onBrandChange = function(name) {
+      if (name === '') {
+        $scope.BrandList = []
+        return false
+      }
+      if ((/[^\x00-\xff]/g).test(name)) {
+        $scope.keyword = ''
+        $scope.BrandList = []
+        return false
+      }
+      $scope.BrandList = getSimilarBrands(name).$$state
+    }
+    /**
+     * 品牌联想词失去焦点
+     */
+    $scope.onBrandBlur = function(name) {
+      if (name === '') {
+        $scope.BrandList = []
+        return false
+      }
+    }
+    /**
+     * 保存不通过原因
+     */
+    function saveReason() {
+      if (!$scope.keyword || $scope.keyword === '') {
+        toaster.pop('error', '品牌未必填项');
+        return ;
+      }
+      if ($scope.kindPojo.first === '请选择一级类目') {
+        toaster.pop('error', '商城类目未选择');
+        return ;
+      }
+      if ($scope.kindPojo.second === '请选择二级类目') {
+        toaster.pop('error', '商城类目未选择');
+        return ;
+      }
+      if ($scope.kindPojo.third === '请选择三级类目') {
+        toaster.pop('error', '商城类目未选择');
+        return ;
+      }
+      // 申请品牌后,返回
+      $modalInstance.close({});
+    }
+    /**
+     * 选择品牌联想词
+     */
+    $scope.setBrand = function(item) {
+      $scope.keyword = item
+      $scope.BrandList = []
+    }
+
+    /**
+     * 关闭模态框
+     */
+    function dismiss() {
+      $modalInstance.dismiss();
+    }
+
+    var initKindDataInfo = function () {
+      Commodity.getAllKindInfo({}, function (data) {
+        $scope.kindInfo = data[0].children;
+      })
+    };
+    initKindDataInfo();
+
+    /**
+     * 获取品牌联想词
+     *
+     * @param name    品牌名称
+     */
+    function getSimilarBrands(name) {
+      if (name) {
+        return Search.getSimilarBrands({keyword: name}).$promise.then(
+            function (data) {
+              return data.map(function (item) {
+                return item;
+              });
+            });
+      }
+    }
+  }]);
+
+  /**
+   * 规格书选项
+   */
+  app.register.controller('auditRegulpicChooseController',['$scope', '$modalInstance', 'toaster', 'responseData', 'item', function($scope, $modalInstance, toaster, responseData, item) {
+    $scope.saveReason = saveReason;
+    $scope.dismiss = dismiss;
+    $scope.checked = 'store';
+
+    /**
+     * 保存不通过原因
+     */
+    function saveReason() {
+      // if (!$scope.reason || $scope.reason === '') {
+      //   toaster.pop('error', '请填写审核不通过原因');
+      //   return ;
+      // }
+      // 请求保存规格书接口
+      alert($scope.checked)
+      $modalInstance.close($scope.reason);
+    }
+
+    /**
+     * 关闭模态框
+     */
+    function dismiss() {
+      $modalInstance.dismiss();
+    }
+  }])
 });

+ 39 - 7
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -40,6 +40,7 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
           }
           seekPurchase.getSeekUrl({}, function(data) {
             var seekUrl = data.url;
+              // var seekUrl = 'http://10.1.51.82:24002';
             /*$scope.tab = 'waitOffer';*/
             $scope.toogleTab = function (tab) {
               $scope.vendorType = 'all'
@@ -80,7 +81,16 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
                     }).success(function (data) {
                       params.total(data.totalElements);
                       $defer.resolve(data.content);
+                        // for (var i = 0; i < data.content.length; i++) {
+                        //     data.content[i].replaceQutations = [];
+                        //     for (var j = 0; j < data.content[i].qutations.length; j++) {
+                        //         if (data.content[i].qutations[j].isReplace) {
+                        //             data.content[i].replaceQutations.push(data.content[i].qutations[j])
+                        //         }
+                        //     }
+                        // }
                       $scope.seekListData = data;
+
                     }).error(function (response) {
                       toaster.pop('error', response);
                     });
@@ -581,16 +591,38 @@ define(['app/app', 'clipboard', 'QRCode'], function (app, clipboard, QRCode) {
 
           $scope.offerCount = 0;
           $scope.goodsCount = 0;
+              $scope.replaceOfferCount = 0;
           $scope.currentSeek = {};
-          $scope.setSeekStatus = function (seek, status) {
-            $scope.offerCount = seek.offerAmount;
+          $scope.setSeekStatus = function (seek, status, isDisabled) {
+              if (isDisabled) {
+                  return;
+              }
+              if (seek.id != $scope.currentSeek.id) {
+                  $scope.isInit = true;
+                  $scope.goodsCount = 0;
+                  $scope.offerCount = 0;
+                  $scope.replaceOfferCount = 0;
+              }
+              if (seek.qutations && seek.qutations.length && $scope.isInit) {
+                  for (var i = 0; i < seek.qutations.length; i++) {
+                      if (seek.qutations[i].isReplace == 1) {
+                          $scope.replaceOfferCount++;
+                      } else {
+                          $scope.offerCount++;
+                      }
+                  }
+                  $scope.isInit = false;
+              }
+            // $scope.offerCount = seek.offerAmount;
             $scope.currentSeek = seek;
-            seekPurchase.getMallGoodsList({code:seek.cmpCode, brand: seek.inbrand}, function (data) {
-              $scope.goods = data;
-              $scope.goodsCount = data.length;
-            });
+              if (!seek.$status || seek.$status != 1) {
+                  seekPurchase.getMallGoodsList({code:seek.cmpCode, brand: seek.inbrand}, function (data) {
+                      $scope.goods = data;
+                      $scope.goodsCount = data.length;
+                  });
+              }
             // 查看报价
-            if (status == 2 && $scope.offerCount != 0) {
+            if ((!seek.$status || seek.$status < 2) || (status == 2 && $scope.offerCount != 0) || (status == 3 && $scope.replaceOfferCount != 0)) {
                 Authority.getAuthority({resUrl: '/authInquiry/inquiry/getQuotations'}, function (data) {
                     if (data.status == 'fail') {
                         toaster.pop('error', data.msg || '系统错误');

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

@@ -6,6 +6,7 @@ define(['app/app'], function(app) {
         $scope.offer = {};
       seekPurchase.getSeekUrl({}, function(data) {
         var seekUrl = data.url;
+        //   var seekUrl = 'http://10.1.51.82:24002';
         // 获取我的报价列表
         $scope.seekPurchaseTableParams = new ngTableParams({
           pageNumber: 1,

+ 57 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -7,21 +7,46 @@ define(['app/app'], function (app) {
           document.title = '求购询价-优软商城';
           $rootScope.active = 'vendor_seek_purchase';
           $scope.seekPurchaseRate = {};
+          $scope.sayType = 'current'; // 报价类型,current为当前,replace为替代料
           seekPurchase.getSeekUrl({}, function(data) {
             var seekUrl = data.url;
+            // var seekUrl = 'http://10.1.51.82:24002';
           $scope.initInquiryItem = function () {
             $scope.validSayPrice = {
               leadtime: false,
               repliesPrice: false,
-              repliesLapQty: false
+              repliesLapQty: false,
+              replaceBrand: false,
+              replaceCmpCode: false,
+              replaceSpec: false
             }
           }
           $scope.initInquiryItem();
 
+            $scope.setSayType = function (type) {
+              if (type == 'current') {
+                delete $scope.inquiryItem.replaceBrand;
+                delete $scope.inquiryItem.replaceCmpCode;
+                delete $scope.inquiryItem.replaceSpec;
+                // $scope.inquiryItem.isReplace = null;
+              }
+              $scope.inquiryItem.leadtime = '';
+              for (var i = 0; i < $scope.seekCurrency.length; i++) {
+                $scope.seekCurrency[i] = 'RMB';
+              }
+              $scope.inquiryItem.replies = [
+                {
+                  lapQty: '',
+                  price: ''
+                }
+              ];
+              $scope.sayType = type;
+            }
+
             //卖家待报价推送信息,self为我的商机,all为公司商机
             if ($location.search().type === '1') {
               $scope.vendorType = 'self';
-              console.log(1)
+              // console.log(1)
             } else {
               $scope.vendorType = 'all';
             }
@@ -210,6 +235,9 @@ define(['app/app'], function (app) {
               if ($scope.vendorType !== 'noOppor') {
                   $scope.inquiryItem.id = $scope.inquiryItem.itemId;
               }
+              if ($scope.sayType == 'replace') {
+                $scope.inquiryItem.isReplace = 1;
+              }
               // $scope.inquiryItem.id = $scope.inquiryItem.itemId;
               if (seekUrl == 'https://api-inquiry.usoftmall.com') {
                 seekPurchase.saveOfferProd($scope.inquiryItem, function (data) {
@@ -342,7 +370,7 @@ define(['app/app'], function (app) {
 
           $scope.onLeadtimeInput = function () {
             var time = $scope.inquiryItem.leadtime.toString();
-            console.info();
+            // console.info();
             if (time.length > 3) {
               $scope.inquiryItem.leadtime = Number(time.substring(0, 3));
             }
@@ -355,6 +383,30 @@ define(['app/app'], function (app) {
               $scope.validSayPrice.leadtime = true;
             }
           }
+            $scope.onReplaceBrandBlur = function () {
+              if (!$scope.inquiryItem.replaceBrand || $scope.inquiryItem.replaceBrand.length == 0) {
+                $scope.validSayPrice.replaceBrand = false;
+                toaster.pop('error', '请填写替代物料品牌');
+              } else {
+                $scope.validSayPrice.replaceBrand = true;
+              }
+            }
+            $scope.onReplaceCmpCodeBlur = function () {
+              if (!$scope.inquiryItem.replaceCmpCode || $scope.inquiryItem.replaceCmpCode.length == 0) {
+                $scope.validSayPrice.replaceCmpCode = false;
+                toaster.pop('error', '请填写替代物料型号');
+              } else {
+                $scope.validSayPrice.replaceCmpCode = true;
+              }
+            }
+            $scope.onReplaceSpecBlur = function () {
+              if (!$scope.inquiryItem.replaceSpec || $scope.inquiryItem.replaceSpec.length == 0) {
+                $scope.validSayPrice.replaceSpec = false;
+                toaster.pop('error', '请填写替代物料规格');
+              } else {
+                $scope.validSayPrice.replaceSpec = true;
+              }
+            }
           $scope.onReplyLapQtyBlur = function (index) {
             var lapQty = $scope.inquiryItem.replies[index].lapQty;
             var limitDownObj = $scope.getLimitDownQty();
@@ -436,12 +488,13 @@ define(['app/app'], function (app) {
           }*/
 
           $scope.checkValid = function () {
+            var validReplace = $scope.sayType == 'replace' ? $scope.validSayPrice.replaceBrand && $scope.validSayPrice.replaceCmpCode && $scope.validSayPrice.replaceSpec : true;
             for (var i = 0; i < $scope.inquiryItem.replies.length; i++) {
               if (!$scope.inquiryItem.replies[i].lapQty || !$scope.inquiryItem.replies[i].price) {
                 return false;
               }
             }
-            return $scope.validSayPrice.leadtime && $scope.validSayPrice.repliesLapQty && $scope.validSayPrice.repliesPrice;
+            return $scope.validSayPrice.leadtime && $scope.validSayPrice.repliesLapQty && $scope.validSayPrice.repliesPrice && validReplace;
           }
 
           $scope.setReplies = function (type, index) {

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

@@ -3384,7 +3384,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
       var _wl = (angular.element('body').width() - angular.element('.edit-replace-box').width()) / 2
       var _bl = angular.element(window).height() * 0.2  + angular.element('.edit-replace-box .title').height()
       var Y = _bl + _hl + 28 - _scrollTop
-      if(type == 'brand') {
+      if(type == 'code') {
         X = _wl + $event.currentTarget.offsetLeft - 11
         el.css({
           right: X,

+ 3 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js

@@ -2806,11 +2806,12 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 
     function caleUllist($event,type,key,el){
       var _scrollTop = angular.element('.edit-replace-box .content').scrollTop()
+      var Y, X;
       var _hl = angular.element('.edit-replace-box .content .content-line')[key] ? angular.element('.edit-replace-box .content .content-line')[key].offsetTop : 0
       var _wl = (angular.element('body').width() - angular.element('.edit-replace-box').width()) / 2
       var _bl = angular.element(window).height() * 0.2  + angular.element('.edit-replace-box .title').height()
-      var Y = _bl + _hl + 28 - _scrollTop, X
-      if(type == 'brand') {
+      var Y = _bl + _hl + 28 - _scrollTop
+      if(type == 'code') {
         X = _wl + $event.currentTarget.offsetLeft - 11
         el.css({
           right: X,

+ 143 - 142
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -65,148 +65,6 @@ define(['app/app'], function (app) {
             if (!$scope.isYrscStore && !$scope.isCONSIGNMENT) {
                 $scope.storeType = 'other';
                 window.sessionStorage.setItem('storeType', $scope.storeType);
-                $scope.orderTableParams = new ngTableParams($scope.tableParams, {
-                    total: 0,
-                    getData: function ($defer, params) {
-                        $scope.loading = true;
-                        $scope.paginationParams = params;
-                        var param = BaseService.parseParams(params.url());
-                        param.keyword = $scope.keyword ? $scope.keyword : null;
-                        if ($scope.childStatus!==''){
-                            param.status = $scope.childStatus;
-                        }else{
-                            param.status = getState();
-                        }
-                        param.page = $scope.param.page;
-                        // param.startMils = $scope.startMils;
-                        // param.endMils = $scope.endMils;
-                        param.exceptionType = window.sessionStorage.getItem('exceptionType');
-                        param.storeType = $scope.storeType;
-
-                        param.startMils = $scope.startDate ? $scope.startDate.getTime() : null;
-                        param.endMils = $scope.endDate ? $scope.endDate.getTime() : null;
-                        if (param.startMils != null && param.endMils != null){
-                            if (param.startMils > param.endMils){
-                                alert("开始时间不得超过结束时间!");
-                                return;
-                            }
-                        }
-
-                        Purchase.getByStatusAndInternal(param, function (page) {
-                            if (page) {
-                                if (!$scope.startDate && !$scope.endDate && !$scope.keyword) {
-                                    if ($scope.childStatus == '') {
-                                        if (page.content) {
-                                            angular.forEach(page, function (value, key) {
-                                                if (key == 'all' || key == 'tobeconfirmed' || key == 'comfirmed' || key == 'inbound'
-                                                    || key == 'tobepaid' || key == 'completed' || key == 'unavailable' || key == 'toBeReviewed') {
-                                                    if (!$scope.counts) {
-                                                        $scope.counts = {};
-                                                    }
-                                                    $scope.counts[key] = value;
-                                                }
-                                                $scope.counts[$scope.status] = page.totalElements;
-                                            });
-                                        } else {
-                                            $scope.counts = {};
-                                        }
-                                    }
-                                }
-
-                                $scope.purchases = page.content;
-                                angular.forEach($scope.purchases, function (data) {
-                                    if (data.installmentId && data.installment.status == 504) {
-                                        angular.forEach(data.installment.installmentDetails, function (list) {
-                                            if (list.detno == data.installment.currentNo) {
-                                                if (list.status == 504) {
-                                                    data.installmentDetailPaid = true;
-                                                }
-                                            }
-                                        })
-                                    }
-                                    // 循环判断一期都没有付款并且延期的
-                                    if (data.installmentId && data.installment.status == 503) {
-                                        angular.forEach(data.installment.installmentDetails, function (detailslist) {
-                                            var nowTime = new Date();
-                                            if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
-                                                data.Overtime = true;
-                                            }
-                                        })
-                                    }
-                                    // 循环判断已付款未收款卖家可取消的
-
-                                });
-                                $scope.requestOver = 0;
-                                angular.forEach($scope.purchases, function (order) {
-                                    Rate.getRateVendor({orderId:order.orderid},{},function (data) {
-                                        if (data.data){
-                                            order.isEachRate = true;
-                                        }
-                                    });
-                                    Rate.getRateBuyer({orderId:order.orderid},{},function (data) {
-                                        if(data.data){
-                                            if (data.data.vendorRateTime){
-                                                order.isFirstRate = true; // 是否完成初评
-                                            }
-                                            if (data.data.vendorAfterRateTime){
-                                                order.isAfterRate = true; // 是否完成追评
-                                            }
-                                        }
-                                        $scope.requestOver += 1;
-                                    });
-                                    angular.forEach(JSON.parse(order.statushistory),function (data) {
-                                        if (data.status == 520){
-                                            order.complete = data.time;
-                                        }
-                                    });
-                                });
-                                getExMsgState(); // 获取异常消息状态
-                                getReturnByPurchaseIds(); // 获取退货单信息
-
-                                $scope.orderLength = page.numberOfElements;
-                                $scope.pageParams.content = page.content;
-                                $scope.pageParams.number = page.number;
-                                // 分页部分有关内容
-                                $scope.param.currentPage = page.number;
-                                $scope.AllOrderInfo = page;
-                                $scope.acculatePages(page.number, page.totalPages);
-
-                                $scope.pageParams.totalElements = page.totalElements;
-                                $scope.pageParams.totalPages = page.totalPages;
-                                params.total(page.totalElements);
-                                $defer.resolve(page.content);
-                                $scope.orderLength = page.content.length;
-
-                                angular.forEach(page.content, function (order) {
-                                    var purchaseDetails = angular.copy(order.purchaseDetails);
-                                    // 获取型号数量
-                                    var components = {};
-                                    angular.forEach(purchaseDetails, function (purchaseDetail) {
-                                        components[purchaseDetail.uuid]++;
-                                    });
-                                    order.codeNum = Object.getOwnPropertyNames(components).length;
-                                    // TODO huxz 获取付款到账时间[已付款时间]
-                                    // 获取订单发货时间
-                                    getTimeByStatus(order, order.statushistory, 406, 'inbound');
-                                    // 获取订单收货时间
-                                    getTimeByStatus(order, order.statushistory, 405, 'receivedGoods');
-                                    // 当订单状态码为失效状态时
-                                    var statusCode = order.status;
-                                    if (statusCode == 602 || statusCode == 603 || statusCode == 604 || statusCode == 315 || statusCode == 605 || statusCode == 606) {
-                                        getTimeByStatus(order, order.statushistory, statusCode, 'unavailable');
-                                        order.unavailableReason = unavailableReasons[statusCode];
-                                    }
-                                });
-                            }
-                        }, function (reponse) {
-                            if ("系统错误".indexOf(reponse.data) > -1) {
-                                toaster.pop('error', '不好意思,系统出错,请联系客服。');
-                            } else {
-                                toaster.pop('info', reponse.data);
-                            }
-                        });
-                    }
-                });
                 $scope.orderTableParams.reload();
             }
         }, function (error) {
@@ -679,6 +537,149 @@ define(['app/app'], function (app) {
             $scope.orderTableParams.reload();
         };
 
+        $scope.orderTableParams = new ngTableParams($scope.tableParams, {
+            total: 0,
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                $scope.paginationParams = params;
+                var param = BaseService.parseParams(params.url());
+                param.keyword = $scope.keyword ? $scope.keyword : null;
+                if ($scope.childStatus!==''){
+                    param.status = $scope.childStatus;
+                }else{
+                    param.status = getState();
+                }
+                param.page = $scope.param.page;
+                // param.startMils = $scope.startMils;
+                // param.endMils = $scope.endMils;
+                param.exceptionType = window.sessionStorage.getItem('exceptionType');
+                param.storeType = $scope.storeType;
+
+                param.startMils = $scope.startDate ? $scope.startDate.getTime() : null;
+                param.endMils = $scope.endDate ? $scope.endDate.getTime() : null;
+                if (param.startMils != null && param.endMils != null){
+                    if (param.startMils > param.endMils){
+                        alert("开始时间不得超过结束时间!");
+                        return;
+                    }
+                }
+
+                Purchase.getByStatusAndInternal(param, function (page) {
+                    if (page) {
+                        if (!$scope.startDate && !$scope.endDate && !$scope.keyword) {
+                            if ($scope.childStatus == '') {
+                                if (page.content) {
+                                    angular.forEach(page, function (value, key) {
+                                        if (key == 'all' || key == 'tobeconfirmed' || key == 'comfirmed' || key == 'inbound'
+                                            || key == 'tobepaid' || key == 'completed' || key == 'unavailable' || key == 'toBeReviewed') {
+                                            if (!$scope.counts) {
+                                                $scope.counts = {};
+                                            }
+                                            $scope.counts[key] = value;
+                                        }
+                                        $scope.counts[$scope.status] = page.totalElements;
+                                    });
+                                } else {
+                                    $scope.counts = {};
+                                }
+                            }
+                        }
+
+                        $scope.purchases = page.content;
+                        angular.forEach($scope.purchases, function (data) {
+                            if (data.installmentId && data.installment.status == 504) {
+                                angular.forEach(data.installment.installmentDetails, function (list) {
+                                    if (list.detno == data.installment.currentNo) {
+                                        if (list.status == 504) {
+                                            data.installmentDetailPaid = true;
+                                        }
+                                    }
+                                })
+                            }
+                            // 循环判断一期都没有付款并且延期的
+                            if (data.installmentId && data.installment.status == 503) {
+                                angular.forEach(data.installment.installmentDetails, function (detailslist) {
+                                    var nowTime = new Date();
+                                    if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
+                                        data.Overtime = true;
+                                    }
+                                })
+                            }
+                            // 循环判断已付款未收款卖家可取消的
+
+                        });
+                        $scope.requestOver = 0;
+                        angular.forEach($scope.purchases, function (order) {
+                            Rate.getRateVendor({orderId:order.orderid},{},function (data) {
+                                if (data.data){
+                                    order.isEachRate = true;
+                                }
+                            });
+                            Rate.getRateBuyer({orderId:order.orderid},{},function (data) {
+                                if(data.data){
+                                    if (data.data.vendorRateTime){
+                                        order.isFirstRate = true; // 是否完成初评
+                                    }
+                                    if (data.data.vendorAfterRateTime){
+                                        order.isAfterRate = true; // 是否完成追评
+                                    }
+                                }
+                                $scope.requestOver += 1;
+                            });
+                            angular.forEach(JSON.parse(order.statushistory),function (data) {
+                                if (data.status == 520){
+                                    order.complete = data.time;
+                                }
+                            });
+                        });
+                        getExMsgState(); // 获取异常消息状态
+                        getReturnByPurchaseIds(); // 获取退货单信息
+
+                        $scope.orderLength = page.numberOfElements;
+                        $scope.pageParams.content = page.content;
+                        $scope.pageParams.number = page.number;
+                        // 分页部分有关内容
+                        $scope.param.currentPage = page.number;
+                        $scope.AllOrderInfo = page;
+                        $scope.acculatePages(page.number, page.totalPages);
+
+                        $scope.pageParams.totalElements = page.totalElements;
+                        $scope.pageParams.totalPages = page.totalPages;
+                        params.total(page.totalElements);
+                        $defer.resolve(page.content);
+                        $scope.orderLength = page.content.length;
+
+                        angular.forEach(page.content, function (order) {
+                            var purchaseDetails = angular.copy(order.purchaseDetails);
+                            // 获取型号数量
+                            var components = {};
+                            angular.forEach(purchaseDetails, function (purchaseDetail) {
+                                components[purchaseDetail.uuid]++;
+                            });
+                            order.codeNum = Object.getOwnPropertyNames(components).length;
+                            // TODO huxz 获取付款到账时间[已付款时间]
+                            // 获取订单发货时间
+                            getTimeByStatus(order, order.statushistory, 406, 'inbound');
+                            // 获取订单收货时间
+                            getTimeByStatus(order, order.statushistory, 405, 'receivedGoods');
+                            // 当订单状态码为失效状态时
+                            var statusCode = order.status;
+                            if (statusCode == 602 || statusCode == 603 || statusCode == 604 || statusCode == 315 || statusCode == 605 || statusCode == 606) {
+                                getTimeByStatus(order, order.statushistory, statusCode, 'unavailable');
+                                order.unavailableReason = unavailableReasons[statusCode];
+                            }
+                        });
+                    }
+                }, function (reponse) {
+                    if ("系统错误".indexOf(reponse.data) > -1) {
+                        toaster.pop('error', '不好意思,系统出错,请联系客服。');
+                    } else {
+                        toaster.pop('info', reponse.data);
+                    }
+                });
+            }
+        });
+
         // 确认收款
         // 分期明细
         $scope.numArray = {

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

@@ -307,7 +307,7 @@ define([ 'app/app' ], function(app) {
         // 下载模板
         $scope.download = function() {
             var show = SessionService.get($scope.userInfo.userUU + "-releasetip");
-            var downloadUrl = $rootScope.isPcbStore ? 'release/product/release/template/pcb' : 'release/product/release/template'
+            var downloadUrl = $rootScope.isPcbStore ? '/release/product/release/template/pcb' : '/release/product/release/template'
             if (!show) {
                 var modalInstance = $modal.open({
                     animation: true,

+ 1 - 1
src/main/webapp/resources/view/admin/RegulpicList.html

@@ -300,7 +300,7 @@
           </div>
         </td>
         <td>
-          <span class="passBtn" ng-click="passBtnFn()">通过</span>
+          <span class="passBtn" ng-click="passBtnFn(list)">通过</span>
           <span class="cancelBtn" ng-click="cancelBtnFn(list)">不通过</span>
         </td>
       </tr>

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

@@ -1,6 +1,7 @@
 <div class="box">
 	<div class="box-header well" data-original-title>
-		<i class="icon-user"></i> 标准器件审批
+		<span style="color: #178acc"><i class="icon-user"></i> 标准器件审批</span>
+		<span ui-sref="audit_regulplist" style="cursor: pointer;"><i class="icon-user"></i> 规格书审核</span>
 	</div>
 	<div class="box-content">
 		<!-- ng-tableStart -->

+ 63 - 0
src/main/webapp/resources/view/admin/modal/auditRegulpic_choose_modal.html

@@ -0,0 +1,63 @@
+<style type="text/css">
+  h3.modal-title {
+    font-size: 17px;
+    line-height: 1;
+    color: #fff;
+  }
+
+  #body {
+    padding-left: 10px;
+    padding-right: 10px;
+    font-size: 15px;
+  }
+
+  div.title {
+    background-color: #3ba9e9;
+  }
+
+  #body . {
+    margin-bottom: 10px;
+  }
+
+  .close {
+    font-size: 22px;
+  }
+  [class^="span"] {
+    width: auto;
+  }
+</style>
+<div class="modal-header title">
+  <button type="button" class="close" ng-click="dismiss()"><span>×</span></button>
+  <h3 class="modal-title">选择规格书</h3>
+</div>
+<form class="form-horizontal " name="myForm" novalidate>
+  <div class="modal-body" id="body">
+    <div class="form-group">
+      <div class="col-sm-12">
+        <p style="color: #ea0025">商城已存在该标准物料,请选择正确的规格书</p>
+      </div>
+    </div>
+    <div class="form-group" style="margin: 0px">
+      <div class="col-sm-6">
+        <label class="radio-inline">
+          <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="store" ng-checked="checked === 'store'" ng-click="checked = 'store'"> 商城规格书
+        </label>
+        <div style="margin: 10px 0"><img src="static/img/vendor/images/pdf.png" style="width:31px;height:35px;" /></div>
+      </div>
+      <div class="col-sm-6">
+        <label class="radio-inline">
+          <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="user"  ng-checked="checked === 'user'" ng-click="checked = 'user'"> 用户上传规格书
+        </label>
+        <div style="margin: 10px 0"><img src="static/img/vendor/images/pdf.png" style="width:31px;height:35px;" /></div>
+      </div>
+    </div>
+    <div class="form-group">
+      <div class="col-sm-6">
+        <input class="btn btn-primary" type="button" value="确定" ng-click="saveReason()" style="float: right;"/>
+      </div>
+      <div class="col-sm-6">
+        <input class="btn btn-default" type="button" value="取消" ng-click="dismiss()"/>
+      </div>
+    </div>
+  </div>
+</form>

+ 1 - 1
src/main/webapp/resources/view/admin/modal/auditRegulpic_modal.html

@@ -34,7 +34,7 @@
   <div class="modal-body" id="body">
     <div class="form-group">
       <div class="col-sm-12">
-        <textarea class="form-control" id="reason" title="reason" rows="10" ng-model="reason"></textarea>
+        <textarea class="form-control" id="reason" title="reason" rows="10" ng-model="reason" placeholder="请填写不通过原因(必填)"></textarea>
       </div>
     </div>
     <div class="form-group">

+ 135 - 0
src/main/webapp/resources/view/admin/modal/auditRegulpicpass_modal.html

@@ -0,0 +1,135 @@
+<style type="text/css">
+  h3.modal-title {
+    font-size: 17px;
+    line-height: 1;
+    color: #fff;
+  }
+
+  #body {
+    padding-left: 10px;
+    padding-right: 10px;
+    font-size: 15px;
+  }
+
+  div.title {
+    background-color: #3ba9e9;
+  }
+
+  #body . {
+    margin-bottom: 10px;
+  }
+
+  .close {
+    font-size: 22px;
+  }
+  [class^="span"] {
+    width: auto;
+  }
+  .form-horizontal .form-group {
+    line-height: 28px;
+  }
+  .form-horizontal div {
+    color: #666;
+    font-size: 14px
+  }
+  .form-horizontal .name {
+    color: #999
+  }
+  .listUl {
+    position: absolute;
+    top: 28px;
+    left: 15px;
+    width: 240px;
+    max-height: 180px;
+    overflow-y: auto;
+    background: #fff;
+    border: 1px solid #dcdcdc;
+    z-index: 10;
+  }
+  .listUl li {
+    font-size: 14px;
+    color: #666;
+    line-height: 24px;
+    text-indent: 12px;
+  }
+  .listUl li:hover {
+    background: #dcdcdc;
+    cursor: pointer;
+  }
+</style>
+<div class="modal-header title">
+  <button type="button" class="close" ng-click="dismiss()"><span>×</span></button>
+  <h3 class="modal-title">通过</h3>
+</div>
+<form class="form-horizontal " name="myForm" novalidate>
+  <div class="modal-body" id="body" style="padding: 0px 15px;">
+    <div class="form-group">
+      <div class="col-sm-3 name">品牌:</div>
+      <div class="col-sm-9">这是品牌名字</div>
+    </div>
+    <div class="form-group">
+      <div class="col-sm-3 name">物料名称(类目):</div>
+      <div class="col-sm-9">这是物料名称</div>
+    </div>
+    <div class="form-group">
+      <div class="col-sm-3 name">型号:</div>
+      <div class="col-sm-9">这是型号名字</div>
+    </div>
+    <div class="form-group">
+      <div class="col-sm-3 name">规格书:</div>
+      <div class="col-sm-9"><a href="" target="_blank"><img src="static/img/vendor/images/pdf.png" style="width:28px;height:28px;"/></a></div>
+    </div>
+    <div class="form-group">
+      <div class="col-sm-3 name"><em style="color: #ea0e0e">*</em>品牌:</div>
+      <div class="col-sm-9" style="position: relative;">
+        <input type="text" ng-blur="onBrandBlur(keyword)"  ng-change="onBrandChange(keyword)" placeholder="请输入品牌名字" ng-model="keyword" class="form-control" style="width: 240px;height: 28px" />
+        <ul class="listUl" ng-if="BrandList.value.length > 0">
+          <li ng-repeat="item in BrandList.value" ng-click="setBrand(item.nameEn)">
+            {{item.nameEn}}
+          </li>
+        </ul>
+      </div>
+    </div>
+    <div class="form-group">
+      <div class="col-sm-3 name"><em style="color: #ea0e0e">*</em>商城类目:</div>
+      <div class="col-sm-9" >
+        <div class="col-sm-4" style="padding: 0px;">
+          <select class="form-control"
+                  ng-model="kindPojo.first"
+                  ng-options="key as value.nameCn for (key,value) in kindInfo"
+                  ng-change="kindPojo.second='';kindPojo.third='';"
+                  style="opacity: 1;height:28px;overflow-y: scroll;line-height:28px;padding: 0 6px;">
+            <option value="">请选择一级类目</option>
+          </select>
+        </div>
+        <div class="col-sm-4" style="padding: 0px;">
+          <select class="form-control" ng-model="kindPojo.second"
+                  ng-options="key as value.nameCn for (key,value) in kindInfo[kindPojo.first].children"
+                  ng-change="kindPojo.third='';" style="height:28px;line-height:28px;padding: 0 6px;">
+            <option value="">请选择二级类目</option>
+          </select>
+        </div>
+        <div class="col-sm-4" style="padding: 0px;">
+          <select class="form-control" ng-model="kindPojo.third" style="opacity: 1;height:28px;line-height:28px;padding: 0 6px;"
+                  ng-options="value as value.nameCn for value in kindInfo[kindPojo.first].children[kindPojo.second].children">
+            <option value="">请选择三级类目</option>
+          </select>
+        </div>
+      </div>
+    </div>
+    <div class="form-group">
+      <div class="col-sm-3 name">规格:</div>
+      <div class="col-sm-9">
+        <input type="text" placeholder="请输入规格(非必填)" ng-model="spec" class="form-control" style="width: 240px;height: 28px" />
+      </div>
+    </div>
+    <div class="form-group">
+      <div class="col-sm-6">
+        <input class="btn btn-primary" type="button" value="确定" ng-click="saveReason()" style="float: right;"/>
+      </div>
+      <div class="col-sm-6">
+        <input class="btn btn-default" type="button" value="取消" ng-click="dismiss()"/>
+      </div>
+    </div>
+  </div>
+</form>

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

@@ -344,10 +344,10 @@
         background: #e8e8e8;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.input-number span:first-child {
-        top: 12px;
+        top: 22px;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.input-number span:last-child {
-        top: 12px;
+        top: 22px;
         right: -5px;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row table tbody tr td.operate > div > a {
@@ -430,18 +430,19 @@
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a {
         position: relative;
-        width: 50%;
+        width: 33.2%;
         height: 34px;
         line-height: 34px;
         text-align: center;
         display: inline-block;
-        background: #d7d6d5;
-        color: #fff;
+        background: #d6e5ff;
+        color: #3f84f6;
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a.active {
-        background: #414140;
+        background: #3f84f6;
+        color: #fff;
     }
-    .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a:first-child::after {
+  /*  .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a:first-child::after {
         position: absolute;
         right: 0;
         content: '';
@@ -452,7 +453,7 @@
     }
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .switch-line a:first-child.active::after {
         border-bottom-color: #d7d6d5;
-    }
+    }*/
     .seek-purchase .seek-purchase-content >table >tbody tr.expand-row td .seek-list {
         max-height: 250px;
         overflow-y: auto;
@@ -727,9 +728,9 @@
         border-radius: 2px;
         color: #fff;
     }
-    .seek-purchase .link-saler-box .content div a:first-child {
+   /* .seek-purchase .link-saler-box .content div a:first-child {
         background: #b4b5b9 !important;
-    }
+    }*/
     .seek-purchase .link-saler-box .select-adder {
         display: inline-block;
         width: 127px;
@@ -1134,14 +1135,15 @@
                     </div>
                 </td>
             </tr>
-            <tr class="expand-row" ng-if="seek.$status == 1 || seek.$status == 2">
+            <tr class="expand-row" ng-if="seek.$status == 1 || seek.$status == 2 || seek.$status == 3">
                 <td colspan="6">
                     <div>
                         <div class="switch-line">
-                            <a ng-disabled="goodsCount == 0" ng-class="{'active': seek.$status == 1}" ng-click="setSeekStatus(seek, 1)">商城现货(<span ng-bind="goodsCount"></span>)</a>
-                            <a ng-disabled="offerCount == 0" ng-class="{'active': seek.$status == 2}"  ng-click="setSeekStatus(seek, 2)">当前报价(<span ng-bind="offerCount"></span>)</a>
+                            <a ng-disabled="goodsCount == 0" ng-class="{'active': seek.$status == 1}" ng-click="setSeekStatus(seek, 1, goodsCount == 0)">商城现货(<span ng-bind="goodsCount"></span>)</a>
+                            <a ng-disabled="offerCount == 0" ng-class="{'active': seek.$status == 2}"  ng-click="setSeekStatus(seek, 2, offerCount == 0)">当前报价(<span ng-bind="offerCount"></span>)</a>
+                            <a ng-disabled="replaceOfferCount == 0" ng-class="{'active': seek.$status == 3}"  ng-click="setSeekStatus(seek, 3, replaceOfferCount == 0)">替代型号报价(<span ng-bind="replaceOfferCount"></span>)</a>
                         </div>
-                        <div ng-show="seek.$status == 1">
+                        <div ng-show="currentSeek.$status == 1">
                             <table>
                                 <thead>
                                 <tr>
@@ -1209,7 +1211,7 @@
                             </div>
                             -->
                         </div>
-                        <div ng-show="seek.$status == 2">
+                        <div ng-show="currentSeek.$status == 2 || currentSeek.$status == 3">
                             <table>
                                 <thead>
                                 <tr>
@@ -1224,7 +1226,7 @@
                             <div class="seek-list">
                                 <table>
                                     <tbody>
-                                    <tr ng-repeat="of in offer track by $index">
+                                    <tr ng-repeat="of in offer track by $index" ng-show="(currentSeek.$status == 3 && of.isReplace == 1) || (currentSeek.$status == 2 && of.isReplace != 1)">
                                         <td width="273" ng-bind="of.vendName" title="{{of.vendName}}"></td>
                                         <td width="233" class="red-text" ng-bind="of.leadtime">4-6</td>
                                         <td width="234" class="seek-replies">

+ 20 - 3
src/main/webapp/resources/view/vendor/forstore/purchaseOffer.html

@@ -583,6 +583,14 @@
     .oder01 ul li.active:after{
         display: block
     }
+    .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history .replace-param {
+        display: block;
+        width: 100%;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        text-align: left;
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
@@ -704,8 +712,8 @@
                 <td>
                     <div class="row-wrap il-content">
                         <div class="il-box-large il-box">
-                            <div title="{{seek.cmpCode}}" style="width: 100%" class="fl item"><span>型号:</span><div class="content" style="width:135px">{{seek.cmpCode || '-'}}</div></div>
-                            <div title="{{seek.spec}}" style="width: 100%" class="fl item bottom"><span>规格:</span><div class="content" style="width:135px">{{seek.spec || '-'}}</div></div>
+                            <div title="{{seek.cmpCode}}" style="width: 100%" class="fl item"><span>型号:</span><div class="content" style="width:130px">{{seek.cmpCode || '-'}}</div></div>
+                            <div title="{{seek.spec}}" style="width: 100%" class="fl item bottom"><span>规格:</span><div class="content" style="width:130px">{{seek.spec || '-'}}</div></div>
                         </div>
                     </div>
                 </td>
@@ -726,9 +734,18 @@
                     <a ng-click="setLinkBoxIndex($index)">联系买家<img src="static/img/seekPurchase/link-buyer.png" alt=""></a>
                     <div class="is-say-price" ng-if="seek.agreed != 1 && seek.agreed != 0 || seek.replies">已报价 <img src="static/img/seekPurchase/check.png" alt="">
                         <div class="say-price-history">
-                            <p class="price-title">历史报价</p>
+                            <p class="price-title">{{seek.isReplace == 1 ? '替代型号报价' : '当前型号报价'}}</p>
                             <div>
                                 <div>
+                                    <div class="replace-param" ng-if="seek.isReplace == 1">
+                                        <span>替代物料品牌:</span><span ng-bind="seek.replaceBrand"></span>
+                                    </div>
+                                    <div class="replace-param" ng-if="seek.isReplace == 1">
+                                        <span>替代物料型号:</span><span ng-bind="seek.replaceCmpCode"></span>
+                                    </div>
+                                    <div class="replace-param" ng-if="seek.isReplace == 1">
+                                        <span>替代物料规格:</span><span ng-bind="seek.replaceSpec"></span>
+                                    </div>
                                     <span>交期:</span><span class="red-text" ng-bind="seek.leadtime + '天'">6 天</span>
                                 </div>
                                 <!--<div>-->

+ 79 - 10
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -387,8 +387,10 @@
       /*  display: none;*/
         position: fixed;
         width: 476px;
-        top: 30%;
-        left: 33%;
+        top: 50%;
+        left: 50%;
+        margin-top: -183px;
+        margin-left: -238px;
         /*-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
         -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
         box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
@@ -526,6 +528,12 @@
         padding-left: 36px;
         width: 133px;
     }
+    .seek-purchase .say-price-box  .content .content-line .form-item.form-long {
+        width: 100%;
+    }
+    .seek-purchase .say-price-box  .content .content-line .form-item.form-long input {
+        width: 292px;
+    }
     .seek-purchase .say-price-box .operate {
         border-top: 1px solid #e4e5e6;
         border-bottom-left-radius: 5px;
@@ -651,16 +659,16 @@
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div {
         padding: 9px 12px;
     }
-    .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div {
+    /*.seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div {
         display: inline-block;
         text-align: left;
-    }
+    }*/
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div:nth-child(1) {
         /*float: left;*/
     }
-    .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div:nth-child(2) {
-        margin-left: 32px;
-    }
+    /*.seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div:nth-child(2) {*/
+        /*margin-left: 32px;*/
+    /*}*/
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div span {
         color: #020202;
         margin: 0;
@@ -668,6 +676,14 @@
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div span.red-text {
         color: #f62d37;
     }
+    .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history .replace-param {
+        display: block;
+        width: 100%;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        text-align: left;
+    }
     .seek-purchase .seek-purchase-content >table tbody tr.default-row td.operate .is-say-price .say-price-history > div > div.pre-line {
         display: block;
         padding: 13px 0;
@@ -696,6 +712,26 @@
         opacity: 1;
         height: 210px;
     }
+    .say-price-box .switch-say {
+        text-align: center;
+        margin: 13px 0;
+        font-size: 0;
+    }
+    .say-price-box .switch-say li {
+        width: 200px;
+        height: 34px;
+        line-height: 34px;
+        color: #4290f7;
+        border: 1px solid #4290f7;
+        display: inline-block;
+        vertical-align: middle;
+        font-size: 14px;
+        cursor: pointer;
+    }
+    .say-price-box .switch-say li.active {
+        color: #fff;
+        background: #4290f7;
+    }
 </style>
 <div class="user_right fr seek-purchase">
     <!--求购询价-->
@@ -841,10 +877,19 @@
                         <!--<span ng-if="seek.quoted == 1 || seek.newId">已报价 <img src="static/img/seekPurchase/check.png" alt=""></span>-->
                         <div class="is-say-price" ng-if="seek.quoted == 1 || seek.newId">已报价 <img src="static/img/seekPurchase/check.png" alt="">
                             <div class="say-price-history">
-                                <p class="price-title">历史报价</p>
+                                <p class="price-title">{{seek.quotation.isReplace == 1 ? '替代型号报价' : '当前型号报价'}}</p>
                                 <div>
-                                    <div>
-                                        <span>交期:</span><span class="red-text" ng-bind="seek.quotation.leadtime + '天'">6 天</span>
+                                    <div class="replace-param" ng-if="seek.quotation.isReplace == 1">
+                                        <span>替代物料品牌:</span><span ng-bind="seek.quotation.replaceBrand"></span>
+                                    </div>
+                                    <div class="replace-param" ng-if="seek.quotation.isReplace == 1">
+                                        <span>替代物料型号:</span><span ng-bind="seek.quotation.replaceCmpCode"></span>
+                                    </div>
+                                    <div class="replace-param" ng-if="seek.quotation.isReplace == 1">
+                                        <span>替代物料规格:</span><span ng-bind="seek.quotation.replaceSpec"></span>
+                                    </div>
+                                    <div class="replace-param">
+                                        <span>交期:</span><span class="red-text" ng-bind="seek.quotation.leadtime + '天'"></span>
                                     </div>
                                     <!--<div>-->
                                     <!--<span>附件:</span><a href="">下载</a>-->
@@ -907,6 +952,30 @@
                         <span>规格:</span><span class="text" ng-bind="inquiryItem.spec || '-'" title="{{inquiryItem.spec || '-'}}"></span>
                     </div>
                 </div>
+                <ul class="switch-say">
+                    <li ng-class="{'active': sayType == 'current'}" ng-click="setSayType('current')">当前型号报价</li>
+                    <li ng-class="{'active': sayType == 'replace'}" ng-click="setSayType('replace')">替代型号报价</li>
+                </ul>
+                <div ng-show="sayType == 'replace'">
+                    <div class="content-line">
+                        <div class="form-item form-left form-long">
+                            <span><i>*</i>品牌:</span>
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceBrand" ng-blur="onReplaceBrandBlur()">
+                        </div>
+                    </div>
+                    <div class="content-line">
+                        <div class="form-item form-left form-long">
+                            <span><i>*</i>型号:</span>
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceCmpCode" ng-blur="onReplaceCmpCodeBlur()">
+                        </div>
+                    </div>
+                    <div class="content-line">
+                        <div class="form-item form-left form-long">
+                            <span><i>*</i>规格:</span>
+                            <input type="text" class="form-control" ng-model="inquiryItem.replaceSpec" ng-blur="onReplaceSpecBlur()">
+                        </div>
+                    </div>
+                </div>
                 <div class="content-line">
                     <div class="form-item form-left">
                         <span><i>*</i>交期:</span>

+ 11 - 8
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -2734,21 +2734,24 @@
 			</div>
 			<div class="content-line" ng-repeat="(key, mate) in replaceMaterialList" on-finish-render="ngRepeatFinished">
 				<div class="form-item form-left">
-					<span><i>{{key + 1}}</i><em>*</em>型号:</span>
-					<input type="text" class="form-control" ng-readonly="mate.editable == false" ng-model="mate.ptrCmpcode" ng-focus="onFocus($event, 'similar-list1_'+ key, 'code', key)" ng-change="onCodeChange(mate.ptrCmpcode, key, $event)" ng-blur="onCodeBlur(key)" ng-class="{'error': errorObj[key].code == 1}" placeholder="请输入型号名称">
-					<ul class="similar-list" ng-class="'similar-list1_'+ key" ng-show="mate.showSimilarCodeList && similarCode.length > 0 && mate.ptrCmpcode" ng-mouseenter="setIsInCodeList(true, key)" ng-mouseleave="setIsInCodeList(false, key)">
-						<li ng-repeat="sCode in similarCode" ng-bind="sCode.code" title="{{sCode.code}}" ng-click="setCode(key, sCode.code)"></li>
+					<span><i>{{key + 1}}</i><em>*</em>品牌:</span>
+
+					<input type="text" class="form-control" ng-readonly="mate.editable == false" ng-model="mate.ptrBranden" ng-focus="onFocus($event, 'similar-list1_'+ key, 'brand', key)" ng-change="onBrandChange(mate.ptrBranden, key)" ng-blur="onBrandBlur(key)" ng-class="{'error': errorObj[key].brand == 1}" placeholder="请输入品牌名称">
+					<ul class="similar-list" ng-class="'similar-list1_'+ key" ng-show="mate.showSimilarBrandList && similarBrand.length > 0 && mate.ptrBranden" ng-mouseenter="setIsInBrandList(true, key)" ng-mouseleave="setIsInBrandList(false, key)">
+						<li ng-repeat="sBrand in similarBrand" ng-bind="sBrand.nameEn" title="{{sBrand.nameEn}}" ng-click="setBrand(key, sBrand.nameEn)"></li>
 					</ul>
+
 				</div>
 				<div class="form-item form-right">
-					<span><em>*</em>品牌:</span>
-					<input type="text" class="form-control" ng-readonly="mate.editable == false" ng-model="mate.ptrBranden" ng-focus="onFocus($event, 'similar-list2_'+ key, 'brand', key)" ng-change="onBrandChange(mate.ptrBranden, key)" ng-blur="onBrandBlur(key)" ng-class="{'error': errorObj[key].brand == 1}" placeholder="请输入品牌名称">
-					<ul class="similar-list" ng-class="'similar-list2_'+ key" ng-show="mate.showSimilarBrandList && similarBrand.length > 0 && mate.ptrBranden" ng-mouseenter="setIsInBrandList(true, key)" ng-mouseleave="setIsInBrandList(false, key)">
-						<li ng-repeat="sBrand in similarBrand" ng-bind="sBrand.nameEn" title="{{sBrand.nameEn}}" ng-click="setBrand(key, sBrand.nameEn)"></li>
+					<span><em>*</em>型号:</span>
+					<input type="text" class="form-control" ng-readonly="mate.editable == false" ng-model="mate.ptrCmpcode" ng-focus="onFocus($event, 'similar-list2_'+ key, 'code', key)" ng-change="onCodeChange(mate.ptrCmpcode, key, $event)" ng-blur="onCodeBlur(key)" ng-class="{'error': errorObj[key].code == 1}" placeholder="请输入型号名称">
+					<ul class="similar-list" ng-class="'similar-list2_'+ key" ng-show="mate.showSimilarCodeList && similarCode.length > 0 && mate.ptrCmpcode" ng-mouseenter="setIsInCodeList(true, key)" ng-mouseleave="setIsInCodeList(false, key)">
+						<li ng-repeat="sCode in similarCode" ng-bind="sCode.code" title="{{sCode.code}}" ng-click="setCode(key, sCode.code)"></li>
 					</ul>
 					<i class="fa fa-minus-circle" ng-if="replaceMaterialList.length >= 1 && mate.editable != false" ng-click="setReplies('sub', key)"></i>
 					<i class="fa fa-plus-circle" ng-if="key == linearLength - 1 && mate.editable != false" ng-click="setReplies('add', key)"></i>
 				</div>
+
 			</div>
 		</div>
 

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

@@ -2528,16 +2528,16 @@
 			<div class="content-line" ng-repeat="(key, mate) in replaceMaterialList" on-finish-render="ngRepeatFinished">
 				<div class="form-item form-left">
 					<span><i>{{key + 1}}</i><em>*</em>品牌:</span>
-					<input type="text"  ng-readonly="mate.editable == false"  class="form-control" ng-model="mate.ptrBranden" ng-focus="onFocus($event, 'similar-list4_'+ key, 'brand', key)" ng-change="onBrandChange(mate.ptrBranden, key)" ng-blur="onBrandBlur(key)" ng-class="{'error': errorObj[key].brand == 1}" placeholder="请输入品牌名称">
-					<ul class="similar-list" ng-class="'similar-list4_'+ key" ng-show="mate.showSimilarBrandList && similarBrand.length > 0 && mate.ptrBranden" ng-mouseenter="setIsInBrandList(true, key)" ng-mouseleave="setIsInBrandList(false, key)">
+					<input type="text"  ng-readonly="mate.editable == false"  class="form-control" ng-model="mate.ptrBranden" ng-focus="onFocus($event, 'similar-list3_'+ key, 'brand', key)" ng-change="onBrandChange(mate.ptrBranden, key)" ng-blur="onBrandBlur(key)" ng-class="{'error': errorObj[key].brand == 1}" placeholder="请输入品牌名称">
+					<ul class="similar-list" ng-class="'similar-list3_'+ key" ng-show="mate.showSimilarBrandList && similarBrand.length > 0 && mate.ptrBranden" ng-mouseenter="setIsInBrandList(true, key)" ng-mouseleave="setIsInBrandList(false, key)">
 							<li ng-repeat="sBrand in similarBrand" ng-bind="sBrand.nameEn" title="{{sBrand.nameEn}}" ng-click="setBrand(key, sBrand.nameEn)"></li>
 					</ul>
 
 				</div>
 				<div class="form-item form-right">
 					<span><em>*</em>型号:</span>
-					<input type="text"  ng-readonly="mate.editable == false"  class="form-control" ng-model="mate.ptrCmpcode" ng-focus="onFocus($event, 'similar-list3_'+ key, 'code', key)" ng-change="onCodeChange(mate.ptrCmpcode, key)" ng-blur="onCodeBlur(key)" ng-class="{'error': errorObj[key].code == 1}" placeholder="请输入型号名称">
-					<ul class="similar-list" ng-class="'similar-list3_'+ key"  ng-show="mate.showSimilarCodeList && similarCode.length > 0 && mate.ptrCmpcode" ng-mouseenter="setIsInCodeList(true, key)" ng-mouseleave="setIsInCodeList(false, key)">
+					<input type="text"  ng-readonly="mate.editable == false"  class="form-control" ng-model="mate.ptrCmpcode" ng-focus="onFocus($event, 'similar-list4_'+ key, 'code', key)" ng-change="onCodeChange(mate.ptrCmpcode, key)" ng-blur="onCodeBlur(key)" ng-class="{'error': errorObj[key].code == 1}" placeholder="请输入型号名称">
+					<ul class="similar-list" ng-class="'similar-list4_'+ key"  ng-show="mate.showSimilarCodeList && similarCode.length > 0 && mate.ptrCmpcode" ng-mouseenter="setIsInCodeList(true, key)" ng-mouseleave="setIsInCodeList(false, key)">
 						<li ng-repeat="sCode in similarCode" ng-bind="sCode.code" title="{{sCode.code}}" ng-click="setCode(key, sCode.code)"></li>
 					</ul>
 					<i class="fa fa-minus-circle" ng-if="replaceMaterialList.length >= 1 && mate.editable != false" ng-click="setReplies('sub', key)"></i>

+ 3 - 3
src/main/webapp/resources/view/vendor/modal/edit_regul_modal.html

@@ -223,9 +223,9 @@
         <div class="previewImage">
           <img ng-src="{{Regulpic}}" alt="商品图片">
           <img ng-src="{{Regulpic}}" alt="商品图片" ng-if="!Regulpic">
-          <div class="cover" style="background: rgba(0,0,0,0)">
-            <i class="fa fa-trash" style="z-index: 98" ng-click="deleteImg()"></i>
-          </div>
+          <!--<div class="cover" style="background: rgba(0,0,0,0)">-->
+            <!--<i class="fa fa-trash" style="z-index: 98" ng-click="deleteImg()"></i>-->
+          <!--</div>-->
           <a href="{{Regulpic}}" target="_blank" ng-if="Regulpic != 'static/img/store/common/default.png'">
             <div class="cover">
               <div class="look"><i class="fa fa-search"></i>查看</div>