|
@@ -42,6 +42,7 @@
|
|
|
<span v-else></span>
|
|
|
</div>
|
|
|
<div class="task_button">
|
|
|
+ <van-button size="small" type="danger" v-if="user.id == item.creatorId || user.id == projectDetail.creatorId ||user.id == projectDetail.inchargerId || projectManagement" @click="taskDelete(item)">删除</van-button>
|
|
|
<van-button size="small" type="info" @click="toEditask(item.id)">编辑</van-button>
|
|
|
<van-button size="small" type="primary" @click="taskStatus(item.id,0,item)" v-if="item.taskStatus == 0">完成</van-button>
|
|
|
<van-button size="small" color="#e6a23c" @click="taskStatus(item.id,1,item)" v-if="item.taskStatus == 1">重启</van-button>
|
|
@@ -329,6 +330,22 @@ export default {
|
|
|
}
|
|
|
}).catch(err=> {this.$toast.clear();console.log(err)});
|
|
|
},
|
|
|
+ taskDelete(taskitem){
|
|
|
+ this.$dialog.confirm({
|
|
|
+ title: '提示',
|
|
|
+ message: taskitem.subTaskList.length > 0 ? '您确定删除当前任务及其子任务吗?' : '您确定删除当前任务吗?'
|
|
|
+ }).then(()=>{
|
|
|
+ this.$axios.post("/task/delete", {id: taskitem.id})
|
|
|
+ .then(res => {
|
|
|
+ if(res.code == "ok") {
|
|
|
+ this.$toast.success('删除成功');
|
|
|
+ this.inside.taskList = this.inside.taskList.filter(item => item.id != taskitem.id)
|
|
|
+ } else {
|
|
|
+ this.$toast.fail('操作失败');
|
|
|
+ }
|
|
|
+ }).catch(err=> {this.$toast.clear();console.log(err)});
|
|
|
+ }).catch(()=>{})
|
|
|
+ },
|
|
|
|
|
|
openProject(){
|
|
|
if(this.active == 1 && (this.projectManagement || this.user.id==this.projectDetail.inchargerId || this.user.id==this.projectDetail.creatorId)){
|