فهرست منبع

维修按钮多少点击重复bug

hzj18279462576@163.com 1 سال پیش
والد
کامیت
f534cd6ff6
1فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 10 3
      src/views/roomStatus/roomStatus.vue

+ 10 - 3
src/views/roomStatus/roomStatus.vue

@@ -2683,6 +2683,7 @@
               type="primary"
               @click="maintainConfirm(maintainRef)"
               style="margin-right: 20px"
+              :loading="maintainLoading"
             >
               确定
             </el-button>
@@ -3321,6 +3322,7 @@ const lockRoomRules = reactive({
 // 维修弹窗
 const maintainVisible = ref(false);
 const maintainRef = ref();
+const maintainLoading=ref(false)
 const maintainRuleForm = reactive({
   reason: "",
   // time: [dayjs().format('YYYY-MM-DD HH:mm:ss'),""],
@@ -5930,6 +5932,7 @@ const cancelMaintain = () => {
   maintainVisible.value = false;
 };
 const maintainConfirm = lodash.throttle(async (formEl) => {
+  maintainLoading.value=true;
   if (!formEl) return;
   await formEl.validate(async (valid, fields) => {
     if (valid) {
@@ -5953,7 +5956,9 @@ const maintainConfirm = lodash.throttle(async (formEl) => {
         getList();
         maintainVisible.value = false;
         maintainRef.value.resetFields();
+        maintainLoading.value=false;
       } else {
+        maintainLoading.value=false;
         ElMessage({
           type: "error",
           showClose: true,
@@ -5967,7 +5972,8 @@ const maintainConfirm = lodash.throttle(async (formEl) => {
   });
 }, 1500);
 // 取消维修功能
-const maintainCancel = async (row) => {
+const maintainCancel =lodash.throttle( async (row) => {
+  roomLoading.value = true; // 加载页面
   let data = {
     houseNumberId: row.houseNumberId,
     permissionSettingId: sessionStorage.getItem("permissionSettingId"),
@@ -5984,8 +5990,9 @@ const maintainCancel = async (row) => {
   console.log(res, "取消维修");
   if (res.data.code == 200) {
     getList();
-    maintainVisible.value = false;
     maintainRef.value.resetFields();
+    maintainVisible.value = false;
+    roomLoading.value = false; // 加载页面
     ElMessage({
       type: "success",
       showClose: true,
@@ -6000,7 +6007,7 @@ const maintainCancel = async (row) => {
       center: true,
     });
   }
-};
+},5000);
 
 //导出功能
 const importExcel = lodash.debounce(async () => {