DetectionInspectorView.vue
7.25 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
<template>
<div>
<div class="titleBox">
检测师详情
<a-button style="float: right;" @click="handleBack()">返回列表</a-button>
</div>
<div class="inspectorDetail">
<a-descriptions :column="5" size="small" layout="vertical">
<template #title>
基本信息
<a-button @click="handleEdit()" type="primary" style="float: right;">编辑</a-button>
</template>
<a-descriptions-item label="姓名">
{{ pageData?.account?.name || '-' }}
</a-descriptions-item>
<a-descriptions-item label="手机号">{{ pageData?.account?.phone || '-' }}</a-descriptions-item>
<a-descriptions-item label="所在城市">{{ pageData?.account?.regionName || '-' }}</a-descriptions-item>
<a-descriptions-item label="账号状态">
<a-tag v-if="pageData?.account?.status == 1" color="#E8F8F2" :style="{ color: '#00AD74' }"
:bordered="false">启用</a-tag>
<a-tag v-if="pageData?.account?.status == 0" color="#F0F2F5" :style="{ color: '#777C85' }"
:bordered="false">禁用</a-tag>
</a-descriptions-item>
<a-descriptions-item label="账号创建时间">{{ pageData?.account?.createTime || '-' }}</a-descriptions-item>
</a-descriptions>
</div>
<div style="width: 100%;float: left;margin-top: 24px;">
<a-row :gutter="24">
<a-col :span="12">
<a-card class="stat-card">
<img src="@/assets/detection/inspectorCount.png" class="stat-img">
<a-statistic class="stat-data" title="累计已检"
:value="pageData?.inspectorSimpleSummary?.inspectCount || 0"></a-statistic>
</a-card>
</a-col>
<a-col :span="12">
<a-card class="stat-card">
<img src="@/assets/detection/countInspect.png" class="stat-img">
<a-statistic class="stat-data" title="平均检测耗时"
:value="convertToHourMinuteSecond(pageData?.inspectorSimpleSummary?.avgInspectCost || 0)">
</a-statistic>
</a-card>
</a-col>
</a-row>
</div>
<!-- 关联工单列表 -->
<div style="width: 100%;float: left;margin-top: 16px;">
<a-descriptions :column="1" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
关联工单列表
<div class="title-line"></div>
</template>
</a-descriptions>
<div style="width: 100%;float: left;">
<TicketList ref="ticketListRef" :ticketListData="pageData" />
</div>
</div>
<!-- 操作日志 -->
<div style="width: 100%;float: left;">
<a-descriptions :column="1" size="small" layout="vertical">
<template #title>
<div>
<div>
<title-tip-icon></title-tip-icon>
操作日志
</div>
<div @click="handleFold(false)" v-if="isShowFold" class="foldBox">收起
<DoubleLeftOutlined color="#666666" font-size="13px;" style="transform: rotate(90deg);" />
</div>
<div @click="handleFold(true)" v-else class="foldBox">展开
<DoubleLeftOutlined color="#666666" font-size="13px;" style="transform: rotate(270deg);" />
</div>
</div>
<div class="title-line"></div>
</template>
<a-descriptions-item v-if="isShowFold" label="">
<OperationLog ref="operationLogRef" :operationLogData="pageData" />
</a-descriptions-item>
</a-descriptions>
</div>
<!--编辑检测师弹窗-->
<InspectorAddForm ref="inspectorAddFormRef" @emitOk="getDetailData" />
</div>
</template>
<script lang="ts">
import { Component } from 'vue-facing-decorator';
import { PaginationComponent } from "@/components/PaginationComponent";
import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";
import { DetectionController } from "@/api/DetectionController";
import TitleDivider from "@/components/TitleDivider.vue";
import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";
import InspectorAddForm from "@/views/detection/inspector/components/InspectorAddForm.vue";
import OperationLog from "@/views/detection/inspector/components/OperationLog.vue";
import TicketList from "@/views/detection/inspector/components/ticketList.vue";
import { DoubleLeftOutlined } from '@ant-design/icons-vue';
@Component({
components: { TitleDivider, TitleTipIcon, InspectorAddForm, OperationLog, TicketList, DoubleLeftOutlined }
})
export default class DetectionInspectorView extends PaginationComponent<Vehicle> {
routeData: any = {
id: '',
action: ''
};
pageData: any = {};
isShowFold: boolean = true;
created(): void {
this.routeData = this.$route.query;
this.getDetailData();
}
getDetailData() {
DetectionController.inspectDetail(this.axios, { id: this.routeData.id }).then(response => {
this.pageData = response.data.data || {};
});
}
handleEdit() {
this.$refs.inspectorAddFormRef.init(this.pageData.account || {});
}
handleBack() {
this.$router.back();
}
handleFold(isFold: boolean) {
this.isShowFold = isFold;
}
//秒转换为时分秒
convertToHourMinuteSecond(seconds: number) {
const hours = Math.floor(seconds / 3600);
const minutes = Math.floor((seconds % 3600) / 60);
return `${hours}小时${minutes}分`;
}
}
</script>
<style scoped lang="less">
.titleBox {
width: -webkit-calc(100% - 24px);
width: -moz-calc(100% - 24px);
width: calc(100% - 24px);
height: 32px;
line-height: 32px;
margin-left: 12px;
font-size: 16px;
font-weight: 700;
margin-bottom: 4px;
}
.inspectorDetail {
padding: 16px;
width: 100%;
border-radius: 8px;
float: left;
margin-top: 12px;
background: linear-gradient(56.9deg, #e6f6ff 0%, #f0f6ff 28.999999999999996%, #f0f6ff 60%, #e3f1ff 100%);
}
.ant-card .ant-card-body {
padding: 0 !important;
}
.ant-card-bordered {
border: none;
}
.stat-card ::v-deep(.ant-card-body) {
display: flex;
padding: 0 16px;
height: 100px;
border-radius: 8px;
background: linear-gradient(180deg, #e3f0ff 0%, #f9fbfe 100%);
}
.stat-img {
width: 36px;
height: 36px;
margin-right: 16px;
margin-top: 32px;
}
.stat-data {
margin-top: 24px;
}
.title-line {
width: 100%;
height: 1px;
background-color: #F2F4F7;
margin-top: 10px;
}
.foldBox {
float: right;
color: #666666;
font-size: 13px;
font-weight: 400;
margin-top: -16px;
cursor: pointer;
}
</style>