提交
This commit is contained in:
parent
a14e1841cc
commit
05ca0e6a45
|
@ -1,12 +1,20 @@
|
|||
<template>
|
||||
<el-col :span="span">
|
||||
<el-form-item :label="label" :prop="prop" :label-width="labelWidth">
|
||||
<el-form-item :prop="prop" :label-width="labelWidth">
|
||||
<template #label>
|
||||
<el-tooltip v-if="!isEmpty(tip)" :content="tip" placement="top">
|
||||
<i class="el-icon-question" style="margin-right: 5px;cursor: pointer"/>
|
||||
</el-tooltip>
|
||||
<span>{{label}}</span>
|
||||
</template>
|
||||
<slot></slot>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isEmpty } from '@/utils/index'
|
||||
|
||||
export default {
|
||||
name: 'FormCol',
|
||||
props: {
|
||||
|
@ -25,7 +33,14 @@ export default {
|
|||
labelWidth: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
tip: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
|||
pageSizes: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [10, 20, 30, 50]
|
||||
return [10, 20, 30, 50, 100]
|
||||
}
|
||||
},
|
||||
// 移动端页码按钮的数量端默认值5
|
||||
|
|
|
@ -206,9 +206,9 @@
|
|||
<el-tab-pane label="命令日志" :lazy="true">
|
||||
<command-log :query="{macList: macList}" :views="views.device"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="时长/电量变化" :lazy="true">
|
||||
<!-- <el-tab-pane label="时长/电量变化" :lazy="true">
|
||||
<record-time :query="{deviceId: deviceData.deviceId}" view="device"/>
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="抄表记录" :lazy="true">
|
||||
<reading-record :device-id="deviceData.deviceId"/>
|
||||
</el-tab-pane>
|
||||
|
|
169
src/views/system/smUser/components/UserFormDialog.vue
Normal file
169
src/views/system/smUser/components/UserFormDialog.vue
Normal file
|
@ -0,0 +1,169 @@
|
|||
<template>
|
||||
<el-dialog :title="title" :visible.sync="visible" width="700px" append-to-body @close="onClose">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<form-col :span="span" label="用户头像" prop="avatar">
|
||||
<image-upload v-model="form.avatar" :limit="1"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="用户类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择用户类型" style="width: 100%">
|
||||
<el-option v-for="item of dict.type.sm_user_type" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</form-col>
|
||||
<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="phonenumber">
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号" :maxlength="11" show-word-limit
|
||||
clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
|
||||
</form-col>
|
||||
<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>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<form-col :span="span" label="商户服务费" prop="serviceRate" label-width="8em" tip="平台收取商户的服务费">
|
||||
<el-input v-model="form.serviceRate" placeholder="请输入平台收取商户服务费" type="number">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<form-col :span="span" label="代理服务费" prop="agentServiceRate" label-width="9em" v-if="form.type === SmUserType.AGENT" tip="平台收取代理商的服务费">
|
||||
<el-input v-model="form.agentServiceRate" placeholder="请输入平台收取代理商服务费" type="number">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<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">
|
||||
<el-option
|
||||
v-for="dict in dict.type.withdraw_service_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #append>{{withdrawServiceUnit(form.withdrawServiceType)}}</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<form-col :span="span * 2" label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" :maxlength="500" show-word-limit type="textarea"/>
|
||||
</form-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addSmUser, getSmUser, updateSmUser } from '@/api/system/smUser'
|
||||
import { SmUserType } from '@/utils/constants'
|
||||
import { $withdrawServiceType } from '@/utils/mixins'
|
||||
|
||||
export default {
|
||||
name: "UserFormDialog",
|
||||
dicts: ['sm_user_status', 'sm_user_type', 'sys_user_sex', 'service_type', 'withdraw_service_type'],
|
||||
mixins: [$withdrawServiceType],
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
userId: {
|
||||
type: [Number, String],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
span: 12,
|
||||
title: '',
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: '请输入用户名称', trigger: 'blur' }
|
||||
],
|
||||
phonenumber: [
|
||||
{ required: true, message: '请输入手机号',trigger: 'blur'}
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择用户类型', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
SmUserType() {
|
||||
return SmUserType
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
handler(val) {
|
||||
this.visible = val
|
||||
if (val) {
|
||||
this.reset()
|
||||
if (this.userId) {
|
||||
this.getDetail()
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
this.form = {
|
||||
userId: null,
|
||||
userName: null,
|
||||
nickName: null,
|
||||
phonenumber: null,
|
||||
sex: "2",
|
||||
avatar: null,
|
||||
type: '1',
|
||||
deviceAdmin: false,
|
||||
serviceType: '1',
|
||||
withdrawServiceType: "1",
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form && this.$refs.form.clearValidate()
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
getSmUser(this.userId).then(response => {
|
||||
this.form = response.data
|
||||
this.title = "修改用户信息"
|
||||
})
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.userId != null) {
|
||||
updateSmUser(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.visible = false
|
||||
this.$emit('success')
|
||||
})
|
||||
} else {
|
||||
addSmUser(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.visible = false
|
||||
this.$emit('success')
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
onClose() {
|
||||
this.$emit('update:show', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -8,7 +8,22 @@
|
|||
<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>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-setting"
|
||||
size="small"
|
||||
style="padding: 5px 0 0"
|
||||
@click="showConfigDialog = true"
|
||||
>配置</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
size="small"
|
||||
style="padding: 5px 0 0"
|
||||
@click="showEditDialog = true"
|
||||
>编辑</el-button
|
||||
>
|
||||
</div>
|
||||
</el-row>
|
||||
</template>
|
||||
|
@ -18,19 +33,57 @@
|
|||
<el-avatar :size="64" :src="detail.avatar"></el-avatar>
|
||||
<el-row type="flex" class="name-box">
|
||||
<span class="user-name">{{ detail.realOrUserName }}</span>
|
||||
<dict-tag :value="detail.type" :options="dict.type.sm_user_type"/>
|
||||
<dict-tag
|
||||
:value="detail.type"
|
||||
:options="dict.type.sm_user_type"
|
||||
/>
|
||||
</el-row>
|
||||
<div class="phone-number">{{ detail.phonenumber }}</div>
|
||||
</div>
|
||||
|
||||
<el-row type="flex" style="margin-top: 16px;">
|
||||
<el-statistic title="店铺数" :value="detail.storeCount" :precision="0" suffix="家"/>
|
||||
<el-statistic title="设备数" :value="detail.deviceCount" :precision="0" suffix="台"/>
|
||||
<el-statistic title="账户余额" :value="detail.balance" :precision="2" suffix="元"/>
|
||||
<el-statistic title="总收入" :value="detail.totalIncome" :precision="2" suffix="元"/>
|
||||
<el-statistic title="未入账" :value="detail.waitBonusAmount" :precision="2" suffix="元"/>
|
||||
<el-statistic title="总提现" :value="detail.withDrawlAmount" :precision="2" suffix="元"/>
|
||||
<el-statistic title="总消费" :value="detail.rechargeAmount" :precision="2" suffix="元"/>
|
||||
<el-row type="flex" style="margin-top: 16px">
|
||||
<el-statistic
|
||||
title="店铺数"
|
||||
:value="detail.storeCount"
|
||||
:precision="0"
|
||||
suffix="家"
|
||||
/>
|
||||
<el-statistic
|
||||
title="设备数"
|
||||
:value="detail.deviceCount"
|
||||
:precision="0"
|
||||
suffix="台"
|
||||
/>
|
||||
<el-statistic
|
||||
title="账户余额"
|
||||
:value="detail.balance"
|
||||
:precision="2"
|
||||
suffix="元"
|
||||
/>
|
||||
<el-statistic
|
||||
title="总收入"
|
||||
:value="detail.totalIncome"
|
||||
:precision="2"
|
||||
suffix="元"
|
||||
/>
|
||||
<el-statistic
|
||||
title="未入账"
|
||||
:value="detail.waitBonusAmount"
|
||||
:precision="2"
|
||||
suffix="元"
|
||||
/>
|
||||
<el-statistic
|
||||
title="总提现"
|
||||
:value="detail.withDrawlAmount"
|
||||
:precision="2"
|
||||
suffix="元"
|
||||
/>
|
||||
<el-statistic
|
||||
title="总消费"
|
||||
:value="detail.rechargeAmount"
|
||||
:precision="2"
|
||||
suffix="元"
|
||||
/>
|
||||
</el-row>
|
||||
|
||||
<div class="user-description">
|
||||
|
@ -42,22 +95,34 @@
|
|||
{{ detail.agentServiceRate | money | defaultValue }} %
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="提现服务费">
|
||||
<template v-if="detail.withdrawServiceRate == null || detail.withdrawServiceType == null">跟随渠道</template>
|
||||
<template
|
||||
v-if="
|
||||
detail.withdrawServiceRate == null ||
|
||||
detail.withdrawServiceType == null
|
||||
"
|
||||
>跟随渠道</template
|
||||
>
|
||||
<template v-else>
|
||||
<dict-tag :options="dict.type.withdraw_service_type" :value="detail.withdrawServiceType" size="mini"/>
|
||||
{{detail.withdrawServiceRate}} {{serviceUnit(detail.withdrawServiceType)}}
|
||||
<dict-tag
|
||||
:options="dict.type.withdraw_service_type"
|
||||
:value="detail.withdrawServiceType"
|
||||
size="mini"
|
||||
/>
|
||||
{{ detail.withdrawServiceRate }}
|
||||
{{ serviceUnit(detail.withdrawServiceType) }}
|
||||
</template>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="实名认证">
|
||||
<boolean-tag :value="detail.isReal" size="small" />
|
||||
<el-link
|
||||
v-if="detail.isReal"
|
||||
style="margin-left: 4px;"
|
||||
style="margin-left: 4px"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-link"
|
||||
@click="handleResetRealName"
|
||||
>解除实名</el-link>
|
||||
>解除实名</el-link
|
||||
>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">
|
||||
{{ detail.realName | defaultValue }}
|
||||
|
@ -68,7 +133,9 @@
|
|||
<el-descriptions-item label="实名手机">
|
||||
{{ detail.realPhone | defaultValue }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{detail.remark | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{
|
||||
detail.remark | defaultValue
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -79,7 +146,10 @@
|
|||
<el-row type="flex">
|
||||
<el-tabs style="width: 100%">
|
||||
<el-tab-pane label="日报表" lazy>
|
||||
<user-daily-recharge-report v-if="detail.userId != null" :query="{arrivalId: detail.userId}"/>
|
||||
<user-daily-recharge-report
|
||||
v-if="detail.userId != null"
|
||||
:query="{ arrivalId: detail.userId }"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="月报表" lazy>
|
||||
<user-recharge-report :mch-id="detail.userId" />
|
||||
|
@ -93,10 +163,18 @@
|
|||
<el-card class="box-card">
|
||||
<el-tabs>
|
||||
<el-tab-pane label="商户设备列表" lazy>
|
||||
<device v-if="detail.userId != null" :query="{userId: detail.userId}" :view="views.user"/>
|
||||
<device
|
||||
v-if="detail.userId != null"
|
||||
:query="{ userId: detail.userId }"
|
||||
:view="views.user"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="代理设备列表" lazy>
|
||||
<device v-if="detail.userId != null" :query="{agentId: detail.userId}" :view="views.user"/>
|
||||
<device
|
||||
v-if="detail.userId != null"
|
||||
:query="{ agentId: detail.userId }"
|
||||
:view="views.user"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="店铺列表" lazy>
|
||||
<store :query="{ userId: detail.userId }" :view="views.user" />
|
||||
|
@ -111,16 +189,28 @@
|
|||
<recharge :query="{ mchId: detail.userId }" :view="views.mch" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="分成记录" lazy>
|
||||
<bonus :query="{arrivalId: detail.userId, arrivalTypes: BonusArrivalType.userList()}" :view="views.user"/>
|
||||
<bonus
|
||||
:query="{
|
||||
arrivalId: detail.userId,
|
||||
arrivalTypes: BonusArrivalType.userList(),
|
||||
}"
|
||||
:view="views.user"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="提现列表" lazy>
|
||||
<withdraw :query="{ userId: detail.userId }" :view="views.user" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="应收账" lazy>
|
||||
<receive-bill :query="{userId: detail.userId}" :view="views.user"/>
|
||||
<receive-bill
|
||||
:query="{ userId: detail.userId }"
|
||||
:view="views.user"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="账变记录" lazy>
|
||||
<record-balance :query="{userId: detail.userId}" :view="views.user"/>
|
||||
<record-balance
|
||||
:query="{ userId: detail.userId }"
|
||||
:view="views.user"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="风控记录" lazy>
|
||||
<risk :query="{ userId: detail.userId }" :view="views.user" />
|
||||
|
@ -132,7 +222,10 @@
|
|||
<real-name :query="{ userId: detail.userId }" :view="views.user" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="绑定记录" lazy>
|
||||
<bind-record :query="{userId: detail.userId}" :view="views.user"/>
|
||||
<bind-record
|
||||
:query="{ userId: detail.userId }"
|
||||
:view="views.user"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="收款账户" lazy>
|
||||
<account :query="{ userId: detail.userId }" :view="views.user" />
|
||||
|
@ -146,8 +239,18 @@
|
|||
<el-empty v-else description="用户不存在" />
|
||||
|
||||
<!--用户设置-->
|
||||
<user-config-dialog :show.sync="showConfigDialog" :user-id="detail.userId" @success="getDetail"/>
|
||||
<user-config-dialog
|
||||
:show.sync="showConfigDialog"
|
||||
:user-id="detail.userId"
|
||||
@success="getDetail"
|
||||
/>
|
||||
|
||||
<!--用户编辑-->
|
||||
<user-form-dialog
|
||||
:show.sync="showEditDialog"
|
||||
:user-id="detail.userId"
|
||||
@success="getDetail"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -176,12 +279,35 @@ import UserDailyRechargeReport from '@/views/system/smUser/components/UserDailyR
|
|||
import Bonus from '@/views/ss/bonus/index.vue'
|
||||
import RiskInfo from '@/views/ss/riskInfo/index.vue'
|
||||
import BindRecord from '@/views/system/bindRecord/index.vue'
|
||||
|
||||
import UserFormDialog from '@/views/system/smUser/components/UserFormDialog.vue'
|
||||
export default {
|
||||
name: 'User/:userId',
|
||||
mixins: [$view, $serviceType],
|
||||
dicts: ['sm_user_type', 'service_type', 'withdraw_service_type'],
|
||||
components: { BindRecord, RiskInfo, Bonus, UserDailyRechargeReport, Risk, ReceiveBill, UserConfigDialog, RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
|
||||
components: {
|
||||
BindRecord,
|
||||
RiskInfo,
|
||||
Bonus,
|
||||
UserDailyRechargeReport,
|
||||
Risk,
|
||||
ReceiveBill,
|
||||
UserConfigDialog,
|
||||
RealName,
|
||||
Withdraw,
|
||||
BooleanTag,
|
||||
Recharge,
|
||||
Device,
|
||||
Suit,
|
||||
Account,
|
||||
RecordBalance,
|
||||
Store,
|
||||
Access,
|
||||
UserRechargeReport,
|
||||
UserAccount,
|
||||
UserDevice,
|
||||
LineChart,
|
||||
UserFormDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
BonusArrivalType,
|
||||
|
@ -189,6 +315,7 @@ export default {
|
|||
detail: {},
|
||||
loading: false,
|
||||
showConfigDialog: false,
|
||||
showEditDialog: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -243,7 +370,7 @@ export default {
|
|||
.phone-number {
|
||||
font-size: 18px;
|
||||
line-height: 30px;
|
||||
color: #9B9B9B;
|
||||
color: #9b9b9b;
|
||||
}
|
||||
.user-header {
|
||||
text-align: center;
|
||||
|
|
|
@ -224,78 +224,22 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改普通用户信息对话框 -->
|
||||
<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">
|
||||
<image-upload v-model="form.avatar" :limit="1"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="用户类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择用户类型" style="width: 100%">
|
||||
<el-option v-for="item of dict.type.sm_user_type" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</form-col>
|
||||
<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="phonenumber">
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号" :maxlength="11" show-word-limit
|
||||
clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>
|
||||
</form-col>
|
||||
<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>
|
||||
</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>
|
||||
</form-col>
|
||||
<form-col :span="span" label="代理服务费" prop="agentServiceRate" label-width="7em" v-if="form.type === SmUserType.AGENT">
|
||||
<el-input v-model="form.agentServiceRate" placeholder="请输入平台收取代理商服务费" type="number">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<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">
|
||||
<el-option
|
||||
v-for="dict in dict.type.withdraw_service_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #append>{{withdrawServiceUnit(form.withdrawServiceType)}}</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<form-col :span="span * 2" label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" :maxlength="500" show-word-limit type="textarea"/>
|
||||
</form-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--用户设置-->
|
||||
<user-config-dialog :show.sync="showConfigDialog" :user-id="row.userId" @success="getList" show-current/>
|
||||
|
||||
<!-- 添加或修改普通用户信息对话框 -->
|
||||
<user-form-dialog
|
||||
:show.sync="open"
|
||||
:user-id="userId"
|
||||
@success="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listSmUser,
|
||||
getSmUser,
|
||||
addSmUser,
|
||||
updateSmUser,
|
||||
delSmUser,
|
||||
resetSmUserService
|
||||
} from '@/api/system/smUser'
|
||||
|
@ -304,6 +248,7 @@ import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
|||
import { SmUserType } from '@/utils/constants'
|
||||
import UserConfigDialog from '@/views/system/smUser/components/UserConfigDialog.vue'
|
||||
import BooleanTag from '@/components/BooleanTag/index.vue'
|
||||
import UserFormDialog from './components/UserFormDialog.vue'
|
||||
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
|
@ -313,7 +258,7 @@ const defaultSort = {
|
|||
export default {
|
||||
name: "SmUser",
|
||||
mixins: [$showColumns, $serviceType, $withdrawServiceType],
|
||||
components: { BooleanTag, UserConfigDialog, UserLink },
|
||||
components: { BooleanTag, UserConfigDialog, UserLink, UserFormDialog },
|
||||
dicts: ['sm_user_status', 'sm_user_type', 'sys_user_sex', 'service_type', 'withdraw_service_type'],
|
||||
computed: {
|
||||
SmUserType() {
|
||||
|
@ -384,20 +329,7 @@ export default {
|
|||
realOrUserName: null,
|
||||
deviceAdmin: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: '请输入用户名称', trigger: 'blur' }
|
||||
],
|
||||
phonenumber: [
|
||||
{ required: true, message: '请输入手机号',trigger: 'blur'}
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择用户类型', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
userId: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -452,46 +384,9 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
userId: null,
|
||||
userName: null,
|
||||
nickName: null,
|
||||
phonenumber: null,
|
||||
sex: "2",
|
||||
avatar: null,
|
||||
type: '1',
|
||||
deviceAdmin: false,
|
||||
serviceType: '1',
|
||||
withdrawServiceType: "1",
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.userId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.userId = null;
|
||||
this.open = true;
|
||||
this.title = "添加用户信息";
|
||||
},
|
||||
|
@ -501,38 +396,14 @@ export default {
|
|||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const userId = row.userId || this.ids
|
||||
getSmUser(userId).then(response => {
|
||||
this.form = response.data;
|
||||
this.userId = row.userId || this.ids;
|
||||
this.open = true;
|
||||
this.title = "修改用户信息";
|
||||
});
|
||||
},
|
||||
handleUpdateRisk(row) {
|
||||
this.row = row;
|
||||
this.showConfigDialog = true;
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.userId != null) {
|
||||
updateSmUser(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addSmUser(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const userIds = row.userId || this.ids;
|
||||
|
@ -548,7 +419,23 @@ export default {
|
|||
this.download('system/smUser/export', {
|
||||
...this.queryParams
|
||||
}, `smUser_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.userId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user