Browse Source

perf: 处理应收应付

wangcz 7 years ago
parent
commit
88d70d8ce6

+ 59 - 28
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;
 
         //生成应收对账单

+ 208 - 110
src/main/webapp/resources/tpl/index/fa/apCheck.html

@@ -376,58 +376,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.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>
+					<td colspan="7">
+						<div class="table-colspan-list" ng-repeat="count in check.amountDetailList">
+							<span>{{count.currency || '-'}}</span>
+							<span>{{count.thisPeriodAmount ? (count.thisPeriodAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodSendQty ? (count.thisPeriodSendQty | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodTodoAmount ? (count.thisPeriodTodoAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodDoneAmount ? (count.thisPeriodDoneAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodReceipt ? (count.thisPeriodReceipt | number:2) : '-'}}</span>
+							<span>{{count.totalAmount ? (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>
@@ -558,63 +536,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>
@@ -692,6 +613,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.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.thisPeriodSendAmount.length > 0" ng-repeat="count in dataInfo.thisPeriodSendAmount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisPeriodSendAmount.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.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
@@ -766,26 +761,21 @@
 			<div class="table-header-wrap">
 				<table class="table table-bordered">
 					<tr>
-						<th width="55" style="vertical-align: middle;">
+						<th width="60" 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="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="70">发货数量</th>
+						<th width="50">单价</th>
+						<th width="50">税率</th>
 						<th width="70">小计</th>
-						<th width="110">
-							对账人<br />/日期
-						</th>
+						<th width="100">对账人</th>
 						<!--<th width="35">序号</th>-->
 						<!--<th width="60">类型</th>-->
 						<!--<th width="60">单据<br>日期</th>-->
@@ -799,6 +789,61 @@
 			</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="childs.allChecked === 1">已对账</span>
+									</th>
+									<th width="70" ng-bind="check.orderCode"></th>
+									<th colspan="11">
+										<div class="order-count">
+											<span>合计:</span>
+											验收数量:<span>{{'-'}}</span>
+											发货数量:<span>{{check.sendQty ? (check.sendQty | number:2) : '-'}}</span>
+											应收金额:<span>{{check.checkAmountList ? (check.checkAmountList | number: 2) : '-'}}</span>
+											发货金额:<span>{{check.sendAmountList ? (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>
+				<table style="display:none;" 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">
@@ -861,6 +906,59 @@
 		text-align: center;
 		padding: 20px 0
 	}
+	.order-table2 tbody td .table-colspan-list span {
+		display:inline-block;
+		vertical-align: top;
+		width:95px;
+		margin:0 auto;
+	}
+	.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;
+	}
+	#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 {

+ 205 - 109
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 ? (count.thisPeriodAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodSendQty ? (count.thisPeriodSendQty | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodTodoAmount ? (count.thisPeriodTodoAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodDoneAmount ? (count.thisPeriodDoneAmount | number:2) : '-'}}</span>
+							<span>{{count.thisPeriodReceipt ? (count.thisPeriodReceipt | number:2) : '-'}}</span>
+							<span>{{count.totalAmount ? (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.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.thisPeriodSendAmount.length > 0" ng-repeat="count in dataInfo.thisPeriodSendAmount">
+								<span>{{count.currency}}:{{count.amount | number:2}}</span>
+							</div>
+							<div ng-if="dataInfo.thisPeriodSendAmount.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.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,25 +675,77 @@
 				<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="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>{{'-'}}</span>
+											发货数量:<span>{{check.sendQty ? (check.sendQty | number:2) : '-'}}</span>
+											应收金额:<span>{{check.checkAmountList ? (check.checkAmountList | number: 2) : '-'}}</span>
+											发货金额:<span>{{check.sendAmountList ? (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>
+				<table style="display:none;" 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>
@@ -753,6 +797,58 @@
 		text-align: center;
 		padding: 20px 0
 	}
+	.order-table2 tbody td .table-colspan-list span {
+		display:inline-block;
+		vertical-align: top;
+		width:95px;
+		margin:0 auto;
+	}
+	.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;
+	}
+	#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 {