|
|
@@ -1,37 +1,41 @@
|
|
|
<template>
|
|
|
- <el-dialog v-model="showDialog">
|
|
|
+ <el-dialog v-model="showDialog" width="800">
|
|
|
<template #header>
|
|
|
<div class="full-width flex flex-center flex-justify-between">
|
|
|
<h4>任务详情</h4>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div>
|
|
|
- <el-input v-model="form.title"></el-input>
|
|
|
+ <el-input v-model="form.title" placeholder="请输入任务名称"></el-input>
|
|
|
<div class="mt-10">
|
|
|
<div class="flex flex-center flex-justify-start">
|
|
|
<span class="mr-10 title flex flex-justify-start">状态:</span>
|
|
|
- <wt-tag :data="data" />
|
|
|
+ <wt-tag :data="data" @change="changeStatus($event, 1)" />
|
|
|
</div>
|
|
|
|
|
|
<div class="mt-10 flex flex-center flex-justify-start">
|
|
|
<span class="mr-10 title flex flex-justify-start">优先级:</span>
|
|
|
- <wt-tag :data="data1" />
|
|
|
+ <wt-tag :data="data1" @change="changeStatus($event, 2)" />
|
|
|
</div>
|
|
|
|
|
|
<div class="mt-10 flex flex-center flex-justify-start">
|
|
|
<span class="mr-10 title flex flex-justify-start">时间:</span>
|
|
|
<div class="flex flex-center">
|
|
|
<el-date-picker
|
|
|
- v-model="value1"
|
|
|
+ v-model="form.startTime"
|
|
|
type="date"
|
|
|
placeholder="设置开始日期"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
<div class="ml-5 mr-5">至</div>
|
|
|
<el-date-picker
|
|
|
- v-model="value1"
|
|
|
+ v-model="form.endTime"
|
|
|
type="date"
|
|
|
placeholder="设置截止日期"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
@@ -45,24 +49,32 @@
|
|
|
</div>
|
|
|
<div class="mt-10 flex flex-align-start flex-justify-start">
|
|
|
<span class="mr-10 title flex flex-justify-start">备注:</span>
|
|
|
- <el-input type="textarea" :rows="5"></el-input>
|
|
|
+ <el-input type="textarea" :rows="5" v-model="form.remark"></el-input>
|
|
|
</div>
|
|
|
|
|
|
<div class="mt-10 flex flex-align-start flex-justify-start flex-col">
|
|
|
<div class="flex flex-center flex-justify-start">
|
|
|
<span class="mr-10 title flex flex-justify-start">关联附件:</span>
|
|
|
- <filepicker project-id="" />
|
|
|
+ <filepicker :project-id="projectId" @submit="selection" />
|
|
|
</div>
|
|
|
<div class="flex flex-center flex-justify-start full-width mt-10">
|
|
|
<div class="title mr-10"></div>
|
|
|
- <el-input type="textarea" :rows="5"></el-input>
|
|
|
+ <div>
|
|
|
+ <div v-for="item in fileList" :key="item.id">
|
|
|
+ {{ item.title }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="flex flex-justify-start full-width flex-col">
|
|
|
<div class="mt-10 flex flex-align-start flex-justify-start">
|
|
|
<span class="mr-10 title flex flex-justify-start">任务进展:</span>
|
|
|
- <el-input type="textarea" :rows="5"></el-input>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="5"
|
|
|
+ v-model="form.taskProcess"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
<div class="flex flex-justify-start flex-center mt-10 full-width">
|
|
|
<div class="title mr-10" />
|
|
|
@@ -75,7 +87,7 @@
|
|
|
</div>
|
|
|
<div class="flex flex-justify-end full-width">
|
|
|
<el-button type="primary" plain>取 消</el-button>
|
|
|
- <el-button type="primary">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submit">确 定</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -89,15 +101,31 @@ import filepicker from '@/components/filepicker/index.vue'
|
|
|
export default {
|
|
|
components: { Tasker, WtTag, filepicker },
|
|
|
props: {
|
|
|
+ projectId: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
task: {
|
|
|
type: Object,
|
|
|
- default: {}
|
|
|
+ default: () => {
|
|
|
+ return null
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
task: {
|
|
|
handler(val) {
|
|
|
- this.form = val
|
|
|
+ if (val) {
|
|
|
+ this.form = val
|
|
|
+ this.data = this.fetchIndex(this.data, this.form.taskStatus)
|
|
|
+ this.data1 = this.fetchIndex(this.data1, this.form.level)
|
|
|
+ this.fileList = val.files.map(ele => {
|
|
|
+ return {
|
|
|
+ fileId: ele.id,
|
|
|
+ title: ele.title
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
immediate: true
|
|
|
}
|
|
|
@@ -105,61 +133,112 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
showDialog: false,
|
|
|
- form: null,
|
|
|
+ fileList: [],
|
|
|
+ form: {
|
|
|
+ title: ''
|
|
|
+ },
|
|
|
data: [
|
|
|
{
|
|
|
title: '待确认',
|
|
|
value: 0,
|
|
|
- color: '#D7D7D7'
|
|
|
+ color: '#D7D7D7',
|
|
|
+ checked: true
|
|
|
},
|
|
|
{
|
|
|
title: '进行中',
|
|
|
value: 1,
|
|
|
- color: '#47A6EA'
|
|
|
+ color: '#47A6EA',
|
|
|
+ checked: false
|
|
|
},
|
|
|
{
|
|
|
title: '已完成',
|
|
|
value: 2,
|
|
|
- color: '#80B336'
|
|
|
+ color: '#80B336',
|
|
|
+ checked: false
|
|
|
},
|
|
|
{
|
|
|
title: '已关闭',
|
|
|
value: 3,
|
|
|
- color: '#ECAB56'
|
|
|
+ color: '#ECAB56',
|
|
|
+ checked: false
|
|
|
},
|
|
|
{
|
|
|
title: '已取消',
|
|
|
value: 4,
|
|
|
- color: '#C72A29'
|
|
|
+ color: '#C72A29',
|
|
|
+ checked: false
|
|
|
}
|
|
|
],
|
|
|
data1: [
|
|
|
{
|
|
|
title: 'P1',
|
|
|
value: 0,
|
|
|
- color: '#C72A29'
|
|
|
+ color: '#C72A29',
|
|
|
+ checked: true
|
|
|
},
|
|
|
{
|
|
|
title: 'P2',
|
|
|
value: 1,
|
|
|
- color: '#E89D42'
|
|
|
+ color: '#E89D42',
|
|
|
+ checked: false
|
|
|
},
|
|
|
{
|
|
|
title: 'P3',
|
|
|
value: 2,
|
|
|
- color: '#47A6EA'
|
|
|
+ color: '#47A6EA',
|
|
|
+ checked: false
|
|
|
},
|
|
|
{
|
|
|
title: 'P4',
|
|
|
value: 3,
|
|
|
- color: '#A0A0A0'
|
|
|
+ color: '#A0A0A0',
|
|
|
+ checked: false
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ fetchIndex(list, key) {
|
|
|
+ const index = list.findIndex(ele => ele.value === key)
|
|
|
+ if (index > -1) {
|
|
|
+ list.map(ele => {
|
|
|
+ ele.checked = false
|
|
|
+ return ele
|
|
|
+ })
|
|
|
+ list[index].checked = true
|
|
|
+ }
|
|
|
+ return list
|
|
|
+ },
|
|
|
show() {
|
|
|
this.showDialog = true
|
|
|
+ },
|
|
|
+ changeStatus(res, type) {
|
|
|
+ if (type === 1) {
|
|
|
+ this.form.taskStatus = res.value
|
|
|
+ } else {
|
|
|
+ this.form.level = res.value
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ this.form.projectId = this.projectId
|
|
|
+ this.form.relatedIds = this.fileList.map(ele => ele.fileId).join(',')
|
|
|
+ this.$api.task.addTask(this.form).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.showDialog = false
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selection(list) {
|
|
|
+ this.fileList = list.map(ele => {
|
|
|
+ return {
|
|
|
+ fileId: ele.id,
|
|
|
+ title: ele.title
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(this.fileList)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -174,6 +253,7 @@ export default {
|
|
|
box-shadow: none;
|
|
|
font-weight: bold;
|
|
|
font-size: 16px;
|
|
|
+ background-color: #eeeeee;
|
|
|
}
|
|
|
|
|
|
:deep(.el-input__wrapper:hover) {
|