|
|
|
@ -8,26 +8,31 @@ |
|
|
|
|
<li> |
|
|
|
|
<label>创建时间:</label> |
|
|
|
|
<el-select v-model="month" placeholder="请选择创建时间" size="small" clearable class="flex-1"> |
|
|
|
|
<el-option v-for="(item,index) in monthList" :key="index" :label="item.label" :value="item.id"></el-option> |
|
|
|
|
<el-option v-for="(item, index) in monthList" :key="index" :label="item.label" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>时间范围:</label> |
|
|
|
|
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable size="small"></el-date-picker> |
|
|
|
|
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" |
|
|
|
|
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable |
|
|
|
|
size="small"></el-date-picker> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>角色:</label> |
|
|
|
|
<el-select v-model="role" placeholder="请选择角色" size="small" clearable class="flex-1" @change="initData"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<template v-for="(item, index) in roleList"> |
|
|
|
|
<el-option v-if="item.roleName != '超级管理员'" :key="index" :label="item.roleName" :value="item.id"></el-option> |
|
|
|
|
<el-option v-if="item.roleName != '超级管理员'" :key="index" :label="item.roleName" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</template> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>状态:</label> |
|
|
|
|
<el-select v-model="status" placeholder="请选择状态" size="small" clearable class="flex-1" @change="initData"> |
|
|
|
|
<el-option v-for="(item,index) in statusList" :key="index" :label="item.label" :value="item.id"></el-option> |
|
|
|
|
<el-option v-for="(item, index) in statusList" :key="index" :label="item.label" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
@ -41,7 +46,8 @@ |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li style="margin-bottom: 0"> |
|
|
|
|
<label>搜索:</label> |
|
|
|
|
<el-input style="width: 250px" placeholder="请输入员工姓名/工号" v-model="keyword" suffix-icon="el-icon-search" clearable size="small"></el-input> |
|
|
|
|
<el-input style="width: 250px" placeholder="请输入员工姓名/工号" v-model="keyword" suffix-icon="el-icon-search" |
|
|
|
|
clearable size="small"></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
@ -52,7 +58,8 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" width="80" align="center"></el-table-column> |
|
|
|
|
<el-table-column type="index" label="序号" width="55" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
@ -60,13 +67,13 @@ |
|
|
|
|
<el-table-column prop="workNumber" label="工号/学号" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="权限状态" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{scope.row.isEnable ? '启用' : '禁用'}} |
|
|
|
|
{{ scope.row.isEnable ? '启用' : '禁用' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="roleName" label="账号角色" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="loginNumber" label="登录次数" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{scope.row.loginNumber ? scope.row.loginNumber : 0}} |
|
|
|
|
{{ scope.row.loginNumber ? scope.row.loginNumber : 0 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="lastLoginTime" label="上次登录时间" width="160" align="center"></el-table-column> |
|
|
|
@ -76,16 +83,20 @@ |
|
|
|
|
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button> |
|
|
|
|
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button> |
|
|
|
|
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> |
|
|
|
|
<el-switch 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/list:禁用'"></el-switch> |
|
|
|
|
<el-switch 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/list:禁用'"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background layout="total,prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination> |
|
|
|
|
<el-pagination background layout="total,prev, pager, next" :current-page="page" |
|
|
|
|
@current-change="handleCurrentChange" :total="total"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px" @close="closeUser" class="dialog" :close-on-click-modal="false"> |
|
|
|
|
<el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px" |
|
|
|
|
@close="closeUser" class="dialog" :close-on-click-modal="false"> |
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px" label-suffix=":" :disabled="isDetail"> |
|
|
|
|
<el-form-item prop="workNumber" label="工号/学号"> |
|
|
|
|
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input> |
|
|
|
@ -96,8 +107,9 @@ |
|
|
|
|
<el-form-item prop="roleIds" label="账号角色"> |
|
|
|
|
<div class="role-wrap"> |
|
|
|
|
<el-checkbox-group v-model="form.roleIds"> |
|
|
|
|
<template v-for="(item,index) in roleList"> |
|
|
|
|
<el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id" :title="item.roleName">{{item.roleName}}</el-checkbox> |
|
|
|
|
<template v-for="(item, index) in roleList"> |
|
|
|
|
<el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id" |
|
|
|
|
:title="item.roleName">{{ item.roleName }}</el-checkbox> |
|
|
|
|
</template> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</div> |
|
|
|
@ -118,10 +130,14 @@ |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport" :close-on-click-modal="false"> |
|
|
|
|
<div class="upload-wrap" :class="{lg: uploadFaild}"> |
|
|
|
|
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button> |
|
|
|
|
<el-upload ref="import" accept=".xls,.xlsx" :headers="{token}" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.uploadFile" :file-list="uploadList" :data="{schoolId: this.schoolId}" name="file"> |
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<div class="upload-wrap" :class="{ lg: uploadFaild }"> |
|
|
|
|
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> |
|
|
|
|
模板下载</el-button> |
|
|
|
|
<el-upload ref="import" accept=".xls,.xlsx" :headers="{ token }" :on-remove="handleRemove" :on-error="uploadError" |
|
|
|
|
:on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" |
|
|
|
|
:action="this.api.uploadFile" :file-list="uploadList" :data="{ schoolId: this.schoolId }" name="file"> |
|
|
|
|
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button> |
|
|
|
|
</el-upload> |
|
|
|
|
<div class="link" v-if="uploadFaild"> |
|
|
|
@ -141,7 +157,7 @@ import { mapState } from 'vuex' |
|
|
|
|
import util from '@/libs/util' |
|
|
|
|
import axios from 'axios' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
token: util.local.get(Setting.tokenKey), |
|
|
|
|
month: '', |
|
|
|
@ -149,13 +165,13 @@ export default { |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
label: '不限' |
|
|
|
|
},{ |
|
|
|
|
}, { |
|
|
|
|
id: 3, |
|
|
|
|
label: '近3个月' |
|
|
|
|
},{ |
|
|
|
|
}, { |
|
|
|
|
id: 6, |
|
|
|
|
label: '近6个月' |
|
|
|
|
},{ |
|
|
|
|
}, { |
|
|
|
|
id: 12, |
|
|
|
|
label: '近1年' |
|
|
|
|
} |
|
|
|
@ -169,10 +185,10 @@ export default { |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
label: '不限' |
|
|
|
|
},{ |
|
|
|
|
}, { |
|
|
|
|
id: 1, |
|
|
|
|
label: '启用' |
|
|
|
|
},{ |
|
|
|
|
}, { |
|
|
|
|
id: 0, |
|
|
|
|
label: '禁用' |
|
|
|
|
} |
|
|
|
@ -253,39 +269,39 @@ export default { |
|
|
|
|
]), |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
keyword: function(val) { |
|
|
|
|
keyword: function (val) { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData() |
|
|
|
|
},500) |
|
|
|
|
}, 500) |
|
|
|
|
}, |
|
|
|
|
month: function(val){ |
|
|
|
|
if(val){ |
|
|
|
|
month: function (val) { |
|
|
|
|
if (val) { |
|
|
|
|
let unit = 24 * 60 * 60 * 1000 |
|
|
|
|
this.date = [util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] |
|
|
|
|
}else{ |
|
|
|
|
this.date = [util.formatDate('yyyy-MM-dd', new Date(new Date().getTime() - unit * 30 * val)), util.formatDate('yyyy-MM-dd', new Date(new Date().getTime() + unit))] |
|
|
|
|
} else { |
|
|
|
|
this.date = [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
date: function(val){ |
|
|
|
|
if(val && val.length){ |
|
|
|
|
date: function (val) { |
|
|
|
|
if (val && val.length) { |
|
|
|
|
this.startTime = val[0] |
|
|
|
|
this.endTime = val[1] |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.startTime = '' |
|
|
|
|
this.endTime = '' |
|
|
|
|
} |
|
|
|
|
this.initData() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted(){ |
|
|
|
|
mounted () { |
|
|
|
|
this.form.schoolId = this.schoolId |
|
|
|
|
this.getData() |
|
|
|
|
this.getRole() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getData(){ |
|
|
|
|
this.$post(this.api.getUserList,{ |
|
|
|
|
getData () { |
|
|
|
|
this.$post(this.api.getUserList, { |
|
|
|
|
createTime: this.startTime, |
|
|
|
|
isEnable: this.status, |
|
|
|
|
endTime: this.endTime, |
|
|
|
@ -298,82 +314,82 @@ export default { |
|
|
|
|
const { records, total } = pageList |
|
|
|
|
this.listData = records |
|
|
|
|
this.total = total |
|
|
|
|
if(!records.length && total){ |
|
|
|
|
if (!records.length && total) { |
|
|
|
|
this.page-- |
|
|
|
|
this.getData() |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
initData(){ |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
// 获取全部角色 |
|
|
|
|
getRole(){ |
|
|
|
|
getRole () { |
|
|
|
|
this.$get(`${this.api.listRole}?page=1&size=1000&name=&platformId=${Setting.platformId}&port=0`).then(res => { |
|
|
|
|
const list = res.rolePage.records |
|
|
|
|
this.roleList = list |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
resetPassword(row){ |
|
|
|
|
resetPassword (row) { |
|
|
|
|
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', { |
|
|
|
|
type: 'info', |
|
|
|
|
customClass: 'normal' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$get(this.api.resetPwd,{ |
|
|
|
|
this.$get(this.api.resetPwd, { |
|
|
|
|
newPwd: Setting.initialPassword, |
|
|
|
|
userId: row.userId, |
|
|
|
|
}).then(res => { |
|
|
|
|
if(res.message == 'success'){ |
|
|
|
|
if (res.message == 'success') { |
|
|
|
|
this.$message.success('重置成功') |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.$message.error('重置失败') |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
// 组合账号 |
|
|
|
|
renderAccount() { |
|
|
|
|
renderAccount () { |
|
|
|
|
const form = this.form |
|
|
|
|
// 平台id-端id-schoolId-workNumber组成账号 |
|
|
|
|
form.account = `${Setting.platformId}-${Setting.platformType}-${this.schoolId}-${form.workNumber}` |
|
|
|
|
}, |
|
|
|
|
workNumberChange(){ |
|
|
|
|
if(this.form.workNumber && this.form.workNumber !== this.originalWorkNumber){ |
|
|
|
|
workNumberChange () { |
|
|
|
|
if (this.form.workNumber && this.form.workNumber !== this.originalWorkNumber) { |
|
|
|
|
this.$post(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => { |
|
|
|
|
this.workNumberRepeat = false |
|
|
|
|
this.renderAccount() |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.workNumberRepeat = true |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.workNumberRepeat = false |
|
|
|
|
this.renderAccount() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
phoneChange(){ |
|
|
|
|
if(this.form.phone && this.form.phone !== this.originalPhone){ |
|
|
|
|
phoneChange () { |
|
|
|
|
if (this.form.phone && this.form.phone !== this.originalPhone) { |
|
|
|
|
this.$post(`${this.api.checkEmailOrPhone}?phone=${this.form.phone}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => { |
|
|
|
|
this.phoneRepeat = false |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.phoneRepeat = true |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.phoneRepeat = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
emailChange(){ |
|
|
|
|
if(this.form.email && this.form.email !== this.originalEmail){ |
|
|
|
|
emailChange () { |
|
|
|
|
if (this.form.email && this.form.email !== this.originalEmail) { |
|
|
|
|
this.$post(`${this.api.checkEmailOrPhone}?email=${this.form.email}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => { |
|
|
|
|
this.emailRepeat = false |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.emailRepeat = true |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.emailRepeat = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
closeUser(){ |
|
|
|
|
closeUser () { |
|
|
|
|
this.$refs.form.resetFields() |
|
|
|
|
this.form.userId = '' |
|
|
|
|
this.form.accountId = '' |
|
|
|
@ -381,11 +397,11 @@ export default { |
|
|
|
|
this.accountRepeat = false |
|
|
|
|
this.workNumberRepeat = false |
|
|
|
|
}, |
|
|
|
|
add(){ |
|
|
|
|
add () { |
|
|
|
|
this.isDetail = false |
|
|
|
|
this.userVisible = true |
|
|
|
|
}, |
|
|
|
|
getDetail(accountId){ |
|
|
|
|
getDetail (accountId) { |
|
|
|
|
this.userVisible = true |
|
|
|
|
this.$post(`${this.api.getDetail}?accountId=${accountId}`).then(res => { |
|
|
|
|
let data = res.data |
|
|
|
@ -407,33 +423,33 @@ export default { |
|
|
|
|
this.originalWorkNumber = data.workNumber |
|
|
|
|
this.originalPhone = data.phone |
|
|
|
|
this.originalEmail = data.email |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
edit(row){ |
|
|
|
|
edit (row) { |
|
|
|
|
this.isDetail = false |
|
|
|
|
this.getDetail(row.accountId) |
|
|
|
|
}, |
|
|
|
|
show(row){ |
|
|
|
|
show (row) { |
|
|
|
|
this.isDetail = true |
|
|
|
|
this.getDetail(row.accountId) |
|
|
|
|
}, |
|
|
|
|
confirm(){ |
|
|
|
|
confirm () { |
|
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.submiting) return false |
|
|
|
|
if(this.accountRepeat) return util.errorMsg('该账号已存在!') |
|
|
|
|
if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!') |
|
|
|
|
if(this.phoneRepeat) return util.errorMsg('该手机号已存在!') |
|
|
|
|
if(this.emailRepeat) return util.errorMsg('该邮箱已存在!') |
|
|
|
|
if (this.accountRepeat) return util.errorMsg('该账号已存在!') |
|
|
|
|
if (this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!') |
|
|
|
|
if (this.phoneRepeat) return util.errorMsg('该手机号已存在!') |
|
|
|
|
if (this.emailRepeat) return util.errorMsg('该邮箱已存在!') |
|
|
|
|
let data = this.form |
|
|
|
|
// 如果是新增,则取当前用户的schoolId |
|
|
|
|
data.schoolId = data.schoolId ? data.schoolId : this.schoolId |
|
|
|
|
// 如果是新增,则生成个时间戳作为唯一标识 |
|
|
|
|
if(!data.userId) data.uniqueIdentification = new Date().getTime() |
|
|
|
|
if(!data.roleIds.length) return util.errorMsg('请至少选择一个角色') |
|
|
|
|
if (!data.userId) data.uniqueIdentification = new Date().getTime() |
|
|
|
|
if (!data.roleIds.length) return util.errorMsg('请至少选择一个角色') |
|
|
|
|
this.submiting = true |
|
|
|
|
if(this.form.userId){ |
|
|
|
|
this.$post(this.api.modifyUser,data).then(res => { |
|
|
|
|
if (this.form.userId) { |
|
|
|
|
this.$post(this.api.modifyUser, data).then(res => { |
|
|
|
|
this.userVisible = false |
|
|
|
|
util.successMsg('编辑成功') |
|
|
|
|
this.getData() |
|
|
|
@ -441,8 +457,8 @@ export default { |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
this.$post(this.api.saveUser,data).then(res => { |
|
|
|
|
} else { |
|
|
|
|
this.$post(this.api.saveUser, data).then(res => { |
|
|
|
|
this.userVisible = false |
|
|
|
|
util.successMsg('添加成功') |
|
|
|
|
this.getData() |
|
|
|
@ -454,20 +470,20 @@ export default { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleDelete(row){ |
|
|
|
|
handleDelete (row) { |
|
|
|
|
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(`${this.api.deleteUser}?accountIds=${row.accountId}`).then(res => { |
|
|
|
|
util.successMsg('删除成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
switchOff(val,row,index) { |
|
|
|
|
switchOff (val, row, index) { |
|
|
|
|
this.$post(`${this.api.getDetail}?accountId=${row.accountId}`).then(res => { |
|
|
|
|
const { data } = res |
|
|
|
|
this.$post(this.api.modifyUser,{ |
|
|
|
|
this.$post(this.api.modifyUser, { |
|
|
|
|
account: row.account, |
|
|
|
|
accountId: row.accountId, |
|
|
|
|
isEnable: val, |
|
|
|
@ -484,13 +500,13 @@ export default { |
|
|
|
|
}).catch((res) => { |
|
|
|
|
row.isEnable = val == 1 ? 0 : 1 |
|
|
|
|
}) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange(val) { |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
this.multipleSelection = val |
|
|
|
|
}, |
|
|
|
|
delAllSelection() { |
|
|
|
|
if(this.multipleSelection.length != ''){ |
|
|
|
|
delAllSelection () { |
|
|
|
|
if (this.multipleSelection.length != '') { |
|
|
|
|
let newArr = this.multipleSelection |
|
|
|
|
let delList = newArr.map(item => { |
|
|
|
|
return `accountIds=${item.accountId}` |
|
|
|
@ -502,71 +518,71 @@ export default { |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
util.successMsg('删除成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}else{ |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} else { |
|
|
|
|
util.errorMsg('请先选择数据 !') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
batchImport(){ |
|
|
|
|
batchImport () { |
|
|
|
|
this.importVisible = true |
|
|
|
|
this.uploadList = [] |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
handleCurrentChange (val) { |
|
|
|
|
this.page = val |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
downLoad(){ |
|
|
|
|
downLoad () { |
|
|
|
|
location.href = `${this.api.userTemplate}?id=${Math.random()}` |
|
|
|
|
}, |
|
|
|
|
showFaild(){ |
|
|
|
|
showFaild () { |
|
|
|
|
this.importVisible = false |
|
|
|
|
axios.get(`${this.api.export_failure}?token=${this.importToken}`,{ |
|
|
|
|
axios.get(`${this.api.export_failure}?token=${this.importToken}`, { |
|
|
|
|
headers: { |
|
|
|
|
token: this.token |
|
|
|
|
}, |
|
|
|
|
responseType: 'blob' |
|
|
|
|
}).then((res) => { |
|
|
|
|
util.downloadFileDirect(`导入失败原因.xlsx`,new Blob([res.data])) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
util.downloadFileDirect(`导入失败原因.xlsx`, new Blob([res.data])) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
handleExceed(files, fileList) { |
|
|
|
|
handleExceed (files, fileList) { |
|
|
|
|
util.warningMsg( |
|
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
|
uploadSuccess (res, file, fileList) { |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
if(res.status == 200){ |
|
|
|
|
if(res.data.token){ |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
if (res.data.token) { |
|
|
|
|
util.errorMsg('导入失败,请下载失败模板查看原因') |
|
|
|
|
this.importToken = res.data.token |
|
|
|
|
this.uploadFaild = true |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
res.data.message ? util.errorMsg(res.data.message) : util.errorMsg('上传失败,请检查数据') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
uploadError(err, file, fileList) { |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
|
this.$message({ |
|
|
|
|
message: "上传出错,请重试!", |
|
|
|
|
type: "error", |
|
|
|
|
center: true |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
beforeRemove(file, fileList) { |
|
|
|
|
beforeRemove (file, fileList) { |
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
|
}, |
|
|
|
|
handleRemove(file, fileList) { |
|
|
|
|
handleRemove (file, fileList) { |
|
|
|
|
this.uploadList = fileList |
|
|
|
|
this.uploadFaild = false |
|
|
|
|
}, |
|
|
|
|
closeImport(){ |
|
|
|
|
closeImport () { |
|
|
|
|
this.uploadList = [] |
|
|
|
|
}, |
|
|
|
|
confirmImport(){ |
|
|
|
|
confirmImport () { |
|
|
|
|
this.importVisible = false |
|
|
|
|
this.initData() |
|
|
|
|
} |
|
|
|
@ -574,29 +590,36 @@ export default { |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.l-title{ |
|
|
|
|
.l-title { |
|
|
|
|
margin-bottom: 24px; |
|
|
|
|
} |
|
|
|
|
.filter{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.filter { |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
li{ |
|
|
|
|
|
|
|
|
|
li { |
|
|
|
|
width: 22%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/deep/.dialog{ |
|
|
|
|
.el-form-item{ |
|
|
|
|
.el-form-item__label{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.dialog { |
|
|
|
|
.el-form-item { |
|
|
|
|
.el-form-item__label { |
|
|
|
|
font-size: 16px; |
|
|
|
|
color: rgba(0, 0, 0, 0.65); |
|
|
|
|
&:before{ |
|
|
|
|
|
|
|
|
|
&:before { |
|
|
|
|
margin-right: 0; |
|
|
|
|
color: #CC221C; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.el-input,.el-select{ |
|
|
|
|
|
|
|
|
|
.el-input, |
|
|
|
|
.el-select { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.role-wrap { |
|
|
|
|
max-height: 130px; |
|
|
|
|
padding: 10px 12px 0; |
|
|
|
@ -604,16 +627,18 @@ export default { |
|
|
|
|
border-radius: 4px; |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.el-checkbox { |
|
|
|
|
display: inline-flex; |
|
|
|
|
width: 33.33%; |
|
|
|
|
margin-right: 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.el-checkbox__label { |
|
|
|
|
max-width: 108px; |
|
|
|
|
overflow: hidden; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |