| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <template>
- <div class="content-container">
- <el-row class="tool-bar">
- <el-col :span="12" class="left">
- <div class="content-title">
- {{ title }}
- </div>
- </el-col>
- <el-col :span="12" class="right">
- <el-input v-model="conditions.keywords" class="search-input m-right-15" placeholder="请输入内容">
- <el-button slot="append" icon="el-icon-search" @click="getData" />
- </el-input>
- </el-col>
- </el-row>
- <el-row class="content-body">
- <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 210px)">
- <el-table-column type="index" label="序号" width="60" header-align="center" align="center" />
- <el-table-column prop="taskTitle" label="任务名称" header-align="left" align="left">
- <template v-slot="{row}">
- <span>{{ row.taskTitle }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="riskPointTitle" label="风险点" header-align="center" align="center" width="120">
- <template v-slot="{row}">
- <span><i class="el-icon-place" />{{ row.riskPointTitle }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="checkTypeId" label="类型" header-align="center" align="center" width="100">
- <template v-slot="{row}">
- {{ row.checkTypeId | checkTypeFilter }}
- </template>
- </el-table-column>
- <el-table-column prop="checkCatTitle" label="分类" header-align="center" align="center" width="100">
- <template v-slot="{row}">
- <span>{{ row.checkCatTitle }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="handleAccountName" label="执行人员" header-align="center" align="center" width="100">
- <template v-slot="{row}">
- <el-popover v-if="row.handleAccountName" trigger="hover" placement="top">
- <p>部门: {{ row.handleGroupName }}</p>
- <p>岗位: {{ row.handlePositionName }}</p>
- <div slot="reference" class="name-wrapper">
- <i class="el-icon-user" />
- {{ row.handleAccountName }}
- </div>
- </el-popover>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column prop="expectedEndTime" label="截止时间" header-align="center" align="center" width="180">
- <template v-slot="{row}">
- <span v-if="row.expectedEndTime" style="margin-left: 10px"><i class="el-icon-time" />{{ row.expectedEndTime }}</span>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column prop="status" label="状态" header-align="center" align="center" width="120">
- <template v-slot="{row}">
- <span><el-tag type="info" effect="plain" color="rgb(38 69 90)">{{ row.checkStatus | checkStatusFilter }}</el-tag></span>
- </template>
- </el-table-column>
- <el-table-column label="操作" header-align="center" align="center" width="160">
- <template v-slot="{row}">
- <el-button size="mini" type="info" icon="el-icon-view" @click="handleViewDetails(row)">查看</el-button>
- <template v-if="(row.status===0) && row.handleAccountId===userData.userId">
- <el-button size="mini" type="primary" icon="el-icon-mobile" @click="handleTask(row)">处理</el-button>
- </template>
- <template v-if="row.status===0 && userData.userId===row.createdBy">
- <el-dropdown @command="(command)=>handlerCommand(command, row)">
- <el-button size="mini" type="warning" style="background-color: #F97647">
- 更多<i class="el-icon-arrow-down el-icon--right" />
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="editTask"><i class="el-icon-edit" />编辑</el-dropdown-item>
- <el-dropdown-item command="delTask"><i class="el-icon-delete" />删除</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagination-wrap">
- <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
- </div>
- </el-row>
- <task-event ref="TaskEvent" title="任务动态" />
- <task-details ref="TaskDetails" title="任务详情" />
- <handling-view ref="HandlingView" title="处理任务" @formSuccess="getData" />
- <check-task ref="AddCheckTask" @formSuccess="getData" />
- <check-task ref="EditCheckTask" @formSuccess="getData" />
- </div>
- </template>
- <script>
- import CheckTask from './CheckTask.vue'
- import TaskEvent from './TaskEvent.vue'
- import HandlingView from './check/Handle.vue'
- import TaskDetails from './Details.vue'
- import { getCheckTaskByPage, deleteCheckTaskById } from '@/api/aqpt/checkTaskApi'
- import { mapGetters } from 'vuex'
- import Pagination from '@/components/Pagination'
- import { checkType, checkStatus } from '@/utils'
- export default {
- name: 'MyWaiting',
- filters: {
- checkTypeFilter(val) {
- return checkType(val)
- },
- checkStatusFilter(val) {
- return checkStatus(val)
- }
- },
- components: { Pagination, CheckTask, TaskEvent, HandlingView, TaskDetails },
- data() {
- return {
- title: '',
- dataList: [],
- total: 0,
- listLoading: false,
- conditions: {
- page: 1,
- limit: 10,
- keywords: '',
- launchAccountId: undefined,
- launchGroupId: undefined,
- launchPositionId: undefined,
- handleGroupId: undefined,
- handlePositionId: undefined,
- handleAccountId: undefined,
- checkStatus: undefined
- },
- isGroup: false,
- action: 'MyWaiting'
- }
- },
- computed: {
- ...mapGetters([
- 'userData'
- ])
- },
- mounted() {
- this.loadData(this.action)
- },
- methods: {
- resetConditions() {
- this.conditions.launchAccountId = undefined
- this.conditions.launchGroupId = undefined
- this.conditions.launchPositionId = undefined
- this.conditions.handleGroupId = undefined
- this.conditions.handlePositionId = undefined
- this.conditions.handleAccountId = undefined
- this.conditions.checkStatus = undefined
- },
- // 加载数据
- loadData(action) {
- this.action = action
- switch (action) {
- case 'MyCreated':
- this.title = '我发起的'
- this.resetConditions()
- this.conditions.launchAccountId = this.userData.userId
- break
- case 'MyWaiting':
- this.title = '我待办的'
- this.resetConditions()
- this.conditions.handleAccountId = this.userData.userId
- this.conditions.checkStatus = 0
- break
- case 'MyHandling':
- this.title = '我处理中的'
- this.resetConditions()
- this.conditions.handleAccountId = this.userData.userId
- this.conditions.checkStatus = 1
- break
- case 'MyCompleted':
- this.title = '我处理完的'
- this.resetConditions()
- this.conditions.handleAccountId = this.userData.userId
- this.conditions.checkStatus = 2
- break
- case 'MyCanceled':
- this.title = '我撤消的'
- this.resetConditions()
- this.conditions.handleAccountId = this.userData.userId
- this.conditions.checkStatus = -1
- break
- case 'GroupWaiting':
- this.title = '部门待处理'
- this.resetConditions()
- this.conditions.handleGroupId = this.userData.groupId
- this.conditions.checkStatus = 0
- break
- case 'GroupHandling':
- this.title = '部门待处理'
- this.resetConditions()
- this.conditions.handleGroupId = this.userData.groupId
- this.conditions.checkStatus = 1
- break
- case 'GroupCompleted':
- this.title = '部门完成的'
- this.resetConditions()
- this.conditions.handleGroupId = this.userData.groupId
- this.conditions.checkStatus = 2
- break
- }
- this.getData()
- },
- // 加载数据
- getData() {
- this.listLoading = true
- getCheckTaskByPage(this.conditions).then((resp) => {
- this.listLoading = false
- const { data, total } = resp
- this.total = total
- this.dataList = data
- }).catch((error) => {
- console.log(error)
- })
- },
- // 指令处理
- handlerCommand(command, data) {
- const { taskId } = data
- switch (command) {
- case 'editTask':
- this.$refs['EditTask'].showEditModel(taskId)
- break
- case 'delTask':
- this.handleDelete(data)
- break
- }
- },
- // 任务动态
- handleTaskEvent(data) {
- const taskId = data.taskId
- this.$refs['TaskEvent'].showTaskEvent(taskId)
- },
- // 处理
- handleTask(data) {
- const { taskId } = data
- this.$refs['HandlingView'].showView(taskId)
- },
- // 添加
- handleAdd() {
- this.$refs['AddTask'].showAddModel()
- },
- // 查看详情
- handleViewDetails(data) {
- const { taskId } = data
- this.$refs['TaskDetails'].showView(taskId)
- },
- // 删除
- handleDelete(data) {
- const { taskId } = data
- this.$confirm('删除任务?是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- deleteCheckTaskById(taskId).then((resp) => {
- const { msg } = resp
- this.getData()
- this.$message.success(msg)
- }).catch((error) => {
- console.log(error)
- })
- }).catch(() => {
- this.$message.info('已取消删除')
- })
- },
- // 操作更新
- operationalUpdate() {
- this.$emit('operationalUpdate')
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
- <style lang="scss" scoped>
- .content-container{
- height: calc(100%- 80px);
- margin: 10px 10px 10px 0;
- }
- </style>
|