Procházet zdrojové kódy

处理专利挖掘任务时加上按钮加载动画

zhuliu před 1 rokem
rodič
revize
ca9bfff098

+ 1 - 1
src/utils/window.js

@@ -34,7 +34,7 @@ function findComponentDownward(context, componentName) {
   const childrens = context.$children
   let children = null
 
-  if (childrens.length) {
+  if (childrens && childrens.length) {
     for (const child of childrens) {
       const name = child.$options.name
       if (name === componentName) {

+ 2 - 2
src/views/patentMining/components/details/index.vue

@@ -3,7 +3,7 @@
   <div class="height_100">
       <el-container>
         <el-header class="basic_header">
-            <el-tabs v-model="activeName" @tab-click="handleClick" type="card"  style="width:100%">
+            <el-tabs v-model="activeName" @tab-click="tabClick" type="card"  style="width:100%">
               <el-tab-pane v-for="item in menu" :key='item.path' :label="item.label" :name="item.path"></el-tab-pane>
             </el-tabs>
         </el-header>
@@ -67,7 +67,7 @@ export default {
         this.processId=val.pathId
       }
     },
-    handleClick(tab, event) {
+    tabClick(tab, event) {
         this.$nextTick(() => {
           this.processId=null
         })

+ 25 - 6
src/views/patentMining/components/dialog/handleTask2.vue

@@ -43,8 +43,8 @@
         <el-button @click="handleClose" size="small">取 消</el-button>
         <template>
           <div v-if="isLook" style="margin-left: 10px;">
-            <el-button @click="handleSave" size="small" type="primary">保 存</el-button>
-            <el-button @click="submit" size="small" type="primary">提交审核</el-button>
+            <el-button @click="handleSave" :loading="btnLoading" size="small" type="primary">保 存</el-button>
+            <el-button @click="submit" :loading="btnLoading" size="small" type="primary">提交审核</el-button>
           </div>
         </template>
 
@@ -79,6 +79,7 @@ export default {
       // 是否是处理任务?
       isLook: false,
       row: null,
+      btnLoading:false,
     };
   },
   watch: {},
@@ -166,17 +167,31 @@ export default {
     },
     // 保存
     async handleSave(type) {
+      if(type != 1){
+        if(this.form.systemFileList && this.form.systemFileList.length == 0){
+          this.handleClose()
+          return false
+        }
+      }
       // 判断文件是否都上传完毕
-      this.$commonJS.allUploadFile(this.form)
+      // this.$commonJS.allUploadFile(this.form)
+      var guids = this.$commonJS.checkUploadFile(this.form.systemFileList)
+      if(!guids){
+        return false
+      }
+      this.form.fileGuids = guids
       this.form.taskId = this.row.id
+      this.btnLoading = true
       await this.$api.addTaskAuditResult(this.form).then(res => {
         if (res.code == 200) {
           this.$message.success('保存文件成功')
-          if (!type) {
+          if (type != 1) {
             this.handleClose()
           }
+          this.btnLoading = false
         }
       })
+      return true
     },
     // 提交审核时有未保存的文件调用保存接口
     async isHandleSave() {
@@ -199,8 +214,12 @@ export default {
     },
 
     // 专利挖掘项目-文件分配任务审核
-    fileTask(form) {
-      this.isHandleSave()
+    async fileTask(form) {
+      // this.isHandleSave()
+      var sign = await this.handleSave(1)
+      if(!sign){
+        return false
+      }
       var params = {
         ...form,
         projectId: this.form.projectId,//项目id