1.管理员列表中-绑定app用户
This commit is contained in:
parent
e4c9da15a6
commit
a4c71feb8c
|
@ -55,6 +55,16 @@ export function bandSystemUser(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 解绑系统用户
|
||||
export function unbindSystemUser(data) {
|
||||
return request({
|
||||
url: '/user/user/unbindSystemUser',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 删除用户
|
||||
export function delUser(userId) {
|
||||
|
|
|
@ -167,6 +167,7 @@ aside {
|
|||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: rgb(32, 160, 255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -732,9 +732,6 @@ export default {
|
|||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// console.log("this.appUserId=====",this.appUserId)
|
||||
// console.log("this.form.appUserId=====",this.form.appUserId)
|
||||
// this.form.appUserId = this.appUserId
|
||||
if (this.form.deptId != undefined) {
|
||||
updateDept(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
|
|
|
@ -358,7 +358,7 @@ export default {
|
|||
userName: undefined,
|
||||
loading: true,
|
||||
ids: [],
|
||||
returnVerify: '',
|
||||
returnVerify: '0',
|
||||
single: true,
|
||||
// 运营区下拉框
|
||||
areaOptions: [],
|
||||
|
@ -375,31 +375,31 @@ export default {
|
|||
name: null,
|
||||
status: null,
|
||||
},
|
||||
time1:'',
|
||||
time1:'24',
|
||||
time2:'',
|
||||
form: {
|
||||
name: '',
|
||||
instructions: '',
|
||||
instructions: '按小时计费',
|
||||
status: "正常",
|
||||
autoRefundDeposit: '',
|
||||
autoRefundDeposit: '0',
|
||||
orderExceedMinutes: '',
|
||||
orderExceedWarn: '',
|
||||
freeRideTime: '',
|
||||
freeRideTime: '5',
|
||||
rentalUnit: 'minutes',
|
||||
ridingRule: '1',
|
||||
chargingCycle: '',
|
||||
chargingCycleValue: '',
|
||||
cappedAmount: '',
|
||||
chargingCycle: '1',
|
||||
chargingCycleValue: '24',
|
||||
cappedAmount: '200',
|
||||
rule: [{ start: '', end: '', eachUnit: '', fee: '' }],
|
||||
timeoutTime: '',
|
||||
startingTime: ''
|
||||
// chargingCycle: 1, // 默认选择第一个选项
|
||||
// chargingCycleValue: '', // 对应的值
|
||||
},
|
||||
timeoutTime: '',
|
||||
startingPrice: '',
|
||||
startingTime: '',
|
||||
timeoutPrice: '',
|
||||
timeoutTime: '1',
|
||||
startingPrice: '5',
|
||||
startingTime: '1',
|
||||
timeoutPrice: '5',
|
||||
enablelnterval: false,
|
||||
rule: [{ start: '', end: '', eachUnit: '', fee: '' }],
|
||||
more: { start: '', end: '9999', eachUnit: '', fee: '' },
|
||||
|
@ -529,26 +529,26 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
name: '',
|
||||
instructions: '',
|
||||
instructions: '按小时计费',
|
||||
status: "正常",
|
||||
autoRefundDeposit: '',
|
||||
autoRefundDeposit: '0',
|
||||
orderExceedMinutes: '',
|
||||
orderExceedWarn: '',
|
||||
freeRideTime: '',
|
||||
freeRideTime: '5',
|
||||
rentalUnit: 'minutes',
|
||||
ridingRule: '1',
|
||||
chargingCycle: '',
|
||||
chargingCycleValue: '',
|
||||
cappedAmount: '',
|
||||
chargingCycle: '1',
|
||||
chargingCycleValue: '24',
|
||||
cappedAmount: '200',
|
||||
areaId: null
|
||||
}
|
||||
this.enablelnterval = false,
|
||||
this.more = { start: '', end: '9999', eachUnit: '', fee: '' }
|
||||
this.rule = [{ start: '', end: '', eachUnit: '', fee: '' }],
|
||||
this.timeoutTime = '',
|
||||
this.startingPrice = '',
|
||||
this.startingTime = '',
|
||||
this.timeoutPrice = '',
|
||||
this.timeoutTime = '60',
|
||||
this.startingPrice = '5',
|
||||
this.startingTime = '60',
|
||||
this.timeoutPrice = '5',
|
||||
this.resetForm("form")
|
||||
},
|
||||
handleQuery() {
|
||||
|
|
|
@ -145,7 +145,13 @@
|
|||
<el-table-column label="运营区" align="center" key="areaName" prop="areaName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="运营商" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
||||
<el-table-column label="关联APP用户" align="center" key="appUserName" prop="appUserName" v-if="columns[5].visible" width="120" />
|
||||
<el-table-column label="关联APP用户" align="center" key="appUserName" prop="appUserName" v-if="columns[5].visible" width="120" >
|
||||
<template slot-scope="scope">
|
||||
<span class="link-type" @click="handleBandSysUser(scope.row.userId)">
|
||||
{{ appUserNameFormatter(scope.row.appUserName) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
|
@ -286,6 +292,57 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 绑定系统用户对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open2" width="600px" append-to-body>
|
||||
<el-form label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div v-for="user in appUserList" :key="user.phonenumber" class="user-item">
|
||||
<span style="padding-right: 10px">{{ formatRealName(user) }} - {{ user.phonenumber }} - {{user.appName}}</span>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="unbindUser(user.userId)"
|
||||
style="margin-left: 10px;"
|
||||
class="link-type"
|
||||
>解绑</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="绑定app用户" prop="appUserId" label-width="100">
|
||||
<el-select
|
||||
ref="headerSearchSelect"
|
||||
v-model="appUserId"
|
||||
:remote-method="queryPhonenumber"
|
||||
filterable
|
||||
default-first-option
|
||||
remote
|
||||
:loading="loading2"
|
||||
placeholder="输入手机号搜索"
|
||||
class="header-search-select" >
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label+'---'+item.appName"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="success"
|
||||
@click="submitBand()"
|
||||
style="margin-left: 10px;color: #FFFFFF"
|
||||
class="link-type"
|
||||
>绑定</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel2">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload
|
||||
|
@ -324,6 +381,7 @@ import { getToken } from "@/utils/auth";
|
|||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import { listArea } from '@/api/system/area'
|
||||
import { bandSystemUser, fastSearch, unbindSystemUser } from '@/api/user/user'
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
|
@ -336,6 +394,9 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
loading2: false,
|
||||
appUserId: null,
|
||||
userName: undefined,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
|
@ -359,6 +420,7 @@ export default {
|
|||
deptOptions: undefined,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
open2: false,
|
||||
// 运营商名称
|
||||
deptName: undefined,
|
||||
// 默认密码
|
||||
|
@ -375,6 +437,7 @@ export default {
|
|||
children: "children",
|
||||
label: "label"
|
||||
},
|
||||
appUserList: [],
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(用户导入)
|
||||
|
@ -451,6 +514,74 @@ export default {
|
|||
});
|
||||
},
|
||||
methods: {
|
||||
formatRealName(user) {
|
||||
return user.realName ? user.realName : user.userName;
|
||||
},
|
||||
unbindUser(userId) {
|
||||
console.log(`取消绑定电话号码的用户: ${userId}`);
|
||||
unbindSystemUser({userId:userId}).then(response => {
|
||||
getUser(this.form.userId).then(response => {
|
||||
this.appUserList = response.data.users;
|
||||
console.log("this.appUserList",this.appUserList)
|
||||
this.$modal.msgSuccess("解绑成功");
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
queryPhonenumber(query) {
|
||||
console.log("query:",query)
|
||||
if (query !== '') {
|
||||
this.loading2 = true;
|
||||
setTimeout(() => {
|
||||
this.loading2 = false;
|
||||
fastSearch({"phonenumber":query}).then(response => {
|
||||
this.options = response.data;
|
||||
}
|
||||
);
|
||||
}, 200);
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
submitBand: function () {
|
||||
console.log("this.form.userId",this.form.userId)//系统用户
|
||||
console.log("this.appUserId",this.appUserId)//app用户
|
||||
let roles1 = this.form.roles
|
||||
console.log("this.form.roles",roles1)//app用户
|
||||
let role
|
||||
if(roles1 && roles1.length>0){
|
||||
let roleKey = roles1[0].roleKey
|
||||
if(roleKey == 'root'){
|
||||
role = '3';
|
||||
}else if(roleKey == 'repair'){
|
||||
role = '2';
|
||||
}
|
||||
}
|
||||
console.log("role",role)
|
||||
bandSystemUser({userId:this.appUserId,sysUserId:this.form.userId,role:role}).then(response => {
|
||||
getUser(this.form.userId).then(response => {
|
||||
this.appUserList = response.data.users;
|
||||
console.log("this.appUserList",this.appUserList)
|
||||
this.$modal.msgSuccess("绑定成功");
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
|
||||
/** 绑定系统用户 */
|
||||
handleBandSysUser(userId){
|
||||
this.reset();
|
||||
getUser(userId).then(response => {
|
||||
this.form = response.data;
|
||||
this.appUserList = response.data.users;
|
||||
console.log("this.appUserList",this.appUserList)
|
||||
this.open2 = true;
|
||||
this.title = "关联APP用户";
|
||||
});
|
||||
},
|
||||
appUserNameFormatter(value){
|
||||
return value ? value : '去绑定';
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -496,6 +627,11 @@ export default {
|
|||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 取消按钮
|
||||
cancel2() {
|
||||
this.open2 = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
|
@ -512,6 +648,7 @@ export default {
|
|||
postIds: [],
|
||||
roleIds: []
|
||||
};
|
||||
this.appUserId = undefined;
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
|
@ -663,3 +800,15 @@ export default {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.hover-style {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
color: blue;
|
||||
}
|
||||
.user-item{
|
||||
padding-left: 10px;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -56,48 +56,48 @@
|
|||
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:user:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:user:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
v-hasPermi="['system:user:import']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
<!-- v-hasPermi="['system:user:add']"-->
|
||||
<!-- >新增</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['system:user:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['system:user:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="info"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-upload2"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleImport"-->
|
||||
<!-- v-hasPermi="['system:user:import']"-->
|
||||
<!-- >导入</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
|
@ -145,30 +145,30 @@
|
|||
<dict-tag :options="dict.type.et_user_is_authentication" :value="scope.row.isAuthentication" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="240"
|
||||
class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>修改</el-button>
|
||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
|
||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
|
||||
v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
|
||||
<el-dropdown-item command="handleBandSysUser" icon="el-icon-circle-check"
|
||||
v-hasPermi="['system:user:edit']">绑定系统用户</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="操作"-->
|
||||
<!-- align="center"-->
|
||||
<!-- width="240"-->
|
||||
<!-- class-name="small-padding fixed-width">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-circle-check"-->
|
||||
<!-- @click="handleBandSysUser(scope.row)"-->
|
||||
<!-- v-hasPermi="['system:user:edit']"-->
|
||||
<!-- >绑定系统用户</el-button>-->
|
||||
<!-- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">-->
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>-->
|
||||
<!-- <el-dropdown-menu slot="dropdown">-->
|
||||
<!-- <el-dropdown-item command="handleResetPwd" icon="el-icon-key"-->
|
||||
<!-- v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item command="handleBandSysUser" icon="el-icon-circle-check"-->
|
||||
<!-- v-hasPermi="['system:user:edit']">绑定系统用户</el-dropdown-item>-->
|
||||
<!-- </el-dropdown-menu>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
|
Loading…
Reference in New Issue
Block a user