gjy 2 år sedan
förälder
incheckning
d952adb819
1 ändrade filer med 21 tillägg och 20 borttagningar
  1. 21 20
      src/views/profitable/contractprofitsdetails.vue

+ 21 - 20
src/views/profitable/contractprofitsdetails.vue

@@ -235,9 +235,9 @@
                       weightprice+=(data[i].weight*data[i].settlementPrice)
                   }
                   if(row.agreementType=='收购合同'||row.agreementType=='采购合同'){
-                    row.profit=weightprice-(row.weight*row.settlementPrice)
+                    row.profit=weightprice-(row.actualWeight*row.settlementPrice)
                   }else if(row.agreementType=='销售合同'){
-                    row.profit=(row.weight*row.settlementPrice)-weightprice
+                    row.profit=(row.actualWeight*row.settlementPrice)-weightprice
                   }
         this.$confirm('结算后当前合同和相关合同不可再进行费用相关操作', '提示', {
             confirmButtonText: '确定',
@@ -262,6 +262,7 @@
         })
       },
       finalstatement(row){
+        console.log(row)
         this.tableData.contractNo=row.contractNo
         this.tableData.agreementType=row.agreementType
         this.tableData.buyer=row.buyer
@@ -289,20 +290,20 @@
         this.$router.push({name:'contractcost',query:{contractNo:row.contractNo,contractType:row.contractType,buyer:row.buyer,seller:row.seller}})
       },
       getPassYearFormatDate () {
-        getcontractdetails({
-            // warehouseType: 1,
-            agreementType: this.agreementType,
-            startDate:this.startDate,
-            endDate:this.endDate,
-            currentPage: 1,
-            pageSize:9999 ,
-            searchType:this.searchType,
-            searchContractType:this.searchContractType,
-            searchTypeCon:this.searchTypeCon
-          })
-          .toPromise()
-          .then(response => {
-            this.tableData = response.records
+        // getcontractdetails({
+        //     // warehouseType: 1,
+        //     agreementType: this.agreementType,
+        //     startDate:this.startDate,
+        //     endDate:this.endDate,
+        //     currentPage: 1,
+        //     pageSize:9999 ,
+        //     searchType:this.searchType,
+        //     searchContractType:this.searchContractType,
+        //     searchTypeCon:this.searchTypeCon
+        //   })
+        //   .toPromise()
+        //   .then(response => {
+        //     this.tableData = response.records
              var _date = new Date()
             var year1 = _date.getFullYear()
             var month1 = _date.getMonth() + 1
@@ -313,11 +314,11 @@
             if (strDate1 >= 0 && strDate1 <= 9) {
               strDate1 = '0' + strDate1
             }
-            this.startDate = response.records[response.records.length-1].signingDate
+            this.startDate = year1 + '-' + month1 +'-' + strDate1
             this.endDate = year1 + '-' + month1 +'-' + strDate1
             this.value=[this.startDate,this.endDate]
             this.getList()
-          })
+          // })
         },
       async getList() {
          getcontractdetails({
@@ -347,9 +348,9 @@
                     // weightprice1-=(data[i].weight*data[i].settlementPrice)
                   }
                   if(response.records[i].agreementType=='收购合同'||response.records[i].agreementType=='采购合同'){
-                    response.records[i].profit=weightprice-(response.records[i].weight*response.records[i].settlementPrice)
+                    response.records[i].profit=weightprice-(response.records[i].actualWeight*response.records[i].settlementPrice)
                   }else if(response.records[i].agreementType=='销售合同'){
-                    response.records[i].profit=(response.records[i].weight*response.records[i].settlementPrice)-weightprice
+                    response.records[i].profit=(response.records[i].actualWeight*response.records[i].settlementPrice)-weightprice
                   }
                 }
                 response.records[i].profit=Number(Number(response.records[i].profit/10000).toFixed(3))