lizhenhao 2 лет назад
Родитель
Сommit
1143b238fd

+ 8 - 0
src/api/flowable/TaskService.js

@@ -17,6 +17,14 @@ export default class TaskService {
     })
   }
 
+  getTaskId (data) {
+    return request({
+      url: '/flowable/task/getTaskId',
+      method: 'post',
+      data: data
+    })
+  }
+
   historicList (params) {
     return request({
       url: '/flowable/task/historic',

+ 14 - 2
src/views/modules/flowable/task/TaskForm.vue

@@ -173,6 +173,9 @@
         this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
       } else if (this.status === 'reback') {
         this.buttons = [{code: '_flow_reback', name: '撤回', isHide: '0'}]
+      } else if (this.status === 'agreeAndReject') {
+        this.buttons = [{code: '_flow_agree', name: '同意', isHide: '0'}, {code: '_flow_reject', name: '驳回', isHide: '0'}]
+        this.status = 'audit'
       } else if (this.procDefKey && this.taskDefKey) {
         // 读取按钮
         this.taskDefExtensionService.queryByDefIdAndTaskId({
@@ -243,6 +246,7 @@
         this.auditForm.assignee = null
         this.auditForm.userIds = null
         this.auditForm.message = ''
+        this.cUser = this.commonJS.isEmpty(this.$route.query.cUser) ? false : this.$route.query.cUser
         this.contractTitle = this.$route.query.contractTitle
         if (this.$route.query.isShow === undefined || this.$route.query.isShow === '') {
           this.isShow = 'true'
@@ -361,7 +365,14 @@
           type: 'warning'
         }).then(async () => {
           if (this.formType === '2') {
-            await this.$refs.form.updateStatusById('reject')
+            console.log('cUser', this.cUser)
+            if (this.cUser === true) { // cUser为true则页面审核人为自定义多选,驳回时要将审核人重新定义一次
+              await this.$refs.form.updateStatusById('reject', (businessTable, businessId, inputForm) => {
+                this.auditForm.candidateUserList = inputForm.assignee
+              })
+            } else {
+              await this.$refs.form.updateStatusById('reject')
+            }
           }
           this.taskService.backNodes(this.taskId).then(({data}) => {
             let backNodes = data
@@ -685,7 +696,8 @@
           status: '',
           userIds: null,
           assignee: null
-        }
+        },
+        cUser: false
       }
     }
   }

+ 6 - 3
src/views/modules/flowable/task/TodoList.vue

@@ -209,8 +209,11 @@
       },
       todo (row) {
         // eslint-disable-next-line no-unused-vars
-        var sum = this.mySum
-        console.log(sum)
+        let sum = this.mySum
+        let cUser = false
+        if (row.processDefinitionName === '业务提问') {
+          cUser = true
+        }
         this.taskService.getTaskDef({
           taskId: row.task.id,
           taskName: row.task.name,
@@ -222,7 +225,7 @@
         }).then(({data}) => {
           this.$router.push({
             path: '/flowable/task/TaskForm',
-            query: {formTitle: `${row.vars.title}`, isShow: false, formReadOnly: true, title: `审批【${row.task.name || ''}】`, ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId'), num: sum}
+            query: {formTitle: `${row.vars.title}`, cUser: cUser, isShow: false, formReadOnly: true, title: `审批【${row.task.name || ''}】`, ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId'), num: sum}
           })
         })
       },

+ 61 - 8
src/views/modules/klgBase/questions/KlgBaseQuestionsForm.vue

@@ -64,6 +64,13 @@
             <WangEditor ref="contentEditor" v-model="inputForm.content"/>
           </el-form-item>
         </el-col>
+        <el-col :span="24" v-for="(item,index) in inputForm.klgBaseReplyDTOList">
+          <el-form-item :label="commonJS.isNotEmpty(item.replyName)?item.replyName+'回复:':'回复:'"
+                        :prop="'content'+index"
+          >
+            <WangEditor ref="contentEditorList" v-model="item.content"/>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
     <!--        附件-->
@@ -184,10 +191,12 @@
         this.$nextTick(() => {
           this.$refs.inputForm.resetFields()
           this.loading = true
+          this.$refs.contentEditor.clear()
           this.klgBaseQuestionsService.queryById(this.inputForm.id).then(({data}) => {
-            this.$refs.contentEditor.clear()
-            if (this.commonJS.isNotEmpty(this.inputForm.status) && this.inputForm.status !== '1') {
+            if (this.status === 'audit') {
               this.$refs.contentEditor.disable()
+            } else {
+              this.$refs.contentEditor.enable()
             }
             this.$refs.uploadComponent.clearUpload()
             this.inputForm = this.recover(this.inputForm, data)
@@ -207,6 +216,23 @@
             } else {
               this.$refs.uploadComponent.newUpload('view', this.inputForm.workAttachmentDtoList, 'klg_questions', null, null, true, JSON.parse(localStorage.getItem('user')).name)
             }
+            this.$nextTick(() => {
+              if (this.commonJS.isNotEmpty(this.inputForm.klgBaseReplyDTOList)) {
+                if (this.status === 'audit') {
+                  this.inputForm.klgBaseReplyDTOList.push({content: ''})
+                }
+                this.inputForm.klgBaseReplyDTOList.forEach((item, index) => {
+                  if (this.commonJS.isNotEmpty(item.content)) {
+                    this.$refs.contentEditorList[index].init(item.content)
+                  }
+                })
+              } else {
+                this.inputForm.klgBaseReplyDTOList = []
+                if (this.status === 'audit') {
+                  this.inputForm.klgBaseReplyDTOList.push({content: ''})
+                }
+              }
+            })
             this.loading = false
           })
         })
@@ -219,7 +245,7 @@
       },
       async agreeForm (callback) {
         await this.klgBaseQuestionsService.queryById(this.inputForm.id).then(({data}) => {
-          if (data.status !== '2' || this.inputForm.procInsId !== data.procInsId) { // status的值不等于“审核中”,或者“procInsId”已经改变,就弹出提示
+          if (this.inputForm.procInsId !== data.procInsId) { // “procInsId”已经改变,就弹出提示
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             this.err = true
           }
@@ -264,7 +290,12 @@
           this.inputForm.status = '2'
         } else if (status === 'agree') {
           // 审核同意
-          this.inputForm.status = '5'
+          if (this.inputForm.status === '2') {
+            this.inputForm.status = '5'
+          }
+          if (this.inputForm.status === '5') {
+            this.inputForm.status = '9'
+          }
         }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
@@ -273,6 +304,11 @@
               this.loading = false
               return
             }
+            this.inputForm.klgBaseReplyDTOList.forEach((item, index) => {
+              if (this.commonJS.isEmpty(item.content)) {
+                this.inputForm.klgBaseReplyDTOList.splice(index, 1)
+              }
+            })
             this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
             if (this.commonJS.isNotEmpty(this.inputForm.disposeBy)) {
               this.inputForm.klgBaseDisposeDTOList = []
@@ -293,13 +329,13 @@
           }
         })
       },
-      async updateStatusById (type) {
+      async updateStatusById (type, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
         }
         await this.klgBaseQuestionsService.queryById(this.inputForm.id).then(({data}) => {
-          if (data.status !== '2' || this.inputForm.procInsId !== data.procInsId) { // status的值不等于“审核中”,或者“procInsId”已经改变,就弹出提示
+          if (this.inputForm.procInsId !== data.procInsId) { // status的值不等于“审核中”,或者“procInsId”已经改变,就弹出提示
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             this.err = true
           }
@@ -329,7 +365,17 @@
             } else {
               this.inputForm.klgBaseDisposeDTOList = []
             }
+            this.inputForm.klgBaseReplyDTOList.forEach((item, index) => {
+              if (this.commonJS.isEmpty(item.content)) {
+                this.inputForm.klgBaseReplyDTOList.splice(index, 1)
+              }
+            })
+            if (this.inputForm.status === '5') {
+              this.inputForm.status = '6'
+            }
             this.klgBaseQuestionsService.saveForm(this.inputForm).then(({data}) => {
+              this.inputForm.assignee = this.inputForm.disposeBy
+              callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {
               this.loading = false
@@ -338,8 +384,14 @@
           }
           if (type === 'reback') {
             // 撤回
-            let param = {status: '3', id: this.inputForm.id}
-            this.klgBaseQuestionsService.updateStatusById(param)
+            if (this.inputForm.status === '2') {
+              let param = {status: '3', id: this.inputForm.id}
+              this.klgBaseQuestionsService.updateStatusById(param)
+            }
+            if (this.inputForm.status === '6') {
+              let param = {status: '7', id: this.inputForm.id}
+              this.klgBaseQuestionsService.updateStatusById(param)
+            }
           }
         }
       },
@@ -361,6 +413,7 @@
         }
         this.$refs.uploadComponent.clearUpload()
         this.$refs.inputForm.resetFields()
+        this.$refs.contentEditor.enable()
       },
       openProgramPageForm () {
         this.$refs.programPageForm.init('1', false)

+ 80 - 15
src/views/modules/klgBase/questions/KlgBaseQuestionsList.vue

@@ -37,31 +37,34 @@
           :checkbox-config="{}">
           <vxe-column type="seq" width="40"></vxe-column>
           <vxe-column type="checkbox" width="40" ></vxe-column>
-          <vxe-column min-width="160" title="标题" field="title"></vxe-column>
-          <vxe-column min-width="160" title="问题类型" field="type"></vxe-column>
-          <vxe-column min-width="160" title="所属项目" field="programId"></vxe-column>
-          <vxe-column min-width="160" title="提交人" field="createBy.name"></vxe-column>
-          <vxe-column min-width="160" title="提交时间" field="createDate"></vxe-column>
-          <vxe-column min-width="160" title="处理人" field="createDate"></vxe-column>
-          <vxe-column min-width="160" title="结案时间" field="createDate"></vxe-column>
-          <vxe-column  min-width="150px"align="center" title="状态" field="status" >
+          <vxe-column min-width="160"align="center" title="标题" field="title"></vxe-column>
+          <vxe-column min-width="160"align="center" title="问题类型" field="type"></vxe-column>
+          <vxe-column min-width="160"align="center" title="所属项目" field="programId"></vxe-column>
+          <vxe-column min-width="160"align="center" title="提交人" field="createBy.name"></vxe-column>
+          <vxe-column min-width="160"align="center" title="提交时间" field="createDate"></vxe-column>
+          <vxe-column min-width="160"align="center" title="处理人" field="createDate"></vxe-column>
+          <vxe-column min-width="160"align="center" title="结案时间" field="createDate"></vxe-column>
+          <vxe-column  min-width="150px"align="center" fixed="right" title="状态" field="status" >
             <template slot-scope="scope">
               <el-button  type="text" @click="registeredDetail(scope.row)" effect="dark" size="mini"
-                          :type="$dictUtils.getDictLabel('program_project_list_info_status_info', scope.row.status, '-')">
-                {{$dictUtils.getDictLabel("program_project_list_info_status", scope.row.status, '-')}}
+                          :type="$dictUtils.getDictLabel('questions_status_flag', scope.row.status, '-')">
+                {{$dictUtils.getDictLabel("questions_status", scope.row.status, '-')}}
               </el-button>
             </template>
           </vxe-column>
-          <vxe-column title="操作" width="230px" fixed="right" align="center">
+          <vxe-column title="操作" width="150px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('klg:question:edit')" type="text" icon="el-icon-edit" size="small" @click="registeredPush(scope.row)">修改</el-button>
-              <el-button v-if="hasPermission('klg:question:del')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text" icon="el-icon-edit" size="small" @click="registeredPush(scope.row)">修改</el-button>
+              <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='2'" type="text" icon="el-icon-edit" size="small" @click="registeredReback(scope.row)">撤回</el-button>
+<!--              <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='5'" type="text" icon="el-icon-edit" size="small" @click="auditPush(scope.row)">处理回复</el-button>-->
+<!--              <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='6'" type="text" icon="el-icon-edit" size="small" @click="auditReback(scope.row)">撤回回复驳回</el-button>-->
+<!--              <el-button v-if="hasPermission('klg:question:del')&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>-->
             </template>
           </vxe-column>
         </vxe-table>
       </div>
     </div>
-    <KlgBaseQuestionsForm  ref="klgBaseQuestionsForm" @refreshDataList="refreshList"></KlgBaseQuestionsForm>
+<!--    <KlgBaseQuestionsForm  ref="klgBaseQuestionsForm" @refreshDataList="refreshList"></KlgBaseQuestionsForm>-->
   </div>
 </template>
 
@@ -88,7 +91,8 @@
         tableKey: '',
         loading: false,
         processDefinitionAuditId: '',
-        procDefAuditKey: ''
+        procDefAuditKey: '',
+        taskId: ''
       }
     },
     klgBaseQuestionsService: null,
@@ -114,6 +118,9 @@
     mounted () {
       this.refreshList()
     },
+    activated () {
+      this.refreshList()
+    },
     methods: {
       // 新增
       add () {
@@ -288,6 +295,64 @@
             })
           }
         })
+      },
+      // 业务回复审核
+      async auditPush (row) {
+        await this.taskService.getTaskId({procDefId: this.processDefinitionAuditId, procInsId: row.procInsId}).then((data) => {
+          this.taskId = data.data
+        })
+        // 读取流程表单
+        let title = `发起流程【业务回复审核】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[业务回复审核]`
+        let status = 'agreeAndReject'
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+          businessId: row.id,
+          businessTable: 'klg_base_questions'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                title: title,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'klg_base_questions',
+                businessId: row.id,
+                isShow: 'false',
+                status: status,
+                taskId: this.taskId,
+                formReadOnly: true,
+                routePath: '/klgBase/questions/KlgBaseQuestionsList'
+              }
+            })
+          })
+      },
+      // 撤回项目登记审批
+      auditReback (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          await this.klgBaseQuestionsService.queryById(row.id).then(({data}) => {
+            if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
+              this.$message.error('数据已发生改变或不存在,请刷新数据')
+              this.err = true
+            }
+          })
+          if (this.err === true) {
+            this.err = ''
+            this.refreshList()
+          } else {
+            this.processService.revokeProcIns(row.procInsId).then(({data}) => {
+              let form = {status: '5', id: row.id}
+              this.klgBaseQuestionsService.updateStatusById(form)
+              this.$message.success(data)
+              this.refreshList()
+            })
+          }
+        })
       }
     }
   }