Browse Source

05241045lhj添加防抖

liuhj 11 months ago
parent
commit
44fde5333a

+ 5 - 4
src/components/Finance/DailyFeeedit.vue

@@ -81,6 +81,7 @@
     </div>
 </template>
 <script>
+import {debounce} from '../../store/statice'
 export default {
     // beforeRouteLeave(to, from, next) {
     //     if(to.name=='DailyFeePayment'){
@@ -145,7 +146,7 @@ export default {
         }
     },
     methods:{
-        submitForm(formName) {
+        submitForm:debounce(function(formName) {
             this.$refs[formName].validate((valid) => {
                 if (valid) {
                     this.SumPrice=0;
@@ -190,7 +191,7 @@ export default {
                     return false;
                 }
             });
-        },
+        },1000,true),
         resetForm(formName) {
             // this.$refs[formName].resetFields();
             this.$router.push({ path: "/home/DailyFeePayment"});
@@ -347,7 +348,7 @@ export default {
             })
         },
         //审核
-        PostDelDailyPaymentAudit(val){
+        PostDelDailyPaymentAudit:debounce(function(val){
             var url = "/api/Financial/PostDelDailyPaymentAudit"
             var that = this
             var auditType=0
@@ -380,7 +381,7 @@ export default {
                     that.$message.error(res.data.msg);
                 }
             })
-        },
+        },1000,true),
         getPostSearchDailyPaymentInfo(){
             if(this.editid!=undefined){
                 console.log("jing")

+ 14 - 1
src/components/Finance/royaltypg.vue

@@ -2,12 +2,25 @@
     <div>
         <div class="royaltypg-all">
             提成
+            <el-button @click="addcost" type="primary">主要按钮</el-button>
         </div>
     </div>
 </template>
 <script>
+import {throttle} from '../../store/statice'
+import {debounce} from '../../store/statice'
 export default {
-    
+    data () {
+        return {
+            cost:0,
+        }
+    },
+    methods:{
+        addcost:debounce(function(){
+            this.cost++
+            console.log(this.cost)
+        },1000,true)
+    }
 }
 </script>
 <style>

+ 3 - 2
src/components/OP/HotelReservations.vue

@@ -478,6 +478,7 @@
 <script>
 import { el } from '@fullcalendar/core/internal-common';
 import { set } from 'vue';
+import {debounce} from '../../store/statice'
 export default {
     data() {
         return {
@@ -1198,7 +1199,7 @@ export default {
             });
         },
         //保存
-        AddBtn(RequiredParameters) {
+        AddBtn:debounce(function(RequiredParameters) {
             console.log(this.RequiredParameters.CurrentRate)
             if(this.RequiredParameters.CurrentRate=="当前团组未设置此币种汇率!"){
                 this.$alert('当前团组未设置此币种汇率,请前往设置!', '警告', {
@@ -1240,7 +1241,7 @@ export default {
                 }
             });
 
-        },
+        },1000,true),
         //预定成本
         BookingCost(){
             var url = "/api/Groups/PostHotelReservationsPredictedCostFileDownload"

+ 3 - 2
src/components/OP/Hotelenquiry.vue

@@ -196,6 +196,7 @@
     </div>
 </template>
 <script>
+import {debounce} from '../../store/statice'
 export default {
     data () {
         return {
@@ -406,7 +407,7 @@ export default {
             })
         },
         //保存新增
-        PostHotelInquiryAddOrEdit(enquiryinfo) {
+        PostHotelInquiryAddOrEdit:debounce(function(enquiryinfo) {
             this.$refs[enquiryinfo].validate((valid) => {
                 if (valid) {
                     var status=1
@@ -471,7 +472,7 @@ export default {
                 }
             })
             
-        },
+        },1000,true),
         //新增切换
         AddToggle(){
             this.enquiryinfo={