用户相关联调

dev_2022-04-07
yujialong 3 years ago
parent e8deac4d8b
commit a1b2370412
  1. 5
      src/router/index.js
  2. 16
      src/utils/http.js
  3. 7
      src/views/order/AddOrder.vue
  4. 44
      src/views/user/AddUser.vue
  5. 830
      src/views/user/Info.vue
  6. 58
      src/views/user/User.vue

@ -36,6 +36,11 @@ let router = new Router({
component: () => import( '../views/user/AddUser.vue'),
// meta: { title: '新增用户' }
},
{
path: '/info',
component: () => import( '../views/user/Info.vue'),
// meta: { title: '新增用户' }
},
{
path: '/order',
component: () => import( '../views/order/Order.vue'),

@ -34,11 +34,21 @@ axios.interceptors.request.use(config => {
axios.interceptors.response.use(
response => {
if (response.status === 200) {
if(response.data.status && response.data.status!==200){// 接口定义的非正常返回的时候,应当处于报错状态
const { status } = response.data
if (status) {
// 接口定义的非正常返回的时候,应当处于报错状态
if (status === 10020) {
// 该状态为用户列表启用用户的接口返回的状态,特殊处理
return Promise.reject(response)
} else if (status !== 200) {
Message.error(response.data.message)
return Promise.reject(response);
return Promise.reject(response)
} else {
return Promise.resolve(response)
}
} else {
return Promise.resolve(response)
}
return Promise.resolve(response);
} else {
Message.error(response.message,'res');
return Promise.reject(response);

@ -832,9 +832,10 @@ export default {
});
},
setStartDate(renewList, contract, form, orderOther) {
console.log(33, renewList, contract, form)
const { orderType } = form
let list = orderOther.map(e => {
const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority)
if (orderType === 2) e.finalPrice = 0 // 0
const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority) // renew
if (item) {
//
if (this.renewDisabled) {
@ -895,7 +896,7 @@ export default {
orderType: form.orderType,
cityId: form.cityId,
phone: form.phone,
orderAmount: form.orderAmount,
orderAmount: form.orderType === 2 ? 0 : form.orderAmount, // 0
orderId: form.orderId,
options: form.options,
};

@ -132,7 +132,7 @@
class="table"
stripe
header-align="center"
row-key="platformId"
row-key="accountId"
>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="platformName" label="平台名称" align="center"></el-table-column>
@ -162,7 +162,7 @@ export default {
data() {
return {
userId: this.$route.query.userId,
isDetail: this.$route.query.show, //
isDetail: this.$route.query.show === '1', //
form: {
//
userId: '',
@ -191,41 +191,19 @@ export default {
goback(){
this.$router.back()
},
switchUser(val,row,index) {
this.$get(this.api.updateAccountAllEnable,{
id: row.userId,
//
switchUser(val,row) {
this.$get(this.api.updateAccountEnable, {
id: row.accountId,
isEnable: val
}).then(res => {
if(res.code == '200') {
this.$message.success(val ? '启用成功' : '禁用成功')
}else{
this.$message.success(res.message)
}
}).catch(res => {})
},
show(row,isShow){
let obj = {}
Object.assign(obj,{
regionName: row.platformName,
regionId: row.platformId,
}).catch(res => {
row.isEnable = 0
})
this.regionOption = [obj, ...[]]
this.region = row.platformId
this.dialogFormVisible = true
this.choosecusArr = ''
this.chooseCusList = []
this.chooseList = []
this.isShow = isShow
this.$get(this.api.selectUserSysBind, { userId: this.userId, platformId: row.platformId}).then(res => {
let list = res.result.map
for(let i in list){
for(let n in list[i]){
list[i] = list[i][n]
}
}
this.chooseList = list
}).catch(res => {})
},
show(row) {
this.$router.push(`/info?userId=${row.userId}&workNumber=${row.workNumber}&roleName=${row.roleName}&platformName=${row.platformName}`)
}
}
};

@ -0,0 +1,830 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" @click="$router.back()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">{{ this.$route.query.platformName }}</span>
</div>
</div>
</el-card>
<div class="page" v-loading="loading">
<div class="inner">
<h6 class="l-title"><img src="@/assets/img/info1.png" alt=""> 基本信息</h6>
<el-form disabled>
<div class="page-content">
<ul class="list">
<div class="line info">
<li>
<label>姓名</label>
<el-input size="small" v-model="form.userName" clearable></el-input>
</li>
<li>
<label>工号</label>
<el-input size="small" v-model="form.workNumber" clearable></el-input>
</li>
</div>
<div class="line info">
<li>
<label>性别</label>
<el-select size="small" v-model="form.sex">
<el-option v-for="item in sexList" :key="item.value" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li class="selects">
<label>所在地</label>
<div class="mul">
<div class="child">
<el-select size="small" v-model="form.countries" placeholder>
<el-option v-for="item in countryList" :key="item.value" :label="item.label" :value="item.label"></el-option>
</el-select>
</div>
<div class="child">
<el-select size="small" v-model="form.provinceId" placeholder @change="id => getCity(id,1)">
<el-option v-for="item in provinceList" :key="item.provinceId" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</div>
<div class="child">
<el-select size="small" v-model="form.cityId" placeholder :disabled="form.provinceId ? false : true">
<el-option v-for="item in cityList" :key="item.cityId" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</div>
</div>
</li>
</div>
<div class="line info">
<li>
<label>出生年月</label>
<el-date-picker size="small" placeholder="请选择时间" v-model="form.dateBirth" :clearable="false" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd"></el-date-picker>
</li>
<li>
<label>教育程度</label>
<el-select size="small" v-model="form.educationDegree" placeholder="请选择教育程度">
<el-option v-for="(item,index) in educationDegreeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
</div>
<div class="line info">
<li>
<label>角色</label>
<el-input size="small" v-model="form.roleName" clearable></el-input>
</li>
<li>
<label>身份证</label>
<el-input size="small" placeholder="请输入身份证" v-model="form.idNumber" clearable></el-input>
</li>
</div>
</ul>
</div>
<div class="flex j-between a-center" style="width: 862px">
<h6 class="l-title"><img src="@/assets/img/info2.png" alt=""> 个人档案</h6>
</div>
<div class="page-content">
<div class="archives" v-for="(archive,index) in archivesList" :key="index" v-show="index == 0 || showArch">
<ul class="list">
<div class="line">
<li>
<label>职业</label>
<el-select size="small" v-model="archive.personalCareerId" placeholder="选择职业">
<el-option v-for="item in occupationList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>院校</label>
<el-select size="small" v-model="archive.schoolId" filterable placeholder="选择学校" @change="id => getSchoolName(id,index)">
<el-option v-for="item in schoolList" :key="item.value" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</li>
</div>
<div class="line">
<li>
<label>专业学科</label>
<el-select size="small" v-model="archive.disciplineId" placeholder="选择专业学科" @change="id => getItemProfessionalClass(id,index)" @clear="() => clearItemClass(index)">
<el-option v-for="item in subjectList" :key="item.value" :label="item.disciplineName" :value="item.disciplineId"></el-option>
</el-select>
</li>
<li>
<label>专业类</label>
<el-select size="small" v-model="archive.professionalClassId" placeholder="选择专业类" :disabled="archive.disciplineId ? false : true" @change="id => getItemProfessional(id,index)" @clear="() => clearItemProfess(index)">
<el-option v-for="item in archive.ProfessionalClassList" :key="item.professionalClassId" :label="item.professionalClassName" :value="item.professionalClassId"></el-option>
</el-select>
</li>
</div>
<div class="line" style="margin-bottom: 0">
<li>
<label>专业</label>
<el-select size="small" v-model="archive.professionalId" placeholder="选择专业" :disabled="archive.professionalClassId ? false : true" @change="getItemStuGrade">
<el-option v-for="item in archive.ProfessionalList" :key="item.professionalId" :label="item.professionalName" :value="item.professionalId"></el-option>
</el-select>
</li>
</div>
</ul>
</div>
<div class="fold" v-if="archivesList.length > 1">
<span :class="{active: showArch}" @click="showArch = !showArch">
展开更多
<i class="el-icon-arrow-down"></i>
</span>
</div>
</div>
</el-form>
</div>
</div>
</div>
</template>
<script>
import { mapState,mapActions } from 'vuex'
import util from '@/libs/util'
export default {
data() {
return {
userId: this.$route.query.userId,
form: {
name:'',
workNumber:'',
password:"",
phone:'',
email:'',
provinceName:'',
cityName:'',
schoolName:'',
professionalName:'',
experimentName:'',
sex: 1,
dateBirth: '',
educationDegree: ''
},
sexList: [
{
name: '男',
value: 1
},
{
name: '女',
value: 2
}
],
countryList: [
{
label: '中国'
}
],
occupationList: [{
value: 1,
label: '学生'
},{
value: 2,
label: '老师'
}],
provinceList:[],
cityList: [],
educationDegreeList: [
{
name: '专科',
value: 1
},
{
name: '本科',
value: 2
},
{
name: '硕士',
value: 3
},
{
name: '博士',
value: 4
},
{
name: '其他',
value: 5
}
],
subjectList: [], //
ProfessionalClassList: [], //
ProfessionalList: [], //
schoolList: [],
curPassword: '',
accountRepeat: false,
archivesList: [],
showArch: false,
archivesForm: {
personalCareerId: '',
schoolId: '',
schoolName: '',
professionalClassId: '',
professionalClassName: '',
disciplineId: '',
disciplineName: '',
professionalId: '',
professionalName: '',
},
loading: false
};
},
watch: {
// ,
form: {
handler(){
this.updateTime++
if(this.updateTime > 1) this.$emit('updateStatus',this.updateTime > 1)
},
deep:true
}
},
mounted() {
this.getdata()
this.getProvince()
this.getSchoolData()
this.getSubject()
if (!this.archivesList.length) this.archivesList = [JSON.parse(JSON.stringify(this.archivesForm))]
},
methods: {
...mapActions('user', [
'setAvatar','setUserName'
]),
getdata() {
this.loading = true
this.$get(this.api.queryUserInfoDetails, { userId: this.userId }).then(({ result }) => {
let userInfo = result.hrUserInfo
this.form = Object.assign(userInfo, result.userAccountList[0])
const form = this.form
const { workNumber, roleName } = this.$route.query
form.workNumber = workNumber
form.roleName = roleName
this.archivesList = result.personalFileList
this.$nextTick(() => {
if(this.form.provinceId){
this.getCityData(1)
}
if(this.archivesList.length != 0){
this.archivesList.forEach((e,k) =>{
this.$set(e, 'subjectList', this.subjectList)
this.$set(e, 'disciplineId', e.disciplineId ? e.disciplineId : '')
this.$set(e, 'disciplineName', e.disciplineName ? e.disciplineName : '')
this.$set(e, 'professionalClassId', e.professionalClassId ? e.professionalClassId : '')
this.$set(e, 'professionalClassName', e.professionalClassName ? e.professionalClassName : '')
this.$set(e, 'professionalId', e.professionalId ? e.professionalId : '')
this.$set(e, 'professionalName', e.professionalName ? e.professionalName : '')
this.$set(e, 'schoolId', e.schoolId ? e.schoolId : '')
this.$set(e, 'schoolName', e.schoolName ? e.schoolName : '')
if(e.disciplineId){
this.$get(this.api.queryCourseProfessionalClass, {disciplineId: e.disciplineId }).then(res => {
this.$set(e, 'ProfessionalClassList', res.list)
}).catch(res => {})
}else{
this.$set(e, 'ProfessionalClassList', [])
}
if(e.professionalClassId){
this.$get(this.api.queryCourseProfessional,{ professionalClassId: e.professionalClassId }).then(res => {
this.$set(e, 'ProfessionalList', res.list)
}).catch(res => {})
}else{
this.$set(e, 'ProfessionalList', [])
}
})
}else{
this.concatArch()
}
this.loading = false
})
}).catch(err => {
this.loading = false
})
},
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.list
}).catch(res => {})
},
getCity(id,type){
this.form.cityId = 1
this.getCityData()
},
getCityData(index){
let provinceId = this.form.provinceId
this.$get(this.api.queryCity,{provinceId}).then(res => {
this.cityList = res.list
}).catch(res => {})
},
getCityName(id,index){
this.archivesList[index].cityName = this.archivesList[index].cityList[id-1].cityName
},
getSchoolName(id,index){
const school = this.schoolList.find(e => e.schoolId == id)
if (school) this.archivesList[index].schoolName = school.schoolName
},
getSchoolData(){
this.$get(this.api.querySchoolData,{schoolName: '',provinceId: this.provinceId,cityId: this.cityId}).then(res => {
this.schoolList = res.list
}).catch(res => {})
},
accountChange(){
this.$get(`${this.api.getAccount}?account=${this.form.account}`).then(res => {
if(res.data.userInfo){
this.accountRepeat = true
util.warningMsg('该账号已存在')
}else{
this.accountRepeat = false
}
}).catch(res => {})
},
save() {
if (this.form.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.form.idNumber)) return util.warningMsg("请输入正确的身份证号码");
let form = this.form;
let personalFileList = []
this.archivesList.forEach((n,k) => {
n.personalCareerId && personalFileList.push({
disciplineId: n.disciplineId,
disciplineName: n.disciplineName,
personalCareerId: n.personalCareerId,
personalFileId: n.personalFileId,
professionalClassId: n.professionalClassId,
professionalClassName: n.professionalClassName,
professionalId: n.professionalId,
professionalName: n.professionalName,
provinceId: n.provinceId,
provinceName: n.provinceName,
schoolId: n.schoolId,
schoolName: n.schoolName,
userId: form.userId
})
})
let data = {
userId: form.userId,
userAccountList: [{
id: form.accountId,
account: form.account,
userId: form.userId,
}],
hrUserInfo: {
provinceId: form.provinceId,
cityId: form.cityId,
countries: form.countries,
dateBirth: form.dateBirth,
educationDegree: form.educationDegree,
idNumber: form.idNumber,
schoolId: form.schoolId,
sex: form.sex,
userId: form.userId,
userName: form.userName,
wechatId: form.wechatId
},
personalFileList,
}
this.$post(this.api.updatePersonCenter,data).then(res => {
this.setUserName(form.userName);
this.$emit('updateStatus',false)
this.$message.success('提交成功!')
}).catch(res => {})
},
concatArch() {
this.archivesList = this.archivesList.concat({
countries: '中国',
personalCareerId: '',
schoolId: '',
schoolName: '',
subjectList: this.subjectList,
disciplineId: '',
disciplineName: '',
ProfessionalClassList: [],
professionalClassId: '',
professionalClassName: '',
ProfessionalList: [],
professionalId: '',
professionalName: '',
personalFileId: ''
})
},
addArch() {
let isEmpty = false
this.archivesList.forEach((n,k) => {
if(!n.personalCareerId) isEmpty = true
})
if(isEmpty) return util.warningMsg('请选择职业')
this.showArch = true
this.concatArch()
},
delArchive(i) {
this.$confirm(`此操作不可逆,是否确认删除?`, '提示', {
type: 'warning'
}).then(() => {
const id = this.archivesList[i].personalFileId
this.archivesList.splice(i, 1)
id && this.$post(`${this.api.deleteProfile}?personalFileIds=${id}`).then(res => {}).catch(err => {})
}).catch(() => {})
},
bindEmail() {
this.email = this.form.email
this.emailVisible = true
},
bindPhone() {
this.phoneVisible = true
},
bindPassword() {
this.passwordVisible = true
},
editPassword() {
if(!this.passwordForm.password) return util.warningMsg('请输入原密码')
if(!this.passwordForm.newPassword) return util.warningMsg('请输入新密码')
if(!this.passwordForm.reNewPassword) return util.warningMsg('请确认新密码')
if(this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg('请输入6位数以上的密码')
if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg('输入的新密码不一致,请重新确认')
if(this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg('原密码跟新密码不能一致')
let data = this.passwordForm
data.accountId = this.form.id
this.$post(this.api.examinePassword,data).then(res => {
util.successMsg('更换成功')
this.passwordVisible = false
}).catch(err => {})
},
closePassword() {
this.passwordForm = {
password: '',
newPassword: '',
reNewPassword: ''
}
},
foldArch() {
this.showArch = !this.showArch
this.$nextTick(() => {
document.body.scrollTop = document.querySelector('.content-box').scrollHeight
document.documentElement.scrollTop = document.querySelector('.content-box').scrollHeight
})
},
//
getSubject(){
this.$get(this.api.queryCourseDiscipline).then(res => {
this.subjectList = res.list
}).catch(res => {})
},
//
clearClass(){
this.archivesForm.professionalClassId = '',
this.archivesForm.professionalId = ''
},
//
getProfessionalClass(val){
this.clearClass()
if(val){
let obj = {}
obj = this.subjectList.find((item)=>{
return item.disciplineId === val
});
this.archivesForm.disciplineName = obj.disciplineName
this.getProfessionalClassData(val)
}
},
clearItemClass(index){
this.archivesList[index].professionalClassId = ''
this.archivesList[index].professionalClassName = ''
this.archivesList[index].professionalId = ''
this.archivesList[index].professionalName = ''
},
getItemProfessionalClass(item,index){
this.clearItemClass(index)
if(item){
let obj = {}
obj = this.subjectList.find(r =>{
return r.disciplineId === item
});
this.$get(this.api.queryCourseProfessionalClass, { disciplineId: item }).then(res => {
this.archivesList.map(e =>{
if(e.disciplineId == item){
e.ProfessionalClassList = res.list
e.disciplineName = obj.disciplineName
}
})
}).catch(res => {})
}
},
getProfessionalClassData(value){
this.$get(this.api.queryCourseProfessionalClass, {
disciplineId: value
}).then(res => {
this.ProfessionalClassList = res.list
}).catch(res => {})
},
//
clearProfess(){
this.archivesForm.professionalId = ''
},
//
getProfessional(val){
this.clearProfess()
if(val){
let obj = {}
obj = this.ProfessionalClassList.find((item)=>{
return item.professionalClassId === val
})
this.archivesForm.professionalClassName = obj.professionalClassName
this.getProfessionalData(val)
}
},
clearItemProfess(index){
this.archivesList[index].professionalId = ''
this.archivesList[index].professionalName = ''
},
getItemProfessional(item,index){
this.clearItemProfess(index)
if(item){
this.$get(this.api.queryCourseProfessional,{ professionalClassId: item }).then(res => {
this.archivesList.map(e =>{
if(e.professionalClassId == item){
let obj = {}
obj = e.ProfessionalClassList.find(r =>{
return r.professionalClassId === item
})
e.ProfessionalList = res.list
e.professionalClassName = obj.professionalClassName
}
})
}).catch(res => {})
}
},
getProfessionalData(value){
this.$get(this.api.queryCourseProfessional,{professionalClassId: value}).then(res => {
this.ProfessionalList = res.list
}).catch(res => {})
},
//
getStuGrade(val){
if(val){
let obj = {}
obj = this.ProfessionalList.find(r =>{
return r.professionalId === val;
})
this.archivesForm.professionalName = obj.professionalName
}
},
getItemStuGrade(item){
if(item){
this.archivesList.map(e =>{
if(e.professionalId == item){
let obj = {}
obj = e.ProfessionalList.find(r =>{
return r.professionalId === item;
})
e.professionalName = obj.professionalName
}
})
}
},
emailCountdown(){
let count = 60
if(!this.emailTimer){
this.emailDisabled = true
this.emailTimer = setInterval(() => {
console.log('倒计时中')
if(count > 0){
count--
this.emailBtnText = `${count}秒后重试`
}else{
this.emailDisabled = false
clearInterval(this.emailTimer)
this.emailTimer = null
this.emailBtnText = `发送验证码`
}
},1000)
}
},
phoneCountdown(){
let count = 60
if(!this.phoneTimer){
this.phoneDisabled = true
this.phoneTimer = setInterval(() => {
console.log('倒计时中')
if(count > 0){
count--
this.phoneBtnText = `${count}秒后重试`
}else{
this.phoneDisabled = false
clearInterval(this.phoneTimer)
this.phoneTimer = null
this.phoneBtnText = `发送验证码`
}
},1000)
}
},
closeEmail(){
this.emailCode = ''
},
sendEmailCode(){
if(!this.email) return util.warningMsg('请输入邮箱')
if(!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg('请输入正确的邮箱')
let data = {
userId: this.form.userId,
email: this.email,
types: 1
}
this.$post(this.api.sendPhoneOrEmailCode,data).then(res => {
if(res.message.opener){
this.emailCountdown()
this.emailOpener = res.message.opener
}else{
util.errorMsg(res.message)
}
}).catch(res => {})
},
emailSubmit(){
if(!this.email) return util.warningMsg('请输入邮箱')
if(!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg('请输入正确的邮箱')
if(!this.emailCode) return util.warningMsg('请输入验证码')
let data = {
userId: this.form.userId,
email: this.email,
types: 1,
code: this.emailCode,
opener: this.emailOpener
}
this.$post(this.api.bindPhoneOrEmail,data).then(res => {
util.successMsg('绑定成功')
this.form.email = this.email
this.emailVisible = false
}).catch(res => {})
},
closePhone(){
this.phoneCode = ''
},
sendPhoneCode(){
if(!this.phone) return util.warningMsg('请输入手机号')
if(!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg('请输入正确的手机号')
let data = {
userId: this.form.userId,
phone: this.phone,
types: 2
}
this.$post(this.api.sendPhoneOrEmailCode,data).then(res => {
if(res.message.opener){
this.phoneCountdown()
this.phoneOpener = res.message.opener
}else{
util.errorMsg(res.message)
}
}).catch(res => {})
},
phoneSubmit(){
if(!this.phone) return util.warningMsg('请输入手机号')
if(!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg('请输入正确的手机号')
if(!this.phoneCode) return util.warningMsg('请输入验证码')
let data = {
userId: this.form.userId,
phone: this.phone,
types: 2,
code: this.phoneCode,
opener: this.phoneOpener
}
this.$post(this.api.bindPhoneOrEmail,data).then(res => {
util.successMsg('绑定成功')
this.form.phone = this.phone
this.phoneVisible = false
}).catch(res => {})
},
openAccount() {
this.account = this.form.account
this.accountVisible = true
},
confirmAccount() {
if (this.account) {
this.form.account = this.account
this.accountVisible = false
} else {
util.errorMsg('请输入账号')
}
}
}
};
</script>
<style lang="scss" scoped>
.m-r-10 {
margin-right: 10px;
}
.l-title{
display: flex;
align-items: center;
margin-bottom: 12px;
font-size: 14px;
color: #333;
img{
margin-right: 5px;
}
}
.page{
.inner {
width: 1000px;
margin: 0 auto;
}
/deep/.el-input__inner{
border-color: #CACFDB;
}
.list{
.line{
display: flex;
margin-bottom: 24px;
&.info li:not(.selects){
.el-input{
flex: 1;
}
}
&.imp li{
&:nth-child(odd) {
width: 360px;
margin-right: 64px;
}
}
}
.el-input, .el-select{
width: 220px;
.el-input__inner{
border-color: #CACFDB;
}
}
li{
display: inline-flex;
align-items: center;
&>label{
width: 100px;
margin-right: 5px;
text-align: right;
font-size: 14px;
color: #4c4c4c;
}
.el-select {
flex: 1;
}
.el-select .el-input.is-disabled .el-input__inner{
border-color: #ddd;
}
.val{
margin-right: 15px;
color: #606266;
font-size: 14px;
}
.mul{
display: inline-flex;
.child{
display: inline-flex;
width: 132px;
margin-right: 10px;
&>span{
margin-bottom: 5px;
font-size: 14px;
color: #575757;
}
}
}
&:nth-child(odd) {
width: 325px;
margin-right: 100px;
}
}
}
.archives{
position: relative;
width: 862px;
padding: 16px 0;
margin-bottom: 6px;
border-radius: 4px;
background-color: #FAFAFA;
.del{
position: absolute;
top: 80px;
right: 19px;
cursor: pointer;
}
}
.fold{
margin-top: 20px;
text-align: center;
font-size: 12px;
color: #006EFF;
span{
cursor: pointer;
i{
transition: .5s;
}
&.active i{
transform: rotate(180deg);
}
}
}
}
.btns{
width: 100%;
padding: 12px 0;
text-align: center;
background-color: #fff;
box-shadow: 0px 0px 10px 0px rgba(188, 201, 218, 0.4);
.el-button{
width: 80px;
}
}
</style>

@ -103,7 +103,7 @@
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="userData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="userId">
<el-table :data="userData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" v-loading="loading" row-key="userId">
<el-table-column type="selection" width="55" 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>
@ -116,7 +116,6 @@
<el-table-column label="操作" width="300" align="center">
<template slot-scope="scope">
<el-button type="text" @click="toDetail(scope.row, 1)" v-auth>查看</el-button>
<el-button type="text" @click="toDetail(scope.row)" v-auth>编辑</el-button>
<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>
@ -213,7 +212,8 @@ export default {
page: 1,
pageSize: 10,
totals: 1,
multipleSelection: []
multipleSelection: [],
loading: false
};
},
watch: {
@ -262,10 +262,23 @@ export default {
page: this.page,
size: this.pageSize
}
this.$get(this.api.queryUserInfoList,data).then(res => {
this.userData = res.message.list
this.totals = res.message.totalCount
}).catch(res => {});
this.loading = true
this.$get(this.api.queryUserInfoList,data).then(({ message }) => {
const { list } = message
list.map(e => {
//
this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => {
const platList = result.bindingPlatformAndUserList
// 1->0->
e.isEnable = platList.find(e => e.isEnable) ? 1 : 0
}).catch((res) => {})
})
this.userData = list
this.totals = message.totalCount
this.loading = false
}).catch(res => {
this.loading = false
})
},
initData(){
this.page = 1
@ -343,18 +356,37 @@ export default {
}).catch(res => {})
}).catch(() => {})
},
switchOff(val,row,index) {
this.$get(this.api.updateAccountAllEnable,{
//
switchUser(val,row) {
this.$get(this.api.updateAccountAllEnable, {
id: row.userId,
isEnable: val
}).then(res => {
if(res.code == '200') {
this.$message.success(val ? '启用成功' : '禁用成功')
}else{
this.$message.success(res.message)
}
}).catch(res => {})
},
//
switchOff(val,row) {
//
if (val) {
//
this.$post(`${this.api.oneClickEnableVerification}?accountId=${row.accountId}`).then(({ result }) => {
this.switchUser(val, row)
}).catch((res) => {
//
this.$confirm(res.message, '提示', {
type: 'info'
}).then(() => {
this.switchUser(val, row)
}).catch(() => {
//
row.isEnable = 0
})
})
} else {
this.switchUser(val, row)
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},

Loading…
Cancel
Save