carDetailTransactionCar.vue
3.83 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
<template>
<div class="margin-top">
<div class="margin-top-lg"></div>
<div class="margin-top">
<el-table :data="carDetailTransactionCarInfo.machineTranslates" border style="width: 100%">
<el-table-column prop="machineTranslateId" :label="$t('carDetailTransactionCar.syncId')"
align="center"></el-table-column>
<el-table-column prop="machineCode" :label="$t('carDetailTransactionCar.deviceCode')"
align="center"></el-table-column>
<el-table-column prop="typeCdName" :label="$t('carDetailTransactionCar.objectType')"
align="center"></el-table-column>
<el-table-column prop="objName" :label="$t('carDetailTransactionCar.objectName')"
align="center"></el-table-column>
<el-table-column prop="machineCmdName" :label="$t('carDetailTransactionCar.command')"
align="center"></el-table-column>
<el-table-column prop="stateName" :label="$t('carDetailTransactionCar.status')"
align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('carDetailTransactionCar.remark')" align="center"
width="80px"></el-table-column>
<el-table-column prop="updateTime" :label="$t('carDetailTransactionCar.syncTime')"
align="center"></el-table-column>
<el-table-column :label="$t('carDetailTransactionCar.operation')" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="_openEditMachineTranslateModel(scope.row)">
{{ $t('carDetailTransactionCar.resync') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-row>
<el-col :span="16" :offset="8">
<el-pagination @current-change="handleCurrentChange" :current-page="currentPage" :page-size="pageSize"
layout="total, prev, pager, next, jumper" :total="total">
</el-pagination>
</el-col>
</el-row>
</div>
<edit-machine-translate ref="editMachineTranslate"></edit-machine-translate>
</div>
</template>
<script>
import { getMachineTranslates } from '@/api/car/carDetailTransactionCarApi'
import EditMachineTranslate from '@/components/property/editMachineTranslate'
import { getCommunityId } from '@/api/community/communityApi'
export default {
name: 'CarDetailTransactionCar',
components: {
EditMachineTranslate
},
data() {
return {
carDetailTransactionCarInfo: {
machineTranslates: [],
ownerId: '',
carId: '',
memberId: ''
},
currentPage: 1,
pageSize: 10,
total: 0
}
},
methods: {
open(data) {
this.carDetailTransactionCarInfo.ownerId = data.ownerId
this.carDetailTransactionCarInfo.carId = data.carId
this.carDetailTransactionCarInfo.memberId = data.memberId
this._loadCarDetailTransactionCarData(this.currentPage, this.pageSize)
},
switch(data) {
this.carDetailTransactionCarInfo.carId = data.carId
this.carDetailTransactionCarInfo.memberId = data.memberId
this._loadCarDetailTransactionCarData(this.currentPage, this.pageSize)
},
_loadCarDetailTransactionCarData(page, row) {
const params = {
page,
row,
communityId: getCommunityId(),
objId: this.carDetailTransactionCarInfo.memberId,
typeCd: '4455'
}
getMachineTranslates(params).then(response => {
this.carDetailTransactionCarInfo.machineTranslates = response.machineTranslates
this.total = response.total
}).catch(error => {
console.error('请求失败:', error)
})
},
handleCurrentChange(val) {
this.currentPage = val
this._loadCarDetailTransactionCarData(val, this.pageSize)
},
_openEditMachineTranslateModel(machineTranslate) {
this.$refs.editMachineTranslate.open(machineTranslate)
}
}
}
</script>