This commit is contained in:
xiongchengqiang 2020-12-10 19:43:04 +08:00
parent 94eff82a21
commit 0525c605f4
4 changed files with 156 additions and 41 deletions

View File

@ -132,3 +132,29 @@ export function apiEditTask(query) {
data: query data: query
}) })
} }
// 任务记录
export function apiChangeTaskList(query) {
return request({
url: '/lz_management/performance/result/changeTaskList',
method: 'post',
data: query
})
}
// 添加评论
export function apiAddTaskComment(query) {
return request({
url: '/lz_management/user/lzstaffrole/task/comment',
method: 'post',
data: query
})
}
// 评论列表
export function apiTaskCommentList(query) {
return request({
url: '/lz_management/user/lzstaffrole/comment/list',
method: 'post',
data: query
})
}

View File

@ -1,17 +1,26 @@
<!-- --> <!-- -->
<template> <template>
<div class="pinglunTem"> <div class="pinglunTem">
<div class="pinglunTem-left"> <div class="pingcontent"
<img src="@/assets/img/default.jpg" style="display:flex;"
alt=""> :key="i.id"
</div> v-for="i in pinglunList">
<div class="pinglunTem-right"> <div class="pinglunTem-left">
<div class="pinglunTem-right-title"> <img :src="i.avatar"
<div><span>十万</span><span class="beizhu">#开机后即可很快就#</span></div> alt="">
<div>2020-12-12 12:00:00</div>
</div> </div>
<div class="pinglunTem-right-content"> <div class="pinglunTem-right">
将骄傲和公司的环境kg阿克苏较好的噶好几款是个大括号建安公司大家观看 <div class="pinglunTem-right-title">
<div><span>{{i.staffName}}</span><span class="beizhu">#
<span v-if="i.type===1">修改名称</span>
<span v-if="i.type===2">修改进度</span>
<span v-if="i.type===3">名称和进度都修改</span>
#</span></div>
<div>{{i.gmtCreate}}</div>
</div>
<div class="pinglunTem-right-content">
{{i.label}}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -20,6 +29,13 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
props: {
pinglunList: {
type: Array,
default: () => []
}
},
// 12 3
data () { data () {
return { return {
@ -38,13 +54,16 @@ export default {
<style lang='less' scoped> <style lang='less' scoped>
.pinglunTem { .pinglunTem {
display: flex; .pingcontent {
margin: 20px 0;
}
&-left { &-left {
width: 40px; width: 40px;
margin: 0 10px 0 0; margin: 0 10px 0 0;
img { img {
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 50%;
} }
} }
&-right { &-right {

View File

@ -21,13 +21,13 @@
<div class="drawer-content-left-title"> <div class="drawer-content-left-title">
<div> 关键结果{{handleFilter(taskInfo.resultTasks).length}}</div> <div> 关键结果{{handleFilter(taskInfo.resultTasks).length}}</div>
<div> <div>
<i style="color:#409EFF;" <el-button icon="el-icon-plus"
class="el-icon-plus"></i> @click="handleAddTask"
<el-button @click="handleAddTask"
type="text">添加</el-button> type="text">添加</el-button>
</div> </div>
</div> </div>
<div v-for="i in handleFilter(taskInfo.resultTasks)" <div v-for="i in handleFilter(taskInfo.resultTasks)"
:key="i.id"
class="boderAndRadius drawer-content-left-content"> class="boderAndRadius drawer-content-left-content">
<div :style="{border:!(!i.updateProcess && i.label)?'none':''}" <div :style="{border:!(!i.updateProcess && i.label)?'none':''}"
class="drawer-content-left-content-top"> class="drawer-content-left-content-top">
@ -41,7 +41,7 @@
<el-input v-if="i.editProcess" <el-input v-if="i.editProcess"
size="small" size="small"
placeholder="请输入内容" placeholder="请输入内容"
v-model="form.input" v-model="form.name"
clearable> clearable>
</el-input> </el-input>
</div> </div>
@ -49,6 +49,7 @@
<div class="right"> <div class="right">
<div v-if="i.editProcess"> <div v-if="i.editProcess">
<el-button size="mini" <el-button size="mini"
@click="handleEditTask(1)"
type="primary">确认</el-button> type="primary">确认</el-button>
<el-button size="mini" <el-button size="mini"
@click="handleEditProcess(i,false)" @click="handleEditProcess(i,false)"
@ -94,23 +95,27 @@
</div> </div>
<div v-if="!i.updateProcess && i.label" <div v-if="!i.updateProcess && i.label"
class="drawer-content-left-content-center" class="drawer-content-left-content-center"
:class="{bg:false}"> :class="{bg:i.showTask}">
<div class="content commonFont"> <div class="content commonFont">
<div class="drawer-content-left-content-center-left"> <div class="drawer-content-left-content-center-left">
<img v-if="true" <img v-if="!i.showTask"
:onerror="defaultImg" :onerror="defaultImg"
:src='i.avatar' :src='i.avatar || defaultImg'
alt=""> alt="">
<span v-if="true">{{i.staffName}}</span> <span v-if="!i.showTask">{{i.staffName}}:</span>
<span v-if="true">:{{i.label}}</span> <span class="label"
style="word-wrap:break-word;"
v-if="!i.showTask">{{i.label}}</span>
</div> </div>
<div> <div style="user-select:none;">
<i :class="{rate:false}" <i :class="{rate:!i.showTask}"
style=" cursor: pointer;color:#3ba1ff;" @click="handleShowAll(i)"
style=" cursor: pointer;color:#3ba1ff;transition: all 0.2s;"
class="el-icon-arrow-down"></i> class="el-icon-arrow-down"></i>
</div> </div>
</div> </div>
<pinglun v-if="false" /> <pinglun v-if="i.showTask"
:pinglunList='i.taskList' />
</div> </div>
<div v-if="i.updateProcess" <div v-if="i.updateProcess"
class="drawer-content-left-content-bottom"> class="drawer-content-left-content-bottom">
@ -137,7 +142,7 @@
<div style="text-align: right;"> <div style="text-align: right;">
<el-button type="primary" <el-button type="primary"
size="mini" size="mini"
@click="handleEditTask">确定</el-button> @click="handleEditTask(2)">确定</el-button>
<el-button @click="handleUpdateProcess(i,false)" <el-button @click="handleUpdateProcess(i,false)"
size="mini">取消</el-button> size="mini">取消</el-button>
</div> </div>
@ -160,7 +165,8 @@
<div v-if="activeName==='1'" <div v-if="activeName==='1'"
class="drawer-content-right-item pinglun"> class="drawer-content-right-item pinglun">
<div class="pinglun-top"> <div class="pinglun-top">
<pinglun /> <pinglun :pinglunList='pinglunList' />
</div> </div>
<div class="pinglun-bottom"> <div class="pinglun-bottom">
<el-input type="textarea" <el-input type="textarea"
@ -172,7 +178,7 @@
</div> </div>
<div v-if="activeName==='2'" <div v-if="activeName==='2'"
class="drawer-content-right-item jilu"> class="drawer-content-right-item jilu">
记录ss <pinglun :pinglunList='pinglunList' />
</div> </div>
</div> </div>
</div> </div>
@ -191,9 +197,9 @@
<el-form-item label="任务进度" <el-form-item label="任务进度"
prop="weight"> prop="weight">
<el-input size="small" <el-input size="small"
@blur="$handleBlur('form.process')" @blur="$handleBlur('form.processRate')"
@input.native="$handleInputInt('form.process')" @input.native="$handleInputInt('form.processRate')"
v-model="form.process"> v-model="form.processRate">
<template slot="append">%</template> <template slot="append">%</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -204,7 +210,7 @@
@click="dialogFormVisible = false"> </el-button> @click="dialogFormVisible = false"> </el-button>
<el-button size="small" <el-button size="small"
type="primary" type="primary"
@click="dialogFormVisible = false"> </el-button> @click="handleEditTask(3)"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -214,7 +220,7 @@
import InfoHeader from '@/components/InfoHeader' import InfoHeader from '@/components/InfoHeader'
import pinglun from './pinglun.vue' import pinglun from './pinglun.vue'
import { apiDeleteTask, apiEditTask } from '@/api/assessment' import { apiDeleteTask, apiEditTask, apiChangeTaskList, apiTaskCommentList, apiAddTaskComment } from '@/api/assessment'
export default { export default {
props: { props: {
@ -243,8 +249,9 @@ export default {
}, },
form: { form: {
name: '', name: '',
process: '0' processRate: '0'
}, },
pinglunList: [],
dialogFormVisible: false, dialogFormVisible: false,
title: '添加任务', title: '添加任务',
defaultImg: 'this.src="' + require('@/assets/img/default.jpg') + '"' defaultImg: 'this.src="' + require('@/assets/img/default.jpg') + '"'
@ -255,17 +262,60 @@ export default {
beforeMount () { }, beforeMount () { },
mounted () { mounted () {
this.taskInfo = Object.assign({}, this.taskObj) this.taskInfo = Object.assign({}, this.taskObj)
this.handleGetChangeTaskList()
console.log(this.taskInfo) console.log(this.taskInfo)
}, },
methods: { methods: {
async handleEditTask () { //
const res = await apiEditTask(Object.assign({}, this.form, { processRate: this.form.processRate / 100 })) async handleShowAll (i) {
if (i.showTask) {
i.showTask = false
this.$forceUpdate()
return
}
const params = {
currPage: 1,
taskId: i.id,
pageSize: 2300
}
i.taskList = []
let res = await apiChangeTaskList(params)
if (res.code !== 200) {
this.$message.error(res.msg)
return
}
i.showTask = true
i.taskList = res.data.list
this.$forceUpdate()
},
async handleGetChangeTaskList () {
const params = {
currPage: 1,
detailId: this.taskInfo.detailId,
pageSize: 2300
}
this.pinglunList = []
let res = await apiChangeTaskList(params)
if (res.code !== 200) {
this.$message.error(res.msg)
return
}
this.pinglunList = res.data.list
},
async handleEditTask (type) {
const params = Object.assign({}, this.form)
if (type === 2 || type === 3) params.processRate = this.form.processRate / 100
if (type === 3) params.detailId = this.taskInfo.detailId
const res = await apiEditTask(params)
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)
return return
} }
this.form = {} this.form = {}
this.taskInfo = await this.$parent.handleGetTaskDetail(this.taskInfo.detailId) this.taskInfo = await this.$parent.handleGetTaskDetail(this.taskInfo.detailId)
this.dialogFormVisible = false
this.handleGetChangeTaskList()
this.$parent.handleGetTable()
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'success' type: 'success'
@ -286,6 +336,7 @@ export default {
return return
} }
this.taskInfo = await this.$parent.handleGetTaskDetail(this.taskInfo.detailId) this.taskInfo = await this.$parent.handleGetTaskDetail(this.taskInfo.detailId)
this.$parent.handleGetTable()
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'success' type: 'success'
@ -295,6 +346,7 @@ export default {
handleUpdateProcess (i, type = false) { handleUpdateProcess (i, type = false) {
this.taskInfo.resultTasks.map(i => { this.taskInfo.resultTasks.map(i => {
i.updateProcess = false i.updateProcess = false
i.editProcess = false
}) })
if (type) { if (type) {
this.form = Object.assign({}, i) this.form = Object.assign({}, i)
@ -309,6 +361,10 @@ export default {
}, },
// / // /
handleEditProcess (i, type = false) { handleEditProcess (i, type = false) {
this.taskInfo.resultTasks.map(i => {
i.updateProcess = false
i.editProcess = false
})
i.editProcess = type i.editProcess = type
this.form = Object.assign({}, i) this.form = Object.assign({}, i)
this.form.taskId = this.form.id this.form.taskId = this.form.id
@ -366,7 +422,7 @@ export default {
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
border-right: 1px solid #666666; border-right: 1px solid #e7e7e7;
&-jiaoyi { &-jiaoyi {
.title { .title {
font-size: 16px; font-size: 16px;
@ -425,16 +481,20 @@ export default {
background: #fafafa; background: #fafafa;
} }
.rate { .rate {
transform: rotate(180deg); transform: rotate(-180deg);
transition: all 0.2s;
} }
&-center { &-center {
padding: 6px 20px 6px; padding: 6px 20px 6px;
.label {
width: 400px;
}
.content { .content {
display: flex; display: flex;
align-content: center; align-content: center;
justify-content: space-between; justify-content: space-between;
> div {
flex-shrink: 0;
}
} }
&-left { &-left {
flex: 1 0 auto; flex: 1 0 auto;
@ -467,9 +527,14 @@ export default {
} }
.pinglun { .pinglun {
display: flex; display: flex;
flex: 1;
// overflow: auto;
flex-direction: column; flex-direction: column;
&-top { &-top {
flex: 1 0 auto; flex: 1;
display: flex;
flex-direction: column;
overflow: auto;
padding: 0 20px; padding: 0 20px;
} }
&-bottom { &-bottom {
@ -495,6 +560,8 @@ export default {
} }
.jilu { .jilu {
padding: 0 20px; padding: 0 20px;
flex: 1;
overflow: auto;
} }
} }
} }

View File

@ -44,7 +44,7 @@
</div> </div>
<div class="jindu"> <div class="jindu">
<el-progress type="circle" <el-progress type="circle"
:width='40' :width='50'
:stroke-width='4' :stroke-width='4'
:percentage="Math.round((i.processRate * 100) * 1000) / 1000 "></el-progress> :percentage="Math.round((i.processRate * 100) * 1000) / 1000 "></el-progress>
<el-button type="text" <el-button type="text"
@ -344,6 +344,9 @@ export default {
handleCancelResult () { handleCancelResult () {
this.$emit('update:tableInfo', Object.assign({}, this.tableInfo, { result: false, score: false })) this.$emit('update:tableInfo', Object.assign({}, this.tableInfo, { result: false, score: false }))
}, },
handleGetTable () {
this.$parent.handleGetTbale({ id: this.$route.query.id || '' })
},
async handleGrt375 () { async handleGrt375 () {
let res = await apiGet375() let res = await apiGet375()
if (res.code !== 200) return if (res.code !== 200) return