|
|
|
@ -1,11 +1,15 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<el-table
|
|
|
|
|
ref="multipleTable"
|
|
|
|
|
:data="tableData"
|
|
|
|
|
border
|
|
|
|
|
:default-sort="{prop: 'date', order: 'descending'}"
|
|
|
|
|
stripe
|
|
|
|
|
style="width: 90%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
type="selection">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
fixed
|
|
|
|
|
prop="id"
|
|
|
|
@ -35,15 +39,23 @@
|
|
|
|
|
prop="reason"
|
|
|
|
|
label="外出原因"
|
|
|
|
|
sortable
|
|
|
|
|
width="300">
|
|
|
|
|
width="150">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="type"
|
|
|
|
|
label="状态"
|
|
|
|
|
sortable>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button size="small" type="danger" @click="deleteLD(scope.row.id)">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<div style="margin-top: 20px">
|
|
|
|
|
<el-button type="danger" @click="allDeleteLD()">批量删除</el-button>
|
|
|
|
|
<el-button @click="toggleSelection()">取消选择</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-pagination
|
|
|
|
|
background
|
|
|
|
|
layout="prev, pager, next"
|
|
|
|
@ -61,23 +73,48 @@ export default {
|
|
|
|
|
page(currentPage){
|
|
|
|
|
const _this = this
|
|
|
|
|
let id = window.location.pathname.split('/')[3];
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByType/已过期/' + id + '/' + (currentPage) + '/6').then(function (resp) {
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByType/已过期/' + id + '/' + (currentPage) + '/20').then(function (resp) {
|
|
|
|
|
console.log(resp)
|
|
|
|
|
_this.tableData = resp.data
|
|
|
|
|
_this.pageSize = 6
|
|
|
|
|
_this.pageSize = 20
|
|
|
|
|
})
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByTypeNum/已过期/' + id + '/' + (currentPage) + '/6').then(function (resp) {
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByTypeNum/已过期/' + id + '/' + (currentPage) + '/20').then(function (resp) {
|
|
|
|
|
_this.total = resp.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
deleteLD(id) {
|
|
|
|
|
const _this = this
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/delete/' + id).then(function (resp) {
|
|
|
|
|
location.reload();
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
allDeleteLD() {
|
|
|
|
|
let arrLength = this.$refs.multipleTable.selection.length;
|
|
|
|
|
for (let i = 0; i < arrLength; i++) {
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/delete/' + this.$refs.multipleTable.selection[i].id)
|
|
|
|
|
}
|
|
|
|
|
location.reload();
|
|
|
|
|
},
|
|
|
|
|
toggleSelection(rows) {
|
|
|
|
|
if (rows) {
|
|
|
|
|
rows.forEach(row => {
|
|
|
|
|
this.$refs.multipleTable.toggleRowSelection(row);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$refs.multipleTable.clearSelection();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.multipleSelection = val;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
pageSize: 6,
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
total: 11,
|
|
|
|
|
tableData: [{
|
|
|
|
|
id: 1,
|
|
|
|
|
leave_time: '2021-12-20 16:59:15',
|
|
|
|
|
leave_time: '2021-12-20 15:59:15',
|
|
|
|
|
back_time: '2222-12-21 17:28:59',
|
|
|
|
|
place: '万家丽',
|
|
|
|
|
reason: '见导师',
|
|
|
|
@ -88,12 +125,12 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
const _this = this
|
|
|
|
|
let id = window.location.pathname.split('/')[3];
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByType/已过期/' + id + '/1/6').then(function (resp) {
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByType/已过期/' + id + '/1/20').then(function (resp) {
|
|
|
|
|
console.log(resp.data)
|
|
|
|
|
_this.tableData = resp.data
|
|
|
|
|
_this.pageSize = 6
|
|
|
|
|
_this.pageSize = 20
|
|
|
|
|
})
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByTypeNum/已过期/' + id + '/1/6').then(function (resp) {
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByTypeNum/已过期/' + id + '/1/20').then(function (resp) {
|
|
|
|
|
_this.total = resp.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|