|
|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
<basic-container class='mt-10'>
|
|
|
+ {{view}}
|
|
|
<div class='flex flex-align-start flex flex-col'>
|
|
|
<span class='bold'>任务基本信息:</span>
|
|
|
<el-divider/>
|
|
|
@@ -19,6 +20,7 @@
|
|
|
<div class='mt-10'>
|
|
|
<span class='bold'>任务状态:</span>
|
|
|
<el-tag>{{ taskInfo.isCompleted === 0 ? '未完成':'已完成' }}</el-tag>
|
|
|
+ <el-tag class='ml-10'>{{ taskInfo.isConfirmed === 0 ? '待确认':'已确认' }}</el-tag>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -34,10 +36,13 @@
|
|
|
<el-button icon='Check' type='primary' v-if='this.folderList.length === 0 && taskInfo && taskInfo.isCompleted === 0 ' @click='completeTask'>
|
|
|
完成任务
|
|
|
</el-button>
|
|
|
+ <el-button icon='Check' type='primary' v-if='taskInfo && taskInfo.isConfirmed === 0 && view' @click='confirmTask'>
|
|
|
+ 确认任务
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<basic-curd class='full-width' :data='data' :option='taskOption' @row-view='rowDetail' @row-del='rowDel'>
|
|
|
<template #menu='{row}'>
|
|
|
- <main-button title='提交文件' v-if='row.type === 2' icon='Position' @click='postFile(row)'/>
|
|
|
+ <main-button title='提交文件' v-if='row.type === 2 && view !== true' icon='Position' @click='postFile(row)'/>
|
|
|
</template>
|
|
|
</basic-curd>
|
|
|
</div>
|
|
|
@@ -94,6 +99,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
clientId: '',
|
|
|
+ view: false,
|
|
|
showImage: false,
|
|
|
imgList: [],
|
|
|
show: false,
|
|
|
@@ -133,10 +139,35 @@ export default {
|
|
|
created () {
|
|
|
this.id = this.$route.query.id
|
|
|
this.taskId = this.$route.query.taskId
|
|
|
- this.detail()
|
|
|
this.clientId = Base64.encode(`${website.clientId}:${website.clientSecret}`)
|
|
|
+ const viewtemp = this.$route.query.view
|
|
|
+ if (viewtemp) {
|
|
|
+ this.view = true
|
|
|
+ }
|
|
|
+ if (this.view) {
|
|
|
+ this.confirmDetail()
|
|
|
+ } else {
|
|
|
+ this.detail()
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ confirmDetail () {
|
|
|
+ const data = { taskId: this.taskId }
|
|
|
+ this.$api.task.confirmDetail(Object.assign(data, this.page)).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.data = res.data.records.map(sub => {
|
|
|
+ sub.parentId = 0
|
|
|
+ sub.type = 2
|
|
|
+ return sub
|
|
|
+ })
|
|
|
+ this.current = this.data[0]
|
|
|
+ this.isAccess = this.data[0].isAccess
|
|
|
+ this.taskInfo = this.data[0]
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
detail () {
|
|
|
const data = { taskId: this.taskId }
|
|
|
this.$api.task.detail(Object.assign(data, this.page)).then(res => {
|
|
|
@@ -286,6 +317,22 @@ export default {
|
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ confirmTask () {
|
|
|
+ this.$confirm('确认任务,并且向业主发送提醒', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(res => {
|
|
|
+ this.$api.task.taskConfirm({ taskId: this.taskId }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|