init
This commit is contained in:
@@ -17,28 +17,11 @@ export function getAccount(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增用户账户
|
// 修改用户账户
|
||||||
export function addAccount(data) {
|
export function updateAccountCoin(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/cai/account',
|
url: '/cai/account/updateCoin',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改用户账户
|
|
||||||
export function updateAccount(data) {
|
|
||||||
return request({
|
|
||||||
url: '/cai/account',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除用户账户
|
|
||||||
export function delAccount(id) {
|
|
||||||
return request({
|
|
||||||
url: '/cai/account/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
44
src/api/cai/goods.js
Normal file
44
src/api/cai/goods.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询充值配置列表
|
||||||
|
export function listGoods(query) {
|
||||||
|
return request({
|
||||||
|
url: '/cai/goods/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询充值配置详细
|
||||||
|
export function getGoods(id) {
|
||||||
|
return request({
|
||||||
|
url: '/cai/goods/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增充值配置
|
||||||
|
export function addGoods(data) {
|
||||||
|
return request({
|
||||||
|
url: '/cai/goods',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改充值配置
|
||||||
|
export function updateGoods(data) {
|
||||||
|
return request({
|
||||||
|
url: '/cai/goods',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除充值配置
|
||||||
|
export function delGoods(id) {
|
||||||
|
return request({
|
||||||
|
url: '/cai/goods/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
126
src/views/cai/account/add-account-dialog.vue
Normal file
126
src/views/cai/account/add-account-dialog.vue
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="700px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="调整账户" prop="rechargeType">
|
||||||
|
<el-radio-group v-model="form.rechargeType">
|
||||||
|
<el-radio :label="1">余额调整</el-radio>
|
||||||
|
<el-radio :label="2">收益调整</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="调整金额" prop="rechargeCoin">
|
||||||
|
<el-input v-model="form.rechargeCoin" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="蜜瓜号" prop="usercode">
|
||||||
|
<el-autocomplete
|
||||||
|
class="inline-input"
|
||||||
|
v-model="form.usercode"
|
||||||
|
:fetch-suggestions="querySearch"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
@select="handleSelect"
|
||||||
|
></el-autocomplete>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="昵称" v-if="info.nickname">
|
||||||
|
{{ info.nickname }} 【{{ info.usercode }}】
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="头像" v-if="info.avatar">
|
||||||
|
<image-avatar :src="info.avatar"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
注意:调整金额为负减余额,正则加余额, 请保证余额不能减为负数
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getUserByUsercode, listUserByUserCode} from "@/api/cai/user";
|
||||||
|
import { listMemberPrice } from '@/api/cai/memberPrice'
|
||||||
|
import { addUserMember } from '@/api/cai/userMember'
|
||||||
|
import {updateAccountCoin} from "@/api/cai/account";
|
||||||
|
import {listGoods} from "@/api/cai/goods";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
open: false,
|
||||||
|
title: '',
|
||||||
|
form:{
|
||||||
|
usercode: undefined,
|
||||||
|
rechargeType: undefined,
|
||||||
|
rechargeCoin: undefined,
|
||||||
|
remark: undefined
|
||||||
|
},
|
||||||
|
info:{
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
usercode: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
rechargeType: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
rechargeCoin: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
remark: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
},
|
||||||
|
buttonLoading: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init () {
|
||||||
|
this.open = true;
|
||||||
|
this.title = "调整用户账号"
|
||||||
|
this.info = {};
|
||||||
|
this.form.usercode = undefined
|
||||||
|
this.form.rechargeCoin = undefined
|
||||||
|
this.form.remark = undefined
|
||||||
|
},
|
||||||
|
querySearch(querySearch,cb){
|
||||||
|
listUserByUserCode(querySearch).then(res => {
|
||||||
|
cb(res.data.map((terminal) => {
|
||||||
|
return {
|
||||||
|
value: terminal,
|
||||||
|
name: terminal,
|
||||||
|
};
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSelect(item){
|
||||||
|
getUserByUsercode(item.value).then(res => {
|
||||||
|
this.info = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
submitForm () {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
updateAccountCoin(this.form).then(data => {
|
||||||
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
this.buttonLoading = false;
|
||||||
|
this.open = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -24,6 +24,16 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<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="['cai:account:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@@ -66,18 +76,25 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<add-account-dialog v-if="addAccountDialogVisible" ref="addAccountDialog" @refreshDataList="getList"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listAccount} from "@/api/cai/account";
|
import {listAccount} from "@/api/cai/account";
|
||||||
import {genderList, isAnchorList, userStatusList, yesOrNoList} from "@/constant/statusMap";
|
import {genderList, isAnchorList, userStatusList, yesOrNoList} from "@/constant/statusMap";
|
||||||
|
import AddAccountDialog from "@/views/cai/account/add-account-dialog";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Account",
|
name: "Account",
|
||||||
|
components:{
|
||||||
|
AddAccountDialog
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
genderList, userStatusList, yesOrNoList, isAnchorList,
|
genderList, userStatusList, yesOrNoList, isAnchorList,
|
||||||
|
addAccountDialogVisible: false,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@@ -130,6 +147,12 @@ export default {
|
|||||||
this.single = selection.length !== 1
|
this.single = selection.length !== 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
|
handleAdd(row) {
|
||||||
|
this.addAccountDialogVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addAccountDialog.init(row?.usercode)
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -100,23 +100,28 @@
|
|||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
<recharge-order-info v-if="rechargeOrderInfoVisible" ref="rechargeOrderInfo" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRechargeOrder, getRechargeOrder, delRechargeOrder, addRechargeOrder, updateRechargeOrder } from "@/api/cai/rechargeOrder";
|
import {listRechargeOrder} from "@/api/cai/rechargeOrder";
|
||||||
import {
|
import {
|
||||||
booleanList,
|
booleanList,
|
||||||
genderList,
|
genderList,
|
||||||
memberStatusList,
|
memberStatusList,
|
||||||
memberTypeList, payStatusList,
|
memberTypeList,
|
||||||
|
payStatusList,
|
||||||
platformTypeList,
|
platformTypeList,
|
||||||
yesOrNoList
|
yesOrNoList
|
||||||
} from '@/constant/statusMap'
|
} from '@/constant/statusMap'
|
||||||
|
import RechargeOrderInfo from "@/views/cai/rechargeOrder/recharge-order-info";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RechargeOrder",
|
name: "RechargeOrder",
|
||||||
|
components:{
|
||||||
|
RechargeOrderInfo
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
genderList,memberTypeList,yesOrNoList,memberStatusList,booleanList,platformTypeList,
|
genderList,memberTypeList,yesOrNoList,memberStatusList,booleanList,platformTypeList,
|
||||||
|
|||||||
Reference in New Issue
Block a user