فهرست منبع

流程页面、附件组件添加加载中状态

lizhenhao 2 سال پیش
والد
کامیت
d62102bd9a

+ 12 - 2
src/views/common/UpLoadComponent.vue

@@ -12,13 +12,14 @@
                :on-change="changes"
                :on-progress="uploadVideoProcess"
                :file-list="fileList">
-      <el-button type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
+      <el-button :loading="loading" type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
       <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
       <el-table
         ref="uploadTable"
+        v-loading="loading"
         :key="tableKey"
         :data="dataListNew">
         <el-table-column type="seq" width="40"></el-table-column>
@@ -92,7 +93,8 @@
         uploadFlag: false,
         delFlag: false,
         createBy: '',
-        showDivider: true
+        showDivider: true,
+        loading: false
       }
     },
     watch: {
@@ -355,6 +357,14 @@
       },
       fileLoadingFalse () {
         this.fileLoading = false
+      },
+      // 开启/关闭页面的加载中状态
+      changeLoading (loading) {
+        if (this.commonJS.isNotEmpty(loading)) {
+          this.loading = loading
+        } else {
+          this.loading = false
+        }
       }
     }
   }

+ 12 - 2
src/views/common/UpLoadComponentV2.1.vue

@@ -12,7 +12,7 @@
                :on-change="changes"
                :on-progress="uploadVideoProcess"
                :file-list="fileList">
-      <el-button type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
+      <el-button :loading="loading" type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
     </el-upload>
     <el-button v-if="showSign" type="info" size="mini" style="float: right;" @click="clickSign">签章</el-button>
     <div style="height: calc(100% - 80px);margin-top: 10px">
@@ -21,6 +21,7 @@
       <el-table
         ref="uploadTable"
         :key="tableKey"
+        v-loading="loading"
         :data="dataListNew">
         <el-table-column type="seq" width="40"></el-table-column>
         <el-table-column label="文件名称" prop="name" align="center">
@@ -138,7 +139,8 @@
         fileType: '',
         sealType: '',
         remarks: '',
-        showSign: false
+        showSign: false,
+        loading: false
       }
     },
     watch: {
@@ -705,6 +707,14 @@
       // 隐藏签章按钮
       hideSign () {
         this.showSign = false
+      },
+      // 开启/关闭页面的加载中状态
+      changeLoading (loading) {
+        if (this.commonJS.isNotEmpty(loading)) {
+          this.loading = loading
+        } else {
+          this.loading = false
+        }
       }
     }
   }

+ 12 - 2
src/views/common/UpLoadComponentV2.vue

@@ -12,7 +12,7 @@
                :on-change="changes"
                :on-progress="uploadVideoProcess"
                :file-list="fileList">
-      <el-button type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
+      <el-button :loading="loading" type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -22,6 +22,7 @@
         :key="tableKey"
         @row-click="tableRowClick"
         :row-class-name="tableRowClassName"
+        v-loading="loading"
         :data="dataListNew">
         <el-table-column type="seq" width="40"></el-table-column>
         <el-table-column label="文件名称" prop="name" align="center">
@@ -130,7 +131,8 @@
         showDivider: true,
         fileType: '',
         sealType: '',
-        remarks: ''
+        remarks: '',
+        loading: false
       }
     },
     watch: {
@@ -668,6 +670,14 @@
             this.dataListNew[index].remarks = this.remarks
           }
         })
+      },
+      // 开启/关闭页面的加载中状态
+      changeLoading (loading) {
+        if (this.commonJS.isNotEmpty(loading)) {
+          this.loading = loading
+        } else {
+          this.loading = false
+        }
       }
     }
   }

+ 12 - 2
src/views/common/UpLoadComponentV3.1.vue

@@ -12,7 +12,7 @@
                :on-change="changes"
                :on-progress="uploadVideoProcess"
                :file-list="fileList">
-      <el-button type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
+      <el-button :loading="loading" type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -20,6 +20,7 @@
       <el-table
         ref="uploadTable"
         :key="tableKey"
+        v-loading="loading"
         :data="dataListNew">
         <el-table-column type="seq" width="40"></el-table-column>
         <el-table-column label="文件名称" prop="name" align="center">
@@ -119,7 +120,8 @@
         createBy: '',
         showDivider: true,
         fileType: '',
-        remarks: ''
+        remarks: '',
+        loading: false
       }
     },
     watch: {
@@ -578,6 +580,14 @@
             this.dataListNew[index].remarks = this.remarks
           }
         })
+      },
+      // 开启/关闭页面的加载中状态
+      changeLoading (loading) {
+        if (this.commonJS.isNotEmpty(loading)) {
+          this.loading = loading
+        } else {
+          this.loading = false
+        }
       }
     }
   }

+ 12 - 2
src/views/common/UpLoadComponentV3.vue

@@ -12,7 +12,7 @@
                :on-change="changes"
                :on-progress="uploadVideoProcess"
                :file-list="fileList">
-      <el-button type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
+      <el-button :loading="loading" type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
     </el-upload>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
@@ -22,6 +22,7 @@
         :key="tableKey"
         @row-click="tableRowClick"
         :row-class-name="tableRowClassName"
+        v-loading="loading"
         :data="dataListNew">
         <el-table-column type="seq" width="40"></el-table-column>
         <el-table-column label="文件名称" prop="name" align="center">
@@ -118,7 +119,8 @@
         createBy: '',
         showDivider: true,
         fileType: '',
-        remarks: ''
+        remarks: '',
+        loading: false
       }
     },
     watch: {
@@ -577,6 +579,14 @@
             this.dataListNew[index].remarks = this.remarks
           }
         })
+      },
+      // 开启/关闭页面的加载中状态
+      changeLoading (loading) {
+        if (this.commonJS.isNotEmpty(loading)) {
+          this.loading = loading
+        } else {
+          this.loading = false
+        }
       }
     }
   }

+ 32 - 2
src/views/modules/cw/projectReportArchive/ProjectReportArchiveTaskForm.vue

@@ -361,6 +361,13 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          console.log(newVal)
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     components: {
@@ -467,10 +474,32 @@
         })
       },
       saveForm (callback) {
-        this.doSubmit('save', callback)
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.projectReportArchiveService.queryById(this.inputForm.id).then(({data}) => {
+            if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”,就弹出提示
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error()
+            } else {
+              this.doSubmit('save', callback)
+            }
+          })
+        } else {
+          this.doSubmit('save', callback)
+        }
       },
       startForm (callback) {
-        this.doSubmit('start', callback)
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.projectReportArchiveService.queryById(this.inputForm.id).then(({data}) => {
+            if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error()
+            } else {
+              this.doSubmit('start', callback)
+            }
+          })
+        } else {
+          this.doSubmit('start', callback)
+        }
       },
       async agreeForm (callback) {
         await this.projectReportArchiveService.queryById(this.inputForm.id).then(({data}) => {
@@ -508,6 +537,7 @@
           })
           this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
           this.projectReportArchiveService.saveForm(this.inputForm).then(({data}) => {
+            this.inputForm.id = data.businessId
             callback(data.businessTable, data.businessId, this.inputForm)
             this.loading = false
           }).catch(() => {

+ 1 - 1
src/views/modules/flowable/task/TaskForm.vue

@@ -4,7 +4,7 @@
 
   <el-tabs type="border-card" v-model="taskSelectedTab">
     <el-tab-pane label="表单信息" name="form-first">
-      <component id="printForm" :status="status" :formReadOnly="formReadOnly" v-if="formType === '2'" :class="formReadOnly?'readonly':''" ref="form" :businessId="businessId" :is="form" @callBackFunc="callBackFunc"></component>
+      <component id="printForm" :status="status" :formReadOnly="formReadOnly" v-if="formType === '2'" :class="formReadOnly?'readonly':''" ref="form" :businessId="businessId" :is="form" @callBackFunc="callBackFunc" @changeLoading="changeLoading"></component>
 
       <PreviewForm  id="printForm"   v-if="formType !== '2'"  :processDefinitionId="procDefId" :edit="true" :taskFormData="taskFormData" ref="form"/>
     </el-tab-pane>