Prechádzať zdrojové kódy

物资说明上传pdf新增了截图 接口上传慢所及加了按钮动画

pm 8 mesiacov pred
rodič
commit
319365cf8c

+ 19 - 3
src/views/mes/material/instructions/index.vue

@@ -167,7 +167,8 @@
       @pagination="getList"
     />
     <!-- 添加或修改物资对话框 -->
-    <el-dialog :visible.sync="open" width="500px" append-to-body>
+    <el-dialog :visible.sync="open" width="500px" append-to-body >
+
       <div slot="title" class="dialog-title">
         <i></i>
         <span class="title">{{ title }}</span>
@@ -253,12 +254,14 @@
         </el-form-item>
       </el-form>
 
+
       <div slot="footer" class="dialog-footer">
-        <el-button v-no-more-click type="primary" @click="submitForm"
-          >确 定
+        <el-button v-no-more-click type="primary" @click="submitForm" :loading="loadingDialog"
+        >{{ loadingDialog?'正在上传':'确认' }}
         </el-button>
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
+
     </el-dialog>
 
     <!--  说明上传-->
@@ -328,6 +331,7 @@ export default {
       optType: undefined,
       // 遮罩层
       loading: true,
+      loadingDialog:false,//弹框新增的等待效果
       // 选中数组
       ids: [],
       codes: [],
@@ -523,12 +527,16 @@ export default {
     submitForm() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          this.loadingDialog = true;
+
           if (this.form.instructionsId != null) {
             updateInstructions(this.form).then((response) => {
               console.log(response, "修改返回");
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+            }).finally(() => {
+              this.loadingDialog = false;  // 结束加载
             });
           } else {
             console.log(this.form, "新增参数");
@@ -537,6 +545,8 @@ export default {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+            }).finally(() => {
+              this.loadingDialog = false;  // 结束加载
             });
           }
         }
@@ -564,4 +574,10 @@ export default {
 .el-input-width {
   width: 380px !important;
 }
+.el-loading-parent--relative {
+  position: relative;
+}
+.el-loading-mask {
+  background-color: rgba(255, 255, 255, 0.7);
+}
 </style>