|
|
@@ -48,11 +48,28 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-slot:right-search>
|
|
|
- <el-button type="blueInfo" size="small" @click="addUser()">添加新用户</el-button>
|
|
|
+ <el-button :type="tableRadio?'blueInfo':'grayInfo'" size="mini" title="充值" @click="recharge()">
|
|
|
+ 充值
|
|
|
+ </el-button>
|
|
|
+ <el-button :type="tableRadio?'blueInfo':'grayInfo'" size="mini" title="充值" @click="testUser()">
|
|
|
+ 激活
|
|
|
+ </el-button>
|
|
|
+ <el-button :type="tableRadio?'blueInfo':'grayInfo'" size="mini" title="充值" @click="edit()">
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button :type="tableRadio?'blueInfo':'grayInfo'" size="mini" title="充值" @click="resetPassword()">
|
|
|
+ 重置密码
|
|
|
+ </el-button>
|
|
|
+ <el-button type="blueInfo" size="small" @click="addUser()">添加新用户</el-button>
|
|
|
</template>
|
|
|
</search-bar>
|
|
|
<template>
|
|
|
<el-table :data="userList" stripe style="width: 100%">
|
|
|
+ <el-table-column label="选择" fixed width="55">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-radio v-model="tableRadio" :label="scope.row"><i></i></el-radio>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="username" width="150" fixed label="用户名称"></el-table-column>
|
|
|
<el-table-column prop="role_name" label="用户角色">
|
|
|
</el-table-column>
|
|
|
@@ -75,20 +92,20 @@
|
|
|
<el-table-column prop="expire_time" width="200" label="到期时间">
|
|
|
<template slot-scope="scope">{{ ( scope.row.expire_time * 1000) | formatTime }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop label="操作" fixed="right" width="450">
|
|
|
+ <el-table-column prop label="操作" fixed="right" width="250">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="blueInfo" size="mini" title="一键登录" plain @click="login(scope.row.uid, scope.row.username)">
|
|
|
一键登录
|
|
|
</el-button>
|
|
|
- <el-button type="greenInfo" v-if="scope.row.user_type!=3" size="mini" title="分配设备" plain @click="distribute(scope.row.uid, scope.row.username)">
|
|
|
+ <el-button type="orangeInfo" v-if="scope.row.user_type!=3" size="mini" title="分配设备" plain @click="distribute(scope.row.uid, scope.row.username)">
|
|
|
分配设备
|
|
|
</el-button>
|
|
|
- <el-button type="redInfo" size="mini" title="充值" plain @click="recharge(scope.row.uid)">
|
|
|
+ <!-- <el-button type="redInfo" size="mini" title="充值" plain @click="recharge(scope.row.uid)">
|
|
|
充值
|
|
|
- </el-button>
|
|
|
- <el-button type="blueInfo" size="mini" title="编辑" plain @click="edit(scope.row)">
|
|
|
+ </el-button> -->
|
|
|
+ <!-- <el-button type="blueInfo" size="mini" title="编辑" plain @click="edit(scope.row)">
|
|
|
编辑
|
|
|
- </el-button>
|
|
|
+ </el-button> -->
|
|
|
<template v-if="scope.row.state == 1">
|
|
|
<el-button type="greenInfo" size="mini" title="禁用" plain @click="forbidUse(scope.row.uid,4, '确认禁用该用户?')">
|
|
|
禁用
|
|
|
@@ -99,9 +116,9 @@
|
|
|
恢复
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <el-button type="blueInfo" size="mini" title="重置密码" plain @click="resetPassword(scope.row.uid, scope.row.username)">
|
|
|
+ <!-- <el-button type="blueInfo" size="mini" title="重置密码" plain @click="resetPassword(scope.row.uid, scope.row.username)">
|
|
|
重置密码
|
|
|
- </el-button>
|
|
|
+ </el-button> -->
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
@@ -481,6 +498,7 @@ export default {
|
|
|
this.page = 1
|
|
|
this.getList()
|
|
|
},
|
|
|
+ tableRadio:'',
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
@@ -510,7 +528,7 @@ export default {
|
|
|
url: "/api/api_gateway?method=user.login.users_info",
|
|
|
data: this.qs.stringify({
|
|
|
role_id: this.role,
|
|
|
- page_size: 8,
|
|
|
+ page_size: 10,
|
|
|
user_type: this.userTypeCheck,
|
|
|
page: this.page,
|
|
|
username: this.username,
|
|
|
@@ -638,19 +656,26 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 编辑用户信息
|
|
|
- edit(role) {
|
|
|
- console.log(role)
|
|
|
- let data = JSON.stringify(role)
|
|
|
- this.editUserForm = JSON.parse(data)
|
|
|
- if (role.role_id == 0) {
|
|
|
- //把0转换成""
|
|
|
- this.editUserForm.role_id = ''
|
|
|
- }
|
|
|
- if (role.user_group_id=='0') {
|
|
|
- //把0转换成""
|
|
|
- this.editUserForm.user_group_id = ''
|
|
|
+ edit() {
|
|
|
+ if(this.tableRadio){
|
|
|
+ let data = JSON.stringify(this.tableRadio)
|
|
|
+ this.editUserForm = JSON.parse(data)
|
|
|
+ if (this.tableRadio.role_id == 0) {
|
|
|
+ //把0转换成""
|
|
|
+ this.editUserForm.role_id = ''
|
|
|
+ }
|
|
|
+ if (this.tableRadio.user_group_id=='0') {
|
|
|
+ //把0转换成""
|
|
|
+ this.editUserForm.user_group_id = ''
|
|
|
+ }
|
|
|
+ this.editUserDialogVisible = true
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先选择用户!'
|
|
|
+ })
|
|
|
}
|
|
|
- this.editUserDialogVisible = true
|
|
|
+
|
|
|
},
|
|
|
editUserDialogClosed() {
|
|
|
this.$refs.editUserFormRef.resetFields()
|
|
|
@@ -771,7 +796,8 @@ export default {
|
|
|
})
|
|
|
this.$router.push('allotEquip')
|
|
|
},
|
|
|
- recharge(id) {
|
|
|
+ recharge() {
|
|
|
+ if(this.tableRadio){
|
|
|
this.$confirm('是否向该用户充值一年费用?', '信息', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
@@ -782,7 +808,7 @@ export default {
|
|
|
method: 'POST',
|
|
|
url: '/api/api_gateway?method=user.login.user_add_package_time',
|
|
|
data: this.qs.stringify({
|
|
|
- uid: id
|
|
|
+ uid: this.tableRadio.uid
|
|
|
})
|
|
|
}).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
|
@@ -805,46 +831,82 @@ export default {
|
|
|
message: '充值取消!'
|
|
|
})
|
|
|
})
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先选择用户!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//密码重置
|
|
|
- resetPassword(id, name) {
|
|
|
- // this.resetPassForm.uid = id
|
|
|
- // this.resetPassForm.username = name
|
|
|
- // this.resetPassDialogVisible = true
|
|
|
- this.$confirm('是否重置密码 ? 重置后的密码为 yf_123456', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$axios({
|
|
|
- method: 'POST',
|
|
|
- url: '/api/api_gateway?method=user.login.admin_changepwd',
|
|
|
- data: this.qs.stringify({
|
|
|
- uid: id
|
|
|
- })
|
|
|
- }).then((res) => {
|
|
|
- if (res.data.message == '') {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功!'
|
|
|
- })
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
+ resetPassword() {
|
|
|
+ if(this.tableRadio){
|
|
|
+ this.$confirm('是否重置密码 ? 重置后的密码为 yf_123456', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$axios({
|
|
|
+ method: 'POST',
|
|
|
+ url: '/api/api_gateway?method=user.login.admin_changepwd',
|
|
|
+ data: this.qs.stringify({
|
|
|
+ uid: this.tableRadio.uid
|
|
|
})
|
|
|
- }
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.message == '') {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功!'
|
|
|
+ })
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
|
message: '取消重置密码!'
|
|
|
})
|
|
|
})
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先选择用户!'
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
+ testUser() {
|
|
|
+ if(this.tableRadio){
|
|
|
+ this.$axios({
|
|
|
+ method: "POST",
|
|
|
+ url: "/api/api_gateway?method=user.login.user_add_package_time",
|
|
|
+ data: this.qs.stringify({
|
|
|
+ uid:this.tableRadio.uid,
|
|
|
+ user_test: 1,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.message == "") {
|
|
|
+ this.$message.success("激活成功");
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先选择用户!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
},
|
|
|
filters: {
|
|
|
@@ -889,10 +951,10 @@ export default {
|
|
|
text-align: center;
|
|
|
}
|
|
|
/deep/.el-table th{
|
|
|
- background-color: #f6f6f6;
|
|
|
+ background-color: #232733;
|
|
|
}
|
|
|
/deep/.el-table thead{
|
|
|
- color: #373737;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
.greenState{
|
|
|
color: green;
|