|
|
@ -1,6 +1,7 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="wrap"> |
|
|
|
<div class="wrap"> |
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="mgb20"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<div class="flex-center mgb20"> |
|
|
|
<div class="flex-center mgb20"> |
|
|
|
<p class="hr_tag"></p> |
|
|
|
<p class="hr_tag"></p> |
|
|
@ -18,35 +19,57 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
--> |
|
|
|
--> |
|
|
|
<el-form-item label="省份"> |
|
|
|
<el-form-item label="省份"> |
|
|
|
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" @clear="clearprovince()"> |
|
|
|
<el-select v-model="form.provinces" |
|
|
|
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option> |
|
|
|
clearable |
|
|
|
|
|
|
|
placeholder="请选择省份" |
|
|
|
|
|
|
|
@change="getCity" |
|
|
|
|
|
|
|
@clear="clearprovince()"> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in provinceList" |
|
|
|
|
|
|
|
:key="index" |
|
|
|
|
|
|
|
:label="item.provinceName" |
|
|
|
|
|
|
|
:value="item.provinceId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="城市"> |
|
|
|
<el-form-item label="城市"> |
|
|
|
<el-select v-model="form.city" clearable placeholder="请选择城市" |
|
|
|
<el-select v-model="form.city" |
|
|
|
:disabled="form.provinces ? false : true" @clear="clearcity()" @change="initData"> |
|
|
|
clearable |
|
|
|
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option> |
|
|
|
placeholder="请选择城市" |
|
|
|
|
|
|
|
:disabled="form.provinces ? false : true" |
|
|
|
|
|
|
|
@clear="clearcity()" |
|
|
|
|
|
|
|
@change="initData"> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in cityList" |
|
|
|
|
|
|
|
:key="index" |
|
|
|
|
|
|
|
:label="item.cityName" |
|
|
|
|
|
|
|
:value="item.cityId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="来源"> |
|
|
|
<el-form-item label="来源"> |
|
|
|
<el-select v-model="form.platformId" clearable placeholder="请选择来源" @change="initData"> |
|
|
|
<el-select v-model="form.platformId" |
|
|
|
<el-option |
|
|
|
clearable |
|
|
|
v-for="item in platformList" |
|
|
|
placeholder="请选择来源" |
|
|
|
|
|
|
|
@change="initData"> |
|
|
|
|
|
|
|
<el-option v-for="item in platformList" |
|
|
|
:key="item.value" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
:value="item.value"></el-option> |
|
|
|
></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-form-item label="学校"> |
|
|
|
<el-form-item label="学校"> |
|
|
|
<el-select v-model="form.schoolId" clearable filterable placeholder="请选择学校" @change="initData"> |
|
|
|
<el-select v-model="form.schoolId" |
|
|
|
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option> |
|
|
|
clearable |
|
|
|
|
|
|
|
filterable |
|
|
|
|
|
|
|
placeholder="请选择学校" |
|
|
|
|
|
|
|
@change="initData"> |
|
|
|
|
|
|
|
<el-option v-for="(item,index) in schoolList" |
|
|
|
|
|
|
|
:key="index" |
|
|
|
|
|
|
|
:label="item.schoolName" |
|
|
|
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
@ -60,16 +83,19 @@ |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="创建时间" class="userRadio"> |
|
|
|
<el-form-item label="创建时间" |
|
|
|
|
|
|
|
class="userRadio"> |
|
|
|
<el-radio-group v-model="form.month"> |
|
|
|
<el-radio-group v-model="form.month"> |
|
|
|
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
|
|
|
<el-radio v-for="(item,index) in dateList" |
|
|
|
|
|
|
|
:key="index" |
|
|
|
|
|
|
|
:label="item.id" |
|
|
|
|
|
|
|
border>{{item.name}}</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="自定义"> |
|
|
|
<el-form-item label="自定义"> |
|
|
|
<el-date-picker |
|
|
|
<el-date-picker v-model="form.date" |
|
|
|
v-model="form.date" |
|
|
|
|
|
|
|
align="right" |
|
|
|
align="right" |
|
|
|
unlink-panels |
|
|
|
unlink-panels |
|
|
|
type="daterange" |
|
|
|
type="daterange" |
|
|
@ -77,13 +103,15 @@ |
|
|
|
end-placeholder="结束日期" |
|
|
|
end-placeholder="结束日期" |
|
|
|
format="yyyy-MM-dd" |
|
|
|
format="yyyy-MM-dd" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
clearable |
|
|
|
clearable></el-date-picker> |
|
|
|
></el-date-picker> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input placeholder="支持手机号,姓名" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input> |
|
|
|
<el-input placeholder="支持手机号,姓名" |
|
|
|
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
|
|
|
v-model="form.keyword" |
|
|
|
|
|
|
|
clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
@ -93,37 +121,89 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="card"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="card"> |
|
|
|
<div class="flex-between mgb20"> |
|
|
|
<div class="flex-between mgb20"> |
|
|
|
<div class="flex-center"> |
|
|
|
<div class="flex-center"> |
|
|
|
<p class="hr_tag"></p> |
|
|
|
<p class="hr_tag"></p> |
|
|
|
<span>用户列表</span> |
|
|
|
<span>用户列表</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
round |
|
|
|
|
|
|
|
@click="delAllSelection" |
|
|
|
|
|
|
|
v-auth>批量删除</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="userData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" v-loading="loading" row-key="userId"> |
|
|
|
<el-table :data="userData" |
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
class="table" |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
|
|
|
ref="table" |
|
|
|
<el-table-column prop="userName" label="姓名" align="center"></el-table-column> |
|
|
|
stripe |
|
|
|
<el-table-column prop="phone" label="手机号" align="center"></el-table-column> |
|
|
|
header-align="center" |
|
|
|
<el-table-column prop="schoolName" label="学校" align="center"></el-table-column> |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
<el-table-column prop="platformName" label="来源" align="center"></el-table-column> |
|
|
|
v-loading="loading" |
|
|
|
<el-table-column prop="createTime" label="创建时间" width="150" align="center"></el-table-column> |
|
|
|
row-key="userId"> |
|
|
|
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column> |
|
|
|
<el-table-column type="selection" |
|
|
|
<el-table-column prop="lastLoginTime" label="最近登录时间" align="center"></el-table-column> |
|
|
|
width="55" |
|
|
|
<el-table-column label="操作" width="300" align="center"> |
|
|
|
align="center" |
|
|
|
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column type="index" |
|
|
|
|
|
|
|
width="100" |
|
|
|
|
|
|
|
label="序号" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="userName" |
|
|
|
|
|
|
|
label="姓名" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="phone" |
|
|
|
|
|
|
|
label="手机号" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="schoolName" |
|
|
|
|
|
|
|
label="学校" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="platformName" |
|
|
|
|
|
|
|
label="来源" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="createTime" |
|
|
|
|
|
|
|
label="创建时间" |
|
|
|
|
|
|
|
width="150" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="logInNumber" |
|
|
|
|
|
|
|
label="登录次数" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="lastLoginTime" |
|
|
|
|
|
|
|
label="最近登录时间" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
width="300" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" @click="toDetail(scope.row, 1)" v-auth>查看</el-button> |
|
|
|
<el-button type="text" |
|
|
|
<el-button v-if="scope.row.userId!==1" type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> |
|
|
|
@click="toDetail(scope.row, 1)" |
|
|
|
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button> |
|
|
|
v-auth>查看</el-button> |
|
|
|
<el-switch v-if="scope.row.userId!==1" v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" :active-text="scope.row.isEnable ? '启用' : '禁用'" @change="switchOff($event,scope.row,scope.$index)" v-auth="'/user:启用'"></el-switch> |
|
|
|
<el-button v-if="scope.row.userId!==1" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
|
|
|
|
v-auth>删除</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="resetPassword(scope.row)" |
|
|
|
|
|
|
|
v-auth>重置密码</el-button> |
|
|
|
|
|
|
|
<el-switch v-if="scope.row.userId!==1" |
|
|
|
|
|
|
|
v-model="scope.row.isEnable" |
|
|
|
|
|
|
|
:active-value="1" |
|
|
|
|
|
|
|
:inactive-value="0" |
|
|
|
|
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
|
|
|
|
:active-text="scope.row.isEnable ? '启用' : '禁用'" |
|
|
|
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)" |
|
|
|
|
|
|
|
v-auth="'/user:启用'"></el-switch> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<div class="pagination"> |
|
|
|
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="totals"> |
|
|
|
<el-pagination background |
|
|
|
|
|
|
|
@current-change="currentChange" |
|
|
|
|
|
|
|
:current-page="page" |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
:total="totals"> |
|
|
|
</el-pagination> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
@ -134,7 +214,7 @@ |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'user', |
|
|
|
name: 'user', |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
platformId: Setting.platformId, |
|
|
|
platformId: Setting.platformId, |
|
|
|
searchTimer: null, |
|
|
|
searchTimer: null, |
|
|
@ -147,7 +227,7 @@ export default { |
|
|
|
schoolId: '', |
|
|
|
schoolId: '', |
|
|
|
accountRole: '', |
|
|
|
accountRole: '', |
|
|
|
keyword: '', |
|
|
|
keyword: '', |
|
|
|
date:'', |
|
|
|
date: '', |
|
|
|
startTime: '', |
|
|
|
startTime: '', |
|
|
|
endTime: '', |
|
|
|
endTime: '', |
|
|
|
month: '' |
|
|
|
month: '' |
|
|
@ -169,12 +249,12 @@ export default { |
|
|
|
value: 4 |
|
|
|
value: 4 |
|
|
|
}], |
|
|
|
}], |
|
|
|
countryList: [{ |
|
|
|
countryList: [{ |
|
|
|
name:'中国' |
|
|
|
name: '中国' |
|
|
|
}], |
|
|
|
}], |
|
|
|
provinceList: this.$store.state.provinceList, |
|
|
|
provinceList: this.$store.state.provinceList, |
|
|
|
cityList: [], |
|
|
|
cityList: [], |
|
|
|
schoolList: [], |
|
|
|
schoolList: [], |
|
|
|
userData:[], |
|
|
|
userData: [], |
|
|
|
dateList: [{ |
|
|
|
dateList: [{ |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
name: '不限' |
|
|
|
name: '不限' |
|
|
@ -217,37 +297,37 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
'form.keyword': function(val) { |
|
|
|
'form.keyword': function (val) { |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
},500) |
|
|
|
}, 500) |
|
|
|
}, |
|
|
|
}, |
|
|
|
'form.month': function(val){ |
|
|
|
'form.month': function (val) { |
|
|
|
if(val){ |
|
|
|
if (val) { |
|
|
|
let unit = 24 * 60 * 60 * 1000 |
|
|
|
let unit = 24 * 60 * 60 * 1000 |
|
|
|
this.form.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] |
|
|
|
this.form.date = [this.formatDate('yyyy-MM-dd', new Date(new Date().getTime() - unit * 30 * val)), this.formatDate('yyyy-MM-dd', new Date(new Date().getTime() + unit))] |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.form.date = [] |
|
|
|
this.form.date = [] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
'form.date': function(val){ |
|
|
|
'form.date': function (val) { |
|
|
|
if(val && val.length){ |
|
|
|
if (val && val.length) { |
|
|
|
this.form.startTime = val[0] |
|
|
|
this.form.startTime = val[0] |
|
|
|
this.form.endTime = val[1] |
|
|
|
this.form.endTime = val[1] |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.form.startTime = '' |
|
|
|
this.form.startTime = '' |
|
|
|
this.form.endTime = '' |
|
|
|
this.form.endTime = '' |
|
|
|
} |
|
|
|
} |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
this.getSchoolData(); |
|
|
|
this.getSchoolData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData() { |
|
|
|
getData () { |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
countries: this.form.countries, |
|
|
|
countries: this.form.countries, |
|
|
|
provinceId: this.form.provinces, |
|
|
|
provinceId: this.form.provinces, |
|
|
@ -288,95 +368,95 @@ export default { |
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData(){ |
|
|
|
initData () { |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 清除省份 |
|
|
|
// 清除省份 |
|
|
|
clearprovince(){ |
|
|
|
clearprovince () { |
|
|
|
this.form.city = '', |
|
|
|
this.form.city = '', |
|
|
|
this.form.schoolId = '' |
|
|
|
this.form.schoolId = '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取城市 |
|
|
|
// 获取城市 |
|
|
|
getCity(){ |
|
|
|
getCity () { |
|
|
|
this.clearprovince() |
|
|
|
this.clearprovince() |
|
|
|
this.getCityData() |
|
|
|
this.getCityData() |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
getCityData(){ |
|
|
|
getCityData () { |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
provinceId: this.form.provinces |
|
|
|
provinceId: this.form.provinces |
|
|
|
} |
|
|
|
} |
|
|
|
this.$get(this.api.queryCity,data).then(res => { |
|
|
|
this.$get(this.api.queryCity, data).then(res => { |
|
|
|
this.cityList = res.list |
|
|
|
this.cityList = res.list |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 清除城市 |
|
|
|
// 清除城市 |
|
|
|
clearcity(){ |
|
|
|
clearcity () { |
|
|
|
this.form.schoolId = '' |
|
|
|
this.form.schoolId = '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取学校/客户名称 |
|
|
|
// 获取学校/客户名称 |
|
|
|
getSchool(){ |
|
|
|
getSchool () { |
|
|
|
this.clearcity() |
|
|
|
this.clearcity() |
|
|
|
this.getSchoolData() |
|
|
|
this.getSchoolData() |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
getSchoolData(){ |
|
|
|
getSchoolData () { |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
provinceId: "", |
|
|
|
provinceId: "", |
|
|
|
cityId: "" |
|
|
|
cityId: "" |
|
|
|
} |
|
|
|
} |
|
|
|
this.$get(this.api.querySchoolData,data).then(res => { |
|
|
|
this.$get(this.api.querySchoolData, data).then(res => { |
|
|
|
this.schoolList = res.list |
|
|
|
this.schoolList = res.list |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
currentChange(val) { |
|
|
|
currentChange (val) { |
|
|
|
this.page = val |
|
|
|
this.page = val |
|
|
|
this.$router.push(`user?page=${val}`) |
|
|
|
this.$router.push(`user?page=${val}`) |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
toDetail(row, detail){ |
|
|
|
toDetail (row, detail) { |
|
|
|
this.$router.push(`/adduser?userId=${row.userId}${detail ? '&show=1' : ''}`) |
|
|
|
this.$router.push(`/adduser?userId=${row.userId}${detail ? '&show=1' : ''}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleDelete(row) { |
|
|
|
handleDelete (row) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$post(this.api.delUserAccounts, row.userIds).then(res => { |
|
|
|
this.$post(this.api.delUserAccounts, row.userIds).then(res => { |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
resetPassword(row){ |
|
|
|
resetPassword (row) { |
|
|
|
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', { |
|
|
|
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', { |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$get(this.api.resetPwd,{ |
|
|
|
this.$get(this.api.resetPwd, { |
|
|
|
newPwd: Setting.initialPassword, |
|
|
|
newPwd: Setting.initialPassword, |
|
|
|
userId: row.userId, |
|
|
|
userId: row.userId, |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
if(res.message == 'success'){ |
|
|
|
if (res.message == 'success') { |
|
|
|
this.$message.success('重置成功') |
|
|
|
this.$message.success('重置成功') |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.$message.error('重置失败') |
|
|
|
this.$message.error('重置失败') |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 调禁用启用接口 |
|
|
|
// 调禁用启用接口 |
|
|
|
switchUser(val,row) { |
|
|
|
switchUser (val, row) { |
|
|
|
this.$get(this.api.updateAccountAllEnable, { |
|
|
|
this.$get(this.api.updateAccountAllEnable, { |
|
|
|
id: row.userId, |
|
|
|
id: row.userId, |
|
|
|
isEnable: val, |
|
|
|
isEnable: val, |
|
|
|
phone: row.phone |
|
|
|
phone: row.phone |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
this.$message.success(val ? '启用成功' : '禁用成功') |
|
|
|
this.$message.success(val ? '启用成功' : '禁用成功') |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 禁用启用 |
|
|
|
// 禁用启用 |
|
|
|
switchOff(val,row) { |
|
|
|
switchOff (val, row) { |
|
|
|
// 如果是启用,则要判断,禁用不用判断 |
|
|
|
// 如果是启用,则要判断,禁用不用判断 |
|
|
|
if (val) { |
|
|
|
if (val) { |
|
|
|
// 判断是否能够一键启用(数据平台) |
|
|
|
// 判断是否能够一键启用(数据平台) |
|
|
@ -385,7 +465,8 @@ export default { |
|
|
|
}).catch((res) => { |
|
|
|
}).catch((res) => { |
|
|
|
// 弹框提示是否要继续启用,点了是,才需要继续启用 |
|
|
|
// 弹框提示是否要继续启用,点了是,才需要继续启用 |
|
|
|
this.$confirm(res.message, '提示', { |
|
|
|
this.$confirm(res.message, '提示', { |
|
|
|
type: 'info' |
|
|
|
type: 'info', |
|
|
|
|
|
|
|
closeOnClickModal: false |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.switchUser(val, row) |
|
|
|
this.switchUser(val, row) |
|
|
|
}).catch(() => { |
|
|
|
}).catch(() => { |
|
|
@ -397,19 +478,19 @@ export default { |
|
|
|
this.switchUser(val, row) |
|
|
|
this.switchUser(val, row) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { |
|
|
|
handleSelectionChange (val) { |
|
|
|
this.multipleSelection = val; |
|
|
|
this.multipleSelection = val; |
|
|
|
}, |
|
|
|
}, |
|
|
|
delAllSelection() { |
|
|
|
delAllSelection () { |
|
|
|
if(this.multipleSelection.length){ |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
let delList = this.multipleSelection.map(e => e.userId); |
|
|
|
let delList = this.multipleSelection.map(e => e.userId); |
|
|
|
this.$confirm('确定要删除选中用户吗?', '提示', { |
|
|
|
this.$confirm('确定要删除选中用户吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$post(this.api.delUserAccounts,delList).then(res => { |
|
|
|
this.$post(this.api.delUserAccounts, delList).then(res => { |
|
|
|
if(delList.length == this.userData.length){ |
|
|
|
if (delList.length == this.userData.length) { |
|
|
|
if(this.page > 1){ |
|
|
|
if (this.page > 1) { |
|
|
|
this.page = this.page-1 |
|
|
|
this.page = this.page - 1 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.$message.success('删除成功') |
|
|
@ -418,8 +499,8 @@ export default { |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.$message.error('请先选择客户 !') |
|
|
|
this.$message.error('请先选择客户 !') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -434,7 +515,7 @@ export default { |
|
|
|
.card { |
|
|
|
.card { |
|
|
|
min-height: calc(100vh - 380px); |
|
|
|
min-height: calc(100vh - 380px); |
|
|
|
} |
|
|
|
} |
|
|
|
.el-form-item{ |
|
|
|
.el-form-item { |
|
|
|
margin-bottom: 0; |
|
|
|
margin-bottom: 0; |
|
|
|
/deep/.el-radio { |
|
|
|
/deep/.el-radio { |
|
|
|
width: 87px; |
|
|
|
width: 87px; |
|
|
@ -443,7 +524,7 @@ export default { |
|
|
|
padding-left: 0; |
|
|
|
padding-left: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.el-radio.is-bordered+.el-radio.is-bordered{ |
|
|
|
.el-radio.is-bordered + .el-radio.is-bordered { |
|
|
|
margin-left: 0; |
|
|
|
margin-left: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|