Просмотр исходного кода

文件收集审批-下发只能走一次

hujunwei 2 лет назад
Родитель
Сommit
7f61da1eb4

+ 13 - 4
src/pages/main/performance/components/dialog.vue

@@ -16,7 +16,7 @@
     <div slot="footer">
       <slot name="footer">
         <el-button @click="handleCancel" size="small">取消</el-button>
-        <el-button @click="handleConfirm" type="primary" size="small" :disabled="this.btnDisabled"
+        <el-button @click="handleConfirm" type="primary" size="small" :disabled="this.BtnDisabled"
           >确定</el-button
         >
       </slot>
@@ -27,6 +27,10 @@
 <script>
 export default {
   props: {
+    btnDisabled: {
+      type: Boolean,
+      default: false,
+    },
     visible: {
       type: Boolean,
       default: false,
@@ -58,17 +62,22 @@ export default {
   },
   data(){
     return{
-      btnDisabled: false,
+      BtnDisabled: false,
     }
   },
   mounted() {
   },
+  watch:{
+    btnDisabled(val){
+      this.BtnDisabled =val
+    }
+  },
   methods: {
     //   确定的回调
     handleConfirm() {
-    this.btnDisabled = false;
+    this.BtnDisabled = false;
     this.$emit("confirm", false);      
-    this.btnDisabled = true;
+    // this.BtnDisabled = this.btnDisabled;
     },
     //   取消的回调
     handleCancel() {

+ 4 - 0
src/pages/main/performance/mould.vue

@@ -29,6 +29,7 @@
       width="500px"
       @cancel="handleVisible('issue')"
       @confirm="handleIssue"
+      :btnDisabled="btnDisabled"
       :visible="issue_visible"
     >
       <el-form label-width="120px" :model="issue_form" ref="issue_ref">
@@ -132,6 +133,7 @@ export default {
   },
   data() {
     return {
+      btnDisabled: false,
       page: 1,
       rows: 10,
       total: 0,
@@ -328,6 +330,7 @@ export default {
       });
     },
     handleIssue() {
+      
       this.$refs["issue_ref"].validate((valid) => {
         if (valid) {
           let url = "";
@@ -361,6 +364,7 @@ export default {
               }
             }
           }
+          this.btnDisabled = true;
           this.$http({
             url: url,
             method: "post",