|
|
|
@ -1,10 +1,123 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="tableData"
|
|
|
|
|
border
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
fixed
|
|
|
|
|
prop="id"
|
|
|
|
|
label="编号"
|
|
|
|
|
width="100">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="leave_time"
|
|
|
|
|
label="出发时间"
|
|
|
|
|
width="200">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="back_time"
|
|
|
|
|
label="返回时间"
|
|
|
|
|
width="200">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="place"
|
|
|
|
|
label="地点"
|
|
|
|
|
width="200">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="reason"
|
|
|
|
|
label="外出原因"
|
|
|
|
|
width="200">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="type"
|
|
|
|
|
label="状态"
|
|
|
|
|
width="120">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
width="200">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button type="success" @click="choose(scope.row.id)">选择</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<el-pagination
|
|
|
|
|
background
|
|
|
|
|
layout="prev, pager, next"
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
:total="total"
|
|
|
|
|
@current-change="page">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
function $_GET(name, urls) {
|
|
|
|
|
let url = urls || window.location.href;
|
|
|
|
|
if (!name == true) {
|
|
|
|
|
let data = url.match(new RegExp("([^?&]*)=([^?&]*)", "ig"));
|
|
|
|
|
return data != null ? data : [];
|
|
|
|
|
} else {
|
|
|
|
|
let test = new RegExp(name + "=", "i").test(url);
|
|
|
|
|
return test ? url.match(new RegExp(name + "=([^?&]*)", "i"))[1] : "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "OuterAppDetail"
|
|
|
|
|
name: "OuterAppDetail",
|
|
|
|
|
methods: {
|
|
|
|
|
page(currentPage) {
|
|
|
|
|
const _this = this
|
|
|
|
|
let id = window.location.pathname.split('/')[3];
|
|
|
|
|
let school_id = $_GET('school_id', window.location.href);
|
|
|
|
|
console.log(school_id);
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findFromSIDTimeLimit/' + school_id + "/" + (currentPage) + '/6').then(function (resp) {
|
|
|
|
|
_this.tableData = resp.data
|
|
|
|
|
_this.pageSize = 6
|
|
|
|
|
_this.total = resp.data.length
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
choose(id) {
|
|
|
|
|
const _this = this
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findByIDAndSaveOD/' + id).then(function (resp) {
|
|
|
|
|
if (resp.data == 'success') {
|
|
|
|
|
_this.$alert('成功', '消息', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
callback: action => {
|
|
|
|
|
_this.$router.push('/user/outer/' + id + '/history')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
_this.$alert('失败', '消息', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
callback: action => {
|
|
|
|
|
_this.$router.push('/user/outer/' + id + '/history')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
pageSize: 6,
|
|
|
|
|
total: 11,
|
|
|
|
|
tableData: [{}]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
const _this = this
|
|
|
|
|
let id = window.location.pathname.split('/')[3];
|
|
|
|
|
let school_id = $_GET('school_id', window.location.href);
|
|
|
|
|
console.log(school_id);
|
|
|
|
|
axios.get('http://localhost:8181/leaveDetail/findFromSIDTimeLimit/' + school_id + '/1/6').then(function (resp) {
|
|
|
|
|
_this.tableData = resp.data
|
|
|
|
|
_this.pageSize = 6
|
|
|
|
|
_this.total = resp.data.length
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|