Просмотр исходного кода

增加公共询价功能

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8096 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 лет назад
Родитель
Сommit
182543f6c4
20 измененных файлов с 2095 добавлено и 39 удалено
  1. 102 5
      src/main/java/com/uas/platform/b2b/controller/PurcInquiryController.java
  2. 1 1
      src/main/java/com/uas/platform/b2b/controller/SaleInquiryController.java
  3. 13 0
      src/main/java/com/uas/platform/b2b/dao/PurcInquiryItemInfoDao.java
  4. 4 0
      src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryDao.java
  5. 8 0
      src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryItemDao.java
  6. 14 0
      src/main/java/com/uas/platform/b2b/model/PurcInquiry.java
  7. 313 0
      src/main/java/com/uas/platform/b2b/model/PurcInquiryInfo.java
  8. 15 1
      src/main/java/com/uas/platform/b2b/model/PurcInquiryItem.java
  9. 408 0
      src/main/java/com/uas/platform/b2b/model/PurcInquiryItemInfo.java
  10. 14 0
      src/main/java/com/uas/platform/b2b/model/PurchaseInquiry.java
  11. 28 0
      src/main/java/com/uas/platform/b2b/search/SearchController.java
  12. 20 0
      src/main/java/com/uas/platform/b2b/search/SearchService.java
  13. 26 0
      src/main/java/com/uas/platform/b2b/search/SearchServiceImpl.java
  14. 41 0
      src/main/java/com/uas/platform/b2b/service/PurcInquiryService.java
  15. 263 26
      src/main/webapp/resources/js/index/app.js
  16. 582 0
      src/main/webapp/resources/tpl/index/baseInfo/inquiryItem_detail.html
  17. 221 0
      src/main/webapp/resources/tpl/index/baseInfo/inquiry_list.html
  18. 2 2
      src/main/webapp/resources/tpl/index/home/left.html
  19. 18 3
      src/main/webapp/resources/tpl/index/purc/inquiry_new.html
  20. 2 1
      src/main/webapp/resources/tpl/index/purc/inquiry_unapply.html

+ 102 - 5
src/main/java/com/uas/platform/b2b/controller/PurcInquiryController.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2b.model.PurcInquiry;
+import com.uas.platform.b2b.model.PurcInquiryItemInfo;
 import com.uas.platform.b2b.model.PurchaseInquiryItem;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.PurcInquiryService;
@@ -64,14 +65,15 @@ public class PurcInquiryController {
 	}
 
 	/**
-	 * 查询详情
+	 * 保存、更新(公共)
 	 * 
-	 * @param id
+	 * @param inquiry
 	 * @return
 	 */
-	@RequestMapping(value = "/detail/{id}", method = RequestMethod.GET)
-	private PurcInquiry getDetail(@PathVariable Long id) {
-		return null;
+	@RequestMapping(value = "/saveWithoutVendor", method = RequestMethod.POST)
+	private ModelMap saveWithoutVendor(String inquiry) {
+		PurcInquiryInfo purcInquiry = JSONObject.parseObject(inquiry, PurcInquiryInfo.class);
+		return purcInquiryService.saveWithoutVendor(purcInquiry);
 	}
 
 	/**
@@ -87,6 +89,18 @@ public class PurcInquiryController {
 		return purcInquiryService.saveAndSubmit(purcInquiry, vendors);
 	}
 
+	/**
+	 * 保存并提交(公共)
+	 * 
+	 * @param formStore
+	 * @return
+	 */
+	@RequestMapping(value = "/saveAndSubmitWithoutVendor", method = RequestMethod.POST)
+	private ModelMap saveAndSubmitWithoutVendor(String inquiry) {
+		PurcInquiryInfo purcInquiry = JSONObject.parseObject(inquiry, PurcInquiryInfo.class);
+		return purcInquiryService.saveAndSubmitWithoutVendor(purcInquiry);
+	}
+
 	/**
 	 * 提交
 	 * 
@@ -228,4 +242,87 @@ public class PurcInquiryController {
 		return purcInquiryService.refuseInquiry(id);
 	}
 	
+	/**
+	 * 发布公共招标
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/pubishInquiry/{id}", method = RequestMethod.POST)
+	private ModelMap pubishInquiry(@PathVariable Long id) {
+		return purcInquiryService.pubishInquiry(id);
+	}
+
+	/**
+	 * 查询公共询价单
+	 * 
+	 * @param params
+	 * @param keyword
+	 * @return
+	 */
+	@RequestMapping(value = "/publicInquiry", method = RequestMethod.GET)
+	public SPage<PurcInquiry> getPublicInquiry(PageParams params, String keyword) {
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("in_enterystatus", Status.ENABLED.value());
+		pageParams.getFilters().put("in_isopen", Constant.YES);
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("in_id", false, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return searchService.searchPurcInquiryCheckIds(keyword, pageParams);
+	}
+
+	/**
+	 * 查询公共询价单
+	 * 
+	 * @param params
+	 * @param keyword
+	 * @return
+	 */
+	@RequestMapping(value = "/publicInquiryItem", method = RequestMethod.GET)
+	public SPage<PurcInquiryItemInfo> getPublicInquiryItem(PageParams params, String searchFilter) {
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		JSONObject jsonObject = JSONObject.parseObject(searchFilter);
+		String keyword = jsonObject.getString("keyword");
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("id_inid", Status.ENABLED.value());
+		pageParams.getFilters().put("id_isopen", Constant.YES);
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("id_id", false, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return searchService.searchPurcInquiryItemCheckIds(keyword, pageParams);
+	}
+
+	/**
+	 * 查询详情(客户查询自己发出的询价单)
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/detail/{id}", method = RequestMethod.GET)
+	private PurcInquiry getDetail(@PathVariable Long id) {
+		return null;
+	}
+
+	/**
+	 * 明细详情
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/inquiryItem/{id}", method = RequestMethod.GET)
+	private PurcInquiryItemInfo getInquiryItemDetail(@PathVariable Long id) {
+		return purcInquiryService.getInquiryItemDetail(id);
+	}
+
+	/**
+	 * 转成客户询价单
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/transtoInquiry/{id}", method = RequestMethod.POST)
+	private ModelMap transtoInquiry(@PathVariable Long id) {
+		return purcInquiryService.transtoInquiry(id);
+	}
 }

+ 1 - 1
src/main/java/com/uas/platform/b2b/controller/SaleInquiryController.java

@@ -339,7 +339,7 @@ public class SaleInquiryController {
 	}
 
 	/**
-	 * 得到询价消息提示
+	 * 公共询价消息提示
 	 * 
 	 * @return
 	 */

+ 13 - 0
src/main/java/com/uas/platform/b2b/dao/PurcInquiryItemInfoDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.b2b.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.platform.b2b.model.PurcInquiryItemInfo;
+
+@Repository
+public interface PurcInquiryItemInfoDao
+		extends JpaRepository<PurcInquiryItemInfo, Long>, JpaSpecificationExecutor<PurcInquiryItemInfo> {
+
+}

+ 4 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryDao.java

@@ -52,4 +52,8 @@ public interface PurchaseInquiryDao extends JpaSpecificationExecutor<PurchaseInq
 	@Query("update PurchaseInquiry p set p.check = :check where p.enUU = :enUU and p.sourceId IN (:sourceIds)")
 	public void updateByCheck(@Param("check") short check, @Param("enUU") long enUU, @Param("sourceIds") Long[] sourceIds);
 
+	@Query("select p from PurchaseInquiry p where p.sourceId = :sourceId and p.sourceApp = :sourceApp")
+	public PurchaseInquiry findBySourceIdAndSourceApp(@Param("sourceId") Long sourceId,
+			@Param("sourceApp") String sourceApp);
+
 }

+ 8 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryItemDao.java

@@ -138,4 +138,12 @@ public interface PurchaseInquiryItemDao
 	@Query("select count(p) from PurchaseInquiryItem p where p.vendUU = :vendUU")
 	public long countByVendUU(@Param("vendUU") Long vendUU);
 
+	/**
+	 * 查询单据是否存在
+	 * 
+	 * @param enuu
+	 * @param sourceId
+	 * @return
+	 */
+	public PurchaseInquiryItem findByVendUUAndSourceId(Long enuu, Long sourceId);
 }

+ 14 - 0
src/main/java/com/uas/platform/b2b/model/PurcInquiry.java

@@ -139,6 +139,12 @@ public class PurcInquiry implements Serializable {
 	@Column(name = "in_overdue", insertable = false, updatable = false)
 	private Short overdue;
 
+	/**
+	 * 是否公开
+	 */
+	@Column(name = "in_isopen")
+	private Short isOpen;
+
 	public Long getId() {
 		return id;
 	}
@@ -275,4 +281,12 @@ public class PurcInquiry implements Serializable {
 		this.overdue = overdue;
 	}
 
+	public Short getIsOpen() {
+		return isOpen;
+	}
+
+	public void setIsOpen(Short isOpen) {
+		this.isOpen = isOpen;
+	}
+
 }

+ 313 - 0
src/main/java/com/uas/platform/b2b/model/PurcInquiryInfo.java

@@ -0,0 +1,313 @@
+package com.uas.platform.b2b.model;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+import org.codehaus.jackson.annotate.JsonIgnore;
+
+import com.alibaba.fastjson.annotation.JSONField;
+
+/**
+ * 平台新增询价单中间表
+ * 
+ * @author hejq
+ * @time 创建时间:2017年4月17日
+ */
+@Entity
+@Table(name = "purc$puinquiry")
+public class PurcInquiryInfo implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "purc$puinquiry_gen")
+	@SequenceGenerator(name = "purc$puinquiry_gen", sequenceName = "purc$puinquiry_seq", allocationSize = 1)
+	@Column(name = "in_id")
+	private Long id;
+
+	/**
+	 * 询价单所属企业UU
+	 */
+	@Column(name = "in_enuu")
+	private Long enUU;
+
+	/**
+	 * 询价单所属用户UU
+	 */
+	@Column(name = "in_recorderuu")
+	private Long recorderUU;
+
+	/**
+	 * 记录人信息
+	 */
+	@OneToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH })
+	@JoinColumn(name = "in_recorderuu", insertable = false, updatable = false)
+	private UserBaseInfo userBaseInfo;
+
+	/**
+	 * 询价企业
+	 */
+	@OneToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH })
+	@JoinColumn(name = "in_enuu", insertable = false, updatable = false)
+	private EnterpriseInfo enterprise;
+
+	/**
+	 * 流水号
+	 */
+	@Column(name = "in_code")
+	private String code;
+
+	/**
+	 * 单据归属日期
+	 */
+	@Column(name = "in_date")
+	private Date date;
+
+	/**
+	 * 录入人
+	 */
+	@Column(name = "in_recorder")
+	private String recorder;
+
+	/**
+	 * 审核人
+	 */
+	@Column(name = "in_auditor")
+	private String auditor;
+
+	/**
+	 * 报价截止日期
+	 */
+	@Column(name = "in_enddate")
+	private Date endDate;
+
+	/**
+	 * 备注
+	 */
+	@Column(name = "in_remark")
+	private String remark;
+
+	/**
+	 * 环保要求
+	 */
+	@Column(name = "in_environment")
+	private String environment;
+
+	/**
+	 * 价格类型
+	 */
+	@Column(name = "in_pricetype")
+	private String priceType;
+
+	/**
+	 * 询价明细
+	 */
+	@OneToMany(mappedBy = "inquiry", cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
+	@OrderBy("number")
+	private Set<PurcInquiryItemInfo> inquiryItems;
+
+	/**
+	 * 附件
+	 */
+	@OneToMany(fetch = FetchType.EAGER, cascade = { CascadeType.ALL })
+	@JoinTable(name = "purc$puinquiryattach", joinColumns = @JoinColumn(name = "in_id", referencedColumnName = "in_id") , inverseJoinColumns = @JoinColumn(name = "at_id", referencedColumnName = "at_id") )
+	private Set<Attach> attachs;
+
+	/**
+	 * 采纳结果
+	 */
+	@Column(name = "in_checked")
+	private Short check;
+
+	/**
+	 * 单据状态(已提交、在录入)
+	 */
+	@Column(name = "in_enterystatus")
+	private Integer enteryStatus;
+
+	/**
+	 * 是否过期
+	 */
+	@Column(name = "in_overdue", insertable = false, updatable = false)
+	private Short overdue;
+
+	/**
+	 * 是否公开
+	 */
+	@Column(name = "in_isopen")
+	private Short isOpen;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getEnUU() {
+		return enUU;
+	}
+
+	public void setEnUU(Long enUU) {
+		this.enUU = enUU;
+	}
+
+	public Long getRecorderUU() {
+		return recorderUU;
+	}
+
+	public void setRecorderUU(Long recorderUU) {
+		this.recorderUU = recorderUU;
+	}
+
+	public EnterpriseInfo getEnterprise() {
+		return enterprise;
+	}
+
+	public void setEnterprise(EnterpriseInfo enterprise) {
+		this.enterprise = enterprise;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public Date getDate() {
+		return date;
+	}
+
+	public void setDate(Date date) {
+		this.date = date;
+	}
+
+	public String getRecorder() {
+		return recorder;
+	}
+
+	public void setRecorder(String recorder) {
+		this.recorder = recorder;
+	}
+
+	public String getAuditor() {
+		return auditor;
+	}
+
+	public void setAuditor(String auditor) {
+		this.auditor = auditor;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getEnvironment() {
+		return environment;
+	}
+
+	public void setEnvironment(String environment) {
+		this.environment = environment;
+	}
+
+	public String getPriceType() {
+		return priceType;
+	}
+
+	public void setPriceType(String priceType) {
+		this.priceType = priceType;
+	}
+
+	@JsonIgnore
+	@JSONField(serialize = false)
+	public Set<PurcInquiryItemInfo> getInquiryItems() {
+		return inquiryItems;
+	}
+
+	public void setInquiryItems(Set<PurcInquiryItemInfo> inquiryItems) {
+		this.inquiryItems = inquiryItems;
+	}
+
+	public Set<Attach> getAttachs() {
+		return attachs;
+	}
+
+	public void setAttachs(Set<Attach> attachs) {
+		this.attachs = attachs;
+	}
+
+	public Short getCheck() {
+		return check;
+	}
+
+	public void setCheck(Short check) {
+		this.check = check;
+	}
+
+	public Integer getEnteryStatus() {
+		return enteryStatus;
+	}
+
+	public void setEnteryStatus(Integer enteryStatus) {
+		this.enteryStatus = enteryStatus;
+	}
+
+	public Short getOverdue() {
+		return overdue;
+	}
+
+	public void setOverdue(Short overdue) {
+		this.overdue = overdue;
+	}
+
+	public Short getIsOpen() {
+		return isOpen;
+	}
+
+	public void setIsOpen(Short isOpen) {
+		this.isOpen = isOpen;
+	}
+
+	public UserBaseInfo getUserBaseInfo() {
+		return userBaseInfo;
+	}
+
+	public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
+		this.userBaseInfo = userBaseInfo;
+	}
+
+}

+ 15 - 1
src/main/java/com/uas/platform/b2b/model/PurcInquiryItem.java

@@ -29,7 +29,7 @@ import com.alibaba.fastjson.annotation.JSONField;
  * @time 创建时间:2017年4月17日
  */
 @Entity
-@Table(name = "purc$puinquirytimes")
+@Table(name = "purc$puinquiryitems")
 public class PurcInquiryItem {
 
 	@Id
@@ -199,6 +199,12 @@ public class PurcInquiryItem {
 	@Column(name = "id_source")
 	private String source;
 
+	/**
+	 * 是否公开
+	 */
+	@Column(name = "id_isopen")
+	private Short isOpen;
+
 	public Long getId() {
 		return id;
 	}
@@ -417,4 +423,12 @@ public class PurcInquiryItem {
 		this.enterprise = enterprise;
 	}
 
+	public Short getIsOpen() {
+		return isOpen;
+	}
+
+	public void setIsOpen(Short isOpen) {
+		this.isOpen = isOpen;
+	}
+
 }

+ 408 - 0
src/main/java/com/uas/platform/b2b/model/PurcInquiryItemInfo.java

@@ -0,0 +1,408 @@
+package com.uas.platform.b2b.model;
+
+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.ManyToOne;
+import javax.persistence.OneToOne;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+/**
+ * 平台新增询价单明细
+ * 
+ * @author hejq
+ * @time 创建时间:2017年4月17日
+ */
+@Entity
+@Table(name = "purc$puinquiryitems")
+public class PurcInquiryItemInfo {
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "purc$puinquirytimes_gen")
+	@SequenceGenerator(name = "purc$puinquirytimes_gen", sequenceName = "purc$puinquirytimes_seq", allocationSize = 1)
+	@Column(name = "id_id")
+	private Long id;
+
+	/**
+	 * 序号
+	 */
+	@Column(name = "id_number")
+	private Short number;
+
+	/**
+	 * 询价单
+	 */
+	@ManyToOne(cascade = CascadeType.ALL, optional = true)
+	@JoinColumn(name = "id_inid", nullable = false)
+	private PurcInquiryInfo inquiry;
+
+	/**
+	 * 买家采购员UU
+	 */
+	@Column(name = "id_useruu")
+	private Long userUU;
+
+	/**
+	 * 产品
+	 */
+	@OneToOne(cascade = { CascadeType.REFRESH })
+	@JoinColumn(name = "id_prid", insertable = false, updatable = false)
+	private Product product;
+
+	@Column(name = "id_prid")
+	private Long productId;
+
+	/**
+	 * 币种
+	 */
+	@Column(name = "id_currency")
+	private String currency;
+
+	/**
+	 * 税率
+	 */
+	@Column(name = "id_taxrate")
+	private Float taxrate;
+
+	/**
+	 * 备注
+	 */
+	@Column(name = "id_remark")
+	private String remark;
+
+	/**
+	 * 供应商UU
+	 */
+	@Column(name = "id_venduu")
+	private Long vendUU;
+
+	/**
+	 * 供应商
+	 */
+	@OneToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH })
+	@JoinColumn(name = "id_venduu", insertable = false, updatable = false)
+	private EnterpriseInfo enterprise;
+
+	/**
+	 * 供应商联系人UU
+	 */
+	@Column(name = "id_venduseruu")
+	private Long vendUserUU;
+
+	/**
+	 * (买家预先提供的)有效期始
+	 */
+	@Column(name = "id_fromdate")
+	private Date fromDate;
+
+	/**
+	 * (买家预先提供的)有效期止
+	 */
+	@Column(name = "id_todate")
+	private Date toDate;
+
+	/**
+	 * (卖家报的)有效期始
+	 */
+	@Column(name = "id_vendfromdate")
+	private Date vendFromDate;
+
+	/**
+	 * (卖家报的)有效期止
+	 */
+	@Column(name = "id_vendtodate")
+	private Date vendToDate;
+
+	/**
+	 * (卖家报的)最小订购量
+	 */
+	@Column(name = "id_minorderqty")
+	private Double minOrderQty;
+
+	/**
+	 * (卖家报的)最小包装量
+	 */
+	@Column(name = "id_minpackqty")
+	private Double minPackQty;
+
+	/**
+	 * (卖家报的)物料品牌
+	 */
+	@Column(name = "id_brand")
+	private String brand;
+
+	/**
+	 * (卖家报的)供应商物料编号
+	 */
+	@Column(name = "id_vendorprodcode")
+	private String vendorprodcode;
+
+	/**
+	 * (卖家报的)交货周期(天数)
+	 */
+	@Column(name = "id_leadtime")
+	private Long leadtime;
+
+	/**
+	 * {未回复、已回复}
+	 */
+	@Column(name = "id_status")
+	private Short status;
+
+	/**
+	 * 是否采纳
+	 */
+	@Column(name = "id_agreed")
+	private Short agreed;
+
+	/**
+	 * 是否买家已设置分段数
+	 */
+	@Column(name = "id_custlap")
+	private Short custLap;
+
+	/**
+	 * search项目进行是否已过期时实际根据主表中enddate与当前时间的比较获取,但是数据库无字段会报“标识符无效”的错误
+	 * 所以建立此字段,但是此字段不会赋值。
+	 * 
+	 * @return
+	 */
+	@Column(name = "id_overdue")
+	private Short overdue;
+
+	/**
+	 * 来源ERP或B2B
+	 */
+	@Column(name = "id_source")
+	private String source;
+
+	/**
+	 * 是否公开
+	 */
+	@Column(name = "id_isopen")
+	private Short isOpen;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Short getNumber() {
+		return number;
+	}
+
+	public void setNumber(Short number) {
+		this.number = number;
+	}
+
+	public PurcInquiryInfo getInquiry() {
+		return inquiry;
+	}
+
+	public void setInquiry(PurcInquiryInfo inquiry) {
+		this.inquiry = inquiry;
+	}
+
+	public Long getUserUU() {
+		return userUU;
+	}
+
+	public void setUserUU(Long userUU) {
+		this.userUU = userUU;
+	}
+
+	public Product getProduct() {
+		return product;
+	}
+
+	public void setProduct(Product product) {
+		this.product = product;
+	}
+
+	public Long getProductId() {
+		return productId;
+	}
+
+	public void setProductId(Long productId) {
+		this.productId = productId;
+	}
+
+	public String getCurrency() {
+		return currency;
+	}
+
+	public void setCurrency(String currency) {
+		this.currency = currency;
+	}
+
+	public Float getTaxrate() {
+		return taxrate;
+	}
+
+	public void setTaxrate(Float taxrate) {
+		this.taxrate = taxrate;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Long getVendUU() {
+		return vendUU;
+	}
+
+	public void setVendUU(Long vendUU) {
+		this.vendUU = vendUU;
+	}
+
+	public Long getVendUserUU() {
+		return vendUserUU;
+	}
+
+	public void setVendUserUU(Long vendUserUU) {
+		this.vendUserUU = vendUserUU;
+	}
+
+	public Date getFromDate() {
+		return fromDate;
+	}
+
+	public void setFromDate(Date fromDate) {
+		this.fromDate = fromDate;
+	}
+
+	public Date getToDate() {
+		return toDate;
+	}
+
+	public void setToDate(Date toDate) {
+		this.toDate = toDate;
+	}
+
+	public Date getVendFromDate() {
+		return vendFromDate;
+	}
+
+	public void setVendFromDate(Date vendFromDate) {
+		this.vendFromDate = vendFromDate;
+	}
+
+	public Date getVendToDate() {
+		return vendToDate;
+	}
+
+	public void setVendToDate(Date vendToDate) {
+		this.vendToDate = vendToDate;
+	}
+
+	public Double getMinOrderQty() {
+		return minOrderQty;
+	}
+
+	public void setMinOrderQty(Double minOrderQty) {
+		this.minOrderQty = minOrderQty;
+	}
+
+	public Double getMinPackQty() {
+		return minPackQty;
+	}
+
+	public void setMinPackQty(Double minPackQty) {
+		this.minPackQty = minPackQty;
+	}
+
+	public String getBrand() {
+		return brand;
+	}
+
+	public void setBrand(String brand) {
+		this.brand = brand;
+	}
+
+	public String getVendorprodcode() {
+		return vendorprodcode;
+	}
+
+	public void setVendorprodcode(String vendorprodcode) {
+		this.vendorprodcode = vendorprodcode;
+	}
+
+	public Long getLeadtime() {
+		return leadtime;
+	}
+
+	public void setLeadtime(Long leadtime) {
+		this.leadtime = leadtime;
+	}
+
+	public Short getStatus() {
+		return status;
+	}
+
+	public void setStatus(Short status) {
+		this.status = status;
+	}
+
+	public Short getAgreed() {
+		return agreed;
+	}
+
+	public void setAgreed(Short agreed) {
+		this.agreed = agreed;
+	}
+
+	public Short getCustLap() {
+		return custLap;
+	}
+
+	public void setCustLap(Short custLap) {
+		this.custLap = custLap;
+	}
+
+	public Short getOverdue() {
+		return overdue;
+	}
+
+	public void setOverdue(Short overdue) {
+		this.overdue = overdue;
+	}
+
+	public String getSource() {
+		return source;
+	}
+
+	public void setSource(String source) {
+		this.source = source;
+	}
+
+	public EnterpriseInfo getEnterprise() {
+		return enterprise;
+	}
+
+	public void setEnterprise(EnterpriseInfo enterprise) {
+		this.enterprise = enterprise;
+	}
+
+	public Short getIsOpen() {
+		return isOpen;
+	}
+
+	public void setIsOpen(Short isOpen) {
+		this.isOpen = isOpen;
+	}
+
+}

+ 14 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseInquiry.java

@@ -157,6 +157,12 @@ public class PurchaseInquiry implements Serializable {
 	@Column(name = "in_isopen")
 	private Short isOpen;
 
+	/**
+	 * 应用来源,主要是为了平台公共询价做处理
+	 */
+	@Column(name = "in_sourceapp")
+	private String sourceApp;
+
 	public Long getId() {
 		return id;
 	}
@@ -303,4 +309,12 @@ public class PurchaseInquiry implements Serializable {
 		this.isOpen = isOpen;
 	}
 
+	public String getSourceApp() {
+		return sourceApp;
+	}
+
+	public void setSourceApp(String sourceApp) {
+		this.sourceApp = sourceApp;
+	}
+
 }

+ 28 - 0
src/main/java/com/uas/platform/b2b/search/SearchController.java

@@ -18,6 +18,8 @@ import com.uas.platform.b2b.model.MakeOrder;
 import com.uas.platform.b2b.model.MakeOrderChangeItem;
 import com.uas.platform.b2b.model.MakeReturn;
 import com.uas.platform.b2b.model.Product;
+import com.uas.platform.b2b.model.PurcInquiry;
+import com.uas.platform.b2b.model.PurcInquiryItemInfo;
 import com.uas.platform.b2b.model.PurchaseAccept;
 import com.uas.platform.b2b.model.PurchaseApBill;
 import com.uas.platform.b2b.model.PurchaseApCheck;
@@ -332,6 +334,32 @@ public class SearchController {
 		return searchService.searchVendorCheckIds(keyword, pageParams);
 	}
 
+	/**
+	 * 平台询价单
+	 * 
+	 * @param keyword
+	 * @param pageParams
+	 * @return
+	 */
+	@RequestMapping("/puinquiry")
+	@ResponseBody
+	public SPage<PurcInquiry> searchPurcInquiryCheckIds(String keyword, PageParams pageParams) {
+		return searchService.searchPurcInquiryCheckIds(keyword, pageParams);
+	}
+
+	/**
+	 * 平台询价单详情
+	 * 
+	 * @param keyword
+	 * @param pageParams
+	 * @return
+	 */
+	@RequestMapping("/puinquiryItem")
+	@ResponseBody
+	public SPage<PurcInquiryItemInfo> searchPurcInquiryItemCheckIds(String keyword, PageParams pageParams) {
+		return searchService.searchPurcInquiryItemCheckIds(keyword, pageParams);
+	}
+
 	/**
 	 * 根据输入获取联想词(器件)
 	 *

+ 20 - 0
src/main/java/com/uas/platform/b2b/search/SearchService.java

@@ -13,6 +13,8 @@ import com.uas.platform.b2b.model.MakeOrderChangeItem;
 import com.uas.platform.b2b.model.MakeReturn;
 import com.uas.platform.b2b.model.PagingReleaseDetail;
 import com.uas.platform.b2b.model.Product;
+import com.uas.platform.b2b.model.PurcInquiry;
+import com.uas.platform.b2b.model.PurcInquiryItemInfo;
 import com.uas.platform.b2b.model.PurchaseAccept;
 import com.uas.platform.b2b.model.PurchaseApBill;
 import com.uas.platform.b2b.model.PurchaseApCheck;
@@ -384,4 +386,22 @@ public interface SearchService {
 	 * @throws Exception
 	 */
 	public List<Map<String, Object>> getSimilarEnterprise(String keyword) throws Exception;
+
+	/**
+	 * 平台询价单
+	 * 
+	 * @param keyword
+	 * @param pageParams
+	 * @return
+	 */
+	public SPage<PurcInquiry> searchPurcInquiryCheckIds(String keyword, PageParams pageParams);
+
+	/**
+	 * 平台询价单详情
+	 * 
+	 * @param keyword
+	 * @param pageParams
+	 * @return
+	 */
+	public SPage<PurcInquiryItemInfo> searchPurcInquiryItemCheckIds(String keyword, PageParams pageParams);
 }

+ 26 - 0
src/main/java/com/uas/platform/b2b/search/SearchServiceImpl.java

@@ -33,6 +33,8 @@ import com.uas.platform.b2b.dao.MakeOrderDao;
 import com.uas.platform.b2b.dao.MakeReturnDao;
 import com.uas.platform.b2b.dao.PagingReleaseDetailDao;
 import com.uas.platform.b2b.dao.ProductDao;
+import com.uas.platform.b2b.dao.PurcInquiryDao;
+import com.uas.platform.b2b.dao.PurcInquiryItemInfoDao;
 import com.uas.platform.b2b.dao.PurchaseAcceptDao;
 import com.uas.platform.b2b.dao.PurchaseApBillDao;
 import com.uas.platform.b2b.dao.PurchaseApCheckDao;
@@ -68,6 +70,8 @@ import com.uas.platform.b2b.model.MakeOrderChangeItem;
 import com.uas.platform.b2b.model.MakeReturn;
 import com.uas.platform.b2b.model.PagingReleaseDetail;
 import com.uas.platform.b2b.model.Product;
+import com.uas.platform.b2b.model.PurcInquiry;
+import com.uas.platform.b2b.model.PurcInquiryItemInfo;
 import com.uas.platform.b2b.model.PurchaseAccept;
 import com.uas.platform.b2b.model.PurchaseApBill;
 import com.uas.platform.b2b.model.PurchaseApCheck;
@@ -222,6 +226,12 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
 	@Autowired
 	private BrandDao brandDao;
 
+	@Autowired
+	private PurcInquiryDao purcInquiryDao;
+
+	@Autowired
+	private PurcInquiryItemInfoDao purcInquiryItemInfoDao;
+
 	private static final Integer SIMILAR_NUM = 10;  // 联想词size
 
 	/**
@@ -902,4 +912,20 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
 		return vendors;
 	}
 
+	@Override
+	public SPage<PurcInquiry> searchPurcInquiryCheckIds(String keyword, PageParams pageParams) {
+		SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$PUINQUIRY, pageParams);
+		List<PurcInquiry> content = purcInquiryDao.findAll(idsPage.getContent());
+		sortByProperty(content, PurcInquiry.class, "id", idsPage.getContent());
+		return toSPage(idsPage, content);
+	}
+
+	@Override
+	public SPage<PurcInquiryItemInfo> searchPurcInquiryItemCheckIds(String keyword, PageParams pageParams) {
+		SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$PUINQUIRYITEMS, pageParams);
+		List<PurcInquiryItemInfo> content = purcInquiryItemInfoDao.findAll(idsPage.getContent());
+		sortByProperty(content, PurcInquiryItemInfo.class, "id", idsPage.getContent());
+		return toSPage(idsPage, content);
+	}
+
 }

+ 41 - 0
src/main/java/com/uas/platform/b2b/service/PurcInquiryService.java

@@ -6,6 +6,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.ui.ModelMap;
 
 import com.uas.platform.b2b.model.PurcInquiry;
+import com.uas.platform.b2b.model.PurcInquiryItemInfo;
 import com.uas.platform.b2b.temporary.model.PurcInquiryInfo;
 import com.uas.platform.b2b.temporary.model.VendorAndContact;
 import com.uas.platform.core.model.PageParams;
@@ -76,4 +77,44 @@ public interface PurcInquiryService {
 	 */
 	public ModelMap acceptInquiry(Long id);
 
+	/**
+	 * 公共询价(保存)
+	 * 
+	 * @param purcInquiry
+	 * @return
+	 */
+	public ModelMap saveWithoutVendor(PurcInquiryInfo purcInquiry);
+
+	/**
+	 * 公共询价(保存并提交)
+	 * 
+	 * @param purcInquiry
+	 * @return
+	 */
+	public ModelMap saveAndSubmitWithoutVendor(PurcInquiryInfo purcInquiry);
+
+	/**
+	 * 发布公共招标
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public ModelMap pubishInquiry(Long id);
+
+	/**
+	 * 转客户询价单
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public ModelMap transtoInquiry(Long id);
+
+	/**
+	 * 公共询价单据详情
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public PurcInquiryItemInfo getInquiryItemDetail(Long id);
+
 }

+ 263 - 26
src/main/webapp/resources/js/index/app.js

@@ -454,6 +454,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
         }).state('baseInfo.businessGroups', {
             url : '/businessGroups',
             controller : 'BusinessGroupsCtrl'
+        }).state('baseInfo.inquiryList', {
+            url : '/inquiryList',
+            templateUrl : "static/tpl/index/baseInfo/inquiry_list.html",
+            controller : 'PublicInquiryListCtrl'
+        }).state('baseInfo.inquiryListDetail', {
+            url : '/inquiryList/:id',
+            templateUrl : "static/tpl/index/baseInfo/inquiryItem_detail.html",
+            controller : 'PublicInquiryListDetailCtrl'
         }).state('qc', {
             url : "/qc",
             views : {
@@ -2772,7 +2780,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		$scope.inquiry = {
 				code: 'XJ' + $filter('date')(new Date(), 'yyMMddsss'),
 				showdate: $filter('date')(new Date, 'yyyy-MM-dd'),
-				priceType: '采购'
+				priceType: '采购',
+				isOpen: 0
 		};
 		
 	    $scope.currentDay = function() {
@@ -2889,6 +2898,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
         
         // 保存
         $scope.save = function() {
+        	console.log($scope.inquiry);
 //        	var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
 //    		$upload.upload({
 //    			url: 'product/baseInfo/updateProdInfo',
@@ -2909,36 +2919,76 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 //    			$scope.loadingShow = false;
 //    			toaster.pop('error', '操作失败', data.error);
 //    		});    
-        	PurchaseInquiry.save({inquiry: $scope.inquiry}, $scope.vendors, function(data) {
-        		if(data.success) {
-        			toaster.pop('success', '提示', data.success);
-        			$timeout(function() {
-        				window.loaction.hash = "#/purc/inquiry_unapply";
-        			}, 500);
-        		}
-        		if(data.error) {
-        			toaster.pop('error', '提示', data.error);
-        		}
-        	}, function(response) {
-        		toaster.pop('error', '提示', response.data);
-        	});
+        	if($scope.inquiry.isOpen == 0) {
+        		if( $scope.vendors.length > 0) { // 指定询价
+            		PurchaseInquiry.save({inquiry: $scope.inquiry}, $scope.vendors, function(data) {
+            			if(data.success) {
+            				toaster.pop('success', '提示', data.success);
+            				$timeout(function() {
+            					window.location.hash = "#/purc/inquiry_unapply";
+            				}, 500);
+            			}
+            			if(data.error) {
+            				toaster.pop('error', '提示', data.error);
+            			}
+            		}, function(response) {
+            			toaster.pop('error', '提示', response.data);
+            		});
+            	} else {
+            		toaster.pop('info', '提示', '请先选择供应商');
+            	}
+        	} else {
+        		PurchaseInquiry.saveWithoutVendor({inquiry: $scope.inquiry}, {}, function(data) {
+        			if(data.success) {
+        				toaster.pop('success', '提示', data.success);
+        				$timeout(function() {
+        					window.location.hash = "#/purc/inquiry_unapply";
+        				}, 500);
+        			}
+        			if(data.error) {
+        				toaster.pop('error', '提示', data.error);
+        			}
+        		}, function(response) {
+        			toaster.pop('error', '提示', response.data);
+        		});
+        	}
     	}
         
         // 保存并提交
         $scope.submit = function() {
-        	PurchaseInquiry.submit({inquiry: $scope.inquiry}, $scope.vendors, function(data) {
-        		if(data.success) {
-        			toaster.pop('success', '提示', data.success);
-        			$timeout(function() {
-        				window.location.hash = "#/purc/inquiry_unapply";
-        			}, 500);
-        		}
-        		if(data.error) {
-        			toaster.pop('error', '提示', data.error);
+        	if( $scope.inquiry.isOpen == 0) { // 指定询价
+        		if($scope.vendors.length > 0) {
+        			PurchaseInquiry.submit({inquiry: $scope.inquiry}, $scope.vendors, function(data) {
+            			if(data.success) {
+            				toaster.pop('success', '提示', data.success);
+            				$timeout(function() {
+            					window.location.hash = "#/purc/purchaseinquiry";
+            				}, 500);
+            			}
+            			if(data.error) {
+            				toaster.pop('error', '提示', data.error);
+            			}
+            		}, function(response) {
+            			toaster.pop('error', '提示', response.data);
+            		});
+        		} else {
+        			toaster.pop('info', '提示', '请先选择供应商');
         		}
-        	}, function(response) {
-        		toaster.pop('error', '提示', response.data);
-        	});
+        	} else {
+        		PurchaseInquiry.saveAndSubmitWithoutVendor({inquiry: $scope.inquiry}, {}, function(data) {
+        			if(data.success) {
+        				toaster.pop('success', '提示', data.success);
+        				$timeout(function() {
+        					window.location.hash = "#/purc/purchaseinquiry";
+        				}, 500);
+        			}
+        			if(data.error) {
+        				toaster.pop('error', '提示', data.error);
+        			}
+        		}, function(response) {
+        			toaster.pop('error', '提示', response.data);
+        		});
+        	}
     	}
 	}]);
 
@@ -3116,7 +3166,193 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 				toaster.pop('error', '提示', response.data);
 			})
 		}
+		
+		// 发布公共询价
+		$scope.publish = function(id) {
+			PurchaseInquiry.publishInquiry({id: id}, {}, function(data) {
+				toaster.pop('success', '提示', data.success);
+			}, function(response) {
+				toaster.pop('error', '提示', response.data);
+			})
+		}
 	}]);
+	
+	// 公共询价列表
+	app.controller('PublicInquiryListCtrl', ['$scope', '$stateParams', 'PurchaseInquiry','$filter', 'toaster', 'BaseService', 'ngTableParams', function($scope, $stateParams, PurchaseInquiry, $filter, toaster, BaseService, ngTableParams) {
+		BaseService.scrollBackToTop();
+        /**
+         * 改变单据日期范围
+         */
+        var getTenderDateCondition = function(zone, condition) {
+            var date = new Date();
+            if(zone == -1) {
+                condition.dateFrom = null;
+                condition.dateTo = null;
+            } else if(zone == 7) { // 一星期内
+                date.setDate(date.getDate() - 7);
+                condition.dateFrom = date;
+                condition.dateTo = new Date();
+            } else if(zone == 1) { // 一个月内
+                date.setMonth(date.getMonth() - 1);
+                condition.dateFrom = date;
+                condition.dateTo = new Date();
+            } else if(zone == 3) { // 三个月内
+                date.setMonth(date.getMonth() - 3);
+                condition.dateFrom = date;
+                condition.dateTo = new Date();
+            } else if (zone == 6) { // 半年内
+                date.setMonth(date.getMonth() - 6);
+                condition.dateFrom = date;
+                condition.dateTo = new Date();
+            } else {  // 一年内
+                date.setYear(date.getYear() - 1);
+                condition.dateFrom = date;
+                condition.dateTo = new Date();
+            }
+        };
+
+        $scope.dateZoneText = '不限';
+        $scope.deliveryZoneText = '不限';
+        $scope.condition = {dateZone: -1};
+        $scope.changeDateZone = function(zone) {
+            $scope.condition.dateZone = zone;
+            $scope.condition.$dateZoneOpen = false;
+            getTenderDateCondition(zone, $scope.condition);
+            $scope.tableParams.reload();
+        };
+
+        $scope.openDatePicker = function($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+        };
+
+        $scope.parseDate = function(dateStr) {
+            if(dateStr)
+                return Date.parse(dateStr, 'yyyy-MM-dd');
+            return new Date();
+        };
+
+        // 选择查找日期
+        $scope.onDateCondition = function(){
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+        // $scope.setActive = function(state) {
+        //     if($scope.active != state) {
+        //         $scope.active = state;
+        //         if($scope.tableParams.page() == 1)
+        //             $scope.tableParams.reload();
+        //         else
+        //             $scope.tableParams.page(1);
+        //     }
+        // };
+        
+        $scope.nowdate = new Date().getTime();
+        var getOpenState = function(active) {
+            var fn = 'getOpenAll';
+            switch(active) {
+                case 'all':
+                    fn = 'getOpenAll';break;
+                case 'todo':
+                    fn = 'getOpenTodo';break;
+                case 'end':
+                    fn = 'getOpenEnd';break;
+            }
+            return fn;
+        };
+
+        $scope.tableParams = new ngTableParams({
+            page : 1,
+            count : 10,
+            sorting: {
+//                'tender.endDate': 'desc',
+//                'tender.enterprise.enName': 'asc',
+//                'tender.code': 'asc'
+            }
+        }, {
+            total : 0,
+            counts: [10, 25, 50, 100],
+            getData : function($defer, params) {
+                $scope.loading = true;
+                var pageParams = params.url();
+//                var realActive = {};
+                pageParams.searchFilter = { // 筛选条件
+                    keyword: $scope.keyword,
+                    fromDate: getDateTime($scope.condition.dateFrom),
+                    endDate: getDateTime($scope.condition.dateTo)
+                };
+//                AccountEnterprise.get({}, function(data){
+//                    $scope.loading = false;
+//                    $scope.currentEn = data;
+//                });
+                PurchaseInquiry.publicInquiryItem.call(null, BaseService.parseParams(pageParams), function(page){
+                    $scope.loading = false;
+                    if(page) {
+                        params.total(page.totalElement);
+                        $defer.resolve(page.content);
+                        // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词  做导出时需要的字段
+                    }
+                }, function(response){
+                    $scope.loading = false;
+                    toaster.pop('error', '数据加载失败', response.data);
+                });
+            }
+        });
+
+        $scope.toDetail = function(id) {
+            window.location.hash = '#/baseInfo/inquiryList/' + id;
+        };
+
+        // 搜索框回车
+        $scope.onSearch = function() {
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+	}]);
+	
+	/**
+	 * 公共询价详情
+	 */
+	app.controller('PublicInquiryListDetailCtrl', ['$scope', '$stateParams', 'PurchaseInquiry','$filter', 'toaster', 'BaseService', 'ngTableParams', 'AccountEnterprise', function($scope, $stateParams, PurchaseInquiry, $filter, toaster, BaseService, ngTableParams, AccountEnterprise) {
+		BaseService.scrollBackToTop();
+		var loadData = function() {
+			PurchaseInquiry.inquiryItemDetail({id: $stateParams.id}, function(data) {
+				$scope.inquiryItem = data;
+			}, function(response) {
+				toaster.pop('error', '提示', response.data);
+			});
+		}
+		loadData();
+		
+		// 当前时间
+        $scope.nowdate = new Date().getTime();
+        
+		 // 当前企业
+		AccountEnterprise.get({}, function(data){
+			$scope.loading = false;
+			$scope.enterprise = data;
+		});
+        
+		// 转客户询价
+		$scope.transtoInquiry = function(id) {
+			PurchaseInquiry.transtoInquiry({id: id}, {}, function(data) {
+				if(data.success) {
+					toaster.pop('success', '提示', data.success);
+				} 
+				if(data.error) {
+					toaster.pop('error', '提示', data.error);
+				}
+				if(data.info) {
+					toaster.pop('info', '提示', data.info);
+				}
+			}, function(response) {
+				toaster.pop('error', '提示', response.data);
+			});
+		}
+	}]);
+	
 	// 询价单明细
 	app.controller('PurcInquiryDetailCtrl', ['$scope', '$stateParams', 'PurcInquiry','$filter', 'toaster', function($scope, $stateParams, PurcInquiry,$filter, toaster){
 		var loadData = function() {
@@ -6003,6 +6239,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		
 		//查找客户
 		$scope.searchCust = function(suuorname) {
+			console.log('eeee');
 			var modalInstance = $modal.open({
 				animation: true,
 				templateUrl: 'static/tpl/index/fa/custInfo.html',

+ 582 - 0
src/main/webapp/resources/tpl/index/baseInfo/inquiryItem_detail.html

@@ -0,0 +1,582 @@
+<!--  查看公共招标单  -->
+<style>
+
+/* 标题 */
+.tender-label {
+	/*height: 30px;*/
+	/*margin-left: 10px;*/
+	/*margin-right: 10px;*/
+	/*background-color: #e8e8e8;*/
+	/*box-shadow: 0 0 5px #6f6f6f;*/
+	/*border-top-right-radius: 20px;*/
+	width: 100%;
+	height: 40px;
+	line-height: 42px;
+	background: url(static/img/comm_bg01.png) no-repeat center;
+	background-size: 100%;
+}
+/* 主体 */
+.purc-tender {
+	line-height: 2;
+	font-size: 14px;
+}
+
+.purc-tender .row {
+	margin-left: 0px;
+	margin-right: 0px;
+	padding-left: 15px;
+	padding-right: 15px;
+}
+
+.tender-content {
+	background-color: #fff;
+}
+
+.tender-content>div>div {
+	margin-top: 3px;
+	margin-bottom: 3px;
+}
+/* 二级标题栏 */
+.title-div {
+	font-size: 14px;
+	font-weight: 600;
+	padding-left: 30px;
+	height: 50px;
+	padding-top: 11px;
+}
+
+/* 输入框前描述 */
+.tender-desc {
+	width: 100px;
+	float: left;
+}
+/* 输入框 */
+.tender-input {
+	border: none;
+	border-bottom: 1px solid #323232;
+	text-align: center;
+}
+
+.tender-input:focus {
+	outline: none;
+	border-bottom: 1px solid #5078cb;
+}
+
+/* 收货地址 */
+.address-group {
+	border-bottom: 1px solid #323232;
+	border-bottom-left-radius: 0;
+	margin-right: 20px;
+}
+
+.address-group>input:focus {
+	outline: none;
+}
+
+/* 基本信息 */
+.base-info {
+	border-bottom: 1px solid #e8e8e8;
+	padding-bottom: 30px;
+	padding-top: 20px;
+	margin-bottom: 0; /* 去除index中公共样式影响 */
+}
+
+/* 地址附加图标 */
+.address-addon {
+	border: none;
+	background: none;
+}
+
+/* 下拉选项 */
+.select-menu {
+	margin: 4px;
+	width: 100px;
+	padding: 0 5%;
+	height: 30px;
+}
+
+select {
+	/*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
+	border: solid 1px #5078cb;
+	/*很关键:将默认的select选择框样式清除*/
+	appearance: none;
+	-moz-appearance: none;
+	-webkit-appearance: none;
+	/*在选择框的最右侧中间显示小箭头图片*/
+	background: url("resources/img/tender/select.png") no-repeat scroll
+		right center transparent;
+	/*为下拉小箭头留出一点位置,避免被文字覆盖*/
+	padding-right: 14px;
+}
+
+/*清除ie的默认选择框样式清除,隐藏下拉箭头*/
+select::-ms-expand {
+	display: none;
+}
+
+/* 日期选择器 */
+.purc-tender .date-picker {
+	padding-top: 10px;
+}
+
+.purc-tender .date-picker input {
+	border-radius: 0;
+	border: 1px solid #5078cb;
+	border-right: none;
+	font-size: 12px;
+}
+
+.purc-tender .date-picker span .btn-open {
+	color: #fff;
+	background-color: #5078cb;
+	border-radius: 0;
+	border: 1px solid #5078cb;
+	border-left: none;
+}
+
+/* 修改本页内btn的样式 及datepicker中的btn-success的样式 */
+.tender-content .date-picker .btn {
+	border-radius: 0;
+}
+
+.tender-content .date-picker .btn-success {
+	background-color: #327EBE;
+}
+
+.tender-content .date-picker ul {
+	border-radius: 0;
+}
+
+.tender-content .date-picker ul div:focus {
+	outline: none;
+	border-radius: 0;
+	border: none;
+}
+
+/* 附件上传 */
+.purc-tender .base-info .attach-upload {
+	display: inline;
+}
+
+.purc-tender .base-info .attach-upload input {
+	height: 100px;
+	width: 100px;
+	margin: 6px 0 0 100px;
+	opacity: 0;
+	z-index: 1;
+	position: relative;
+}
+
+.purc-tender .base-info .attach-upload input:hover {
+	cursor: pointer;
+}
+
+.fileInputContainer {
+	height: 100px;
+	background-image: url('resources/img/tender/upload.png');
+	position: relative;
+	width: 100px;
+	margin-left: 100px;
+	margin-top: 20px;
+}
+
+.fileInput {
+	height: 100px;
+	font-size: 100px;
+	position: absolute;
+	margin-left: 100px;
+	margin-top: 20px;
+	right: 0;
+	top: 0;
+	opacity: 0;
+	filter: alpha(opacity = 0);
+	cursor: pointer;
+}
+/* 图片点击上传 */
+/*.upload-bg {*/
+/*width: 100px;*/
+/*height: 100px;*/
+/*background-image: url('resources/img/tender/upload.png');*/
+/*margin-top: 10px;*/
+/*margin-left: 100px;*/
+/*border: 1px solid #e8e8e8;*/
+/*z-index: 2;*/
+/*}*/
+/* 供应商信息 添加供应商 */
+.vend-info  a.add-vendor {
+	color: #5078cb;
+}
+
+.vend-info  a.add-vendor:hover {
+	cursor: pointer;
+	color: #55b6ff;
+}
+
+.vend-info  a.remove-vendor {
+	color: #FF2E2F;
+}
+
+.vend-info  a.remove-vendor:hover {
+	cursor: pointer;
+	color: #D32526;
+}
+
+/* 单选框 复选框 */
+input[type="radio"], input[type="checkbox"] {
+	vertical-align: text-bottom;
+	margin-bottom: 2px;
+	margin-bottom: -2px\9;
+}
+
+.vend-info .input-select {
+	float: left;
+	padding-top: 4px;
+	margin-left: -20px;
+}
+
+.vend-info .input-select input {
+	margin-right: 8px;
+}
+
+/* 右下角按钮 */
+.tender-content>div {
+	background-color: #fff;
+}
+
+.tender-content>div>div>button {
+	width: 94px;
+	height: 36px;
+	font-size: 14px;
+	color: #fff;
+	border-radius: 0;
+}
+
+.tender-content>div>div.btn-publish>button {
+	background-color: #FF2E2F;
+	width: 150px;
+	height: 60px;
+	font-size: 16px;
+	color: #fff;
+	border-radius: 0;
+}
+
+.tender-content>div>div.btn-disabled>button {
+	background-color: #999;
+	width: 150px;
+	height: 60px;
+	font-size: 16px;
+	color: #fff;
+	border-radius: 0;
+}
+
+.tender-content>div>div.a-detail {
+	margin-top: 40px;
+}
+
+.tender-content>div>div.a-detail>a {
+	color: #FF2E2F;
+	font-size: 14px;
+}
+
+.tender-content>div>div.a-detail>a:hover {
+	color: #D32526;
+	cursor: pointer;
+}
+
+.read-only {
+	border: none;
+	color: #969595;
+}
+
+.read-only:focus {
+	border: none;
+}
+
+.attach-file {
+	margin-left: 100px;
+	width: 400px;
+}
+
+.com_head {
+	width: 100%;
+	height: 40px;
+	line-height: 42px;
+	background: url(static/img/comm_bg01.png) no-repeat center;
+	background-size: 100%;
+}
+
+.com_head span {
+	margin-left: 30px;
+	color: #000;
+	font-size: 14px;
+}
+
+.com_head a {
+	color: #327ebe;
+	float: right;
+	margin-right: 40px;
+	font-size: 14px;
+}
+
+.com_head a i {
+	margin-left: 5px;
+	line-height: 40px;
+}
+
+.com_head a:hover {
+	color: #d2272d;
+}
+
+.com_title {
+	width: 100%;
+	margin: 0px auto;
+	height: 40px;
+	line-height: 40px;
+	font-size: 14px;
+	color: #323232;
+	background: #f5f5f5;
+}
+
+.com_title font {
+	color: #327ebe;
+}
+
+.com_title01 {
+	height: 50px;
+	line-height: 50px;
+	width: 100%;
+	border-bottom: #3578ba 1px dotted;
+	border-top: #e8e8e8 1px solid;
+	margin-top: -4px;
+} /*  这里修改过 margin-top*/
+.com_title01 span {
+	margin-left: 20px;
+	font-size: 14px;
+	line-height: 50px;
+	color: #555;
+	font-weight: bold;
+}
+
+.com_title01  a {
+	color: #5078cb;
+}
+
+.com_title01  a:hover {
+	cursor: pointer;
+	color: #55b6ff;
+}
+
+/*招标单*/
+.tender-list02 dl {
+	width: 100%;
+	margin: 0 auto;
+}
+
+.tender-list02 dl dt {
+	width: 100%;
+	margin: 0 auto;
+	height: 40px;
+}
+
+.tender-list02 dl dt span {
+	height: 50px;
+	line-height: 50px;
+	display: inline-block;
+	color: #999;
+}
+
+.tender-list02 dl dd {
+	width: 100%;
+	margin: 0 auto;
+	height: 50px;
+	border-bottom: #ccc 1px dotted;
+	overflow: hidden;
+	position: relative;
+}
+
+.tender-list02 dl dd:hover {
+	border: #d32526 1px solid;
+}
+
+.tender-list02 dl dd span {
+	height: 50px;
+	line-height: 50px;
+	display: inline-block;
+}
+
+.tender-list02 dl span {
+	width: 11%;
+	font-size: 14px;
+	float: left;
+	text-align: center;
+}
+
+.tender-list02 dl span.wid01 {
+	width: 22%;
+}
+
+.tender-list02 dl span.wid02 {
+	width: 18%;
+}
+
+.tender-list02 dl span.wid03 {
+	width: 5%;
+}
+
+.tender-list02 .editable {
+	text-align: center;
+	width: 100%;
+}
+
+.tender-list02  .scroll-y dd input {
+	width: 100%;
+	height: 34px;
+	border: none;
+	font-size: 14px;
+	padding-left: 4px;
+	text-align: center;
+	vertical-align: middle;
+	line-height: 34px;
+}
+
+.tender-list02 dl span.wid03 a {
+	display: none;
+}
+
+.tender-list02 dl span.wid03 a.active {
+	display: inline-block;
+}
+
+.tender-list02 dl span.wid03 a i {
+	width: 20px;
+	height: 20px;
+	display: inline-block;
+	line-height: 20px;
+	background: #d2272d;
+	text-align: center;
+	border-radius: 100%;
+	color: #fff;
+}
+
+.tender-list02 .com_title01 a {
+	float: right;
+	margin-right: 45px;
+	font-size: 14px;
+	line-height: 50px;
+}
+
+.scroll-y {
+	width: 100%;
+	margin: 0 auto;
+	max-height: 500px;
+}
+
+.scroll-y.active {
+	overflow-y: scroll;
+	overflow-x: hidden;
+}
+
+#resultTop {
+	margin-top: -10px;
+	border-radius: 0px 20px 0px 0px;
+	box-shadow: 0 0 3px #ccc;
+	background: linear-gradient(to top, #e7e7e7 0%, #ffffff 100%);
+	height: 40px;
+	font-size: 14px;
+	line-height: 40px;
+	padding: 0;
+}
+
+#resultTop strong {
+	line-height: 40px;
+	font-weight: bold;
+	font-size: 14px;
+	padding-left: 15px;
+}
+</style>
+
+<div class="ng-scope" style="width: 1170px; margin-left: -240px;">
+    <form name="tenderForm">
+        <div class="purc-tender">
+            <div class="condition block" id="resultTop">
+                <strong>|&nbsp;&nbsp;&nbsp;公供询价单</strong>
+            </div>
+            <div class="tender-content ng-scope">
+                <div class="title-div" style="border-bottom: 1px dashed #327ebe;">
+                    <span>询价信息</span>&nbsp;
+                    <span style="color: rgb(211,37,38);">*</span>
+                </div>
+                <div class="row base-info">
+                    <div class = "col-xs-4">
+                        <div class="tender-desc">询价编号:</div>
+                        <div ng-bind="::inquiryItem.inquiry.code"></div>
+                    </div>
+                    <div class = "col-xs-4">
+                        <div class="tender-desc">招标企业:</div>
+                        <div ng-bind="::inquiryItem.inquiry.enterprise.enName"></div>
+                    </div>
+                    <div class = "col-xs-4">
+                        <div class="tender-desc">联系人:</div>
+                        <div ng-bind="::inquiryItem.inquiry.recorder"></div>
+                    </div>
+                    <div class = "col-xs-4">
+                        <div class="tender-desc">联系电话:</div>
+                        <div ng-bind="::inquiryItem.inquiry.userBaseInfo.userTel"></div>
+                    </div>
+                    <div class="col-xs-4">
+                        <span class="tender-desc">报价截止时间:</span>
+                        <div ng-bind="::inquiryItem.inquiry.endDate | date:'yyyy-MM-dd'"></div>
+                    </div>
+                    <div class="col-xs-4">
+                    </div>
+                    <div class="col-xs-12">
+                        <div class="tender-desc">附件:</div>
+                        <div ng-if="tender.tenderAttaches.length" class="col-xs-10">
+                            <a class="file" ng-repeat="attach in inquiryItem.inquiry.attachs" href="file/{{attach.id}}">{{::attach.name}}</a>
+                        </div>
+                        <div ng-if="inquiryItem.inquiry.attachs == 0">无</div>
+                    </div>
+                </div>
+				<div class="title-div" style="border-bottom: 1px dashed #327ebe;">
+                    <span>物料信息</span>&nbsp;
+                    <span style="color: rgb(211,37,38);">*</span>
+                </div>
+                <div class="row base-info">
+                    <div class = "col-xs-4">
+                        <div class="tender-desc">物料名称:</div>
+                        <div ng-bind="::inquiryItem.product.title"></div>
+                    </div>
+                    <div class = "col-xs-4">
+                        <div class="tender-desc">物料编号:</div>
+                        <div ng-bind="::inquiryItem.product.code"></div>
+                    </div>
+                    <div class = "col-xs-4">
+                        <div class="tender-desc">物料品牌:</div>
+                        <div ng-bind="::inquiryItem.product.brand"></div>
+                    </div>
+                    <div class = "col-xs-12">
+                        <div class="tender-desc">物料规格</div>
+                        <div ng-bind="::inquiryItem.product.spec"></div>
+                    </div>
+                    <div class="col-xs-4">
+                        <span class="tender-desc">物料单位:</span>
+                        <div ng-bind="::inquiryItem.product.unit"></div>
+                    </div>
+                    <div class="col-xs-4">
+                    	<span class="tender-desc">开始时间:</span>
+                        <div ng-bind="::inquiryItem.fromDate| date:'yyyy-MM-dd'"></div>
+                    </div>
+                    <div class="col-xs-4">
+                    	<span class="tender-desc">截止时间:</span>
+                        <div ng-bind="::inquiryItem.toDate| date:'yyyy-MM-dd'"></div>
+                    </div>
+                </div>
+                <div class="col-xs-12" style="padding: 30px;">
+                    <div ng-show="!currentHasBid" class="col-xs-2 pull-right btn-publish">
+                        <button class="btn" ng-click="transtoInquiry(inquiryItem.id)" ng-disabled="enterprise.uu == inquiryItem.inquiry.enterprise.uu || nowdate > inquiryItem.toDate" ng-hide="inquiryItem.overdue == 1" title="如果招标单已过期,将无法进入投标">我要报价</button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </form>
+</div>

+ 221 - 0
src/main/webapp/resources/tpl/index/baseInfo/inquiry_list.html

@@ -0,0 +1,221 @@
+<!--  公共询价  -->
+<link rel="stylesheet" href="static/css/add.css "/>
+<style>
+
+/*新增样式 2017-04-19*/
+#tender-list{
+    width: 1170px;
+    margin-left: -240px;
+}
+#tender-list .tender-label{
+    height: auto;
+}
+#tender-list #resultTop{
+    margin-top: -10px;
+    border-radius: 0px 20px 0px 0px;
+    box-shadow: 0 0 3px #ccc;
+    background: linear-gradient(to top, #e7e7e7 0%,#ffffff 100%);
+    height: 40px;
+    font-size: 14px;
+    line-height: 40px;
+    padding: 0;
+}
+#tender-list #resultTop strong{
+    line-height: 40px;
+    font-weight: bold;
+    font-size: 14px;
+    padding-left: 15px;
+}
+.tender-list-content{
+    width: 100%;
+    background: #fff;
+    margin: 0 auto;
+}
+    .tender-list-content .filter{
+        margin-top: 20px;
+    }
+    .tender-list-content .filter span{
+        width: 50px;
+        float: left;
+        text-align: center;
+        display: inline-block;
+        font-size: 14px;
+        color: #000;
+        height: 40px;
+        line-height: 30px;
+        font-weight: 600;
+        margin-right: 20px;
+    }
+    .tender-list-content .filter div{
+        float: left;
+    }
+    .tender-list-content .filter div a{
+        padding: 1.5px 10px;
+        display: inline-block;
+        line-height: 30px;
+        font-size: 14px;
+        text-align: center;
+        float: left;
+        margin-right: 15px;
+    }
+    .tender-list-content .filter div a.active,.tender-list-content .filter div a:hover{
+        background: #5078cb;
+        color: #fff;
+    }
+    .tender-list-content .filter div.form-group{
+        position: relative;
+    }
+    .tender-list-content .filter div.form-group .input-group-addon{
+        position: absolute;
+        right: 0;
+        top: 0;
+        background: #5078cb;
+        color: #fff;
+        height: 35px;
+        width: 55px;
+        border: none;
+        font-size: 18px;
+        text-align: center;
+        line-height: 20px;
+    }
+    .tender-list-content .filter div.form-group .input-group-addon:hover{
+        background: #3a89d1;
+    }
+    .tender-list-content .filter div.form-group input{
+        border-radius: 0;
+        height: 35px;
+        line-height: 35px;
+        border: #5078cb 1px solid;
+    }
+    .tender-list-tab{
+        border-top: #dbe7ff 1px solid;
+    }
+.inquiry-table{
+    width: 100%;
+}
+.inquiry-table tr{
+    height: 60px;
+}
+.inquiry-table tbody tr td,.inquiry-table thead tr th{
+    border-bottom: #dbe7ff 1px dashed !important;
+    font-size: 14px;
+    vertical-align: middle;
+    border-top: none !important;
+    font-weight: inherit;
+    position: relative;
+    text-align: center;
+}
+.inquiry-table tbody tr td em{
+    padding: 1px 5px;
+    display: inline-block;
+    background: #eb676c;
+    font-size: 14px;
+    color: #fff;
+    text-align: center;
+    line-height: 23px;
+    margin-right: 10px;
+}
+.inquiry-table tbody tr td img{
+    margin-left: 20px;
+    margin-right: 8px;
+}
+.inquiry-table tbody tr td:first-child{
+    text-align: left;
+}
+.text-trans{
+    opacity: 1;
+    top: 12px;
+    right: 50px;
+ }
+.overdue{
+    color: #f47a86;
+    border: #f47a86 1px solid;
+    background: transparent;
+}
+</style>
+
+<div class="ng-scope">
+    <!--<form name="tenderForm">-->
+        <div class="purc-tender" id="tender-list">
+            <div class="tender-label list-unstyled">
+                <div class="condition block" id="resultTop">
+                    <strong>|&nbsp;&nbsp;&nbsp;公共招标</strong>
+                </div>
+                <div class="tender-list-content">
+                    <div class="container">
+                       <div class="filter row">
+                           <span>时间</span>
+                           <div>
+                               <a ng-click="changeDateZone(-1)" title="" ng-class="{'active':condition.dateZone=='-1'}">最新</a>
+                               <a ng-click="changeDateZone(7)" title="" ng-class="{'active':condition.dateZone=='7'}">一个星期内</a>
+                               <a ng-click="changeDateZone(1)" title="" ng-class="{'active':condition.dateZone=='1'}">一个月内</a>
+                               <a ng-click="changeDateZone(3)" title="" ng-class="{'active':condition.dateZone=='3'}">三个月内</a>
+                               <a ng-click="changeDateZone(6)" title="" ng-class="{'active':condition.dateZone=='6'}">半年内</a>
+                               <a ng-click="changeDateZone()" title="" ng-class="{'active':condition.dateZone== null}">一年内</a>
+                           </div>
+                       </div>
+                        <div class="filter row">
+                            <span>查询</span>
+                            <div class="form-group" style="width: 310px;">
+                                <input type="search" class="form-control" ng-model="keyword" ng-search="onSearch()" />
+                                <div class="input-group-addon">
+                                    <i class="fa fa-search" ng-click="onSearch()"></i>
+                                </div>
+                            </div>
+                            <div style="padding-left: 50px; font-size: 14px; line-height: 35px;">
+                            	    共{{tableParams.total()}}条
+                            </div>
+                        </div>
+                        <div class="tender-list-tab">
+                           <table class="table inquiry-table" ng-table="tableParams">
+                               <thead>
+                                    <tr>
+                                        <th>企业名称</th>
+                                        <th width="200">产品名称</th>
+                                        <th width="200">产品型号</th>
+                                        <th width="150">发布日期</th>
+                                        <th width="150">报价截止日期</th>
+                                        <th width="60"></th>
+                                    </tr>
+                               </thead>
+                               <tbody ng-repeat="inquiryItem in $data">
+                                    <tr ng-click="toDetail(inquiryItem.id)" title="查看详情">
+                                        <td><img src="resources/img/icon/inquiry.png" /><em>询价信息</em><a>{{::inquiryItem.inquiry.enterprise.enName}}</a></td>
+                                        <td>{{::inquiryItem.product.title}}</td>
+                                        <td>{{::inquiryItem.product.code}}</td>
+                                        <td>{{::inquiryItem.inquiry.date| date: 'yyyy-MM-dd'}}</td>
+                                        <td>{{::inquiryItem.toDate| date: 'yyyy-MM-dd'}}</td>
+                                        <td ng-if="nowdate > inquiryItem.toDate"><span class="text-trans overdue">已过期</span></td>
+                                    </tr>
+                               </tbody>
+                           </table>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    <!--</form>-->
+</div>
+<script src="static/lib/jquery/jquery.min.js"></script>
+<script>
+    $(function(){
+        var size10= $(".tender-list02 dl dd").size();
+        if(size10 > 10){
+            $(".scroll-y").addClass("active");
+        }else{
+            $(".scroll-y").removeClass("active");
+        }
+
+        //新增收货地址
+        $(".tender-content .base-info .add-address").click(function(){
+            document.getElementById('shipAddress').reset();
+            $(".bomb-box").show();
+        });
+        $(".bomb-box .box04 .off,.box04 .many-file-btn .btn02").click(function(){
+            $(".bomb-box").hide();
+        });
+        $(".bomb-box .box04 .off,.box04 .many-file-btn .btn01").click(function(){
+            $(".bomb-box").hide();
+        })
+    })
+</script>

+ 2 - 2
src/main/webapp/resources/tpl/index/home/left.html

@@ -153,13 +153,13 @@
 	<div class="pane service" ng-controller="SaleInquiryCtrl">
 		<div class="pane-header">
 			<img src="static/img/home/xunjia.png"> 询价信息<a class="pull-right text-muted"></a>
-			<span class="pull-right"><a href="#/sale/inquiry" class="text-light">更多>></a></span>
+			<span class="pull-right"><a ui-sref="baseInfo.inquiryList" class="text-light">更多>></a></span>
 		</div>
 		<div class="pane-body">
 			<ul class="list-unstyled detail">
 				<li ng-repeat="msg in message | orderBy : '- inid'">
 					<!--<span ng-show="tender.isNew"><img src="static/img/home/newTender.png"></span>-->
-					<a ui-sref="sale.inquiry_detail({id:msg.inid})"class="text-light"><em style="font-style: normal;">{{msg.pordName}}</em><img src="static/img/home/new.png"/></a>
+					<a ui-sref="baseInfo.inquiryListDetail({id:msg.inid})"class="text-light"><em style="font-style: normal;">{{msg.pordName}}</em><img src="static/img/home/new.png"/></a>
 				</li>
 				<li ng-show="message == null || message == ''" class="grey">
 					暂无询价信息!

+ 18 - 3
src/main/webapp/resources/tpl/index/purc/inquiry_new.html

@@ -840,6 +840,10 @@ input[type="radio"], input[type="checkbox"] {
 .tender-content input{
     font-size: 14px;
 }
+
+#isOpenChoice {
+	margin-top: 10px;
+}
 </style>
 <div class="ng-scope">
     <form name="tenderForm">
@@ -953,10 +957,21 @@ input[type="radio"], input[type="checkbox"] {
                 </div>
                 <!-- <div class="com_title01" style="border-bottom: 1px solid #969595;"><a ng-click="add()" style="margin-left: 20px;"><i class="fa fa-plus"></i>新增产品明细</a></div>-->
                 <div  class="title-div" style="border-bottom: 1px dashed #327ebe;">
-                    <span>供应商信息</span>
-                    <a class="add-vendor tender-desc" ng-click="dbfindVendor()" href="javascript:void(0)">
+                  	<span>供应商信息</span>
+                  	 <a class="add-vendor tender-desc" ng-click="dbfindVendor()" href="javascript:void(0)" ng-if="inquiry.isOpen == 0">
                         <i class="fa fa-plus-square"></i>添加供应商&nbsp;
                     </a>
+                   	<div class="col-xs-12" id="isOpenChoice">
+                   		<div class="tender-desc">是否开放报名:</div>
+                        <div class="input-select col-xs-4">
+                            <input class="tender-input" name="ifOpen" type="radio" value="1" ng-click="removeChecked()" ng-model="inquiry.isOpen"/>
+                            <span>允许优软平台的供应商参与</span>
+                        </div>
+                        <div class="input-select col-xs-4">
+                            <input  class="tender-input" name="ifOpen" type="radio" value="0" ng-model="inquiry.isOpen"/>
+                            <span>只允许我邀请的供应商参与</span>
+                        </div>
+                    </div>
                 </div>
                 <div class="row vend-info">
                     <div class="col-xs-12" style="" ng-repeat="vendor in vendors">
@@ -974,7 +989,7 @@ input[type="radio"], input[type="checkbox"] {
                         </div>
                     </div>
                 </div>
-                <div class="col-xs-12" style="padding: 30px;" ng-if="inquiry.inquiryItems.length>0 && vendors.length>0">
+                <div class="col-xs-12" style="padding: 30px;" ng-if="inquiry.inquiryItems.length>0">
                     <div class="col-xs-2 pull-right btn-publish">
                         <button class="btn" ng-disabled="tenderForm.$invalid " ng-click="save()">保存</button>
                     </div>

+ 2 - 1
src/main/webapp/resources/tpl/index/purc/inquiry_unapply.html

@@ -351,7 +351,8 @@
 				备注:<span ng-bind="::inquiry.remark"></span>
 			</td>
 			<td colspan="1" class="text-center">
-				<a ng-click="submit(inquiry.id)">提交</a>
+				<a ng-click="submit(inquiry.id)" ng-if="inquiry.isOpen==0">提交</a>
+				<a ng-click="publish(inquiry.id)" ng-if="inquiry.isOpen==1">发布</a>
 				<a ng-click="clearOrder(inquiry.id)">删除</a>
 			</td>
 		</tr>