explanation.vue
2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<template>
<div>
<Card title="案件补充说明">
<div class="explanation">
<div class="explanation-list" v-for="(item, idx) in supplementList" :key="idx">
<div class="explanation-item">
<label class="label" for="">{{ `说明${idx + 1}:` }}</label>
<el-input :disabled="disabled || item.operation == 1" :placeholder="`请输入说明${idx + 1}`" v-model="item.content" type="textarea" maxlength="200" :rows="3"></el-input>
<i class="el-icon-delete del" v-if="!disabled && supplementList.length > 1 && item.operation != 1" @click="handleDel(idx)"></i>
</div>
<div v-if="item.operation == 1" class="operate-wrap">
<span></span>
<span>操作时间:{{ item.operationTime | formatTime(item.operationTime) }}</span>
</div>
</div>
</div>
<div class="add-explanation" v-if="!disabled" @click="addExplanation">
<i class="el-icon-circle-plus-outline"></i>
<span>新增说明</span>
</div>
</Card>
</div>
</template>
<script type="text/ecmascript-6">
import Card from './card.vue'
import util from '@/util/util'
export default {
name: 'explanation',
data() {
return {}
},
components: {
Card
},
filters: {
formatTime(time) {
return time ? util.dateFormat(time, 'YYYY-MM-DD HH:mm:ss') : '--'
}
},
props: {
supplementList: {
type: Array,
default: function () {
return [{ content: '' }]
}
},
disabled: {
type: Boolean,
default: false
}
},
mounted() {},
methods: {
handleDel(idx) {
this.$delete(this.supplementList, idx)
},
addExplanation() {
const idx = this.supplementList.length
const newObj = { claimsId: this.supplementList[idx - 1].claimsId, content: '' }
this.$set(this.supplementList, idx, newObj)
}
}
}
</script>
<style lang="scss" scoped>
.explanation {
.explanation-list {
margin-bottom: 20px;
&:last-child {
margin-bottom: 10px;
}
}
.operate-wrap {
display: flex;
margin-left: 154px;
width: 580px;
justify-content: space-between;
font-weight: 400;
font-size: 12px;
height: 17px;
line-height: 17px;
margin-top: 4px;
color: #666666;
}
.explanation-item {
display: flex;
// align-items: center;
/deep/ .el-textarea {
width: 580px;
}
.label {
width: 154px;
font-size: 14px;
font-weight: 400;
line-height: 32px;
color: #333;
text-align: right;
flex-shrink: 0;
}
}
.del {
color: #c6c6c6;
font-size: 16px;
margin-left: 10px;
cursor: pointer;
margin-top: 28px;
}
}
.add-explanation {
color: #5850ff;
display: flex;
align-items: center;
margin-left: 154px;
cursor: pointer;
.el-icon-circle-plus-outline {
font-size: 20px;
margin-right: 6px;
}
span {
font-size: 12px;
}
}
</style>