lion 1 year ago
parent 27a5321a48
commit 8f4785b8c2

@ -33,3 +33,21 @@ export function getAuthMenu(token) {
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() {},
methods: {
getAllPara(){
let number = ['company_type','company_area','company_industry','type','education']
let number = ['company_position','company_type','company_area','company_industry','type','education']
getparameter({
number:number
}).then(res=>{

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

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

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

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

@ -5,21 +5,62 @@
<div ref="lxHeader">
<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 class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-input v-model="select.name" placeholder="请输入姓名"></el-input>
</div>
<div>
<el-select v-model="select.status" placeholder="请选择状态" clearable>
<el-option v-for="item in apply_status_list" :key="item.id" :label="item.value" :value="item.id">
</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 class="searchwrap" style="display: flex;align-items: center;">
<div>
<div>
<el-input v-model="select.name" placeholder="请输入姓名"></el-input>
</div>
<div>
<el-input v-model="select.company_name" placeholder="请输入公司名称"></el-input>
</div>
<div>
<el-select v-model="select.company_position" placeholder="请选择职务" clearable>
<el-option v-for="item in formSelect.company_position" :key="item.id" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</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>
@ -64,7 +105,8 @@
<script>
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 {
index
} from '@/api/apply/index.js'
@ -72,7 +114,7 @@
download
} from "@/utils/downloadRequest";
export default {
mixins: [myMixins],
mixins: [myMixins,formMixin],
components: {
studentDetail
},
@ -81,7 +123,12 @@
subjectObj: {},
select: {
name: '',
course_id: '',
course_id: '',
company_name: '',
company_position: '',
company_area: '',
company_type: '',
company_industry: '',
status: '',
page: 1,
page_size: 10
@ -167,7 +214,12 @@
const res = await index({
page: this.select.page,
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: [{
key: 'course_id',
op: 'eq',
@ -236,18 +288,26 @@
}
}
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
.searchwrap {
display: flex;
align-items: center;
flex-wrap: wrap;
&>div {
display: flex;
align-items: center;
// margin-bottom: 10px;
flex-wrap: wrap;
&>div {
margin-right: 10px;
margin-bottom: 10px;
width: 150px;
&:last-child {
width:auto
}
}
}
}
</style>

@ -13,14 +13,14 @@
<div class="title-container">
<h3 class="title">欢迎登录</h3>
<div class="title-change">
<span @click="changeLogin=false" :class="{color:!changeLogin}">账号登录</span>
<span @click="changeLogin=true" :class="{color:changeLogin}">短信登录</span>
<span @click="changeLoginType" :class="{color:!changeLogin}">账号登录</span>
<span @click="changeLoginType" :class="{color:changeLogin}">短信登录</span>
</div>
</div>
<template v-if="!changeLogin">
<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" />
</el-form-item>
<el-form-item prop="password">
@ -32,22 +32,26 @@
</el-form-item>
</template>
<template v-else>
<el-form-item prop="username">
<el-input ref="username" v-model="loginForm.username" placeholder="手机号" name="username" type="text"
tabindex="1" auto-complete="on" />
<el-form-item prop="mobile">
<el-input ref="mobile" v-model="loginForm.mobile" placeholder="手机号" name="mobile" type="text" tabindex="1"
auto-complete="on" />
</el-form-item>
<el-form-item prop="code" class="send_item">
<el-input ref="code" v-model="loginForm.code" placeholder="验证码" name="code" type="text" tabindex="1"
auto-complete="on">
</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>
</template>
<el-button :loading="loading" type="primary" class="loginBtn"
@click.native.prevent="handleLogin">登录</el-button>
<el-button v-if="!changeLogin" :loading="loading" type="primary" class="loginBtn"
@click.native.prevent="handleLogin">登录</el-button>
<el-button v-else :loading="loading" type="primary" class="loginBtn"
@click.native.prevent="handleMsgLogin">登录</el-button>
</el-form>
</div>
</div>
@ -60,7 +64,13 @@
import {
validUsername
} from '@/utils/validate'
import {
getMsg,
loginMsg
} from "@/api/user.js"
import {
setToken
} from '@/utils/auth'
const defaultSettings = require('../../../src/settings.js')
export default {
name: 'Login',
@ -82,6 +92,9 @@
return {
title: "",
changeLogin: false,
hasSend: false,
count: 60,
sendTimer: null,
loginForm: {
username: '',
password: ''
@ -105,12 +118,12 @@
},
watch: {
$route: {
handler: function(route) {
if(route.query && route.query.redirect==='/'){
this.redirect = '/dashboard'
}else{
this.redirect = route.query && route.query.redirect
}
handler: function(route) {
if (route.query && route.query.redirect === '/') {
this.redirect = '/dashboard'
} else {
this.redirect = route.query && route.query.redirect
}
},
immediate: true
@ -132,8 +145,66 @@
this.$nextTick(() => {
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() {
this.$refs.loginForm.validate(valid => {
if (valid) {
@ -152,7 +223,8 @@
return false
}
})
}
},
//
}
}
</script>
@ -222,17 +294,19 @@
background: url("../../assets/login_bg.png") no-repeat;
overflow: hidden;
background-size: 100% 100%;
position: relative;
.login-footer{
text-align: center;
position: absolute;
bottom:20px;
left:0;
width:100%;
color:#274999;
position: relative;
.login-footer {
text-align: center;
position: absolute;
bottom: 20px;
left: 0;
width: 100%;
color: #274999;
}
.login-logo {
// width: 20vw;
width: 383px;
@ -316,6 +390,18 @@
height: 47px;
line-height: 47px;
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;
}
}
@media (max-width:492px) {
.login-container {
.login-logo{
width:100%;
.login-container {
.login-logo {
width: 100%;
}
.login-wrap {
margin-left: 0px;
margin-right: 0px;
@ -374,7 +461,7 @@
}
}
}
}
}
@media (min-width:493px) {
.login-container {

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

Loading…
Cancel
Save