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

Merge branch 'dev' into dev-mysql

# Conflicts:
#	pom.xml
#	src/main/java/com/uas/platform/b2b/v2/service/impl/InviteRecordServiceImpl.java
dongbw 8 лет назад
Родитель
Сommit
8e306184e0
22 измененных файлов с 481 добавлено и 486 удалено
  1. 6 6
      pom.xml
  2. 31 1
      src/main/java/com/uas/platform/b2b/controller/BaseInfoController.java
  3. 45 0
      src/main/java/com/uas/platform/b2b/controller/ProductUserBatchController.java
  4. 78 0
      src/main/java/com/uas/platform/b2b/erp/controller/ErpVendorRecommendController.java
  5. 9 9
      src/main/java/com/uas/platform/b2b/erp/controller/VendorRecommendController.java
  6. 1 1
      src/main/java/com/uas/platform/b2b/service/BaseInfoService.java
  7. 5 2
      src/main/java/com/uas/platform/b2b/service/VendorService.java
  8. 2 10
      src/main/java/com/uas/platform/b2b/service/impl/BaseInfoServiceImpl.java
  9. 1 1
      src/main/java/com/uas/platform/b2b/service/impl/PubInquiryServiceImpl.java
  10. 36 5
      src/main/java/com/uas/platform/b2b/service/impl/SaleQuotationServiceImpl.java
  11. 66 50
      src/main/java/com/uas/platform/b2b/service/impl/VendorsServiceImpl.java
  12. 9 3
      src/main/java/com/uas/platform/b2b/v2/controller/InviteRecordController.java
  13. 13 0
      src/main/java/com/uas/platform/b2b/v2/model/Invitation.java
  14. 40 15
      src/main/java/com/uas/platform/b2b/v2/service/impl/InviteRecordServiceImpl.java
  15. 69 351
      src/main/webapp/resources/js/index/app.js
  16. 5 1
      src/main/webapp/resources/js/index/services/BaseInfo.js
  17. 17 7
      src/main/webapp/resources/tpl/index/baseInfo/modal/quotation_modal.html
  18. 6 2
      src/main/webapp/resources/tpl/index/purc/pubInquiry.html
  19. 8 0
      src/main/webapp/resources/tpl/index/sale/inquiry.html
  20. 32 4
      src/main/webapp/resources/tpl/index/sale/pubinquiry.html
  21. 2 0
      src/main/webapp/resources/tpl/index/sale/pubinquiry_detail.html
  22. 0 18
      src/main/webapp/resources/tpl/index/sale/quotation_new.html

+ 6 - 6
pom.xml

@@ -9,7 +9,6 @@
         <groupId>com.uas.platform</groupId>
         <artifactId>platform</artifactId>
         <version>0.0.1-SNAPSHOT</version>
-        <relativePath>../platform</relativePath>
     </parent>
     <profiles>
         <profile>
@@ -20,6 +19,7 @@
                 <!-- static plugin -->
                 <static-path>static</static-path>
             </properties>
+
         </profile>
         <profile>
             <!-- 测试环境 -->
@@ -287,11 +287,11 @@
             <version>0.0.1-SNAPSHOT</version>
         </dependency>
 
-        <dependency>
-            <groupId>com.uas.sso</groupId>
-            <artifactId>sso-common</artifactId>
-            <version>0.0.1-SNAPSHOT</version>
-        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>com.uas.sso</groupId>-->
+            <!--<artifactId>sso-common</artifactId>-->
+            <!--<version>0.0.1-SNAPSHOT</version>-->
+        <!--</dependency>-->
 
         <dependency>
             <groupId>com.uas.ps</groupId>

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

@@ -481,7 +481,37 @@ public class BaseInfoController {
 	@ResponseBody
 	public SPage<UserSpaceDetail> getUserSpaceDetails(PageParams params, String keyword)
 			throws Exception {
-		return baseInfoService.getUserSpaceDetails(params, keyword);
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		pageParams.getFilters().put("searchstatus", Constant.YES);
+		// 排序条件
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("status", false, Type.LONG, new Long(1)));
+		sortList.add(new Sort("id", true, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return baseInfoService.getUserSpaceDetails(pageParams, keyword);
+	}
+
+	/**
+	 * 顶部通过关键词查询账户中心的相关的企业信息
+	 *
+	 * @param keyword
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "/getUserSpaceDetails/done", method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<UserSpaceDetail> getUserSpaceDetailsDone(PageParams params, String keyword)
+			throws Exception {
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		pageParams.getFilters().put("searchstatus", Constant.YES);
+		pageParams.getFilters().put("status", Status.ENABLED.value());
+		// 排序条件
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("status", false, Type.LONG, new Long(1)));
+		sortList.add(new Sort("id", true, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return baseInfoService.getUserSpaceDetails(pageParams, keyword);
 	}
 	
 	/**

+ 45 - 0
src/main/java/com/uas/platform/b2b/controller/ProductUserBatchController.java

@@ -0,0 +1,45 @@
+package com.uas.platform.b2b.controller;
+
+import com.uas.platform.b2b.service.PurchaseInquiryService;
+import com.uas.platform.b2b.service.PurchaseOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Created by dongbw
+ * 18/03/18 11:34.
+ */
+@RestController
+@RequestMapping("/batch/covertouser")
+public class ProductUserBatchController {
+
+    @Autowired
+    private PurchaseInquiryService purchaseInquiryService;
+
+    @Autowired
+    private PurchaseOrderService purchaseOrderService;
+
+    /**
+     * 根据企业UU批量处理询价单明细中的物料转入供应商报价人个人物料
+     * @param enUU 采购方企业UU
+     */
+    @RequestMapping(value = "/inquiryItem", method = RequestMethod.GET)
+    public void coverInquiryItemProdToUser (Long enUU) throws Exception {
+        //TODO 添加不需要enUU的处理
+        System.out.println("进入接口");
+        purchaseInquiryService.coverInquiryItemProdToUser(enUU);
+    }
+
+    /**
+     * 根据企业UU批量处理采购单中的物料转入供应商报价人个人物料
+     * @param enUU 采购方企业UU
+     */
+    @RequestMapping(value = "/purchaseOrder", method = RequestMethod.GET)
+    public void coverPurchaseOrderItemProdToUser (Long enUU) throws Exception {
+        //TODO 添加不需要enUU的处理
+        System.out.println("进入接口");
+        purchaseOrderService.coverPurchaseOrderItemProdToUser(enUU);
+    }
+}

+ 78 - 0
src/main/java/com/uas/platform/b2b/erp/controller/ErpVendorRecommendController.java

@@ -0,0 +1,78 @@
+package com.uas.platform.b2b.erp.controller;
+
+import com.uas.account.support.Page;
+import com.uas.platform.b2b.erp.model.VendorRecommend;
+import com.uas.platform.b2b.erp.support.ErpBufferedLogger;
+import com.uas.platform.b2b.model.Product;
+import com.uas.platform.b2b.service.VendorService;
+import com.uas.platform.b2b.support.SystemSession;
+import com.uas.platform.core.logging.BufferedLoggerManager;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 供应商推荐 -- 2018年4月8日 21:57:40  因为UAS不能立刻同时发布,所以保留原接口
+ * Created by dongbw
+ * 18/01/18 14:00.
+ */
+@RestController
+@RequestMapping("/erp/recommend")
+public class ErpVendorRecommendController {
+
+    @Autowired
+    private VendorService vendorService;
+
+    private final static ErpBufferedLogger logger = BufferedLoggerManager.getLogger(ErpBufferedLogger.class);
+
+    /**
+     * 获取当前企业推荐供应商
+     *
+     * @param productMatchCondition 物料模糊匹配条件
+     * @param enterpriseMatchCondition 企业搜索匹配条件
+     * @param page 页面
+     * @param size 每页条数
+     * @return
+     */
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public Page<VendorRecommend> getVendorRecommend (String productMatchCondition, String enterpriseMatchCondition, int page, int size) {
+        Long enUU = SystemSession.getUser().getEnterprise().getUu();
+        Page<VendorRecommend> vendorRecommendPage = vendorService.getVendorRecommend(enUU, productMatchCondition, enterpriseMatchCondition, page, size);
+//        logger.log("供应商推荐","获取当前企业推荐供应商:" + enUU, vendorRecommendPage.getNumberOfElements());
+        return vendorRecommendPage;
+    }
+
+    /**
+     * 根据条件获取物料型号和品牌值对(UAS品牌和型号联想词接口)
+     *
+     * @param field 需要的字段名
+     * @param condition 物料模糊匹配条件
+     * @return 物料型号和品牌值对List
+     */
+    @RequestMapping(value = "/product/associate", method = RequestMethod.GET)
+    public List<Product> getProductAssociate (String field, String condition) {
+        List<Product> products = vendorService.getProductAssociate(field, condition);
+//        logger.log("供应商推荐","根据条件获取物料型号和品牌值对", products.size());
+        return products;
+    }
+
+    /**
+     * 获取推荐企业物料列表(匹配到的排前面)
+     * @param page 页数
+     * @param size 每页条数
+     * @param vendUU 推荐供应商企业UU
+     * @param productMatchCondition 列表的物料匹配搜索条件  不带where
+     * @param whereCondition where条件(product的筛选条件拼接) 不带where
+     * @return
+     */
+    @RequestMapping(value = "/detail", method = RequestMethod.GET)
+    public Page<Product> getVendorRecommendDetail(int page, int size, Long vendUU, String productMatchCondition, String whereCondition) {
+        Long enUU = SystemSession.getUser().getEnterprise().getUu();
+        Page<Product> productPage = vendorService.getProductsByVendorRecommend(page, size, enUU, vendUU, productMatchCondition, whereCondition);
+//        logger.log("供应商推荐","获取当前企业推荐供应商:" + enUU, productPage.getNumberOfElements());
+        return productPage;
+    }
+}

+ 9 - 9
src/main/java/com/uas/platform/b2b/erp/controller/VendorRecommendController.java

@@ -5,7 +5,6 @@ import com.uas.platform.b2b.erp.model.VendorRecommend;
 import com.uas.platform.b2b.erp.support.ErpBufferedLogger;
 import com.uas.platform.b2b.model.Product;
 import com.uas.platform.b2b.service.VendorService;
-import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,7 +19,7 @@ import java.util.List;
  * 18/01/18 14:00.
  */
 @RestController
-@RequestMapping("/erp/recommend")
+@RequestMapping("/public/recommend")
 public class VendorRecommendController {
 
     @Autowired
@@ -38,9 +37,9 @@ public class VendorRecommendController {
      * @return
      */
     @RequestMapping(value = "/list", method = RequestMethod.GET)
-    public Page<VendorRecommend> getVendorRecommend (String productMatchCondition, String enterpriseMatchCondition, int page, int size) {
-        Page<VendorRecommend> vendorRecommendPage = vendorService.getVendorRecommend(productMatchCondition, enterpriseMatchCondition, page, size);
-        logger.log("供应商推荐","获取当前企业推荐供应商:" + SystemSession.getUser().getEnterprise().getUu(), vendorRecommendPage.getNumberOfElements());
+    public Page<VendorRecommend> getVendorRecommend (Long enUU, String productMatchCondition, String enterpriseMatchCondition, int page, int size) {
+        Page<VendorRecommend> vendorRecommendPage = vendorService.getVendorRecommend(enUU, productMatchCondition, enterpriseMatchCondition, page, size);
+//        logger.log("供应商推荐","获取当前企业推荐供应商:" + enUU, vendorRecommendPage.getNumberOfElements());
         return vendorRecommendPage;
     }
 
@@ -54,7 +53,7 @@ public class VendorRecommendController {
     @RequestMapping(value = "/product/associate", method = RequestMethod.GET)
     public List<Product> getProductAssociate (String field, String condition) {
         List<Product> products = vendorService.getProductAssociate(field, condition);
-        logger.log("供应商推荐","根据条件获取物料型号和品牌值对" + SystemSession.getUser().getEnterprise().getUu(), products.size());
+//        logger.log("供应商推荐","根据条件获取物料型号和品牌值对", products.size());
         return products;
     }
 
@@ -62,15 +61,16 @@ public class VendorRecommendController {
      * 获取推荐企业物料列表(匹配到的排前面)
      * @param page 页数
      * @param size 每页条数
+     * @param enUU 当前企业UU
      * @param vendUU 推荐供应商企业UU
      * @param productMatchCondition 列表的物料匹配搜索条件  不带where
      * @param whereCondition where条件(product的筛选条件拼接) 不带where
      * @return
      */
     @RequestMapping(value = "/detail", method = RequestMethod.GET)
-    public Page<Product> getVendorRecommendDetail(int page, int size, Long vendUU, String productMatchCondition, String whereCondition) {
-        Page<Product> productPage = vendorService.getProductsByVendorRecommend(page, size, vendUU, productMatchCondition, whereCondition);
-        logger.log("供应商推荐","获取当前企业推荐供应商:" + SystemSession.getUser().getEnterprise().getUu(), productPage.getNumberOfElements());
+    public Page<Product> getVendorRecommendDetail(int page, int size, Long enUU, Long vendUU, String productMatchCondition, String whereCondition) {
+        Page<Product> productPage = vendorService.getProductsByVendorRecommend(page, size, enUU, vendUU, productMatchCondition, whereCondition);
+//        logger.log("供应商推荐","获取当前企业推荐供应商:" + enUU, productPage.getNumberOfElements());
         return productPage;
     }
 }

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/BaseInfoService.java

@@ -98,7 +98,7 @@ public interface BaseInfoService {
 	 * @return
 	 * @throws Exception
 	 */
-	SPage<UserSpaceDetail> getUserSpaceDetails(PageParams params, String keyword) throws Exception;
+	SPage<UserSpaceDetail> getUserSpaceDetails(com.uas.search.b2b.model.PageParams params, String keyword) throws Exception;
 
 	/**
 	 * 通过id获取附件信息

+ 5 - 2
src/main/java/com/uas/platform/b2b/service/VendorService.java

@@ -124,6 +124,7 @@ public interface VendorService {
 	/**
 	 * 获取当前企业推荐供应商
 	 *
+     * @param enUU 当前企业UU
 	 * @param productMatchCondition 物料模糊匹配条件
 	 * @param enterpriseMatchCondition 企业搜索匹配条件
 	 * @param productCondition 物料精确匹配条件
@@ -131,7 +132,7 @@ public interface VendorService {
 	 * @param size 每页条数
 	 * @return
 	 */
-	com.uas.account.support.Page<VendorRecommend> getVendorRecommend(String productMatchCondition, String enterpriseMatchCondition, int page, int size);
+	com.uas.account.support.Page<VendorRecommend> getVendorRecommend(Long enUU, String productMatchCondition, String enterpriseMatchCondition, int page, int size);
 
 	/**
 	 * 获取推荐企业物料列表(匹配到的排前面)
@@ -139,9 +140,11 @@ public interface VendorService {
 	 * @param size 每页条数
 	 * @param productMatchCondition 列表的物料匹配搜索条件
 	 * @param whereCondition where条件(product的筛选条件拼接)
+     * @param enUU 当前企业UU
+     * @param vendUU 供应商企业UU
 	 * @return
 	 */
-    com.uas.account.support.Page<Product> getProductsByVendorRecommend(int page, int size, Long vendUU, String productMatchCondition,  String whereCondition);
+    com.uas.account.support.Page<Product> getProductsByVendorRecommend(int page, int size, Long enUU, Long vendUU, String productMatchCondition,  String whereCondition);
 
 	/**
 	 * 根据条件获取物料型号和品牌值对

+ 2 - 10
src/main/java/com/uas/platform/b2b/service/impl/BaseInfoServiceImpl.java

@@ -557,16 +557,8 @@ public class BaseInfoServiceImpl implements BaseInfoService {
 	}
 
 	@Override
-	public SPage<UserSpaceDetail> getUserSpaceDetails(PageParams params, String keyword) throws Exception {
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
-		pageParams.getFilters().put("searchstatus", Constant.YES);
-		// 排序条件
-		List<Sort> sortList = new ArrayList<>();
-		sortList.add(new Sort("status", false, Type.LONG, new Long(1)));
-		sortList.add(new Sort("id", true, Type.LONG, new Long(1)));
-		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
-		SPage<com.uas.account.entity.UserSpaceDetail> details = searchService.searchUserSpaceDetailCheckIds(keyword,
-				pageParams);
+	public SPage<UserSpaceDetail> getUserSpaceDetails(com.uas.search.b2b.model.PageParams params, String keyword) throws Exception {
+		SPage<com.uas.account.entity.UserSpaceDetail> details = searchService.searchUserSpaceDetailCheckIds(keyword, params);
 		SPage<UserSpaceDetail> userSpaceDetails = new SPage<UserSpaceDetail>();
 		List<UserSpaceDetail> spaceDetails = new ArrayList<UserSpaceDetail>();
 		if (!CollectionUtils.isEmpty(details.getContent())) {

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PubInquiryServiceImpl.java

@@ -562,7 +562,7 @@ public class PubInquiryServiceImpl implements PubInquiryService {
     @Override
     public ModelMap refuseInquiry(Long id) throws Exception {
         ModelMap map = new ModelMap();
-        InquiryUtils.decide(id, Constant.YES);
+        InquiryUtils.decide(id, Constant.NO);
         map.put("success", "操作成功");
         return map;
     }

+ 36 - 5
src/main/java/com/uas/platform/b2b/service/impl/SaleQuotationServiceImpl.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2b.service.impl;
 
 import com.uas.platform.b2b.core.util.ContextUtils;
+import com.uas.platform.b2b.core.util.ThreadUtils;
 import com.uas.platform.b2b.dao.*;
 import com.uas.platform.b2b.erp.model.Inquiry;
 import com.uas.platform.b2b.event.SaleQuotationDecideReleaseEvent;
@@ -9,10 +10,13 @@ import com.uas.platform.b2b.model.*;
 import com.uas.platform.b2b.service.ProductUsersService;
 import com.uas.platform.b2b.service.SaleQuotationService;
 import com.uas.platform.b2b.support.SystemSession;
+import com.uas.platform.b2b.support.UsageBufferedLogger;
 import com.uas.platform.core.exception.NotFoundException;
+import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Status;
+import com.uas.platform.core.persistence.Logger;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.search.b2b.model.SPage;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -52,6 +56,11 @@ public class SaleQuotationServiceImpl implements SaleQuotationService {
 	@Autowired
     private ProductUsersService productUsersService;
 
+	@Autowired
+    private VendorDao vendorDao;
+
+    private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
+
 	@Override
 	public void save(List<SaleQuotationItem> items) {
 		saleQuotationItemDao.save(items);
@@ -112,15 +121,37 @@ public class SaleQuotationServiceImpl implements SaleQuotationService {
 		item.getQuotation().setEnUU(SystemSession.getUser().getEnterprise().getUu());
 		item.getQuotation().setUserUU(SystemSession.getUser().getUserUU());
 		item.setNumber((short) 1);
-		SaleQuotationItem newItem = saleQuotationItemDao.save(item);
+		final SaleQuotationItem newItem = saleQuotationItemDao.save(item);
 		List<SaleQuotationItem> list = new ArrayList<SaleQuotationItem>();
 		list.add(newItem);
-        // 更新我的物料库信息
-        productUsersService.coverToMyProduct(item.getProductId(), SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "主动报价");
-		return newItem;
+        ThreadUtils.task(new Runnable() {
+            @Override
+            public void run() {
+                // 更新我的物料库信息
+                productUsersService.coverToMyProduct(newItem.getProductId(), SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "主动报价");
+            }
+        }).run();
+        checkCust(item.getQuotation().getCustUU(), item.getQuotation().getEnUU(), item.getQuotation().getCustUserUU(), item.getQuotation().getUserUU());
+        return newItem;
 	}
 
-	@Override
+    private void checkCust(Long custUU, Long enUU, Long custUserUU, Long userUU) {
+        List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(custUU, enUU);
+        if (CollectionUtils.isEmpty(vendors)) {
+            // 添加客户
+            Vendor vendor = new Vendor();
+            vendor.setCustswitch(Constant.YES);
+            vendor.setVendswitch(Constant.YES);
+            vendor.setMyEnUU(custUU);
+            vendor.setMyUserUU(custUserUU);
+            vendor.setVendEnUU(enUU);
+            vendor.setVendUserUU(userUU);
+            vendor = vendorDao.save(vendor);
+            logger.log("添加客户", "通过主动报价自动添加客户", "关联id: " + vendor.getId());
+        }
+    }
+
+    @Override
 	public SaleQuotationItem findItemById(Long id) {
 		SaleQuotationItem item = null;
 		List<SaleQuotationItem> items = saleQuotationItemDao.findByQuid(id);

+ 66 - 50
src/main/java/com/uas/platform/b2b/service/impl/VendorsServiceImpl.java

@@ -306,6 +306,7 @@ public class VendorsServiceImpl implements VendorService {
 	/**
 	 * 获取当前企业推荐供应商
 	 *
+	 * @param enUU 当前企业UU
 	 * @param productMatchCondition 物料模糊匹配条件
 	 * @param enterpriseMatchCondition 企业搜索匹配条件
 	 * @param page 页面
@@ -313,10 +314,14 @@ public class VendorsServiceImpl implements VendorService {
 	 * @return
 	 */
 	@Override
-	public com.uas.account.support.Page<VendorRecommend> getVendorRecommend(String productMatchCondition, String enterpriseMatchCondition, int page, int size) {
+	public com.uas.account.support.Page<VendorRecommend> getVendorRecommend(Long enUU, String productMatchCondition, String enterpriseMatchCondition, int page, int size) {
 		long start = System.currentTimeMillis();
-		final Long enUU = SystemSession.getUser().getEnterprise().getUu();
-		if (StringUtils.isEmpty(productMatchCondition)) {
+//		final Long enUU = SystemSession.getUser().getEnterprise().getUu();
+        if (null == enUU) {
+            // 设置测试企业 - 优软测试二
+            enUU = 10030994L;
+        }
+        if (StringUtils.isEmpty(productMatchCondition)) {
 			productMatchCondition = " 1=1 ";
 		}
 		if (StringUtils.isEmpty(enterpriseMatchCondition)) {
@@ -325,7 +330,7 @@ public class VendorsServiceImpl implements VendorService {
 		// 查询所有的企业信息
 		StringBuffer enterpriseSql = new StringBuffer();
 		enterpriseSql.append("select en.en_uu, en.en_name, en.en_shortname, en.en_address, en.en_tel, en.en_email, en.en_corporation, en.en_businesscode, en.en_profession, en.en_tags, en.en_contactman, en.en_contacttel from sec$enterprises en right join (" +
-				" select en_uu from sec$enterprises left join v$products on en_uu = pr_enuu  where ").append(productMatchCondition).append(" and pr_b2bdisabled <> 1 " +
+				" select en_uu from sec$enterprises left join v$products on en_uu = pr_enuu  where ").append(productMatchCondition).append(" and pr_issale = 1 and pr_b2bdisabled <> 1 " +
 				" and en_uu <> ").append(enUU).append(" and en_name not like '%测试%' and en_name not like '%test%' and ").append(enterpriseMatchCondition).append(" group by en_uu order by count(1) desc" +
 				" ) a on en.en_uu = a.en_uu order by en.en_weight desc");
 		// rownum 控制
@@ -333,12 +338,11 @@ public class VendorsServiceImpl implements VendorService {
 		// 查找非供应商的卖当前商品的企业UU
 		StringBuffer vendorRecommendUusSql = new StringBuffer();
 		vendorRecommendUusSql.append("select s.*,( select wm_concat(pr_title || (case when pr_brand is not null then '(' || pr_brand || ')' else ' ' end)) from v$products where pr_enuu=en_uu and ").append(productMatchCondition)
-				.append(" and exists (select 1 from v$products B where B.pr_cmpcode = pr_cmpcode and B.pr_enuu = ").append(enUU)
-				.append(") and rownum<5 ) productInfo, (select 1 from purc$vendors where ve_vendenuu = en_uu and ve_myenuu = ")
+				.append(" and rownum<5 ) productInfo, (select 1 from purc$vendors where ve_vendenuu = en_uu and ve_myenuu = ")
 				.append(enUU).append(") isVendor from (select t.*,rownum as r1 from (").append(enterpriseSql).append(rownumSql);
 		// 因为需求更改为所有有销售产品的企业都会被返回,所以total直接取除本企业外其他有销售产品的企业数即可,之前的匹配企业数不再返回
 		StringBuffer totalSql = new StringBuffer().append(" select count(1) from (select en_uu from sec$enterprises left join " +
-				" v$products on en_uu = pr_enuu where pr_b2bdisabled <> 1 and en_name not like '%测试%' and en_name not like '%test%' and en_uu <> ")
+				" v$products on en_uu = pr_enuu where pr_issale = 1 and pr_b2bdisabled <> 1 and en_name not like '%测试%' and en_name not like '%test%' and en_uu <> ")
 				.append(enUU).append(" and ").append(productMatchCondition).append(" and ").append(enterpriseMatchCondition).append(" group by en_uu)");
 //        System.out.println("SQL:" + vendorRecommendUusSql.toString());
 //        System.out.println("NUM_SQL:" + totalSql.toString());
@@ -451,53 +455,65 @@ public class VendorsServiceImpl implements VendorService {
 	 * @return
 	 */
 	@Override
-	public com.uas.account.support.Page<Product> getProductsByVendorRecommend(int page, int size, Long vendUU, String productMatchCondition, String whereCondition) {
-		System.out.println("进入方法:" + System.currentTimeMillis());
-		if (!StringUtils.isEmpty(whereCondition)) {
+	public com.uas.account.support.Page<Product> getProductsByVendorRecommend(int page, int size, Long enUU, Long vendUU, String productMatchCondition, String whereCondition) {
+		// 如果enUU不为空按之前的处理,为空另外处理
+		if (StringUtils.isEmpty(whereCondition)) {
 			whereCondition = " 1 = 1 ";
 		}
-		long start = System.currentTimeMillis();
-		// UAS企业UU
-		Long enUU = SystemSession.getUser().getEnterprise().getUu();
-		StringBuffer cmpCodesSql = new StringBuffer();
-		cmpCodesSql.append("select 1 from v$products where pr_cmpcode = p1.pr_cmpcode and pr_enuu = ")
-				.append(enUU).append(" and pr_b2bdisabled <> 1 ");
-		if (null != productMatchCondition) {
-			cmpCodesSql.append(" and ").append(productMatchCondition);
-		}
-		// 查找匹配在售物料的语句
-		StringBuffer productsMatchSql = new StringBuffer();
-		productsMatchSql.append("select pr_id from (select pr_id from v$products p1 where exists (").append(cmpCodesSql)
-				.append(") and p1.pr_enuu = ").append(vendUU).append(" and p1.pr_b2bdisabled <> 1 and ")
-				.append(null != whereCondition ? whereCondition : "").append(" order by pr_code desc)");
-		// 查找不匹配但是在售物料的语句  union all 方便排序
-		StringBuffer notMatchProductsSql = new StringBuffer();
-		notMatchProductsSql.append("select pr_id from (select pr_id from v$products p1 where not exists (").append(cmpCodesSql)
-				.append(") and p1.pr_enuu = ").append(vendUU).append(" and p1.pr_b2bdisabled <> 1 and ")
-				.append(null != whereCondition ? whereCondition : "").append(" order by pr_code desc)");
-		// 物料id
-		StringBuffer idSql = new StringBuffer();
-		String countSql = "select count(1) from v$products where pr_enuu = " + vendUU + " and pr_b2bdisabled <> 1 and " + whereCondition;
-		// rownum 控制
-		String rownumSql = " t where rownum <= " + page * size + ") where r1 > " + (page - 1) * size;
-		idSql.append("select pr_id from (select t.*,rownum as r1 from (").append(productsMatchSql).append(" union all ").append(notMatchProductsSql)
-				.append(")").append(rownumSql);
-		List<Long> matchedIds = commonDao.queryForList(productsMatchSql.toString(), Long.class);
-		Integer count = commonDao.queryForObject(countSql, Integer.class);
-		List<Long> ids = commonDao.queryForList(idSql.toString(), Long.class);
 		List<Product> products = new ArrayList<>();
-		for (Long id : ids) {
-		    Product product = productDao.findOne(id);
-		    if (matchedIds.contains(id)) {
-		    	StringBuffer matchCodeSql = new StringBuffer();
-		    	matchCodeSql.append("select wm_concat(pr_code) from v$products where pr_b2bdisabled <> 1 and pr_enuu = ")
-						.append(enUU).append(" and pr_cmpcode = '").append(product.getCmpCode()).append("'").append(" and rownum <= 20");
-		    	String matchCodes = commonDao.queryForObject(matchCodeSql.toString(), String.class);
-		    	product.setIfMatched(matchCodes);
+		if (null != enUU) {
+			System.out.println("进入方法:" + System.currentTimeMillis());
+			long start = System.currentTimeMillis();
+			// UAS企业UU
+//		Long enUU = SystemSession.getUser().getEnterprise().getUu();
+			StringBuffer cmpCodesSql = new StringBuffer();
+			cmpCodesSql.append("select 1 from v$products where pr_cmpcode = p1.pr_cmpcode and pr_enuu = ")
+					.append(enUU).append(" and nvl(pr_issale,0) <> 1 and pr_ispurchase = 1 and pr_b2bdisabled <> 1 ");
+//			if (null != productMatchCondition) {
+//				cmpCodesSql.append(" and ").append(productMatchCondition);
+//			}
+			// 查找匹配在售物料的语句
+			StringBuffer productsMatchSql = new StringBuffer();
+			productsMatchSql.append("select pr_id from (select pr_id from v$products p1 where exists (").append(cmpCodesSql)
+					.append(") and p1.pr_enuu = ").append(vendUU).append(" and p1.pr_issale = 1 and p1.pr_b2bdisabled <> 1 and ")
+					.append(null != whereCondition ? whereCondition : "").append(" order by pr_code desc)");
+			// 查找不匹配但是在售物料的语句  union all 方便排序
+			StringBuffer notMatchProductsSql = new StringBuffer();
+			notMatchProductsSql.append("select pr_id from (select pr_id from v$products p1 where not exists (").append(cmpCodesSql)
+					.append(") and p1.pr_enuu = ").append(vendUU).append(" and p1.pr_issale = 1 and p1.pr_b2bdisabled <> 1 and ")
+					.append(null != whereCondition ? whereCondition : "").append(" order by pr_code desc)");
+			// 物料id
+			StringBuffer idSql = new StringBuffer();
+			// rownum 控制
+			String rownumSql = " t where rownum <= " + page * size + ") where r1 > " + (page - 1) * size;
+			idSql.append("select pr_id from (select t.*,rownum as r1 from (").append(productsMatchSql).append(" union all ").append(notMatchProductsSql)
+					.append(")").append(rownumSql);
+			List<Long> matchedIds = commonDao.queryForList(productsMatchSql.toString(), Long.class);
+			List<Long> ids = commonDao.queryForList(idSql.toString(), Long.class);
+//			System.out.println("id:" + idSql);
+			for (Long id : ids) {
+				Product product = productDao.findOne(id);
+				if (matchedIds.contains(id)) {
+					StringBuffer matchCodeSql = new StringBuffer();
+					matchCodeSql.append("select wm_concat(pr_code) from v$products where pr_b2bdisabled <> 1 and pr_enuu = ")
+							.append(enUU).append(" and pr_cmpcode = '").append(product.getCmpCode()).append("'").append(" and rownum <= 5");
+					String matchCodes = commonDao.queryForObject(matchCodeSql.toString(), String.class);
+					product.setIfMatched(matchCodes);
+				}
+				products.add(product);
 			}
-		    products.add(product);
-        }
-		System.out.println("返回数据:" + (System.currentTimeMillis() - start));
+			System.out.println("返回数据:" + (System.currentTimeMillis() - start));
+		} else {
+			String prodSql = "select a.* from (select t.*,rownum as r1 from (select pr_id id, pr_code code, pr_title title, pr_spec spec, pr_cmpcode cmpCode, pr_unit unit, pr_kind kind, " +
+					"pr_minpack minPack, pr_minOrder minOrder, pr_brand brand, pr_standard standard from v$products where pr_b2bdisabled <> 1 and pr_issale = 1 and pr_enuu = " + vendUU + " and " +
+					whereCondition + " order by pr_standard desc, pr_id desc) t where rownum <= " + page * size + ") a where r1 > " + (page - 1) * size;
+			System.out.println("无UU:" + prodSql);
+			products = commonDao.query(prodSql, Product.class);
+
+		}
+		String countSql = "select count(1) from v$products where pr_enuu = " + vendUU + " and pr_issale = 1 and pr_b2bdisabled <> 1 and " + whereCondition;
+		Integer count = commonDao.queryForObject(countSql, Integer.class);
+//		System.out.println("count:" + countSql);
 		return new com.uas.account.support.Page<>(page, size, products, count);
 	}
 

+ 9 - 3
src/main/java/com/uas/platform/b2b/v2/controller/InviteRecordController.java

@@ -24,6 +24,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
@@ -141,8 +143,9 @@ public class InviteRecordController {
      * @return
      */
     @RequestMapping(value = "/add", method = RequestMethod.POST)
-    private ModelMap addInvitation(String jsonStr) {
-        InvitationRecord record = JSON.parseObject(jsonStr, InvitationRecord.class);
+    private ModelMap addInvitation(String jsonStr) throws UnsupportedEncodingException {
+        String str = URLDecoder.decode(jsonStr, "UTF-8");
+        InvitationRecord record = JSON.parseObject(str, InvitationRecord.class);
         Long enUU = checkByBusinessCode(record.getEnuu(), record.getBussinesscode());
         Long userUU = checkByUserTel(record.getUseruu(), record.getUserTel());
         record.setEnuu(enUU);
@@ -182,9 +185,12 @@ public class InviteRecordController {
      * @return
      */
     @RequestMapping(value = "/count/groupBydate", method = RequestMethod.GET)
-    private List<Invitation> getCountGroupByDate(Long userUU, Long enUU, String year, String businessCode, String userTel) {
+    private List<Invitation> getCountGroupByDate(Long userUU, Long enUU, String year, String businessCode, String userTel) throws IllegalAccessException {
         enUU = checkByBusinessCode(enUU, businessCode);
         userUU = checkByUserTel(userUU, userTel);
+        if (StringUtils.isEmpty(enUU)) {
+            throw new IllegalAccessException("企业UU号不能为空");
+        }
         if (StringUtils.isEmpty(year)) {
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
             year = sdf.format(new Date());

+ 13 - 0
src/main/java/com/uas/platform/b2b/v2/model/Invitation.java

@@ -37,6 +37,11 @@ public class Invitation {
      */
     private Integer doneCount;
 
+    /**
+     * 企业UU
+     */
+    private Long enUU;
+
     public Long getUserUU() {
         return userUU;
     }
@@ -84,4 +89,12 @@ public class Invitation {
     public void setDoneCount(Integer doneCount) {
         this.doneCount = doneCount;
     }
+
+    public Long getEnUU() {
+        return enUU;
+    }
+
+    public void setEnUU(Long enUU) {
+        this.enUU = enUU;
+    }
 }

+ 40 - 15
src/main/java/com/uas/platform/b2b/v2/service/impl/InviteRecordServiceImpl.java

@@ -137,9 +137,9 @@ public class InviteRecordServiceImpl implements InviteRecordService {
         Integer allNum = 0;
         Integer todoNum = 0;
         Integer doneNum = 0;
-        String allSql = "select ifnull(sum(count), 0) from v$invitation where useruu = " + userUU;
-        String todoSql = "select ifnull(sum(count), 0) from v$invitation where active = 0 and useruu = " + userUU;
-        String doneSql = "select ifnull(sum(count), 0) from v$invitation where active = 1 and useruu = " + userUU;
+        String allSql = "select COALESCE(sum(count), 0) from v$invitation where useruu = " + userUU;
+        String todoSql = "select COALESCE(sum(count), 0) from v$invitation where active = 0 and useruu = " + userUU;
+        String doneSql = "select COALESCE(sum(count), 0) from v$invitation where active = 1 and useruu = " + userUU;
         allNum = commonDao.queryForObject(allSql, Integer.class);
         todoNum = commonDao.queryForObject(todoSql, Integer.class);
         doneNum = commonDao.queryForObject(doneSql, Integer.class);
@@ -159,9 +159,13 @@ public class InviteRecordServiceImpl implements InviteRecordService {
      */
     @Override
     public List<Invitation> getCountGroupByDate(Long userUU, Long enUU, String year) {
-        String sql = "select time, count, 0 as doneCount,substr(time, -2) month from v$invitation_all where time like '%" + year + "%' and useruu = " + userUU + "order by time asc";
+        String sql = "select substr(time, -2) month,in_enuu enUU,count(1) count from(" +
+                "select to_char(in_date, 'yyyy-mm') time,COALESCE(in_active,0),in_enuu from invitationrecords where in_enuu = " + enUU + ")" +
+                "where time like '%" + year + "%' group by time,in_enuu order by time";
         List<Invitation> all = commonDao.query(sql, Invitation.class);
-        String sql1 = "select time, count doneCount,substr(time, -2) month from v$invitation where time like'%" + year + "%' and useruu = " + userUU + "and active = 1";
+        String sql1 = "select substr(time, -2) month,in_enuu enUU,count(1) count from(" +
+                "select to_char(in_date, 'yyyy-mm') time,COALESCE(in_active,0),in_enuu from invitationrecords where in_enuu = " + enUU + " and COALESCE(in_active,0) = 1)" +
+                "where time like '%" + year + "%' group by time,in_enuu order by time";
         List<Invitation> done = commonDao.query(sql1, Invitation.class);
         if (!CollectionUtils.isEmpty(all) && !CollectionUtils.isEmpty(done)) {
             for (Invitation a : all) {
@@ -236,19 +240,40 @@ public class InviteRecordServiceImpl implements InviteRecordService {
                 contactTel = cu.getUserTel();
             }
         }
+        final String enName = v.getEnName();
+        final String contactTel1 = contactTel;
+        final String adminTel1 = adnimTel;
+        final String userName = user.getUserName();
+        final String custName = c.getEnName();
         // 发送短信通知
         if (adnimTel.equals(contactTel)) {// 相同的人调用通知接口
-            try {
-                smsService.send(messageConf.getMsgAddPartForB2B(), adnimTel,
-                        new Object[] { user.getUserName(), c.getEnName(), v.getEnName() });
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
+            ThreadUtils.task(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        smsService.send(messageConf.getMsgAddPartForB2B(), adminTel1,
+                                new Object[] { userName, custName, enName });
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }).run();
+
         } else { // 针对不同的人调用不同的接口
-            // 发送给管理员
-            sendMsgToManager(v.getEnName(), adnimTel);
-            // 发送给联系人
-            sendMsgToContact(v.getEnName(), contactTel, user.getUserName(), adnimTel);
+            ThreadUtils.task(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        // 发送给管理员
+                        sendMsgToManager(enName, adminTel1);
+
+                        // 发送给联系人
+                        sendMsgToManager(enName, contactTel1);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }).run();
         }
         String result = AccountUtils.addNewRecord(record);
         JSONObject object = JSON.parseObject(result);

+ 69 - 351
src/main/webapp/resources/js/index/app.js

@@ -368,7 +368,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         }).state('sale.quotation.new', {
             url: "/new",
             templateUrl: "static/tpl/index/sale/quotation_new.html",
-            controller: 'SaleQuotationNewCtrl'
+            controller: 'SaleQuotationNewCtrl',
+            params: {
+                'inquiryItem': null
+            }
         }).state('sale.quotation.list', {
             url: "/list",
             templateUrl: "static/tpl/index/sale/quotation_list.html",
@@ -595,6 +598,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             controller: 'AddPartnersCtrl'
         }).state('baseInfo.partner_searchresult', {
             url: '/search',
+            params: {
+                'active': 'done'
+            },
             templateUrl: "static/tpl/index/baseInfo/searchresult.html",
             controller: 'EnterpriseSearchCtrl'
         }).state('baseInfo.invitation', {
@@ -1342,7 +1348,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             modalInstance.result.then(function (data) {
                 InvitationRecord.invite({formStore: data}, {}, function (data) {
                     if (data.success) {
-                        toaster.pop('success', '提示', data.success);
+                        // toaster.pop('success', '提示', data.success);
                     }
                     if (data.error) {
                         toaster.pop('error', '提示', data.error);
@@ -4351,6 +4357,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 toaster.pop('error', '数据加载失败', response.data);
             })
         }
+
+        $scope.isoverdue = function(time) {
+            var timeSpan = new Date().getTime();
+            if (time > timeSpan) {
+                return false;
+            } else {
+                return true;
+            }
+        }
     }]);
 
     // 询价单明细
@@ -6001,8 +6016,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         }
                     });
 
-                    modalInstance.result.then(function (data) {
-                        $scope.tableParams.reload();
+                    modalInstance.result.then(function () {
+                        loadData();
                     }, function () {
 
                     });
@@ -6439,7 +6454,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             // var file = $scope.myFiles;
             if (file.length > 0) {
                 for (var i = 0; i < file.length; i++) {
-                    console.log(file[i].name);
                     var flag = true;
 
                     if (mould.sellAttachs.length > 0) {
@@ -6475,23 +6489,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         // 保存并确认报价
         $scope.onReplyClick = function (mould, withSteps) {
             $scope.loading = true;
-////			var file = mould.attachFile.$viewValue, file = file && file.length > 0 ? file[0] : null;
-//			var file = mould.attachs[0];
-//			$scope.mould  = mould;
-//			$upload.upload({
-//				url: 'sale/mould/' + mould.id + '/send',
-//				method: 'POST',
-//				file: file,
-//				data: {
-//					json: $scope.mould
-//				}
-//			}).success(function(res){
-//				console.log("success");
-//				console.log(res);
-//			}).error(function(res){
-//				console.log("failure");
-//			});
-
             if (withSteps) {
                 PurcInquiryMould.reply({id: mould.id}, mould, function () {
                     $scope.loading = false;
@@ -6716,21 +6713,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         $scope.onReplyClick = function (mould, withSteps) {
             $scope.loading = true;
-//			var file = mould.attachs[0];
-//			$scope.mould  = mould;
-//			$upload.upload({
-//				url: 'sale/mould/' + mould.id + '/send',
-//				method: 'POST',
-//				file: file,
-//				data: {
-//					json: $scope.mould
-//				}
-//			}).success(function(res){
-//
-//			}).error(function(res){
-//				console.log(res);
-//			});
-
             if (withSteps) {
                 PurcInquiryMould.reply({id: mould.id}, mould, function () {
                     $scope.loading = false;
@@ -7027,6 +7009,33 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         };
 
+        // 根据传入的询价相关的信息封装成报价需要的信息
+        if ($stateParams.inquiryItem != null) {
+            var item = $stateParams.inquiryItem;
+            $scope.item.quotation.cust = item.inquiry.enterprise;
+            $scope.item.quotation.custUser = item.user;
+            $scope.item.quotation.custUserUU = item.userUU;
+            if ($scope.item.quotation.custUserUU == null) {
+                $scope.item.quotation.custUserUU = item.inquiry.recorderUU;
+            }
+            if (item.product == null || item.product.id == null) {
+                toaster.pop('info', '暂未匹配到物料信息,请手动选择');
+            } else {
+                $scope.item.product = item.product;
+                if (item.replies.length > 0) {
+                    $scope.item.prices = item.replies;
+                    angular.forEach($scope.item.prices, function(price) {
+                        price.id = null;
+                    });
+                }
+                $scope.item.quotation.taxrate = item.taxrate;
+                $scope.item.minPackQty = item.minPackQty;
+                $scope.item.minOrderQty = item.minOrderQty;
+                $scope.item.leadtime = item.leadtime;
+                $scope.item.quotation.currency = item.currency;
+            }
+        }
+
         // 保存
         $scope.save = function () {
             var valid = true;
@@ -7042,15 +7051,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if (!$scope.item.quotation.code) //新增,设单号
                     $scope.item.quotation.code = 'BJ' + $filter('date')(new Date(), 'yyMMddHHmmss_sss');
                 $scope.item.quotation.custUU = $scope.item.quotation.cust.uu;
-                $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
+                if ($scope.item.quotation.custUserUU == null) {
+                    $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
+                }
                 $scope.item.productId = $scope.item.product.id;
-                // $scope.item.quotation.status = 100;//在录入
-                // if ($scope.item.quotation.date instanceof Date) {
-                //     $scope.item.quotation.date = $scope.item.quotation.date.getTime();
-                // }
-                // if ($scope.item.quotation.endDate instanceof Date) {
-                //     $scope.item.quotation.endDate = $scope.item.quotation.endDate.getTime();
-                // }
                 Quotation.save({}, $scope.item, function (data) {
                     $scope.loading = false;
                     $scope.item = data;
@@ -7092,7 +7096,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if (!$scope.item.quotation.code) //新增,设单号
                     $scope.item.quotation.code = 'BJ' + $filter('date')(new Date(), 'yyMMddHHmmss_sss');
                 $scope.item.quotation.custUU = $scope.item.quotation.cust.uu;
-                $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
+                if ($scope.item.quotation.custUserUU == null) {
+                    $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
+                }
                 $scope.item.productId = $scope.item.product.id;
                 // $scope.item.quotation.status = 101;//已提交
                 if ($scope.item.quotation.date instanceof Date) {
@@ -14774,8 +14780,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }, function (response) {
 
             });
-        }
-        ;
+        };
 
         // 查找供应商
         $scope.dbfindVend = function () {
@@ -20974,10 +20979,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
     }]);
 
     // 企业圈搜索结果
-    app.controller('EnterpriseSearchCtrl', ['$scope', 'getAccountUserSpace', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', '$rootScope', '$modal', 'InvitationRecord', function ($scope, getAccountUserSpace, ngTableParams, $filter, BaseService, toaster, AddPartner, $rootScope, $modal, InvitationRecord) {
+    app.controller('EnterpriseSearchCtrl', ['$scope', 'getAccountUserSpace', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', '$rootScope', '$modal', 'InvitationRecord', '$stateParams', function ($scope, getAccountUserSpace, ngTableParams, $filter, BaseService, toaster, AddPartner, $rootScope, $modal, InvitationRecord, $stateParams) {
         $scope.status = 'add';
         BaseService.scrollBackToTop();
-        $scope.active = 'all';
+        if ($stateParams.active != null) {
+            $scope.active = $stateParams.active;
+        } else {
+            $scope.active = 'all';
+        }
         $scope.agreedText = '全部';
         $scope.dateZoneText = '一个月内';
         $scope.condition = {dateZone: 1};
@@ -21082,7 +21091,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             modalInstance.result.then(function (data) {
                 InvitationRecord.invite({formStore: data}, {}, function (data) {
                     if (data.success) {
-                        toaster.pop('success', '提示', data.success);
+                        // toaster.pop('success', '提示', data.success);
                         $scope.tableParams.reload();
                     }
                     if (data.error) {
@@ -21483,7 +21492,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             modalInstance.result.then(function (data) {
                 InvitationRecord.invite({formStore: data}, {}, function (data) {
                     if (data.success) {
-                        toaster.pop('success', '提示', data.success);
+                        // toaster.pop('success', '提示', data.success);
                         $scope.tableParams.reload();
                     }
                     if (data.error) {
@@ -23498,15 +23507,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         };
 
-        // // 设置阅读状态
-        // $scope.setReadStatus = function(msg) {
-        //     if(!msg.read) {
-        //         PurcInquiry.setStatus({id: msg.inid}, {}, function(data) {
-        //
-        //         });
-        //     }
-        // }
-
         $scope.searchMethod = false;
         var getService = function () {
             return $scope.searchMethod ? PubInquirySearchInfo : PubInquiryNoSearchInfo;
@@ -23534,17 +23534,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if ($scope.active == 'overdue') {
                     $scope.active = 'end';
                 }
-                /*getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
-                    $scope.loading = false;
-                    if (page) {
-                        params.total(page.totalElement);
-                        $defer.resolve(page.content);
-                        $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
-                    }
-                }, function (response) {
-                    $scope.loading = false;
-                    toaster.pop('error', '数据加载失败', response.data);
-                });*/
                 AccountEnterprise.get({}, function(data) {
                     $scope.currentEn = data;
                     publicInquiry.getUrl({}, function(data) {
@@ -23561,7 +23550,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             if (response) {
                                 params.total(response.totalElements);
                                 $defer.resolve(response.content);
-                                // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词  做导出时需要的字段
                             }
                         }).error(function (err) {
                             $scope.loading = false;
@@ -23572,264 +23560,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         });
 
-        //获得各分类未阅读数量
-        // var getUnreadCount = function () {
-        //     PurcInquiry.getUnreadCount(null, function (data) {
-        //         $scope.unread = data;
-        //     });
-        // };
-        // getUnreadCount();
-
-        // //设置单据已读
-        // $scope.setOrdersRead = function (id) {
-        //     // 如果单据本身已读,则不发送请求修改数据
-        //     if (!$scope.isUnread(id)){
-        //         return;
-        //     }
-        //     var sourceId = [];
-        //     sourceId.push(id);
-        //     PurcInquiry.setRead({}, sourceId, function (message) {
-        //         getUnreadCount();
-        //         removeByValue($scope.unreadCode, id);
-        //     });
-        // };
-
-        // $scope.setOrdersReadByState = function () {
-        //     if (!$scope.unread.replied || $scope.unread.replied == 0) {
-        //         return;
-        //     }
-        //     PurcInquiry.setReadByState({}, function () {
-        //         getUnreadIds();
-        //         getUnreadCount();
-        //     });
-        // };
-
-        // var getUnreadIds = function () {
-        //     PurcInquiry.getUnreadIds({}, "", function (message) {
-        //         $scope.unreadCode = message.content;
-        //     });
-        // };
-        // getUnreadIds();
-
-        $scope.isUnread = function (id) {
-            for (var i in $scope.unreadCode) {
-                if (id == $scope.unreadCode[i]) {
-                    return true;
-                }
-            }
-        };
-
-        $scope.getMinDate = function (item) {
-            return $filter('date')(item.inquiry.date, 'yyyy-MM-dd');
-        };
-        $scope.replyPrices = [];
-        $scope.replylapQtys = [];
-        $scope.replyPrices.push(true);
-        $scope.replylapQtys.push(true);
-        $scope.addStep = function (inquiryItem) {
-            $scope.replyPrices.push(true);
-            if (inquiryItem.replies.length >= 10) {
-                toaster.pop('warning', '提示', '最多支持10个分段!');
-            } else {
-                inquiryItem.replies.push({});
-                if (inquiryItem.replies.length != 1) {
-                    $scope.replyPrices.push(true);
-                    $scope.replylapQtys.push(true);
-                }
-            }
-        };
-        $scope.removeStep = function (inquiryItem, stepIndex) {
-            inquiryItem.replies.splice(stepIndex, 1);
-            $scope.replyPrices.splice(stepIndex, 1);
-            $scope.replylapQtys.splice(stepIndex, 1);
-        };
-
-        $scope.openDatePicker = function ($event, item, openParam) {
-            $event.preventDefault();
-            $event.stopPropagation();
-            item[openParam] = !item[openParam];
-        };
-
-        $scope.openFilterDatePicker = function ($event, item, openParam) {
-            $event.preventDefault();
-            $event.stopPropagation();
-            item[openParam] = !item[openParam];
-            if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
-                $scope.tableParams.reload();
-            }
-        };
-
-        $scope.getHistory = function (item) {
-            if (!item.history) {
-                publicInquiry.getHistory({itemId: item.id}, function (data) {
-                    item.history = data;
-                });
-            }
-        };
-
-        // 报价
-        $scope.quote = function(inquiryItem) {
-            $modal.open({
-                animation: true,
-                templateUrl: 'static/tpl/index/sale/modal/quote_inquiry.html',
-                controller: 'QuoteInquiryCtrl',
-                resolve: {
-                    inquiryItem: function () {
-                        return inquiryItem
-                    }
-                }
-            }).result.then(function (data) {
-
-            }, function () {})
-        };
-
-        $scope.deleteAttach = function (attaches, index) {
-            attaches.splice(index, 1);
-        };
-
-        $scope.onReplyClick = function (item, withSteps) {
-            if (item.vendFromDate instanceof Date) {
-                item.vendFromDate = item.vendFromDate.getTime();
-            }
-            if (item.vendToDate instanceof Date) {
-                item.vendToDate = item.vendToDate.getTime();
-            }
-            if (item.vendFromDate > item.vendToDate) {
-                toaster.pop('warning', '警告', '有效开始日期不能超过有效截止日期');
-                return;
-            }
-            var replies = [];
-            // 判断分段数是否合法
-            var valid = true;
-            var validLapQty = 0;
-            angular.forEach(item.replies, function (r, i) {
-                if ((i > 0 ? r.lapQty : 1) || r.price) {
-                    replies.push(r);
-                }
-                // 直接比较是字符串比较,需要先转换再比较  2017年9月7日 15:05:51
-                if (i > 0 && parseInt(r.lapQty) <= parseInt(item.replies[i - 1].lapQty) || r.lapQty == null) {
-                    valid = false;
-                    validLapQty = r.lapQty;
-                }
-            });
-            item.replies = replies;
-            $scope.loading = true;
-            if (!valid) {
-                if (validLapQty) {
-                    toaster.pop('info', '提示', '分段' + validLapQty + '小于等于了上一分段数,不能保存!');
-                } else {
-                    toaster.pop('info', '提示', '分段数量不合法,不能保存!');
-                }
-                $scope.loading = false;
-            } else {
-                var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
-                if (withSteps) { // 保存并报价
-                    if(null != file) {
-                        $upload.upload({
-                            url: 'sale/pubInquiry/addAttach',
-                            file: file,
-                            method: 'POST',
-                            data: {
-                                item: item,
-                                method: 'reply'
-                            }
-                        }).success(function (data) {
-                            if (data.item) {
-                                item = data.item;
-                            }
-                            $scope.loading = false;
-                            toaster.pop('info', '提示', '报价成功');
-                            $scope.tableParams.reload();
-                        }).error(function (data) {
-                            $scope.loading = false;
-                            toaster.pop('error', '附件上传失败');
-                        });
-                    } else {
-                        publicInquiry.reply({itemId: item.id, token: $scope.token}, item, function (data) {
-                            $scope.loading = false;
-                            toaster.pop('info', '提示', '报价成功');
-                            $scope.tableParams.reload();
-                        }, function (response) {
-                            $scope.loading = false;
-                            toaster.pop('error', '询价失效', response.data);
-                        });
-                    }
-                } else {  // 保存
-                    if(null != file) {
-                        $upload.upload({
-                            url: 'sale/pubInquiry/addAttach',
-                            file: file,
-                            method: 'POST',
-                            data: {
-                                item: item,
-                                method: 'save'
-                            }
-                        }).success(function (data) {
-                            if (data.item) {
-                                item = data.item;
-                            }
-                            $scope.loading = false;
-                            toaster.pop('info', '提示', '保存成功');
-                            $scope.tableParams.reload();
-                        }).error(function (data) {
-                            $scope.loading = false;
-                            toaster.pop('error', '附件上传失败');
-                        });
-                    } else {
-                        publicInquiry.saveItem({itemId: item.id, token: $scope.token}, item, function (data) {
-                            $scope.loading = false;
-                            toaster.pop('info', '提示', '保存成功');
-                            $scope.tableParams.reload();
-                        }, function (response) {
-                            $scope.loading = false;
-                            toaster.pop('error', '保存失败', response.data);
-                        });
-                    }
-                }
-            }
-        };
-
-        $scope.isValid = function (item, withSteps) {
-            var bool = item.leadtime && item.replies && item.replies[0].price > 0;
-            if (!withSteps || !bool)
-                return bool;
-            angular.forEach(item.replies, function (r, i) {
-                $scope.verifylapQty(r.lapQty, i, item);
-                bool = (i > 0 ? r.lapQty : 1) && r.price && $scope.replylapQtys[i];
-            });
-            return bool;
-        };
-
-        $scope.verifylapQty = function (value, index, inquiryItem) {
-            value = parseInt(value);
-            var regex = /^\d+(.\d{1,5})?$/;
-            var valid = true;
-            angular.forEach(inquiryItem.replies, function(reply, $index) {
-                if ($index < index && reply.lapQty >= value) {
-                    valid = false;
-                }
-            });
-            $scope.replylapQtys[index] = regex.test(value) && valid;
-        };
-
-        $scope.minOrderQtyVerify = $scope.minPackQtyVerify = $scope.leadtimeVerify = true;
-        $scope.verify = function (value, type) {
-            var regex = /^\d+(.\d{1,5})?$/;//
-            switch (type) {
-                case 'minOrderQty':
-                    $scope.minOrderQtyVerify = regex.test(value);
-                    break;
-                case 'minPackQty':
-                    $scope.minPackQtyVerify = regex.test(value);
-                    break;
-                case 'leadtime':
-                    $scope.leadtimeVerify = regex.test(value);
-                    break;
-                default:
-                    $scope.replyPrices[type] = regex.test(value);
-                    break;
-            }
-        }
         // 搜索框回车
         $scope.onSearch = function (keyword) {
             // 每次搜索重置获取数据方法
@@ -23846,15 +23576,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.tableParams.reload();
         }
 
-        // 导出
-        $scope.exportXls = function () {
-            PurcInquiry.exportXls({}, {}, function (data) {
-                if (data.success) {
-                    window.location.href = 'sale/inquiry/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
-                }
-            }, function (response) {
-                toaster.pop('error', '数据加载失败', response.data);
-            })
+        // 判断是否过期
+        $scope.isoverdue = function(time) {
+            var timeSpan = new Date().getTime();
+            if (time > timeSpan) {
+                return false;
+            } else {
+                return true;
+            }
         }
     }]);
 
@@ -24142,17 +23871,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if ($scope.active == 'overdue') {
                     $scope.active = 'end';
                 }
-               /* getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
-                    $scope.loading = false;
-                    if (page) {
-                        params.total(page.totalElement);
-                        $defer.resolve(page.content);
-                        $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
-                    }
-                }, function (response) {
-                    $scope.loading = false;
-                    toaster.pop('error', '数据加载失败', response.data);
-                });*/
                 AccountEnterprise.get({}, function(data) {
                     $scope.currentEn = data;
                     publicInquiry.getUrl({}, function(data) {

+ 5 - 1
src/main/webapp/resources/js/index/services/BaseInfo.js

@@ -299,7 +299,11 @@ define(['ngResource'], function() {
 		return $resource('product/baseInfo/getUserSpaceDetails', {}, {
 			getAll: {
 				isArray: false
-			}
+			},
+            getDone: {
+                url: 'product/baseInfo/getUserSpaceDetails/done',
+                method: 'GET'
+            },
 		})
 	}]).factory('AddPartner', ['$resource', function($resource) {
 		return $resource('addpartner', {}, {

+ 17 - 7
src/main/webapp/resources/tpl/index/baseInfo/modal/quotation_modal.html

@@ -138,7 +138,7 @@
             <div class="form-group">
                 <label for="inputEmail3" class="col-xs-4 control-label">最小订购</label>
                 <div class="col-xs-8">
-                    <input type="text" class="form-control" id="inputEmail3" placeholder="1000" ng-model="inquiryItem.minOrderQty" ng-pattern="/^[0-9]*[1-9][0-9]*$/">
+                    <input type="text" class="form-control" id="inputEmail3" placeholder="请输入最小订购数" ng-model="inquiryItem.minOrderQty" ng-pattern="/^[0-9]*[1-9][0-9]*$/">
                 </div>
             </div>
         </div>
@@ -146,7 +146,7 @@
             <div class="form-group">
                 <label for="inputEmail1" class="col-xs-4 control-label">最小包装</label>
                 <div class="col-xs-8">
-                    <input type="text" class="form-control" id="inputEmail1" placeholder="1000" ng-model="inquiryItem.minPackQty" ng-pattern="/^[0-9]*[1-9][0-9]*$/">
+                    <input type="text" class="form-control" id="inputEmail1" placeholder="请输入最小包装数" ng-model="inquiryItem.minPackQty" ng-pattern="/^[0-9]*[1-9][0-9]*$/">
                 </div>
             </div>
         </div>
@@ -154,7 +154,7 @@
             <div class="form-group">
                 <label for="inputEmail2" class="col-xs-4 control-label text-inverse">交货周期(天)</label>
                 <div class="col-xs-8">
-                    <input type="text" class="form-control" id="inputEmail2" placeholder="20" ng-model="inquiryItem.leadtime" ng-pattern="/^[0-9]*[1-9][0-9]*$/" ng-required="true">
+                    <input type="text" class="form-control" id="inputEmail2" placeholder="请输入交货周期" ng-model="inquiryItem.leadtime" ng-pattern="/^[0-9]*[1-9][0-9]*$/" ng-required="true">
                 </div>
             </div>
         </div>
@@ -172,7 +172,7 @@
             <div class="form-group">
                 <label for="inputEmail4" class="col-xs-4 control-label">税率(%)</label>
                 <div class="col-xs-8">
-                    <input type="text" class="form-control" id="inputEmail4" placeholder="10" ng-model="inquiryItem.taxrate" ng-pattern="/^((\d|[123456789]\d)(\.\d+)?)$/">
+                    <input type="text" class="form-control" id="inputEmail4" placeholder="请输入税率" ng-model="inquiryItem.taxrate" ng-pattern="/^((\d|[123456789]\d)(\.\d+)?)$/">
                 </div>
             </div>
         </div>
@@ -180,7 +180,7 @@
             <div class="form-group">
                 <label for="inputEmail5" class="col-xs-4 control-label">供应商型号</label>
                 <div class="col-xs-8">
-                    <input type="text" class="form-control" id="inputEmail5" placeholder="1000" ng-model="inquiryItem.vendorprodcode">
+                    <input type="text" class="form-control" id="inputEmail5" placeholder="请输入供应商型号" ng-model="inquiryItem.vendorprodcode">
                 </div>
             </div>
         </div>
@@ -191,7 +191,7 @@
                 <label for="inputEmail6" class="col-xs-4 control-label">分段数量
                     <span ng-bind="$index + 1" ng-if="inquiryItem.replies.length > 1"></span></label>
                 <div class="col-xs-8">
-                    <input type="text" class="form-control" id="inputEmail6" ng-model="reply.lapQty" ng-pattern="/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/" ng-required="true" ng-disabled="$first">
+                    <input type="text" class="form-control" id="inputEmail6" ng-model="reply.lapQty" placeholder="请输入分段数量" ng-pattern="/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/" ng-required="true" ng-disabled="$first">
                 </div>
             </div>
         </div>
@@ -200,12 +200,22 @@
                 <label for="inputEmail7" class="col-xs-4 control-label text-inverse">价格
                     <span ng-bind="$index + 1" ng-if="inquiryItem.replies.length > 1"></span></label>
                 <div class="col-xs-8">
-                    <input type="text" class="form-control" id="inputEmail7" ng-model="reply.price" ng-pattern="/^(([0-9]+\.[0-9]{1,3})|([0-9]*[1-9][0-9]*\.[0-9]{1,3})|([0-9]*[1-9][0-9]*))$/" ng-required="true">
+                    <input type="text" class="form-control" id="inputEmail7" ng-model="reply.price" placeholder="请输入价格" ng-pattern="/^(([0-9]+\.[0-9]{1,3})|([0-9]*[1-9][0-9]*\.[0-9]{1,3})|([0-9]*[1-9][0-9]*))$/" ng-required="true">
                 </div>
             </div>
         </div>
         <a ng-click="removeStep(inquiryItem, $index)" ng-if="!$first"><i class="fa fa-trash"></i></a>
     </div>
+    <div class="row">
+        <div class="col-xs-12 form-horizontal">
+            <div class="form-group">
+                <label for="inputEmail4" class="col-xs-2 control-label">备注</label>
+                <div class="col-xs-10">
+                    <input type="text" class="form-control" id="inputEmail8" ng-model="inquiryItem.remark" placeholder="请输入备注(100字以内)" maxlength="100">
+                </div>
+            </div>
+        </div>
+    </div>
     <div class="modal-file" ng-if="imgPreviewName">
         <span>附件:</span><a ng-bind="imgPreviewName" style="margin-left:10px;"></a>
     </div>

+ 6 - 2
src/main/webapp/resources/tpl/index/purc/pubInquiry.html

@@ -505,6 +505,9 @@ margin-left: 55px;
 				<div ng-if="inquiryItem.attachUrl" class="text-muted">
 					<i class="fa fa-paperclip fa-fw" style="color: #ffa340; font-size: 18px;"></i>附件:<a class="file" href="{{inquiryItem.attachUrl}}" target="_blank">{{::inquiryItem.attachName}}</a>
 				</div>
+                <div ng-if="inquiryItem.remark" class="text-muted">
+                    备注:<span ng-bind="inquiryItem.remark"></span>
+                </div>
 			</td>
 			<td class="text-center">
 				<div ng-bind="inquiryItem.product.unit"></div>
@@ -627,8 +630,9 @@ margin-left: 55px;
 			<td class="text-center br-l">
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.agreed == null && inquiryItem.invalid != 1" class="block">
 					<div ng-if="inquiryItem.replies.length > 0" class="text-muted" style="padding-top: 50px;">
-						<a ng-click="accept(inquiryItem.id);setOrdersRead(inquiryItem.id)">采纳</a>
-						<a ng-click="refuse(inquiryItem.id);setOrdersRead(inquiryItem.id)">拒绝</a></div>
+						<a ng-click="accept(inquiryItem.id)">采纳</a>
+						<a ng-click="refuse(inquiryItem.id)">拒绝</a>
+					</div>
 				</div>
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.agreed == null && inquiryItem.invalid == 1" class="block">
 					<span class="text-trans text-light">已失效</span>

+ 8 - 0
src/main/webapp/resources/tpl/index/sale/inquiry.html

@@ -513,15 +513,21 @@
 				</div>
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.agreed == 1 && inquiryItem.invalid != 1" class="block">
 					<span class="text-trans success">已采纳</span>
+                    <br><br>
+                    <a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
 				</div>
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.invalid == 1" class="block">
 					<span class="text-trans text-light">已失效</span>
 				</div>
 				<div ng-if="inquiryItem.status == 314" class="block">
 					<span class="text-trans text-light">已作废</span>
+                    <br><br>
+                    <a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
 				</div>
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.agreed == 0" class="block">
 					<span class="text-trans error">未采纳</span>
+                    <br><br>
+                    <a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
 				</div>
 				<div ng-if="inquiryItem.status == 200">
 					<div ng-if="inquiryItem.inquiry.overdue == 0 && inquiryItem.inquiry.check != 1">
@@ -552,6 +558,8 @@
 					</div>
 					<div ng-if="inquiryItem.inquiry.overdue == 1" class="block">
 						<span class="text-trans error">已过期</span>
+                        <br><br>
+                        <a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
 					</div>
 				</div>
 			</td>

+ 32 - 4
src/main/webapp/resources/tpl/index/sale/pubinquiry.html

@@ -87,8 +87,14 @@
 	.order-table .order-bd .product {
 		padding-left: 20px;
 	}
-	.order-table .order-bd .product .dropdown-toggle span{
+	.order-table .order-bd .product .dropdown-toggle >span{
+		display:inline-block;
+		vertical-align: top;
 		color:#333;
+		width:250px;
+		overflow: hidden;
+		text-overflow:ellipsis;
+		white-space:nowrap;
 	}
 	.order-table .order-bd .product .dropdown-toggle{
 		position:relative;
@@ -152,6 +158,7 @@
 		/*background: #f5f5f5;*/
 	}
 	.order-table{
+		table-layout:fixed;
 		background: #fff;
 	}
 	.menu .new-dot{
@@ -174,12 +181,22 @@
 		font-size: 14px;
 		color:#999;
 		font-style:normal;
+		word-break:break-all;
 	}
 	.order-table .order-bd td span{
 		font-size: 14px;
 		color:#999;
 		font-style:normal;
 	}
+	.order-table .order-bd td span.lang{
+		cursor:pointer;
+		width:160px;
+		display:inline-block;
+		overflow: hidden;
+		-ms-text-overflow: ellipsis;
+		text-overflow: ellipsis;
+		white-space:nowrap;
+	}
 </style>
 <div class="block" id="public">
 	<div class="loading in" ng-class="{'in': loading}">
@@ -292,7 +309,7 @@
 	<table class="order-table block" ng-table="tableParams">
 		<thead>
 		<tr class="header">
-			<th>产品型号</th>
+			<th width="330">产品型号</th>
 			<th width="160">品牌</th>
 			<th width="110">分段数量</th>
 			<th width="90">价格</th>
@@ -359,7 +376,7 @@
 				币别:<span ng-bind="::(isUser?'-':inquiryItem.currency)"></span>
 			</td>
 			<td>
-				税率:<span>17</span>%
+				税率:<span ng-bind="::inquiryItem.taxrate || 0"></span>%
 			</td>
 			<td class="text-right" colspan="2" class="order-sum">
 				<div ng-if="inquiryItem.replyable">
@@ -395,10 +412,13 @@
 				</div>
                 <div ng-if="inquiryItem.attachUrl" class="text-muted">
                     <i class="fa fa-paperclip fa-fw" style="color: #ffa340; font-size: 18px;"></i>附件:<a class="file" href="{{inquiryItem.attachUrl}}" target="_blank">{{::inquiryItem.attachName}}</a>
+                </div>
+                <div ng-if="inquiryItem.remark" class="text-muted">
+                    备注:<span ng-bind="inquiryItem.remark"></span>
                 </div>
 			</td>
 			<td class="text-center">
-				<span ng-bind="inquiryItem.product.brand || inquiryItem.inbrand || '-'"></span>
+				<span class="lang" ng-bind="inquiryItem.product.brand || inquiryItem.inbrand || '-'" title="{{inquiryItem.product.brand || inquiryItem.inbrand || '-'}}"></span>
 			</td>
 			<td class="text-center">
 				<div ng-repeat="reply in inquiryItem.replies">
@@ -423,15 +443,23 @@
 				</div>
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.agreed == 1 && inquiryItem.invalid != 1" class="block">
 					<span class="text-trans success">已采纳</span>
+                    <br><br>
+                    <a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
 				</div>
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.invalid == 1" class="block">
 					<span class="text-trans text-light">已失效</span>
+                    <br><br>
+                    <a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
 				</div>
 				<div ng-if="inquiryItem.status == 314" class="block">
 					<span class="text-trans text-light">已作废</span>
+                    <br><br>
+                    <a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
 				</div>
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.agreed == 0" class="block">
 					<span class="text-trans error">未采纳</span>
+                    <br><br>
+                    <a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
 				</div>
 			</td>
 		</tr>

+ 2 - 0
src/main/webapp/resources/tpl/index/sale/pubinquiry_detail.html

@@ -152,6 +152,8 @@
 				<span>报价截止</span><em ng-bind="::inquiry.endDate | date:'yyyy-MM-dd'"></em>
 			</li>
 		</ul>
+		<span style="font-size: 14px; font-weight: bold; width: 25%">备注</span>
+		<span ng-bind="inquiryItem.remark" style="font-size: 14px;font-style: normal;color: #999;width: 75%"></span>
 	</div>
 	<table class="table">
 		<thead>

+ 0 - 18
src/main/webapp/resources/tpl/index/sale/quotation_new.html

@@ -408,24 +408,6 @@
 					   placeholder="只可以为正整数" ng-readonly="!item.$editing" ng-required="true" ng-disabled="isDisabled()">
 				<span class="text-inverse text-bold">* </span>
 			</div>
-			<!--<label class="col-sm-2 control-label">价格有效日期:</label>
-			<div class="col-sm-4">
-				<div class="input-group">
-					<input ng-model="item.quotation.endDate" type="text" class="form-control" id="endDate"
-						   placeholder="" datepicker-popup="yyyy-MM-dd" is-open="item.$endDateOpen"
-						   min-date="getMinDate()" ng-required="true" ng-disabled="true"
-						   current-text="今天" clear-text="清除" close-text="关闭"
-						   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-						   ng-focus="openDatePicker($event, item.$endDateOpen)" ng-readonly="!item.$editing">
-					<span class="input-group-btn">
-						<button type="button" class="btn btn-default btn-sm" ng-disabled="!item.$editing || isDisabled()"
-								ng-click="openDatePicker($event, item.$endDateOpen)" >
-							<i class="fa fa-calendar"></i>
-						</button>
-					</span>
-					<span class="text-inverse text-bold" style="right:-10px">* </span>
-				</div>
-			</div>-->
 		</div>
 		<div class="form-group form-group-sm">
 			<label for="currency" class="col-sm-2 control-label">币别:</label>