Browse Source

Merge branch 'release-201847-wangcz' of ssh://10.10.101.21/source/platform-b2b into feature-hejq-payment-0104

hejq 7 years ago
parent
commit
d8443b4ed5

+ 8 - 0
pom.xml

@@ -331,6 +331,14 @@
             <version>0.0.1-SNAPSHOT</version>
         </dependency>
 
+        <!--lombok-->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+            <version>1.16.20</version>
+        </dependency>
+
         <!-- dubbo -->
         <dependency>
             <groupId>com.alibaba</groupId>

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

@@ -117,7 +117,7 @@ public class SaleApCheckController {
 	 */
 	@RequestMapping("/operation/cancel")
 	public ModelMap cancelApCheck(Long id) {
-		boolean result = purchaseApCheckService.cancelApcheck(id);
+		boolean result = purchaseApCheckService.cancelApCheck(id);
 		LOGGER.log("应收对账单", "作废应收对账单", result ? "成功" : "失败", "", id);
 		return new ModelMap("result", result);
 	}

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

@@ -212,7 +212,7 @@ public class ErpProdIODetail implements Serializable {
     /**
      * 是否已对账
      */
-    private Short haveChecked;
+    private Short haveChecked = Constant.NO;
 
     /**
      * 对账主表id

+ 21 - 4
src/main/java/com/uas/platform/b2b/model/ErpProdIo.java

@@ -1,6 +1,8 @@
 package com.uas.platform.b2b.model;
 
 import com.uas.platform.b2b.publicapi.model.ApCheckAmount;
+import lombok.Getter;
+import lombok.Setter;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -14,22 +16,22 @@ import java.util.List;
 public class ErpProdIo {
 
     /**
-     * 应收对账单数据
+     * 应收对账单数据(下方列表数据,未按照code聚合)
      */
     private List<ErpProdIODetail> details = new ArrayList<>();
 
     /**
-     * 本应收(前端传入指定月份)
+     * 本应收(前端传入指定月份)
      */
     private List<ApCheckAmount> thisMonthCount;
 
     /**
-     * 本月应收(前端传入指定月份)
+     * 本期已对账(前端传入指定月份)
      */
     private List<ApCheckAmount> thisMonthDoneCount;
 
     /**
-     * 本月应收(前端传入指定月份)
+     * 本期未对账(前端传入指定月份)
      */
     private List<ApCheckAmount> thisMonthTodoCount;
 
@@ -43,6 +45,21 @@ public class ErpProdIo {
      */
     private String vendorName;
 
+    /**
+     * 应收对账单数据(下方列表数据,按code分组聚合)
+     */
+    @Getter@Setter List<ProductIoGroup> groupList;
+
+    /**
+     * 本期发货(ERP数据)
+     */
+    @Getter@Setter List<ApCheckAmount> thisPeriodSendAmount;
+
+    /**
+     * 本期已收(ERP数据)
+     */
+    @Getter@Setter List<ApCheckAmount> thisPeriodDoneAmount;
+
     public List<ErpProdIODetail> getDetails() {
         return details;
     }

+ 53 - 0
src/main/java/com/uas/platform/b2b/model/ProductIoGroup.java

@@ -0,0 +1,53 @@
+package com.uas.platform.b2b.model;
+
+import com.uas.platform.b2b.publicapi.model.ApCheckAmount;
+import com.uas.platform.core.model.Constant;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 应收对账明细单据分组
+ *
+ * @author hejq
+ * @date 2018-12-29 14:53
+ */
+@Data
+public class ProductIoGroup {
+
+    /**
+     * 采购单号
+     */
+    private String orderCode;
+
+    /**
+     * 发货数量
+     */
+    private Double sendQty;
+
+    /**
+     * 对账数量(页面验收数量)
+     */
+    private Double checkQty;
+
+    /**
+     * 应收金额
+     */
+    private List<ApCheckAmount> checkAmountList;
+
+    /**
+     * 发货金额
+     */
+    private List<ApCheckAmount> sendAmountList;
+
+    /**
+     * 明细
+     */
+    private List<ErpProdIODetail> details = new ArrayList<>();
+
+    /**
+     * 明细是否全对账
+     */
+    private Short allChecked = Constant.YES;
+}

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

@@ -462,7 +462,7 @@ public class PurchaseApCheckItem implements Serializable {
 
 	public static List<PurchaseApCheck> distinct(List<PurchaseApCheckItem> items) {
 		List<PurchaseApCheck> purchaseApChecks = new ArrayList<PurchaseApCheck>();
-		Set<Long> keys = new HashSet<Long>();
+		Set<Long> keys = new HashSet<>();
 		for (PurchaseApCheckItem item : items) {
 			if (!keys.contains(item.apCheck.getId())) {
 				purchaseApChecks.add(item.apCheck);

+ 10 - 0
src/main/java/com/uas/platform/b2b/model/User.java

@@ -46,6 +46,16 @@ import java.util.stream.Collectors;
 @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "com.uas.platform.b2b.model.User")
 public class User implements Serializable {
 
+    /**
+     * 姓名长度限制
+     */
+    public static final Integer MAX_NAME_LENGTH = 20;
+
+    /**
+     * 邮箱长度限制
+     */
+    public static final Integer MAX_EMAIL_LENGTH = 50;
+
 	/**
 	 * 
 	 */

+ 9 - 0
src/main/java/com/uas/platform/b2b/model/Vendor.java

@@ -3,10 +3,13 @@ package com.uas.platform.b2b.model;
 import com.alibaba.fastjson.annotation.JSONField;
 import com.uas.platform.b2b.erp.model.InquiryVendorInfo;
 import com.uas.platform.b2b.publicapi.model.ApCheckAmount;
+import com.uas.platform.b2b.publicapi.model.ApCheckAmountDetail;
 import com.uas.platform.core.persistence.Logger;
 import com.uas.platform.core.persistence.OtherUserUU;
 import com.uas.platform.core.persistence.StatusColumn;
 import com.uas.platform.core.persistence.UserUU;
+import lombok.Getter;
+import lombok.Setter;
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.hibernate.annotations.Cache;
 import org.hibernate.annotations.CacheConcurrencyStrategy;
@@ -251,6 +254,12 @@ public class Vendor implements Serializable {
 	@Transient
     private List<ApCheckAmount> apCheckAmounts;
 
+    /**
+     * 对账金额详情
+     */
+	@Transient
+    @Getter@Setter private List<ApCheckAmountDetail> amountDetailList;
+
 	public Long getId() {
 		return id;
 	}

+ 48 - 0
src/main/java/com/uas/platform/b2b/publicapi/model/ApCheckAmountDetail.java

@@ -0,0 +1,48 @@
+package com.uas.platform.b2b.publicapi.model;
+
+import lombok.Data;
+
+/**
+ * 对账金额统计
+ *
+ * @author hejq
+ * @date 2018-12-29 11:06
+ */
+@Data
+public class ApCheckAmountDetail {
+
+    /**
+     * 币别
+     */
+    private String currency;
+
+    /**
+     * 本期应收
+     */
+    private String thisPeriodAmount;
+
+    /**
+     * 本期发货
+     */
+    private Double thisPeriodSendQty;
+
+    /**
+     * 本期未对
+     */
+    private String thisPeriodTodoAmount;
+
+    /**
+     * 本期已对
+     */
+    private String thisPeriodDoneAmount;
+
+    /**
+     * 本期收款
+     */
+    private String thisPeriodReceipt;
+
+    /**
+     * 应收总额
+     */
+    private String totalAmount;
+}

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

@@ -60,7 +60,6 @@ public interface ErpProdIODetailService {
      */
     List<ErpProdIODetail> covertApCheckToErpIo(List<PurchaseApCheckItemInfo> apCheckList);
 
-
     /**
      * 设置对账金额信息
      *
@@ -73,4 +72,11 @@ public interface ErpProdIODetailService {
      * @throws InterruptedException 线程中断异常
      */
     void setCheckAmount(ErpProdIo erpProdIo, Long vendorUU, Long customerUU, String checkDate, Long fromDate, Long endDate) throws InterruptedException;
+
+    /**
+     * 按订单明细分组
+     *
+     * @param erpProdIo 出入库单信息
+     */
+    void groupByOrderCode(ErpProdIo erpProdIo);
 }

+ 3 - 2
src/main/java/com/uas/platform/b2b/service/PurchaseApCheckService.java

@@ -51,9 +51,10 @@ public interface PurchaseApCheckService {
 	/**
 	 * 作废应收对账单
 	 * 
-	 * @param id
+	 * @param id 对账单id
+     * @return 是否成功
 	 */
-    boolean cancelApcheck(Long id);
+    boolean cancelApCheck(Long id);
 
 	/**
 	 * 保存生成的应收对账单主记录

+ 76 - 10
src/main/java/com/uas/platform/b2b/service/impl/ErpProdIODetailServiceImpl.java

@@ -5,28 +5,26 @@ import com.uas.platform.b2b.core.util.BoundedExecutor;
 import com.uas.platform.b2b.core.util.DateFormatUtils;
 import com.uas.platform.b2b.core.util.DateUtils;
 import com.uas.platform.b2b.core.util.StringUtil;
-import com.uas.platform.b2b.core.util.ThreadTask;
 import com.uas.platform.b2b.core.util.ThreadUtils;
 import com.uas.platform.b2b.dao.CommonDao;
-import com.uas.platform.b2b.dao.PurchaseApCheckDao;
 import com.uas.platform.b2b.dao.PurchaseApCheckItemInfoDao;
 import com.uas.platform.b2b.dao.VendorDao;
 import com.uas.platform.b2b.model.ApcheckKeyWord;
 import com.uas.platform.b2b.model.DateFilter;
 import com.uas.platform.b2b.model.ErpProdIODetail;
 import com.uas.platform.b2b.model.ErpProdIo;
-import com.uas.platform.b2b.model.PurchaseApCheck;
+import com.uas.platform.b2b.model.ProductIoGroup;
 import com.uas.platform.b2b.model.PurchaseApCheckItemInfo;
 import com.uas.platform.b2b.model.Vendor;
 import com.uas.platform.b2b.publicapi.model.ApCheckAmount;
 import com.uas.platform.b2b.service.ErpProdIODetailService;
-import com.uas.platform.b2b.service.OrderRedDotService;
 import com.uas.platform.b2b.service.PurchaseApCheckService;
-import com.uas.platform.b2b.service.SnapshotService;
 import com.uas.platform.b2b.support.CollectionUtil;
+import com.uas.platform.b2b.support.DecimalUtils;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.task.ApCheckTask;
 import com.uas.platform.core.exception.IllegalOperatorException;
+import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import org.apache.axis.utils.StringUtils;
@@ -41,9 +39,13 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.stream.Collectors;
+
+import static java.util.Comparator.comparing;
 
 
 /**
@@ -61,19 +63,16 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
 
     private final VendorDao vendorDao;
 
-    private final PurchaseApCheckDao apCheckDao;
-
     private final BoundedExecutor executor;
 
     private final PurchaseApCheckItemInfoDao apCheckItemInfoDao;
 
     @Autowired
     public ErpProdIODetailServiceImpl(CommonDao commonDao, PurchaseApCheckService apCheckService,
-                                      VendorDao vendorDao, PurchaseApCheckDao apCheckDao, PurchaseApCheckItemInfoDao apCheckItemInfoDao) {
+                                      VendorDao vendorDao, PurchaseApCheckItemInfoDao apCheckItemInfoDao) {
         this.commonDao = commonDao;
         this.apCheckService = apCheckService;
         this.vendorDao = vendorDao;
-        this.apCheckDao = apCheckDao;
         this.apCheckItemInfoDao = apCheckItemInfoDao;
         ExecutorService executorService = Executors.newCachedThreadPool();
         executor = new BoundedExecutor(executorService, 1600);
@@ -153,9 +152,76 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
             List<ErpProdIODetail> detailList = covertApCheckToErpIo(apCheckList);
             erpProdIo.getDetails().addAll(detailList);
         }
-		return erpProdIo;
+        groupByOrderCode(erpProdIo);
+        return erpProdIo;
 	}
 
+    /**
+     * 按订单明细分组
+     * @param erpProdIo 出入库单信息
+     */
+    @Override
+    public void groupByOrderCode(ErpProdIo erpProdIo) {
+        Set<String> codeSet = erpProdIo.getDetails().parallelStream().map(ErpProdIODetail::getOrdercode).collect(Collectors.toSet());
+        List<ProductIoGroup> groupList = new ArrayList<>();
+        codeSet.forEach(code -> {
+            ProductIoGroup group = new ProductIoGroup();
+            if (StringUtils.isEmpty(code)) {
+                group.setOrderCode("");
+                List<ErpProdIODetail> details = erpProdIo.getDetails().stream()
+                    .filter(detail -> StringUtils.isEmpty(detail.getOrdercode())).collect(Collectors.toList());
+                collectOrders(group, details);
+            } else {
+                group.setOrderCode(code);
+                // 筛选单号一样的明细
+                List<ErpProdIODetail> details = erpProdIo.getDetails().stream()
+                    .filter(detail -> code.equals(detail.getOrdercode())).collect(Collectors.toList());
+                collectOrders(group, details);
+            }
+            groupList.add(group);
+        });
+        erpProdIo.setGroupList(groupList);
+        if (!CollectionUtil.isEmpty(groupList)) {
+            erpProdIo.getGroupList().sort(comparing(ProductIoGroup::getAllChecked));
+        }
+    }
+
+    /**
+     * 分组处理数据
+     *
+     * @param group 应收对账明细单据分组
+     * @param details 筛选后的数据
+     */
+    private void collectOrders(ProductIoGroup group, List<ErpProdIODetail> details) {
+        for (ErpProdIODetail detail : details) {
+            if (Constant.NO == detail.getHaveChecked()) {
+                group.setAllChecked(Constant.NO);
+                break;
+            }
+        }
+        group.setDetails(details);
+        // 统计发货数量
+        Double sendQty = details.stream().mapToDouble(ErpProdIODetail::getQty).sum();
+        group.setSendQty(sendQty);
+        // 统计对账数量
+        Double checkQty = details.stream().mapToDouble(ErpProdIODetail::getThischeckqty).sum();
+        group.setCheckQty(checkQty);
+        // 明细筛选币别
+        Set<String> currencySet = details.stream().map(ErpProdIODetail::getCurrency).collect(Collectors.toSet());
+        // 根据币别统计金额
+        currencySet.forEach(currency -> {
+            List<ApCheckAmount> amounts = new ArrayList<>();
+            Double amount = details.stream().filter(tradeCount -> null != tradeCount && currency.equals(tradeCount.getCurrency()))
+                .mapToDouble(ErpProdIODetail::getMoney).sum();
+            if (amount > 0) {
+                amounts.add(new ApCheckAmount(currency, DecimalUtils.decimalPoint(amount, 2)));
+            }
+            group.setCheckAmountList(amounts);
+        });
+        // 按照是否已对账排序
+        group.getDetails().sort(comparing(ErpProdIODetail::getHaveChecked));
+    }
+
     /**
      * 设置对账金额信息
      *

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

@@ -1,9 +1,7 @@
 package com.uas.platform.b2b.service.impl;
 
-import com.alibaba.fastjson.JSON;
 import com.uas.platform.b2b.constant.StringConstant;
 import com.uas.platform.b2b.core.util.BoundedExecutor;
-import com.uas.platform.b2b.core.util.SplitArray;
 import com.uas.platform.b2b.dao.CommonDao;
 import com.uas.platform.b2b.dao.EnterpriseDao;
 import com.uas.platform.b2b.dao.PurchaseApBillDao;
@@ -19,19 +17,15 @@ import com.uas.platform.b2b.model.ErpProdIo;
 import com.uas.platform.b2b.model.Product;
 import com.uas.platform.b2b.model.PurchaseApBill;
 import com.uas.platform.b2b.model.PurchaseApBillItem;
-import com.uas.platform.b2b.model.PurchaseApCheck;
 import com.uas.platform.b2b.model.PurchaseApCheckItemInfo;
 import com.uas.platform.b2b.model.SearchFilter;
 import com.uas.platform.b2b.model.Vendor;
 import com.uas.platform.b2b.ps.ProductUtils;
-import com.uas.platform.b2b.publicapi.model.ApCheckAmount;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.ErpProdIODetailService;
 import com.uas.platform.b2b.service.PurchaseApBillService;
 import com.uas.platform.b2b.service.PurchaseApCheckService;
-import com.uas.platform.b2b.support.CollectionUtil;
 import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.b2b.task.ApCheckTask;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
@@ -362,6 +356,7 @@ public class PurchaseApBillServiceImpl implements PurchaseApBillService {
             Enterprise enterprise = enterpriseDao.findOne(searchKeyWord.getVendorUU());
             erpProdIo.setVendorName(enterprise.getEnName());
         }
+        erpProdIODetailService.groupByOrderCode(erpProdIo);
         return erpProdIo;
     }
 

+ 87 - 89
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApCheckServiceImpl.java

@@ -3,7 +3,7 @@ package com.uas.platform.b2b.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.uas.platform.b2b.constant.StringConstant;
 import com.uas.platform.b2b.core.util.BoundedExecutor;
-import com.uas.platform.b2b.core.util.ContextUtils;
+import com.uas.platform.b2b.core.util.ThreadUtils;
 import com.uas.platform.b2b.dao.CommonDao;
 import com.uas.platform.b2b.dao.CommunalLogDao;
 import com.uas.platform.b2b.dao.EnterpriseDao;
@@ -13,7 +13,6 @@ import com.uas.platform.b2b.dao.PurchaseApCheckDoneDao;
 import com.uas.platform.b2b.dao.PurchaseApCheckItemDao;
 import com.uas.platform.b2b.dao.PurchaseApCheckTodoDao;
 import com.uas.platform.b2b.dao.VendorDao;
-import com.uas.platform.b2b.event.PurchaseApCheckReplyReleaseEvent;
 import com.uas.platform.b2b.model.ApCheckTable;
 import com.uas.platform.b2b.model.CommunalLog;
 import com.uas.platform.b2b.model.DateFilter;
@@ -32,6 +31,7 @@ import com.uas.platform.b2b.model.util.ApCheckAllCountSqls;
 import com.uas.platform.b2b.model.util.ApCheckDoneCountSqls;
 import com.uas.platform.b2b.model.util.ApCheckTodoCountSqls;
 import com.uas.platform.b2b.publicapi.model.ApCheckAmount;
+import com.uas.platform.b2b.publicapi.model.ApCheckAmountDetail;
 import com.uas.platform.b2b.service.ErpProdIODetailService;
 import com.uas.platform.b2b.service.OrderRedDotService;
 import com.uas.platform.b2b.service.PurchaseApCheckService;
@@ -63,7 +63,6 @@ import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
-import java.sql.SQLException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -101,21 +100,6 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 
     private final static UsageBufferedLogger LOGGER = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
 
-    /**
-     * RMB
-     */
-    private final String RMB = "RMB";
-
-    /**
-     * 港币
-     */
-    private final String HKD = "HKD";
-
-    /**
-     * 美元
-     */
-    private final String USD = "USD";
-
     private final BoundedExecutor executor;
 
     @Autowired
@@ -158,14 +142,28 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 
 	@Override
 	public void saveApChecks(List<PurchaseApCheckItem> checkItems) {
-		if (checkItems != null && checkItems.size() > 0) {
-			purchaseApCheckItemDao.save(checkItems);
-			List <PurchaseApCheck> apChecks = PurchaseApCheckItem.distinct(checkItems);
+		if (!CollectionUtil.isEmpty(checkItems)) {
+            checkItems = purchaseApCheckItemDao.save(checkItems);
+			List<PurchaseApCheck> apChecks = PurchaseApCheckItem.distinct(checkItems);
 			saveUserOrders(apChecks);
-			ContextUtils.publishEvent(new PurchaseApCheckReplyReleaseEvent(apChecks));
+            Set<Long> needRestoreIdList = checkItems.stream()
+                .filter(item -> Status.NOTAGREED.getPhrase().equals(item.getApCheck().getCheckStatus()))
+                .map(item -> item.getApCheck().getId())
+                .collect(Collectors.toSet());
+            restoreApCheckQty(needRestoreIdList);
 		}
 	}
 
+    /**
+     * 针对客户不同意单据,自动还原,不需要供应商这边处理
+     *
+     * @param needRestoreIdList 需要处理的对账单的id
+     */
+    private void restoreApCheckQty(Set<Long> needRestoreIdList) {
+        LOGGER.log("ERP不同意对账作废应收对账单", "关联id:" + needRestoreIdList);
+        ThreadUtils.task(() -> needRestoreIdList.forEach(this::cancelApCheck)).run();
+    }
+
     /**
      * 生成消息红点
      *
@@ -181,56 +179,18 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 	}
 
 	@Override
-	public boolean cancelApcheck(Long id) {
+	public boolean cancelApCheck(Long id) {
 		PurchaseApCheck check = purchaseApCheckDao.findOne(id);
 		if (check != null) {
-			if (!CollectionUtils.isEmpty(check.getItems()) && check.getCheckStatus().equals("不同意")) {
-			    List<String> sqls = new ArrayList<>();
-				for (PurchaseApCheckItem item : check.getItems()) {
-					item.setCheckQty(0.0);
-					Double newYCheckQtyVal = item.getOldYCheckQty();
-					Long sourceIdVal = item.getSourceId();
-					String sourceTable = null;
-					String idName = null;
-					String yCheckQtyName = null;
-					if (item.getSourceTable() != null) {
-						sourceTable = item.getSourceTable();
-					} else {
-						sourceTable = "";
-					}
-					if (sourceTable.equals("purc$returnitem")) {
-						idName = "pri_id";
-						yCheckQtyName = "pri_ycheckqty";
-					} else if (sourceTable.equals("purc$acceptitem")) {
-						idName = "pai_id";
-						yCheckQtyName = "pai_ycheckqty";
-					} else if (sourceTable.equals("purc$badinitem")) {
-						idName = "pbi_id";
-						yCheckQtyName = "pbi_ycheckqty";
-					} else if (sourceTable.equals("purc$badoutitem")) {
-						idName = "poi_id";
-						yCheckQtyName = "poi_ycheckqty";
-					} else if (sourceTable.equals("make$acceptitem")) {
-						idName = "mai_id";
-						yCheckQtyName = "mai_ycheckqty";
-					} else if (sourceTable.equals("make$returnitem")) {
-						idName = "mri_id";
-						yCheckQtyName = "mri_ycheckqty";
-					} else if (sourceTable.equals("purc$apbilladjustment")) {
-						idName = "aa_id";
-						yCheckQtyName = "aa_ycheckqty";
-					}
-					String sql = "update " + sourceTable + " set " + yCheckQtyName + " = " + newYCheckQtyVal + " where "
-							+ idName + " = " + sourceIdVal;
-                    sqls.add(sql);
-				}
-                if (!CollectionUtils.isEmpty(sqls)) {
-                    try {
-                        commonDao.getJdbcTemplate().batchUpdate(sqls.toArray(new String[sqls.size()]));
-                    } catch (RuntimeException e) {
-                        System.out.println("生成对账单批量更新来源数据失败: " + e.getMessage());
-                        throw new IllegalOperatorException("保存失败!");
-                    }
+		    List<SourceForApcheck> sources = new ArrayList<>();
+			if (!CollectionUtils.isEmpty(check.getItems()) && Status.NOTAGREED.getPhrase().equals(check.getCheckStatus())) {
+                check.getItems().forEach(item -> {
+                    item.setCheckQty(0.0);
+                    SourceForApcheck source = new SourceForApcheck(item);
+                    sources.add(source);
+                });
+				if (!CollectionUtil.isEmpty(sources)) {
+				    updateSourceInfo(sources, "ERP上传不同意单据同步更新对账单");
                 }
 			}
 			check.setCheckStatus("已作废");
@@ -362,7 +322,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 			SourceForApcheck source = new SourceForApcheck(item);
 			sources.add(source);
 		}
-        updateSourceInfo(sources);
+        updateSourceInfo(sources, "生成对账单批量更新来源数据");
         saveCheckItemsByJdbcTemplate(purchaseApCheck.getItems(), apCheck.getId());
         List<PurchaseApCheck> apChecks = new ArrayList<>();
         purchaseApCheck.setId(apCheck.getId());
@@ -424,9 +384,10 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
      * 更新来源表数据
      *
      * @param sourceApCheckList 来源库信息
+     * @param path 路径
      * @return 保存结果
      */
-	public void updateSourceInfo(List<SourceForApcheck> sourceApCheckList) {
+	public void updateSourceInfo(List<SourceForApcheck> sourceApCheckList, String path) {
 		if (CollectionUtils.isEmpty(sourceApCheckList)) {
             throw new IllegalOperatorException("保存失败!");
         }
@@ -443,7 +404,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
             try {
                 commonDao.getJdbcTemplate().batchUpdate(sqlList.toArray(new String[sqlList.size()]));
             } catch (RuntimeException e) {
-                System.out.println("生成对账单批量更新来源数据失败: " + e.getMessage());
+                System.out.println(path + "失败: " + e.getMessage());
                 throw new IllegalOperatorException("保存失败!");
             }
         }
@@ -687,9 +648,53 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
                 List<ApCheckAmount> thisMonthDoneTrades = getThisMonthDoneTrade(vendorUU, customerUU, checkDate, fromDate, endDate);
                 customer.setThisMonthDoneCount(thisMonthDoneTrades);
             }
+            setAmountDetail(customer);
         }
     }
 
+    /**
+     * 设置对账明细数据
+     *
+     * @param customer 供应商客户信息
+     */
+    private void setAmountDetail(Vendor customer) {
+        // 先统计总额币别
+        Set<String> currencySet = customer.getTotalCount()
+            .parallelStream().map(ApCheckAmount::getCurrency)
+            .collect(Collectors.toSet());
+        List<ApCheckAmountDetail> detailList = new ArrayList<>();
+        currencySet.forEach(currency -> {
+            ApCheckAmountDetail detail = new ApCheckAmountDetail();
+            if (!StringUtils.isEmpty(customer.getThisMonthCount())) {
+                List<String> thisPeriodAmount = customer.getThisMonthCount().stream()
+                    .filter(count -> currency.equals(count.getCurrency()))
+                    .map(ApCheckAmount::getAmount).collect(Collectors.toList());
+                detail.setThisPeriodAmount(thisPeriodAmount.size() > 0 ? thisPeriodAmount.get(0) : null);
+            }
+            if (!StringUtils.isEmpty(detail.getThisPeriodAmount())) {
+                List<String> totalAmount = customer.getTotalCount().stream()
+                    .filter(count -> currency.equals(count.getCurrency()))
+                    .map(ApCheckAmount::getAmount).collect(Collectors.toList());
+                detail.setTotalAmount(totalAmount.size() > 0 ? totalAmount.get(0) : null);
+                detail.setCurrency(currency);
+                if (!StringUtils.isEmpty(customer.getThisMonthTodoCount())) {
+                    List<String> thisPeriodTodoAmount = customer.getThisMonthTodoCount().stream()
+                        .filter(count -> currency.equals(count.getCurrency()))
+                        .map(ApCheckAmount::getAmount).collect(Collectors.toList());
+                    detail.setThisPeriodTodoAmount(thisPeriodTodoAmount.size() > 0 ? thisPeriodTodoAmount.get(0) : null);
+                }
+                if (!StringUtils.isEmpty(customer.getThisMonthDoneCount())) {
+                    List<String> thisPeriodDoneAmount = customer.getThisMonthDoneCount().stream()
+                        .filter(count -> currency.equals(count.getCurrency()))
+                        .map(ApCheckAmount::getAmount).collect(Collectors.toList());
+                    detail.setThisPeriodDoneAmount(thisPeriodDoneAmount.size() > 0 ? thisPeriodDoneAmount.get(0) : null);
+                }
+                detailList.add(detail);
+            }
+        });
+        customer.setAmountDetailList(detailList);
+    }
+
     /**
      * 设置供应商信息
      * @param params 分页参数
@@ -801,21 +806,14 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
     public List<ApCheckAmount> groupCountByCurrency(List<ApCheckAmount> totalTrades) {
         List<ApCheckAmount> resultCounts = new ArrayList<>();
         if (null != totalTrades && !CollectionUtils.isEmpty(totalTrades)) {
-            Double rmbCount = totalTrades.stream().filter(tradeCount -> null != tradeCount && RMB.equals(tradeCount.getCurrency()))
-                .mapToDouble(ApCheckAmount::getCount).sum();
-            Double usdCount = totalTrades.stream().filter(tradeCount -> null != tradeCount && USD.equals(tradeCount.getCurrency()))
-                .mapToDouble(ApCheckAmount::getCount).sum();
-            Double hkdCount = totalTrades.stream().filter(tradeCount -> null != tradeCount && HKD.equals(tradeCount.getCurrency()))
-                .mapToDouble(ApCheckAmount::getCount).sum();
-            if (rmbCount > 0) {
-                resultCounts.add(new ApCheckAmount(RMB, DecimalUtils.decimalPoint(rmbCount, 2)));
-            }
-            if (usdCount > 0) {
-                resultCounts.add(new ApCheckAmount(USD, DecimalUtils.decimalPoint(usdCount, 2)));
-            }
-            if (hkdCount > 0) {
-                resultCounts.add(new ApCheckAmount(HKD, DecimalUtils.decimalPoint(hkdCount, 2)));
-            }
+            Set<String> currencySet = totalTrades.parallelStream().map(ApCheckAmount::getCurrency).collect(Collectors.toSet());
+            currencySet.forEach(currency -> {
+                Double amount = totalTrades.stream().filter(tradeCount -> null != tradeCount && currency.equals(tradeCount.getCurrency()))
+                    .mapToDouble(ApCheckAmount::getCount).sum();
+                if (amount > 0) {
+                    resultCounts.add(new ApCheckAmount(currency, DecimalUtils.decimalPoint(amount, 2)));
+                }
+            });
         }
         return resultCounts;
     }
@@ -1083,7 +1081,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
                     .collect(Collectors.toSet()));
             });
             if (!CollectionUtil.isEmpty(alters)) {
-                throw new IllegalOperatorException("订单" + new ModelMap("alters", alters) + "存在未对账的单据,请先进行对账!");
+                throw new IllegalOperatorException("订单" + alters + "存在未对账的单据,请先进行对账!");
             }
         }
     }

+ 17 - 2
src/main/java/com/uas/platform/b2b/service/impl/UserServiceImpl.java

@@ -372,10 +372,11 @@ public class UserServiceImpl implements UserService {
         return users;
     }
 
-    static final String defaultPassword = "111111";
+    private static final String defaultPassword = "111111";
 
 	@Override
 	public User addUser(User user, HttpServletRequest request) {
+        enableUserInfo(user);
 		List<User> users = userDao.findUserByUserTel(user.getUserTel().trim());
 		if (users.size() > 0) {
 			throw new IllegalOperatorException("电话号码重复,建议输入您自己的手机号");
@@ -416,7 +417,21 @@ public class UserServiceImpl implements UserService {
 		return user;
 	}
 
-	private Long addUserToAccountCenter(User user) throws Exception {
+    /**
+     * 校验填写的用户信息
+     *
+     * @param user 前端传入的用户信息
+     */
+    private void enableUserInfo(User user) {
+        if (user.getUserName().length() > User.MAX_NAME_LENGTH) {
+            throw new IllegalOperatorException("用户姓名请不要超过20个字符");
+        }
+        if (user.getUserEmail().length() > User.MAX_EMAIL_LENGTH) {
+            throw new IllegalOperatorException("用户邮箱请不要超过50个字符");
+        }
+    }
+
+    private Long addUserToAccountCenter(User user) throws Exception {
 		UserView userView = new UserView();
 		userView.setVipName(user.getUserName());
 		userView.setIdCard(user.getUserIdcode());

+ 181 - 149
src/main/webapp/resources/js/index/app.js

@@ -9978,9 +9978,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 }
                 FaApCheck.getAllArCheckByKeywords(_params, function (data) {
                     $scope.checkMain = data;
-                    if (data.details.length > 0) {
-                        angular.forEach(data.details, function (item) {
+                    if (data.groupList.length > 0) {
+                        angular.forEach(data.groupList, function (item) {
                             item.$selected = true;
+                            item.showDetail = true;
+                            angular.forEach(item.details, function(detail){
+                                detail.$selected = true;
+                            })
                         });
                         var _mouthArr = []
                         data.thisMonthCount && data.thisMonthCount.forEach(function(item) {
@@ -10022,7 +10026,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         data.apCheckAmounts = _apCheckAmounts
 
                         $scope.dataInfo = data
-                        $scope.data = data.details;
+                        $scope.data = data.groupList;
                         $scope.checkboxes.checked = true;
                         // $scope.suuorname = data.vendorName
                         $scope.getTotalMoney();
@@ -10120,6 +10124,12 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             // event.preventDefault();
             return false;
         }
+
+        $scope.showDetailClick = function (e, item) {
+            e.stopPropagation();
+            item.showDetail = !item.showDetail
+        }
+
         $scope.Checkall = function() {
             var result = true;
             angular.forEach($scope.data, function (item) {
@@ -10927,9 +10937,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 }
                     FaApCheck.getAllByKeywords(_params, function (data) {
                         $scope.checkMain = data;
-                        if (data.details.length > 0) {
-                            angular.forEach(data.details, function (item) {
+                        if (data.groupList.length > 0) {
+                            angular.forEach(data.groupList, function (item) {
                                 item.$selected = true;
+                                item.showDetail = true;
+                                angular.forEach(item.details, function(detail) {
+                                    detail.$selected = true;
+                                })
                             });
                             var _mouthArr = []
                             data.thisMonthCount && data.thisMonthCount.forEach(function(item) {
@@ -10972,7 +10986,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             data.apCheckAmounts = _apCheckAmounts
 
                             $scope.dataInfo = data
-                            $scope.data = data.details;
+                            $scope.data = data.groupList;
                             $scope.checkboxes.checked = true;
                             // $scope.Checkall()
                             $scope.getTotalMoney();
@@ -11030,36 +11044,31 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             // var dateFrom = $scope.condition.dateFrom;
             // var dateTo = $scope.condition.dateTo;
             angular.forEach($scope.filteredData, function (item) {
-                if (item.haveChecked !== 1) {
+                if (item.allChecked !== 1) {
                     // if ((item.pidate >= dateFrom || dateFrom == '') && (item.pidate < dateTo || dateTo == '')) {
                     item.$selected = $scope.checkboxes.checked;
                     // }
+                    angular.forEach(item.details, function (type) {
+                        if(type.haveChecked !==1){
+                            type.$selected = $scope.checkboxes.checked;
+                        }
+                    })
                 }
             });
             $scope.getTotalMoney();
         };
 
-        //获取已选单据总金额
-        $scope.getTotalMoney = function () {
-            $scope.totalMoney = 0;
-            angular.forEach($scope.data, function (check) {
-                // if (check.$selected) {
-                    var price = DecimalNumber.accMul((check.thischeckqty || 0), (check.orderprice || 0));
-                    $scope.totalMoney += Math.round(price * 100) / 100;
-                // } else {
-                //     $scope.totalMoney += 0;
-                // }
-            });
-
-        }
-
         // 点击其中一个明细的复选框
-        $scope.checkOne = function (check) {
-            if (check.haveChecked === 1) {
-                return
+        $scope.checkOneAll = function (e, check) {
+            angular.forEach(check.details, function(type) {
+                if (type.haveChecked === 1) {
+                    return
+                }
+                type.$selected = check.$selected;
+            })
+            if(!check.$selected) {
+                $scope.checkboxes.checked = false;
             }
-            check.$selected = !check.$selected
-            $scope.Checkall()
         };
         $scope.stopPrevent = function(e) {
             e = e || window.event
@@ -11068,17 +11077,39 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             // event.preventDefault();
             return false;
         }
+
         $scope.Checkall = function() {
             var result = true;
-            angular.forEach($scope.data, function (item) {
+            var childResult = true;
+            angular.forEach($scope.data, function(item) {
+                angular.forEach(item.details, function(type) {
+                    if(type.$selected != true) {
+                        childResult = false;
+                    }
+                })
+                item.$selected = childResult;
                 if (item.$selected != true) {
                     result = false;
                     return;
                 }
-            });
+            })
             $scope.checkboxes.checked = result;
         }
 
+        //获取已选单据总金额
+        $scope.getTotalMoney = function () {
+            $scope.totalMoney = 0;
+            angular.forEach($scope.data, function (check) {
+                // if (check.$selected) {
+                    var price = DecimalNumber.accMul((check.thischeckqty || 0), (check.orderprice || 0));
+                    $scope.totalMoney += Math.round(price * 100) / 100;
+                // } else {
+                //     $scope.totalMoney += 0;
+                // }
+            });
+
+        }
+
         $scope.haveSelected = false;
 
         //生成应收对账单
@@ -11109,136 +11140,137 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.sameCust = true;
             $scope.validQty = true;
             $scope.loading = true;
+            angular.forEach($scope.data, function(items) {
+                angular.forEach(items.details, function (check) {
+                    //保存应收对账单明细行数据
+                    $scope.item = {
+                        inoutno: '',
+                        inoutnodetno: '',
+                        orderCode: '',
+                        orderClass: '',
+                        orderDetno: '',
+                        price: '',
+                        checkQty: '',
+                        amount: '',
+                        sourceId: '',
+                        sourceTable: '',
+                        oldYCheckQty: '',
+                        status: 0,
+                        receiveCode: '',
+                        receiveName: '',
+                        prodCode: '',
+                        prodTitle: '',
+                        prodUnit: '',
+                        prodSpec: '',
+                        taxrate: '',
+                        sendcode: '',
+                        whname: '',
+                        custUserUU: '',
+                        pidate: ''
+                    };
 
-            angular.forEach($scope.data, function (check) {
-                //保存应收对账单明细行数据
-                $scope.item = {
-                    inoutno: '',
-                    inoutnodetno: '',
-                    orderCode: '',
-                    orderClass: '',
-                    orderDetno: '',
-                    price: '',
-                    checkQty: '',
-                    amount: '',
-                    sourceId: '',
-                    sourceTable: '',
-                    oldYCheckQty: '',
-                    status: 0,
-                    receiveCode: '',
-                    receiveName: '',
-                    prodCode: '',
-                    prodTitle: '',
-                    prodUnit: '',
-                    prodSpec: '',
-                    taxrate: '',
-                    sendcode: '',
-                    whname: '',
-                    custUserUU: '',
-                    pidate: ''
-                };
-
-                //应收对账单明细行来源表信息
-                $scope.sourceInfo = {
-                    sourceId: '',
-                    sourceTable: '',
-                    newYCheckQty: ''
-                };
-
-                //此次对账后新的已转数
-                $scope.newYCheckQty = 0;
-                if (check.$selected == true && !check.haveChecked) {
-                    $scope.apCheck.custName = check.custname;
-                    $scope.apCheck.enUu = check.enuu;
-                    $scope.apCheck.checkAmount += (check.thischeckqty || 0) * (check.orderprice || 0);
-                    $scope.apCheck.apDate = check.pidate;
-                    $scope.apCheck.rate = check.rate;
-
-                    //必须是同一家客户才能生成对账单,否则提示错误
-                    if ($scope.apCheck.custUu == '') {
-                        $scope.apCheck.custUu = check.custuu;
-                    } else if ($scope.apCheck.custUu !== check.custuu) {
-                        $scope.sameCust = false;
-                        $scope.loading = false;
-                        toaster.pop('error', '请选择同一家客户');
-                    }
-
-                    //必须是相同币别才能生成对账单,否则提示错误
-                    if ($scope.apCheck.currency == '') {
-                        $scope.apCheck.currency = check.currency;
-                    } else if ($scope.apCheck.currency !== check.currency) {
-                        $scope.sameCust = false;
-                        $scope.loading = false;
-                        toaster.pop('error', '请选择同一种币别');
-                    }
-
-                    //必须是相同税率才能生成对账单,否则提示错误
-                    if (!angular.isNumber($scope.apCheck.taxrate)) {
-                        $scope.apCheck.taxrate = check.taxrate;
-                    } else if ($scope.apCheck.taxrate != check.taxrate) {
-                        $scope.sameCust = false;
-                        $scope.loading = false;
-                        toaster.pop('error', '请选择相同的税率');
-                    }
+                    //应收对账单明细行来源表信息
+                    $scope.sourceInfo = {
+                        sourceId: '',
+                        sourceTable: '',
+                        newYCheckQty: ''
+                    };
 
-                    //本次对账数量必须小于总对账数量
-                    if (check.qty > 0) {
-                        $scope.data.maxThisCheckQty = check.qty;
-                        $scope.data.minThisCheckQty = 0;
-                        if (check.qty - (check.ycheckqty || 0) < check.thischeckqty || check.thischeckqty < 0 || check.thischeckqty == 0) {
-                            $scope.validQty = false;
+                    //此次对账后新的已转数
+                    $scope.newYCheckQty = 0;
+                    if (check.$selected == true && !check.haveChecked) {
+                        $scope.apCheck.custName = check.custname;
+                        $scope.apCheck.enUu = check.enuu;
+                        $scope.apCheck.checkAmount += (check.thischeckqty || 0) * (check.orderprice || 0);
+                        $scope.apCheck.apDate = check.pidate;
+                        $scope.apCheck.rate = check.rate;
+
+                        //必须是同一家客户才能生成对账单,否则提示错误
+                        if ($scope.apCheck.custUu == '') {
+                            $scope.apCheck.custUu = check.custuu;
+                        } else if ($scope.apCheck.custUu !== check.custuu) {
+                            $scope.sameCust = false;
                             $scope.loading = false;
-                            toaster.pop('error', '本次对账数量,填写有误!');
+                            toaster.pop('error', '请选择同一家客户');
                         }
-                    } else if (check.qty < 0) {
-                        $scope.data.maxThisCheckQty = 0;
-                        $scope.data.minThisCheckQty = check.qty;
-                        if (((-check.qty) - (-check.ycheckqty) < (-check.thischeckqty)) || check.thischeckqty > 0 || check.thischeckqty == 0) {
-                            $scope.validQty = false;
+
+                        //必须是相同币别才能生成对账单,否则提示错误
+                        if ($scope.apCheck.currency == '') {
+                            $scope.apCheck.currency = check.currency;
+                        } else if ($scope.apCheck.currency !== check.currency) {
+                            $scope.sameCust = false;
                             $scope.loading = false;
-                            toaster.pop('error', '本次对账数量,填写有误!');
+                            toaster.pop('error', '请选择同一种币别');
                         }
-                    }
 
-                    //获取筛选时间的开始时间为对账的开始时间
-                    // $scope.apCheck.beginDate = $scope.fromDate;
-
-                    //获取筛选的截止时间为对账的截止时间
-                    // $scope.apCheck.endDate = $scope.endDate;
+                        //必须是相同税率才能生成对账单,否则提示错误
+                        if (!angular.isNumber($scope.apCheck.taxrate)) {
+                            $scope.apCheck.taxrate = check.taxrate;
+                        } else if ($scope.apCheck.taxrate != check.taxrate) {
+                            $scope.sameCust = false;
+                            $scope.loading = false;
+                            toaster.pop('error', '请选择相同的税率');
+                        }
 
-                    //应收对账单明细行数据
-                    $scope.item.orderCode = check.ordercode;
-                    $scope.item.orderClass = check.piclass;
-                    $scope.item.orderDetno = check.orderdetno;
-                    $scope.item.price = check.orderprice;
-                    $scope.item.checkQty = check.thischeckqty;
-                    $scope.item.amount = (check.thischeckqty || 0) * (check.orderprice || 0);
-                    $scope.item.sourceId = check.sourceid;
-                    $scope.item.sourceTable = check.sourcetable;
-                    $scope.item.oldYCheckQty = check.ycheckqty;
-                    $scope.item.prodCode = check.prodcode;
-                    $scope.item.prodTitle = check.prodtitle;
-                    $scope.item.prodSpec = check.prodspec;
-                    $scope.item.prodUnit = check.produnit;
-                    $scope.item.inoutno = check.inoutno;
-                    $scope.item.inoutnodetno = check.detno;
-                    $scope.item.taxrate = check.taxrate;
-                    $scope.item.receiveCode = check.receivecode;
-                    $scope.item.receiveName = check.receivename;
-                    $scope.item.sendcode = check.sendcode;
-                    $scope.item.whname = check.whname;
-                    $scope.item.custUserUU = check.custuseruu;
-                    $scope.item.sourceDate = check.pidate
-                    //来源表相关信息
-                    $scope.sourceInfo.sourceid = check.sourceid;
-                    $scope.sourceInfo.sourcetable = check.sourcetable;
-                    $scope.sourceInfo.newYCheckQty = ((check.ycheckqty || 0) + check.thischeckqty);
+                        //本次对账数量必须小于总对账数量
+                        if (check.qty > 0) {
+                            $scope.data.maxThisCheckQty = check.qty;
+                            $scope.data.minThisCheckQty = 0;
+                            if (check.qty - (check.ycheckqty || 0) < check.thischeckqty || check.thischeckqty < 0 || check.thischeckqty == 0) {
+                                $scope.validQty = false;
+                                $scope.loading = false;
+                                toaster.pop('error', '本次对账数量,填写有误!');
+                            }
+                        } else if (check.qty < 0) {
+                            $scope.data.maxThisCheckQty = 0;
+                            $scope.data.minThisCheckQty = check.qty;
+                            if (((-check.qty) - (-check.ycheckqty) < (-check.thischeckqty)) || check.thischeckqty > 0 || check.thischeckqty == 0) {
+                                $scope.validQty = false;
+                                $scope.loading = false;
+                                toaster.pop('error', '本次对账数量,填写有误!');
+                            }
+                        }
 
-                    sourceInfos.push($scope.sourceInfo);
-                    $scope.apCheck.items.push($scope.item);
-                    $scope.haveSelected = true;
-                }
-            });
+                        //获取筛选时间的开始时间为对账的开始时间
+                        // $scope.apCheck.beginDate = $scope.fromDate;
+
+                        //获取筛选的截止时间为对账的截止时间
+                        // $scope.apCheck.endDate = $scope.endDate;
+
+                        //应收对账单明细行数据
+                        $scope.item.orderCode = check.ordercode;
+                        $scope.item.orderClass = check.piclass;
+                        $scope.item.orderDetno = check.orderdetno;
+                        $scope.item.price = check.orderprice;
+                        $scope.item.checkQty = check.thischeckqty;
+                        $scope.item.amount = (check.thischeckqty || 0) * (check.orderprice || 0);
+                        $scope.item.sourceId = check.sourceid;
+                        $scope.item.sourceTable = check.sourcetable;
+                        $scope.item.oldYCheckQty = check.ycheckqty;
+                        $scope.item.prodCode = check.prodcode;
+                        $scope.item.prodTitle = check.prodtitle;
+                        $scope.item.prodSpec = check.prodspec;
+                        $scope.item.prodUnit = check.produnit;
+                        $scope.item.inoutno = check.inoutno;
+                        $scope.item.inoutnodetno = check.detno;
+                        $scope.item.taxrate = check.taxrate;
+                        $scope.item.receiveCode = check.receivecode;
+                        $scope.item.receiveName = check.receivename;
+                        $scope.item.sendcode = check.sendcode;
+                        $scope.item.whname = check.whname;
+                        $scope.item.custUserUU = check.custuseruu;
+                        $scope.item.sourceDate = check.pidate
+                        //来源表相关信息
+                        $scope.sourceInfo.sourceid = check.sourceid;
+                        $scope.sourceInfo.sourcetable = check.sourcetable;
+                        $scope.sourceInfo.newYCheckQty = ((check.ycheckqty || 0) + check.thischeckqty);
+
+                        sourceInfos.push($scope.sourceInfo);
+                        $scope.apCheck.items.push($scope.item);
+                        $scope.haveSelected = true;
+                    }
+                });
+            })
             if ($scope.apCheckCondition.$open) {
                 $scope.apCheck.beginDate = $scope.apCheckCondition.dateFrom ? $scope.apCheckCondition.dateFrom.getTime() : null;
                 $scope.apCheck.endDate = $scope.apCheckCondition.dateTo ? $scope.apCheckCondition.dateTo.getTime() : null;

+ 2 - 1
src/main/webapp/resources/tpl/index/approvalFlow/user.html

@@ -387,6 +387,7 @@
 						</td>
 						<td class="text-center"><input ng-model="newUser.userName"
 							class="form-control input-sm" required type="text"
+							maxlength="20"
 							placeholder="用户名"></td>
 						<!--<td class="text-center"><select ng-model="newUser.userSex"-->
 							<!--class="form-control input-sm" ng-init="newUser.userSex='M'" style="width: 80px;">-->
@@ -406,7 +407,7 @@
 						<td class="text-center"
 							ng-class="{'has-error': userEmailError, 'has-success': userEmailSuccess}">
 							<input ng-model="newUser.userEmail" ng-pattern="/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/"
-							name="newUserEmail" class="form-control input-sm" type="text"
+							name="newUserEmail" class="form-control input-sm" type="text" maxlength="50"
 							placeholder="邮箱">
 						</td>
 						<td colspan="2"></td>

+ 1005 - 951
src/main/webapp/resources/tpl/index/fa/apCheck.html

@@ -1,952 +1,1006 @@
-<style>
-	body{
-		font-family: "Microsoft YaHei", "微软雅黑" !important;
-	}
-	.text-num{
-
-	}
-.append{
-	color: #5078cb;font-size:12px; margin-left: 10px
-}
-.order-table td {
-	padding-top: 10px;
-	margin-bottom: 20px;
-	border-bottom: solid 1px #ccc;
-	border-top: solid 1px #e8e8e8;
-}
-
-.order-table td.first {
-	padding-left: 20px;
-}
-
-.order-table td.last {
-	padding-right: 20px;
-}
-
-.order-table td .static p {
-	display: inline-block;
-	line-height: 30px;
-	padding-top: 5px;
-	padding-bottom: 0px;
-	width: 150px;
-	font-size: 14px;
-	color: #666;
-	padding-left: 15px;
-	border-left: solid 1px #e8e8e8;
-}
-	.order-table td .static p:first-child{
-		border-left: none;
-		width: 180px;
-		padding-left: 0;
-	}
-	.order-table td .static p:last-child{
-		margin-left: 22px;
-	}
-	.order-table td .static p:nth-of-type(3){
-		margin-left: 20px;
-	}
-.order-table td .main {
-	margin-top: 5px;
-	margin-bottom: 20px;
-	color: #333;
-}
-.static{
-	margin: 12px 0;
-}
-.order-table td .main strong {
-	font-size: 14px;
-}
-
-.order-table td .static p strong {
-	font-size: 14px;
-	font-weight: bold;
-	color: #888;
-}
-
-.order-table td.status {
-	position: relative;
-	border-left: solid 1px #e8e8e8;
-	padding: 10px;
-	vertical-align: top;
-}
-
-.order-table td.status .operate {
-	position: absolute;
-	display: block;
-	bottom: 0;
-	left: 0;
-	right: 0;
-	height: 0px;
-	color: #ffffff;
-	font-size: 14px;
-	font-weight: bold;
-	line-height: 40px;
-	opacity: 0.8;
-	transition: height ease-in-out 0.5s;
-	text-decoration: none;
-}
-
-.order-table td.status .operate-undo {
-	background: #428bca;
-}
-
-.order-table td.status .operate-done {
-	background: #cccccc;
-}
-
-.order-table td.status:hover  .operate {
-	height: 40px;
-}
-
-.unPrinted {
-    color: #56a022;
-}
-.order-table td .main strong{
-	font-weight: normal;
-}
-.order-table td{
-	font-size: 14px;
-}
-	.order-table th{
-		text-align: center;
-	}
-	.order-table .text-trans{
-		margin-top: -17px;
-		margin-right: 14px;
-	}
-	.menu .new-dot{
-		width: 20px;
-		height: 20px;
-		line-height: 20px;
-		font-size: 12px;
-		color: #fff;
-		font-weight: inherit;
-		top: -2px;
-	}
-	.wui-date.small .wui-date-picker {
-		width: 260px
-	}
-</style>
-<link rel="stylesheet" href="static/css/public.css">
-<link rel="stylesheet" href="static/css/wui.min.css">
-<div class="block" id="public">
- 	<div class="loading in" ng-class="{'in': loading}">
-		<!--<i></i>-->
-		<div class="wrap">
-			<div class="outer"></div>
-		</div>
-	</div>
-	<div class="pub-com_head">
-		<span>应收对账单</span>
-		<!--<div class="p-right">-->
-			<!--<a class="text-simple append" ui-sref="fa.apCheckList" title="新增对账单" ng-hide="showNotCheck"><i class="fa fa-plus-square fa-fw"></i>新增对账单</a>&nbsp;&nbsp;&nbsp;-->
-			<!--<a href="#" ng-click="exportXls()" ng-hide="active === 'all'" target="_self" title="导出Excel表格" class="blue f14"><i class="fa fa-file-text fa-fw"></i>导出</a>-->
-		<!--</div>-->
-
-		<div class="p-right" ng-show="active !== 'all'">
-			<div class="btn-group btn-group-sm"  style="float: right;font-size: 14px;cursor: pointer;text-align: right;height: 40px;line-height: 40px; margin-right: 20px;;color: #fff;"  ng-click="setActive('all')">
-				<img src="static/img/vendor/images/backIcon.png" width="20"/>返回
-			</div>
-		</div>
-		<div class="btn-group btn-group-sm"  style="float: right;font-size: 14px;cursor: pointer;text-align: right;height: 40px;line-height: 40px; margin-right: 20px;;color: #fff;" ng-hide="!showNotCheck" ng-click="hideshowNotCheck()">
-			<img src="static/img/vendor/images/backIcon.png" width="20"/>返回
-			<!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
-
-		</div>
-		<div class="p-right" ng-show="active === 'all'">
-			<div class="btn-group btn-group-sm"  style="    float: right;
-    font-size: 14px;
-    cursor: pointer;
-    text-align: right;
-    height: 28px;
-    line-height: 27px;
-    margin-right: 20px;
-    color: #fff;
-    border: 1px solid #fff;
-    margin-top: 3px;
-    padding: 0 5px;"  ng-click="setActive();changeDateZone(1, true);condition.$open=false;showNotCheck=false">查看对账记录
-				<!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
-			</div>
-		</div>
-	</div>
-	<!--<div class="menu condition block">-->
-		<!--<div class="row">-->
-			<!--<div class="col-xs-7">-->
-				<!--<div class="btn-group btn-group-sm btn-group-justified">-->
-					<!--<div class="btn-group btn-group-sm/fa/arCheck">-->
-						<!--<button type="button" class="btn btn-default btn-line"-->
-							<!--ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">未对账</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>-->
-					<!--</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')">已对账-->
-							<!--<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=='end'}" ng-click="setActive('end')">已作废-->
-							<!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
-						<!--</button>-->
-					<!--</div>-->
-
-					<!--<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')">全部</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')">已确认-->
-					<!--<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>-->
-					<!--</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')">已作废-->
-					<!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
-					<!--</button>-->
-					<!--</div>-->
-				<!--</div>-->
-			<!--</div>-->
-			<!--<div class="col-xs-12 f12" style="text-align: right;height: 40px;line-height: 40px; margin-right: 20px; float: right;">-->
-				<!--<div class="btn-group btn-group-sm"  style="float: right;font-size: 14px;cursor: pointer;" ng-hide="!showNotCheck" ng-click="hideshowNotCheck()">-->
-					<!--<img src="static/img/vendor/images/backIcon.png" width="20"/>返回-->
-					<!--&lt;!&ndash;<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>&ndash;&gt;-->
-
-				<!--</div>-->
-			<!--</div>-->
-		<!--</div>-->
-	<!--</div>-->
-
-	<div ng-hide="showNotCheck">
-		<div class="condition block"  ng-show="!showNotCheck">
-			<div class="search-bg condition block" style="padding: 10px 15px;">
-				<div class="row">
-					<div id="topSearch" ng-show="active !== 'all'" style="float: left">
-						<a ng-click="changeDateZone(1);condition.$open=false" title="最近一个月" ng-class="{'active':condition.dateZone=='1'}">最近一个月</a>
-						<a ng-click="changeDateZone(3);condition.$open=false" title="最近三个月" ng-class="{'active':condition.dateZone=='3'}">最近三个月</a>
-						<a ng-click="changeDateZone(6);condition.$open=false" title="最近六个月" ng-class="{'active':condition.dateZone=='6'}">最近六个月</a>
-						<a ng-click="condition.$open=!condition.$open;changeDateZone(-1)" title="自定义" ng-class="{'active':condition.dateZone=='-1'}" >自定义</a>
-					</div>
-					<div  style="float: left" ng-show="active === 'all'" >
-						<div style="width: 355px;display: inline-block">
-						<label class="control-label">请选择月份:</label>
-						<span ng-click="addMouthOut(-1)" style="display: inline-block;
-							width: 32px;
-							height: 32px;
-							border: 1px solid #ddd;
-							text-align: center;
-							line-height: 32px;
-							cursor: pointer;
-							vertical-align: middle;">
-							<img src="static/img/vendor/images/arrow-left-d-l.png" width="24"/>
-						</span>
-						<span class="inputsIcon control-label" style="padding-right: 0px;display: inline-block;vertical-align: top;">
-						  <wui-date
-								  format="yyyy-mm"
-								  placeholder="请选择或输入日期"
-								  id="date3"
-								  btns="{'ok':'确定','now':'此刻'}"
-								  ng-model="thisMouthOut"
-						  >
-						  </wui-date>
-						</span>
-                        <span ng-show="MouthOutShow"  ng-click="addMouthOut(1)" style="display: inline-block;
-							width: 32px;
-							height: 32px;
-							border: 1px solid #ddd;
-							text-align: center;
-							line-height: 32px;
-							cursor: pointer;
-							vertical-align: middle;"><img src="static/img/vendor/images/arrow-right-d-l.png" width="24"/></span>
-						</div>
-						<a ng-click="condition.$open=!condition.$open;changeDateZone(1)" title="自定义" ng-class="{'active':condition.dateZone=='-1'}" style="margin-left: 10px;display: inline-block;padding: 7px 12px;background: #3f84f6;color: #fff" >自定义</a>
-						<div class="more-list more" ng-class="{'open': condition.$open}" ng-if="active === 'all'">
-							<form class="form-inline">
-								<div class="form-group ">
-									<label>日期:</label>
-									<div class="form-group input-group input-group-xs input-trigger">
-										<input type="text" ng-model="condition.dateFrom"
-											   class="form-control" placeholder="从"
-											   datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
-											   ng-required="true" max-date = "condition.dateTo"
-											   current-text="今天" clear-text="清除" close-text="关闭"
-											   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-											   ng-focus="openFilterDatePicker($event, condition, '$fromOpened')">
-										<span class="input-group-btn">
-											<button type="button" class="btn btn-default"
-													ng-click="openFilterDatePicker($event, condition, '$fromOpened')">
-												<i class="fa fa-calendar"></i>
-											</button>
-										</span>
-									</div>
-									<div class="form-group input-group input-group-xs input-trigger">
-										<input type="text" ng-model="condition.dateTo"
-											   class="form-control" placeholder="到"
-											   datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
-											   ng-required="true" min-date = "condition.dateFrom"
-											   current-text="今天" clear-text="清除" close-text="关闭"
-											   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-											   ng-focus="openFilterDatePicker($event, condition, '$toOpened')">
-										<span class="input-group-btn">
-											<button type="button" class="btn btn-default"
-													ng-click="openFilterDatePicker($event, condition, '$toOpened')">
-												<i class="fa fa-calendar"></i>
-											</button>
-										</span>
-									</div>
-								</div>
-							</form>
-						</div>
-					</div>
-					<div class="col-xs-6" style="float: right;">
-						<div class="search">
-							<div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick"
-								 on-toggle="searchAdvance=open">
-								<input type="search" class="form-control input-sm" ng-model="keyword"
-									   ng-search="onSearch(keyword)" placeholder="输入单据编号、客户名称、物料名称搜索" style="width: 100%" ng-show="active !== 'all'"/>
-								<a class="btn input-group-addon" href="javascript:void(0)" ng-click="onSearch(keyword)" ng-show="active !== 'all'">搜索</a>
-
-								<input type="search" class="form-control input-sm" ng-model="keyword" ng-search="onSearch(keyword)" placeholder="客户名称" style="width: 100%" ng-show="active === 'all' && !showNotCheck" />
-								<a class="btn input-group-addon" ng-click="onSearch(keyword)" ng-show="active === 'all' && !showNotCheck">搜索</a>
-							</div>
-						</div>
-					</div>
-				</div>
-				<div class="more-list more" ng-class="{'open': condition.$open}" ng-if="active !== 'all'">
-					<form class="form-inline">
-						<div class="form-group ">
-							<label>日期:</label>
-							<div class="btn-group btn-menu" dropdown is-open="condition.$dateZoneOpen">
-								<ul class="dropdown-menu">
-									<li><a ng-click="changeDateZone(1)">一个月内</a></li>
-									<li><a ng-click="changeDateZone(6)">半年内</a></li>
-									<li><a ng-click="changeDateZone()">半年前</a></li>
-								</ul>
-							</div>
-							<div class="form-group input-group input-group-xs input-trigger">
-								<input type="text" ng-model="condition.dateFrom"
-									   class="form-control" placeholder="从"
-									   datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
-									   ng-required="true" max-date = "condition.dateTo"
-									   current-text="今天" clear-text="清除" close-text="关闭"
-									   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-									   ng-focus="openFilterDatePicker($event, condition, '$fromOpened')">
-								<span class="input-group-btn">
-								<button type="button" class="btn btn-default"
-										ng-click="openFilterDatePicker($event, condition, '$fromOpened')">
-									<i class="fa fa-calendar"></i>
-								</button>
-							</span>
-							</div>
-							<div class="form-group input-group input-group-xs input-trigger">
-								<input type="text" ng-model="condition.dateTo"
-									   class="form-control" placeholder="到"
-									   datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
-									   ng-required="true" min-date = "condition.dateFrom"
-									   current-text="今天" clear-text="清除" close-text="关闭"
-									   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-									   ng-focus="openFilterDatePicker($event, condition, '$toOpened')">
-								<span class="input-group-btn">
-							<button type="button" class="btn btn-default"
-									ng-click="openFilterDatePicker($event, condition, '$toOpened')">
-								<i class="fa fa-calendar"></i>
-							</button>
-						</span>
-							</div>
-						</div>
-					</form>
-				</div>
-			</div>
-		</div>
-		<div ng-if="active === 'all'">
-			<table class="order-table block order-table2" ng-table="tableParams" width="100%" style="table-layout:fixed">
-				<thead>
-					<tr class="header">
-						<th width="180">客户名称</th>
-						<th width="140">本期应收</th>
-						<th width="140">本期未对账</th>
-						<th width="140">本期已对账</th>
-						<!--<th width="140">本月已收</th>-->
-						<th width="140">应收总额</th>
-						<th width="80">操作</th>
-					</tr>
-				</thead>
-				<tbody ng-repeat="check in ALLList">
-				<tr >
-					<td style="color: #3f84f6">{{::check.myEnterprise.enName}}</td>
-					<td ng-if="check.thisMonthCount.length > 0">
-						<div ng-repeat="count in check.thisMonthCount">
-							<span>{{count.currency}}:{{count.amount | number:2}}</span>
-						</div>
-					</td>
-					<td ng-if="check.thisMonthCount.length === 0">-</td>
-
-					<td ng-if="check.thisMonthTodoCount.length > 0">
-						<div ng-repeat="count in check.thisMonthTodoCount">
-							<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>
-						</div>
-					</td>
-					<td ng-if="check.thisMonthTodoCount.length === 0">-</td>
-
-					<td ng-if="check.thisMonthDoneCount.length > 0">
-						<div ng-repeat="count in check.thisMonthDoneCount">
-							<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>
-						</div>
-					</td>
-					<td ng-if="check.thisMonthDoneCount.length === 0">-</td>
-
-					<!--<td ng-if="check.apCheckAmounts.length > 0">-->
-						<!--<div ng-repeat="count in check.apCheckAmounts">-->
-							<!--<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>-->
-						<!--</div>-->
-					<!--</td>-->
-					<!--<td ng-if="check.apCheckAmounts.length === 0">-</td>-->
-
-					<td ng-if="check.totalCount.length > 0">
-						<div ng-repeat="count in check.totalCount">
-							<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>
-						</div>
-					</td>
-					<td ng-if="check.totalCount.length === 0">-</td>
-
-					<td style="color: #3f84f6;cursor: pointer" ng-click="goToMNs(check)">明细</td>
-				</tr>
-				</tbody>
-				<tbody ng-if="!ALLList || ALLList.length == 0">
-				<tr>
-					<td colspan="6">
-						<div id="empty">
-							<div class="left_img">
-								<a><img src="static/img/empty/uas_empty.png"></a>
-								<a>B2B 商务</a>
-							</div>
-							<div class="right_link">
-								<!--<p ng-if="active != 'all'">您还未生成对账单,请立即新增对账!</p>-->
-								<!--<a ng-if="active != 'all'" ui-sref="fa.apCheckList"><i class="fa fa-plus-square fa-fw"></i> 新增对账单</a>-->
-							</div>
-						</div>
-					</td>
-				</tr>
-				</tbody>
-			</table>
-		</div>
-		<div ng-if="active !== 'all'">
-			<table class="order-table block" ng-table="tableParams">
-				<thead>
-					<tr class="header">
-						<th width="150">对账期间</th>
-						<th width="180">对账总额</th>
-						<th width="180">对账人</th>
-						<!--<th width="180">商品总数</th>-->
-						<th width="100">对账结果</th>
-						<th width="100">操作</th>
-					</tr>
-				</thead>
-				<tbody ng-repeat="check in $data">
-					<tr>
-						<td class="first info" colspan="3">
-							<div class="">
-								<a href="javascript:void(0)" ng-if="!isUnread(check.id)">
-									<i class="fa fa-circle-thin"></i>
-								</a>
-								<a href="javascript:void(0)" ng-if="isUnread(check.id)">
-									<i class="fa fa-circle" style="color: #f40;"></i>
-								</a>&nbsp;&nbsp;
-								<span class="text-num" title="录单时间">{{::check.recordDate | date:'MM月dd日 HH:mm'}} <i class="fa fa-clock-o"></i></span>&nbsp;&nbsp;&nbsp;
-								<span><i class="fa fa-star" ng-class="{'text-default':check.status==201}"></i> {{::check.custName}}</span>
-								<span style="margin-left: 100px;">单据编号:</span>
-								<span class="text-num"><a ui-sref="fa.apCheck_detail({id:check.id})" title="点击查看详情" ng-click="setOrdersRead(check.id)" style="color: #5078cb">{{::check.code}}</a></span>
-							</div>
-							<div class="static">
-								<p><span class="f14 text-num">{{::check.beginDate | date:'yyyy/MM/dd'}} - {{::check.endDate | date:'yyyy/MM/dd'}}</span></p>
-								<p>
-									<strong class="text-num">{{::(isUser?'-':(check.checkAmount | number:2))}}</strong>
-									<span ng-if="!isUser" class="text-number">{{::check.currency}}</span>
-								</p>
-								<p style="text-align: center;margin-left: 65px">
-									对账人:{{::check.recorder}}
-								</p>
-								<!--<p>-->
-									<!--<strong class="text-num">{{::check.items.length}}</strong> 条<br>-->
-								<!--</p>-->
-								<!--<p>-->
-									<!--<strong class="text-num">{{getTotalProd(check) | number}}</strong> <i class="fa fa-cubes"></i>-->
-								<!--</p>-->
-							</div>
-						</td>
-
-						<td class="status">
-							<!--<div ng-if="check.checkStatus == '未对账'" class="text-center text-muted f14"><br>未对账!</div>-->
-							<div></div>
-							<div ng-if="check.checkStatus == '已确认'" class="text-center text-muted f14">
-								<br> <i class="fa fa-check-square-o"></i> 已确认
-							</div>
-							<div ng-if="check.checkStatus == '不同意'" class="text-center text-muted f14">
-								<br> <i class="fa fa-check-square-o"></i> 不同意
-							</div>
-							<div ng-if="check.checkStatus == '已作废'" class="text-center text-muted f14">
-								<br> <i class="fa fa-check-square-o"></i> 已作废
-							</div>
-						</td>
-						<td>
-							<div ng-hide="check.status" class="block">
-								 <span class="text-trans error">未提交</span>
-							</div>
-							<div ng-show="check.status" class="block">
-								 <span class="text-trans success">已提交</span>
-							</div>
-							<div ng-if="check.checkStatus == '未对账'" class="text-center text-muted f14">
-								<div class="" style="margin-top: 33px;margin-right: 20px;">
-									<div class="pull-right" title="等待客户确认"><a>&nbsp;客户正在确认</a></div>
-								</div>
-							</div>
-							<div ng-if="check.checkStatus == '不同意'" class="text-center text-muted f14">
-								<div class="" style="margin-top: 33px;margin-right: 20px;">
-									<div class="pull-right" title="客户不同意"><a>&nbsp;客户不同意</a></div>
-								</div>
-							</div>
-							<div ng-if="check.checkStatus == '已确认'" class="text-center text-muted f14">
-								<div class="" style="margin-top: 33px;margin-right: 20px;">
-									<a ng-click="print(check)" class="pull-right" title="打印{{check.print? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !check.print, 'text-muted': check.print}"><i class="fa fa-print fa-lg"></i>&nbsp;打印</a>
-								</div>
-							</div>
-							<!-- <a ui-sref="fa.apCheck_detail({id:check.id})" class="operate operate-undo text-center"
-								 target="_blank">查看详情</a>	 -->
-						</td>
-					</tr>
-				</tbody>
-				<tbody ng-if="tableParams.total() == 0">
-				<tr>
-					<td colspan="5">
-						<div id="empty">
-							<div class="left_img">
-								<a><img src="static/img/empty/uas_empty.png"></a>
-								<a>B2B 商务</a>
-							</div>
-							<div class="right_link">
-								<!--<p ng-if="active != 'all'">您还未生成对账单,请立即新增对账!</p>-->
-								<!--<a ng-if="active != 'all'" ui-sref="fa.apCheckList"><i class="fa fa-plus-square fa-fw"></i> 新增对账单</a>-->
-							</div>
-						</div>
-					</td>
-				</tr>
-				</tbody>
-			</table>
-		</div>
-	</div>
-	<div ng-hide="!showNotCheck" class="infoms add-apCheckList"  >
-		<form class="form-horizontal"
-			  style="padding-top: 10px; padding-bottom: 20px;">
-			<div class="form-group form-group-sm form-group-inline">
-				<div  class="col-sm-6 control-label">
-					<div style="text-align: left">
-						<label>应收客户:</label>
-						<label style="text-align:left">
-							{{suuorname}}
-						</label>
-					</div>
-					<div style="text-align: left;margin-top: 20px">
-						<label>本期应收:</label>
-						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthCount.length > 0" ng-repeat="count in dataInfo.thisMonthCount">
-								<span>{{count.currency}}:{{count.amount | number:2}}</span>
-							</div>
-							<div ng-if="dataInfo.thisMonthCount.length === 0">
-								0
-							</div>
-						</label>
-					</div>
-					<div style="text-align: left;margin-top: 20px">
-						<label>本期未对账:</label>
-						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
-								<span>{{count.currency}}:{{count.amount | number:2}}</span>
-							</div>
-							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
-								0
-							</div>
-						</label>
-					</div>
-					<div style="text-align: left;margin-top: 20px">
-						<label>本期已对账:</label>
-						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
-								<span>{{count.currency}}:{{count.amount | number:2}}</span>
-							</div>
-							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
-								0
-							</div>
-						</label>
-					</div>
-
-					<!--<div style="text-align: left;margin-top: 20px">-->
-						<!--<label>本期间已收总额:</label>-->
-						<!--<label style="text-align:left;vertical-align: top;">-->
-							<!--<div ng-if="dataInfo.apCheckAmounts.length > 0" ng-repeat="count in dataInfo.apCheckAmounts">-->
-								<!--<span>{{count.currency}}:{{count.amount | number:2}}</span>-->
-							<!--</div>-->
-							<!--<div ng-if="dataInfo.apCheckAmounts.length === 0">-->
-								<!--0-->
-							<!--</div>-->
-						<!--</label>-->
-					<!--</div>-->
-
-					<div style="text-align: left;margin-top: 20px">
-						<label>应收总额:</label>
-						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.totalCount.length > 0" ng-repeat="count in dataInfo.totalCount">
-								<span>{{count.currency }}:{{count.amount | number:2}}</span>
-							</div>
-							<div ng-if="dataInfo.totalCount.length === 0">
-								0
-							</div>
-						</label>
-					</div>
-				</div>
-				<div  class="col-sm-6 control-label condition">
-					<div>
-						<label class="control-label">请选择月份:</label>
-						<span ng-click="addMouth(-1)" style="display: inline-block;
-							width: 32px;
-							height: 32px;
-							border: 1px solid #ddd;
-							text-align: center;
-							line-height: 32px;
-							cursor: pointer;
-							vertical-align: middle;">
-							<img src="static/img/vendor/images/arrow-left-d-l.png" width="24"/>
-						</span>
-						<span class="control-label" style="padding-right: 5px;display: inline-block;vertical-align: middle;padding-top: 0;" ng-click="apCheckCondition.$open = false">
-							<wui-date
-								  format="yyyy-mm"
-								  placeholder="请选择或输入日期"
-								  id="date4"
-								  btns="{'ok':'确定','now':'此刻'}"
-								  ng-model="thisMouth"
-						  >
-						</wui-date>
-						</span><span ng-show="MouthinShow" ng-click="addMouth(1)" style="display: inline-block;
-							width: 32px;
-							height: 32px;
-							border: 1px solid #ddd;
-							text-align: center;
-							line-height: 32px;
-							cursor: pointer;
-							vertical-align: middle;">
-						<img src="static/img/vendor/images/arrow-right-d-l.png" width="24"/></span>
-						<label class="control-label com-check-radio" ng-click="apCheckCondition.$open = true" style="vertical-align: middle;padding-top: 0">
-							<input type="radio" name="psa" ng-checked="apCheckCondition.$open === true"  ng-model="apCheckCondition.$open" style="vertical-align: middle">自定义
-						</label>
-					</div>
-					<div ng-hide="!apCheckCondition.$open" class="more open date fr apCheckCondition" style="margin-top: 14px;">
-						<div class="form-inline">
-							<div class="form-group">
-								<div class="form-group input-group input-group-xs input-trigger">
-									<input type="text" ng-model="apCheckCondition.dateFrom"
-										   class="form-control" placeholder="从"
-										   datepicker-popup="yyyy-MM-dd" is-open="apCheckCondition.$fromOpened"
-										   ng-required="true" max-date = "apCheckCondition.dateTo"
-										   current-text="今天" clear-text="清除" close-text="关闭"
-										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-										   ng-focus="apCheckopenFilterDatePicker($event, apCheckCondition, '$fromOpened')"
-									style="height: 26px">
-									<span class="input-group-btn">
-									<button type="button" class="btn btn-default"
-											ng-click="apCheckopenFilterDatePicker($event, apCheckCondition, '$fromOpened')">
-										<i class="fa fa-calendar"></i>
-									</button>
-									</span>
-								</div>
-								<em style="margin: 0 10px;display: inline-block">–</em>
-								<div class="form-group input-group input-group-xs input-trigger">
-									<input type="text" ng-model="apCheckCondition.dateTo"
-													   class="form-control" placeholder="到"
-													   datepicker-popup="yyyy-MM-dd" is-open="apCheckCondition.$toOpened"
-													   ng-required="true" min-date = "apCheckCondition.dateFrom"
-													   current-text="今天" clear-text="清除" close-text="关闭"
-													   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-													   ng-focus="apCheckopenFilterDatePicker($event, apCheckCondition, '$toOpened')" style="height: 26px">
-									<span class="input-group-btn">
-										<button type="button" class="btn btn-default"
-												ng-click="apCheckopenFilterDatePicker($event, apCheckCondition, '$toOpened')">
-											<i class="fa fa-calendar"></i>
-										</button>
-									</span>
-								</div>
-							</div>
-						</div>
-
-					</div>
-				</div>
-			</div>
-			<div class="form-group form-group-sm form-group-inline">
-				<div class="col-sm-12 text-right">
-					<a ng-click="condition.$open2=!condition.$open2" class="text-simple"><span
-							ng-bind="condition.$open2 ? '收起筛选条件' : '更多筛选条件'"></span><i
-							class="fa fa-fw"
-							ng-class="{'fa-angle-up': condition.$open2, 'fa-angle-down': !condition.$open2}"></i></a>
-					<div class="btn-group btn-group-sm">
-						<a class="btn btn-default" ng-click="searchOrder()" title="筛选"><i class="fa fa-search fa-fw btn-icon-left"></i>筛选</a>
-						<a class="btn btn-default" ng-click="createApCheck(check.$selected)" ng-disabled="!data || data.length==0"><i class="fa fa-check-circle-o fa-fw btn-icon-left"></i>确认对账</a>
-						<a class="btn btn-default" ng-click="exportApcheckList()" title="导出Excel" ng-disabled="!data || data.length==0"><i class="fa fa-file-text fa-fw btn-icon-left"></i>导出</a>
-					</div>
-				</div>
-			</div>
-			<div class="form-group form-group-sm form-group-inline"
-				 ng-show="condition.$open2">
-				<!--<label class="col-sm-2 control-label">应付供应商:</label>-->
-				<!--<div class="col-sm-4">-->
-					<!--<div class="form-group form-group-sm has-feedback">-->
-						<!--<input type="search" class="form-control input-sm"-->
-							   <!--ng-model="receiveName" placeholder="可用应付供应商名称筛选" /><span-->
-							<!--class="form-control-feedback text-simple"><i-->
-							<!--class="fa fa-search"></i></span>-->
-					<!--</div>-->
-				<!--</div>-->
-				<label class="col-sm-2 control-label">送货工厂:</label>
-				<div class="col-sm-4">
-					<div class="form-group form-group-sm has-feedback">
-						<input type="search" class="form-control input-sm"
-							   ng-model="factory" placeholder="请输入送货工厂名称" /><span
-							class="form-control-feedback text-simple"><i
-							class="fa fa-search"></i></span>
-					</div>
-				</div>
-                <label class="col-sm-2 control-label">税&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label>
-                <div class="col-sm-4">
-                    <div class="form-group form-group-sm has-feedback">
-                        <input type="search" class="form-control input-sm"
-                               ng-model="taxRate" placeholder="请输入税率" /><span
-                            class="form-control-feedback text-simple"><i
-                            class="fa fa-search"></i></span>
-                    </div>
-                </div>
-			</div>
-			<div class="form-group form-group-sm form-group-inline"
-				 ng-show="condition.$open2">
-				<label class="col-sm-2 control-label">物料名称:</label>
-				<div class="col-sm-4">
-					<div class="form-group form-group-sm has-feedback">
-						<input type="search" class="form-control input-sm"
-							   ng-model="prodTitle" placeholder="请输入物料名称" /><span
-							class="form-control-feedback text-simple"><i
-							class="fa fa-search"></i></span>
-					</div>
-				</div>
-				<label class="col-sm-2 control-label">规&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格:</label>
-				<div class="col-sm-4">
-					<div class="form-group form-group-sm has-feedback">
-						<input type="search" class="form-control input-sm"
-							   ng-model="prodSpec" placeholder="请输入物料规格" /><span
-							class="form-control-feedback text-simple"><i
-							class="fa fa-search"></i></span>
-					</div>
-				</div>
-			</div>
-			<!--<div class="form-group form-group-sm form-group-inline"-->
-				 <!--ng-show="condition.$open">-->
-
-			<!--</div>-->
-		</form>
-		<!-- 标签scroll-table用于表头滚动 -->
-		<div class="table-wrap" id="order-detail-list" scroll-table>
-			<div class="table-header-wrap">
-				<table class="table table-bordered">
-					<tr>
-						<th width="55" style="vertical-align: middle;">
-							<input type="checkbox" name="checkbox" ng-model="checkboxes.checked" ng-click="checkAll()">
-						</th>
-						<!--<th width="70">客户<br>名称</th>-->
-						<th width="70">采购单</th>
-						<th width="60">发货单</th>
-						<th width="90">单据日期</th>
-						<th width="60">验收单</th>
-						<th width="70">物料编号</th>
-						<th width="70">物料名称</th>
-						<th width="70">规格型号</th>
-						<!--<th width="60">发货单</th>-->
-						<th width="55">发货数量</th>
-						<th width="100">验收数量</th>
-						<th width="40">单价</th>
-						<th width="40">税率</th>
-						<th width="70">小计</th>
-						<th width="110">
-							对账人<br />/日期
-						</th>
-						<!--<th width="35">序号</th>-->
-						<!--<th width="60">类型</th>-->
-						<!--<th width="60">单据<br>日期</th>-->
-						<!--<th width="90">应付<br>供应商</th>-->
-						<!--<th width="65">客户<br>料号</th>-->
-						<!--<th width="65">送货<br>工厂</th>-->
-						<!--<th width="30">币别</th>-->
-						<!--<th width="60">金额</th>-->
-					</tr>
-				</table>
-			</div>
-			<div class="table-body-wrap">
-				<table class="table table-bordered">
-						<tr ng-repeat="check in data" ng-click="checkOne(check);getTotalMoney()" class="thAlign" style="height: 40px;">
-						<td width="55" style="text-align: center;vertical-align: middle;">
-							<input ng-model="check.$selected" name="checkbox" type="checkbox" ng-checked="check.$selected" ng-click="stopPrevent($event)" ng-if="check.haveChecked !== 1">
-							<span ng-if="check.haveChecked === 1">已对账</span>
-						</td>
-						<td width="70">{{::check.ordercode}}</td>
-							<td width="60">{{::check.sendcode}}</td>
-							<td width="90">{{::check.pidate | date:'yyyy年MM月dd日'  || '-'}}</td>
-							<td width="60">{{::check.inoutno}}</td>
-							<td width="70">{{::check.prodcode}}</td>
-						<td width="70" title="{{check.prodtitle}}">
-							<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::check.prodtitle}}</div>
-						</td>
-						<td width="70" title="{{check.prodspec}}">
-							<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::check.prodspec}}</div></td>
-
-						<td width="55">{{::check.qty}}</td>
-
-						<td width="100">{{::check.thischeckqty}}</td>
-						<td width="40">{{::check.orderprice}}</td>
-						<td width="40" align="center">{{::check.taxrate}}</td>
-						<td width="70">{{::(check.orderprice || 0)*(check.thischeckqty || 0) | number:2}}</td>
-							<td width="110" ng-if="check.haveChecked === 1">
-								<div>{{::check.recorder || '-'}}</div>
-								<div>{{::check.apCheckDate | date:'yyyy年MM月dd日'  || '-'}}</div>
-							</td>
-							<td width="110" ng-if="check.haveChecked !== 1">
-								未对账
-							</td>
-						<!--<td width="70" title="{{check.custname}}"><div-->
-						<!--style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::check.custname}}</div></td>-->
-						<!--<td width="35" align="center">{{::check.detno}}</td>-->
-						<!--<td width="60">{{::check.piclass}}</td>-->
-						<!--<td width="60">{{::check.pidate | date:'yyyy-MM-dd' }}</td>-->
-						<!--<td width="90" title="{{check.receivename}}">-->
-						<!--<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::check.receivename}}</div>-->
-						<!--</td>-->
-						<!--<td width="65">{{::check.prodcode}}</td>-->
-						<!--<td width="65">{{::check.factory}}</td>-->
-						<!--<td width="30">{{::check.currency}}</td>-->
-						<!--<td width="60">{{::(check.qty || 0)*(check.orderprice || 0) | number:2}}</td>-->
-
-					</tr>
-					<tr ng-if="!data || data.length==0">
-						<td colspan="11">
-							<div class="empty-block">
-								<i class="fa fa-exclamation-circle"></i>
-								<p class="text-muted">没有对账数据,请先筛选</p>
-							</div>
-						</td>
-					</tr>
-				</table>
-			</div>
-			<div style="padding: 10px 20px">本期间应收总额:{{totalMoney | number:2 || 0}}</div>
-		</div>
-	</div>
-</div>
-<style>
-	.order-table2 tbody td {
-		text-align: center;
-		padding: 20px 0
-	}
-</style>
-<style>
-	.wui-date-picker.left {
-		margin-right : 0 !important;
-		right: 0;
-		left: auto
-	}
-	.add-apCheckList {
-		background: #fff
-	}
-
-	.add-apCheckList input[type="checkbox"] {
-		/*width: 16px;
-        height: 16px*/
-	}
-
-	.add-apCheckList .table-wrap {
-		overflow: hidden
-	}
-
-	.add-apCheckList .table-header-wrap {
-		background: #f9f9f9;
-		overflow-x: hidden;
-		overflow-y: scroll;
-	}
-
-	.add-apCheckList .table-header-wrap table,.add-apCheckList .table-body-wrap table
-	{
-		width: 100%;
-		table-layout: fixed;
-		border-collapse: collapse;
-		border-spacing: 0;
-		margin-bottom: 0
-	}
-
-	.add-apCheckList .table-header-wrap th {
-		text-align: center;
-	}
-
-	.add-apCheckList .table-body-wrap {
-		max-height: 600px;
-		overflow-x: auto;
-		overflow-y: scroll;
-	}
-
-	.add-apCheckList td {
-		word-break: break-all;
-		text-align: center;
-	}
-
-	.add-apCheckList tbody {
-		overflow: auto;
-	}
-
-	#order-detail-list .input-sm {
-		border: #ccc 1px solid;
-	}
-
-	.infoms .has-feedback input[type="search"] {
-		padding-right: 0 !important;
-	}
-	.infoms .table>tbody>tr>td{
-		vertical-align: middle;
-	}
-	.infoms .form-horizontal .form-group-sm .control-label{
-		font-size: 14px;
-	}
-	.infoms .form-group .form-control{
-		font-size: 14px;
-	}
-	.wui-date.small .wui-date-picker {
-		width: 260px
-	}
-
-    .wui-input {
-        border: 1px solid #3f84f6;
-        font-size: 14px;
-        color: #3f84f6;
-        font-weight: bold;
-    }
-    .wui-date-editor .iconfont {
-        color: #3f84f6
-    }
-
-	.apCheckCondition ul {
-		left: auto !important;
-		right: 0;
-	}
+<style>
+	body{
+		font-family: "Microsoft YaHei", "微软雅黑" !important;
+	}
+	.text-num{
+
+	}
+.append{
+	color: #5078cb;font-size:12px; margin-left: 10px
+}
+.order-table td {
+	padding-top: 10px;
+	margin-bottom: 20px;
+	border-bottom: solid 1px #ccc;
+	border-top: solid 1px #e8e8e8;
+}
+
+.order-table td.first {
+	padding-left: 20px;
+}
+
+.order-table td.last {
+	padding-right: 20px;
+}
+
+.order-table td .static p {
+	display: inline-block;
+	line-height: 30px;
+	padding-top: 5px;
+	padding-bottom: 0px;
+	width: 150px;
+	font-size: 14px;
+	color: #666;
+	padding-left: 15px;
+	border-left: solid 1px #e8e8e8;
+}
+	.order-table td .static p:first-child{
+		border-left: none;
+		width: 180px;
+		padding-left: 0;
+	}
+	.order-table td .static p:last-child{
+		margin-left: 22px;
+	}
+	.order-table td .static p:nth-of-type(3){
+		margin-left: 20px;
+	}
+.order-table td .main {
+	margin-top: 5px;
+	margin-bottom: 20px;
+	color: #333;
+}
+.static{
+	margin: 12px 0;
+}
+.order-table td .main strong {
+	font-size: 14px;
+}
+
+.order-table td .static p strong {
+	font-size: 14px;
+	font-weight: bold;
+	color: #888;
+}
+
+.order-table td.status {
+	position: relative;
+	border-left: solid 1px #e8e8e8;
+	padding: 10px;
+	vertical-align: top;
+}
+
+.order-table td.status .operate {
+	position: absolute;
+	display: block;
+	bottom: 0;
+	left: 0;
+	right: 0;
+	height: 0px;
+	color: #ffffff;
+	font-size: 14px;
+	font-weight: bold;
+	line-height: 40px;
+	opacity: 0.8;
+	transition: height ease-in-out 0.5s;
+	text-decoration: none;
+}
+
+.order-table td.status .operate-undo {
+	background: #428bca;
+}
+
+.order-table td.status .operate-done {
+	background: #cccccc;
+}
+
+.order-table td.status:hover  .operate {
+	height: 40px;
+}
+
+.unPrinted {
+    color: #56a022;
+}
+.order-table td .main strong{
+	font-weight: normal;
+}
+.order-table td{
+	font-size: 14px;
+}
+	.order-table th{
+		text-align: center;
+	}
+	.order-table .text-trans{
+		margin-top: -17px;
+		margin-right: 14px;
+	}
+	.menu .new-dot{
+		width: 20px;
+		height: 20px;
+		line-height: 20px;
+		font-size: 12px;
+		color: #fff;
+		font-weight: inherit;
+		top: -2px;
+	}
+	.wui-date.small .wui-date-picker {
+		width: 260px
+	}
+</style>
+<link rel="stylesheet" href="static/css/public.css">
+<link rel="stylesheet" href="static/css/wui.min.css">
+<div class="block" id="public">
+ 	<div class="loading in" ng-class="{'in': loading}">
+		<!--<i></i>-->
+		<div class="wrap">
+			<div class="outer"></div>
+		</div>
+	</div>
+	<div class="pub-com_head">
+		<span>应收对账单</span>
+		<!--<div class="p-right">-->
+			<!--<a class="text-simple append" ui-sref="fa.apCheckList" title="新增对账单" ng-hide="showNotCheck"><i class="fa fa-plus-square fa-fw"></i>新增对账单</a>&nbsp;&nbsp;&nbsp;-->
+			<!--<a href="#" ng-click="exportXls()" ng-hide="active === 'all'" target="_self" title="导出Excel表格" class="blue f14"><i class="fa fa-file-text fa-fw"></i>导出</a>-->
+		<!--</div>-->
+
+		<div class="p-right" ng-show="active !== 'all'">
+			<div class="btn-group btn-group-sm"  style="float: right;font-size: 14px;cursor: pointer;text-align: right;height: 40px;line-height: 40px; margin-right: 20px;;color: #fff;"  ng-click="setActive('all')">
+				<img src="static/img/vendor/images/backIcon.png" width="20"/>返回
+			</div>
+		</div>
+		<div class="btn-group btn-group-sm"  style="float: right;font-size: 14px;cursor: pointer;text-align: right;height: 40px;line-height: 40px; margin-right: 20px;;color: #fff;" ng-hide="!showNotCheck" ng-click="hideshowNotCheck()">
+			<img src="static/img/vendor/images/backIcon.png" width="20"/>返回
+			<!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
+
+		</div>
+		<div class="p-right" ng-show="active === 'all'">
+			<div class="btn-group btn-group-sm"  style="    float: right;
+    font-size: 14px;
+    cursor: pointer;
+    text-align: right;
+    height: 28px;
+    line-height: 27px;
+    margin-right: 20px;
+    color: #fff;
+    border: 1px solid #fff;
+    margin-top: 3px;
+    padding: 0 5px;"  ng-click="setActive();changeDateZone(1, true);condition.$open=false;showNotCheck=false">查看对账记录
+				<!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
+			</div>
+		</div>
+	</div>
+	<!--<div class="menu condition block">-->
+		<!--<div class="row">-->
+			<!--<div class="col-xs-7">-->
+				<!--<div class="btn-group btn-group-sm btn-group-justified">-->
+					<!--<div class="btn-group btn-group-sm/fa/arCheck">-->
+						<!--<button type="button" class="btn btn-default btn-line"-->
+							<!--ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">未对账</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>-->
+					<!--</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')">已对账-->
+							<!--<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=='end'}" ng-click="setActive('end')">已作废-->
+							<!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
+						<!--</button>-->
+					<!--</div>-->
+
+					<!--<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')">全部</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')">已确认-->
+					<!--<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>-->
+					<!--</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')">已作废-->
+					<!--<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>-->
+					<!--</button>-->
+					<!--</div>-->
+				<!--</div>-->
+			<!--</div>-->
+			<!--<div class="col-xs-12 f12" style="text-align: right;height: 40px;line-height: 40px; margin-right: 20px; float: right;">-->
+				<!--<div class="btn-group btn-group-sm"  style="float: right;font-size: 14px;cursor: pointer;" ng-hide="!showNotCheck" ng-click="hideshowNotCheck()">-->
+					<!--<img src="static/img/vendor/images/backIcon.png" width="20"/>返回-->
+					<!--&lt;!&ndash;<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>&ndash;&gt;-->
+
+				<!--</div>-->
+			<!--</div>-->
+		<!--</div>-->
+	<!--</div>-->
+
+	<div ng-hide="showNotCheck">
+		<div class="condition block"  ng-show="!showNotCheck">
+			<div class="search-bg condition block" style="padding: 10px 15px;">
+				<div class="row">
+					<div id="topSearch" ng-show="active !== 'all'" style="float: left">
+						<a ng-click="changeDateZone(1);condition.$open=false" title="最近一个月" ng-class="{'active':condition.dateZone=='1'}">最近一个月</a>
+						<a ng-click="changeDateZone(3);condition.$open=false" title="最近三个月" ng-class="{'active':condition.dateZone=='3'}">最近三个月</a>
+						<a ng-click="changeDateZone(6);condition.$open=false" title="最近六个月" ng-class="{'active':condition.dateZone=='6'}">最近六个月</a>
+						<a ng-click="condition.$open=!condition.$open;changeDateZone(-1)" title="自定义" ng-class="{'active':condition.dateZone=='-1'}" >自定义</a>
+					</div>
+					<div  style="float: left" ng-show="active === 'all'" >
+						<div style="width: 355px;display: inline-block">
+						<label class="control-label">请选择月份:</label>
+						<span ng-click="addMouthOut(-1)" style="display: inline-block;
+							width: 32px;
+							height: 32px;
+							border: 1px solid #ddd;
+							text-align: center;
+							line-height: 32px;
+							cursor: pointer;
+							vertical-align: middle;">
+							<img src="static/img/vendor/images/arrow-left-d-l.png" width="24"/>
+						</span>
+						<span class="inputsIcon control-label" style="padding-right: 0px;display: inline-block;vertical-align: top;">
+						  <wui-date
+								  format="yyyy-mm"
+								  placeholder="请选择或输入日期"
+								  id="date3"
+								  btns="{'ok':'确定','now':'此刻'}"
+								  ng-model="thisMouthOut"
+						  >
+						  </wui-date>
+						</span>
+                        <span ng-show="MouthOutShow"  ng-click="addMouthOut(1)" style="display: inline-block;
+							width: 32px;
+							height: 32px;
+							border: 1px solid #ddd;
+							text-align: center;
+							line-height: 32px;
+							cursor: pointer;
+							vertical-align: middle;"><img src="static/img/vendor/images/arrow-right-d-l.png" width="24"/></span>
+						</div>
+						<a ng-click="condition.$open=!condition.$open;changeDateZone(1)" title="自定义" ng-class="{'active':condition.dateZone=='-1'}" style="margin-left: 10px;display: inline-block;padding: 7px 12px;background: #3f84f6;color: #fff" >自定义</a>
+						<div class="more-list more" ng-class="{'open': condition.$open}" ng-if="active === 'all'">
+							<form class="form-inline">
+								<div class="form-group ">
+									<label>日期:</label>
+									<div class="form-group input-group input-group-xs input-trigger">
+										<input type="text" ng-model="condition.dateFrom"
+											   class="form-control" placeholder="从"
+											   datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
+											   ng-required="true" max-date = "condition.dateTo"
+											   current-text="今天" clear-text="清除" close-text="关闭"
+											   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+											   ng-focus="openFilterDatePicker($event, condition, '$fromOpened')">
+										<span class="input-group-btn">
+											<button type="button" class="btn btn-default"
+													ng-click="openFilterDatePicker($event, condition, '$fromOpened')">
+												<i class="fa fa-calendar"></i>
+											</button>
+										</span>
+									</div>
+									<div class="form-group input-group input-group-xs input-trigger">
+										<input type="text" ng-model="condition.dateTo"
+											   class="form-control" placeholder="到"
+											   datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
+											   ng-required="true" min-date = "condition.dateFrom"
+											   current-text="今天" clear-text="清除" close-text="关闭"
+											   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+											   ng-focus="openFilterDatePicker($event, condition, '$toOpened')">
+										<span class="input-group-btn">
+											<button type="button" class="btn btn-default"
+													ng-click="openFilterDatePicker($event, condition, '$toOpened')">
+												<i class="fa fa-calendar"></i>
+											</button>
+										</span>
+									</div>
+								</div>
+							</form>
+						</div>
+					</div>
+					<div class="col-xs-6" style="float: right;">
+						<div class="search">
+							<div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick"
+								 on-toggle="searchAdvance=open">
+								<input type="search" class="form-control input-sm" ng-model="keyword"
+									   ng-search="onSearch(keyword)" placeholder="输入单据编号、客户名称、物料名称搜索" style="width: 100%" ng-show="active !== 'all'"/>
+								<a class="btn input-group-addon" href="javascript:void(0)" ng-click="onSearch(keyword)" ng-show="active !== 'all'">搜索</a>
+
+								<input type="search" class="form-control input-sm" ng-model="keyword" ng-search="onSearch(keyword)" placeholder="客户名称" style="width: 100%" ng-show="active === 'all' && !showNotCheck" />
+								<a class="btn input-group-addon" ng-click="onSearch(keyword)" ng-show="active === 'all' && !showNotCheck">搜索</a>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="more-list more" ng-class="{'open': condition.$open}" ng-if="active !== 'all'">
+					<form class="form-inline">
+						<div class="form-group ">
+							<label>日期:</label>
+							<div class="btn-group btn-menu" dropdown is-open="condition.$dateZoneOpen">
+								<ul class="dropdown-menu">
+									<li><a ng-click="changeDateZone(1)">一个月内</a></li>
+									<li><a ng-click="changeDateZone(6)">半年内</a></li>
+									<li><a ng-click="changeDateZone()">半年前</a></li>
+								</ul>
+							</div>
+							<div class="form-group input-group input-group-xs input-trigger">
+								<input type="text" ng-model="condition.dateFrom"
+									   class="form-control" placeholder="从"
+									   datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
+									   ng-required="true" max-date = "condition.dateTo"
+									   current-text="今天" clear-text="清除" close-text="关闭"
+									   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+									   ng-focus="openFilterDatePicker($event, condition, '$fromOpened')">
+								<span class="input-group-btn">
+								<button type="button" class="btn btn-default"
+										ng-click="openFilterDatePicker($event, condition, '$fromOpened')">
+									<i class="fa fa-calendar"></i>
+								</button>
+							</span>
+							</div>
+							<div class="form-group input-group input-group-xs input-trigger">
+								<input type="text" ng-model="condition.dateTo"
+									   class="form-control" placeholder="到"
+									   datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
+									   ng-required="true" min-date = "condition.dateFrom"
+									   current-text="今天" clear-text="清除" close-text="关闭"
+									   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+									   ng-focus="openFilterDatePicker($event, condition, '$toOpened')">
+								<span class="input-group-btn">
+							<button type="button" class="btn btn-default"
+									ng-click="openFilterDatePicker($event, condition, '$toOpened')">
+								<i class="fa fa-calendar"></i>
+							</button>
+						</span>
+							</div>
+						</div>
+					</form>
+				</div>
+			</div>
+		</div>
+		<div ng-if="active === 'all'">
+			<table class="order-table block order-table2" ng-table="tableParams" width="100%" style="table-layout:fixed">
+				<thead>
+					<tr class="header">
+						<th width="180">客户名称</th>
+						<th width="90">币别</th>
+						<th width="100">本期应收</th>
+						<th width="100">本期发货</th>
+						<th width="100">本期未对账</th>
+						<th width="100">本期已对账</th>
+						<th width="100">本期已收</th>
+						<th width="120">应收总额</th>
+						<th width="80">操作</th>
+					</tr>
+				</thead>
+				<tbody ng-repeat="check in ALLList">
+				<tr >
+					<td style="color: #3f84f6">{{::check.myEnterprise.enName}}</td>
+					<td colspan="7">
+						<div class="table-colspan-list" ng-repeat="count in check.amountDetailList">
+							<span>{{count.currency || '-'}}</span>
+							<span>{{count.thisPeriodAmount >= 0 ? (count.thisPeriodAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodSendQty >= 0 ? (count.thisPeriodSendQty | number:2) : '暂无数据'}}</span>
+							<span>{{count.thisPeriodTodoAmount >= 0 ? (count.thisPeriodTodoAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodDoneAmount >= 0 ? (count.thisPeriodDoneAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodReceipt >= 0 ? (count.thisPeriodReceipt | number:2) : '暂无数据'}}</span>
+							<span>{{count.totalAmount >= 0 ? (count.totalAmount | number:2) : '-'}}</span>
+						</div>
+					</td>
+					<td style="color: #3f84f6;cursor: pointer" ng-click="goToMNs(check)">明细</td>
+				</tr>
+				</tbody>
+				<tbody ng-if="!ALLList || ALLList.length == 0">
+				<tr>
+					<td colspan="9">
+						<div id="empty">
+							<div class="left_img">
+								<a><img src="static/img/empty/uas_empty.png"></a>
+								<a>B2B 商务</a>
+							</div>
+							<div class="right_link">
+								<!--<p ng-if="active != 'all'">您还未生成对账单,请立即新增对账!</p>-->
+								<!--<a ng-if="active != 'all'" ui-sref="fa.apCheckList"><i class="fa fa-plus-square fa-fw"></i> 新增对账单</a>-->
+							</div>
+						</div>
+					</td>
+				</tr>
+				</tbody>
+			</table>
+		</div>
+		<div ng-if="active !== 'all'">
+			<table class="order-table block" ng-table="tableParams">
+				<thead>
+					<tr class="header">
+						<th width="150">对账期间</th>
+						<th width="180">对账总额</th>
+						<th width="180">对账人</th>
+						<!--<th width="180">商品总数</th>-->
+						<th width="100">对账结果</th>
+						<th width="100">操作</th>
+					</tr>
+				</thead>
+				<tbody ng-repeat="check in $data">
+					<tr>
+						<td class="first info" colspan="3">
+							<div class="">
+								<a href="javascript:void(0)" ng-if="!isUnread(check.id)">
+									<i class="fa fa-circle-thin"></i>
+								</a>
+								<a href="javascript:void(0)" ng-if="isUnread(check.id)">
+									<i class="fa fa-circle" style="color: #f40;"></i>
+								</a>&nbsp;&nbsp;
+								<span class="text-num" title="录单时间">{{::check.recordDate | date:'MM月dd日 HH:mm'}} <i class="fa fa-clock-o"></i></span>&nbsp;&nbsp;&nbsp;
+								<span><i class="fa fa-star" ng-class="{'text-default':check.status==201}"></i> {{::check.custName}}</span>
+								<span style="margin-left: 100px;">单据编号:</span>
+								<span class="text-num"><a ui-sref="fa.apCheck_detail({id:check.id})" title="点击查看详情" ng-click="setOrdersRead(check.id)" style="color: #5078cb">{{::check.code}}</a></span>
+							</div>
+							<div class="static">
+								<p><span class="f14 text-num">{{::check.beginDate | date:'yyyy/MM/dd'}} - {{::check.endDate | date:'yyyy/MM/dd'}}</span></p>
+								<p>
+									<strong class="text-num">{{::(isUser?'-':(check.checkAmount | number:2))}}</strong>
+									<span ng-if="!isUser" class="text-number">{{::check.currency}}</span>
+								</p>
+								<p style="text-align: center;margin-left: 65px">
+									对账人:{{::check.recorder}}
+								</p>
+								<!--<p>-->
+									<!--<strong class="text-num">{{::check.items.length}}</strong> 条<br>-->
+								<!--</p>-->
+								<!--<p>-->
+									<!--<strong class="text-num">{{getTotalProd(check) | number}}</strong> <i class="fa fa-cubes"></i>-->
+								<!--</p>-->
+							</div>
+						</td>
+
+						<td class="status">
+							<!--<div ng-if="check.checkStatus == '未对账'" class="text-center text-muted f14"><br>未对账!</div>-->
+							<div></div>
+							<div ng-if="check.checkStatus == '已确认'" class="text-center text-muted f14">
+								<br> <i class="fa fa-check-square-o"></i> 已确认
+							</div>
+							<div ng-if="check.checkStatus == '不同意'" class="text-center text-muted f14">
+								<br> <i class="fa fa-check-square-o"></i> 不同意
+							</div>
+							<div ng-if="check.checkStatus == '已作废'" class="text-center text-muted f14">
+								<br> <i class="fa fa-check-square-o"></i> 已作废
+							</div>
+						</td>
+						<td>
+							<div ng-hide="check.status" class="block">
+								 <span class="text-trans error">未提交</span>
+							</div>
+							<div ng-show="check.status" class="block">
+								 <span class="text-trans success">已提交</span>
+							</div>
+							<div ng-if="check.checkStatus == '未对账'" class="text-center text-muted f14">
+								<div class="" style="margin-top: 33px;margin-right: 20px;">
+									<div class="pull-right" title="等待客户确认"><a>&nbsp;客户正在确认</a></div>
+								</div>
+							</div>
+							<div ng-if="check.checkStatus == '不同意'" class="text-center text-muted f14">
+								<div class="" style="margin-top: 33px;margin-right: 20px;">
+									<div class="pull-right" title="客户不同意"><a>&nbsp;客户不同意</a></div>
+								</div>
+							</div>
+							<div ng-if="check.checkStatus == '已确认'" class="text-center text-muted f14">
+								<div class="" style="margin-top: 33px;margin-right: 20px;">
+									<a ng-click="print(check)" class="pull-right" title="打印{{check.print? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !check.print, 'text-muted': check.print}"><i class="fa fa-print fa-lg"></i>&nbsp;打印</a>
+								</div>
+							</div>
+							<!-- <a ui-sref="fa.apCheck_detail({id:check.id})" class="operate operate-undo text-center"
+								 target="_blank">查看详情</a>	 -->
+						</td>
+					</tr>
+				</tbody>
+				<tbody ng-if="tableParams.total() == 0">
+				<tr>
+					<td colspan="5">
+						<div id="empty">
+							<div class="left_img">
+								<a><img src="static/img/empty/uas_empty.png"></a>
+								<a>B2B 商务</a>
+							</div>
+							<div class="right_link">
+								<!--<p ng-if="active != 'all'">您还未生成对账单,请立即新增对账!</p>-->
+								<!--<a ng-if="active != 'all'" ui-sref="fa.apCheckList"><i class="fa fa-plus-square fa-fw"></i> 新增对账单</a>-->
+							</div>
+						</div>
+					</td>
+				</tr>
+				</tbody>
+			</table>
+		</div>
+	</div>
+	<div ng-hide="!showNotCheck" class="infoms add-apCheckList"  >
+		<form class="form-horizontal"
+			  style="padding-top: 10px; padding-bottom: 20px;">
+			<div class="form-group form-group-sm form-group-inline">
+				<div  class="col-sm-6 control-label">
+					<div style="text-align: left">
+						<label>应收客户:</label>
+						<label style="text-align:left">
+							{{suuorname}}
+						</label>
+					</div>
+				</div>
+				<div  class="col-sm-6 control-label condition">
+					<div>
+						<label class="control-label">请选择月份:</label>
+						<span ng-click="addMouth(-1)" style="display: inline-block;
+							width: 32px;
+							height: 32px;
+							border: 1px solid #ddd;
+							text-align: center;
+							line-height: 32px;
+							cursor: pointer;
+							vertical-align: middle;">
+							<img src="static/img/vendor/images/arrow-left-d-l.png" width="24"/>
+						</span>
+						<span class="control-label" style="padding-right: 5px;display: inline-block;vertical-align: middle;padding-top: 0;" ng-click="apCheckCondition.$open = false">
+							<wui-date
+								  format="yyyy-mm"
+								  placeholder="请选择或输入日期"
+								  id="date4"
+								  btns="{'ok':'确定','now':'此刻'}"
+								  ng-model="thisMouth"
+						  >
+						</wui-date>
+						</span><span ng-show="MouthinShow" ng-click="addMouth(1)" style="display: inline-block;
+							width: 32px;
+							height: 32px;
+							border: 1px solid #ddd;
+							text-align: center;
+							line-height: 32px;
+							cursor: pointer;
+							vertical-align: middle;">
+						<img src="static/img/vendor/images/arrow-right-d-l.png" width="24"/></span>
+						<label class="control-label com-check-radio" ng-click="apCheckCondition.$open = true" style="vertical-align: middle;padding-top: 0">
+							<input type="radio" name="psa" ng-checked="apCheckCondition.$open === true"  ng-model="apCheckCondition.$open" style="vertical-align: middle">自定义
+						</label>
+					</div>
+					<div ng-hide="!apCheckCondition.$open" class="more open date fr apCheckCondition" style="margin-top: 14px;">
+						<div class="form-inline">
+							<div class="form-group">
+								<div class="form-group input-group input-group-xs input-trigger">
+									<input type="text" ng-model="apCheckCondition.dateFrom"
+										   class="form-control" placeholder="从"
+										   datepicker-popup="yyyy-MM-dd" is-open="apCheckCondition.$fromOpened"
+										   ng-required="true" max-date = "apCheckCondition.dateTo"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="apCheckopenFilterDatePicker($event, apCheckCondition, '$fromOpened')"
+									style="height: 26px">
+									<span class="input-group-btn">
+									<button type="button" class="btn btn-default"
+											ng-click="apCheckopenFilterDatePicker($event, apCheckCondition, '$fromOpened')">
+										<i class="fa fa-calendar"></i>
+									</button>
+									</span>
+								</div>
+								<em style="margin: 0 10px;display: inline-block">–</em>
+								<div class="form-group input-group input-group-xs input-trigger">
+									<input type="text" ng-model="apCheckCondition.dateTo"
+													   class="form-control" placeholder="到"
+													   datepicker-popup="yyyy-MM-dd" is-open="apCheckCondition.$toOpened"
+													   ng-required="true" min-date = "apCheckCondition.dateFrom"
+													   current-text="今天" clear-text="清除" close-text="关闭"
+													   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+													   ng-focus="apCheckopenFilterDatePicker($event, apCheckCondition, '$toOpened')" style="height: 26px">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default"
+												ng-click="apCheckopenFilterDatePicker($event, apCheckCondition, '$toOpened')">
+											<i class="fa fa-calendar"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+						</div>
+
+					</div>
+				</div>
+			</div>
+			<div class="form-group form-group-sm form-group-inline">
+				<div  class="col-sm-12 control-label">
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期应收:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthCount.length > 0" ng-repeat="count in dataInfo.thisMonthCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期未对账:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期已收:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisPeriodDoneAmount.length > 0" ng-repeat="count in dataInfo.thisPeriodDoneAmount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="!dataInfo.thisPeriodDoneAmount || dataInfo.thisPeriodDoneAmount.length === 0">
+								暂无数据
+							</div>
+						</label>
+					</div>
+
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期发货:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisPeriodSendAmount.length > 0" ng-repeat="count in dataInfo.thisPeriodSendAmount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="!dataInfo.thisPeriodSendAmount || dataInfo.thisPeriodSendAmount.length === 0">
+								暂无数据
+							</div>
+						</label>
+					</div>
+
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期已对账:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>应收总额:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.totalCount.length > 0" ng-repeat="count in dataInfo.totalCount">
+								<span>{{count.currency }}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.totalCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+				</div>
+			</div>
+			<div class="form-group form-group-sm form-group-inline">
+				<div class="col-sm-12 text-right">
+					<a ng-click="condition.$open2=!condition.$open2" class="text-simple"><span
+							ng-bind="condition.$open2 ? '收起筛选条件' : '更多筛选条件'"></span><i
+							class="fa fa-fw"
+							ng-class="{'fa-angle-up': condition.$open2, 'fa-angle-down': !condition.$open2}"></i></a>
+					<div class="btn-group btn-group-sm">
+						<a class="btn btn-default" ng-click="searchOrder()" title="筛选"><i class="fa fa-search fa-fw btn-icon-left"></i>筛选</a>
+						<a class="btn btn-default" ng-click="createApCheck(check.$selected)" ng-disabled="!data || data.length==0"><i class="fa fa-check-circle-o fa-fw btn-icon-left"></i>确认对账</a>
+						<a class="btn btn-default" ng-click="exportApcheckList()" title="导出Excel" ng-disabled="!data || data.length==0"><i class="fa fa-file-text fa-fw btn-icon-left"></i>导出</a>
+					</div>
+				</div>
+			</div>
+			<div class="form-group form-group-sm form-group-inline"
+				 ng-show="condition.$open2">
+				<!--<label class="col-sm-2 control-label">应付供应商:</label>-->
+				<!--<div class="col-sm-4">-->
+					<!--<div class="form-group form-group-sm has-feedback">-->
+						<!--<input type="search" class="form-control input-sm"-->
+							   <!--ng-model="receiveName" placeholder="可用应付供应商名称筛选" /><span-->
+							<!--class="form-control-feedback text-simple"><i-->
+							<!--class="fa fa-search"></i></span>-->
+					<!--</div>-->
+				<!--</div>-->
+				<label class="col-sm-2 control-label">送货工厂:</label>
+				<div class="col-sm-4">
+					<div class="form-group form-group-sm has-feedback">
+						<input type="search" class="form-control input-sm"
+							   ng-model="factory" placeholder="请输入送货工厂名称" /><span
+							class="form-control-feedback text-simple"><i
+							class="fa fa-search"></i></span>
+					</div>
+				</div>
+                <label class="col-sm-2 control-label">税&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率:</label>
+                <div class="col-sm-4">
+                    <div class="form-group form-group-sm has-feedback">
+                        <input type="search" class="form-control input-sm"
+                               ng-model="taxRate" placeholder="请输入税率" /><span
+                            class="form-control-feedback text-simple"><i
+                            class="fa fa-search"></i></span>
+                    </div>
+                </div>
+			</div>
+			<div class="form-group form-group-sm form-group-inline"
+				 ng-show="condition.$open2">
+				<label class="col-sm-2 control-label">物料名称:</label>
+				<div class="col-sm-4">
+					<div class="form-group form-group-sm has-feedback">
+						<input type="search" class="form-control input-sm"
+							   ng-model="prodTitle" placeholder="请输入物料名称" /><span
+							class="form-control-feedback text-simple"><i
+							class="fa fa-search"></i></span>
+					</div>
+				</div>
+				<label class="col-sm-2 control-label">规&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格:</label>
+				<div class="col-sm-4">
+					<div class="form-group form-group-sm has-feedback">
+						<input type="search" class="form-control input-sm"
+							   ng-model="prodSpec" placeholder="请输入物料规格" /><span
+							class="form-control-feedback text-simple"><i
+							class="fa fa-search"></i></span>
+					</div>
+				</div>
+			</div>
+			<!--<div class="form-group form-group-sm form-group-inline"-->
+				 <!--ng-show="condition.$open">-->
+
+			<!--</div>-->
+		</form>
+		<!-- 标签scroll-table用于表头滚动 -->
+		<div class="table-wrap" id="order-detail-list" scroll-table>
+			<div class="table-header-wrap">
+				<table class="table table-bordered">
+					<tr>
+						<th width="60" style="vertical-align: middle;">
+							<input type="checkbox" name="checkbox" ng-model="checkboxes.checked" ng-click="checkAll()">
+						</th>
+						<th width="70">订单号</th>
+						<th width="70">验收单</th>
+						<th width="70">发货单</th>
+						<th width="70">物料编号</th>
+						<th width="70">物料名称</th>
+						<th width="70">规格型号</th>
+						<th width="70">验收数量</th>
+						<th width="70">发货数量</th>
+						<th width="50">单价</th>
+						<th width="50">税率</th>
+						<th width="70">小计</th>
+						<th width="100">对账人</th>
+						<!--<th width="35">序号</th>-->
+						<!--<th width="60">类型</th>-->
+						<!--<th width="60">单据<br>日期</th>-->
+						<!--<th width="90">应付<br>供应商</th>-->
+						<!--<th width="65">客户<br>料号</th>-->
+						<!--<th width="65">送货<br>工厂</th>-->
+						<!--<th width="30">币别</th>-->
+						<!--<th width="60">金额</th>-->
+					</tr>
+				</table>
+			</div>
+			<div class="table-body-wrap">
+				<table class="table table-bordered">
+					<tr ng-repeat="check in data" ng-click="getTotalMoney()" class="thAlign" style="height: 40px;">
+						<td style="padding:0;">
+							<table class="table table-bordered child-table">
+								<tr style="height:10px;"><td colspan="13"></td></tr>
+								<tr>
+									<th width="60">
+										<input ng-model="check.$selected" name="checkbox" type="checkbox" ng-checked="check.$selected" ng-click="checkOneAll($event, check)" ng-if="check.allChecked !== 1">
+										<span ng-if="check.allChecked === 1">已对账</span>
+									</th>
+									<th width="70" ng-bind="check.orderCode"></th>
+									<th colspan="11">
+										<div class="order-count">
+											<span>合计:</span>
+											验收数量:<span>{{check.checkQty >= 0 ? (check.checkQty | number:2) :'暂无数据'}}</span>
+											发货数量:<span>{{check.sendQty >= 0 ? (check.sendQty | number:2) : '暂无数据'}}</span>
+											应收金额:<span>{{check.checkAmountList >= 0 ? (check.checkAmountList | number: 2) : '暂无数据'}}</span>
+											发货金额:<span>{{check.sendAmountList >= 0 ? (check.sendAmountList | number: 2) : '暂无数据'}}</span>
+										</div>
+										<a ng-show="check.showDetail" class="order-count-click" ng-click="check.showDetail = !check.showDetail">收起 <i class="fa fa-angle-up"></i></a>
+										<a ng-show="!check.showDetail" class="order-count-click" ng-click="check.showDetail = !check.showDetail">展开 <i class="fa fa-angle-down"></i></a>
+									</th>
+								</tr>
+								<tr ng-repeat="(index, childs) in check.details" ng-show="check.showDetail">
+									<td width="60">
+										<input ng-model="childs.$selected" name="checkbox" type="checkbox" ng-checked="childs.$selected" ng-click="stopPrevent($event)" ng-if="childs.haveChecked !== 1">
+										<span ng-if="childs.haveChecked === 1">已对账</span>
+									</td>
+									<td width="70" rowspan="{{index}}" ng-if="index === 0"></td>
+									<td width="70">{{::childs.inoutno}}</td>
+									<td width="70">{{::childs.sendcode}}</td>
+									<td width="70">{{::childs.prodcode}}</td>
+									<td width="70" title="{{childs.prodtitle}}">
+										<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::childs.prodtitle}}</div>
+									</td>
+									<td width="70" title="{{childs.prodspec}}">
+										<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::childs.prodspec}}</div>
+									</td>
+									<td width="70">{{::childs.thischeckqty}}</td>
+									<td width="70">{{::childs.qty}}</td>
+									<td width="50">{{::childs.orderprice}}</td>
+									<td width="50" align="center">{{::childs.taxrate}}</td>
+									<td width="70">{{::(childs.orderprice || 0)*(childs.thischeckqty || 0) | number:2}}</td>
+									<td width="100" ng-if="childs.haveChecked === 1">
+										<div>{{::childs.recorder || '-'}}</div>
+										<div>{{::childs.apCheckDate | date:'yyyy-MM-dd'  || '-'}}</div>
+									</td>
+									<td width="100" ng-if="childs.haveChecked !== 1">
+										未对账
+									</td>
+								</tr>
+							</table>
+						</td>
+					</tr>
+				</table>
+			</div>
+			<div style="padding: 10px 20px">本期间应收总额:{{totalMoney | number:2 || 0}}</div>
+		</div>
+	</div>
+</div>
+<style>
+	.order-table2 tbody td {
+		text-align: center;
+		padding: 20px 0
+	}
+    .order-table2 tbody td .table-colspan-list{
+        border-bottom:1px dotted #999;
+    }
+    .order-table2 tbody td .table-colspan-list:last-child{
+        border:none;
+    }
+	.order-table2 tbody td .table-colspan-list span {
+		display:inline-block;
+		vertical-align: top;
+		width:95px;
+		margin:0 auto;
+        line-height: 25px;
+	}
+	.order-table2 tbody td .table-colspan-list span:first-child {
+		width:90px;
+	}
+	.order-table2 tbody td .table-colspan-list span:last-child {
+		width:120px;
+	}
+	#order-detail-list .child-table{
+		table-layout: auto;
+	}
+	#order-detail-list .child-table tr th{
+		position:relative;
+		background: #d3eafc;
+		font-weight: bold;
+		font-size:14px;
+		padding:0 2px;
+		vertical-align: middle;
+		border:1px solid #fff;
+	}
+	#order-detail-list .child-table tr th:first-child{
+		text-align: center;
+	}
+	#order-detail-list .child-table tr th .order-count{
+		background: #d3eafc;
+		font-weight:normal;
+	}
+	#order-detail-list .child-table tr th .order-count span{
+		background: #d3eafc;
+		font-weight:bold;
+		margin-right:20px;
+	}
+	#order-detail-list .child-table tr th .order-count-click{
+		position:absolute;
+		top:10px;
+		right:20px;
+		display:inline-block;
+		padding: 0 5px;
+		line-height: 20px;
+		background: #fff;
+		color:#333;
+		border:1px solid #333;
+		border-radius:5px;
+		text-decoration: none;
+	}
+	#order-detail-list .child-table tr td{
+		padding:0 2px;
+		vertical-align: middle;
+	}
+
+</style>
+<style>
+	.wui-date-picker.left {
+		margin-right : 0 !important;
+		right: 0;
+		left: auto
+	}
+	.add-apCheckList {
+		background: #fff
+	}
+
+	.add-apCheckList input[type="checkbox"] {
+		/*width: 16px;
+        height: 16px*/
+	}
+
+	.add-apCheckList .table-wrap {
+		overflow: hidden
+	}
+
+	.add-apCheckList .table-header-wrap {
+		background: #f9f9f9;
+		overflow-x: hidden;
+		overflow-y: scroll;
+	}
+
+	.add-apCheckList .table-header-wrap table,.add-apCheckList .table-body-wrap table
+	{
+		width: 100%;
+		table-layout: fixed;
+		border-collapse: collapse;
+		border-spacing: 0;
+		margin-bottom: 0
+	}
+
+	.add-apCheckList .table-header-wrap th {
+		text-align: center;
+        vertical-align:middle;
+	}
+
+	.add-apCheckList .table-body-wrap {
+		max-height: 600px;
+		overflow-x: auto;
+		overflow-y: scroll;
+	}
+
+	.add-apCheckList td {
+		word-break: break-all;
+		text-align: center;
+	}
+
+	.add-apCheckList tbody {
+		overflow: auto;
+	}
+
+	#order-detail-list .input-sm {
+		border: #ccc 1px solid;
+	}
+
+	.infoms .has-feedback input[type="search"] {
+		padding-right: 0 !important;
+	}
+	.infoms .table>tbody>tr>td{
+		vertical-align: middle;
+	}
+	.infoms .form-horizontal .form-group-sm .control-label{
+		font-size: 14px;
+	}
+	.infoms .form-group .form-control{
+		font-size: 14px;
+	}
+	.wui-date.small .wui-date-picker {
+		width: 260px
+	}
+
+    .wui-input {
+        border: 1px solid #3f84f6;
+        font-size: 14px;
+        color: #3f84f6;
+        font-weight: bold;
+    }
+    .wui-date-editor .iconfont {
+        color: #3f84f6
+    }
+
+	.apCheckCondition ul {
+		left: auto !important;
+		right: 0;
+	}
 </style>

+ 210 - 147
src/main/webapp/resources/tpl/index/fa/arCheck.html

@@ -354,58 +354,36 @@
 				<thead>
 				<tr class="header">
 					<th width="180">应付供应商名称</th>
-					<th width="140">本期应付</th>
-					<th width="140">本期未对账</th>
-					<th width="140">本期已对账</th>
-					<!--<th width="140">本月已付</th>-->
-					<th width="140">应付总额</th>
+					<th width="90">币别</th>
+					<th width="100">本期应付</th>
+					<th width="100">本期发货</th>
+					<th width="100">本期未对账</th>
+					<th width="100">本期已对账</th>
+					<th width="100">本期已付</th>
+					<th width="120">应付总额</th>
 					<th width="80">操作</th>
 				</tr>
 				</thead>
 				<tbody ng-repeat="check in ALLList">
 				<tr >
 					<td style="color: #3f84f6">{{::check.vendorEnterprise.enName}}</td>
-					<td ng-if="check.thisMonthCount.length > 0">
-						<div ng-repeat="count in check.thisMonthCount">
-							<span>{{count.currency}}:{{count.amount | number:2}}</span>
+					<td colspan="7">
+						<div class="table-colspan-list" ng-repeat="count in check.amountDetailList">
+							<span>{{count.currency || '-'}}</span>
+							<span>{{count.thisPeriodAmount >= 0 ? (count.thisPeriodAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodSendQty >= 0 ? (count.thisPeriodSendQty | number:2) : '暂无数据'}}</span>
+							<span>{{count.thisPeriodTodoAmount >= 0 ? (count.thisPeriodTodoAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodDoneAmount >= 0 ? (count.thisPeriodDoneAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodReceipt >= 0 ? (count.thisPeriodReceipt | number:2) : '暂无数据'}}</span>
+							<span>{{count.totalAmount >= 0 ? (count.totalAmount | number:2) : '-'}}</span>
 						</div>
 					</td>
-					<td ng-if="check.thisMonthCount.length === 0">-</td>
-
-					<td ng-if="check.thisMonthTodoCount.length > 0">
-						<div ng-repeat="count in check.thisMonthTodoCount">
-							<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>
-						</div>
-					</td>
-					<td ng-if="check.thisMonthTodoCount.length === 0">-</td>
-
-					<td ng-if="check.thisMonthDoneCount.length > 0">
-						<div ng-repeat="count in check.thisMonthDoneCount">
-							<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>
-						</div>
-					</td>
-					<td ng-if="check.thisMonthDoneCount.length === 0">-</td>
-
-					<!--<td ng-if="check.apCheckAmounts.length > 0">-->
-						<!--<div ng-repeat="count in check.apCheckAmounts">-->
-							<!--<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>-->
-						<!--</div>-->
-					<!--</td>-->
-					<!--<td ng-if="check.apCheckAmounts.length === 0">-</td>-->
-
-					<td ng-if="check.totalCount.length > 0">
-						<div ng-repeat="count in check.totalCount">
-							<span ng-if="count.amount > 0">{{count.currency}}:{{count.amount | number:2}}</span>
-						</div>
-					</td>
-					<td ng-if="check.totalCount.length === 0">-</td>
-
 					<td style="color: #3f84f6;cursor: pointer" ng-click="goToMNs(check)">明细</td>
 				</tr>
 				</tbody>
 				<tbody ng-if="!ALLList || ALLList.length == 0">
 				<tr>
-					<td colspan="6">
+					<td colspan="9">
 						<div id="empty">
 							<div class="left_img">
 								<a><img src="static/img/empty/uas_empty.png"></a>
@@ -483,66 +461,6 @@
 							{{suuorname}}
 						</label>
 					</div>
-					<div style="text-align: left;margin-top: 20px">
-						<label>本期应收:</label>
-						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthCount.length > 0" ng-repeat="count in dataInfo.thisMonthCount">
-								<span>{{count.currency}}:{{count.amount | number:2}}</span>
-							</div>
-							<div ng-if="dataInfo.thisMonthCount.length === 0">
-								0
-							</div>
-						</label>
-					</div>
-
-					<div style="text-align: left;margin-top: 20px">
-						<label>本期未对账:</label>
-						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
-								<span>{{count.currency}}:{{count.amount | number:2}}</span>
-							</div>
-							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
-								0
-							</div>
-						</label>
-					</div>
-
-					<div style="text-align: left;margin-top: 20px">
-						<label>本期已对账:</label>
-						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
-								<span>{{count.currency}}:{{count.amount | number:2}}</span>
-							</div>
-							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
-								0
-							</div>
-						</label>
-					</div>
-
-					<!--<div style="text-align: left;margin-top: 20px">-->
-						<!--<label>本期间已付总额:</label>-->
-						<!--<label style="text-align:left;vertical-align: top;">-->
-							<!--<div ng-if="dataInfo.apCheckAmounts.length > 0" ng-repeat="count in dataInfo.apCheckAmounts">-->
-								<!--<span>{{count.currency}}:{{count.amount | number:2}}</span>-->
-							<!--</div>-->
-							<!--<div ng-if="dataInfo.apCheckAmounts.length === 0">-->
-								<!--0-->
-							<!--</div>-->
-						<!--</label>-->
-					<!--</div>-->
-
-
-					<div style="text-align: left;margin-top: 20px">
-						<label>应付总额:</label>
-						<label style="text-align:left;vertical-align: top;">
-							<div ng-if="dataInfo.totalCount.length > 0" ng-repeat="count in dataInfo.totalCount">
-								<span>{{count.currency }}:{{count.amount | number:2}}</span>
-							</div>
-							<div ng-if="dataInfo.totalCount.length === 0">
-								0
-							</div>
-						</label>
-					</div>
 				</div>
 				<div  class="col-sm-6 control-label condition">
 					<div>
@@ -620,6 +538,80 @@
 					</div>
 				</div>
 			</div>
+			<div class="form-group form-group-sm form-group-inline">
+				<div  class="col-sm-12 control-label">
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期应付:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthCount.length > 0" ng-repeat="count in dataInfo.thisMonthCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期未对账:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthTodoCount.length > 0" ng-repeat="count in dataInfo.thisMonthTodoCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthTodoCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期已付:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisPeriodDoneAmount.length > 0" ng-repeat="count in dataInfo.thisPeriodDoneAmount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="!dataInfo.thisPeriodDoneAmount || dataInfo.thisPeriodDoneAmount.length === 0">
+								暂无数据
+							</div>
+						</label>
+					</div>
+
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期发货:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisPeriodSendAmount.length > 0" ng-repeat="count in dataInfo.thisPeriodSendAmount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="!dataInfo.thisPeriodSendAmount || dataInfo.thisPeriodSendAmount.length === 0">
+								暂无数据
+							</div>
+						</label>
+					</div>
+
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>本期已对账:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.thisMonthDoneCount.length > 0" ng-repeat="count in dataInfo.thisMonthDoneCount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisMonthDoneCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+
+					<div style="display:inline-block;text-align: left;margin-top: 20px; width:32%;">
+						<label>应付总额:</label>
+						<label style="text-align:left;vertical-align: top;">
+							<div ng-if="dataInfo.totalCount.length > 0" ng-repeat="count in dataInfo.totalCount">
+								<span>{{count.currency }}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.totalCount.length === 0">
+								0
+							</div>
+						</label>
+					</div>
+				</div>
+			</div>
 			<div class="form-group form-group-sm form-group-inline">
 				<div class="col-sm-12 text-right">
 					<a ng-click="condition.$open2=!condition.$open2" class="text-simple"><span
@@ -683,63 +675,73 @@
 				<table class="table table-bordered">
 					<tr>
 						<th width="70">采购单</th>
-						<th width="60">发货单</th>
-						<th width="90">单据日期</th>
-						<th width="60">验收单</th>
+						<th width="70">验收单</th>
+						<th width="70">发货单</th>
 						<th width="70">物料编号</th>
 						<th width="70">物料名称</th>
 						<th width="70">规格型号</th>
-						<th width="55">发货数量</th>
-						<th width="100">验收数量</th>
-						<th width="40">单价</th>
-						<th width="40">税率</th>
+						<th width="70">验收数量</th>
+						<th width="70">发货数量</th>
+						<th width="50">单价</th>
+						<th width="50">税率</th>
 						<th width="70">小计</th>
-						<th width="100">
-							对账人<br />/日期
-						</th>
+						<th width="100">对账人</th>
 					</tr>
 				</table>
 			</div>
 			<div class="table-body-wrap">
 				<table class="table table-bordered">
-					<tr ng-repeat="check in data" ng-click="checkOne(check);getTotalMoney()" class="thAlign" style="height: 40px;">
-						<td width="70">{{::check.ordercode}}</td>
-						<td width="60">{{::check.sendcode}}</td>
-						<td width="90">{{::check.pidate | date:'yyyy年MM月dd日'  || '-'}}</td>
-						<td width="60">{{::check.inoutno}}</td>
-						<td width="70" title="{{check.prodcode}}">
-							{{::check.prodcode}}
-						</td>
-						<td width="70" title="{{check.prodtitle}}">
-							<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::check.prodtitle}}</div>
-						</td>
-						<td width="70" title="{{check.prodspec}}">
-							<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::check.prodspec}}</div></td>
-
-						<td width="55">{{::check.qty}}</td>
-
-						<td width="100">{{::check.thischeckqty}}</td>
-						<td width="40">{{::check.orderprice}}</td>
-						<td width="40" align="center">{{::check.taxrate}}</td>
-						<td width="70">{{::(check.orderprice || 0)*(check.thischeckqty || 0) | number:2}}</td>
-						<td width="100" ng-if="check.haveChecked === 1">
-							<div>{{::check.recorder || '-'}}</div>
-							<div>{{::check.apCheckDate | date:'yyyy年MM月dd日'  || '-'}}</div>
-						</td>
-						<td width="100" ng-if="check.haveChecked !== 1">
-							未对账
-						</td>
-						<!--<td width="100">-->
-							<!--<div>{{::check.recorder || '-'}}</div>-->
-							<!--<div>{{::check.apCheckDate | date:'yyyy年MM月dd日'  || '-'}}</div>-->
-						<!--</td>-->
-					</tr>
-					<tr ng-if="!data || data.length==0">
-						<td colspan="11">
-							<div class="empty-block">
-								<i class="fa fa-exclamation-circle"></i>
-								<p class="text-muted">没有对账数据,请先筛选</p>
-							</div>
+					<tr ng-repeat="check in data" ng-click="getTotalMoney()" class="thAlign" style="height: 40px;">
+						<td style="padding:0;">
+							<table class="table table-bordered child-table">
+								<tr style="height:10px;"><td colspan="13"></td></tr>
+								<tr>
+									<!--<th width="60">-->
+										<!--<input ng-model="check.$selected" name="checkbox" type="checkbox" ng-checked="check.$selected" ng-click="checkOneAll($event, check)" ng-if="check.allChecked !== 1">-->
+										<!--<span ng-if="childs.allChecked === 1">已对账</span>-->
+									<!--</th>-->
+									<th width="70" ng-bind="check.orderCode"></th>
+									<th colspan="11">
+										<div class="order-count">
+											<span>合计:</span>
+											验收数量:<span>{{check.checkQty >= 0 ? (check.checkQty | number:2) :'暂无数据'}}</span>
+											发货数量:<span>{{check.sendQty >= 0 ? (check.sendQty | number:2) : '暂无数据'}}</span>
+											应收金额:<span>{{check.checkAmountList >= 0 ? (check.checkAmountList | number: 2) : '暂无数据'}}</span>
+											发货金额:<span>{{check.sendAmountList >= 0 ? (check.sendAmountList | number: 2) : '暂无数据'}}</span>
+										</div>
+										<a ng-show="check.showDetail" class="order-count-click" ng-click="check.showDetail = !check.showDetail">收起 <i class="fa fa-angle-up"></i></a>
+										<a ng-show="!check.showDetail" class="order-count-click" ng-click="check.showDetail = !check.showDetail">展开 <i class="fa fa-angle-down"></i></a>
+									</th>
+								</tr>
+								<tr ng-repeat="(index, childs) in check.details" ng-show="check.showDetail">
+									<!--<td width="60">-->
+										<!--<input ng-model="childs.$selected" name="checkbox" type="checkbox" ng-checked="childs.$selected" ng-click="stopPrevent($event)" ng-if="childs.haveChecked !== 1">-->
+										<!--<span ng-if="childs.haveChecked === 1">已对账</span>-->
+									<!--</td>-->
+									<td width="70" rowspan="{{index}}" ng-if="index === 0"></td>
+									<td width="70">{{::childs.inoutno}}</td>
+									<td width="70">{{::childs.sendcode}}</td>
+									<td width="70">{{::childs.prodcode}}</td>
+									<td width="70" title="{{childs.prodtitle}}">
+										<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::childs.prodtitle}}</div>
+									</td>
+									<td width="70" title="{{childs.prodspec}}">
+										<div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::childs.prodspec}}</div>
+									</td>
+									<td width="70">{{::childs.thischeckqty}}</td>
+									<td width="70">{{::childs.qty}}</td>
+									<td width="50">{{::childs.orderprice}}</td>
+									<td width="50" align="center">{{::childs.taxrate}}</td>
+									<td width="70">{{::(childs.orderprice || 0)*(childs.thischeckqty || 0) | number:2}}</td>
+									<td width="100" ng-if="childs.haveChecked === 1">
+										<div>{{::childs.recorder || '-'}}</div>
+										<div>{{::childs.apCheckDate | date:'yyyy-MM-dd'  || '-'}}</div>
+									</td>
+									<td width="100" ng-if="childs.haveChecked !== 1">
+										未对账
+									</td>
+								</tr>
+							</table>
 						</td>
 					</tr>
 				</table>
@@ -753,6 +755,66 @@
 		text-align: center;
 		padding: 20px 0
 	}
+	.order-table2 tbody td .table-colspan-list{
+		border-bottom:1px dotted #999;
+	}
+	.order-table2 tbody td .table-colspan-list:last-child{
+		border:none;
+	}
+	.order-table2 tbody td .table-colspan-list span {
+		display:inline-block;
+		vertical-align: top;
+		width:95px;
+		margin:0 auto;
+		line-height: 25px;
+	}
+	.order-table2 tbody td .table-colspan-list span:first-child {
+		width:90px;
+	}
+	.order-table2 tbody td .table-colspan-list span:last-child {
+		width:120px;
+	}
+	#order-detail-list .child-table{
+		table-layout: auto;
+	}
+	#order-detail-list .child-table tr th{
+		position:relative;
+		background: #d3eafc;
+		font-weight: bold;
+		font-size:14px;
+		padding:0 2px;
+		vertical-align: middle;
+		border:1px solid #fff;
+	}
+	#order-detail-list .child-table tr th:first-child{
+		text-align: center;
+	}
+	#order-detail-list .child-table tr th .order-count{
+		background: #d3eafc;
+		font-weight:normal;
+	}
+	#order-detail-list .child-table tr th .order-count span{
+		background: #d3eafc;
+		font-weight:bold;
+		margin-right:20px;
+	}
+	#order-detail-list .child-table tr th .order-count-click{
+		position:absolute;
+		top:10px;
+		right:20px;
+		display:inline-block;
+		padding: 0 5px;
+		line-height: 20px;
+		background: #fff;
+		color:#333;
+		border:1px solid #333;
+		border-radius:5px;
+		text-decoration: none;
+	}
+	#order-detail-list .child-table tr td{
+		padding:0 2px;
+		vertical-align: middle;
+	}
 </style>
 <style>
 	.wui-date-picker.left {
@@ -790,6 +852,7 @@
 
 	.add-apCheckList .table-header-wrap th {
 		text-align: center;
+		vertical-align:middle;
 	}
 
 	.add-apCheckList .table-body-wrap {