This commit is contained in:
xiongchengqiang 2020-12-14 16:00:44 +08:00
parent cba97c61ff
commit 8a079a19a2
5 changed files with 45 additions and 104 deletions

View File

@ -22,7 +22,7 @@
<div>
<slot name="footer-left"></slot>
</div>
<div>
<div >
<el-button
size="small"
@click="$emit('cancel')"

View File

@ -1,73 +0,0 @@
const elTransition = '0.3s height ease-in-out, 0.3s padding-top ease-in-out, 0.3s padding-bottom ease-in-out'
const Transition = {
'before-enter' (el) {
el.style.transition = elTransition
if (!el.dataset) el.dataset = {}
el.dataset.oldPaddingTop = el.style.paddingTop
el.dataset.oldPaddingBottom = el.style.paddingBottom
el.style.height = 0
el.style.paddingTop = 0
el.style.paddingBottom = 0
},
'enter' (el) {
el.dataset.oldOverflow = el.style.overflow
if (el.scrollHeight !== 0) {
el.style.height = el.scrollHeight + 'px'
el.style.paddingTop = el.dataset.oldPaddingTop
el.style.paddingBottom = el.dataset.oldPaddingBottom
} else {
el.style.height = ''
el.style.paddingTop = el.dataset.oldPaddingTop
el.style.paddingBottom = el.dataset.oldPaddingBottom
}
el.style.overflow = 'hidden'
},
'after-enter' (el) {
el.style.transition = ''
el.style.height = ''
el.style.overflow = el.dataset.oldOverflow
},
'before-leave' (el) {
if (!el.dataset) el.dataset = {}
el.dataset.oldPaddingTop = el.style.paddingTop
el.dataset.oldPaddingBottom = el.style.paddingBottom
el.dataset.oldOverflow = el.style.overflow
el.style.height = el.scrollHeight + 'px'
el.style.overflow = 'hidden'
},
'leave' (el) {
if (el.scrollHeight !== 0) {
el.style.transition = elTransition
el.style.height = 0
el.style.paddingTop = 0
el.style.paddingBottom = 0
}
},
'after-leave' (el) {
el.style.transition = ''
el.style.height = ''
el.style.overflow = el.dataset.oldOverflow
el.style.paddingTop = el.dataset.oldPaddingTop
el.style.paddingBottom = el.dataset.oldPaddingBottom
}
}
export default {
name: 'collapseTransition',
functional: true,
render (h, { children }) {
const data = {
on: Transition
}
return h('transition', data, children)
}
}

View File

@ -18,12 +18,11 @@
:name="String(i.id)">
<div class="goals-content-tabbar-table">
<div class="goals-content-tabbar-table-header commonFont">
<span style="width:20%">指标名称</span>
<span style="flex:1 0 auto;">指标名称</span>
<span class="kaohe"
style="width:30%">考核标准</span>
<span style="width:20%">进度</span>
<span style="width:10%">权重</span>
<span style="width:20%">操作</span>
style="flex:1 0 auto;">考核标准</span>
<span style="flex:1 0 auto;">权重</span>
<span style="width:240px;">操作</span>
</div>
<div style="justify-content:center;"
v-if="handleFilter(i.detailDtos).length===0"
@ -36,25 +35,19 @@
v-for="(j,indexJ) in handleFilter(i.detailDtos)"
:key="indexJ">
<div class="goals-content-tabbar-table-content-top">
<div style="width:20%"
<div style="flex:1 0 auto;"
class="my-handle"><img style="width:20px;height:20px;"
src="@/assets/img/yidong.png"
alt="">{{j.target}}</div>
<div style="width:30%"
<div style="flex:1 0 auto;"
class="kaohe">
<pre>{{j.keyResult}}</pre>
</div>
<div style="width:20%">
<el-progress type="circle"
:width='40'
:stroke-width='4'
:percentage="handleGetProgress(j,j.taskDtos)"></el-progress>
</div>
<div style="width:10%">{{ Math.round((j.checkWeight * 100)*1000)/1000}}%</div>
<div style="width:20%">
<div style="flex:1 0 auto;">{{ Math.round((j.checkWeight * 100)*1000)/1000}}%</div>
<div style="width:240px;">
<el-button @click="hanidleAddTask(j,0)"
type="text"
size="small">
type="primary" plain
size="mini">
添加任务
</el-button>
<el-button @click="hanidleEdit(j,indexJ,index)"
@ -62,7 +55,7 @@
size="small">
编辑
</el-button>
<el-button @click="handleDelateWeidu(j,indexJ,index)"
<el-button style="color:#F56C6C;" @click="handleDelateWeidu(j,indexJ,index)"
type="text"
size="small">
删除
@ -72,14 +65,20 @@
<div v-for="(kitem,indexK) in handleFilter(j.taskDtos)"
:key="indexK"
class="goals-content-tabbar-table-content-bottom">
<div>{{kitem.name}}({{Math.round((kitem.processRate * 100)*1000)/1000|| 0}}%)</div>
<div style="width:10%">
<div>任务{{indexK+1}}{{kitem.name.length>16?kitem.name.substring(0,12):kitem.name}}(当前进度:{{Math.round((kitem.processRate * 100)*1000)/1000|| 0}}%)</div>
<div style="width:240px;padding: 0 0 0 20px;">
<el-button style="visibility:hidden;"
type="primary" plain
size="mini">
添加任务
</el-button>
<el-button type="text"
@click="hanidleAddTask(j,1,kitem)"
size="small">
编辑
</el-button>
<el-button type="text"
style="color:#F56C6C;"
@click="handleDeleteTask(j,kitem)"
size="small">
删除
@ -94,7 +93,7 @@
业务指标权重{{handleGetWeight(i)}}% <span v-if="i.weight !== null">/{{Math.round((i.weight * 100)*1000)/1000}}%</span>
</div>
<div>
所有指标总权重: {{ handleGetWeight1()}}%
所有指标总权重: <span style="color:#EE6723;">{{ handleGetWeight1()}}%</span>
</div>
</div>
<div style=" padding: 10px;">
@ -139,6 +138,11 @@
</el-form-item>
</el-form>
</div>
<el-button slot="footer"
@click="handleSubmitTask(1)"
size="small"
type="primary"
>确定并继续添加</el-button>
</popup-right>
<popup-right v-if="showIndicators"
@cancel='handleCancelZhibiao'
@ -298,7 +302,7 @@ export default {
this.showTask = false
},
//
handleSubmitTask () {
handleSubmitTask (type) {
this.$refs.formTask.validate((v) => {
if (v) {
this.formTask.processRate = Number(this.formTask.processRate) / 100
@ -310,7 +314,11 @@ export default {
this.editItem.processRate = this.formTask.processRate || '0'
}
this.$forceUpdate()
this.handleCancelTask()
if (!type) this.handleCancelTask()
this.formTask = {
name: '',
processRate: '0'
}
console.log(this.formTask)
}
})
@ -520,6 +528,9 @@ export default {
<style lang='less' scoped>
.goals {
span,div{
box-sizing: border-box;
}
.kaohe {
flex: none;
width: 500px;
@ -601,6 +612,7 @@ export default {
&-content {
// align-items: center;
// height: 60px;
border-bottom: 1px solid @borderColor;
&-top {
border-bottom: 1px solid @borderColor;
display: flex;
@ -612,9 +624,9 @@ export default {
}
}
&-bottom {
padding: 10px 20px 10px 0;
border-bottom: 1px solid @borderColor;
font-size: 10px;
display: flex;
color:#999999;
align-items: center;
justify-content: space-between;
margin: 0 0 0 20px;

View File

@ -39,17 +39,17 @@
</el-form-item>
<el-form-item label="任务进度:"
prop="weight">
<!-- <el-input size="small"
<el-input size="small"
@blur="$handleBlur('form.processRate')"
@input.native="$handleInputInt('form.processRate')"
v-model="form.processRate">
<template slot="append">%</template>
</el-input> -->
<br />
</el-input>
<!-- <br />
<el-slider
v-model="form.processRate"
:step="10">
</el-slider>
</el-slider> -->
</el-form-item>
</el-form>
<div slot="footer"

View File

@ -53,7 +53,7 @@
查看任务
</el-button>
</div>
<div class="kaohe pre">
<div class="kaohe pre" style="justify-content: flex-start;">
<pre>
{{i.keyResult}}
</pre>
@ -312,6 +312,7 @@ export default {
return '总分:' + (this.scoreList.filter(i => i.minScore <= result && i.maxScore > result).length > 0 ? this.scoreList.filter(i => i.minScore <= result && i.maxScore > result)[0].name : '--')
},
handleGetScorlList (list) {
if (!list) list = []
console.log('list: ', list)
console.log('userInfo: ', this.userInfo.userId)
return list.filter(i => i.acquireScore !== null || (i.approvalId === this.userInfo.userId && this.tableInfo.score))
@ -394,6 +395,7 @@ export default {
padding: 10px !important;
display: block;
.center();
justify-content: center;
pre {
white-space: pre-line;
word-wrap: break-word;