Commit 892d1d9a authored by 黄奎's avatar 黄奎

新增页面

parent d60f07c2
......@@ -165,12 +165,12 @@ export function deleteAssist(data) {
* @param {AId} data
*/
export function reApplyAssist(data) {
return request({
url: '/user/ReApplyAssist',
method: 'post',
data
})
}
return request({
url: '/user/ReApplyAssist',
method: 'post',
data
})
}
/**
* 获取班级分页列表
......@@ -300,3 +300,48 @@ export function UpdateStudentIsDisable(data) {
data
})
}
/**
* 获取管理者分页列表
*/
export function queryManagerPage(data) {
return request({
url: '/User/GetManagerPageList',
method: 'post',
data
})
}
/**
* 新增修改管理者
*/
export function saveManager() {
return request({
url: '/User/SetManager',
method: 'post',
data
})
}
/**
* 获取管理者信息
*/
export function queryManagerInfo() {
return request({
url: '/User/GetManager',
method: 'post',
data
})
}
/**
* 获取管理者信息
*/
export function deleteManagerInfo() {
return request({
url: '/User/RemoveManager',
method: 'post',
data
})
}
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.StuName" label="学员名称" />
</div>
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.StuTel" label="学员电话" />
</div>
<div class="col-3">
<q-select @input="resetSearch" clearable filled stack-label option-value="SId" option-label="SName"
v-model="schoolTemp" ref="School_Id" :options="schoolList" label="所属校区" :dense="false" />
</div>
<div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" v-model="msg.Status" :options="AuditOpts"
emit-value map-options label="状态" />
</div>
</div>
<div class="page-option">
<q-btn color="accent" class="q-mr-md" icon="add" label="新增学员" @click="EditStudent(null)" />
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-right-column-table sticky-tow-column-table" separator="none" title="学员信息" :data="data"
:columns="columns" row-key="name">
<template v-slot:body-cell-StuIcon="props">
<q-td auto-width :props="props">
<q-avatar size="md" v-if="props.value">
<img :src="props.value" />
</q-avatar>
<q-avatar size="md" color="teal-10" text-color="white" v-if="!props.value">
{{props.row.StuName}}</q-avatar>
</q-td>
</template>
<template v-slot:body-cell-StuName="props">
<q-td :props="props">
<div class="text-blue cursor-pointer">{{props.value}}</div>
</q-td>
</template>
<template v-slot:body-cell-StuSex="props">
<q-td :props="props">
<q-badge :color="props.value==1?'negative':'primary'" :label="props.value==1?'女':'男'" />
</q-td>
</template>
<template v-slot:body-cell-Status="props">
<q-td :props="props">
<q-toggle disable size="md" color="primary" :false-value="1" :true-value="0" v-model="props.row.Status"
title="注意:关闭后,学员将无法正常使用." />
<!--@input="DeleteMenu(props.row)"-->
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<div style="min-width:190px;width:100%">
<q-btn flat size="xs" icon="iconfont icon-ziyuan" color="warning" style="font-weight:400" class="q-mr-xs"
label="重置密码" @click="resetPw(props.row.StuId)" />
<q-btn flat size="xs" icon="iconfont icon-shanchu" color="negative" style="font-weight:400"
class="q-mr-xs" label="删除" @click="deleteUser(props.row.StuId)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditStudent(props.row)" />
</div>
</q-td>
</template>
</q-table>
<student-form v-if="isShowStuForm" :save-obj="stuOption" @close="closeStuForm" @success="refreshPage">
</student-form>
</div>
</div>
</template>
<script>
import {
getStudentPage,
getSchoolDropdown,
deleteStudent
} from '../../api/school/index'
import {
resetPassword
} from '../../api/users/user.js'
import studentForm from '../../components/school/student/student-form'
export default {
meta: {
title: "学员管理"
},
components: {
studentForm,
},
data() {
return {
currentUrl: "",
columns: [{
name: 'StuIcon',
label: '',
field: 'StuIcon',
align: 'left',
},
{
name: 'StuName',
required: true,
label: '学员昵称',
align: 'left',
field: row => row.StuName
},
{
name: 'StuSex',
label: '性别',
field: 'StuSex',
align: 'left'
},
{
name: 'StuBirthStr',
label: '出生日期',
field: 'StuBirthStr',
align: 'left'
},
{
name: 'StuTel',
label: '手机号码',
field: 'StuTel',
align: 'left'
},
{
name: 'SName',
label: '所属校区',
field: 'SName',
align: 'left',
},
{
name: 'AreaName',
label: '区域',
field: 'AreaName',
align: 'left',
},
{
name: 'Status',
label: '状态',
field: 'Status',
align: 'left',
},
{
name: 'CreateByName',
label: '创建人',
align: 'left',
field: 'CreateByName'
},
{
name: 'CreateTimeStr',
label: '入学时间',
align: 'left',
field: 'CreateTimeStr'
},
{
name: 'optioned',
label: '操作',
field: 'StuId'
}
],
data: [],
loading: true,
AuditOpts: [{
label: '全部',
value: '-1'
},
{
label: '正常',
value: '0'
},
{
label: '禁用',
value: '1'
},
],
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
StuName: "",
StuTel: "",
Status: "-1",
School_Id: 0
},
schoolTemp: "",
pageCount: 0,
stuOption: null,
schoolList: [],
isShowStuForm: false,
resetLoading: false
}
},
mounted() {
this.currentUrl = this.$route.path
this.getSchool()
this.getStudent()
},
methods: {
resetSearch() {
this.msg.pageIndex = 1;
if (this.schoolTemp) {
this.msg.School_Id = this.schoolTemp.SId
} else {
this.msg.School_Id = 0
}
this.getStudent()
},
resetPw(id) {
let that = this
this.$q.dialog({
title: "重置密码",
message: "你正在进行重置密码行为,是否确认执行",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认重置",
flat: true,
focus: true
}
}).onOk(() => {
that.resetLoading = true
resetPassword({
AccountType: 4,
AccountId: id
}).then(res => {
that.resetLoading = false
that.$q.dialog({
title: "密码重置成功",
message: res.Message,
persistent: true,
ok: {
label: "确认",
flat: true,
focus: true
}
})
}).catch(() => {
that.resetLoading = false
});
});
},
deleteUser(id) {
let that = this
this.$q.dialog({
title: "删除学员",
message: "你正在进行删除学员行为,一旦执行无法找回,是否确认执行?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
that.resetLoading = true
deleteStudent({
StuId: id
}).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据删除成功!',
position: 'top'
})
this.getStudent()
})
});
},
changePage(val) {
this.msg.pageIndex = val;
this.getStudent();
},
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
})
},
getStudent() {
this.loading = true;
getStudentPage(this.msg).then(res => {
this.loading = false;
this.data = res.Data.PageData
this.pageCount = res.Data.PageCount
}).catch(() => {
this.loading = false
})
},
refreshPage() {
if (!this.stuOption) {
this.msg.pageIndex = 1;
this.msg.StuName = "";
this.msg.StuTel = "";
this.msg.Status = "-1";
this.msg.School_Id = 0;
}
this.getStudent()
},
EditStudent(obj) {
if (obj) {
this.stuOption = obj;
} else {
this.stuOption = null;
}
this.isShowStuForm = true;
},
closeStuForm() {
this.isShowStuForm = false;
}
},
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass');
</style>
......@@ -42,6 +42,11 @@ const routes = [{
component: () =>
import("pages/school/student.vue")
},
{
path: "/school/sysuser", //后台用户管理
component: () =>
import("pages/school/sysuser.vue")
},
{
path: "/system/menu", //菜单管理
component: () =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment