装起全部商城菜单

This commit is contained in:
2022-04-21 18:07:40 +08:00
parent 1b6f8f0ed9
commit 05fdb1d9e7
436 changed files with 50845 additions and 63 deletions
+204
View File
@@ -0,0 +1,204 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="uid" label="用户id" />
<el-table-column prop="nickname" label="用户昵称" />
<el-table-column ref="table" prop="avatar" label="用户头像">
<template slot-scope="scope">
<a :href="scope.row.avatar" style="color: #42b983" target="_blank"><img :src="scope.row.avatar" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="phone" label="手机号码" />
<el-table-column prop="nowMoney" label="用户余额" />
<el-table-column prop="brokeragePrice" label="佣金金额" />
<el-table-column :show-overflow-tooltip="true" prop="addTime" label="创建日期">
<template slot-scope="scope">
<span>{{ formatTime(scope.row.addTime) }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div @click="onStatus(scope.row.uid,scope.row.status)">
<el-tag v-if="scope.row.status == 1" style="cursor: pointer" :type="''">正常</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">禁用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="spreadCount" label="直推人数" />
<el-table-column prop="payCount" label="购买次数" />
<!---->
<!--<el-table-column v-if="checkPermission(['admin','YXUSER_ALL','YXUSER_EDIT','YXUSER_DELETE'])" label="操作" width="150px" align="center">-->
<!--<template slot-scope="scope">-->
<!--<el-button v-permission="['admin','YXUSER_ALL','YXUSER_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>-->
<!--<el-popover-->
<!--v-permission="['admin','YXUSER_ALL','YXUSER_DELETE']"-->
<!--:ref="scope.row.uid"-->
<!--placement="top"-->
<!--width="180">-->
<!--<p>确定删除本条数据吗</p>-->
<!--<div style="text-align: right; margin: 0">-->
<!--<el-button size="mini" type="text" @click="$refs[scope.row.uid].doClose()">取消</el-button>-->
<!--<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.uid)">确定</el-button>-->
<!--</div>-->
<!--<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>-->
<!--</el-popover>-->
<!--</template>-->
<!--</el-table-column>-->
<!---->
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onStatus } from '@/api/bxg/yxUser'
import eForm from './form'
import { formatTime } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'nickname', display_name: '用户昵称' },
{ key: 'phone', display_name: '手机号码' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTime,
checkPermission,
onStatus(id, status) {
this.$confirm(`确定进行[${status ? '禁用' : '开启'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onStatus(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
beforeInit() {
this.url = 'bxg/api/yxUser'
const sort = 'uid,desc'
this.params = { page: this.page, size: this.size, sort: sort, isPromoter: 1 }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(uid) {
this.delLoading = true
del(uid).then(res => {
this.delLoading = false
this.$refs[uid].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[uid].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
uid: data.uid,
account: data.account,
pwd: data.pwd,
realName: data.realName,
birthday: data.birthday,
cardId: data.cardId,
mark: data.mark,
partnerId: data.partnerId,
groupId: data.groupId,
nickname: data.nickname,
avatar: data.avatar,
phone: data.phone,
addTime: data.addTime,
addIp: data.addIp,
lastTime: data.lastTime,
lastIp: data.lastIp,
nowMoney: data.nowMoney,
brokeragePrice: data.brokeragePrice,
integral: data.integral,
signNum: data.signNum,
status: data.status,
level: data.level,
spreadUid: data.spreadUid,
spreadTime: data.spreadTime,
userType: data.userType,
isPromoter: data.isPromoter,
payCount: data.payCount,
spreadCount: data.spreadCount,
cleanTime: data.cleanTime,
addres: data.addres,
adminid: data.adminid,
loginType: data.loginType
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+270
View File
@@ -0,0 +1,270 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="nickname" clearable placeholder="输入用户昵称" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="category" clearable placeholder="明细种类" class="filter-item" style="width: 130px">
<el-option
v-for="item in categoryOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-model="type" clearable placeholder="明细类型" class="filter-item" style="width: 130px">
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-model="inOuttype" clearable placeholder="进出账" class="filter-item" style="width: 130px">
<el-option
v-for="item in inOutOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-model="shibai" clearable placeholder="账单标题" class="filter-item" style="width: 130px">
<el-option
v-for="item in shibais"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
class="filter-item"
v-model="startTime"
type="date"
placeholder="开始日期"
value-format="yyyy-MM-dd"
style="width: 180px">
</el-date-picker>
<el-date-picker
class="filter-item"
v-model="endTime"
type="date"
placeholder="结束日期"
value-format="yyyy-MM-dd"
style="width: 180px">
</el-date-picker>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<pForm ref="formp" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="nickname" label="用户昵称" />
<el-table-column prop="title" label="账单标题" />
<el-table-column prop="category" label="明细种类">
<template slot-scope="scope">
<span v-if="scope.row.category == 'now_money'">余额</span>
<span v-else-if="scope.row.category == 'integral'">积分</span>
<span v-else>未知</span>
</template>
</el-table-column>
<el-table-column prop="number" label="明细数字">
<template slot-scope="scope">
<span v-if="scope.row.pm == 1">+</span>
<span v-else>-</span>
<span>{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" />
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import {del, onStatus} from '@/api/bxg/yxUser'
import eForm from './form'
import pForm from './formp'
import {formatTime} from '@/utils/index'
export default {
components: { eForm, pForm },
mixins: [initData],
data() {
return {
delLoading: false, nickname: '', category: '', type: '',inOuttype:'',startTime: '',endTime: '',shibai: '',
queryTypeOptions: [
{ key: 'nickname', display_name: '用户昵称' },
{ key: 'phone', display_name: '手机号码' }
],
categoryOptions: [
{ value: 'now_money', label: '余额' },
{ value: 'integral', label: '积分' }
],
typeOptions: [
{ value: 'brokerage', label: '佣金' },
{ value: 'sign', label: '签到' }
],
inOutOptions: [
{ value: 0, label: '支出' },
{ value: 1, label: '获得' }
],
shibais: [
{ value: "获得推广佣金", label: '获得推广佣金' },
{ value: "系统增加余额", label: '增加余额' },
{ value: "系统减少余额", label: '减少余额' },
{ value: "佣金提现", label: '佣金提现' },
{ value: "佣金提现", label: '佣金提现' },
{ value: "购买商品", label: '购买商品' },
{ value: "商品退款", label: '商品退款' },
],
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTime,
checkPermission,
onStatus(id, status) {
this.$confirm(`确定进行[${status ? '禁用' : '开启'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onStatus(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
beforeInit() {
this.url = '/bxg/api/yxUserBill'
const sort = 'id,desc'
this.params = {
page: this.page,
size: this.size,
nickname: this.nickname,
category: this.category,
type: this.type,
pm : this.inOuttype,
startTime: this.startTime,
endTime: this.endTime,
title: this.shibai
}
const query = this.query
const type = query.type
const value = query.value
const pm = query.inOuttype
if (type && value) { this.params[type] = value }
return true
},
subDelete(uid) {
this.delLoading = true
del(uid).then(res => {
this.delLoading = false
this.$refs[uid].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[uid].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
uid: data.uid,
account: data.account,
pwd: data.pwd,
realName: data.realName,
birthday: data.birthday,
cardId: data.cardId,
mark: data.mark,
partnerId: data.partnerId,
groupId: data.groupId,
nickname: data.nickname,
avatar: data.avatar,
phone: data.phone,
addTime: data.addTime,
addIp: data.addIp,
lastTime: data.lastTime,
lastIp: data.lastIp,
nowMoney: data.nowMoney,
brokeragePrice: data.brokeragePrice,
integral: data.integral,
signNum: data.signNum,
status: data.status,
level: data.level,
spreadUid: data.spreadUid,
spreadTime: data.spreadTime,
userType: data.userType,
isPromoter: data.isPromoter,
payCount: data.payCount,
spreadCount: data.spreadCount,
cleanTime: data.cleanTime,
addres: data.addres,
adminid: data.adminid,
loginType: data.loginType
}
_this.dialog = true
},
editP(data) {
this.isAdd = false
const _this = this.$refs.formp
_this.form = {
uid: data.uid,
nickname: data.nickname,
ptype: 1,
money: 0
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+207
View File
@@ -0,0 +1,207 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="nickname" clearable placeholder="输入用户昵称" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<pForm ref="formp" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="nickname" label="用户昵称" />
<el-table-column prop="title" label="账单标题" />
<el-table-column prop="category" label="明细种类">
<template slot-scope="scope">
<span v-if="scope.row.category == 'now_money'">余额</span>
<span v-else-if="scope.row.category == 'integral'">积分</span>
<span v-else>未知</span>
</template>
</el-table-column>
<el-table-column prop="number" label="明细数字">
<template slot-scope="scope">
<span v-if="scope.row.pm == 1">+</span>
<span v-else>-</span>
<span>{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="addTime" label="创建日期">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onStatus } from '@/api/bxg/yxUser'
import eForm from './form'
import pForm from './formp'
import { formatTime } from '@/utils/index'
export default {
components: { eForm, pForm },
mixins: [initData],
data() {
return {
delLoading: false, nickname: '', category: '', type: '',
queryTypeOptions: [
{ key: 'nickname', display_name: '用户昵称' },
{ key: 'phone', display_name: '手机号码' }
],
categoryOptions: [
{ value: 'now_money', label: '余额' },
{ value: 'integral', label: '积分' }
],
typeOptions: [
{ value: 'brokerage', label: '佣金' },
{ value: 'sign', label: '签到' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTime,
checkPermission,
onStatus(id, status) {
this.$confirm(`确定进行[${status ? '禁用' : '开启'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onStatus(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
beforeInit() {
this.url = '/bxg/api/yxUserBill'
const sort = 'id,desc'
this.params = {
page: this.page,
size: this.size,
nickname: this.nickname,
category: 'now_money',
type: 'brokerage'
}
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(uid) {
this.delLoading = true
del(uid).then(res => {
this.delLoading = false
this.$refs[uid].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[uid].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
uid: data.uid,
account: data.account,
pwd: data.pwd,
realName: data.realName,
birthday: data.birthday,
cardId: data.cardId,
mark: data.mark,
partnerId: data.partnerId,
groupId: data.groupId,
nickname: data.nickname,
avatar: data.avatar,
phone: data.phone,
addTime: data.addTime,
addIp: data.addIp,
lastTime: data.lastTime,
lastIp: data.lastIp,
nowMoney: data.nowMoney,
brokeragePrice: data.brokeragePrice,
integral: data.integral,
signNum: data.signNum,
status: data.status,
level: data.level,
spreadUid: data.spreadUid,
spreadTime: data.spreadTime,
userType: data.userType,
isPromoter: data.isPromoter,
payCount: data.payCount,
spreadCount: data.spreadCount,
cleanTime: data.cleanTime,
addres: data.addres,
adminid: data.adminid,
loginType: data.loginType
}
_this.dialog = true
},
editP(data) {
this.isAdd = false
const _this = this.$refs.formp
_this.form = {
uid: data.uid,
nickname: data.nickname,
ptype: 1,
money: 0
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+130
View File
@@ -0,0 +1,130 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" title="查看分销下级" width="700px">
<el-card>
<div slot="header">
<span>{{ form.nickname }}的下级</span>
</div>
<el-tabs type="border-card" @tab-click="handleClick" v-model="activeName">
<el-tab-pane label="一级" name="first">
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
prop="nickname"
label="姓名"
width="180">
</el-table-column>
<el-table-column
prop="avatar"
label="头像">
<template slot-scope="scope">
<a :href="scope.row.avatar" style="color: #42b983" target="_blank"><img :src="scope.row.avatar" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column
prop="time"
label="加入时间"
width="180">
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="二级" name="second">
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
prop="nickname"
label="姓名"
width="180">
</el-table-column>
<el-table-column
prop="avatar"
label="头像">
<template slot-scope="scope">
<a :href="scope.row.avatar" style="color: #42b983" target="_blank"><img :src="scope.row.avatar" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column
prop="time"
label="加入时间"
width="180">
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-card>
</el-dialog>
</template>
<script>
import { add, edit, getSpread } from '@/api/bxg/yxUser'
import { parseTime } from '@/utils/index'
export default {
props: {
// isAdd: {
// type: Boolean,
// required: true
// }
},
data() {
return {
loading: false, dialog: false, expressInfo: [],
activeName: "first",
tableData: [],
form: {
uid: '',
nickname: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
]
}
}
},
mounted() {
// this.express()
},
methods: {
handleClick(tab, event) {
this.spread(this.form.uid)
},
parseTime,
cancel() {
this.dialog = false
},
spread(uid) {
var grade = 0;
if(this.activeName == 'second') grade = 1
let params ={
uid,
grade
}
getSpread(params).then(res=>{
console.log(res)
this.tableData = res
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}
}
}
</script>
<style scoped>
.text {
font-size: 12px;
}
.item {
padding: 6px 0;
}
</style>
+165
View File
@@ -0,0 +1,165 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="用户昵称">
<el-input v-model="form.nickname" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="真实姓名">
<el-input v-model="form.realName" style="width: 370px;" />
</el-form-item>
<el-form-item label="用户备注">
<el-input v-model="form.mark" style="width: 370px;" />
</el-form-item>
<el-form-item label="手机号码">
<el-input v-model="form.phone" style="width: 370px;" />
</el-form-item>
<el-form-item label="用户积分">
<el-input v-model="form.integral" style="width: 370px;" />
</el-form-item>
<el-form-item label="商户管理">
<el-radio v-model="form.adminid" :label="1">开启</el-radio>
<el-radio v-model="form.adminid" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
uid: '',
account: '',
pwd: '',
realName: '',
birthday: '',
cardId: '',
mark: '',
partnerId: '',
groupId: '',
nickname: '',
avatar: '',
phone: '',
addTime: '',
addIp: '',
lastTime: '',
lastIp: '',
nowMoney: '',
brokeragePrice: '',
integral: '',
signNum: '',
status: '',
level: '',
spreadUid: '',
spreadTime: '',
userType: '',
isPromoter: 0,
payCount: '',
spreadCount: '',
cleanTime: '',
addres: '',
adminid: 0,
loginType: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
uid: '',
account: '',
pwd: '',
realName: '',
birthday: '',
cardId: '',
mark: '',
partnerId: '',
groupId: '',
nickname: '',
avatar: '',
phone: '',
addTime: '',
addIp: '',
lastTime: '',
lastIp: '',
nowMoney: '',
brokeragePrice: '',
integral: '',
signNum: '',
status: '',
level: '',
spreadUid: '',
spreadTime: '',
userType: '',
isPromoter: '',
payCount: '',
spreadCount: '',
cleanTime: '',
addres: '',
adminid: '',
loginType: ''
}
}
}
}
</script>
<style scoped>
</style>
+128
View File
@@ -0,0 +1,128 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '余额修改'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="用户昵称">
<el-input v-model="form.nickname" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="修改余额">
<el-radio v-model="form.ptype" :label="1">增加</el-radio>
<el-radio v-model="form.ptype" :label="2">减少</el-radio>
</el-form-item>
<el-form-item label="用户余额">
<el-input v-model="form.money" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit, editp } from '@/api/bxg/yxUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
uid: '',
nickname: '',
money: '',
ptype: '1'
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
editp(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
uid: '',
account: '',
pwd: '',
realName: '',
birthday: '',
cardId: '',
mark: '',
partnerId: '',
groupId: '',
nickname: '',
avatar: '',
phone: '',
addTime: '',
addIp: '',
lastTime: '',
lastIp: '',
nowMoney: '',
brokeragePrice: '',
integral: '',
signNum: '',
status: '',
level: '',
spreadUid: '',
spreadTime: '',
userType: '',
isPromoter: '',
payCount: '',
spreadCount: '',
cleanTime: '',
addres: '',
adminid: '',
loginType: ''
}
}
}
}
</script>
<style scoped>
</style>
+264
View File
@@ -0,0 +1,264 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-select v-model="userType" clearable placeholder="用户来源" class="filter-item" style="width: 130px">
<el-option
v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<pForm ref="formp" :is-add="isAdd" />
<detail ref="formd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="uid" label="用户id" />
<el-table-column prop="nickname" label="用户昵称" />
<el-table-column ref="table" prop="avatar" label="用户头像">
<template slot-scope="scope">
<a :href="scope.row.avatar" style="color: #42b983" target="_blank"><img :src="scope.row.avatar" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="phone" label="手机号码" />
<el-table-column prop="nowMoney" label="用户余额" />
<el-table-column prop="brokeragePrice" label="佣金金额" />
<el-table-column prop="integral" label="用户积分" />
<el-table-column prop="createTime" label="创建日期" width="140">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div @click="onStatus(scope.row.uid,scope.row.status)">
<el-tag v-if="scope.row.status == 1" style="cursor: pointer" :type="''">正常</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">禁用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="用户来源" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.userType == 'wechat'">公众号</el-tag>
<el-tag v-else-if="scope.row.userType == 'routine'">小程序</el-tag>
<el-tag v-else>H5</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="spreadUid" label="推荐人" />
<el-table-column prop="payCount" label="购买次数" />
<el-table-column v-if="checkPermission(['admin','YXUSER_ALL','YXUSER_EDIT','YXUSER_DELETE'])" label="操作" width="215" align="center" fixed="right">
<template slot-scope="scope">
<el-button
v-permission="['admin','YXUSER_ALL','YXUSER_EDIT']"
size="mini"
type="danger"
@click="editD(scope.row)"
>查看下级</el-button>
<el-dropdown size="mini" split-button type="primary" trigger="click">
操作
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button
v-permission="['admin','YXUSER_ALL','YXUSER_EDIT']"
size="mini"
type="primary"
@click="edit(scope.row)"
>修改用户</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
v-permission="['admin','YXUSER_ALL','YXUSER_EDIT']"
size="mini"
type="primary"
@click="editP(scope.row)"
>修改余额</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onStatus } from '@/api/bxg/yxUser'
import eForm from './form'
import pForm from './formp'
import detail from './detail'
import { formatTime } from '@/utils/index'
export default {
components: { eForm, pForm, detail },
mixins: [initData],
data() {
return {
delLoading: false,
userType: '',
queryTypeOptions: [
{ key: 'nickname', display_name: '用户昵称' },
{ key: 'phone', display_name: '手机号码' }
],
statusOptions: [
{ value: 'routine', label: '小程序' },
{ value: 'wechat', label: '公众号' },
{ value: 'H5', label: 'H5' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTime,
checkPermission,
onStatus(id, status) {
this.$confirm(`确定进行[${status ? '禁用' : '开启'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onStatus(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
beforeInit() {
this.url = 'bxg/api/yxUser'
const sort = 'uid,desc'
this.params = { page: this.page, size: this.size, sort: sort, userType: this.userType }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(uid) {
this.delLoading = true
del(uid).then(res => {
this.delLoading = false
this.$refs[uid].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[uid].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
uid: data.uid,
account: data.account,
pwd: data.pwd,
realName: data.realName,
birthday: data.birthday,
cardId: data.cardId,
mark: data.mark,
partnerId: data.partnerId,
groupId: data.groupId,
nickname: data.nickname,
avatar: data.avatar,
phone: data.phone,
addTime: data.addTime,
addIp: data.addIp,
lastTime: data.lastTime,
lastIp: data.lastIp,
nowMoney: data.nowMoney,
brokeragePrice: data.brokeragePrice,
integral: data.integral,
signNum: data.signNum,
status: data.status,
level: data.level,
spreadUid: data.spreadUid,
spreadTime: data.spreadTime,
userType: data.userType,
isPromoter: data.isPromoter,
payCount: data.payCount,
spreadCount: data.spreadCount,
cleanTime: data.cleanTime,
addres: data.addres,
adminid: data.adminid,
loginType: data.loginType
}
_this.dialog = true
},
editP(data) {
this.isAdd = false
const _this = this.$refs.formp
_this.form = {
uid: data.uid,
nickname: data.nickname,
ptype: 1,
money: 0
}
_this.dialog = true
},
editD(data) {
const _this = this.$refs.formd
_this.form = {
uid: data.uid,
nickname: data.nickname
}
_this.dialog = true
_this.spread(data.uid)
}
}
}
</script>
<style scoped>
</style>
+207
View File
@@ -0,0 +1,207 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="nickname" clearable placeholder="输入用户昵称" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<pForm ref="formp" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="nickname" label="用户昵称" />
<el-table-column prop="title" label="账单标题" />
<el-table-column prop="category" label="明细种类">
<template slot-scope="scope">
<span v-if="scope.row.category == 'now_money'">余额</span>
<span v-else-if="scope.row.category == 'integral'">积分</span>
<span v-else>未知</span>
</template>
</el-table-column>
<el-table-column prop="number" label="明细数字">
<template slot-scope="scope">
<span v-if="scope.row.pm == 1">+</span>
<span v-else>-</span>
<span>{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="addTime" label="创建日期">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onStatus } from '@/api/bxg/yxUser'
import eForm from './form'
import pForm from './formp'
import { formatTime } from '@/utils/index'
export default {
components: { eForm, pForm },
mixins: [initData],
data() {
return {
delLoading: false, nickname: '', category: '', type: '',
queryTypeOptions: [
{ key: 'nickname', display_name: '用户昵称' },
{ key: 'phone', display_name: '手机号码' }
],
categoryOptions: [
{ value: 'now_money', label: '余额' },
{ value: 'integral', label: '积分' }
],
typeOptions: [
{ value: 'brokerage', label: '佣金' },
{ value: 'sign', label: '签到' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTime,
checkPermission,
onStatus(id, status) {
this.$confirm(`确定进行[${status ? '禁用' : '开启'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onStatus(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
beforeInit() {
this.url = '/bxg/api/yxUserBill'
const sort = 'id,desc'
this.params = {
page: this.page,
size: this.size,
nickname: this.nickname,
category: 'integral',
type: ''
}
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(uid) {
this.delLoading = true
del(uid).then(res => {
this.delLoading = false
this.$refs[uid].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[uid].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
uid: data.uid,
account: data.account,
pwd: data.pwd,
realName: data.realName,
birthday: data.birthday,
cardId: data.cardId,
mark: data.mark,
partnerId: data.partnerId,
groupId: data.groupId,
nickname: data.nickname,
avatar: data.avatar,
phone: data.phone,
addTime: data.addTime,
addIp: data.addIp,
lastTime: data.lastTime,
lastIp: data.lastIp,
nowMoney: data.nowMoney,
brokeragePrice: data.brokeragePrice,
integral: data.integral,
signNum: data.signNum,
status: data.status,
level: data.level,
spreadUid: data.spreadUid,
spreadTime: data.spreadTime,
userType: data.userType,
isPromoter: data.isPromoter,
payCount: data.payCount,
spreadCount: data.spreadCount,
cleanTime: data.cleanTime,
addres: data.addres,
adminid: data.adminid,
loginType: data.loginType
}
_this.dialog = true
},
editP(data) {
this.isAdd = false
const _this = this.$refs.formp
_this.form = {
uid: data.uid,
nickname: data.nickname,
ptype: 1,
money: 0
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>