From 482efd9ee971fe7d799a015dc288340c85b8805c Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 29 九月 2022 11:24:17 +0800
Subject: [PATCH] 1.新增  提交类按钮只能提交一次的控制2.关联类的按钮  接口返回成功后显示对话框

---
 src/views/jcsz/zzjg.vue |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/views/jcsz/zzjg.vue b/src/views/jcsz/zzjg.vue
index baacc88..5fa44be 100644
--- a/src/views/jcsz/zzjg.vue
+++ b/src/views/jcsz/zzjg.vue
@@ -5,7 +5,6 @@
       <div class="bodyTopButtonGroup">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
       </div>
-
       <div class="bodyTopFormGroup">
         <el-form
           ref="form"
@@ -204,7 +203,12 @@
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
           <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
-          <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+          <el-button
+            type="primary"
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            @click="dialogVisibleConfirm"
+          >纭� 瀹�</el-button>
         </div>
       </span>
     </el-dialog>
@@ -329,6 +333,9 @@
     //   })()
     // }
   },
+  destroyed() {
+
+  },
   methods: {
     async getOrganizationSearch() {
       const res = await OrganizationSearch(this.form)
@@ -367,7 +374,6 @@
         this.SupUnitArr = res
       }
     },
-
     // 鏂板鎸夐挳
     async add(operation) {
       this.operation = operation
@@ -437,6 +443,7 @@
     dialogVisibleConfirm() {
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
+          this.$store.state.app.buttonIsDisabled = true
           const data = {
             OrganType: this.dialogForm.OrgType === '閮ㄩ棬' ? 'D' : 'W',
             OrganCode: this.dialogForm.OrgCode,
@@ -452,11 +459,13 @@
 
           AddUpdateOrganization(data).then(res => {
             if (res.code === '200') {
-              this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
               this.dialogVisible = false
+              this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
               this.getOrganizationSearch()
+              this.$store.state.app.buttonIsDisabled = false
             } else {
               this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+              this.$store.state.app.buttonIsDisabled = false
             }
           })
         }
@@ -568,11 +577,12 @@
   margin-bottom: 0;
 }
 
-.tableFixed{
-  ::v-deep .el-table__fixed-right{
+.tableFixed {
+  ::v-deep .el-table__fixed-right {
     height: 100% !important;
   }
-  ::v-deep .el-table__fixed{
+
+  ::v-deep .el-table__fixed {
     height: 100% !important;
   }
 }
@@ -588,6 +598,9 @@
 //}
 </style>
 <style>
+.osloading{
+  font-size: 30px;
+}
 
 .el-table .custom-row {
   background: #f8f8fa;

--
Gitblit v1.9.3