部署
This commit is contained in:
parent
f99e9c442e
commit
ea2481dc5c
|
@ -72,7 +72,7 @@
|
||||||
<el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="ID" align="center" prop="storeId" width="50"/>
|
<el-table-column label="ID" align="center" prop="storeId" width="50"/>
|
||||||
<el-table-column label="绑定用户" align="center" prop="userName" />
|
<el-table-column label="所属用户" align="center" prop="userName" />
|
||||||
<el-table-column label="商户图片" align="center" prop="picture" width="100">
|
<el-table-column label="商户图片" align="center" prop="picture" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<image-preview :src="scope.row.picture" :width="50" :height="50"/>
|
<image-preview :src="scope.row.picture" :width="50" :height="50"/>
|
||||||
|
@ -134,7 +134,7 @@
|
||||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body :close-on-click-modal="false">
|
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body :close-on-click-modal="false">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row :gutter="8">
|
<el-row :gutter="8">
|
||||||
<form-col label="绑定用户" prop="userId" :span="span * 2">
|
<form-col label="所属用户" prop="userId" :span="span * 2">
|
||||||
<user-input v-model="form.userId" :query="userQuery"/>
|
<user-input v-model="form.userId" :query="userQuery"/>
|
||||||
</form-col>
|
</form-col>
|
||||||
<form-col label="店铺图片" prop="picture" :span="span * 2">
|
<form-col label="店铺图片" prop="picture" :span="span * 2">
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
<dict-tag :options="dict.type.sm_transaction_bill_type" :value="d.row.type"></dict-tag>
|
<dict-tag :options="dict.type.sm_transaction_bill_type" :value="d.row.type"></dict-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="对象" prop="userName"></el-table-column>
|
<el-table-column align="center" label="用户" prop="userName"></el-table-column>
|
||||||
<el-table-column align="center" label="金额" prop="arrivalAmount">
|
<el-table-column align="center" label="金额" prop="arrivalAmount">
|
||||||
<template slot-scope="d">{{d.row.arrivalAmount | money}}</template>
|
<template slot-scope="d">{{d.row.arrivalAmount | money}} 元</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,14 @@
|
||||||
<div>
|
<div>
|
||||||
<el-table v-loading="loading" :data="deviceList">
|
<el-table v-loading="loading" :data="deviceList">
|
||||||
<el-table-column align="center" type="index" label="#"></el-table-column>
|
<el-table-column align="center" type="index" label="#"></el-table-column>
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime"></el-table-column>
|
<el-table-column align="center" label="名称" prop="deviceName"></el-table-column>
|
||||||
<el-table-column label="缩略图" align="center" prop="picture" width="100">
|
<el-table-column label="图片" align="center" prop="picture" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<image-preview :src="scope.row.picture" :width="50" :height="50"/>
|
<image-preview :src="scope.row.picture" :width="50" :height="50"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="MAC" prop="mac"></el-table-column>
|
||||||
|
<el-table-column align="center" label="SN" prop="deviceNo"></el-table-column>
|
||||||
<el-table-column align="center" label="型号" prop="model"></el-table-column>
|
<el-table-column align="center" label="型号" prop="model"></el-table-column>
|
||||||
<el-table-column align="center" label="店铺" prop="storeName"></el-table-column>
|
<el-table-column align="center" label="店铺" prop="storeName"></el-table-column>
|
||||||
<el-table-column align="center" label="最近更新时间" prop="updateTime"></el-table-column>
|
<el-table-column align="center" label="最近更新时间" prop="updateTime"></el-table-column>
|
||||||
|
@ -16,6 +18,7 @@
|
||||||
<dict-tag :options="dict.type.sm_device_online_status" :value="d.row.onlineStatus"></dict-tag>
|
<dict-tag :options="dict.type.sm_device_online_status" :value="d.row.onlineStatus"></dict-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="创建时间" prop="createTime"></el-table-column>
|
||||||
<el-table-column align="center" label="操作">
|
<el-table-column align="center" label="操作">
|
||||||
<template slot-scope="d">
|
<template slot-scope="d">
|
||||||
<el-link type="primary" icon="el-icon-view" :underline="false" @click="handleView(d.row)">查看</el-link>
|
<el-link type="primary" icon="el-icon-view" :underline="false" @click="handleView(d.row)">查看</el-link>
|
||||||
|
|
|
@ -33,12 +33,12 @@
|
||||||
|
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<el-tabs>
|
<el-tabs>
|
||||||
<el-tab-pane label="账户明细">
|
<el-tab-pane label="设备列表" lazy>
|
||||||
<user-account :landlord-id="userData.userId"/>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="设备列表">
|
|
||||||
<user-device :user-id="userData.userId"/>
|
<user-device :user-id="userData.userId"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="充值提现记录" lazy>
|
||||||
|
<user-account :landlord-id="userData.userId"/>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -25,8 +25,14 @@
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="用户类型" prop="isMch">
|
||||||
|
<el-select v-model="queryParams.isMch" placeholder="请选择用户类型" clearable @change="handleQuery">
|
||||||
|
<el-option label="商户" :value="true"/>
|
||||||
|
<el-option label="普通用户" :value="false"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="用户性别" prop="sex">
|
<el-form-item label="用户性别" prop="sex">
|
||||||
<el-select v-model="queryParams.sex" placeholder="请选择用户性别" clearable>
|
<el-select v-model="queryParams.sex" placeholder="请选择用户性别" clearable @change="handleQuery">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.sys_user_sex"
|
v-for="dict in dict.type.sys_user_sex"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -36,7 +42,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="帐号状态" prop="status">
|
<el-form-item label="帐号状态" prop="status">
|
||||||
<el-select v-model="queryParams.status" placeholder="请选择帐号状态" clearable>
|
<el-select v-model="queryParams.status" placeholder="请选择帐号状态" clearable @change="handleQuery">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.sm_user_status"
|
v-for="dict in dict.type.sm_user_status"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -60,7 +66,7 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['system:smUser:add']"
|
v-hasPermi="['system:smUser:add']"
|
||||||
>添加商户</el-button>
|
>添加用户</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -88,25 +94,45 @@
|
||||||
|
|
||||||
<el-table ref="table" v-loading="loading" :data="smUserList" @row-click="changeSelection" @selection-change="handleSelectionChange">
|
<el-table ref="table" v-loading="loading" :data="smUserList" @row-click="changeSelection" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
<el-table-column label="用户ID" align="center" prop="userId" width="80"/>
|
||||||
|
<el-table-column label="头像" align="center" width="80">
|
||||||
|
<template slot-scope="d">
|
||||||
|
<el-avatar :src="d.row.avatar" :width="50" :height="50"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="用户账号" align="center" prop="userName" />
|
<el-table-column label="用户账号" align="center" prop="userName" />
|
||||||
<el-table-column label="用户昵称" align="center" prop="nickName" />
|
<el-table-column label="用户昵称" align="center" prop="nickName" />
|
||||||
<el-table-column label="用户邮箱" align="center" prop="email" show-overflow-tooltip />
|
<el-table-column label="用户类型" align="center" prop="isMch" width="100">
|
||||||
|
<template slot-scope="d">
|
||||||
|
<el-tag :type="d.row.isMch ? 'primary' : 'success'" >{{d.row.isMch ? '商户' : '普通用户'}}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
|
<el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
|
||||||
<el-table-column label="用户性别" align="center" prop="sex">
|
<el-table-column label="用户性别" align="center" prop="sex">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
|
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="头像" align="center" >
|
<el-table-column label="店铺数量" align="center" prop="storeCount" width="100">
|
||||||
<template slot-scope="d">
|
<template slot-scope="d">
|
||||||
<image-preview :src="d.row.avatar" :width="50" :height="50"/>
|
{{d.row.storeCount | defaultValue}} 间
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="充值金额" align="center" prop="rechargeAmount">
|
||||||
|
<template slot-scope="d">
|
||||||
|
{{d.row.rechargeAmount | money}} 元
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="提现金额" align="center" prop="withDrawlAmount">
|
||||||
|
<template slot-scope="d">
|
||||||
|
{{d.row.withDrawlAmount | money}} 元
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="账户余额" align="center" prop="balance" >
|
||||||
|
<template slot-scope="d">
|
||||||
|
{{d.row.balance | money}} 元
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="店铺数量" align="center" prop="storeCount" width="100"/>
|
|
||||||
<el-table-column label="充值金额" align="center" prop="rechargeAmount" />
|
|
||||||
<el-table-column label="提现金额" align="center" prop="withDrawlAmount"/>
|
|
||||||
<el-table-column label="账户余额" align="center" prop="balance" />
|
|
||||||
<el-table-column label="服务费费率" align="center" prop="serviceRate" width="150" >
|
<el-table-column label="服务费费率" align="center" prop="serviceRate" width="150" >
|
||||||
<template slot-scope="d">
|
<template slot-scope="d">
|
||||||
{{d.row.serviceRate == null ? '未设置' : d.row.serviceRate + '%'}}
|
{{d.row.serviceRate == null ? '未设置' : d.row.serviceRate + '%'}}
|
||||||
|
@ -117,7 +143,12 @@
|
||||||
<dict-tag :options="dict.type.sm_user_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.sm_user_status" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="设备数量" align="center" prop="deviceCount" />
|
<el-table-column label="设备数量" align="center" prop="deviceCount" >
|
||||||
|
<template slot-scope="d">
|
||||||
|
{{d.row.deviceCount | defaultValue}} 台
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
|
||||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
|
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -126,7 +157,7 @@
|
||||||
icon="el-icon-view"
|
icon="el-icon-view"
|
||||||
@click="handleSee(scope.row)"
|
@click="handleSee(scope.row)"
|
||||||
v-hasPermi="['system:smUser:detail']"
|
v-hasPermi="['system:smUser:detail']"
|
||||||
>查看详情</el-button>
|
>详情</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -156,9 +187,25 @@
|
||||||
<!-- 添加或修改普通用户信息对话框 -->
|
<!-- 添加或修改普通用户信息对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="用户头像" prop="avatar">
|
||||||
|
<image-upload v-model="form.avatar" :limit="1"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户类型" prop="isMch">
|
||||||
|
<el-select v-model="form.isMch" placeholder="请选择用户类型" style="width: 100%">
|
||||||
|
<el-option label="商户" :value="true"/>
|
||||||
|
<el-option label="普通用户" :value="false"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户名称" prop="userName">
|
||||||
|
<el-input v-model="form.userName" placeholder="请输入用户名称" :maxlength="20" ></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="用户昵称" prop="nickName">
|
<el-form-item label="用户昵称" prop="nickName">
|
||||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称" :maxlength="20" ></el-input>
|
<el-input v-model="form.nickName" placeholder="请输入用户昵称" :maxlength="20" ></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item 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>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="性别" prop="sex">
|
<el-form-item label="性别" prop="sex">
|
||||||
<el-select v-model="form.sex" placeholder="请选择性别" :style="{width: '100%'}">
|
<el-select v-model="form.sex" placeholder="请选择性别" :style="{width: '100%'}">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -169,18 +216,6 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="身份证" prop="identityCard">
|
|
||||||
<el-input v-model="form.identityCard" placeholder="请输入身份证" :maxlength="18" show-word-limit
|
|
||||||
clearable :style="{width: '100%'}"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item 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>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用户地址" prop="address">
|
|
||||||
<el-input v-model="form.address" placeholder="请输入用户地址" clearable :style="{width: '100%'}">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
@ -228,7 +263,7 @@ export default {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
userName: null,
|
userName: null,
|
||||||
nickName: null,
|
nickName: null,
|
||||||
isMch: true,
|
isMch: null,
|
||||||
phonenumber: null,
|
phonenumber: null,
|
||||||
sex: null,
|
sex: null,
|
||||||
status: null,
|
status: null,
|
||||||
|
@ -243,9 +278,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
nickName: [{
|
userName: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入用户昵称',
|
message: '请输入用户名称',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}],
|
}],
|
||||||
sex: [{
|
sex: [{
|
||||||
|
@ -305,25 +340,10 @@ export default {
|
||||||
userId: null,
|
userId: null,
|
||||||
userName: null,
|
userName: null,
|
||||||
nickName: null,
|
nickName: null,
|
||||||
userType: "01",
|
|
||||||
email: null,
|
|
||||||
phonenumber: null,
|
phonenumber: null,
|
||||||
birthday: null,
|
sex: "2",
|
||||||
sex: null,
|
|
||||||
avatar: null,
|
avatar: null,
|
||||||
password: null,
|
isMch: false,
|
||||||
balance: null,
|
|
||||||
payPassword: null,
|
|
||||||
status: null,
|
|
||||||
delFlag: null,
|
|
||||||
loginIp: null,
|
|
||||||
loginDate: null,
|
|
||||||
createBy: null,
|
|
||||||
createTime: null,
|
|
||||||
updateBy: null,
|
|
||||||
updateTime: null,
|
|
||||||
remark: null,
|
|
||||||
isMch: true,
|
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,430 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="用户账号" prop="userName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.userName"
|
|
||||||
placeholder="请输入用户账号"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用户昵称" prop="nickName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.nickName"
|
|
||||||
placeholder="请输入用户昵称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="手机号码" prop="phonenumber">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.phonenumber"
|
|
||||||
placeholder="请输入手机号码"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用户性别" prop="sex">
|
|
||||||
<el-select v-model="queryParams.sex" placeholder="请选择用户性别" clearable>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_user_sex"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="帐号状态" prop="status">
|
|
||||||
<el-select v-model="queryParams.status" placeholder="请选择帐号状态" clearable>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sm_user_status"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<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:smUser: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:smUser: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:smUser:remove']"-->
|
|
||||||
<!-- >删除</el-button>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdateServiceRate"
|
|
||||||
v-hasPermi="['system:smUser:edit']"
|
|
||||||
>修改服务费</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['system:smUser:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table ref="table" v-loading="loading" :data="smUserList" @selection-change="handleSelectionChange" @row-click="changeSelection">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
|
||||||
<el-table-column label="用户账号" align="center" prop="userName" />
|
|
||||||
<el-table-column label="用户昵称" align="center" prop="nickName" />
|
|
||||||
<el-table-column label="用户邮箱" align="center" prop="email" />
|
|
||||||
<el-table-column label="手机号码" align="center" prop="phonenumber" />
|
|
||||||
<el-table-column label="用户性别" align="center" prop="sex">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="头像" align="center" >
|
|
||||||
<template slot-scope="d">
|
|
||||||
<image-preview :src="d.row.avatar" :width="50" :height="50"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="总充值金额" align="center" prop="rechargeAmount" />
|
|
||||||
<el-table-column label="服务费费率" align="center" prop="serviceRate" width="150" >
|
|
||||||
<template slot-scope="d">
|
|
||||||
{{d.row.serviceRate == null ? '未设置' : d.row.serviceRate + '%'}}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="帐号状态" align="center" prop="status">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.sm_user_status" :value="scope.row.status"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="设备数量" align="center" prop="deviceCount" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-view"
|
|
||||||
@click="handleSee(scope.row)"
|
|
||||||
v-hasPermi="['system:smUser:detail']"
|
|
||||||
>查看详情</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['system:smUser:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['system:smUser:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改普通用户信息对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="用户姓名" prop="userName">
|
|
||||||
<el-input v-model="form.userName" placeholder="请输入用户姓名" :maxlength="20"
|
|
||||||
:style="{width: '100%'}"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="性别" prop="sex">
|
|
||||||
<el-select v-model="form.sex" placeholder="请选择性别" :style="{width: '100%'}">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_user_sex"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="身份证" prop="identityCard">
|
|
||||||
<el-input v-model="form.identityCard" placeholder="请输入身份证" :maxlength="18" show-word-limit
|
|
||||||
clearable :style="{width: '100%'}"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item 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>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用户地址" prop="address">
|
|
||||||
<el-input v-model="form.address" placeholder="请输入用户地址" clearable :style="{width: '100%'}">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</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>
|
|
||||||
|
|
||||||
|
|
||||||
<service-rate-form :show.sync="openServiceRate" :user-id="ids[0]" @success="getList" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { listSmUser, getSmUser, addSmUser, updateSmUser, delSmUser } from '@/api/system/smUser'
|
|
||||||
import ServiceRateForm from '@/views/system/smUser/components/serviceRateForm.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "SmUser",
|
|
||||||
components: { ServiceRateForm },
|
|
||||||
dicts: ['sm_user_status', 'user_type', 'sys_user_sex'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
openServiceRate: false,
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 普通用户信息表格数据
|
|
||||||
smUserList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
userName: null,
|
|
||||||
nickName: null,
|
|
||||||
isMch: false,
|
|
||||||
phonenumber: null,
|
|
||||||
sex: null,
|
|
||||||
status: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {
|
|
||||||
userName: undefined,
|
|
||||||
sex: undefined,
|
|
||||||
identityCard: undefined,
|
|
||||||
phonenumber: '',
|
|
||||||
address: undefined,
|
|
||||||
},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
userName: [{
|
|
||||||
required: true,
|
|
||||||
message: '请输入用户姓名',
|
|
||||||
trigger: 'blur'
|
|
||||||
}],
|
|
||||||
sex: [{
|
|
||||||
required: true,
|
|
||||||
message: '请选择性别',
|
|
||||||
trigger: 'change'
|
|
||||||
}],
|
|
||||||
identityCard: [{
|
|
||||||
required: true,
|
|
||||||
message: '请输入身份证',
|
|
||||||
trigger: 'blur'
|
|
||||||
}, {
|
|
||||||
pattern: /^(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
|
||||||
message: '请输入正确的身份证',
|
|
||||||
trigger: 'blur'
|
|
||||||
}],
|
|
||||||
phonenumber: [{
|
|
||||||
required: true,
|
|
||||||
message: '请输入手机号',
|
|
||||||
trigger: 'blur'
|
|
||||||
}, {
|
|
||||||
pattern: /^1(3|4|5|7|8|9)\d{9}$/,
|
|
||||||
message: '手机号格式错误',
|
|
||||||
trigger: 'blur'
|
|
||||||
}],
|
|
||||||
address: [],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查看按钮操作 */
|
|
||||||
handleSee(row) {
|
|
||||||
this.$router.push({path: '/mch/detail', query: {userId: row.userId}})
|
|
||||||
},
|
|
||||||
handleUpdateServiceRate(row) {
|
|
||||||
this.openServiceRate = true;
|
|
||||||
},
|
|
||||||
/** 查询普通用户信息列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listSmUser(this.queryParams).then(response => {
|
|
||||||
this.smUserList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
userId: null,
|
|
||||||
userName: null,
|
|
||||||
nickName: null,
|
|
||||||
userType: "00",
|
|
||||||
email: null,
|
|
||||||
phonenumber: null,
|
|
||||||
birthday: null,
|
|
||||||
sex: null,
|
|
||||||
avatar: null,
|
|
||||||
password: null,
|
|
||||||
balance: null,
|
|
||||||
payPassword: null,
|
|
||||||
status: null,
|
|
||||||
delFlag: null,
|
|
||||||
loginIp: null,
|
|
||||||
loginDate: null,
|
|
||||||
createBy: null,
|
|
||||||
createTime: null,
|
|
||||||
updateBy: null,
|
|
||||||
updateTime: null,
|
|
||||||
remark: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 更换某一行的选中状态
|
|
||||||
changeSelection(row){
|
|
||||||
if (this.ids.includes(row.userId)){
|
|
||||||
this.$refs.table.toggleRowSelection(row, false);
|
|
||||||
this.ids = this.ids.filter(i => i !== row.userId);
|
|
||||||
}else {
|
|
||||||
this.$refs.table.toggleRowSelection(row, true);
|
|
||||||
this.ids.push(row.ids);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.userId)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加租户信息";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const userId = row.userId || this.ids
|
|
||||||
getSmUser(userId).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改租户信息";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
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;
|
|
||||||
this.$modal.confirm('是否确认删除普通用户信息编号为"' + userIds + '"的数据项?').then(function() {
|
|
||||||
return delSmUser(userIds);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('system/smUser/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `smUser_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
Loading…
Reference in New Issue
Block a user