diff --git a/src/api/user/user.js b/src/api/user/user.js index 2ec7653..013a8be 100644 --- a/src/api/user/user.js +++ b/src/api/user/user.js @@ -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) { diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 2f3b9ef..cd83642 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -167,6 +167,7 @@ aside { cursor: pointer; &:hover { + text-decoration: underline; color: rgb(32, 160, 255); } } diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 6027f04..0c25940 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -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("修改成功"); diff --git a/src/views/system/fee/index.vue b/src/views/system/fee/index.vue index 83a73be..87469e0 100644 --- a/src/views/system/fee/index.vue +++ b/src/views/system/fee/index.vue @@ -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() { diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 745a1c3..093012e 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -145,7 +145,13 @@ - + + + + {{ appUserNameFormatter(scope.row.appUserName) }} + + + + + + + + + + {{ formatRealName(user) }} - {{ user.phonenumber }} - {{user.appName}} + 解绑 + + + + + + + + + + + 绑定 + + + + + + + { + 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 { } }; + diff --git a/src/views/user/user/index.vue b/src/views/user/user/index.vue index 81e13f1..fd34466 100644 --- a/src/views/user/user/index.vue +++ b/src/views/user/user/index.vue @@ -56,48 +56,48 @@ - - 新增 - - - 修改 - - - 删除 - - - 导入 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - 修改 - handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']"> - 更多 - - 重置密码 - 绑定系统用户 - - - - + + + + + + + + + + + + + + + + + + + + + + + +