zxz 2 anni fa
parent
commit
dbc53f697d
1 ha cambiato i file con 33 aggiunte e 22 eliminazioni
  1. 33 22
      src/views/profitable/contractprofitsdetails.vue

+ 33 - 22
src/views/profitable/contractprofitsdetails.vue

@@ -174,7 +174,7 @@
     components: {},
     data() {
       return {
-        value: "",
+        value: '',
         tableData: [],
         show:false,
         correlationshow:false,
@@ -183,12 +183,12 @@
         pageSize: 10,
         agreementType:'',
         deptCircularPage: {},
-        searchType:"",
-        searchKeyWord:"",
-        startDate:"",
+        searchType:'',
+        searchKeyWord:'',
+        startDate:'',
         searchContractType:'',
         searchTypeCon:'',
-        endDate:"",
+        endDate:'',
         outtotal:0,
         intotal:0,
         contractList:[],
@@ -301,23 +301,34 @@
       cost(row){
         this.$router.push({name:'contractcost',query:{contractNo:row.contractNo,contractType:row.contractType,buyer:row.buyer,seller:row.seller}})
       },
-      getPassYearFormatDate () {
-             var _date = new Date()
-            var year1 = _date.getFullYear()
-            var month1 = _date.getMonth() + 1
-            var strDate1 = _date.getDate()
-            if (month1 >= 1 && month1 <= 9) {
-              month1 = '0' + month1
-            }
-            if (strDate1 >= 0 && strDate1 <= 9) {
-              strDate1 = '0' + strDate1
-            }
-            this.startDate = year1 + '-' + (month1-1) +'-' + strDate1
-            this.endDate = year1 + '-' + month1 +'-' + strDate1
-            this.value=[this.startDate,this.endDate]
-            this.getList()
-          // })
-        },
+      getPassYearFormatDate() {
+        var _date = new Date()
+        var nowDate = new Date()
+        nowDate.setTime(nowDate.getTime() - 24 * 60 * 60 * 1000 * 30)
+        var year = nowDate.getFullYear()
+        var year1 = _date.getFullYear()
+        var month = nowDate.getMonth() + 1
+        var month1 = _date.getMonth() + 1
+        var strDate = nowDate.getDate()
+        var strDate1 = _date.getDate()
+        if (month >= 1 && month <= 9) {
+          month = '0' + month
+        }
+        if (month1 >= 1 && month1 <= 9) {
+          month1 = '0' + month1
+        }
+        if (strDate >= 0 && strDate <= 9) {
+          strDate = '0' + strDate
+        }
+        if (strDate1 >= 0 && strDate1 <= 9) {
+          strDate1 = '0' + strDate1
+        }
+        this.startDate = year + '-' + month + '-' + strDate
+        this.endDate = year1 + '-' + month1 + '-' + strDate1
+        this.value = [this.startDate, this.endDate]
+        this.getList()
+        // })
+      },
       async getList() {
          var response=await getcontractdetails({
             // warehouseType: 1,