|
@@ -11,7 +11,8 @@
|
|
|
</div>
|
|
|
</el-header>
|
|
|
<el-main class="height_100">
|
|
|
- <el-table :data="tableData" style="width: 100%;" border header-row-class-name="custom-table-header">
|
|
|
+ <el-table :data="tableData" style="width: 100%;" border header-row-class-name="custom-table-header"
|
|
|
+ @sort-change="sortChange">
|
|
|
<el-table-column label="#" align="center" width="80px">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
@@ -19,40 +20,41 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" label="任务名称" align="center"></el-table-column>
|
|
|
- <el-table-column prop="taskType" label="任务类型" align="center">
|
|
|
+
|
|
|
+ <el-table-column v-for="item in columnList" :key="item.value" :prop="item.value"
|
|
|
+ :render-header="$commonJS.renderHeaderMethods" :label="item.name" sortable="custom" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{ taskType[scope.row.taskType] }}
|
|
|
+ <div v-if="['name'].includes(item.value)">
|
|
|
+ <el-link @click="handleItem(scope.row, item.value)">
|
|
|
+ <span v-html="$commonJS.getColumnData(scope.row, item)"></span>
|
|
|
+ </el-link>
|
|
|
</div>
|
|
|
+ <div v-else-if="['taskType'].includes(item.value)" v-html="$commonJS.getColumnData(scope.row, item,null,{data:taskType})"></div>
|
|
|
+ <div v-else v-html="$commonJS.getColumnData(scope.row, item)"></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="createPerson" label="发起人" align="center"></el-table-column>
|
|
|
- <el-table-column prop="handlePerson" label="处理人" align="center"></el-table-column>
|
|
|
- <el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
|
|
|
- <el-table-column prop="endTime" label="截止时间" align="center"></el-table-column>
|
|
|
- <el-table-column prop="status" label="状态" align="center"></el-table-column>
|
|
|
- <el-table-column label="操作" align="center" width="180px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- <el-dropdown split-button type="primary" size="small" @command="handleCommand($event, scope.row)"
|
|
|
- @click="handleTask(scope.row)">
|
|
|
- <span v-if="scope.row.status == '已完成' || scope.row.handlePerson != userInfo.name">查 看</span>
|
|
|
- <span v-else>处 理</span>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="1">查看审核记录</el-dropdown-item>
|
|
|
- <el-dropdown-item command="2" style="color: red;text-align: center;">删除</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+
|
|
|
+ <el-table-column label="操作" align="center" width="180px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-dropdown split-button type="primary" size="small" @command="handleCommand($event, scope.row)"
|
|
|
+ @click="handleTask(scope.row)">
|
|
|
+ <span v-if="scope.row.status == '已完成' || scope.row.handlePerson != userinfo.name">查 看</span>
|
|
|
+ <span v-else>处 理</span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="1">查看审核记录</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="2" style="color: red;text-align: center;">删除</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-main>
|
|
|
<el-footer class="pagination">
|
|
|
- <el-pagination background layout="total, prev, pager, next, jumper" :current-page.sync="queryParams.current"
|
|
|
- :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="queryParams.total">
|
|
|
- </el-pagination>
|
|
|
+ <el-pagination background layout="total, prev, pager, next, jumper" :current-page.sync="queryParams.current"
|
|
|
+ :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="queryParams.total">
|
|
|
+ </el-pagination>
|
|
|
</el-footer>
|
|
|
</el-container>
|
|
|
|
|
@@ -60,24 +62,29 @@
|
|
|
<handleTask1 ref="handleTask1Dialog"></handleTask1>
|
|
|
<!-- <handleTask2 ref="handleTask2Dialog"></handleTask2> -->
|
|
|
<handleTask2 ref="handleTask2Dialog"></handleTask2>
|
|
|
- <auditRecords ref="auditRecords"></auditRecords>
|
|
|
+ <auditRecords ref="auditRecords" ></auditRecords>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
+import {column} from '../mixins/index2'
|
|
|
import createTask from '../dialog/createTask.vue'
|
|
|
import handleTask1 from '../dialog/handleTask1.vue'
|
|
|
import handleTask2 from '../dialog/handleTask2.vue'
|
|
|
import auditRecords from '../dialog/auditRecords.vue'
|
|
|
export default {
|
|
|
+ mixins:[column],
|
|
|
components: {
|
|
|
createTask,
|
|
|
handleTask1,
|
|
|
handleTask2,
|
|
|
auditRecords,
|
|
|
},
|
|
|
+ props: ['id'],
|
|
|
data() {
|
|
|
return {
|
|
|
+ // table数据
|
|
|
tableData: [
|
|
|
{
|
|
|
name: '加热器专利挖掘1',
|
|
@@ -136,16 +143,13 @@ export default {
|
|
|
status: '已完成'
|
|
|
},
|
|
|
],
|
|
|
- taskType: {
|
|
|
- 1: '项目审核任务',
|
|
|
- 2: '文件分配任务',
|
|
|
- 3: '文件审核任务',
|
|
|
- },
|
|
|
+ // 分页及总数信息
|
|
|
queryParams: {
|
|
|
current: 1,
|
|
|
size: 10,
|
|
|
total: 0,
|
|
|
},
|
|
|
+ // 检索字段
|
|
|
searchFiled: [
|
|
|
{
|
|
|
label: '任务名称',
|
|
@@ -160,31 +164,43 @@ export default {
|
|
|
placeholder: '请输入创建人名称'
|
|
|
},
|
|
|
],
|
|
|
- searchOption: {}
|
|
|
+ // 检索字符串
|
|
|
+ searchOption: {},
|
|
|
+ //排序字段
|
|
|
+ sort: [{ "orderBy": "createTime", "orderType": 1 }],
|
|
|
+ // showView:false,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- userInfo() {
|
|
|
- return this.$store.state.user.userinfo
|
|
|
- },
|
|
|
+ ...mapGetters(['webSocket', 'userinfo']),
|
|
|
+ // userInfo() {
|
|
|
+ // return this.$store.state.user.userinfo
|
|
|
+ // },
|
|
|
},
|
|
|
mounted() {
|
|
|
// this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 创建任务事件
|
|
|
+ createTask() {
|
|
|
+ this.$refs.createTaskDialog.open({})
|
|
|
+ },
|
|
|
//处理任务
|
|
|
handleTask(row) {
|
|
|
- if (row.status == '已完成' || row.handlePerson != this.userInfo.name) {
|
|
|
+ // 1: '项目审核任务',
|
|
|
+ // 2: '文件分配任务',
|
|
|
+ // 3: '文件审核任务',
|
|
|
+ if (row.status == '已完成' || row.handlePerson != this.userinfo.name) {
|
|
|
if (row.taskType == '1') {
|
|
|
- this.$refs.handleTask1Dialog.open(row,false)
|
|
|
+ this.$refs.handleTask1Dialog.open(row, false)
|
|
|
} else if (row.taskType == '2') {
|
|
|
- this.$refs.handleTask2Dialog.open(row,false)
|
|
|
+ this.$refs.handleTask2Dialog.open(row, false)
|
|
|
}
|
|
|
} else {
|
|
|
if (row.taskType == '1') {
|
|
|
- this.$refs.handleTask1Dialog.open(row,true)
|
|
|
+ this.$refs.handleTask1Dialog.open(row, true)
|
|
|
} else if (row.taskType == '2') {
|
|
|
- this.$refs.handleTask2Dialog.open(row,true)
|
|
|
+ this.$refs.handleTask2Dialog.open(row, true)
|
|
|
} else {
|
|
|
let router = this.$router.resolve({
|
|
|
path: '/handleExamine',
|
|
@@ -196,37 +212,110 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 操作栏下拉菜单按钮
|
|
|
handleCommand(ev, row) {
|
|
|
switch (ev) {
|
|
|
case '1'://查看审核记录
|
|
|
- this.$refs.auditRecords.open()
|
|
|
+ this.$refs.auditRecords.open(row.id)
|
|
|
break;
|
|
|
case '2'://删除任务
|
|
|
-
|
|
|
+ this.deleteTask(row)
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
+ // 删除任务
|
|
|
+ deleteTask(row) {
|
|
|
+ this.deleteTasks([row.id])
|
|
|
+ },
|
|
|
+ deleteTasks(ids) {
|
|
|
+ this.$api.query(ids).then(response => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ this.queryParams.current = 1
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取table栏位及分组字段、检索字段
|
|
|
+ async getColumn() {
|
|
|
+ let params = ['reportProject']
|
|
|
+ await this.$api.getParamsCommon(params).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
|
|
|
+ // 搜索字段
|
|
|
+ this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
|
|
|
+ label: 'name',
|
|
|
+ value: 'value',
|
|
|
+ type: 'type',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // this.showView = false
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.showView = true
|
|
|
+ // })
|
|
|
+ },
|
|
|
// 左侧搜索
|
|
|
search() {
|
|
|
-
|
|
|
+ let params = {}
|
|
|
+ val.forEach(item => {
|
|
|
+ if (item.type == 3) {
|
|
|
+ params[item.value] = item.searchValue.map(itemValue => {
|
|
|
+ return itemValue.value
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ params[item.value] = item.searchValue.label
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 返回字符串
|
|
|
+ this.searchOption = params
|
|
|
+ // 调用查询接口
|
|
|
+ this.queryParams.current = 1
|
|
|
+ this.getList()
|
|
|
},
|
|
|
- // 创建任务事件
|
|
|
- createTask() {
|
|
|
- this.$refs.createTaskDialog.open({})
|
|
|
+ //排序
|
|
|
+ sortChange({ column, prop, order }) {
|
|
|
+ //如需要多个字段排序,则不需要清空
|
|
|
+ var params = {
|
|
|
+ sort: this.sort,
|
|
|
+ column,
|
|
|
+ prop,
|
|
|
+ order,
|
|
|
+ }
|
|
|
+ this.sort = this.$commonJS.getSortData(params)
|
|
|
+ this.queryParams.current = 1
|
|
|
+ this.getList()
|
|
|
},
|
|
|
// 初始化请求数据
|
|
|
- getList() { },
|
|
|
+ getList() {
|
|
|
+ let params = {
|
|
|
+ ...this.queryParams,//分页信息
|
|
|
+ searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
|
|
|
+ orderDTOList: this.sort,//排序信息
|
|
|
+ id: this.id,
|
|
|
+ }
|
|
|
+ this.$api.query(params).then(response => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ this.tableData = response.data.data
|
|
|
+ this.queryParams.current = response.data.current
|
|
|
+ this.queryParams.size = response.data.size
|
|
|
+ this.queryParams.total = response.data.total
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.tableData = []
|
|
|
+ this.queryParams.total = 0
|
|
|
+ })
|
|
|
+ },
|
|
|
// 分页
|
|
|
handleCurrentChange(val) {
|
|
|
- // this.queryParams.current = val
|
|
|
- // this.getList()
|
|
|
+ this.queryParams.current = val
|
|
|
+ this.getList()
|
|
|
},
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-</style>
|
|
|
+<style lang="scss" scoped></style>
|