浏览代码

代码提交:
1025我的通知

sunruiqi 2 年之前
父节点
当前提交
a8a0557cbe

+ 27 - 0
src/api/flowable/NoticeService.js

@@ -0,0 +1,27 @@
+import request from '@/utils/httpRequest'
+
+export default class NoticeService {
+  list (params) {
+    return request({
+      url: '/flowable/notice/list',
+      method: 'get',
+      params: params
+    })
+  }
+
+  addInfo (params) {
+    return request({
+      url: '/flowable/notice/add',
+      method: 'get',
+      params: params
+    })
+  }
+
+  update (params) {
+    return request({
+      url: '/flowable/notice/update',
+      method: 'get',
+      params: params
+    })
+  }
+}

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

@@ -106,4 +106,12 @@ export default class ProcessService {
       params: {name: name}
     })
   }
+
+  getById (id) {
+    return request({
+      url: `/flowable/process/getById`,
+      method: 'get',
+      params: {id: id}
+    })
+  }
 }

+ 147 - 0
src/views/modules/flowable/task/NoticePageList.vue

@@ -0,0 +1,147 @@
+<template>
+  <div class="page">
+
+      <div class="top bg-white">
+        <vxe-toolbar :refresh="{query: refreshList}" export print custom></vxe-toolbar>
+        <div style="height: calc(100% - 80px);">
+            <vxe-table
+              border="inner"
+              auto-resize
+              resizable
+              height="auto"
+              :loading="loading"
+              size="small"
+              ref="todoTable"
+              show-header-overflow
+              show-overflow
+              highlight-hover-row
+              :menu-config="{}"
+              :print-config="{}"
+              :import-config="{}"
+              :export-config="{}"
+              :data="dataList"
+              :checkbox-config="{}">
+              <vxe-column type="seq" width="40"></vxe-column>
+              <vxe-column type="checkbox"  width="40px"></vxe-column>
+              <vxe-column  title="实例标题" field="title" >
+                <template slot-scope="scope">
+                  <el-link  type="primary" :underline="false" @click="todo(scope.row)">{{scope.row.title}}</el-link>
+                </template>
+              </vxe-column>
+              <vxe-column  title="流程名称" field="taskName" > </vxe-column>
+              <vxe-column  title="当前环节" field="link" ></vxe-column>
+              <vxe-column  title="流程发起人" field="createName" ></vxe-column>
+              <vxe-column
+                field="createTime"
+                title="创建时间">
+              </vxe-column>
+              <vxe-column  title="通知人" field="noticeName" ></vxe-column>
+              <vxe-column  title="读取状态" field="type" ></vxe-column>
+              <vxe-column  title="重复次数" field="repetitionCount" ></vxe-column>
+            </vxe-table>
+            <vxe-pager
+              background
+              size="small"
+              :current-page="tablePage.currentPage"
+              :page-size="tablePage.pageSize"
+              :total="tablePage.total"
+              :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+              @page-change="currentChangeHandle">
+            </vxe-pager>
+        </div>
+      </div>
+       <el-dialog
+        title="查看进度"
+        :close-on-click-modal="true"
+        :visible.sync="visible"
+        v-dialogDrag
+        width="70%"
+        height="600px">
+          <flow-chart ref="preview" :processInstanceId="processInstanceId"></flow-chart>
+        </el-dialog>
+  </div>
+</template>
+
+<script>
+  import TaskService from '@/api/flowable/TaskService'
+  import NoticeService from '@/api/flowable/NoticeService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import pick from 'lodash.pick'
+  export default {
+    data () {
+      return {
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false,
+        visible: false,
+        currentTask: null,
+        processInstanceId: ''
+      }
+    },
+    taskService: null,
+    noticeService: null,
+    created () {
+      this.noticeService = new NoticeService()
+      this.taskService = new TaskService()
+    },
+    activated () {
+      this.refreshList()
+    },
+    components: {
+      SelectUserTree
+    },
+    methods: {
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.noticeService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      },
+      todo (row) {
+        this.inputForm = {
+          taskId: '',
+          noticeId: ''
+        }
+        this.taskService.getTaskDef({
+          procInsId: row.taskId,
+          procDefId: row.defId
+        }).then(({data}) => {
+          this.inputForm.taskId = row.taskId
+          this.inputForm.noticeId = row.noticeName
+          this.noticeService.update(this.inputForm)
+          this.$router.push({
+            path: '/flowable/task/TaskForm',
+            query: {
+              isShow: false,
+              formReadOnly: true,
+              formTitle: `${row.title}`,
+              num: 2,
+              title: `审批【${row.taskName || ''}】`,
+              ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
+            }
+          })
+        })
+      }
+    }
+  }
+</script>

+ 37 - 0
src/views/modules/flowable/task/TaskForm.vue

@@ -109,6 +109,7 @@
   import FlowCopyService from '@/api/flowable/FlowCopyService'
   import ProcessService from '@/api/flowable/ProcessService'
   import WorkContractForm2 from '@/views/modules/sys/workContract/WorkContractForm2'
+  import NoticeService from '@/api/flowable/NoticeService'
   const _import = require('@/router/import-' + process.env.NODE_ENV)
   export default {
     taskDefExtensionService: null,
@@ -116,12 +117,14 @@
     formService: null,
     flowCopyService: null,
     processService: null,
+    noticeService: null,
     created () {
       this.taskService = new TaskService()
       this.taskDefExtensionService = new TaskDefExtensionService()
       this.formService = new FormService()
       this.flowCopyService = new FlowCopyService()
       this.processService = new ProcessService()
+      this.noticeService = new NoticeService()
     },
     activated () {
       this.init()
@@ -511,6 +514,9 @@
               assignee: this.auditForm.assignee
             }).then(({data}) => {
               this.$message.success('提交成功')
+              // 我的通知
+              let createDate = ''
+              this.myNotice(data, this.procDefId, this.title, vars.userName, createDate)
               this.changeBusiness()
               this.$refs.form.close()
               this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
@@ -612,6 +618,37 @@
           default:
             this.commit(vars) // 自定义按钮提交
         }
+      },
+      myNotice (taskId, proDefId, title, userName, createDate) {
+        this.inputForm = {
+          taskId: '',
+          title: '',
+          defId: '',
+          taskName: '',
+          createUser: '',
+          createTime: '',
+          noticeName: ''
+        }
+        this.taskService.historicTaskList(taskId).then(({data}) => {
+          if (data[data.length - 1].comment.status === '结束') {
+            this.inputForm.taskId = taskId
+            // 实例标题
+            this.inputForm.title = title
+            // 流程id
+            this.inputForm.defId = proDefId
+            // 流程名称
+            this.processService.getById(proDefId).then(({data}) => {
+              this.inputForm.taskName = data.name
+            })
+            // 流程发起人
+            this.inputForm.createUser = userName
+            // 创建时间
+            this.inputForm.createTime = data[0].histIns.endTime
+            // 通知人
+            this.inputForm.noticeName = userName
+            this.noticeService.addInfo(this.inputForm)
+          }
+        })
       }
     },
     data () {

+ 113 - 0
src/views/modules/sys/dashboard/workBench/Pending.vue

@@ -197,6 +197,69 @@
           </div>
         </div>
       </el-col>
+
+      <el-col :span="12">
+        <div class="page" style="height: 600px">
+          <div class="top bg-white">
+            <div style="height: 18px" >
+              <span>我的通知({{noticePageList.total}})</span>
+
+              <div style="float:right;align-items:center;display:flex;height: 18px">
+                <el-button type="text" style="float:right" @click="toNoticeList()">更多>></el-button>
+
+              </div>
+            </div>
+
+            <div style="height: calc(100% - 80px);margin-top: 15px">
+              <vxe-table
+                border="inner"
+                auto-resize
+                resizable
+                height="auto"
+                :loading="loading"
+                size="small"
+                ref="noticetable"
+                show-header-overflow
+                show-overflow
+                highlight-hover-row
+                :menu-config="{}"
+                :print-config="{}"
+                :import-config="{}"
+                :export-config="{}"
+                @sort-change="sortChangeHandle"
+                :sort-config="{remote:true}"
+                :data="dataNoticeList"
+                :checkbox-config="{}">
+                <vxe-column title="实例标题" field="title">
+                  <template slot-scope="scope">
+                    <el-link type="primary" :underline="false"
+                             @click="todoPage(scope.row)">{{scope.row.title}}
+                    </el-link>
+                  </template>
+                </vxe-column>
+                <vxe-column title="流程名称" field="taskName"></vxe-column>
+                <vxe-column title="流程发起人" field="createUser"></vxe-column>
+                <vxe-column
+                  field="createTime"
+                  title="创建时间">
+                </vxe-column>
+              </vxe-table>
+              <vxe-pager
+                background
+                size="small"
+                :current-page="noticePageList.currentPage"
+                :page-size="noticePageList.pageSize"
+                :total="noticePageList.total"
+                :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+                :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+                @page-change="currentChangeHandle">
+              </vxe-pager>
+            </div>
+            <!-- 弹窗, 新增 / 修改 -->
+            <NotifyForm  ref="notifyForm" @refreshDataList="refreshList"></NotifyForm>
+          </div>
+        </div>
+      </el-col>
     </el-row>
   </div>
 </template>
@@ -208,6 +271,7 @@
   // import NotifyForm from './NotifyForm'
   import NotifyForm from '@/views/modules/notify/NotifyForm'
   import NotifyService from '@/api/notify/NotifyService'
+  import NoticeService from '@/api/flowable/NoticeService'
 
   export default {
     data () {
@@ -218,6 +282,7 @@
         },
         dataList: [],
         dataLists: [],
+        dataNoticeList: [],
         tablePage: {
           total: 0,
           currentPage: 1,
@@ -230,6 +295,12 @@
           pageSize: 10,
           orders: []
         },
+        noticePageList: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
         loading: false,
         loading2: false,
         visible: false,
@@ -266,9 +337,11 @@
     },
     taskService: null,
     notifyService: null,
+    noticeService: null,
     created () {
       this.taskService = new TaskService()
       this.notifyService = new NotifyService()
+      this.noticeService = new NoticeService()
     },
     activated () {
       this.refreshList()
@@ -284,6 +357,10 @@
       toNotice () {
         this.$router.push('/notify/MyNotifyList')
       },
+      toNoticeList () {
+        // D:\srq\vue\assess_xg_total_process_master_vue\src\views\modules\flowable\task\NoticePageList.vue
+        this.$router.push('/flowable/task/NoticePageList')
+      },
       toPendingList () {
         // this.$router.push('./PendingList')
         this.$router.push({
@@ -317,6 +394,17 @@
           this.noticePage.total = data.total
           this.loading = false
         })
+        this.noticeService.list({
+          'current': this.noticePageList.currentPage,
+          'size': this.noticePageList.pageSize,
+          'orders': this.noticePageList.orders,
+          type: '0',
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataNoticeList = data.records
+          this.noticePageList.total = data.total
+          this.loading = false
+        })
       },
       // 排序
       sortChangeHandle (column) {
@@ -384,6 +472,31 @@
           })
         })
       },
+      todoPage (row) {
+        this.inputForm = {
+          taskId: '',
+          noticeId: ''
+        }
+        this.taskService.getTaskDef({
+          procInsId: row.taskId,
+          procDefId: row.defId
+        }).then(({data}) => {
+          this.inputForm.taskId = row.taskId
+          this.inputForm.noticeId = row.noticeName
+          this.noticeService.update(this.inputForm)
+          this.$router.push({
+            path: '/flowable/task/TaskForm',
+            query: {
+              isShow: false,
+              formReadOnly: true,
+              formTitle: `${row.title}`,
+              num: 2,
+              title: `审批【${row.taskName || ''}】`,
+              ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
+            }
+          })
+        })
+      },
       trace (row) {
         this.processInstanceId = row.task.processInstanceId
         this.visible = true