gjy 3 年之前
父节点
当前提交
6702985bb2
共有 1 个文件被更改,包括 27 次插入19 次删除
  1. 27 19
      src/views/statisticalReport/stockSaleOutReportList.vue

+ 27 - 19
src/views/statisticalReport/stockSaleOutReportList.vue

@@ -42,14 +42,14 @@
         <span v-else>出库量: 0 吨</span>
         <span v-if="orderList.unitContractPrice">合同单价: {{ orderList.unitContractPrice }} 元/吨</span>
         <span v-else>合同单价: 0 元/吨</span>
-        <span v-if="amountReceivable">应收: {{ amountReceivable.toFixed(2) }} 元</span>
+        <span v-if="amountReceivable">应收: {{ amountReceivable }} 元</span>
         <span v-else>应收: 0 元</span>
-        <span v-if="amountReceived">已收: {{ amountReceived.toFixed(2) }} 元
+        <span v-if="amountReceived">已收: {{ amountReceived }} 元
           <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
             src="../../../public/img/fujian.png" @click="fujian1()" alt="" />
         </span>
         <span v-else>已收: 0 元</span>
-        <span v-if="uncollectedAmount">未收: {{ uncollectedAmount.toFixed(2) }} 元</span>
+        <span v-if="uncollectedAmount">未收: {{ uncollectedAmount }} 元</span>
         <span v-else>未收: 0 元</span>
         <span v-if="orderList.deposit">定金: {{ orderList.deposit }} 元
           <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
@@ -328,10 +328,10 @@
         deposit: '0',
         depositUrl: [],
         saleList: [],
-        amountReceivable: '',
-        amountReceived: '',
-        uncollectedAmount: '',
-        outboundVolume: '',
+        amountReceivable: 0,
+        amountReceived: 0,
+        uncollectedAmount: 0,
+        outboundVolume: 0,
         collectionDate: '',
         collectionScreenshot: '',
         amountEdCollectionable: '',
@@ -369,7 +369,7 @@
     },
     methods: {
       tableRowClassName({row, rowIndex}) {
-        console.log(row)
+        // console.log(row)
         if (row.returnFlag==1) {
           return 'warning-row';
         } else {
@@ -558,7 +558,7 @@
               const values = data.map((item) => Number(item[column.property]))
               if (!values.every((value) => isNaN(value))) {
                 sums[index] = values.reduce((prev, curr) => {
-                  const value = Number(curr).toFixed(3)
+                  const value = Number(curr).toFixed(2)
                   if (!isNaN(value)) {
                     return prev + curr
                   } else {
@@ -584,7 +584,7 @@
                 const values = data.map((item) => Number(item[column.property]))
                 if (!values.every((value) => isNaN(value))) {
                   sums[index] = values.reduce((prev, curr) => {
-                    const value = Number(curr).toFixed(3)
+                    const value = Number(curr).toFixed(2)
                     if (!isNaN(value)) {
                       return prev + curr
                     } else {
@@ -609,7 +609,7 @@
                 const values = data.map((item) => Number(item[column.property]))
                 if (!values.every((value) => isNaN(value))) {
                   sums[index] = values.reduce((prev, curr) => {
-                    const value = Number(curr).toFixed(3)
+                    const value = Number(curr).toFixed(2)
                     if (!isNaN(value)) {
                       return prev + curr
                     } else {
@@ -634,7 +634,7 @@
                 const values = data.map((item) => Number(item[column.property]))
                 if (!values.every((value) => isNaN(value))) {
                   sums[index] = values.reduce((prev, curr) => {
-                    const value = Number(curr).toFixed(3)
+                    const value = Number(curr).toFixed(2)
                     if (!isNaN(value)) {
                       return prev + curr
                     } else {
@@ -652,13 +652,13 @@
 
         })
         for (let i = 0; i < sums.length; i++) {
-          console.log(typeof sums[i])
+          // console.log(typeof sums[i])
           if(typeof sums[i]=='number'){
-            sums[i]=sums[i].toFixed(3)
+            sums[i]=sums[i].toFixed(2)
           }
           
         }
-        console.log(sums)
+        // console.log(sums)
           // sums[sums.length - 1] = sums[sums.length - 1].toFixed(2)
           // sums[sums.length - 2] = sums[sums.length - 2].toFixed(2)
         return sums
@@ -852,10 +852,18 @@
             let num = []
             for (var i = 0; i < response.records.length; i++) {
               response.records[i].identification = 'false'
-              this.amountReceivable += response.records[i].amountIngReceivable
-              this.amountReceived += response.records[i].amountEdReceivable
-              this.uncollectedAmount += response.records[i].amountNotReceivable
-              this.outboundVolume += response.records[i].settlementWeight
+              if(response.records[i].amountIngReceivable){
+                this.amountReceivable += Number(response.records[i].amountIngReceivable.toFixed(2))
+              }
+              if(response.records[i].amountEdReceivable){
+                this.amountReceived += Number(response.records[i].amountEdReceivable.toFixed(2))
+              }
+              if(response.records[i].amountNotReceivable){
+                this.uncollectedAmount += Number(response.records[i].amountNotReceivable.toFixed(2))
+              }
+              if(response.records[i].settlementWeight){
+                this.outboundVolume += Number(response.records[i].settlementWeight.toFixed(2))
+              }
               // this.addressUrlArray1.push(response.records[i].collectionScreenshot.split('$'))
               if (response.records[i].collectionScreenshot != null) {
                 num = response.records[i].collectionScreenshot.split('$')