123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <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.trim="conditions.taskTitle" 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 label="采空区">
- <template v-slot="{row}">
- <span>{{ NumConvertLM(row.goafOrebelt) }}/{{ row.goafOrebody }}/{{ row.goafOreheight }}/{{ row.goafName }}</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="expectedEndDate" label="截止时间" header-align="center" align="center" width="180">
- <template v-slot="{row}">
- <span v-if="row.expectedEndDate" style="margin-left: 10px"><i class="el-icon-time" />{{ row.expectedEndDate }}</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.status | checkStatusFilter }}</el-tag></span>
- </template>
- </el-table-column>
- <el-table-column label="操作" header-align="center" align="center" width="280">
- <template v-slot="{row}">
- <el-button v-if="row.status!==1" size="mini" type="text" style="color:#1B81FF" @click="handleTask(row)">处理</el-button>
- <!-- <el-button size="mini" type="text" style="color:#1B81FF" @click="handleUpdate(row)">修改</el-button>
- <el-button size="mini" type="text" style="color:#E44E2D" @click="handleDelete(row)">删除</el-button> -->
- </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="处理任务" @success="getData" />
- <check-task ref="checkTask" @formSuccess="getData" />
- </div>
- </template>
- <script>
- import CheckTask from './CheckTask.vue'
- import TaskEvent from './TaskEvent.vue'
- // import HandlingView from './check/Handle.vue'
- import HandlingView from './ChecklistItem.vue'
- import TaskDetails from './Details.vue'
- import { getCheckTaskByPage, deleteCheckTaskById } from '@/api/goaf/task'
- import { mapGetters } from 'vuex'
- import Pagination from '@/components/Pagination'
- import { checkType } from '@/utils'
- import { NumConvertLM } from '@/utils'
- export default {
- name: 'MyWaiting',
- filters: {
- checkTypeFilter(val) {
- return checkType(val)
- },
- checkStatusFilter(val) {
- if (val === 0) {
- return '待处理'
- } else if (val === 1) {
- return '已处理'
- } else if (val === 2) {
- return '已逾期'
- } else {
- return '--'
- }
- }
- },
- components: { Pagination, CheckTask, TaskEvent, HandlingView, TaskDetails },
- data() {
- return {
- title: '',
- dataList: [],
- total: 0,
- listLoading: false,
- conditions: {
- page: 1,
- limit: 10,
- taskTitle: '',
- status: 0
- },
- isGroup: false
- }
- },
- computed: {
- ...mapGetters([
- 'userData'
- ])
- },
- mounted() {
- this.loadData(this.conditions.status)
- },
- methods: {
- NumConvertLM,
- // 加载数据
- loadData(status) {
- this.conditions.status = status
- switch (status) {
- case 0:
- this.title = '待处理'
- break
- case 1:
- this.title = '处理完成'
- break
- case 2:
- this.title = '逾期'
- break
- }
- this.getData()
- },
- // 加载数据
- getData() {
- this.listLoading = true
- getCheckTaskByPage(this.conditions).then((resp) => {
- this.listLoading = false
- const { code, data, total, msg } = resp
- if (code === 0) {
- this.total = total
- this.dataList = data
- } else {
- this.$message.error(msg)
- }
- }).catch((error) => {
- console.log(error)
- })
- },
- // 指令处理
- handlerCommand(command, data) {
- switch (command) {
- case 'editTask':
- this.handleUpdate(data)
- break
- case 'delTask':
- this.handleDelete(data)
- break
- }
- },
- handleUpdate(data) {
- this.$refs['checkTask'].showEditModel(JSON.parse(JSON.stringify(data)))
- },
- // 任务动态
- handleTaskEvent(data) {
- this.$refs['TaskEvent'].showTaskEvent(data)
- },
- // 处理
- handleTask(data) {
- this.$refs['HandlingView'].showView(data)
- },
- // 添加
- handleAdd() {
- this.$refs['checkTask'].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 { code, msg } = resp
- if (code === 0) {
- this.getData()
- this.$message.success(msg)
- } else {
- this.$message.error(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>
|