Browse Source

05161034lhj日付

liuhj 11 months ago
parent
commit
dd2cd5a5c4
1 changed files with 66 additions and 27 deletions
  1. 66 27
      src/components/Finance/DailyFeePayment.vue

+ 66 - 27
src/components/Finance/DailyFeePayment.vue

@@ -176,12 +176,7 @@
 
 <script>
 export default {
-    beforeRouteLeave(to, from, next) {
-        if(to.name!='DailyFeeedit'){
-            from.meta.keepAlive = false;
-        }
-        next()
-    },
+    
     data() {
         return {
             banned:true,
@@ -284,8 +279,7 @@ export default {
         numFilter(row,column) {
             return parseFloat(row[column.property]).toFixed(2);
         },
-        async postPageDailyPaymentList() {
-            console.log(this.feeTypValue)
+        postPageDailyPaymentList() {
             var url = "/api/Financial/PostPageSearchDailyPaymentList"
             var that = this
             this.$axios({
@@ -373,7 +367,6 @@ export default {
                     this.feeSubTypeData.push(this.feeSubType[i]);
                 }
             }
-            console.log(this.feeTypValue);
             if(this.feeSubTypeData.length==1){
                 this.banned=true;
             }else{
@@ -391,7 +384,7 @@ export default {
         },
         //编辑保存全局变量
         handleEdit(index, row) {
-            this.$store.state.PaymentRequest = {
+            var PaymentRequest = {
                 feeTypValue:this.feeTypValue,
                 feeSubTypeValue:this.feeSubTypeValue,
                 financialValue:this.financialValue,
@@ -402,20 +395,57 @@ export default {
                 pgindex:this.currentPage,
                 pageSize:this.pageSize,
             };
+            localStorage.setItem('PaymentRequest', JSON.stringify(PaymentRequest));
             this.$router.push({path: '/home/DailyFeeedit?id=' + row.id +''});
         },
         //判断全局变量是否有值
         estimatePaymentRequest(){
-            console.log(this.$store.state.PaymentRequest);
-            this.feeTypValue=this.$store.state.PaymentRequest.feeTypValue?this.$store.state.PaymentRequest.feeTypValue:-1;
-            this.feeSubTypeValue=this.$store.state.PaymentRequest.feeSubTypeValue?this.$store.state.PaymentRequest.feeSubTypeValue:-1;
-            this.financialValue=this.$store.state.PaymentRequest.financialValue?this.$store.state.PaymentRequest.financialValue:-1;
-            this.GMValue=this.$store.state.PaymentRequest.GMValue?this.$store.state.PaymentRequest.GMValue:-1;
-            this.formInline.feeDesc=this.$store.state.PaymentRequest.feeDesc?this.$store.state.PaymentRequest.feeDesc:'';
-            this.userNameValue=this.$store.state.PaymentRequest.userNameValue?this.$store.state.PaymentRequest.userNameValue:'';
-            this.isPaySign=this.$store.state.PaymentRequest.isPaySign?this.$store.state.PaymentRequest.isPaySign:'-1';
-            this.currentPage=this.$store.state.PaymentRequest.pgindex?this.$store.state.PaymentRequest.pgindex:1;
-            this.pageSize=this.$store.state.PaymentRequest.pageSize?this.$store.state.PaymentRequest.pageSize:10;
+            if(JSON.parse(localStorage.getItem('PaymentRequest'))){
+                this.feeTypValue=JSON.parse(localStorage.getItem('PaymentRequest')).feeTypValue;
+                this.feeSubTypeValue=JSON.parse(localStorage.getItem('PaymentRequest')).feeSubTypeValue;
+                this.financialValue=JSON.parse(localStorage.getItem('PaymentRequest')).financialValue;
+                this.GMValue=JSON.parse(localStorage.getItem('PaymentRequest')).GMValue;
+                this.formInline.feeDesc=JSON.parse(localStorage.getItem('PaymentRequest')).feeDesc;
+                this.userNameValue=JSON.parse(localStorage.getItem('PaymentRequest')).userNameValue;
+                this.isPaySign=JSON.parse(localStorage.getItem('PaymentRequest')).isPaySign;
+                this.currentPage=JSON.parse(localStorage.getItem('PaymentRequest')).pgindex;
+                this.pageSize=JSON.parse(localStorage.getItem('PaymentRequest')).pageSize;
+                
+               
+                var url = "/api/Financial/PostPageSearchDailyPaymentPriceTypeData"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + that.token
+                    },
+                    data: {
+                        portType: 1,
+                    }
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.feeSubType=res.data.data.feeSubTypeData;
+                        that.feeSubTypeData=[
+                            {
+                                id: -1,
+                                name: "全部",
+                                sTid:'-1'
+                            }
+                        ];
+                        for(var i=0;i<that.feeSubType.length;i++){
+                            if(that.feeSubType[i].sTid==that.feeTypValue){
+                                that.feeSubTypeData.push(that.feeSubType[i]);
+                            }
+                        }
+                        if(that.feeSubTypeData.length==1){
+                            that.banned=true;
+                        }else{
+                            that.banned=false;
+                        }
+                    }
+                })
+            }
         },
         handleDelete(index, row,rows) {
             console.log(index, row);
@@ -513,25 +543,34 @@ export default {
         }
     },
     created(){
-        this.estimatePaymentRequest();
+        
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
         this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
+        this.getTypeData();
         this.judgmentpms();
+        this.estimatePaymentRequest();
     }, 
     mounted() {
         this.postPageDailyPaymentList();
-        this.getTypeData();
+        // this.getTypeData();
         
     },
     watch:{
         'feeSubTypeData.length': {
-        handler(newValue, oldValue) {
-            if (newValue !== oldValue) {
-                // this.banned=false
+            handler(newValue, oldValue) {
+                if (newValue !== oldValue) {
+                    // this.banned=false
+                }
             }
         }
-    }
-    }
+    },
+    beforeRouteLeave(to, from, next) {
+        console.log(to)
+        if(to.name!='DailyFeeedit'){
+            localStorage.removeItem('PaymentRequest');
+        }
+        next()
+    },
 }
 </script>
 <style>