|
@@ -0,0 +1,388 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <el-row :gutter="30">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <div class="page" style="height: 600px">
|
|
|
|
+ <!--<el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
|
|
+ <el-form-item label="创建时间" prop="searchDates">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="searchDates"
|
|
|
|
+ type="daterange"
|
|
|
|
+ size="small"
|
|
|
|
+ align="right"
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
+ unlink-panels
|
|
|
|
+ range-separator="至"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
+ :picker-options="pickerOptions">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
|
|
|
|
+ <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>-->
|
|
|
|
+ <div class="top bg-white">
|
|
|
|
+ <!-- <vxe-toolbar :refresh="{query: refreshList}" export print custom></vxe-toolbar>-->
|
|
|
|
+ <span>我的待办({{tablePage.total}})
|
|
|
|
+ <a @click="toPendingList()">
|
|
|
|
+ <span style="margin-left: 450px">更多</span>
|
|
|
|
+ <i class="fa fa-angle-right">
|
|
|
|
+ </i>
|
|
|
|
+ </a>
|
|
|
|
+ </span>
|
|
|
|
+ <div style="height: calc(100% - 80px);margin-top: 15px">
|
|
|
|
+ <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"
|
|
|
|
+ header-align="center"
|
|
|
|
+ :checkbox-config="{}">
|
|
|
|
+ <!--<vxe-column type="seq" width="40"></vxe-column>
|
|
|
|
+ <vxe-column type="checkbox" width="40px"></vxe-column>-->
|
|
|
|
+ <vxe-column title="实例标题" field="vars.title">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-link type="primary" :underline="false" v-if="scope.row.status === 'todo'"
|
|
|
|
+ @click="todo(scope.row)">{{scope.row.vars.title}}
|
|
|
|
+ </el-link>
|
|
|
|
+ <span v-else>{{scope.row.vars.title}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column title="流程名称" field="processDefinitionName"></vxe-column>
|
|
|
|
+ <vxe-column title="当前环节" field="task.name">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-tag>{{scope.row.task.name}}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column title="流程发起人" field="vars.userName"></vxe-column>
|
|
|
|
+ <vxe-column
|
|
|
|
+ field="task.createTime"
|
|
|
|
+ title="创建时间">
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button type="text" size="small" @click="todo(scope.row)">办理</el-button>
|
|
|
|
+ <el-button type="text" size="small" @click="trace(scope.row)">进度</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </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>
|
|
|
|
+ <user-select ref="userSelect" :limit="1" @doSubmit="selectUsersToTransferTask"></user-select>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <div class="page" style="height: 600px">
|
|
|
|
+ <!--<el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
|
|
+ <!– 搜索框–>
|
|
|
|
+ <el-form-item prop="title">
|
|
|
|
+ <el-input size="small" v-model="searchForm.title" placeholder="标题" clearable></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
|
|
|
|
+ <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>-->
|
|
|
|
+ <div class="top bg-white">
|
|
|
|
+ <span>我的通告({{noticePage.total}})
|
|
|
|
+ <a @click="toNotice()">
|
|
|
|
+ <span style="margin-left: 450px">更多</span>
|
|
|
|
+ <i class="fa fa-angle-right">
|
|
|
|
+ </i>
|
|
|
|
+ </a>
|
|
|
|
+
|
|
|
|
+ </span>
|
|
|
|
+<!-- <vxe-toolbar :refresh="{query: refreshList}" export print custom></vxe-toolbar>-->
|
|
|
|
+ <div style="height: calc(100% - 80px);margin-top: 15px">
|
|
|
|
+ <vxe-table
|
|
|
|
+ border="inner"
|
|
|
|
+ auto-resize
|
|
|
|
+ resizable
|
|
|
|
+ height="auto"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ size="small"
|
|
|
|
+ ref="notifyTable"
|
|
|
|
+ show-header-overflow
|
|
|
|
+ show-overflow
|
|
|
|
+ highlight-hover-row
|
|
|
|
+ :menu-config="{}"
|
|
|
|
+ :print-config="{}"
|
|
|
|
+ :import-config="{}"
|
|
|
|
+ :export-config="{}"
|
|
|
|
+ @sort-change="sortChangeHandle"
|
|
|
|
+ :sort-config="{remote:true}"
|
|
|
|
+ :data="dataLists"
|
|
|
|
+ :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="view(scope.row.id)">{{scope.row.title}}</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column title="类型" field="type">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{ $dictUtils.getDictLabel("oa_notify_type", scope.row.type, '-') }}
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column title="内容" field="content"></vxe-column>
|
|
|
|
+ <vxe-column title="附件" field="files">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <a :href="item" target="_blank" :key="index" v-for="(item, index) in (scope.row.files || '').split('|')">
|
|
|
|
+ {{decodeURIComponent(item.substring(item.lastIndexOf("/")+1))}}
|
|
|
|
+ </a>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+
|
|
|
|
+ <vxe-column title="查阅状态" field="status">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-tag type="success" v-if="scope.row.readFlag === '1'"> {{ $dictUtils.getDictLabel("oa_notify_read", scope.row.readFlag, '-') }}</el-tag>
|
|
|
|
+ <el-tag type="danger" v-if="scope.row.readFlag === '0'"> {{ $dictUtils.getDictLabel("oa_notify_read", scope.row.readFlag, '-') }}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ <vxe-column title="发布者" field="createBy.name"></vxe-column>
|
|
|
|
+ <vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button type="text" icon="el-icon-view" size="mini" @click="view(scope.row.id)">查看</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ </vxe-table>
|
|
|
|
+ <vxe-pager
|
|
|
|
+ background
|
|
|
|
+ size="small"
|
|
|
|
+ :current-page="noticePage.currentPage"
|
|
|
|
+ :page-size="noticePage.pageSize"
|
|
|
|
+ :total="noticePage.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>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import pick from 'lodash.pick'
|
|
|
|
+ import UserSelect from '@/components/userSelect/UserSelectDialog'
|
|
|
|
+ import TaskService from '@/api/flowable/TaskService'
|
|
|
|
+ // import NotifyForm from './NotifyForm'
|
|
|
|
+ import NotifyForm from '@/views/modules/notify/NotifyForm'
|
|
|
|
+ import NotifyService from '@/api/notify/NotifyService'
|
|
|
|
+
|
|
|
|
+ export default {
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ searchForm: {
|
|
|
|
+ beginDate: '',
|
|
|
|
+ endDate: ''
|
|
|
|
+ },
|
|
|
|
+ dataList: [],
|
|
|
|
+ dataLists: [],
|
|
|
|
+ tablePage: {
|
|
|
|
+ total: 0,
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ orders: []
|
|
|
|
+ },
|
|
|
|
+ noticePage: {
|
|
|
|
+ total: 0,
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ orders: []
|
|
|
|
+ },
|
|
|
|
+ loading: false,
|
|
|
|
+ visible: false,
|
|
|
|
+ currentTask: null,
|
|
|
|
+ processInstanceId: ''
|
|
|
|
+ // pickerOptions: {
|
|
|
|
+ // shortcuts: [{
|
|
|
|
+ // text: '最近一周',
|
|
|
|
+ // onClick (picker) {
|
|
|
|
+ // const end = new Date()
|
|
|
|
+ // const start = new Date()
|
|
|
|
+ // start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
|
+ // picker.$emit('pick', [start, end])
|
|
|
|
+ // }
|
|
|
|
+ // }, {
|
|
|
|
+ // text: '最近一个月',
|
|
|
|
+ // onClick (picker) {
|
|
|
|
+ // const end = new Date()
|
|
|
|
+ // const start = new Date()
|
|
|
|
+ // start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
|
|
|
+ // picker.$emit('pick', [start, end])
|
|
|
|
+ // }
|
|
|
|
+ // }, {
|
|
|
|
+ // text: '最近三个月',
|
|
|
|
+ // onClick (picker) {
|
|
|
|
+ // const end = new Date()
|
|
|
|
+ // const start = new Date()
|
|
|
|
+ // start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
|
|
|
+ // picker.$emit('pick', [start, end])
|
|
|
|
+ // }
|
|
|
|
+ // }]
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ taskService: null,
|
|
|
|
+ notifyService: null,
|
|
|
|
+ created () {
|
|
|
|
+ this.taskService = new TaskService()
|
|
|
|
+ this.notifyService = new NotifyService()
|
|
|
|
+ },
|
|
|
|
+ activated () {
|
|
|
|
+ this.refreshList()
|
|
|
|
+ },
|
|
|
|
+ components: {
|
|
|
|
+ UserSelect,
|
|
|
|
+ // FlowChart
|
|
|
|
+ NotifyForm
|
|
|
|
+ },
|
|
|
|
+ // watch: {
|
|
|
|
+ // },
|
|
|
|
+ methods: {
|
|
|
|
+ toNotice () {
|
|
|
|
+ this.$router.push('/notify/MyNotifyList')
|
|
|
|
+ },
|
|
|
|
+ toPendingList () {
|
|
|
|
+ // this.$router.push('./PendingList')
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: './PendingList',
|
|
|
|
+ query: {
|
|
|
|
+ num: 3
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 获取数据列表
|
|
|
|
+ refreshList () {
|
|
|
|
+ this.loading = true
|
|
|
|
+ this.taskService.todoList({
|
|
|
|
+ '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
|
|
|
|
+ })
|
|
|
|
+ this.notifyService.list({
|
|
|
|
+ 'current': this.noticePage.currentPage,
|
|
|
|
+ 'size': this.noticePage.pageSize,
|
|
|
|
+ 'orders': this.noticePage.orders,
|
|
|
|
+ isSelf: true,
|
|
|
|
+ ...this.searchForm
|
|
|
|
+ }).then(({data}) => {
|
|
|
|
+ this.dataLists = data.records
|
|
|
|
+ this.noticePage.total = data.total
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 排序
|
|
|
|
+ sortChangeHandle (column) {
|
|
|
|
+ this.noticePage.orders = []
|
|
|
|
+ if (column.order != null) {
|
|
|
|
+ this.noticePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
|
|
|
|
+ }
|
|
|
|
+ this.refreshList()
|
|
|
|
+ },
|
|
|
|
+ // 当前页
|
|
|
|
+ currentChangeHandle ({ currentPage, pageSize }) {
|
|
|
|
+ this.tablePage.currentPage = currentPage
|
|
|
|
+ this.tablePage.pageSize = pageSize
|
|
|
|
+ this.noticePage.currentPage = currentPage
|
|
|
|
+ this.noticePage.pageSize = pageSize
|
|
|
|
+ this.refreshList()
|
|
|
|
+ },
|
|
|
|
+ todo (row) {
|
|
|
|
+ this.taskService.getTaskDef({
|
|
|
|
+ taskId: row.task.id,
|
|
|
|
+ taskName: row.task.name,
|
|
|
|
+ taskDefKey: row.task.taskDefinitionKey,
|
|
|
|
+ procInsId: row.task.processInstanceId,
|
|
|
|
+ procDefId: row.task.processDefinitionId,
|
|
|
|
+ procDefKey: row.task.processDefKey,
|
|
|
|
+ status: row.status
|
|
|
|
+ }).then(({data}) => {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/flowable/task/TaskForm',
|
|
|
|
+ query: {
|
|
|
|
+ formTitle: `${row.vars.title}`,
|
|
|
|
+ num: 2,
|
|
|
|
+ title: `审批【${row.task.name || ''}】`,
|
|
|
|
+ ...pick(data, 'formType', 'formReadOnly', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ trace (row) {
|
|
|
|
+ this.processInstanceId = row.task.processInstanceId
|
|
|
|
+ this.visible = true
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.preview.init()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ transferTask (row) {
|
|
|
|
+ this.currentTask = row.task
|
|
|
|
+ this.$refs.userSelect.init()
|
|
|
|
+ },
|
|
|
|
+ selectUsersToTransferTask (user) {
|
|
|
|
+ this.taskService.delegate(this.currentTask.id, user[0].id).then(({data}) => {
|
|
|
|
+ this.$message.success(data)
|
|
|
|
+ this.refreshList()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 查看
|
|
|
|
+ view (id) {
|
|
|
|
+ this.$refs.notifyForm.init('read', id)
|
|
|
|
+ }
|
|
|
|
+ // resetSearch () {
|
|
|
|
+ // this.$refs.searchForm.resetFields()
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
+ // this.refreshList()
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+
|
|
|
|
+</style>
|