conveyance.vue
5.6 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
<template>
<el-row>
<el-card style="background-color: #F5F7FA">
<!-- 搜索区域-->
<el-row class="toolbar">
<el-form :model="queryInfo">
<el-col :span="6">
<el-form-item label="" prop="lisenceNo">
<el-input v-model="queryInfo.lisenceNo" size="small" style="width: 170px"
placeholder="车牌号" clearable required>
<template slot="prepend">车牌号</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="2">
<el-button type="primary" icon="el-icon-search" size="small" @click="getList()">
查询
</el-button>
<!-- <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>-->
</el-col>
</el-form>
</el-row>
<!-- 列表区域-->
<el-row>
<el-table
:data="tableData"
border
:cell-style="{textAlign:'center'}"
style="border-radius: 10px 10px 0px 0px;line-height: 25px"
:header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
>
<el-table-column
fixed
prop="lisenceNo"
label="车牌号"
width="120">
</el-table-column>
<el-table-column
prop="username"
label="用户名"
width="120">
</el-table-column>
<el-table-column
prop="starttime"
label="开始时间">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="120">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="applyEnd(scope.row)">结束出勤</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row style="margin-top: 10px" class="toolbar">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageSize"
:page-size="queryInfo.pageNum"
:page-sizes="[10, 50, 100, 500]"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</el-row>
</el-card>
</el-row>
</template>
<script>
import {selectList,DoneTask} from '../../api/consigner/vehicle';
export default {
data() {
return {
queryInfo: {
lisenceNo:'',
// 当前页数
pageNum: 1,
// 每页几条数据
pageSize: 10,
},
total: 0,
tableData:[],
}
},
methods: {
handleSizeChange(val) {
this.queryInfo.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.queryInfo.pageNum = val
this.getList()
},
getList() {
const _this = this
selectList(this.queryInfo).then((response) => {
const res = response.data
console.log(response.data)
if (res.code !== '200') {
return _this.$message.error('获取消息收发记录,失败!')
}
// 获取列表数据
_this.tableData = res.data.list;
// 获取列表的总记录数
_this.total = res.data.total
_this.$message.success('获取消息收发记录,成功!')
}).catch(error => {
// 关闭加载
_this.$message.error(error.toString())
})
},
// 结束出勤
applyEnd(row) {
// 弹框询问是否结束?
this.$confirm('是否继续?', '警告', {
confirmButtonText: '确定结束',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
DoneTask(row).then((response) => {
const res = response.data
this.$message.success(res.msg)
this.getList()
}).catch(error => {
this.$message.error(error)
})
}).catch(() => {
})
},
},
mounted() {
this.getList();
}
}
</script>