商户查看用户手机号

This commit is contained in:
墨大叔 2024-10-14 18:03:44 +08:00
parent 68026a0204
commit 9c8c32ccee
5 changed files with 274 additions and 62 deletions

View File

@ -0,0 +1,25 @@
<template>
<div class="group-title">{{title}}</div>
</template>
<script>
export default {
name: 'GroupTitle',
props: {
title: {
type: String,
default: null
}
}
}
</script>
<style scoped lang="scss">
.group-title {
position: relative;
font-size: 16px;
padding-left: 0.5em;
border-left: 3px solid #00BA88;
margin: 0.5em 0 1em;
}
</style>

View File

@ -154,6 +154,13 @@
<el-descriptions-item label="商户手机号">{{detail.mchMobile | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="店铺名称">{{detail.storeName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="店铺地址">{{detail.storeAddress | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="商户查看手机号功能开启状态">
<boolean-tag :value="detail.mchShowMobile" true-text="已开启" false-text="未开启" size="small"/>
</el-descriptions-item>
<el-descriptions-item label="商户查看手机号价格">{{detail.mchShowMobilePrice | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="商户查看手机号状态">
<dict-tag :value="detail.mchShowMobileStatus" :options="dict.type.recharge_mch_show_mobile_status" size="small"/>
</el-descriptions-item>
</el-descriptions>
</el-card>
</el-col>
@ -194,7 +201,17 @@ export default {
name: 'Recharge/:billId',
mixins: [$recharge],
components: { BooleanTag, RefundDialog, Bonus, PayBill, UserLink, DeviceLink, Refund },
dicts: ['channel_type','sm_transaction_bill_status', 'sm_transaction_bill_device_recharge_status', 'time_unit', 'suit_fee_mode', 'suit_fee_type', 'recharge_close_status', 'device_service_mode'],
dicts: [
'channel_type',
'sm_transaction_bill_status',
'sm_transaction_bill_device_recharge_status',
'time_unit',
'suit_fee_mode',
'suit_fee_type',
'recharge_close_status',
'device_service_mode',
'recharge_mch_show_mobile_status'
],
computed: {
DeviceServiceMode() {
return DeviceServiceMode

View File

@ -0,0 +1,175 @@
<template>
<el-dialog :visible.sync="visible" width="700px" title="用户配置" @open="onOpen">
<el-form ref="form" :model="form" :rules="rules" label-width="80px" v-loading="loading">
<el-row v-if="showCurrent">
<form-col :span="span" label="当前用户" label-width="5em">
{{form.realOrUserName | defaultValue}}
</form-col>
</el-row>
<el-row>
<group-title title="订单显示用户手机号"/>
<form-col :span="8" label="是否开启" label-width="11">
<el-switch v-model="form.showBillMobile" active-text="开启" inactive-text="不开启"/>
</form-col>
<form-col :span="16" label="单价" prop="showBillMobilePrice" v-if="form.showBillMobile">
<el-input v-model="form.showBillMobilePrice" :min="0" type="number" placeholder="请输入单价">
<template #append> / </template>
</el-input>
</form-col>
</el-row>
<el-row>
<group-title title="风控配置"/>
<form-col :span="span * 2" label="充值延迟到账时长" prop="arrivalDelay" label-width="9em">
<el-input v-model="form.arrivalDelay" placeholder="请输入到账延迟时长">
<template #append>小时</template>
</el-input>
</form-col>
</el-row>
<el-row>
<form-col :span="8" label="限制提现" prop="limitWithdraw">
<el-switch v-model="form.limitWithdraw" active-text="限制" inactive-text="不限制"/>
</form-col>
<template v-if="form.limitWithdraw">
<form-col :span="16" label="限制提现至" prop="limitWithdrawTime" label-width="6em">
<el-date-picker type="datetime" v-model="form.limitWithdrawTime" placeholder="请选择限制提现时间(为空则为永久)" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" style="width: 100%"/>
</form-col>
<form-col :span="24" label="限制原因" prop="limitWithdraw">
<el-input v-model="form.limitWithdrawReason" type="textarea" placeholder="请输入限制提现的原因(展示给用户查看)" show-word-limit maxlength="200"/>
</form-col>
</template>
</el-row>
<el-row>
<form-col :span="8" label="限制退款" prop="limitRefund">
<el-switch v-model="form.limitRefund" active-text="限制" inactive-text="不限制"/>
</form-col>
<template v-if="form.limitRefund">
<form-col :span="16" label="限制退款至" prop="limitRefundTime" label-width="6em">
<el-date-picker type="datetime" v-model="form.limitRefundTime" placeholder="请选择限制退款时间(为空则为永久)" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" style="width: 100%"/>
</form-col>
<form-col :span="24" label="限制原因" prop="limitRefundReason">
<el-input v-model="form.limitRefundReason" type="textarea" placeholder="请输入限制退款的原因(展示给用户查看)" show-word-limit maxlength="200"/>
</form-col>
</template>
</el-row>
<el-row>
<group-title title="其他设置"/>
<form-col :span="8" label="是否为设备管理员" label-width="11" prop="deviceAdmin">
<el-switch v-model="form.deviceAdmin" active-text="" inactive-text="" @change="onChangeDeviceAdmin"/>
</form-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :loading="submitLoading"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getSmUser, updateSmUser } from '@/api/system/smUser'
import LineField from '@/components/LineField/index.vue'
import GroupTitle from '@/components/GroupTitle/index.vue'
export default {
name: "UserConfigDialog",
components: { GroupTitle, LineField },
props: {
show: {
type: Boolean,
default: false,
},
userId: {
type: String,
default: null,
},
showCurrent: {
type: Boolean,
default: false,
}
},
computed: {
visible: {
set(val) {
this.$emit('update:show', val);
},
get() {
return this.show;
}
}
},
data() {
return {
span: 12,
form: {},
rules: {
showBillMobilePrice: [
{ required: true, message: '请输入单价', trigger: 'blur' }
]
},
loading: false,
submitLoading: false,
}
},
methods: {
onOpen() {
if (this.userId != null) {
this.loading = true;
getSmUser(this.userId).then(response => {
this.form = response.data;
}).finally(() => {
this.loading = false;
})
} else {
this.reset();
}
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.userId != null) {
this.submitLoading = true;
updateSmUser(this.form).then(res => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit('success');
}).finally(() => {
this.submitLoading = false;
})
}
}
});
},
//
cancel() {
this.visible = false;
this.reset();
},
//
reset() {
this.form = {
userId: this.userId,
};
this.resetForm("form");
},
//
onChangeDeviceAdmin(val) {
if (val) {
this.$confirm('【高危操作】是否确认设置用户为设备管理员?<br/>用户将可以通过微信小程序注册设备!', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.form.deviceAdmin = true;
}).catch((e) => {
this.form.deviceAdmin = false;
});
}
},
}
}
</script>

View File

@ -3,13 +3,22 @@
<template v-if="userData != null">
<el-row :gutter="12">
<el-col :lg="10" :md="12" :xs="24">
<el-card class="box-card" header="用户详情">
<el-card class="box-card">
<template #header>
<el-row type="flex" style="justify-content: space-between">
<div>用户详情</div>
<div>
<el-button type="text" icon="el-icon-setting" size="small" style="padding: 5px 0 0;" @click="showConfigDialog = true">用户配置</el-button>
</div>
</el-row>
</template>
<div class="user-detail">
<div class="user-header">
<el-avatar :size="64" :src="userData.avatar"></el-avatar>
<el-row type="flex" class="name-box">
<span class="user-name">{{userData.nickName}}</span>
<el-tag type="primary" style="margin-left: 8px;" v-if="userData.isMch">商户</el-tag>
<dict-tag :value="userData.type" :options="dict.type.sm_user_type"/>
</el-row>
<div class="phone-number">{{userData.phonenumber}}</div>
</div>
@ -102,6 +111,10 @@
</el-card>
</template>
<el-empty v-else description="用户不存在"/>
<!--用户设置-->
<user-config-dialog :show.sync="showConfigDialog" :user-id="userData.userId" @success="getDetail"/>
</div>
</template>
@ -122,13 +135,18 @@ import Recharge from '@/views/system/recharge/index.vue'
import BooleanTag from '@/components/BooleanTag/index.vue'
import Withdraw from '@/views/system/withdraw/index.vue'
import RealName from '@/views/ss/realName/index.vue'
import UserConfigDialog from '@/views/system/smUser/components/UserConfigDialog.vue'
import { SmUserType } from '@/utils/constants'
export default {
name: 'User/:userId',
mixins: [$view, $serviceType],
components: { RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
components: { UserConfigDialog, RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
dicts: ['sm_user_type', 'service_type', 'withdraw_service_type'],
computed: {
SmUserType() {
return SmUserType
},
serviceUnit() {
return (type) => {
return type === '2' ? '元' : '%';
@ -139,13 +157,14 @@ export default {
return {
userData: {},
loading: false,
showConfigDialog: false,
}
},
created() {
this.initData();
this.getDetail();
},
methods: {
initData() {
getDetail() {
this.loading = true;
getSmUser(this.$route.params.userId).then(response => {
this.userData = response.data;

View File

@ -151,7 +151,7 @@
</template>
</el-table-column>
</template>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
<el-table-column label="操作" align="center" min-width="200" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
@ -160,13 +160,6 @@
@click="handleSee(scope.row)"
v-hasPermi="['system:smUser:detail']"
>详情</el-button>
<el-button
type="text"
icon="el-icon-refresh"
size="mini"
@click="handleResetService(scope.row)"
v-hasPermi="['system:smUser:edit']"
>重置服务费</el-button>
<el-button
size="mini"
type="text"
@ -181,6 +174,20 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:smUser:remove']"
>删除</el-button>
<el-button
type="text"
icon="el-icon-refresh"
size="mini"
@click="handleResetService(scope.row)"
v-hasPermi="['system:smUser:edit']"
>重置服务费</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-setting"
@click="handleUpdateRisk(scope.row)"
v-hasPermi="['system:smUser:edit']"
>配置</el-button>
</template>
</el-table-column>
</el-table>
@ -194,7 +201,7 @@
/>
<!-- 添加或修改普通用户信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<form-col :span="span" label="用户头像" prop="avatar">
@ -208,9 +215,6 @@
<form-col :span="span" label="用户名称" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" :maxlength="20" ></el-input>
</form-col>
<!-- <form-col :span="span" label="用户昵称" prop="nickName">-->
<!-- <el-input v-model="form.nickName" placeholder="请输入用户昵称" :maxlength="20" ></el-input>-->
<!-- </form-col>-->
<form-col :span="span" label="手机号" prop="phonenumber">
<el-input v-model="form.phonenumber" placeholder="请输入手机号" :maxlength="11" show-word-limit
clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
@ -218,7 +222,9 @@
<form-col :span="span" label="密码" prop="password">
<el-input v-model="form.password" placeholder="请输入密码,为空则不修改" type="password" :maxlength="32" show-word-limit show-password/>
</form-col>
<form-col :span="span" label="商户服务费" prop="serviceRate" label-width="7em">
</el-row>
<el-row>
<form-col :span="span" label="商户服务费" prop="serviceRate" label-width="6em">
<el-input v-model="form.serviceRate" placeholder="请输入平台收取商户服务费" type="number">
<template #append>%</template>
</el-input>
@ -228,7 +234,7 @@
<template #append>%</template>
</el-input>
</form-col>
<form-col :span="span * 2" label="提现服务费" prop="withdrawServiceRate" label-width="7em">
<form-col :span="span * 2" label="提现服务费" prop="withdrawServiceRate" label-width="6em">
<el-input v-model="form.withdrawServiceRate" placeholder="请输入提现服务费" type="number">
<template #prepend>
<el-select v-model="form.withdrawServiceType" placeholder="请选择提现服务费收取方式" style="width: 10em">
@ -246,32 +252,6 @@
<form-col :span="span * 2" label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" :maxlength="500" show-word-limit type="textarea"/>
</form-col>
<form-col :span="24" label="延迟到账" prop="arrivalDelay">
<el-input v-model="form.arrivalDelay" placeholder="请输入到账延迟时长">
<template #append>小时</template>
</el-input>
</form-col>
<form-col :span="8" label="限制提现" prop="limitWithdraw">
<el-switch v-model="form.limitWithdraw" active-text="限制" inactive-text="不限制"/>
</form-col>
<form-col :span="16" label="限制提现至" prop="limitWithdrawTime" label-width="6em">
<el-date-picker type="datetime" v-model="form.limitWithdrawTime" placeholder="请选择限制提现时间(为空则为永久)" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" style="width: 100%"/>
</form-col>
<form-col :span="24" label="限制原因" prop="limitWithdraw">
<el-input v-model="form.limitWithdrawReason" type="textarea" placeholder="请输入限制提现的原因(展示给用户查看)" show-word-limit maxlength="200"/>
</form-col>
<form-col :span="8" label="限制退款" prop="limitRefund">
<el-switch v-model="form.limitRefund" active-text="限制" inactive-text="不限制"/>
</form-col>
<form-col :span="16" label="限制退款至" prop="limitRefundTime" label-width="6em">
<el-date-picker type="datetime" v-model="form.limitRefundTime" placeholder="请选择限制退款时间(为空则为永久)" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" style="width: 100%"/>
</form-col>
<form-col :span="24" label="限制原因" prop="limitRefundReason">
<el-input v-model="form.limitRefundReason" type="textarea" placeholder="请输入限制退款的原因(展示给用户查看)" show-word-limit maxlength="200"/>
</form-col>
<form-col :span="span" label="是否设备管理员" prop="deviceAdmin" label-width="9em">
<el-switch v-model="form.deviceAdmin" active-text="" inactive-text="" @change="onChangeDeviceAdmin"/>
</form-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
@ -279,6 +259,10 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!--用户设置-->
<user-config-dialog :show.sync="showConfigDialog" :user-id="row.userId" @success="getList" show-current/>
</div>
</template>
@ -289,12 +273,12 @@ import {
addSmUser,
updateSmUser,
delSmUser,
updateServiceRate,
resetSmUserService
} from '@/api/system/smUser'
import { $serviceType, $showColumns, $withdrawServiceType } from '@/utils/mixins'
import UserLink from '@/components/Business/SmUser/UserLink.vue'
import { SmUserType } from '@/utils/constants'
import UserConfigDialog from '@/views/system/smUser/components/UserConfigDialog.vue'
const defaultSort = {
prop: "createTime",
@ -304,7 +288,7 @@ const defaultSort = {
export default {
name: "SmUser",
mixins: [$showColumns, $serviceType, $withdrawServiceType],
components: { UserLink },
components: { UserConfigDialog, UserLink },
dicts: ['sm_user_status', 'sm_user_type', 'sys_user_sex', 'service_type', 'withdraw_service_type'],
computed: {
SmUserType() {
@ -318,6 +302,8 @@ export default {
},
data() {
return {
showConfigDialog: false,
row: {}, // row
defaultSort,
span: 12,
columns: [
@ -406,20 +392,6 @@ export default {
})
})
},
onChangeDeviceAdmin(val) {
if (val) {
this.$confirm('【高危操作】是否确认设置用户为设备管理员?<br/>用户将可以通过微信小程序注册设备!', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.form.deviceAdmin = true;
}).catch((e) => {
this.form.deviceAdmin = false;
});
}
},
onSortChange(column) {
if (column.order == null) {
this.queryParams.orderByColumn = defaultSort.prop;
@ -506,6 +478,10 @@ export default {
this.title = "修改用户信息";
});
},
handleUpdateRisk(row) {
this.row = row;
this.showConfigDialog = true;
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {