gjy 1 gadu atpakaļ
vecāks
revīzija
16b937fcd0
1 mainītis faili ar 11 papildinājumiem un 6 dzēšanām
  1. 11 6
      pages/task/audit/warehouse_warrant_detail.vue

+ 11 - 6
pages/task/audit/warehouse_warrant_detail.vue

@@ -36,14 +36,16 @@
 				<view class="right">{{auditInfo.warehouseName}}</view>
 			</view>
 			<view class="row">
-				<view class="left" style='width:33.3333%;text-align:center;border-right:1px solid #ccc;'>货名 </view>
-				<view class="right" style='width:33.3333%;text-align:center;border-right:1px solid #ccc;'>重量(吨)</view>
-				<view class="right" style='width:33.3333%;text-align:center;'>金额(元)</view>
+				<view class="left" style='width:30%;text-align:center;border-right:1px solid #ccc;'>货名 </view>
+				<view class="right" style='width:20%;text-align:center;border-right:1px solid #ccc;'>重量</view>
+				<view class="right" style='width:25%;text-align:center;border-right:1px solid #ccc;'>平均单价</view>
+				<view class="right" style='width:25%;text-align:center;'>金额(元)</view>
 			</view>
 			<view class="row" v-for='item in auditInfo.goodNameList'>
-				<view class="left" style='width:33.3333%;text-align:center;border-right:1px solid #ccc;'>{{item.goodsName}}</view>
-				<view class="right" style='width:33.3333%;text-align:center;border-right:1px solid #ccc;'>{{item.inWarehouseWeight}}</view>
-				<view class="right" style='width:33.3333%;text-align:center;'>{{item.requestFunds}}</view>
+				<view class="left" style='width:30%;text-align:center;border-right:1px solid #ccc;'>{{item.goodsName}}</view>
+				<view class="right" style='width:20%;text-align:center;border-right:1px solid #ccc;'>{{item.inWarehouseWeight}}</view>
+				<view class="right" style='width:25%;text-align:center;border-right:1px solid #ccc;'>{{item.cost}}</view>
+				<view class="right" style='width:25%;text-align:center;'>{{item.requestFunds}}</view>
 			</view>
 			<view @click="detailed('',1)" class="row">
 				<view class="left">合计重量(吨)</view>
@@ -385,6 +387,7 @@
 						}
 						var arr=[]
 						for (var i = 0; i < datalist.length; i++) {
+							datalist[i].cost=datalist[i].requestFunds/datalist[i].inWarehouseWeight
 							if(arr.length==0){
 								arr.push(datalist[i])
 							}else{
@@ -395,6 +398,7 @@
 										if(arr[q].goodsName==datalist[i].goodsName){console.log(22222)
 											console.log(arr[q].inWarehouseWeight,datalist[i].inWarehouseWeight)
 											arr[q].inWarehouseWeight+=datalist[i].inWarehouseWeight
+											arr[q].cost+=datalist[i].cost
 											arr[q].requestFunds+=datalist[i].requestFunds
 										}
 									}
@@ -406,6 +410,7 @@
 						}
 						for (var q = 0; q < arr.length; q++) {
 							arr[q].inWarehouseWeight=arr[q].inWarehouseWeight.toFixed(2)
+							arr[q].cost=arr[q].cost.toFixed(2)
 							arr[q].requestFunds=arr[q].requestFunds.toFixed(2)
 						}
 						console.log(arr,1111111)