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
241
242
| <template>
| <div>
| <el-dialog
| :close-on-press-escape="false"
| :visible.sync="isShow"
| title="不合格处理OA流程"
| width="900px"
| top="10vh"
| @close="$emit('closeOAProcess')"
| >
| <el-timeline style="height: 80vh; overflow-y: scroll">
| <el-timeline-item
| placement="top"
| v-for="node in nodes"
| :key="node.id"
| :timestamp="node.name"
| :icon="node.hasData ? 'el-icon-check' : 'el-icon-time'"
| :color="node.hasData ? '#0bbd87' : ''"
| >
| <el-card>
| <h3 class="node-title">{{ node.operation }}</h3>
| <div class="node-details">
| <div class="detail-item">
| <span class="label">处理人:</span>
| <span class="value">{{ node.operator || "-" }}</span>
| </div>
| <div class="detail-item">
| <span class="label">处理时间:</span>
| <span class="value">{{ node.time || "-" }}</span>
| </div>
| <div class="detail-item">
| <span class="label">{{node.name && node.name==='1检验员'?'不合格描述:':'处理意见:'}}</span>
| <span class="value">{{ node.info || "-" }}</span>
| </div>
| </div>
| </el-card>
| </el-timeline-item>
| </el-timeline>
| </el-dialog>
| </div>
| </template>
|
| <script>
| import { getOaFlow } from "../../../../api/business/unqualifiedHandler";
|
| export default {
| name: "OAProcess",
| // import 引入的组件需要注入到对象中才能使用
| components: {},
| props: {
| OAProcess: {
| type: Boolean,
| default: () => false,
| },
| },
| data() {
| // 这里存放数据
| return {
| isShow: this.OAProcess,
| nodes: [
| {
| id: 1,
| name: "1检验员",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| {
| id: 2,
| name: "2检测主管确认",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| {
| id: 3,
| name: "3物流部确认",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| {
| id: 4,
| name: "4产品工程师处理意见",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| {
| id: 5,
| name: "5.总工或者副经理的处理意见",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| {
| id: 6,
| name: "6质量部",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| {
| id: 7,
| name: "7质量部经理",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| {
| id: 8,
| name: "8核算员",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| {
| id: 9,
| name: "9物流部索赔结果",
| info: "",
| time: "",
| operator: "",
| operation: "",
| hasData: false,
| },
| ],
| };
| },
| // 方法集合
| methods: {
| getInfo(id,unqualifiedDesc) {
| getOaFlow({
| id: id,
| })
| .then((res) => {
| if (res.code === 200) {
| const data = res.data;
| if (data.length > 0) {
| data.forEach((item) => {
| const node = this.nodes.find((n) => n.name === item.nodeName);
| if (node) {
| node.time = item.approvalDate + " " + item.approvalTime;
| if(item.nodeName && item.nodeName==="1检验员"){
| node.info=unqualifiedDesc;
| }else{
| node.info = item.approvalOpinion;
| }
| node.operator = item.approver;
| node.operation = item.operation;
| node.hasData = true;
| }
| });
| }
| }
| })
| .catch((err) => {
| this.submitDeclareLoading = false;
| console.log(err);
| });
| },
| },
| };
| </script>
|
| <style scoped>
| .timeline-item-content {
| padding: 15px;
| border: 1px solid #e4e7ed;
| border-radius: 4px;
| margin-bottom: 10px;
| transition: all 0.3s ease;
| }
|
| .node-title {
| font-size: 16px;
| font-weight: bold;
| margin-bottom: 10px;
| color: #333;
| }
|
| .node-details {
| display: flex;
| flex-wrap: wrap;
| gap: 15px;
| }
|
| .detail-item {
| display: flex;
| align-items: center;
| min-width: 350px;
| }
|
| .label {
| font-weight: 500;
| color: #606266;
| margin-right: 8px;
| min-width: 90px;
| }
|
| .value {
| color: #303133;
| }
|
| /* 已完成节点样式 */
| .node-completed {
| color: #67c23a;
| }
|
| .node-completed .timeline-item-content {
| border-color: #c6e2b8;
| background-color: #f0f9eb;
| }
|
| .node-completed .node-title {
| color: #67c23a;
| }
|
| /* 时间线图标样式 */
| .el-timeline-item__node {
| background-color: #909399;
| }
|
| .node-completed .el-timeline-item__node {
| background-color: #67c23a;
| }
| </style>
|
|