|
|
@@ -4,10 +4,12 @@
|
|
|
:data="data"
|
|
|
ref="crud"
|
|
|
v-model="form"
|
|
|
+ v-model:page="page"
|
|
|
:before-open="beforeOpen"
|
|
|
@row-del="rowDel"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-update="rowUpdate"
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
@on-load="onLoad">
|
|
|
<template #menu-left="{}">
|
|
|
<el-button-group>
|
|
|
@@ -17,7 +19,7 @@
|
|
|
</el-button-group>
|
|
|
</template>
|
|
|
<template #menu="{row}">
|
|
|
- <el-button type='primary' text icon='Position' @click='changeQueryType("0")'>提交</el-button>
|
|
|
+ <el-button type='primary' text icon='CircleCheck' @click='taskCheck(row)'>确认</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</template>
|
|
|
@@ -25,7 +27,7 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
name: 'my-task',
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
query: {
|
|
|
type: '0'
|
|
|
@@ -40,7 +42,7 @@ export default {
|
|
|
option: {
|
|
|
align: 'center',
|
|
|
menuAlign: 'center',
|
|
|
- menuWidth: 380,
|
|
|
+ menuWidth: 260,
|
|
|
size: 'mini',
|
|
|
addBtn: false,
|
|
|
viewBtn: true,
|
|
|
@@ -64,13 +66,17 @@ export default {
|
|
|
prop: 'projectName'
|
|
|
},
|
|
|
{
|
|
|
- label: '下发人',
|
|
|
- prop: 'dispatcherUserName'
|
|
|
+ label: '接收人',
|
|
|
+ prop: 'dispatcherToUserName'
|
|
|
},
|
|
|
{
|
|
|
label: '下发时间',
|
|
|
prop: 'createTime'
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '任务截止时间',
|
|
|
+ prop: 'taskEndTime'
|
|
|
+ },
|
|
|
{
|
|
|
label: '任务状态',
|
|
|
prop: 'isCompleted',
|
|
|
@@ -85,17 +91,32 @@ export default {
|
|
|
value: 1
|
|
|
}
|
|
|
]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是否确认',
|
|
|
+ prop: 'isConfirmed',
|
|
|
+ type: 'select',
|
|
|
+ dicData: [
|
|
|
+ {
|
|
|
+ label: '待确认',
|
|
|
+ value: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '已确认',
|
|
|
+ value: 1
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- onLoad () {
|
|
|
+ onLoad() {
|
|
|
this.loading = true
|
|
|
this.page.current = this.page.currentPage
|
|
|
this.page.size = this.page.pageSize
|
|
|
- this.$api.task.taskList(Object.assign(this.page, this.query)).then(res => {
|
|
|
+ this.$api.task.issuedRecords(Object.assign(this.page, this.query)).then(res => {
|
|
|
this.loading = false
|
|
|
if (res.code === 200) {
|
|
|
this.data = res.data.records
|
|
|
@@ -103,44 +124,59 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- beforeOpen (done, type) {
|
|
|
- if (type === 'view') {
|
|
|
- this.$router.push({ path: '/task/detail', query: { id: this.form.id, taskId: this.form.taskId } })
|
|
|
- } else {
|
|
|
- done()
|
|
|
+ beforeOpen(done, type) {
|
|
|
+ if (['view'].includes(type)) {
|
|
|
}
|
|
|
+ done()
|
|
|
},
|
|
|
- currentChange (currentPage) {
|
|
|
+ currentChange(currentPage) {
|
|
|
this.page.currentPage = currentPage
|
|
|
},
|
|
|
- sizeChange (pageSize) {
|
|
|
+ sizeChange(pageSize) {
|
|
|
this.page.size = pageSize
|
|
|
},
|
|
|
- refreshChange () {
|
|
|
+ refreshChange() {
|
|
|
this.onLoad()
|
|
|
},
|
|
|
- rowDel (row) {
|
|
|
+ rowDel(row) {
|
|
|
this.$confirm('确定彻底删除所选择的文件?', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- this.$api.recycle.recycleRemove({ ids: row.id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(res.msg)
|
|
|
- this.onLoad()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
+ .then(() => {
|
|
|
+ this.$api.recycle.recycleRemove({ids: row.id}).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
},
|
|
|
- changeQueryType (type) {
|
|
|
+ changeQueryType(type) {
|
|
|
this.query.type = type
|
|
|
this.onLoad()
|
|
|
+ },
|
|
|
+ taskCheck(row) {
|
|
|
+ if (row.isCompleted === 0) {
|
|
|
+ this.$message.error('该任务尚未完成,不能进行确认!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (row.isConfirmed === 1) {
|
|
|
+ this.$message.error('该任务已经确认!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$api.task.taskConfirm({taskId: row.taskId}).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|