Bläddra i källkod

成本添加上一次团组缓存以及默认人数

123456 1 år sedan
förälder
incheckning
a0e0d8f382
1 ändrade filer med 46 tillägg och 10 borttagningar
  1. 46 10
      src/components/Finance/Cost.vue

+ 46 - 10
src/components/Finance/Cost.vue

@@ -2568,6 +2568,9 @@ export default {
                     that.options = resp.data.data.groupList;
                     that.grouptitleinfo = resp.data.data.groupInfo.data;
                     that.diid = that.grouptitleinfo.id;
+                    localStorage.setItem('costLoadData', JSON.stringify({
+                        diid: that.diid
+                    }))
                     that.QueryRate();
 
                     for (var i = 0; i < that.CheckBoxListSelect.length; i++) {
@@ -2664,12 +2667,12 @@ export default {
                         if (acostvalue != undefined) {
                             that.AGroupCostParameter = acostvalue;
                             var result = Number(that.AGroupCostParameter.currency);
-                            if(isNaN(result)){
+                            if (isNaN(result)) {
 
-                            }else{
+                            } else {
                                 that.AGroupCostParameter.currency = result;
                             }
-                            
+
                         } else {
                             that.AGroupCostParameter = {
                                 "id": 0,
@@ -3053,6 +3056,8 @@ export default {
                         that.ShowBaoPi = [];
                     }
 
+                    that.GivePeopleNumber();
+
                 }
                 that.costloading = false;
             }).catch(err => {
@@ -3141,10 +3146,10 @@ export default {
                             resolve(false);
                         }
 
-                        var result  = Number(that.AGroupCostParameter.currency);
-                        if(isNaN(result)){
+                        var result = Number(that.AGroupCostParameter.currency);
+                        if (isNaN(result)) {
 
-                        }else{
+                        } else {
                             that.AGroupCostParameter.currency = result;
                         }
                     })
@@ -4195,9 +4200,9 @@ export default {
             }
 
             var resultCurr = Number(this.AGroupCostParameter.currency);
-            if(isNaN(resultCurr)){
+            if (isNaN(resultCurr)) {
                 resultCurr = this.AGroupCostParameter.currency;
-            }else{
+            } else {
                 for (let index = 0; index < this.currencyOption.length; index++) {
                     if (this.currencyOption[index].currencyId == resultCurr) {
                         resultCurr = this.currencyOption[index].currencyCode;
@@ -4746,13 +4751,44 @@ export default {
                     break;
                 }
             }
+        },
+        inSelectChangeCheck() {
+            var defaultP = this.costTypeHotelNumbers.filter(item => item.type == 'Default')[0];
+            var A = this.costTypeHotelNumbers.filter(item => item.type == 'A')[0];
+            var B = this.costTypeHotelNumbers.filter(item => item.type == 'B')[0];
+
+        },
+        GivePeopleNumber() {
+            var number = this.grouptitleinfo.visitPNumber;
+            if (this.AGroupCostParameter.visaRS == 0) {
+                this.AGroupCostParameter.visaRS = number;
+            }
+            if (this.AGroupCostParameter.bxrs == 0) {
+                this.AGroupCostParameter.bxrs = number;
+            }
+            if (this.AGroupCostParameter.djrs == 0) {
+                this.AGroupCostParameter.djrs = number;
+            }
+            if (this.AGroupCostParameter.lyjrs == 0) {
+                this.AGroupCostParameter.lyjrs = number;
+            }
+            if (this.AGroupCostParameter.gwrs == 0) {
+                this.AGroupCostParameter.gwrs = number;
+            }
         }
     },
     mounted() {
-
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
         this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
-        this.loadData(-1);
+        var costLoadData = localStorage.getItem('costLoadData');
+        if (costLoadData) {
+            var JSONP = JSON.parse(costLoadData);
+            var diidP = Number(JSONP.diid);
+            this.loadData(isNaN(diidP) ? -1 : diidP);
+        } else {
+            this.loadData(-1);
+        }
+
         window.Vue = this;
     },
     computed: {