master
markma 4 years ago
parent 72199ff419
commit 4814b80c01

@ -74,17 +74,17 @@ const routes = [
component: OuterHistory component: OuterHistory
}, },
{ {
path: "/user/outer/:id/application", path: "/user/outer/:id/appForm",
name: "处理外出申请", name: "处理外出申请",
component: OuterAppForm component: OuterAppForm
}, },
{ {
path: "/user/outer/:id/appDetail", path: "/user/outer/:id/appDetail/",
name: "申请详情", name: "外出申请详情",
component: OuterAppDetail component: OuterAppDetail
} }
] ]
}, }
] ]
const router = new VueRouter({ const router = new VueRouter({

@ -1,10 +1,123 @@
<template> <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> </template>
<script> <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 { 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> </script>

@ -1,12 +1,13 @@
<template> <template>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="学生id" prop="place"> <el-form-item label="学生id" prop="school_id">
<el-input v-model="ruleForm.place"></el-input> <el-input v-model="ruleForm.school_id"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm('ruleForm')"></el-button> <el-button type="primary" @click="submitOutForm('ruleForm')"></el-button>
<el-button type="primary" @click="submitInForm('ruleForm')"></el-button>
<el-button @click="resetForm('ruleForm')"></el-button> <el-button @click="resetForm('ruleForm')"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -14,7 +15,7 @@
<script> <script>
export default { export default {
name: "StudentAppForm", name: "OuterAppForm",
data() { data() {
return { return {
ruleForm: { ruleForm: {
@ -28,10 +29,37 @@ export default {
}; };
}, },
methods: { methods: {
submitForm(formName) { submitOutForm(formName) {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
let school_id = this.ruleForm.school_id;
console.log(school_id);
window.location.href = "/user/outer/" + id + "/appDetail?school_id=" + school_id;
},
submitInForm(formName) {
const _this = this
let id = window.location.pathname.split('/')[3];
let school_id = this.ruleForm.school_id;
console.log(school_id);
axios.get('http://localhost:8181/outDetail/findBySIDAndSetReturnTime/' + school_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')
}
})
}
});
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();

@ -8,7 +8,7 @@
<el-aside width="200px" style="background-color: rgb(238, 241, 246)"> <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
<el-menu router> <el-menu router>
<el-menu-item index="history">外出批准历史</el-menu-item> <el-menu-item index="history">外出批准历史</el-menu-item>
<el-menu-item index="application">处理外出申请</el-menu-item> <el-menu-item index="appForm">处理外出申请</el-menu-item>
</el-menu> </el-menu>
</el-aside> </el-aside>

@ -136,15 +136,6 @@ export default {
const _this = this const _this = this
let id = window.location.pathname.split('/')[3]; let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/findByTypeNoID/审核中/1/6').then(function (resp) { axios.get('http://localhost:8181/leaveDetail/findByTypeNoID/审核中/1/6').then(function (resp) {
/*
_this.id = resp.data.id
_this.leave_time = resp.data.leave_time
_this.back_time = resp.data.back_time
_this.place = resp.data.place
_this.reason = resp.data.reason
_this.type = resp.data.type
console.log(resp)
*/
_this.tableData = resp.data _this.tableData = resp.data
_this.pageSize = 6 _this.pageSize = 6
_this.total = resp.data.length _this.total = resp.data.length

Loading…
Cancel
Save