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

询价列表查询过滤条件更新

hejq 7 лет назад
Родитель
Сommit
a9dedd2100

+ 4 - 4
pom.xml

@@ -363,7 +363,7 @@
         </resources>
         <!-- 在maven生命周期validate阶段生成timestamp -->
         <plugins>
-            <plugin>
+            <!--<plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>buildnumber-maven-plugin</artifactId>
                 <version>1.3</version>
@@ -396,7 +396,7 @@
                 <groupId>com.samaxes.maven</groupId>
                 <artifactId>minify-maven-plugin</artifactId>
                 <version>1.7.4</version>
-                <!-- 静态文件压缩  -->
+                &lt;!&ndash; 静态文件压缩  &ndash;&gt;
                 <executions>
                     <execution>
                         <id>default-minify</id>
@@ -457,7 +457,7 @@
                 <groupId>com.uas.plugins</groupId>
                 <artifactId>static-maven-plugin</artifactId>
                 <version>0.0.2-SNAPSHOT</version>
-                <!-- 静态资源分离  -->
+                &lt;!&ndash; 静态资源分离  &ndash;&gt;
                 <executions>
                     <execution>
                         <id>default-static</id>
@@ -501,7 +501,7 @@
                         </resource>
                     </webResources>
                 </configuration>
-            </plugin>
+            </plugin>-->
             <plugin>
                 <groupId>org.apache.tomcat.maven</groupId>
                 <artifactId>tomcat7-maven-plugin</artifactId>

+ 1 - 1
src/main/java/com/uas/platform/b2b/erp/model/Inquiry.java

@@ -222,7 +222,7 @@ public class Inquiry {
 	public Inquiry(SaleQuotation quotation) {
 		this.in_code = quotation.getCode();
 		this.in_date = quotation.getDate();
-		this.in_enddate = quotation.getDate();
+		this.in_enddate = quotation.getEndDate();
 		this.in_recorddate = quotation.getDate();
 		this.in_remark = quotation.getRemark();
 		this.b2b_qu_id = quotation.getId();

+ 0 - 4
src/main/java/com/uas/platform/b2b/erp/model/InquiryDetail.java

@@ -357,15 +357,11 @@ public class InquiryDetail {
 	public InquiryDetail(SaleQuotationItem item) {
 		this.id_currency = item.getQuotation().getCurrency();
 		this.id_detno = item.getNumber();
-//		this.id_fromdate = item.getQuotation().getDate();
 		this.id_minbuyqty = item.getMinOrderQty();
 		this.id_minqty = item.getMinPackQty();
-		this.id_myfromdate = item.getQuotation().getDate();
-		this.id_mytodate = item.getQuotation().getEndDate();
 		this.id_prodcode = item.getProduct() != null ? item.getProduct().getCode(): item.getCustProductCode();
 		this.id_rate = item.getQuotation().getTaxrate();
 		this.id_remark = item.getRemark();
-//		this.id_todate = item.getQuotation().getEndDate();
 		this.ve_uu = item.getQuotation().getEnUU();
 		this.id_brand = item.getBrand();
 		this.id_leadtime = item.getLeadtime();

+ 2 - 0
src/main/java/com/uas/platform/b2b/erp/service/impl/APCheckServiceImpl.java

@@ -53,6 +53,8 @@ public class APCheckServiceImpl implements APCheckService {
 						} else if (apCheck.getAc_confirmstatus().equals("不同意")) {
 							for (PurchaseApCheckItem exitItem : apcheckb2b.getItems()) {
 								exitItem.setApCheck(apcheckb2b);
+								Double custQty = exitItem.getCustCheckQty() - exitItem.getCheckQty();
+                                exitItem.setCustCheckQty(custQty);
 								apCheckItems.add(exitItem);
 							}
 						}

+ 18 - 14
src/main/java/com/uas/platform/b2b/erp/service/impl/InquiryServiceImpl.java

@@ -23,7 +23,11 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.stereotype.Service;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 @Service
 public class InquiryServiceImpl implements InquiryService {
@@ -113,23 +117,23 @@ public class InquiryServiceImpl implements InquiryService {
 								item.setProduct(products.get(0));
 								item.setProductId(products.get(0).getId());
 							} else {
-                                List<NotExistProduct> productList = notExistProductDao.findByEnuuAndCode(enUU, product.getCode());
-                                if (org.springframework.util.CollectionUtils.isEmpty(productList)) {
-                                    notExistProductDao.save(new NotExistProduct(product.getCode(), enUU, "inquiry", inquiry.getIn_code()));
-                                } else {
-                                    NotExistProduct prod = productList.get(0);
-                                    prod.setStatus(Status.NOT_UPLOAD.value());
-                                    notExistProductDao.save(prod);
-                                }
-                                throw new NotFoundException("企业UU【" + enUU + "】,物料编号【" + product.getCode() + "】,来源【" + inquiry.getIn_code() + "】");
+								List<NotExistProduct> productList = notExistProductDao.findByEnuuAndCode(enUU, product.getCode());
+								if (org.springframework.util.CollectionUtils.isEmpty(productList)) {
+									notExistProductDao.save(new NotExistProduct(product.getCode(), enUU, "inquiry", inquiry.getIn_code()));
+								} else {
+									NotExistProduct prod = productList.get(0);
+									prod.setStatus(Status.NOT_UPLOAD.value());
+									notExistProductDao.save(prod);
+								}
+								throw new NotFoundException("企业UU【" + enUU + "】,物料编号【" + product.getCode() + "】,来源【" + inquiry.getIn_code() + "】");
 							}
-                            item.setInquiry(purchaseInquiry);
+							item.setInquiry(purchaseInquiry);
 							PurchaseInquiryTemp temp = new PurchaseInquiryTemp();
-                            BeanUtils.copyProperties(purchaseInquiry, temp, PurchaseInquiryTemp.class);
-                            PurchaseInquiryItemTemp itemTemp = new PurchaseInquiryItemTemp();
+							BeanUtils.copyProperties(purchaseInquiry, temp, PurchaseInquiryTemp.class);
+							PurchaseInquiryItemTemp itemTemp = new PurchaseInquiryItemTemp();
 							BeanUtils.copyProperties(item, itemTemp, PurchaseInquiryItemTemp.class);
 							itemTemp.setInquiry(temp);
-                            tempList.add(itemTemp);
+							tempList.add(itemTemp);
 						}
 					}
 

+ 2 - 4
src/main/java/com/uas/platform/b2b/service/impl/ErpProdIODetailServiceImpl.java

@@ -107,12 +107,10 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
 			}
 		}
 		if (fromDate != null) {
-			sql = sql + " and pi_date >= " + "to_date('" + new java.sql.Date(new Date(fromDate).getTime())
-					+ "','yyyy-mm-dd')";
+			sql = sql + " and DATE_FORMAT(pi_date, '%Y-%m-%d') >= ('" + new java.sql.Date(new Date(fromDate).getTime()) + "')";
 		}
 		if (endDate != null) {
-			sql = sql + " and pi_date < " + "to_date('" + new java.sql.Date(new Date(endDate).getTime())
-					+ "','yyyy-mm-dd') + 1";
+			sql = sql + " and DATE_FORMAT(pi_date, '%Y-%m-%d') < ('" + new java.sql.Date(new Date(endDate + 1000).getTime()) + "')";
 		}
 		Object[] args = new Object[] { enUu };
 		if (!CollectionUtils.isEmpty(filter)) {

+ 16 - 11
src/main/java/com/uas/platform/b2b/service/impl/InvitationRecordServiceImpl.java

@@ -148,18 +148,23 @@ public class InvitationRecordServiceImpl implements InvitationRecordService {
      * @param businessCode 营业执照
      */
     @Override
-    public void syncToAccount(InvitationRecord record, String businessCode) {
+    public void syncToAccount(final InvitationRecord record, final String businessCode) {
         // 同步一个数据到账户中心(不是必须,不判断状态)
-        try {
-            record.setUser(null);
-            record.setId(null);
-            record.setSamecount(null);
-            record.setVenduu(null);
-            record.setBussinesscode(businessCode);
-            AccountUtils.synchroInvitation(FlexJsonUtils.toJsonDeep(record));
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        ThreadUtils.task(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    record.setUser(null);
+                    record.setId(null);
+                    record.setSamecount(null);
+                    record.setVenduu(null);
+                    record.setBussinesscode(businessCode);
+                    AccountUtils.synchroInvitation(FlexJsonUtils.toJsonDeep(record));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }).run();
     }
 
     /**

+ 10 - 22
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryDetailServiceImpl.java

@@ -10,7 +10,10 @@ import com.uas.platform.b2b.support.SystemSession;
 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.criteria.CriterionExpression;
+import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
+import com.uas.platform.core.persistence.criteria.SimpleExpression;
 import com.uas.search.b2b.model.PageParams;
 import com.uas.search.b2b.model.SPage;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -51,28 +54,13 @@ public class PurchaseInquiryDetailServiceImpl implements PurchaseInquiryDetailSe
 	 */
 	@Override
 	public SPage<PurchaseInquiryDetail> findInvalidByPageInfo(PageInfo pageInfo, String keyword, SearchFilter filter) {
-		Date date = new Date();
-		Calendar now = Calendar.getInstance();
-		now.setTime(date);
-		// 判断时间设置为23:59:59 ,截止报价日期当天也可报价
-		now.set(Calendar.HOUR_OF_DAY, 23);
-		now.set(Calendar.MINUTE, 59);
-		now.set(Calendar.SECOND, 59);
-		// 增加已失效过滤条件
-		pageInfo.expression(PredicateUtils.or(
-				// 状态为314 已作废
-				PredicateUtils.eq("status", Status.DISABLED.value(), false),
-				// invalid 为1,已过客户报价有效截止日期
-				PredicateUtils.eq("invalid", Constant.YES, true),
-				// 未回复且客户系统已提交(this.status == 200 && null != this.getInquiry().getCheck() && this.getInquiry().getCheck() == 1)
-				PredicateUtils.and(PredicateUtils.eq("status", Status.NOT_REPLY.value(), false),
-						PredicateUtils.eq("inquiry.check", Constant.YES, false)),
-				// 未回复但是已过报价截止日期
-				PredicateUtils.and(PredicateUtils.eq("status", Status.NOT_REPLY.value(), false),
-						PredicateUtils.lte("inquiry.endDate", now.getTime(), false))
-
-		));
-		return findByPageInfo(pageInfo, keyword, filter);
+        SimpleExpression overdue = new SimpleExpression("overdue", Constant.YES, CriterionExpression.Operator.EQ, true);
+        SimpleExpression invalid = new SimpleExpression("invalid", Constant.YES, CriterionExpression.Operator.EQ, true);
+        SimpleExpression status = new SimpleExpression("status", Status.DISABLED.value(), CriterionExpression.Operator.EQ, true);
+        SimpleExpression[] expressions = new SimpleExpression[]{overdue, invalid, status};
+        LogicalExpression logical = new LogicalExpression(expressions, CriterionExpression.Operator.OR);
+        pageInfo.expression(PredicateUtils.and(PredicateUtils.isNull("agreed"), logical));
+        return findByPageInfo(pageInfo, keyword, filter);
 	}
 
     /**

+ 67 - 52
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java

@@ -117,8 +117,8 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 	@Autowired
     private PurchaseInquiryItemTempDao tempDao;
 
-    @Autowired
-    private PurchaseInquiryTempDao inquiryTempDao;
+	@Autowired
+	private PurchaseInquiryTempDao inquiryTempDao;
 
 	private final static ErpBufferedLogger logger = BufferedLoggerManager.getLogger(ErpBufferedLogger.class);
 
@@ -131,53 +131,53 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 
     @Override
     public void saveList(List<PurchaseInquiryItemTemp> purchaseInquiryItemTemps) {
-    	try {
-    	    for (PurchaseInquiryItemTemp itemTemp : purchaseInquiryItemTemps) {
-                PurchaseInquiryTemp inquiryTemp = inquiryTempDao.findByCodeAndEnUU(itemTemp.getInquiry().getCode(), itemTemp.getInquiry().getEnUU());
-                if (inquiryTemp == null) {
-                    PurchaseInquiryTemp temp = inquiryTempDao.save(itemTemp.getInquiry());
-                    itemTemp.setInId(temp.getId());
-                } else {
-                    itemTemp.setInId(inquiryTemp.getId());
-                }
-            }
+		try {
+			for (PurchaseInquiryItemTemp itemTemp : purchaseInquiryItemTemps) {
+				PurchaseInquiryTemp inquiryTemp = inquiryTempDao.findByCodeAndEnUU(itemTemp.getInquiry().getCode(), itemTemp.getInquiry().getEnUU());
+				if (inquiryTemp == null) {
+					PurchaseInquiryTemp temp = inquiryTempDao.save(itemTemp.getInquiry());
+					itemTemp.setInId(temp.getId());
+				} else {
+					itemTemp.setInId(inquiryTemp.getId());
+				}
+			}
 			purchaseInquiryItemTemps = tempDao.save(purchaseInquiryItemTemps);
 		} catch (Exception e) {
-    		for (PurchaseInquiryItemTemp temp : purchaseInquiryItemTemps) {
-    		    if (inquiryTempDao.exists(temp.getInId())) {
-                    inquiryTempDao.delete(temp.getInId());
-                }
-                throw new IllegalOperatorException("保存失败");
+			for (PurchaseInquiryItemTemp temp : purchaseInquiryItemTemps) {
+				if (inquiryTempDao.exists(temp.getInId())) {
+					inquiryTempDao.delete(temp.getInId());
+				}
+				throw new IllegalOperatorException("保存失败");
 			}
 		}
-        List<PurchaseInquiryItem> inquiryItems = new ArrayList<PurchaseInquiryItem>();
-        if (!CollectionUtils.isEmpty(purchaseInquiryItemTemps)) {
-            for (PurchaseInquiryItemTemp temp : purchaseInquiryItemTemps) {
-                PurchaseInquiryItem item = new PurchaseInquiryItem();
-                BeanUtils.copyProperties(temp, item, PurchaseInquiryItem.class);
-                item.setInquiry(purchaseInquiryDao.findOne(temp.getInId()));
-                item.setProduct(productDao.findOne(temp.getProductId()));
-            }
-            saveUserOrders(inquiryItems);
-            Long userUU = SystemSession.getUser().getUserUU();
-            Long enUU = SystemSession.getUser().getEnterprise().getUu();
-            String userIp = SystemSession.getUser().getIp();
-            String userName = SystemSession.getUser().getUserName();
-            sendRemind(PurchaseInquiryItem.distinct(inquiryItems), userUU, userName, userIp, enUU);
-            // 产生消息
-            List<PurchaseInquiry> inquiries = PurchaseInquiryItem.distinct(inquiryItems);
-            List<PurchaseInquiryItem> items = new ArrayList<>();
-            for (PurchaseInquiry inquiry : inquiries) {
-                Set<Long> enUUs = new HashSet<>();
-                for (PurchaseInquiryItem inquiryItem : inquiry.getInquiryItems()) {
-                    if (!enUUs.contains(inquiryItem.getVendUU())) {
-                        items.add(inquiryItem);
-                        enUUs.add(inquiryItem.getVendUU());
-                    }
-                }
-            }
-            ContextUtils.publishEvent(new PurchaseInquiryItemSaveReleaseEvent(items));
-        }
+		List<PurchaseInquiryItem> inquiryItems = new ArrayList<PurchaseInquiryItem>();
+		if (!CollectionUtils.isEmpty(purchaseInquiryItemTemps)) {
+			for (PurchaseInquiryItemTemp temp : purchaseInquiryItemTemps) {
+				PurchaseInquiryItem item = new PurchaseInquiryItem();
+				BeanUtils.copyProperties(temp, item, PurchaseInquiryItem.class);
+				item.setInquiry(purchaseInquiryDao.findOne(temp.getInId()));
+				item.setProduct(productDao.findOne(temp.getProductId()));
+			}
+			saveUserOrders(inquiryItems);
+			Long userUU = SystemSession.getUser().getUserUU();
+			Long enUU = SystemSession.getUser().getEnterprise().getUu();
+			String userIp = SystemSession.getUser().getIp();
+			String userName = SystemSession.getUser().getUserName();
+			sendRemind(PurchaseInquiryItem.distinct(inquiryItems), userUU, userName, userIp, enUU);
+			// 产生消息
+			List<PurchaseInquiry> inquiries = PurchaseInquiryItem.distinct(inquiryItems);
+			List<PurchaseInquiryItem> items = new ArrayList<>();
+			for (PurchaseInquiry inquiry : inquiries) {
+				Set<Long> enUUs = new HashSet<>();
+				for (PurchaseInquiryItem inquiryItem : inquiry.getInquiryItems()) {
+					if (!enUUs.contains(inquiryItem.getVendUU())) {
+						items.add(inquiryItem);
+						enUUs.add(inquiryItem.getVendUU());
+					}
+				}
+			}
+			ContextUtils.publishEvent(new PurchaseInquiryItemSaveReleaseEvent(items));
+		}
     }
 
     /**
@@ -572,8 +572,6 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
     public SPage<PurchaseInquiryItem> findTodoByPageInfo(PageInfo pageInfo, String keyword, SearchFilter filter) {
         // 提交状态不为1
         pageInfo.expression(PredicateUtils.or(PredicateUtils.isNull("inquiry.check"), PredicateUtils.eq("inquiry.check", Constant.NO, false)));
-        pageInfo.expression(PredicateUtils.ne("overdue", Constant.YES, false));
-        pageInfo.expression(PredicateUtils.ne("invalid", Constant.YES, false));
         return findByPageInfo(pageInfo, keyword, filter);
     }
 
@@ -583,26 +581,38 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
      */
     @Override
     public void coverInquiryItemProdToUser(Long enUU) throws Exception {
+		System.out.println("开始时间" + new Date());
 		long start = System.currentTimeMillis();
+//		String codePrefix = DateUtils.format(new Date(), "yyMMddHHmm") + StringUtil.getRandomNumber(3);
 		String importId = StringUtil.getRandomNumber(8);
+		System.out.println("importId:" + importId);
         int size = 1000;
         int page = 1;
 		int i = 0;
         String countSql = "select count(1) from (select id_prid,id_venduu,id_venduseruu,count(1) as nums from purc$inquiryitems left join purc$inquiry on id_inid = in_id" +
-                " where id_venduseruu is not null and id_status = 201 and in_enuu = " + enUU + " group by id_prid,id_venduseruu,id_venduu order by count(1) desc) a";
+				"        where id_venduseruu is not null and id_status = 201 and in_enuu = " + enUU + " group by id_prid,id_venduseruu,id_venduu order by count(1) desc)";
         Integer count = commonDao.queryForObject(countSql, Integer.class);
+		System.out.println("循环次数:" + Math.ceil((double)count / (double)size));
         for (; page <= Math.ceil((double)count / (double)size); page++ ) {
+			System.out.println("开始循环:" + page);
 			String sql = "select " + importId + " as pr_import_id, pr_title,pr_code,pr_spec,pr_unit,pr_minpack,pr_minorder,pr_leadtime,pr_ltinstock,pr_brand,pr_cmpcode,'B2B' as pr_sourceapp,id_prid as pr_sourceid,1 as pr_issale,0 aspr_ispurchase,pr_isshow,pr_ispubsale,pr_standard,pr_create_time,id_venduu as pr_enuu,id_venduseruu as pr_useruu from (" +
-					"select id_prid,id_venduu,id_venduseruu,count(1) as nums from purc$inquiryitems left join purc$inquiry on id_inid = in_id " +
+					" select P.*,t.*,rownum r from (select id_prid,id_venduu,id_venduseruu,count(1) as nums from purc$inquiryitems left join purc$inquiry on id_inid = in_id " +
 					" where id_venduseruu is not null and id_status = 201 and in_enuu = " + enUU + " group by id_prid,id_venduseruu,id_venduu order by count(1) desc " +
-					" ) t left join v$products P on id_prid = pr_id where P.pr_title is not null and P.pr_code is not null limit 0,10";
+					" ) t left join v$products P on id_prid = pr_id where P.pr_title is not null and P.pr_code is not null and rownum <= 10" +
+					") where r > 0";
+			System.out.println(sql);
 			List<ProductTemp> productTemps = commonDao.query(sql, ProductTemp.class);
+			System.out.println(enUU + "找到询价单详情" + productTemps.size());
 			// 本地校验
 			checkTempProducts(productTemps);
 			// 保存到公共库
 			saveToDataCenter(productTemps);
+			System.out.println("循环一次物料:" + productTemps.size());
 			i += productTemps.size();
+			System.out.println("结束循环:" + page + "耗时:" + (System.currentTimeMillis() - start));
 		}
+		System.out.println("总计处理物料:" + i);
+		System.out.println("结束循环耗时:" + (System.currentTimeMillis() - start));
     }
 
 	/**
@@ -620,6 +630,7 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 			productTempDao.matchExists(importId);
 			// 已禁用物料自动解禁
 			productTempDao.toggleDisabled(importId);
+			System.out.println("校验:" + (System.currentTimeMillis() - start));
 		}
 	}
 
@@ -627,12 +638,16 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 	 * 保存到公共库
 	 */
 	private void saveToDataCenter(List<ProductTemp> temps) throws Exception {
+		long start = System.currentTimeMillis();
 		if (!CollectionUtils.isEmpty(temps)) {
 			String importId = temps.get(0).getPr_import_id();
 			// 已匹配+未匹配到的物料
 			List<Product> products = productTempDao.getProducts(importId);
+			System.out.println("取匹配后结果:" + (System.currentTimeMillis() - start));
+			start = System.currentTimeMillis();
 			// 更新物料并插入个人物料
-			ProductUtils.paginationUpdateAndAddToProductUser(products);
+			ModelMap map = ProductUtils.paginationUpdateAndAddToProductUser(products);
+			System.out.println("更新物料:" + (System.currentTimeMillis() - start));
 		}
 	}
 
@@ -795,7 +810,7 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 		// 通过相关的id在inquiry表中查询信息,再根据状态进行过滤
 		for (PurchaseInquiryItem purcInquiry : purchaseInquiryItem) {
 			PurchaseInquiry purcInqury = purchaseInquiryDao.findOne(purcInquiry.getInquiry().getId());
-			if (null != purcInqury && !StringUtils.isEmpty(purcInqury.getOverdue()) && purcInqury.getOverdue().equals(Constant.NO)) {
+			if (purcInqury.getOverdue().equals(Constant.NO)) {
 				list.add(purcInqury);
 				number = list.size();
 			}

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

@@ -1,6 +1,7 @@
 package com.uas.platform.b2b.v2.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2b.model.Enterprise;
 import com.uas.platform.b2b.model.EnterpriseBaseInfo;
 import com.uas.platform.b2b.model.InvitationRecord;
@@ -15,6 +16,7 @@ import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageParams;
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.platform.core.web.bind.RequestState;
 import com.uas.ps.core.util.StringUtils;
 import com.uas.search.b2b.model.SPage;
@@ -156,8 +158,12 @@ 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 {
+        System.out.println(jsonStr);
+        String str = URLDecoder.decode(jsonStr, "UTF-8");
+        str = str.replaceAll(" ", "");
+        str = str.replaceAll("\\\\n", "");
+        InvitationRecord record = JSONObject.parseObject(str, InvitationRecord.class);
         Long enUU = checkByBusinessCode(record.getEnuu(), record.getBussinesscode());
         Long userUU = checkByUserTel(record.getUseruu(), record.getUserTel());
         record.setEnuu(enUU);
@@ -197,9 +203,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());

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

@@ -149,7 +149,7 @@ public class InviteRecordServiceImpl implements InviteRecordService {
                 "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 substr(time, -2) month, time ,in_enuu enUU,count(1) count from(" +
+        String sql1 = "select substr(time, -2) month, time ,in_enuu enUU,count(1) doneCount 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);
@@ -338,7 +338,7 @@ public class InviteRecordServiceImpl implements InviteRecordService {
         if (StringUtils.isEmpty(custUser)) {
             throw new IllegalOperatorException(record.getUseruu() + ",不存在邀请人信息");
         }
-        Enterprise custEn = enterpriseService.findByEnUU(record.getEnuu());
+        final Enterprise custEn = enterpriseService.findByEnUU(record.getEnuu());
         if (StringUtils.isEmpty(custEn)) {
             throw new IllegalOperatorException(record.getEnuu() + ",不存在邀请企业信息");
         }

+ 27 - 21
src/main/resources/prod/jdbc.properties

@@ -1,22 +1,28 @@
-jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
-jdbc.url=jdbc:oracle:thin:@10.10.100.200:1521:orcl
-jdbc.username=platform$b2b
-jdbc.password=select*fromuu
-jdbc.initialSize=5
-jdbc.maxActive=100
-jdbc.minIdle=5
-jdbc.suspectTimeout=60
-jdbc.timeBetweenEvictionRunsMillis=30000
-jdbc.minEvictableIdleTimeMillis=60000
-jdbc.validationQuery=SELECT 1 FROM DUAL
-jdbc.testWhileIdle=true
-jdbc.testOnBorrow=true
-jdbc.testOmReturn=false
-jdbc.removeAbandoned=true
-jdbc.removeAbandonedTimeout=1800
+#jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
+#jdbc.url=jdbc:oracle:thin:@10.10.100.200:1521:orcl
+#jdbc.username=platform$b2b
+#jdbc.password=select*fromuu
+#jdbc.initialSize=5
+#jdbc.maxActive=100
+#jdbc.minIdle=5
+#jdbc.suspectTimeout=60
+#jdbc.timeBetweenEvictionRunsMillis=30000
+#jdbc.minEvictableIdleTimeMillis=60000
+#jdbc.validationQuery=SELECT 1 FROM DUAL
+#jdbc.testWhileIdle=true
+#jdbc.testOnBorrow=true
+#jdbc.testOmReturn=false
+#jdbc.removeAbandoned=true
+#jdbc.removeAbandonedTimeout=1800
+#
+##manage.ubtob.com
+#manage.jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
+#manage.jdbc.url=jdbc:oracle:thin:@//10.10.100.215:1521/orcl
+#manage.jdbc.username=platformmanager
+#manage.jdbc.password=select!#%*(
 
-#manage.ubtob.com
-manage.jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
-manage.jdbc.url=jdbc:oracle:thin:@//10.10.100.215:1521/orcl
-manage.jdbc.username=platformmanager
-manage.jdbc.password=select!#%*(
+
+jdbc.driverClassName=com.mysql.jdbc.Driver
+jdbc.url=jdbc:mysql://192.168.253.12:3306/b2b_test_hejq?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true
+jdbc.username=root
+jdbc.password=select111***

+ 2 - 1
src/main/webapp/resources/tpl/index/baseInfo/inquiry_list.html

@@ -397,7 +397,8 @@
                                             <a class="offer" ng-click="">已报价</a>
                                         </td>
                                         <td ng-if="inquiryItem.quoted != 1">
-                                            <a class="offer"ng-click="transtoInquiry(inquiryItem)" ng-if="inquiryItem.remainingTime > 0 && inquiryItem.overdue != 1">我要报价</a>
+                                            <a class="offer"ng-click="transtoInquiry(inquiryItem)" ng-if="inquiryItem.remainingTime > 0 && inquiryItem.overdue != 1 && currentEn.uu != inquiryItem.inquiry.enUU">我要报价</a>
+                                            <a style="color: #999" ng-if="currentEn.uu == inquiryItem.inquiry.enUU" ng-click="transtoInquiry(inquiryItem)">我要报价</a>
                                             <a class="offer" ng-if="inquiryItem.remainingTime <= 0 || inquiryItem.overdue == 1 || !isOverDue(inquiryItem.inquiry.endDate)" ng-click="">已结束</a>
                                         </td>
                                     </tr>

+ 205 - 197
src/main/webapp/resources/tpl/index/purc/order.html

@@ -1,195 +1,195 @@
 <style>
-	.condition .more.open {
-		margin-top: 10px;
-		height: 36px;
-		opacity: 1;
-	}
+.condition .more.open {
+	margin-top: 10px;
+	height: 36px;
+	opacity: 1;
+}
 
-	.condition .more .form-group {
-		margin-bottom: 0;
-	}
+.condition .more .form-group {
+	margin-bottom: 0;
+}
 
-	.order-table .header>th {
-		height: 38px;
-		text-align: center;
-		background: #f5f5f5;
-		border-top: 1px solid #e8e8e8;
-		border-bottom: 1px solid #e8e8e8;
-	}
+.order-table .header>th {
+	height: 38px;
+	text-align: center;
+	background: #f5f5f5;
+	border-top: 1px solid #e8e8e8;
+	border-bottom: 1px solid #e8e8e8;
+}
 
-	.order-table .sep-row {
-		height: 10px;
-	}
+.order-table .sep-row {
+	height: 10px;
+}
 
-	.order-table .selector {
-		vertical-align: middle;
-		margin: 0 0 2px 0;
-	}
+.order-table .selector {
+	vertical-align: middle;
+	margin: 0 0 2px 0;
+}
 
-	.toolbar label {
-		margin-right: 10px;
-		margin-bottom: 0;
-	}
+.toolbar label {
+	margin-right: 10px;
+	margin-bottom: 0;
+}
 
-	.toolbar .select_all {
-		margin: 0 6px 0 10px;
-		line-height: 20px;
-	}
+.toolbar .select_all {
+	margin: 0 6px 0 10px;
+	line-height: 20px;
+}
 
-	.toolbar .btn {
-		-moz-border-radius: 2px;
-		margin-right: 5px;
-		border: 1px solid #dcdcdc;
-		border-radius: 2px;
-		-webkit-border-radius: 2px;
-	}
+.toolbar .btn {
+	-moz-border-radius: 2px;
+	margin-right: 5px;
+	border: 1px solid #dcdcdc;
+	border-radius: 2px;
+	-webkit-border-radius: 2px;
+}
 
-	.order-table .order-hd {
-		background: #f5f5f5;
-		height: 40px;
-		line-height: 40px;
-	}
+.order-table .order-hd {
+	background: #f5f5f5;
+	height: 40px;
+	line-height: 40px;
+}
 
-	.order-table .order-hd td.first {
-		padding-left: 20px;
-	}
+.order-table .order-hd td.first {
+	padding-left: 20px;
+}
 
-	.order-table .order-hd .order-main span {
-		margin-right: 8px;
-	}
+.order-table .order-hd .order-main span {
+	margin-right: 8px;
+}
 
-	.order-table .order-hd .order-code {
-		font-style: normal;
-		font-family: verdana;
-	}
+.order-table .order-hd .order-code {
+	font-style: normal;
+	font-family: verdana;
+}
 
-	.order-table .order-hd .order-sum {
-		padding: 0 5px;
-	}
+.order-table .order-hd .order-sum {
+	padding: 0 5px;
+}
 
-	/*.order-table>tbody {
-        border: 1px solid transparent;
-        border-bottom: 10px #ddd solid;
-    }*/
-	.order-table>tbody:hover{
-		border: #d32526 2px solid !important;
-	}
-	/*.order-table>tbody:hover .order-hd td{
-        border-top: #d32526 2px solid !important;
-    }*/
+/*.order-table>tbody {
+	border: 1px solid transparent;
+	border-bottom: 10px #ddd solid;
+}*/
+.order-table>tbody:hover{
+	border: #d32526 2px solid !important;
+}
+/*.order-table>tbody:hover .order-hd td{
+	border-top: #d32526 2px solid !important;
+}*/
 
-	.order-table .operates {
-		display: none;
-	}
+.order-table .operates {
+	display: none;
+}
 
-	.order-table .operates i {
-		padding: 0 2px;
-	}
+.order-table .operates i {
+	padding: 0 2px;
+}
 
-	.order-table>tbody:hover .operates {
-		display: block;
-	}
-	.order-table>tbody:hover .operates-status {
-		display: none;
-	}
+.order-table>tbody:hover .operates {
+	display: block;
+}
+.order-table>tbody:hover .operates-status {
+	display: none;
+}
 
 
-	.order-table .order-bd {
-		border-bottom: 1px solid #e6e6e6;
-	}
+.order-table .order-bd {
+	border-bottom: 1px solid #e6e6e6;
+}
 
-	.order-table .order-bd>td {
-		padding: 10px 5px;
-		vertical-align: top;
-		position: relative;
-	}
+.order-table .order-bd>td {
+	padding: 10px 5px;
+	vertical-align: top;
+	position: relative;
+}
 
-	.order-table .order-bd .product {
-		padding-left: 20px;
-	}
+.order-table .order-bd .product {
+	padding-left: 20px;
+}
 
-	.order-table .order-bd .order-number {
-		position: absolute;
-		top: -1px;
-		left: -1px;
-		width: 20px;
-		height: 20px;
-		line-height: 20px;
-		text-align: center;
-		background: #f5f5f5;
-		font-weight: 500;
-		border: solid 1px #d5d5d5;
-		border-radius: 0 0 10px 0;
-	}
+.order-table .order-bd .order-number {
+	position: absolute;
+	top: -1px;
+	left: -1px;
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	text-align: center;
+	background: #f5f5f5;
+	font-weight: 500;
+	border: solid 1px #d5d5d5;
+	border-radius: 0 0 10px 0;
+}
 
-	.order-table .order-bd .order-number.key {
-		background: #56a022;
-		color: #ffffff;
-	}
+.order-table .order-bd .order-number.key {
+	background: #56a022;
+	color: #ffffff;
+}
 
-	.unPrinted {
-		color: #56a022;
-	}
+.unPrinted {
+	color: #56a022;
+}
 
-	.info-container .info:hover {
-		color: #CC3333;
-	}
-	.buy-cart{
-		font-size: 14px;
-		padding: 0;
-		margin-left: 50px;
-	}
-	.buy-cart a{
-		color: #5078cb;
-		float: left;
-		margin-left: 15px;
-	}
-	.buy-cart a img{
-		margin-right: 3px;
-	}
-	#public .menu .btn-group{
-		height: inherit !important;
-	}
-	.menu .new-dot{
-		width: 20px;
-		height: 20px;
-		line-height: 20px;
-		font-size: 12px;
-		color: #fff;
-		font-weight: inherit;
-		top: -2px;
-	}
+.info-container .info:hover {
+	color: #CC3333;
+}
+.buy-cart{
+	font-size: 14px;
+	padding: 0;
+	margin-left: 50px;
+}
+.buy-cart a{
+	color: #5078cb;
+	float: left;
+	margin-left: 15px;
+}
+.buy-cart a img{
+	margin-right: 3px;
+}
+#public .menu .btn-group{
+	height: inherit !important;
+}
+.menu .new-dot{
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	font-size: 12px;
+	color: #fff;
+	font-weight: inherit;
+	top: -2px;
+}
 	.order-table .product div.text-over {
 		width: 340px;
 		white-space: nowrap;
 		text-overflow: ellipsis;
 		overflow: hidden;
 	}
-	.order-table .product div.text-flow b{
-		float: left;
-	}
-	.order-table .product div.text-flow span{
-		float: left;
-		display: inline-block;
-		width: 290px;
-		white-space: nowrap;
-		text-overflow: ellipsis;
-		overflow: hidden;
-	}
-	.order-table .product div.text-overflow span{
-		float: left;
-		display: inline-block;
-		width: 340px;
-		white-space: nowrap;
-		text-overflow: ellipsis;
-		overflow: hidden;
-	}
+.order-table .product div.text-flow b{
+	float: left;
+}
+.order-table .product div.text-flow span{
+	float: left;
+	display: inline-block;
+	width: 290px;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	overflow: hidden;
+}
+.order-table .product div.text-overflow span{
+	float: left;
+	display: inline-block;
+	width: 340px;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	overflow: hidden;
+}
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
-	<div class="loading in" ng-class="{'in': loading}">
-		<i></i>
-	</div><div class="pub-com_head">
+<div class="loading in" ng-class="{'in': loading}">
+	<i></i>
+</div><div class="pub-com_head">
 	<span>采购订单</span>
 	<div class="p-right">
 		<a ui-sref="purc.newOrder" title="新增采购单"><img src="static/img/icon/add.png"/>新增</a>
@@ -197,33 +197,33 @@
 		<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 	</div>
 </div>
-	<div class="menu condition block">
+<div class="menu condition block">
 		<div class="row">
 			<div class="col-xs-9">
 				<div class="btn-group btn-group-sm btn-group-justified">
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部
+							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部
 							<b class="new-dot" ng-if="unread.replied > 0">{{unread.replied>99?'99+':unread.replied}}</b>
 						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已回复
+							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已回复
 							<b class="new-dot" ng-if="unread.replied > 0">{{unread.replied>99?'99+':unread.replied}}</b>
 						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待回复</button>
+							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待回复</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='waiting'}" ng-click="setActive('waiting')">待交货</button>
+							ng-class="{'btn-info':active=='waiting'}" ng-click="setActive('waiting')">待交货</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已结案</button>
+							ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已结案</button>
 					</div>
 				</div>
 			</div>
@@ -232,7 +232,7 @@
 			</div>
 		</div>
 	</div>
-	<!--<div class="height10">&nbsp;</div>-->
+<!--<div class="height10">&nbsp;</div>-->
 	<div class="condition block">
 		<div class="search-bg condition block" style="padding: 10px 15px;">
 			<div class="row">
@@ -299,8 +299,8 @@
 			</div>
 		</div>
 	</div>
-	<table class="order-table block" ng-table="tableParams">
-		<thead>
+<table class="order-table block" ng-table="tableParams">
+	<thead>
 		<tr class="header">
 			<th>物料</th>
 			<th width="80">含税单价</th>
@@ -310,8 +310,8 @@
 			<th width="180">单据状态</th>
 			<th width="120">供应商</th>
 		</tr>
-		</thead>
-		<tbody ng-if="tableParams.total() == 0">
+	</thead>
+	<tbody ng-if="tableParams.total() == 0">
 		<tr>
 			<td colspan="6">
 				<div class="row text-muted info-container" style="padding: 50px 10px;">
@@ -328,15 +328,15 @@
 						<div class="f14">
 							<div class="info">
 								<p>1、您的采购单在ERP系统上还没审核,订单无法上传到平台<br>
-									解决:采购员沟通确认单据是否已经审核(只有ERP中已经审核的单据才能接收到)</p>
+								解决:采购员沟通确认单据是否已经审核(只有ERP中已经审核的单据才能接收到)</p>
 							</div>
 							<div class="info">
 								<p>2、ERP中供应商信息有误<br>
-									解决:与您的供应商沟通确认他的资料在供应商资料中是否维护正确,尤其是企业UU号</p>
+								解决:与您的供应商沟通确认他的资料在供应商资料中是否维护正确,尤其是企业UU号</p>
 							</div>
 							<div class="info">
 								<p>3、您的供应商正在使用旧版本的UAS商务平台<br>
-									解决:我们仍有部分用户在使用旧版本UAS商务平台系统,你可以用您的企业UU号和管理员个人UU号 <a href="http://www.usoftchina.com" class="text-bold text-link" title="http://www.usoftchina.com" target="_blank">登陆旧版本UAS商务平台</a></p>
+								解决:我们仍有部分用户在使用旧版本UAS商务平台系统,你可以用您的企业UU号和管理员个人UU号 <a href="http://www.usoftchina.com" class="text-bold text-link" title="http://www.usoftchina.com" target="_blank">登陆旧版本UAS商务平台</a></p>
 							</div>
 						</div>
 						<br>
@@ -345,8 +345,8 @@
 				</div>
 			</td>
 		</tr>
-		</tbody>
-		<tbody ng-repeat="order in $data track by order.id">
+	</tbody>
+	<tbody ng-repeat="order in $data track by order.id">
 		<tr class="order-hd" ng-dblclick="order.$collapsed=!order.$collapsed" ng-class="{'text-bold': order.display>0}">
 			<td class="first" colspan="5">
 				<div class="order-main">
@@ -360,16 +360,16 @@
 						ng-model="order.$selected" ng-click="checkOne(order)">
 					</span> -->
 					<span class="text-num text-bold"
-						  ng-bind="::order.date | date:'yyyy-MM-dd'"></span>
+						ng-bind="::order.date | date:'yyyy-MM-dd'"></span>
 					<span ng-bind="::order.receiveName"></span>
 					<span>订单号:<a title="查看详情"
-								 class="text-num order-detail" ng-bind="::order.code" ui-sref="purc.order_detail({id:order.id})" target="_self"
-								 ng-click="setOrdersRead(order.id)"></a></span>
+						class="text-num order-detail" ng-bind="::order.code" ui-sref="purc.order_detail({id:order.id})" target="_self"
+						ng-click="setOrdersRead(order.id)"></a></span>
 				</div>
 			</td>
 			<td ng-if="!isUser" class="order-sum">{{::order.currency}}: <span
-					ng-bind="getOrderTotal(order.orderItems) | number : 2"
-					class="text-num text-bold"></span>
+				ng-bind="getOrderTotal(order.orderItems) | number : 2"
+				class="text-num text-bold"></span>
 			</td>
 			<td ng-if="isUser" class="order-sum"></td>
 			<td class="text-center">
@@ -394,7 +394,7 @@
 				</div>
 				<div class="text-muted text-over"
 					 title="{{::item.product.spec}}"
-					 ng-bind="::item.product.spec"></div>
+					ng-bind="::item.product.spec"></div>
 				<div class="text-muted text-bold text-overflow" ng-if="item.vendspec" title="{{item.vendspec}}"><span ng-bind="::item.vendspec"></span></div>
 				<div class="text-bold text-inverse text-flow" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
 				<div class="text-bold text-inverse text-flow" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
@@ -408,26 +408,26 @@
 				<div class="text-muted" ng-bind="::item.product.unit"></div>
 				<div style="margin: 0 auto" ng-if="item.$editing">
 					<input type="number" ng-model="item.reply.qty" min="0" max="{{item.qty}}"
-						   ng-init="item.reply.qty=item.qty-item.replyQty"
-						   class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
+						ng-init="item.reply.qty=item.qty-item.replyQty"
+						class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
 				</div>
 			</td>
 			<td class="text-center br-l">
 				<div class="text-num" ng-bind="::item.delivery | date:'yyyy-MM-dd'"></div>
 				<br>
 				<div style="margin: 0 auto"
-					 class="input-group input-group-xs input-trigger"
-					 ng-if="item.$editing">
+					class="input-group input-group-xs input-trigger"
+					ng-if="item.$editing">
 					<input type="text" ng-model="item.reply.delivery"
-						   class="form-control" placeholder="回复交期"
-						   datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
-						   min-date="order.date" ng-required="true" current-text="今天"
-						   clear-text="清除" close-text="关闭"
-						   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-						   ng-focus="openDatePicker($event, item, '$opened')"> <span
+						class="form-control" placeholder="回复交期"
+						datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
+						min-date="order.date" ng-required="true" current-text="今天"
+						clear-text="清除" close-text="关闭"
+						datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+						ng-focus="openDatePicker($event, item, '$opened')"> <span
 						class="input-group-btn">
 						<button type="button" class="btn btn-default"
-								ng-click="openDatePicker($event, item, '$opened')">
+							ng-click="openDatePicker($event, item, '$opened')">
 							<i class="fa fa-calendar"></i>
 						</button>
 					</span>
@@ -439,7 +439,7 @@
 					<div ng-if="item.replyQty > 0 && item.replyQty < item.qty">
 						<div class="progress progress-sm">
 							<div class="progress-bar progress-bar-success"
-								 ng-style="{'width': 100*item.replyQty/item.qty + '%'}">
+								ng-style="{'width': 100*item.replyQty/item.qty + '%'}">
 								<span class="sr-only"></span>
 							</div>
 						</div>
@@ -448,13 +448,13 @@
 					</div>
 					<div ng-if="item.replyQty > 0" class="dropdown" ng-class="{'text-center': item.replyQty>=item.qty}">
 						<a href="javascript:void(0);" class="dropdown-toggle text-default"
-						   ng-mouseover="getReply(item)">回复历史<i class="fa fa-fw fa-angle-down"></i></a>
+							ng-mouseover="getReply(item)">回复历史<i class="fa fa-fw fa-angle-down"></i></a>
 						<div class="dropdown-menu pane" style="width: 270px;">
 							<div class="pane-body">
 								<ul class="list-unstyled list-menu">
 									<li ng-repeat="reply in ::item.replies">
 										<div class="row row-sm"
-											 ng-class="{'text-inverse': $index==0}">
+											ng-class="{'text-inverse': $index==0}">
 											<div class="col-xs-6">
 												<span ng-if="reply.qty < 0"> 撤销</span>
 												数量 {{::reply.qty}}
@@ -479,11 +479,19 @@
 				</div>
 				<div style="margin: 0 auto" ng-if="item.$editing">
 					<br><br><input type="text" ng-model="item.reply.remark"
-								   class="form-control input-xs" placeholder="回复备注" />
+						class="form-control input-xs" placeholder="回复备注" />
 				</div>
 			</td>
 			<td ng-bind="::order.enName"></td>
 		</tr>
-		</tbody>
-	</table>
+		<!-- <tr ng-if="!order.$collapsed && searchFilterXls.keyword" style="cursor: pointer;padding: 10px 0;">
+			<td colspan="6" class="text-center text-simple" ng-if="!order.$showAll" style="cursor: pointer;padding: 10px 0;" ng-click="order.$showAll = true">
+				展开所有明细(包括不含关键词的) <i class="fa fa-angle-down"></i>
+			</td>
+			<td colspan="6" class="text-center text-simple" ng-if="order.$showAll" style="cursor: pointer;padding: 10px 0;" ng-click="order.$showAll = false">
+				收起不含关键词的明细 <i class="fa fa-angle-up"></i>
+			</td>
+		</tr> -->
+	</tbody>
+</table>
 </div>

+ 137 - 101
src/main/webapp/resources/tpl/index/purc/order_detail.html

@@ -32,6 +32,8 @@
 	<div class="pub-com_head">
 		<span>采购单</span>
 		<div class="p-right">
+			<!-- <a ng-click="print(order)" class="pull-right text-simple"><i
+				class="fa fa-print fa-fw"></i>打印</a> -->
 		</div>
 	</div>
 	<div class="pane-body">
@@ -53,10 +55,22 @@
 			</div>
 		</div>
 		<div class="row row-sm item">
+			<!--<div class="col-xs-3">
+				<span class="title">采购类型</span>
+				<div class="content" ng-bind="::order.type"></div>
+			</div>-->
 			<div class="col-xs-3">
 				<span class="title">录单人</span>
 				<div class="content" ng-bind="::order.recorder"></div>
 			</div>
+			<!--<div class="col-xs-3">
+				<span class="title">审批人</span>
+				<div class="content" ng-bind="::order.auditor"></div>
+			</div>
+			<div class="col-xs-3">
+				<span class="title">采购员</span>
+				<div class="content" ng-bind="::order.user.userName"></div>
+			</div>-->
 		</div>
 		<div class="title-div" style="border-bottom: 1px dashed #327ebe;">
 			<span class="f14">交易信息</span>&nbsp;
@@ -106,118 +120,140 @@
 			</table>
 			<table class="block table table-default table-striped table-hover" ng-class="{'scoroll':order.orderItems.length>10}">
 				<tbody>
-				<tr ng-repeat="item in order.orderItems track by item.id">
-					<td class="text-center text-num f-16 text-success "  width="50">
-						<span ng-bind="::item.number"></span>
-					</td>
-					<td width="270" class="product">
-						<div class="text-num text-bold text-overflow" title="{{::item.product.code}}">
-							<span ng-bind="::item.product.code"></span>
-						</div>
-						<div class="text-overflow" title="{{::item.product.title}}">
-							<span ng-bind="::item.product.title"></span>
-						</div>
-						<div class="text-muted text-over" ng-bind="::item.product.spec" title="{{::item.product.spec}}"></div>
-						<div class="text-muted text-bold text-overflow" ng-if="item.vendspec" title="{{item.vendspec}}"><span ng-bind="::item.vendspec"></span></div>
-						<div class="text-bold text-inverse text-flow" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
-						<div class="text-bold text-inverse text-flow" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
-					</td>
-					<td class="text-center" width="110">
-						<div ng-if="!isUser" class="text-num" ng-bind="::item.price | number:6"></div>
-						<div class="text-muted">税率:{{::item.taxrate || 0}}%</div>
-					</td>
-					<td class="text-center"  width="100">
-						<div class="text-num" ng-bind="::item.qty"></div>
-						<div class="text-muted" ng-bind="::item.product.unit"></div>
-						<div style="margin: 0 auto" ng-if="item.$editing">
-							<input type="text" ng-model="item.reply.qty" min="0" max="{{item.qty}}"
-								   ng-init="item.reply.qty=item.qty-item.replyQty"
-								   class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
-						</div>
-					</td>
-					<td class="text-center" width="120">
-						<div class="text-num"
-							 ng-bind="::item.delivery | date:'yyyy-MM-dd'"></div> <br>
-						<div style="margin: 0 auto"
-							 class="input-group input-group-xs input-trigger"
-							 ng-if="item.$editing">
-							<input type="text" ng-model="item.reply.delivery"
-								   ng-init="item.reply.delivery=parseDate(item.delivery)"
-								   class="form-control" placeholder="回复交期"
-								   datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
-								   min-date="order.date" ng-required="true" current-text="今天"
-								   clear-text="清除" close-text="关闭"
-								   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-								   ng-focus="openDatePicker($event, item, '$opened')"> <span
-								class="input-group-btn">
+					<tr ng-repeat="item in order.orderItems track by item.id">
+						<td class="text-center text-num f-16 text-success "  width="50">
+							<span ng-bind="::item.number"></span>
+						</td>
+						<td width="270" class="product">
+							<div class="text-num text-bold text-overflow" title="{{::item.product.code}}">
+								<span ng-bind="::item.product.code"></span>
+							</div>
+							<div class="text-overflow" title="{{::item.product.title}}">
+								<span ng-bind="::item.product.title"></span>
+							</div>
+							<div class="text-muted text-over" ng-bind="::item.product.spec" title="{{::item.product.spec}}"></div>
+							<div class="text-muted text-bold text-overflow" ng-if="item.vendspec" title="{{item.vendspec}}"><span ng-bind="::item.vendspec"></span></div>
+							<div class="text-bold text-inverse text-flow" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
+							<div class="text-bold text-inverse text-flow" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
+						</td>
+						<td class="text-center" width="110">
+							<div ng-if="!isUser" class="text-num" ng-bind="::item.price | number:6"></div>
+							<div class="text-muted">税率:{{::item.taxrate || 0}}%</div>
+						</td>
+						<td class="text-center"  width="100">
+							<div class="text-num" ng-bind="::item.qty"></div>
+							<div class="text-muted" ng-bind="::item.product.unit"></div>
+							<div style="margin: 0 auto" ng-if="item.$editing">
+								<input type="text" ng-model="item.reply.qty" min="0" max="{{item.qty}}"
+									ng-init="item.reply.qty=item.qty-item.replyQty"
+									class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
+							</div>
+						</td>
+						<td class="text-center" width="120">
+							<div class="text-num"
+								ng-bind="::item.delivery | date:'yyyy-MM-dd'"></div> <br>
+							<div style="margin: 0 auto"
+								class="input-group input-group-xs input-trigger"
+								ng-if="item.$editing">
+								<input type="text" ng-model="item.reply.delivery"
+									ng-init="item.reply.delivery=parseDate(item.delivery)"
+									class="form-control" placeholder="回复交期"
+									datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
+									min-date="order.date" ng-required="true" current-text="今天"
+									clear-text="清除" close-text="关闭"
+									datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+									ng-focus="openDatePicker($event, item, '$opened')"> <span
+									class="input-group-btn">
 									<button type="button" class="btn btn-default"
-											ng-click="openDatePicker($event, item, '$opened')">
+										ng-click="openDatePicker($event, item, '$opened')">
 										<i class="fa fa-calendar"></i>
 									</button>
 								</span>
-						</div>
-					</td>
-					<td width="160">
-						<div ng-show="!item.$editing">
-							<div ng-if="!item.replyQty" class="text-muted text-center">未回复</div>
-							<div ng-if="item.replyQty > 0 && item.replyQty < item.qty">
-								<div class="progress progress-sm">
-									<div class="progress-bar progress-bar-success"
-										 ng-style="{'width': 100*item.replyQty/item.qty + '%'}">
-										<span class="sr-only"></span>
+							</div>
+						</td>
+						<td width="160">
+							<div ng-show="!item.$editing">
+								<div ng-if="!item.replyQty" class="text-muted text-center">未回复</div>
+								<div ng-if="item.replyQty > 0 && item.replyQty < item.qty">
+									<div class="progress progress-sm">
+										<div class="progress-bar progress-bar-success"
+											ng-style="{'width': 100*item.replyQty/item.qty + '%'}">
+											<span class="sr-only"></span>
+										</div>
 									</div>
+									已回复 <span class="text-default">{{::item.replyQty}}</span> / <span>{{::item.qty}}</span>
 								</div>
-								已回复 <span class="text-default">{{::item.replyQty}}</span> / <span>{{::item.qty}}</span>
-							</div>
-							<div ng-if="item.replyQty > 0" class="dropdown"
-								 ng-class="{'text-center': item.replyQty>=item.qty}">
-								<a href="javascript:void(0);"
-								   class="dropdown-toggle text-default"
-								   ng-mouseover="getReply(item)">回复历史<i
+								<div ng-if="item.replyQty > 0" class="dropdown"
+									ng-class="{'text-center': item.replyQty>=item.qty}">
+									<a href="javascript:void(0);"
+										class="dropdown-toggle text-default"
+										ng-mouseover="getReply(item)">回复历史<i
 										class="fa fa-fw fa-angle-down"></i></a>
-								<div class="dropdown-menu pane" style="width: 270px;">
-									<div class="pane-body">
-										<ul class="list-unstyled list-menu">
-											<li ng-repeat="reply in ::item.replies">
-												<div class="row row-sm"
-													 ng-class="{'text-inverse': $index==0}">
-													<div class="col-xs-6">
-														<span ng-if="reply.qty < 0"> 撤销</span>
-														数量 {{::reply.qty}}
+									<div class="dropdown-menu pane" style="width: 270px;">
+										<div class="pane-body">
+											<ul class="list-unstyled list-menu">
+												<li ng-repeat="reply in ::item.replies">
+													<div class="row row-sm"
+														ng-class="{'text-inverse': $index==0}">
+														<div class="col-xs-6">
+															<span ng-if="reply.qty < 0"> 撤销</span>
+															数量 {{::reply.qty}}
+														</div>
+														<div class="col-xs-6">交期{{::reply.delivery |
+															date:'yyyy-MM-dd'}}</div>
 													</div>
-													<div class="col-xs-6">交期{{::reply.delivery |
-														date:'yyyy-MM-dd'}}</div>
-												</div>
-												<div class="text-muted">{{::reply.recorder}}{{::reply.date
-													| date:'yyyy-MM-dd HH:mm:ss'}}回复</div>
-												<div class="text-muted" ng-if="reply.remark != null">备注:{{::reply.remark}}</div>
-											</li>
-										</ul>
+													<div class="text-muted">{{::reply.recorder}}{{::reply.date
+														| date:'yyyy-MM-dd HH:mm:ss'}}回复</div>
+													<div class="text-muted" ng-if="reply.remark != null">备注:{{::reply.remark}}</div>
+												</li>
+											</ul>
+										</div>
 									</div>
 								</div>
 							</div>
-						</div>
-						<div style="margin: 0 auto" ng-if="item.$editing">
-							<br> <br> <input type="text"
-											 ng-model="item.reply.remark" class="form-control input-xs"
-											 placeholder="回复备注" />
-						</div>
-						<div ng-if="item.acceptQty" class="text-success text-center text-bold f14">
-							已验收:{{::item.acceptQty}}{{::item.product.unit}}
-						</div>
-						<div ng-if="item.returnQty" class="text-error text-center text-bold f14">
-							已验退:{{::item.returnQty}}{{::item.product.unit}}
-						</div>
-					</td>
-					<td class="text-center" width="100">
-						<div ng-if="item.replyQty>=item.qty" class="block">
-							<span class="text-trans success">已回复</span>
-						</div>
-						<div ng-if="item.end" class="block">
-							<span class="text-trans warning">已结案</span>
-						</div>
-					</td>
-				</tr>
+							<div style="margin: 0 auto" ng-if="item.$editing">
+								<br> <br> <input type="text"
+									ng-model="item.reply.remark" class="form-control input-xs"
+									placeholder="回复备注" />
+							</div>
+							<div ng-if="item.acceptQty" class="text-success text-center text-bold f14">
+								已验收:{{::item.acceptQty}}{{::item.product.unit}}
+							</div>
+							<div ng-if="item.returnQty" class="text-error text-center text-bold f14">
+								已验退:{{::item.returnQty}}{{::item.product.unit}}
+							</div>
+						</td>
+						<td class="text-center" width="100">
+							<div ng-if="item.replyQty>=item.qty" class="block">
+								<span class="text-trans success">已回复</span>
+							</div>
+							<div ng-if="item.end" class="block">
+								<span class="text-trans warning">已结案</span>
+							</div>
+							<!-- <div
+								ng-if="(!item.replyQty || item.replyQty<=item.qty) && !item.end">
+								<br ng-if="item.replyQty>=item.qty">
+								<br ng-if="item.replyQty>=item.qty">
+								<div ng-show="!item.$editing">
+									<a ng-click="item.$editing=!item.$editing">回复</a>
+								</div>
+								<div ng-if="item.$editing">
+									<div>
+										<a ng-click="item.$editing=!item.$editing">取消</a>
+									</div>
+									<br>
+									<div class="text-left">
+										<a ng-click="onReplyClick(item)" class="text-inverse">
+											<i class="fa fa-arrow-up"></i> 确认回复
+										</a>
+										<br>
+										<a ng-click="onReplyClick(item, -1)" class="text-muted" title="减去已回复数量">
+											<i class="fa fa-arrow-down"></i> 撤销回复</a>
+									</div>
+								</div>
+							</div> -->
+						</td>
+					</tr>
 				</tbody>
 			</table>
 		</div>

+ 192 - 164
src/main/webapp/resources/tpl/index/sale/order.html

@@ -1,149 +1,149 @@
 <style>
-	.condition .more.open {
-		margin-top: 10px;
-		height: 36px;
-		opacity: 1;
-	}
+.condition .more.open {
+	margin-top: 10px;
+	height: 36px;
+	opacity: 1;
+}
 
-	.condition .more .form-group {
-		/*margin-bottom: 10px;*/
-	}
+.condition .more .form-group {
+	/*margin-bottom: 10px;*/
+}
 
-	.order-table .header>th {
-		height: 38px;
-		text-align: center;
-		background: #f5f5f5;
-		border-top: 1px solid #e8e8e8;
-		border-bottom: 1px solid #e8e8e8;
-	}
+.order-table .header>th {
+	height: 38px;
+	text-align: center;
+	background: #f5f5f5;
+	border-top: 1px solid #e8e8e8;
+	border-bottom: 1px solid #e8e8e8;
+}
 
-	.order-table .sep-row {
-		height: 10px;
-	}
+.order-table .sep-row {
+	height: 10px;
+}
 
-	.order-table .selector {
-		vertical-align: middle;
-		margin: 0 0 2px 0;
-	}
+.order-table .selector {
+	vertical-align: middle;
+	margin: 0 0 2px 0;
+}
 
-	.toolbar label {
-		margin-right: 10px;
-		margin-bottom: 0;
-	}
+.toolbar label {
+	margin-right: 10px;
+	margin-bottom: 0;
+}
 
-	.toolbar .select_all {
-		margin: 0 6px 0 10px;
-		line-height: 20px;
-	}
+.toolbar .select_all {
+	margin: 0 6px 0 10px;
+	line-height: 20px;
+}
 
-	.toolbar .btn {
-		-moz-border-radius: 2px;
-		margin-right: 5px;
-		border: 1px solid #dcdcdc;
-		border-radius: 2px;
-		-webkit-border-radius: 2px;
-	}
+.toolbar .btn {
+	-moz-border-radius: 2px;
+	margin-right: 5px;
+	border: 1px solid #dcdcdc;
+	border-radius: 2px;
+	-webkit-border-radius: 2px;
+}
 
-	.order-table .order-hd {
-		background: #f5f5f5;
-		height: 40px;
-		line-height: 40px;
-	}
+.order-table .order-hd {
+	background: #f5f5f5;
+	height: 40px;
+	line-height: 40px;
+}
 
-	.order-table .order-hd td.first {
-		padding-left: 20px;
-	}
+.order-table .order-hd td.first {
+	padding-left: 20px;
+}
 
-	.order-table .order-hd .order-main span {
-		margin-right: 8px;
-	}
+.order-table .order-hd .order-main span {
+	margin-right: 8px;
+}
 
-	.order-table .order-hd .order-code {
-		font-style: normal;
-		font-family: verdana;
-	}
+.order-table .order-hd .order-code {
+	font-style: normal;
+	font-family: verdana;
+}
 
-	.order-table .order-hd .order-sum {
-		padding: 0 5px;
-	}
+.order-table .order-hd .order-sum {
+	padding: 0 5px;
+}
 
-	.order-table>tbody {
-		border: 1px solid transparent;
-	}
+.order-table>tbody {
+	border: 1px solid transparent;
+}
 
-	.order-table>tbody:hover {
-		border-color: #d32526;
-		border-width: 2px;
-	}
+.order-table>tbody:hover {
+	border-color: #d32526;
+	border-width: 2px;
+}
 
-	.order-table .operates {
-		display: none;
-	}
+.order-table .operates {
+	display: none;
+}
 
-	.order-table .operates i {
-		padding: 0 2px;
-	}
+.order-table .operates i {
+	padding: 0 2px;
+}
 
-	.order-table>tbody:hover .operates {
-		display: block;
-	}
-	.order-table>tbody:hover .operates-status {
-		display: none;
-	}
+.order-table>tbody:hover .operates {
+	display: block;
+}
+.order-table>tbody:hover .operates-status {
+	display: none;
+}
 
 
-	.order-table .order-bd {
-		border-bottom: 1px solid #e6e6e6;
-	}
+.order-table .order-bd {
+	border-bottom: 1px solid #e6e6e6;
+}
 
-	.order-table .order-bd>td {
-		padding: 10px 5px;
-		vertical-align: top;
-		position: relative;
-	}
+.order-table .order-bd>td {
+	padding: 10px 5px;
+	vertical-align: top;
+	position: relative;
+}
 
-	.order-table .order-bd .product {
-		padding-left: 20px;
-	}
+.order-table .order-bd .product {
+	padding-left: 20px;
+}
 
-	.order-table .order-bd .order-number {
-		position: absolute;
-		top: -1px;
-		left: -1px;
-		width: 20px;
-		height: 20px;
-		line-height: 20px;
-		text-align: center;
-		background: #f5f5f5;
-		font-weight: 500;
-		border: solid 1px #d5d5d5;
-		border-radius: 0 0 10px 0;
-	}
+.order-table .order-bd .order-number {
+	position: absolute;
+	top: -1px;
+	left: -1px;
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	text-align: center;
+	background: #f5f5f5;
+	font-weight: 500;
+	border: solid 1px #d5d5d5;
+	border-radius: 0 0 10px 0;
+}
 
-	.order-table .order-bd .order-number.key {
-		background: #56a022;
-		color: #ffffff;
-	}
+.order-table .order-bd .order-number.key {
+	background: #56a022;
+	color: #ffffff;
+}
 
-	.unPrinted {
-		color: #56a022;
-	}
+.unPrinted {
+	color: #56a022;
+}
 
-	.info-container .info:hover {
-		color: #CC3333;
-	}
-	.order-table{
-		background: #fff;
-	}
-	.menu .new-dot{
-		width: 20px;
-		height: 20px;
-		line-height: 20px;
-		font-size: 12px;
-		color: #fff;
-		font-weight: inherit;
-		top: -2px;
-	}
+.info-container .info:hover {
+	color: #CC3333;
+}
+.order-table{
+	background: #fff;
+}
+.menu .new-dot{
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	font-size: 12px;
+	color: #fff;
+	font-weight: inherit;
+	top: -2px;
+}
 	.order-table .product div.text-over {
 		width: 340px;
 		white-space: nowrap;
@@ -172,9 +172,9 @@
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
-	<div class="loading in" ng-class="{'in': loading}">
-		<i></i>
-	</div>
+<div class="loading in" ng-class="{'in': loading}">
+	<i></i>
+</div>
 	<div class="pub-com_head">
 		<span>客户采购订单</span>
 		<div class="p-right">
@@ -182,21 +182,21 @@
 			   target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
 		</div>
 	</div>
-	<div class="menu condition block">
+<div class="menu condition block">
 		<div class="row">
 			<div class="col-xs-4">
 				<div class="btn-group btn-group-sm btn-group-justified">
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部<b class="new-dot" ng-if="unread.all > 0">{{unread.all>99?'99+':unread.all}}</b></button>
+							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部<b class="new-dot" ng-if="unread.all > 0">{{unread.all>99?'99+':unread.all}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='done'}" ng-click="setActive('done');setOrdersReadByState()">已回复<b class="new-dot" ng-if="unread.replied > 0">{{unread.replied>99?'99+':unread.replied}}</b></button>
+							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done');setOrdersReadByState()">已回复<b class="new-dot" ng-if="unread.replied > 0">{{unread.replied>99?'99+':unread.replied}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待回复<b class="new-dot" ng-if="unread.notReply > 0">{{unread.notReply>99?'99+':unread.notReply}}</b></button>
+							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待回复<b class="new-dot" ng-if="unread.notReply > 0">{{unread.notReply>99?'99+':unread.notReply}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
@@ -204,11 +204,11 @@
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='waiting'}" ng-click="setActive('waiting')">待交货</button>
+							ng-class="{'btn-info':active=='waiting'}" ng-click="setActive('waiting')">待交货</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已结案</button>
+							ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已结案</button>
 					</div>
 				</div>
 			</div>
@@ -264,7 +264,7 @@
 			</div>-->
 		</div>
 	</div>
-	<!--<div class="height10">&nbsp;</div>-->
+<!--<div class="height10">&nbsp;</div>-->
 	<div class="condition block">
 		<div class="search-bg condition block" style="padding: 10px 15px;">
 			<div class="row">
@@ -331,8 +331,8 @@
 			</div>
 		</div>
 	</div>
-	<table class="order-table block" ng-table="tableParams">
-		<thead>
+<table class="order-table block" ng-table="tableParams">
+	<thead>
 		<tr class="header">
 			<th width="400">产品</th>
 			<th width="100">单价</th>
@@ -348,9 +348,19 @@
 			<td colspan="5">
 				<div>
 					<label><input type="checkbox" class="selector select_all"
-								  ng-model="checkboxes.checked" ng-click="checkAll()">全选</label>
-					<a ng-if="active=='todo'" href="javascript:void(0)" class="btn btn-default btn-xs" ng-click="replyByBatch();setOrdersReadByBatch()" title="选中的单据按照客户需求的数量和交期默认回复">&nbsp;批量回复&nbsp;</a>
-					<span class="text-muted">
+						ng-model="checkboxes.checked" ng-click="checkAll()">全选</label> <a ng-if="active=='todo'" href="javascript:void(0)"
+						class="btn btn-default btn-xs" ng-click="replyByBatch();setOrdersReadByBatch()" title="选中的单据按照客户需求的数量和交期默认回复">&nbsp;批量回复&nbsp;</a>
+						<!--<div class="btn-group dropdown">
+  							<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
+    							&nbsp;&nbsp;标记为&nbsp;&nbsp;<span class="caret"></span>&nbsp;
+  							</button>
+  							<ul class="dropdown-menu" role="menu">
+    							<li><a href="javascript:void(0)" ng-click="setDisplay('setRead')">已查看</a></li>
+    							<li><a href="javascript:void(0)" ng-click="setDisplay('setUnRead')">未查看</a></li>
+    							<li><a href="javascript:void(0)" ng-click="setDisplay('setTop')">置顶</a></li>
+  							</ul>
+						</div>-->
+						<span class="text-muted">
 							&nbsp;&nbsp;<i class="fa fa-exclamation-triangle"></i> 批量回复是对选中的单据按照满足客户需求的数量和交期默认回复。
 						</span>
 				</div> <!-- 分页 -->
@@ -362,8 +372,8 @@
 		<tr class="sep-row">
 			<td colspan="6"></td>
 		</tr>
-		</thead>
-		<tbody ng-if="tableParams.total() == 0">
+	</thead>
+	<tbody ng-if="tableParams.total() == 0">
 		<tr>
 			<td colspan="6">
 				<div class="row text-muted info-container" style="padding: 50px 10px;">
@@ -380,15 +390,15 @@
 						<div class="f14">
 							<div class="info">
 								<p>1、您的客户还没有提交审核采购订单<br>
-									解决:与您的客户沟通确认单据是否已经审核(只有客户ERP中已经审核的单据才能接收到)</p>
+								解决:与您的客户沟通确认单据是否已经审核(只有客户ERP中已经审核的单据才能接收到)</p>
 							</div>
 							<div class="info">
 								<p>2、客户ERP中供应商信息有误<br>
-									解决:与您的客户沟通确认您的信息在客户的供应商资料中是否维护正确,尤其是企业UU号</p>
+								解决:与您的客户沟通确认您的信息在客户的供应商资料中是否维护正确,尤其是企业UU号</p>
 							</div>
 							<div class="info">
 								<p>3、您的客户正在使用旧版本的UAS商务平台<br>
-									解决:我们仍有部分用户在使用旧版本UAS商务平台系统,你可以用您的企业UU号和管理员个人UU号 <a href="http://www.usoftchina.com" class="text-bold text-link" title="http://www.usoftchina.com" target="_blank">登陆旧版本UAS商务平台</a></p>
+								解决:我们仍有部分用户在使用旧版本UAS商务平台系统,你可以用您的企业UU号和管理员个人UU号 <a href="http://www.usoftchina.com" class="text-bold text-link" title="http://www.usoftchina.com" target="_blank">登陆旧版本UAS商务平台</a></p>
 							</div>
 						</div>
 						<br>
@@ -397,13 +407,13 @@
 				</div>
 			</td>
 		</tr>
-		</tbody>
-		<tbody ng-repeat="order in $data track by order.id">
+	</tbody>
+	<tbody ng-repeat="order in $data track by order.id">
 		<tr class="order-hd" ng-dblclick="order.$collapsed=!order.$collapsed" ng-class="{'text-bold': order.display>0}">
 			<td class="first" colspan="4">
 				<div class="order-main">
 					<span> <input type="checkbox" class="selector"
-								  ng-model="order.$selected" ng-click="checkOne(order)">
+						ng-model="order.$selected" ng-click="checkOne(order)">
 					</span>
 					<a href="javascript:void(0)" ng-if="!order.display && !isUnread(order.id)" title="标记为未查看" ng-click="setDisplay('setUnRead', order.id)">
 						<i class="fa fa-circle-thin"></i>
@@ -415,14 +425,14 @@
 						<i class="fa fa-tags" style="color: #f40;"></i>
 					</a>
 					&nbsp;&nbsp;<span class="text-num text-bold"
-									  ng-bind="::order.date | date:'yyyy-MM-dd'"></span>
+						ng-bind="::order.date | date:'yyyy-MM-dd'"></span>
 					<span ng-bind="::order.enterprise.enName"></span>
 					<span>订单号:<a class="text-num order-detail" ng-bind="::order.code" ui-sref="sale.order_detail({id:order.id})" target="_self" title="查看详情" ng-click="setOrdersRead(order.id)"></a></span>
 				</div>
 			</td>
 			<td ng-if="!isUser" colspan="1" class="order-sum">{{::order.currency}}: <span
-					ng-bind="getOrderTotal(order.orderItems) | number : 2"
-					class="text-num text-bold"></span>
+				ng-bind="getOrderTotal(order.orderItems) | number : 2"
+				class="text-num text-bold"></span>
 			</td>
 			<td ng-if="isUser" colspan="1" class="order-sum"></td>
 			<td colspan="1" class="text-center">
@@ -430,7 +440,7 @@
 				<span ng-if="!order.print" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #CA3955">未打印</span>
 				<div class="operates">
 					<a ng-click="print(order);" title="打印{{order.print? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !order.print, 'text-muted': order.print}"><i
-							class="fa fa-print fa-lg"></i></a> <a
+						class="fa fa-print fa-lg"></i></a> <a
 						ng-click="order.$collapsed=!order.$collapsed" class="text-muted"
 						title="收拢"><i class="fa fa-toggle-down fa-lg"></i></a>
 				</div>
@@ -448,7 +458,7 @@
 				</div>
 				<div class="text-muted text-over"
 					 title="{{::item.product.spec}}"
-					 ng-bind="::item.product.spec"></div>
+					ng-bind="::item.product.spec"></div>
 				<div class="text-muted text-bold text-overflow" ng-if="item.vendspec" title="{{item.vendspec}}"><span ng-bind="::item.vendspec"></span></div>
 				<div class="text-bold text-inverse text-flow" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
 				<div class="text-bold text-inverse text-flow" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
@@ -462,26 +472,26 @@
 				<div class="text-muted" ng-bind="::item.product.unit"></div>
 				<div style="margin: 0 auto" ng-if="item.$editing">
 					<input type="number" ng-model="item.reply.qty" min="0"
-						   ng-init="item.reply.qty=item.qty-item.replyQty"
-						   class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
+						ng-init="item.reply.qty=item.qty-item.replyQty"
+						class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
 				</div>
 			</td>
 			<td class="text-center br-l">
 				<div class="text-num" ng-bind="::item.delivery | date:'yyyy-MM-dd'"></div>
 				<br>
 				<div style="margin: 0 auto"
-					 class="input-group input-group-xs input-trigger"
-					 ng-if="item.$editing">
+					class="input-group input-group-xs input-trigger"
+					ng-if="item.$editing">
 					<input type="text" ng-model="item.reply.delivery" ng-init="item.reply.delivery= ''"
-						   class="form-control" placeholder="回复交期" readonly
-						   datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
-						   min-date="nowdate" ng-required="true" current-text="今天"
-						   clear-text="清除" close-text="关闭"
-						   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-						   ng-click="openDatePicker($event, item, '$opened')"> <span
+						class="form-control" placeholder="回复交期" readonly
+						datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
+						min-date="nowdate" ng-required="true" current-text="今天"
+						clear-text="清除" close-text="关闭"
+						datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+						ng-click="openDatePicker($event, item, '$opened')"> <span
 						class="input-group-btn">
 						<button type="button" class="btn btn-default"
-								ng-click="openDatePicker($event, item, '$opened')">
+							ng-click="openDatePicker($event, item, '$opened')">
 							<i class="fa fa-calendar"></i>
 						</button>
 					</span>
@@ -491,17 +501,27 @@
 				<div ng-if="!item.$editing">
 					<div ng-if="!item.replyQty" class="text-muted text-center">未回复</div>
 					<div ng-if="item.replyQty > 0 && item.replyQty < item.qty">
+						<!--<div class="progress progress-sm">
+							<div class="progress-bar progress-bar-success"
+								ng-style="{'width': 100*item.replyQty/item.qty + '%'}">
+								<span class="sr-only"></span>
+							</div>
+						</div>
+						已回复 <span class="text-default">{{::item.replyQty}}</span> /
+						<span>{{::item.qty}}</span>-->
+
 						已回复 <span class="text-default">{{::item.latestReplyQty}}</span>
+
 					</div>
 					<div ng-if="item.replyQty > 0" class="dropdown" ng-class="{'text-center': item.replyQty>=item.qty}">
 						<a href="javascript:void(0);" class="dropdown-toggle text-default"
-						   ng-mouseover="getReply(item)">回复历史<i class="fa fa-fw fa-angle-down"></i></a>
+							ng-mouseover="getReply(item)">回复历史<i class="fa fa-fw fa-angle-down"></i></a>
 						<div class="dropdown-menu pane" style="width: 270px;">
 							<div class="pane-body">
 								<ul class="list-unstyled list-menu">
 									<li ng-repeat="reply in ::item.replies">
 										<div class="row row-sm"
-											 ng-class="{'text-inverse': $index==0}">
+											ng-class="{'text-inverse': $index==0}">
 											<div class="col-xs-6">
 												<span ng-if="reply.qty < 0"> 撤销</span>
 												数量 {{::reply.qty}}
@@ -526,7 +546,7 @@
 				</div>
 				<div style="margin: 0 auto" ng-if="item.$editing">
 					<br><br><input type="text" ng-model="item.reply.remark" ng-init="item.reply.remark = ''"
-								   class="form-control input-xs" placeholder="回复备注" />
+						class="form-control input-xs" placeholder="回复备注" />
 				</div>
 			</td>
 			<td class="text-center br-l">
@@ -559,6 +579,14 @@
 				</div>
 			</td>
 		</tr>
-		</tbody>
-	</table>
+		<!-- <tr ng-if="!order.$collapsed && searchFilterXls.keyword" style="cursor: pointer;padding: 10px 0;">
+			<td colspan="6" class="text-center text-simple" ng-if="!order.$showAll" style="cursor: pointer;padding: 10px 0;" ng-click="order.$showAll = true">
+				展开所有明细(包括不含关键词的) <i class="fa fa-angle-down"></i>
+			</td>
+			<td colspan="6" class="text-center text-simple" ng-if="order.$showAll" style="cursor: pointer;padding: 10px 0;" ng-click="order.$showAll = true">
+				收起不含关键词的明细 <i class="fa fa-angle-up"></i>
+			</td>
+		</tr> -->
+	</tbody>
+</table>
 </div>

+ 160 - 131
src/main/webapp/resources/tpl/index/sale/order_detail.html

@@ -34,7 +34,7 @@
 		<span>客户采购单</span>
 		<div class="p-right">
 			<a ng-click="print(order)" class="pull-right text-simple"><i class="fa fa-print fa-fw"></i>打印</a>
-			<a ng-click="fileDownload(order.id)" class="pull-right text-simple"><i class="fa fa-file fa-fw"></i>附件下载</a>
+            <a ng-click="fileDownload(order.id)" class="pull-right text-simple"><i class="fa fa-file fa-fw"></i>附件下载</a>
 		</div>
 	</div>
 	<div class="pane-body">
@@ -57,6 +57,10 @@
 			</div>
 		</div>
 		<div class="row row-sm item">
+			<!--<div class="col-xs-3">
+				<span class="title">采购类型:</span>
+				<div class="content" ng-bind="::order.type"></div>
+			</div>-->
 			<div class="col-xs-3">
 				<span class="title">录单人:</span>
 				<div class="content" ng-bind="::order.recorder"></div>
@@ -65,7 +69,21 @@
 				<span class="title">备注:</span>
 				<div class="content" ng-bind="::order.remark"></div>
 			</div>
+			<!-- <div class="col-xs-6">
+				<span class="title">审批人:</span>
+				<div class="content" ng-bind="::order.auditor"></div>
+			</div> -->
+			<!--<div class="col-xs-6">
+				<span class="title">采购员:</span>
+				<div class="content" ng-bind="::order.user.userName"></div>
+			</div>-->
 		</div>
+		<!--<div class="row row-sm item">
+			<div class="col-xs-12">
+				<span class="title">备注:</span>
+				<div class="content" ng-bind="::order.remark"></div>
+			</div>
+		</div>-->
 		<div class="title-div" style="border-bottom: 1px dashed #327ebe;">
 			<span class="f14">交易信息</span>&nbsp;
 		</div>
@@ -74,6 +92,10 @@
 				<span class="title">币别:</span>
 				<div ng-if="!isUser" class="content" ng-bind="::order.currency"></div>
 			</div>
+			<!--<div class="col-xs-3">
+				<span class="title">汇率:</span>
+				<div class="content" ng-bind="::order.rate"></div>
+			</div>-->
 			<div class="col-xs-3">
 				<span class="title">金额:</span>
 				<div ng-if="!isUser" class="content" ng-bind="::order.total | number:2"></div>
@@ -95,155 +117,162 @@
 		<div class="block">
 			<table class="block table table-default table-striped table-hover" style=" margin-bottom: 0">
 				<thead>
-				<tr class="header">
-					<th width="50">序号</th>
-					<th width="200">产品</th>
-					<th width="80">单价</th>
-					<th width="80">税率</th>
-					<th width="110">数量</th>
-					<th width="50">单位</th>
-					<th width="120">交货日期</th>
-					<th width="120">回复状态</th>
-					<th width="100">操作</th>
-				</tr>
+					<tr class="header">
+						<th width="50">序号</th>
+						<th width="200">产品</th>
+						<th width="80">单价</th>
+						<th width="80">税率</th>
+						<th width="110">数量</th>
+						<th width="50">单位</th>
+						<th width="120">交货日期</th>
+						<th width="120">回复状态</th>
+						<th width="100">操作</th>
+					</tr>
 				</thead>
 			</table>
 			<table class="block table table-default table-striped table-hover" ng-class="{'scoroll':order.orderItems.length>10}">
 				<tbody>
-				<tr ng-repeat="item in order.orderItems track by item.id">
-					<td class="text-center text-num" width="50">
-						<span ng-bind="::item.number"></span>
-					</td>
-					<td width="200">
-						<div class="text-num text-overflow" title="{{::item.product.code}}">
-							<span ng-bind="::item.product.code"></span>
-						</div>
-						<div class="text-overflow" title="{{::item.product.title}}">
-							<span ng-bind="::item.product.title"></span>
-						</div>
-						<div class="text-muted text-over" ng-bind="::item.product.spec" title="{{::item.product.spec}}"></div>
-						<div class="text-muted text-bold text-overflow" ng-if="item.vendspec" title="item.vendspec"><span ng-bind="::item.vendspec"></span></div>
-						<div class="text-bold text-inverse text-flow" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
-						<div class="text-bold text-inverse text-flow" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
-						<div ng-repeat="att in item.attachs" class="text-bold text-bold text-overflow">
-							<a href="file/{{att.id}}">{{att.name}}</a>
-						</div>
-					</td>
-					<td class="text-center" width="80">
-						<div ng-if="!isUser" class="text-num" ng-bind="::item.price | number:6"></div>
-					</td>
-					<td class="text-center" width="80">
-						<div class="text-muted">{{::item.taxrate || 0}}%</div>
-					</td>
-					<td class="text-center" width="110">
-						<div class="text-num" ><span ng-bind="::item.qty"></span></div>
-						<div style="margin-top: 20px" ng-if="item.$editing">
-							<input type="text" ng-model="item.reply.qty" min="0"
-								   ng-init="item.reply.qty=item.qty-item.replyQty"
-								   class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
-						</div>
-					</td>
-					<td class="text-center" width="50">
-						<div class="text-num" ><span ng-bind="::item.product.unit"></span></div>
-					</td>
-					<td class="text-center" width="120">
-						<div class="text-num"
-							 ng-bind="::item.delivery | date:'yyyy-MM-dd'"></div>
-						<div style="margin-top: 20px"
-							 class="input-group input-group-xs input-trigger"
-							 ng-if="item.$editing">
-							<input type="text" ng-model="item.reply.delivery" ng-init="item.reply.delivery=parseDate(item.delivery)"
-								   class="form-control" placeholder="回复交期" readonly
-								   datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
-								   min-date="order.date" ng-required="true" current-text="今天"
-								   clear-text="清除" close-text="关闭"
-								   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-								   ng-click="openDatePicker($event, item, '$opened')"> <span
-								class="input-group-btn">
+					<tr ng-repeat="item in order.orderItems track by item.id">
+						<td class="text-center text-num" width="50">
+							<span ng-bind="::item.number"></span>
+						</td>
+						<td width="200">
+							<div class="text-num text-overflow" title="{{::item.product.code}}">
+								<span ng-bind="::item.product.code"></span>
+							</div>
+							<div class="text-overflow" title="{{::item.product.title}}">
+								<span ng-bind="::item.product.title"></span>
+							</div>
+							<div class="text-muted text-over" ng-bind="::item.product.spec" title="{{::item.product.spec}}"></div>
+							<div class="text-muted text-bold text-overflow" ng-if="item.vendspec" title="item.vendspec"><span ng-bind="::item.vendspec"></span></div>
+							<div class="text-bold text-inverse text-flow" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
+							<div class="text-bold text-inverse text-flow" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
+							<div ng-repeat="att in item.attachs" class="text-bold text-bold text-overflow">
+								<a href="file/{{att.id}}">{{att.name}}</a>
+							</div>
+						</td>
+						<td class="text-center" width="80">
+							<div ng-if="!isUser" class="text-num" ng-bind="::item.price | number:6"></div>
+						</td>
+						<td class="text-center" width="80">
+							<div class="text-muted">{{::item.taxrate || 0}}%</div>
+						</td>
+						<td class="text-center" width="110">
+							<div class="text-num" ><span ng-bind="::item.qty"></span></div>
+							<div style="margin-top: 20px" ng-if="item.$editing">
+								<input type="text" ng-model="item.reply.qty" min="0"
+									ng-init="item.reply.qty=item.qty-item.replyQty"
+									class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
+							</div>
+						</td>
+						<td class="text-center" width="50">
+							<div class="text-num" ><span ng-bind="::item.product.unit"></span></div>
+						</td>
+						<td class="text-center" width="120">
+							<div class="text-num"
+								ng-bind="::item.delivery | date:'yyyy-MM-dd'"></div>
+							<div style="margin-top: 20px"
+								class="input-group input-group-xs input-trigger"
+								ng-if="item.$editing">
+								<input type="text" ng-model="item.reply.delivery" ng-init="item.reply.delivery=parseDate(item.delivery)"
+									class="form-control" placeholder="回复交期" readonly
+									datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
+									min-date="order.date" ng-required="true" current-text="今天"
+									clear-text="清除" close-text="关闭"
+									datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+									ng-click="openDatePicker($event, item, '$opened')"> <span
+									class="input-group-btn">
 									<button type="button" class="btn btn-default"
-											ng-click="openDatePicker($event, item, '$opened')">
+										ng-click="openDatePicker($event, item, '$opened')">
 										<i class="fa fa-calendar"></i>
 									</button>
 								</span>
-						</div>
-					</td>
-					<td width="120">
-						<div ng-show="!item.$editing">
-							<div ng-if="!item.replyQty" class="text-muted text-center">未回复</div>
-							<div ng-if="item.replyQty > 0 && item.replyQty < item.qty">
-								已回复 <span class="text-default">{{::item.latestReplyQty}}</span>
 							</div>
-							<div ng-if="item.replyQty > 0" class="dropdown"
-								 ng-class="{'text-center': item.replyQty>=item.qty}">
-								<a href="javascript:void(0);"
-								   class="dropdown-toggle text-default"
-								   ng-mouseover="getReply(item)">回复历史<i
+						</td>
+						<td width="120">
+							<div ng-show="!item.$editing">
+								<div ng-if="!item.replyQty" class="text-muted text-center">未回复</div>
+								<div ng-if="item.replyQty > 0 && item.replyQty < item.qty">
+									<!--<div class="progress progress-sm">
+										<div class="progress-bar progress-bar-success"
+											ng-style="{'width': 100*item.replyQty/item.qty + '%'}">
+											<span class="sr-only"></span>
+										</div>
+									</div>
+									已回复 <span class="text-default">{{::item.replyQty}}</span> / <span>{{::item.qty}}</span>-->
+									已回复 <span class="text-default">{{::item.latestReplyQty}}</span>
+								</div>
+								<div ng-if="item.replyQty > 0" class="dropdown"
+									ng-class="{'text-center': item.replyQty>=item.qty}">
+									<a href="javascript:void(0);"
+										class="dropdown-toggle text-default"
+										ng-mouseover="getReply(item)">回复历史<i
 										class="fa fa-fw fa-angle-down"></i></a>
-								<div class="dropdown-menu pane" style="width: 270px;">
-									<div class="pane-body">
-										<ul class="list-unstyled list-menu">
-											<li ng-repeat="reply in ::item.replies">
-												<div class="row row-sm"
-													 ng-class="{'text-inverse': $index==0}">
-													<div class="col-xs-6">
-														<span ng-if="reply.qty < 0"> 撤销</span>
-														数量 {{::reply.qty}}
+									<div class="dropdown-menu pane" style="width: 270px;">
+										<div class="pane-body">
+											<ul class="list-unstyled list-menu">
+												<li ng-repeat="reply in ::item.replies">
+													<div class="row row-sm"
+														ng-class="{'text-inverse': $index==0}">
+														<div class="col-xs-6">
+															<span ng-if="reply.qty < 0"> 撤销</span>
+															数量 {{::reply.qty}}
+														</div>
+														<div class="col-xs-6">交期{{::reply.delivery |
+															date:'yyyy-MM-dd'}}</div>
 													</div>
-													<div class="col-xs-6">交期{{::reply.delivery |
-														date:'yyyy-MM-dd'}}</div>
-												</div>
-												<div class="text-muted">{{::reply.recorder}}{{::reply.date
-													| date:'yyyy-MM-dd HH:mm:ss'}}回复</div>
-												<div class="text-muted" ng-if="reply.remark != null">备注:{{::reply.remark}}</div>
-											</li>
-										</ul>
+													<div class="text-muted">{{::reply.recorder}}{{::reply.date
+														| date:'yyyy-MM-dd HH:mm:ss'}}回复</div>
+													<div class="text-muted" ng-if="reply.remark != null">备注:{{::reply.remark}}</div>
+												</li>
+											</ul>
+										</div>
 									</div>
 								</div>
 							</div>
-						</div>
-						<div ng-if="item.acceptQty" class="text-success text-center text-bold f14">
-							客户验收:{{::item.acceptQty}}{{::item.product.unit}}
-						</div>
-						<div ng-if="item.returnQty" class="text-error text-center text-bold f14">
-							客户验退:{{::item.returnQty}}{{::item.product.unit}}
-						</div>
-						<div style="margin: 0 auto" ng-if="item.$editing">
-							<input type="text"
-								   ng-model="item.reply.remark" class="form-control input-xs"  ng-init="item.reply.remark = ''"
-								   placeholder="回复备注" />
-						</div>
-					</td>
-					<td class="text-center" width="100">
-						<div ng-if="item.replyQty>=item.qty" class="block">
-							<span class="text-trans success">已回复</span>
-						</div>
-						<div ng-if="item.end" class="block">
-							<span class="text-trans warning">已结案</span>
-						</div>
-						<div
-								ng-if="(!item.replyQty || item.replyQty<=item.qty) && !item.end">
-							<br ng-if="item.replyQty>=item.qty">
-							<br ng-if="item.replyQty>=item.qty">
-							<div ng-show="!item.$editing">
-								<a ng-click="item.$editing=!item.$editing" ng-if="item.acceptQty-item.returnQty < item.qty">回复</a>
+							<div ng-if="item.acceptQty" class="text-success text-center text-bold f14">
+								客户验收:{{::item.acceptQty}}{{::item.product.unit}}
+							</div>
+							<div ng-if="item.returnQty" class="text-error text-center text-bold f14">
+								客户验退:{{::item.returnQty}}{{::item.product.unit}}
+							</div>
+							<div style="margin: 0 auto" ng-if="item.$editing">
+								<input type="text"
+									   ng-model="item.reply.remark" class="form-control input-xs"  ng-init="item.reply.remark = ''"
+									   placeholder="回复备注" />
+							</div>
+						</td>
+						<td class="text-center" width="100">
+							<div ng-if="item.replyQty>=item.qty" class="block">
+								<span class="text-trans success">已回复</span>
 							</div>
-							<div ng-if="item.$editing">
-								<div>
-									<a ng-click="item.$editing=!item.$editing">取消</a>
+							<div ng-if="item.end" class="block">
+								<span class="text-trans warning">已结案</span>
+							</div>
+							<div
+								ng-if="(!item.replyQty || item.replyQty<=item.qty) && !item.end">
+								<br ng-if="item.replyQty>=item.qty">
+								<br ng-if="item.replyQty>=item.qty">
+								<div ng-show="!item.$editing">
+									<a ng-click="item.$editing=!item.$editing" ng-if="item.acceptQty-item.returnQty < item.qty">回复</a>
 								</div>
-								<br>
-								<div class="text-left">
-									<a ng-click="onReplyClick(item)" class="text-inverse">
-										<i class="fa fa-arrow-up"></i> 确认回复
-									</a>
+								<div ng-if="item.$editing">
+									<div>
+										<a ng-click="item.$editing=!item.$editing">取消</a>
+									</div>
 									<br>
-									<a ng-if="item.replyQty"  ng-click="onReplyClick(item, -1)" class="text-muted" title="减去已回复数量">
-										<i class="fa fa-arrow-down"></i> 撤销回复</a>
+									<div class="text-left">
+										<a ng-click="onReplyClick(item)" class="text-inverse">
+											<i class="fa fa-arrow-up"></i> 确认回复
+										</a>
+										<br>
+										<a ng-if="item.replyQty"  ng-click="onReplyClick(item, -1)" class="text-muted" title="减去已回复数量">
+											<i class="fa fa-arrow-down"></i> 撤销回复</a>
+									</div>
 								</div>
 							</div>
-						</div>
-					</td>
-				</tr>
+						</td>
+					</tr>
 				</tbody>
 			</table>
 		</div>