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/scgl/scdd.vue |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/views/scgl/scdd.vue b/src/views/scgl/scdd.vue
index 262793f..c6c1ced 100644
--- a/src/views/scgl/scdd.vue
+++ b/src/views/scgl/scdd.vue
@@ -370,7 +370,12 @@
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
           <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
-          <el-button type="primary" :disabled="sendButtonIsDisabled" @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>
@@ -653,7 +658,6 @@
       this.dialogForm.ordernum = ''
       this.dialogForm.relse_qty = ''
 
-      this.sendButtonIsDisabled = false
       this.$refs.dialogForm.clearValidate()
     },
     // 瀵硅瘽妗嗗彇娑�
@@ -670,13 +674,13 @@
         return this.$message.info('涓嬪崟鏁伴噺瓒呭嚭鍙笅鍗曟暟鐨勮寖鍥达紒')
       }
 
-      console.log(this.dialogForm.ordernum < this.dialogForm.markqty)
       if (this.dialogForm.ordernum < 1 || this.dialogForm.ordernum > this.dialogForm.markqty) {
         return this.$message.info('涓嬪崟鍗曟暟瓒呭嚭鍙笅鍗曞崟鏁扮殑鑼冨洿锛�')
       }
 
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
+          this.$store.state.app.buttonIsDisabled = true
           const data = {
             'erporderid': this.dialogForm.erporderid,
             // 'erporderstus': this.dialogForm.erporderstus,
@@ -689,12 +693,12 @@
             'ordernum': this.dialogForm.ordernum,
             'relse_qty': this.dialogForm.relse_qty
           }
-          this.sendButtonIsDisabled = true
           MarkSaveErpOrder(data).then(res => {
             if (res.code === '200') {
-              this.$message.success('涓嬭揪鎴愬姛锛�')
               this.dialogVisible = false
+              this.$message.success('涓嬭揪鎴愬姛锛�')
               this.getErpOrderSearch()
+              this.$store.state.app.buttonIsDisabled = false
             } else {
               this.$message.error('涓嬭揪澶辫触锛�')
             }
@@ -839,15 +843,18 @@
     height: 100% !important;
   }
 }
+
 </style>
 <style>
 .el-table .custom-row {
   background: #f8f8fa;
 }
-</style>
-<style>
 .osloading{
-  font-size: 40px;
+  font-size: 26px !important;
 }
 
+.el-loading-text{
+  font-size: 26px !important;
+}
 </style>
+

--
Gitblit v1.9.3