lion 1 year ago
parent 27a5321a48
commit 8f4785b8c2

@ -33,3 +33,21 @@ export function getAuthMenu(token) {
isLoading: false isLoading: false
}) })
} }
export function getMsg(param) {
return request({
url: '/api/admin/auth/send-sms',
method: 'get',
params:param,
isLoading: false
})
}
export function loginMsg(param) {
return request({
url: '/api/admin/auth/sms-login',
method: 'get',
params:param,
isLoading: false
})
}

@ -122,7 +122,7 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
getAllPara(){ getAllPara(){
let number = ['company_type','company_area','company_industry','type','education'] let number = ['company_position','company_type','company_area','company_industry','type','education']
getparameter({ getparameter({
number:number number:number
}).then(res=>{ }).then(res=>{

@ -14,6 +14,9 @@ let base = {
isUrl (url) { isUrl (url) {
return this.checkUrl(url) return this.checkUrl(url)
}, },
isNull(val){
return p == '' || p == undefined || p == null || p == 'undefined' || p == 'null';
},
checkUrl (url) { checkUrl (url) {
// url= 协议://(ftp的登录信息)[IP|域名](:端口号)(/或?请求参数) // url= 协议://(ftp的登录信息)[IP|域名](:端口号)(/或?请求参数)
var strRegex = var strRegex =

@ -85,7 +85,7 @@
}, },
list: [], list: [],
table_item: [{ table_item: [{
prop: 'name', prop: 'user.name',
label: '学员姓名', label: '学员姓名',
align: 'center' align: 'center'
}, { }, {

@ -136,7 +136,7 @@
getDetail() { getDetail() {
show({ show({
id: this.id, id: this.id,
show_relation: ['typeDetail', 'image'] show_relation: ['type_detail', 'image']
}).then(res => { }).then(res => {
this.showform = res this.showform = res
}) })

@ -39,11 +39,11 @@
</div> </div>
</div> </div>
<div> <div>
<div class="txl"> <div class="txl">
<div>课程名称{{subjectObj.title}}</div> <div>课程名称{{subjectObj.title}}</div>
<div>开课日期{{subjectObj.date}}</div> <div>开课日期{{subjectObj.date}}</div>
<div>类别{{subjectObj.leibie}}</div> <div>类别{{subjectObj.leibie}}</div>
</div> </div>
<xy-table :list="list" :total="total" :showIndex="url_type==='pay'?false:true" <xy-table :list="list" :total="total" :showIndex="url_type==='pay'?false:true"
:showIndexFixed="url_type==='pay'?null:'left'" @pageIndexChange="pageIndexChange" :showIndexFixed="url_type==='pay'?null:'left'" @pageIndexChange="pageIndexChange"
@ -206,7 +206,8 @@
this.subjectObj = this.$route.query this.subjectObj = this.$route.query
this.select.course_id = this.subjectObj.id this.select.course_id = this.subjectObj.id
if (this.url_type == 'pay') { if (this.url_type == 'pay') {
this.table_item.unshift({ this.table_item.unshift({
prop:'selection',
type: 'selection', type: 'selection',
width: 50, width: 50,
fixed: 'left' fixed: 'left'
@ -279,21 +280,28 @@
if (this.selectids.length < 1) { if (this.selectids.length < 1) {
this.$message.warning("请先选择要提醒缴费的学员") this.$message.warning("请先选择要提醒缴费的学员")
return return
} }
this.$refs.sendMessage.course_id = this.select.course_id this.$refs.sendMessage.course_id = this.select.course_id
this.$refs.sendMessage.selectids = this.selectids this.$refs.sendMessage.selectids = this.selectids
this.$refs.sendMessage.isShow = true this.$refs.sendMessage.isShow = true
}, },
exportExcel() { exportExcel() {
let _export = {} let _export = {}
this.table_item.map(item => { this.table_item.map(item => {
if (item.prop === 'status') { console.log("item.prop",item.prop)
if (item.prop === 'status') {
_export['status_text'] = item.label _export['status_text'] = item.label
} else { } else if (item.prop === 'fee_status') {
_export['fee_status_text'] = item.label
}else if (item.prop === 'img' || item.prop === 'selection') {
}else {
_export[item.prop] = item.label _export[item.prop] = item.label
} }
}) })
console.log("_export",_export)
download( download(
'/api/admin/course-signs/index', '/api/admin/course-signs/index',
'get', { 'get', {

@ -5,21 +5,62 @@
<div ref="lxHeader"> <div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px"> <lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content" style="padding-left:0"> <div slot="content" style="padding-left:0">
<div class="searchwrap" style="display: flex;align-items: center;">
<div class="searchwrap" style="display: flex;align-items: center;"> <div>
<div> <div>
<el-input v-model="select.name" placeholder="请输入姓名"></el-input> <el-input v-model="select.name" placeholder="请输入姓名"></el-input>
</div> </div>
<div> <div>
<el-select v-model="select.status" placeholder="请选择状态" clearable> <el-input v-model="select.company_name" placeholder="请输入公司名称"></el-input>
<el-option v-for="item in apply_status_list" :key="item.id" :label="item.value" :value="item.id"> </div>
</el-option> <div>
</el-select> <el-select v-model="select.company_position" placeholder="请选择职务" clearable>
</div> <el-option v-for="item in formSelect.company_position" :key="item.id" :label="item.value"
<div> :value="item.value">
<el-button type="primary" size="small" @click="getList"></el-button> </el-option>
<el-button type="primary" size="small" @click="exportExcel"></el-button> </el-select>
</div> </div>
<div>
<el-select v-model="select.company_area" placeholder="请选择所属区域" clearable>
<el-option v-for="item in formSelect.company_area" :key="item.id" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
<div>
<el-select v-model="select.company_type" placeholder="请选择企业性质" clearable>
<el-option v-for="item in formSelect.company_type" :key="item.id" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
<div>
<el-select v-model="select.company_industry" placeholder="请选择所属行业" clearable>
<el-option v-for="item in formSelect.company_industry" :key="item.id" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
<div>
<el-select v-model="select.type" placeholder="请选择人才类型" clearable>
<el-option v-for="item in formSelect.type" :key="item.id" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
<div>
<el-select v-model="select.education" placeholder="请选择学历" clearable>
<el-option v-for="item in formSelect.education" :key="item.id" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
<div>
<el-button type="primary" size="small" @click="getList"></el-button>
<el-button type="primary" size="small" @click="exportExcel"></el-button>
</div>
</div>
</div> </div>
</div> </div>
@ -64,7 +105,8 @@
<script> <script>
import studentDetail from '@/views/student/components/detail.vue'; import studentDetail from '@/views/student/components/detail.vue';
import myMixins from "@/mixin/selectMixin.js"; import myMixins from "@/mixin/selectMixin.js";
import formMixin from "@/mixin/formMixin.js";
import { import {
index index
} from '@/api/apply/index.js' } from '@/api/apply/index.js'
@ -72,7 +114,7 @@
download download
} from "@/utils/downloadRequest"; } from "@/utils/downloadRequest";
export default { export default {
mixins: [myMixins], mixins: [myMixins,formMixin],
components: { components: {
studentDetail studentDetail
}, },
@ -81,7 +123,12 @@
subjectObj: {}, subjectObj: {},
select: { select: {
name: '', name: '',
course_id: '', course_id: '',
company_name: '',
company_position: '',
company_area: '',
company_type: '',
company_industry: '',
status: '', status: '',
page: 1, page: 1,
page_size: 10 page_size: 10
@ -167,7 +214,12 @@
const res = await index({ const res = await index({
page: this.select.page, page: this.select.page,
page_size: this.select.page_size, page_size: this.select.page_size,
name: this.select.name, name: this.select.name,
company_name: this.select.company_name,
company_position: this.select.company_position,
company_area: this.select.company_area,
company_type: this.select.company_type,
company_industry: this.select.company_industry,
filter: [{ filter: [{
key: 'course_id', key: 'course_id',
op: 'eq', op: 'eq',
@ -236,18 +288,26 @@
} }
} }
.searchwrap { .searchwrap {
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap;
&>div {
display: flex; &>div {
align-items: center; display: flex;
margin-right: 10px; align-items: center;
// margin-bottom: 10px;
span { flex-wrap: wrap;
min-width: 70px;
} &>div {
} margin-right: 10px;
margin-bottom: 10px;
width: 150px;
&:last-child {
width:auto
}
}
}
} }
</style> </style>

@ -13,14 +13,14 @@
<div class="title-container"> <div class="title-container">
<h3 class="title">欢迎登录</h3> <h3 class="title">欢迎登录</h3>
<div class="title-change"> <div class="title-change">
<span @click="changeLogin=false" :class="{color:!changeLogin}">账号登录</span> <span @click="changeLoginType" :class="{color:!changeLogin}">账号登录</span>
<span @click="changeLogin=true" :class="{color:changeLogin}">短信登录</span> <span @click="changeLoginType" :class="{color:changeLogin}">短信登录</span>
</div> </div>
</div> </div>
<template v-if="!changeLogin"> <template v-if="!changeLogin">
<el-form-item prop="username"> <el-form-item prop="username">
<el-input ref="username" v-model="loginForm.username" placeholder="手机号/邮箱" name="username" type="text" <el-input ref="username" v-model="loginForm.username" placeholder="用户名" name="username" type="text"
tabindex="1" auto-complete="on" /> tabindex="1" auto-complete="on" />
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
@ -32,22 +32,26 @@
</el-form-item> </el-form-item>
</template> </template>
<template v-else> <template v-else>
<el-form-item prop="username"> <el-form-item prop="mobile">
<el-input ref="username" v-model="loginForm.username" placeholder="手机号" name="username" type="text" <el-input ref="mobile" v-model="loginForm.mobile" placeholder="手机号" name="mobile" type="text" tabindex="1"
tabindex="1" auto-complete="on" /> auto-complete="on" />
</el-form-item> </el-form-item>
<el-form-item prop="code" class="send_item"> <el-form-item prop="code" class="send_item">
<el-input ref="code" v-model="loginForm.code" placeholder="验证码" name="code" type="text" tabindex="1" <el-input ref="code" v-model="loginForm.code" placeholder="验证码" name="code" type="text" tabindex="1"
auto-complete="on"> auto-complete="on">
</el-input> </el-input>
<span class="senndCode">发送验证码</span> <span :class="hasSend?'hasCode':'senndCode'" @click="sendMsg">{{hasSend?'':''}}
<span v-if="hasSend">({{count}}s)</span>
</span>
</el-form-item> </el-form-item>
</template> </template>
<el-button :loading="loading" type="primary" class="loginBtn" <el-button v-if="!changeLogin" :loading="loading" type="primary" class="loginBtn"
@click.native.prevent="handleLogin">登录</el-button> @click.native.prevent="handleLogin">登录</el-button>
<el-button v-else :loading="loading" type="primary" class="loginBtn"
@click.native.prevent="handleMsgLogin">登录</el-button>
</el-form> </el-form>
</div> </div>
</div> </div>
@ -60,7 +64,13 @@
import { import {
validUsername validUsername
} from '@/utils/validate' } from '@/utils/validate'
import {
getMsg,
loginMsg
} from "@/api/user.js"
import {
setToken
} from '@/utils/auth'
const defaultSettings = require('../../../src/settings.js') const defaultSettings = require('../../../src/settings.js')
export default { export default {
name: 'Login', name: 'Login',
@ -82,6 +92,9 @@
return { return {
title: "", title: "",
changeLogin: false, changeLogin: false,
hasSend: false,
count: 60,
sendTimer: null,
loginForm: { loginForm: {
username: '', username: '',
password: '' password: ''
@ -105,12 +118,12 @@
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler: function(route) {
if(route.query && route.query.redirect==='/'){ if (route.query && route.query.redirect === '/') {
this.redirect = '/dashboard' this.redirect = '/dashboard'
}else{ } else {
this.redirect = route.query && route.query.redirect this.redirect = route.query && route.query.redirect
} }
}, },
immediate: true immediate: true
@ -132,8 +145,66 @@
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.password.focus() this.$refs.password.focus()
}) })
},
changeLoginType(){
this.changeLogin = !this.changeLogin
},
//
sendMsg() {
if(this.hasSend){
return
}
if (this.base.isNull(this.loginForm.mobile)) {
this.$Message.warning('请输入手机号')
return
}
if (!this.base.isPhone(this.loginForm.mobile)) {
this.$Message.warning('请输入正确的手机号')
return
}
getMsg({
mobile: this.loginForm.mobile
}).then(res => {
this.$Message.success('发送成功')
// 60s
this.hasSend = true
this.sendTimer = setInterval(() => {
if (this.count > 1) {
this.count--;
} else {
clearInterval(this.sendTimer);
this.hasSend = false;
}
}, 1000);
})
},
//
handleMsgLogin(){
if (this.base.isNull(this.loginForm.mobile)) {
this.$Message.warning('请输入手机号')
return
}
if (this.base.isNull(this.loginForm.code)) {
this.$Message.warning('请输入验证码')
return
}
this.loading = true
loginMsg({
mobile:this.loginForm.mobile,
code:this.loginForm.code
}).then(res=>{
setToken(res.access_token)
this.$router.push({
path: this.redirect || '/dashboard'
})
this.loading = false
}).catch(res=>{
this.loading = false
})
}, },
//
//
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
@ -152,7 +223,8 @@
return false return false
} }
}) })
} },
//
} }
} }
</script> </script>
@ -222,17 +294,19 @@
background: url("../../assets/login_bg.png") no-repeat; background: url("../../assets/login_bg.png") no-repeat;
overflow: hidden; overflow: hidden;
background-size: 100% 100%; background-size: 100% 100%;
position: relative; position: relative;
.login-footer{
text-align: center; .login-footer {
position: absolute; text-align: center;
bottom:20px; position: absolute;
left:0; bottom: 20px;
width:100%; left: 0;
color:#274999; width: 100%;
color: #274999;
} }
.login-logo { .login-logo {
// width: 20vw; // width: 20vw;
width: 383px; width: 383px;
@ -316,6 +390,18 @@
height: 47px; height: 47px;
line-height: 47px; line-height: 47px;
border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0;
cursor: pointer;
}
.hasCode{
background-color: #ddd;
display: inline-block;
width: 30%;
text-align: center;
color: #000;
height: 47px;
line-height: 47px;
border-radius: 0 5px 5px 0;
cursor: pointer;
} }
} }
@ -354,12 +440,13 @@
user-select: none; user-select: none;
} }
} }
@media (max-width:492px) { @media (max-width:492px) {
.login-container { .login-container {
.login-logo{ .login-logo {
width:100%; width: 100%;
} }
.login-wrap { .login-wrap {
margin-left: 0px; margin-left: 0px;
margin-right: 0px; margin-right: 0px;
@ -374,7 +461,7 @@
} }
} }
} }
} }
@media (min-width:493px) { @media (min-width:493px) {
.login-container { .login-container {

@ -61,6 +61,10 @@
<el-form-item label="密码" prop="password"> <el-form-item label="密码" prop="password">
<el-input v-model="form.password" type="password" autocomplete="off"></el-input> <el-input v-model="form.password" type="password" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form.mobile" autocomplete="off">
</el-input>
</el-form-item>
<el-form-item label="部门" prop="department_id"> <el-form-item label="部门" prop="department_id">
<el-select v-model="form.department_id"> <el-select v-model="form.department_id">
<el-option v-for="item in departmentList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in departmentList" :key="item.id" :label="item.name" :value="item.id"></el-option>
@ -115,6 +119,7 @@
name: "", name: "",
username: "", username: "",
password: "", password: "",
mobile:'',
department_id: "", department_id: "",
}, },
rules: { rules: {

Loading…
Cancel
Save