14 注册用户批准

master
markma 3 years ago
parent 98bd86ca71
commit b8434958cd

@ -17,6 +17,7 @@ import SetComment from "../views/SetComment"
import GetComment from "../views/GetComment"
import DataAnalysis from "../views/DataAnalysis";
import StudentAnalysis from "../views/StudentAnalysis";
import RegisterApplication from "../views/RegisterApplication";
Vue.use(VueRouter)
@ -57,7 +58,8 @@ const routes = [
path: "/user/student/:id/studentAnalysis",
name: "学生请假数据分析",
component: StudentAnalysis
}
},
]
},
{
@ -113,6 +115,11 @@ const routes = [
path: "/user/outer/:id/dataAnalysis/",
name: "请假数据分析",
component: DataAnalysis
},
{
path: "/user/outer/:id/registerApplication",
name: "注册申请审批",
component: RegisterApplication
}
]
},

@ -29,6 +29,7 @@
<el-menu-item index="appForm">处理外出申请</el-menu-item>
<el-menu-item index="getComment">查看评论</el-menu-item>
<el-menu-item index="dataAnalysis">请假数据分析</el-menu-item>
<el-menu-item index="registerApplication">注册申请审批</el-menu-item>
</el-menu>
</el-aside>

@ -0,0 +1,191 @@
<template>
<div>
<el-table
ref="multipleTable"
:data="tableData"
:default-sort="{prop: 'date', order: 'descending'}"
border
stripe
style="width: 90%">
<el-table-column
type="selection">
</el-table-column>
<el-table-column
fixed
label="用户编号"
prop="id"
sortable
width="100">
</el-table-column>
<el-table-column
label="用户名"
prop="username"
sortable
width="200">
</el-table-column>
<el-table-column
label="密码"
prop="password"
sortable
width="200">
</el-table-column>
<el-table-column
label="学号"
prop="school_id"
sortable
width="200">
</el-table-column>
<el-table-column
label="姓名"
prop="name"
sortable
width="100">
</el-table-column>
<el-table-column
label="类型"
prop="type"
sortable
width="100">
</el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button size="small" type="success" @click="agree(scope.row.id)"></el-button>
<el-button size="small" type="danger" @click="disagree(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 20px">
<el-button type="success" @click="allAgree()"></el-button>
<el-button type="danger" @click="allDisagree()"></el-button>
<el-button @click="toggleSelection()"></el-button>
</div>
<el-pagination
:page-size="pageSize"
:total="total"
background
layout="prev, pager, next"
@current-change="page">
</el-pagination>
</div>
</template>
<script>
export default {
name: "RegisterApplication",
methods: {
page(currentPage) {
const _this = this
let id = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/userDetail/findAllUADPaged' + (currentPage) + '/20').then(function (resp) {
console.log(resp)
_this.tableData = resp.data
_this.pageSize = 20
})
axios.get('http://localhost:8181/userDetail/findAllUADPaged').then(function (resp) {
_this.total = resp.data
})
},
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
agree(id) {
const _this = this
let userid = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/userDetail/agreeUpdate/' + id)
this.$message({
message: '已批准',
type: 'success'
});
window.location.href = "/user/outer/" + userid + "/history";
},
disagree(row) {
const _this = this
let userid = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/userDetail/disagreeUpdate/' + id)
window.location.href = "/user/outer/" + userid + "/history";
this.$message({
message: '已拒绝',
type: 'success'
});
},
allAgree() {
let arrLength = this.$refs.multipleTable.selection.length;
let userid = window.location.pathname.split('/')[3];
for (let i = 0; i < arrLength; i++) {
axios.get('http://localhost:8181/userDetail/agreeUpdate/' + this.$refs.multipleTable.selection[i].id)
}
this.$message({
message: '已批量同意',
type: 'success'
});
window.location.href = "/user/outer/" + userid + "/history";
},
allDisagree() {
let arrLength = this.$refs.multipleTable.selection.length;
let userid = window.location.pathname.split('/')[3];
for (let i = 0; i < arrLength; i++) {
axios.get('http://localhost:8181/userDetail/disagreeUpdate/' + this.$refs.multipleTable.selection[i].id)
}
this.$message({
message: '已批量拒绝',
type: 'success'
});
window.location.href = "/user/outer/" + userid + "/history";
},
//this.$refs.multipleTable.selection
},
data() {
return {
pageSize: 20,
total: 11,
tableData: [{
id: 1,
username: 'markma',
password: '123',
school_id: '123456',
name: '马铁诚',
type: '管理员'
}],
multipleSelection: [],
}
},
created() {
const _this = this
let id = window.location.pathname.split('/')[3];
let type = window.location.pathname.split('/')[2];
axios.get('http://localhost:8181/user/checkUseridAndType/' + id + '/' + type).then(function (resp) {
if (resp.data != 'success') {
_this.$router.push("/NoAuthority")
} else {
let login_id = _this.$cookieStore.getCookie("login_id")
console.log(login_id)
if (login_id != id) {
_this.$router.push("/NoAuthority")
}
}
})
axios.get('http://localhost:8181/userDetail/findAllUADPaged/1/20').then(function (resp) {
_this.tableData = resp.data
_this.pageSize = 20
})
axios.get('http://localhost:8181/userDetail/findAllUADPagedNum').then(function (resp) {
_this.total = resp.data
})
}
}
</script>
<style scoped>
</style>

@ -101,6 +101,10 @@ export default {
const _this = this
let userid = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/agreeUpdate/' + id).then(function (resp) {
this.$message({
message: '已同意',
type: 'success'
});
window.location.href = "/user/teacher/" + userid + "/history";
})
},
@ -108,6 +112,10 @@ export default {
const _this = this
let userid = window.location.pathname.split('/')[3];
axios.get('http://localhost:8181/leaveDetail/disagreeUpdate/' + id).then(function (resp) {
this.$message({
message: '已拒绝',
type: 'success'
});
window.location.href = "/user/teacher/" + userid + "/history";
})
},
@ -117,6 +125,10 @@ export default {
for (let i = 0; i < arrLength; i++) {
axios.get('http://localhost:8181/leaveDetail/agreeUpdate/' + this.$refs.multipleTable.selection[i].id)
}
this.$message({
message: '已批量同意',
type: 'success'
});
window.location.href = "/user/teacher/" + userid + "/history";
},
allDisagree() {
@ -125,6 +137,10 @@ export default {
for (let i = 0; i < arrLength; i++) {
axios.get('http://localhost:8181/leaveDetail/disagreeUpdate/' + this.$refs.multipleTable.selection[i].id)
}
this.$message({
message: '已批量拒绝',
type: 'success'
});
window.location.href = "/user/teacher/" + userid + "/history";
},
//this.$refs.multipleTable.selection

Loading…
Cancel
Save