Browse Source

fix:调整应付对账

shenjunjie 7 years ago
parent
commit
6db1506abc

+ 32 - 5
src/main/webapp/resources/js/usercenter/controllers/b2b/fa/arCheck.js

@@ -618,9 +618,14 @@
                   }
                   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) {
@@ -661,8 +666,24 @@
                           })
                           data.apCheckAmounts = _apCheckAmounts
 
+                          var _thisPeriodDoneAmount = []
+                          data.thisPeriodDoneAmount && data.thisPeriodDoneAmount.forEach(function(item) {
+                              if (item.amount > 0) {
+                                  _thisPeriodDoneAmount.push(item)
+                              }
+                          })
+                          data.thisPeriodDoneAmount = _thisPeriodDoneAmount
+
+                          var _thisPeriodSendAmount = []
+                          data.thisPeriodSendAmount && data.thisPeriodSendAmount.forEach(function(item) {
+                              if (item.amount > 0) {
+                                  _thisPeriodSendAmount.push(item)
+                              }
+                          })
+                          data.thisPeriodSendAmount = _thisPeriodSendAmount
+
                           $scope.dataInfo = data
-                          $scope.data = data.details;
+                          $scope.data = data.groupList;
                           $scope.checkboxes.checked = true;
                           // $scope.suuorname = data.vendorName
                           $scope.getTotalMoney();
@@ -739,8 +760,8 @@
               $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;
+                  var price = DecimalNumber.accMul((check.thischeckqty || 0), (check.orderprice || 0));
+                  $scope.totalMoney += Math.round(price * 100) / 100;
                   // } else {
                   //     $scope.totalMoney += 0;
                   // }
@@ -760,6 +781,12 @@
               // 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) {

+ 63 - 26
src/main/webapp/resources/js/vendor/controllers/b2b/apCheck.js

@@ -415,9 +415,13 @@ define(['app/app'], function (app) {
               }
               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) {
@@ -459,8 +463,24 @@ define(['app/app'], function (app) {
                       })
                       data.apCheckAmounts = _apCheckAmounts
 
+                      var _thisPeriodDoneAmount = []
+                      data.thisPeriodDoneAmount && data.thisPeriodDoneAmount.forEach(function(item) {
+                          if (item.amount > 0) {
+                              _thisPeriodDoneAmount.push(item)
+                          }
+                      })
+                      data.thisPeriodDoneAmount = _thisPeriodDoneAmount
+
+                      var _thisPeriodSendAmount = []
+                      data.thisPeriodSendAmount && data.thisPeriodSendAmount.forEach(function(item) {
+                          if (item.amount > 0) {
+                              _thisPeriodSendAmount.push(item)
+                          }
+                      })
+                      data.thisPeriodSendAmount = _thisPeriodSendAmount
+
                       $scope.dataInfo = data
-                      $scope.data = data.details;
+                      $scope.data = data.groupList;
                       $scope.checkboxes.checked = true;
                       $scope.getTotalMoney();
                   } else {
@@ -517,36 +537,31 @@ define(['app/app'], function (app) {
           // 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
@@ -555,17 +570,39 @@ define(['app/app'], function (app) {
           // 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;
 
       //生成应收对账单

+ 209 - 145
src/main/webapp/resources/view/usercenter/b2b/fa/arCheck.html

@@ -738,51 +738,30 @@
         <thead ng-show="active === 'all'">
         <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-show="active === 'all'" 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>
@@ -806,7 +785,7 @@
         </tbody>
         <tbody ng-if="active === 'all' && (ALLList === undefined || ALLList.length == 0)">
         <tr>
-          <td colspan="6">
+          <td colspan="9">
             <div class="empty">
               <div class="left_img">
                 <a><img src="static/img/all/empty-cart.png"></a>
@@ -835,66 +814,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.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.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-5 control-label">
           <div>
@@ -962,6 +881,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
@@ -1036,66 +1029,78 @@
       <div class="table-header-wrap">
         <table class="table table-bordered">
           <tr>
-            <!--<th width="36" 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="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="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>-->
+            <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}}">
-              <div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::check.prodcode}}</div>
-            </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">
-              未对账
+          <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>
           <tr ng-if="!data || data.length==0">
-            <td colspan="11">
+            <td colspan="12">
               <div class="empty-block">
                 <i class="fa fa-exclamation-circle"></i>
                 <p class="text-muted">没有对账数据,请先筛选</p>
@@ -1241,4 +1246,63 @@
   .wui-date.small .wui-date-picker .month_panel .wui-data-table td {
     line-height: 20px;
   }
+</style>
+
+<style>
+  .order-table2 tbody td {
+    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>

+ 278 - 106
src/main/webapp/resources/view/vendor/b2b/apCheck.html

@@ -746,58 +746,37 @@
         <thead ng-show="active === 'all'">
           <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-show="active === 'all'" ng-repeat="check in ALLList">
-          <tr>
+        <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 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 style="color: #3f84f6;cursor: pointer" ng-click="goToMNs(check)">明细</td>
-          </tr>
+        </tr>
         </tbody>
 
         <tbody ng-if="active !== 'all' && tableParams.total() == 0">
         <tr>
-          <td colspan="5">
+          <td colspan="9">
             <div id="empty">
               <div class="left_img">
                 <a><img src="static/img/all/empty-cart.png"></a>
@@ -843,42 +822,52 @@
               {{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.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>本期未对账:</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.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="text-align: left;margin-top: 20px">-->
+                <!--<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="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>-->
@@ -888,17 +877,17 @@
                     <!--</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 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-5 control-label">
           <div>
@@ -967,6 +956,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
@@ -1041,24 +1104,21 @@
       <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="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="60">发货单</th>-->
-                  <th width="55">发货数量</th>
-                  <th width="80">验收数量</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>-->
@@ -1072,6 +1132,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 ng-if="false" 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">
@@ -1081,9 +1196,7 @@
                   <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}}">
-                      <div style="display: -webkit-box; text-overflow: ellipsis; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">{{::check.prodcode}}</div>
-                  </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>
@@ -1092,7 +1205,7 @@
 
                   <td width="55">{{::check.qty}}</td>
 
-                  <td width="80">{{::check.thischeckqty}}</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>
@@ -1264,4 +1377,63 @@
   .wui-date.small .wui-date-picker .month_panel .wui-data-table td {
       line-height: 20px;
   }
+</style>
+<style>
+    .order-table2 tbody td {
+        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>