AInspectionRoutePoint.vue
2.69 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
<template>
<div class="point-container">
<el-table :data="points" border style="width: 100%" v-loading="loading">
<el-table-column prop="inspectionId" :label="$t('aInspectionPlanDetail.pointId')" align="center" />
<el-table-column prop="inspectionName" :label="$t('aInspectionPlanDetail.pointName')" align="center" />
<el-table-column prop="pointTypeName" :label="$t('aInspectionPlanDetail.pointType')" align="center" />
<el-table-column prop="pointObjName" :label="$t('aInspectionPlanDetail.pointLocation')" align="center" />
<el-table-column :label="$t('aInspectionPlanDetail.startTime')" align="center">
<template slot-scope="scope">
{{ scope.row.pointStartTime || '-' }}
</template>
</el-table-column>
<el-table-column :label="$t('aInspectionPlanDetail.endTime')" align="center">
<template slot-scope="scope">
{{ scope.row.pointEndTime || '-' }}
</template>
</el-table-column>
<el-table-column :label="$t('aInspectionPlanDetail.sort')" align="center">
<template slot-scope="scope">
{{ scope.row.sortNumber || '-' }}
</template>
</el-table-column>
</el-table>
<el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
:total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
@current-change="handleCurrentChange" />
</div>
</template>
<script>
import { listAdminInspectionRoutePoints } from '@/api/inspection/aInspectionPlanDetailApi'
export default {
name: 'AInspectionRoutePoint',
data() {
return {
loading: false,
points: [],
inspectionRouteId: '',
page: {
current: 1,
size: 10,
total: 0
}
}
},
methods: {
async loadData(params) {
this.inspectionRouteId = params.inspectionRouteId
await this.getPointList()
},
async getPointList() {
try {
this.loading = true
const params = {
inspectionRouteId: this.inspectionRouteId,
page: this.page.current,
row: this.page.size
}
const { inspectionPoints, total } = await listAdminInspectionRoutePoints(params)
this.points = inspectionPoints
this.page.total = total
} catch (error) {
this.$message.error(this.$t('common.fetchError'))
} finally {
this.loading = false
}
},
handleSizeChange(val) {
this.page.size = val
this.getPointList()
},
handleCurrentChange(val) {
this.page.current = val
this.getPointList()
}
}
}
</script>
<style scoped>
.point-container {
padding: 20px;
}
</style>