explanation.vue
6.73 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<template>
<div>
<Card title="案件补充说明">
<div class="explanation">
<div class="explanation-item" v-for="(item, idx) in supplementListTemp" :key="idx">
<div class="explanation-list">
<label class="label" for="">{{ `说明${idx + 1}:` }}</label>
<el-input :disabled="isCheck || isDisabled || item.operation == 1" :placeholder="`请输入说明${idx + 1}`" v-model="item.content" maxlength="200" type="textarea" :rows="3"></el-input>
<i class="el-icon-delete del" v-if="!isCheck && supplementListTemp.length > 1 && item.operation != 1" @click="handleDel(idx)"></i>
<div class="follow-list" @click="showFollow">跟进记录</div>
</div>
<div class="operator">
<div>操作人:{{ item.operationUser ? item.operationUser : '--' }}</div>
<div>操作时间:{{ item.operationTime ? item.operationTime : '--' }}</div>
</div>
</div>
</div>
<div v-if="!isCheck && !isDisabled" class="add-explanation" @click="addExplanation">
<i class="el-icon-circle-plus-outline"></i>
<span>新增说明</span>
</div>
</Card>
<!-- 跟进记录 -->
<GLDialog :title="followDialogTitle" mode="mid" :close-on-press-escape="false" :close-on-click-modal="false" :visible.sync="followDialog" bef :okText="followOkText" @onOk="toAddFollw" @onCancel="closeFollow">
<template v-if="!followEditStatus">
<div class="wrap_time_line">
<templatece v-if="!followResult">
<el-timeline reverse="true">
<el-timeline-item :class="[{ spec: !index }]" v-for="(item, index) in followListData" :key="index" :timestamp="item.createdDate">
{{ item.content }}
</el-timeline-item>
</el-timeline>
</templatece>
<template v-else>
<div style="margin-top: 60px; text-align: center">暂无跟进记录</div>
</template>
</div>
</template>
<template v-if="followEditStatus">
<div class="wrap_time_line">
<div class="col">
<div class="label">
<span style="color: #eb4e4e">*</span>
<span>具体描述:</span>
</div>
<div class="fill">
<el-input maxlength="200" style="width: 432px" type="textarea" :rows="3" placeholder="请输入" v-model="followContent"></el-input>
</div>
</div>
</div>
</template>
</GLDialog>
</div>
</template>
<script type="text/ecmascript-6">
import Card from './card.vue'
import * as dayjs from 'dayjs'
export default {
name: 'explanation',
data() {
return {
followDialog: false,
followListData: [],
followDialogTitle: '跟进记录',
followOkText: '新增',
followEditStatus: false,
followContent: '',
followResult: false,
curentFollowInfo: '',
supplementListTemp: [{ content: '' }]
}
},
components: {
Card
},
props: {
supplementList: {
type: Array,
default: function () {
return [{ content: '' }]
}
},
isCheck: Boolean,
isDisabled: Boolean,
operatorName: String,
id: Number
},
mounted() {},
watch: {
supplementList: {
deep: true,
handler(val) {
this.supplementListTemp = val
val.forEach(item => {
item.operationTime = dayjs(item.operationTime).format('YYYY-MM-DD HH:mm:ss')
})
},
immediate: true
}
},
methods: {
showFollow() {
this.followDialog = true
this.curentFollowInfo = {
id: this.id,
operatorName: this.operatorName
}
this.followListData = []
this.getFollowList(this.curentFollowInfo)
},
closeFollow() {
if (this.followEditStatus) {
// 切换
this.followDialogTitle = '跟进记录'
this.followEditStatus = false
this.followOkText = '新增'
} else {
// 关闭弹窗
this.followDialog = false
this.curentFollowInfo = null
this.followOkText = '新增'
}
},
toAddFollw() {
if (!this.followEditStatus) {
// 切换新增
this.followDialogTitle = '新增记录'
this.followOkText = '提交'
this.followEditStatus = true
} else {
// 切换查看
this.followDialogTitle = '跟进记录'
this.followOkText = '新增'
this.followEditStatus = false
this.createFollow()
}
},
createFollow() {
let para = {
claimsId: this.curentFollowInfo.id,
content: this.followContent,
createdBy: this.curentFollowInfo.operatorName
}
this.$apis.claims.addGHClaimFollowsListApi(para).then(res => {
this.followDialogTitle = '跟进记录'
this.followOkText = '新增'
this.followEditStatus = false
this.getFollowList(this.curentFollowInfo)
this.$message({
message: '新增成功',
type: 'success'
})
})
},
getFollowList(row) {
this.$apis.claims.getGHClaimFollowsListApi({ claimsId: row.id }).then(res => {
res.forEach(el => {
el.createdDate = dayjs(el.createdDate).format('YYYY-MM-DD HH:mm:ss')
})
this.followListData = res || []
this.followResult = res.length ? false : true
})
},
handleDel(idx) {
this.$delete(this.supplementListTemp, idx)
},
addExplanation() {
const idx = this.supplementListTemp.length
const newObj = { claimsId: this.supplementListTemp[idx - 1].claimsId, content: '' }
this.$set(this.supplementListTemp, idx, newObj)
}
}
}
</script>
<style lang="scss" scoped>
.explanation {
.explanation-item {
margin-bottom: 20px;
&:last-child {
margin-bottom: 10px;
}
}
.explanation-list {
position: relative;
display: flex;
/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: #2a58ad;
display: inline-flex;
align-items: center;
margin-left: 154px;
cursor: pointer;
.el-icon-circle-plus-outline {
font-size: 20px;
margin-right: 6px;
}
span {
font-size: 12px;
}
}
.operator {
font-size: 12px;
color: #666666;
display: flex;
justify-content: space-between;
margin-left: 154px;
width: 580px;
margin-top: 4px;
margin-bottom: 20px;
}
.follow-list {
font-size: 14px;
color: #2a58ad;
bottom: 0;
position: absolute;
left: 742px;
cursor: pointer;
}
</style>