用户佣金

This commit is contained in:
2026-02-14 13:56:45 +08:00
parent 5cd7c19b69
commit 694b553a18
6 changed files with 795 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/market/benefit-commission/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getDetail = (id) => {
return request({
url: '/market/benefit-commission/detail',
method: 'get',
params: {
id
}
})
}
export const remove = (ids) => {
return request({
url: '/market/benefit-commission/remove',
method: 'post',
params: {
ids,
}
})
}
export const add = (row) => {
return request({
url: '/market/benefit-commission/submit',
method: 'post',
data: row
})
}
export const update = (row) => {
return request({
url: '/market/benefit-commission/submit',
method: 'post',
data: row
})
}

View File

@@ -0,0 +1,50 @@
import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/market/benefit-commission-log/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getDetail = (id) => {
return request({
url: '/market/benefit-commission-log/detail',
method: 'get',
params: {
id
}
})
}
export const remove = (ids) => {
return request({
url: '/market/benefit-commission-log/remove',
method: 'post',
params: {
ids,
}
})
}
export const add = (row) => {
return request({
url: '/market/benefit-commission-log/submit',
method: 'post',
data: row
})
}
export const update = (row) => {
return request({
url: '/market/benefit-commission-log/submit',
method: 'post',
data: row
})
}

View File

@@ -0,0 +1,100 @@
export default {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: true,
delBtn: false,
addBtn: false,
editBtn: false,
selection: false,
dialogClickModal: false,
column: [
{
label: '用户id',
prop: 'id',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '佣金金额',
prop: 'amount',
type: 'input',
},
{
label: '版本号',
prop: 'version',
type: 'input',
hide: true,
},
{
label: '创建人',
prop: 'createUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '创建部门',
prop: 'createDept',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '创建时间',
prop: 'createTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '修改人',
prop: 'updateUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '修改时间',
prop: 'updateTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '状态',
prop: 'status',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '是否已删除',
prop: 'isDeleted',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
],
};

View File

@@ -0,0 +1,145 @@
export default {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: true,
delBtn: false,
addBtn: false,
editBtn: false,
selection: false,
dialogClickModal: false,
column: [
{
label: '主键',
prop: 'id',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '用户id',
prop: 'userId',
type: 'input',
},
{
label: '金额',
prop: 'amount',
type: 'input',
},
{
label: '上一笔金额',
prop: 'lastAmount',
type: 'input',
},
{
label: '业务类型',
prop: 'sourceType',
type: 'input',
},
{
label: '来源id',
prop: 'sourceId',
type: 'input',
overHidden: true,
},
{
label: '来源详情',
prop: 'sourceDetail',
type: 'input',
overHidden: true,
},
{
label: '收入/支出',
prop: 'type',
type: 'radio',
dicUrl: '/blade-system/dict/dictionary?code=point_spend_type',
props: {
label: 'dictValue',
value: 'dictKey',
},
dataType: 'number',
},
{
label: '统计时间',
prop: 'statisticalDate',
type: 'input',
overHidden: true,
},
{
label: '备注',
prop: 'remark',
type: 'input',
overHidden: true,
},
{
label: '创建人',
prop: 'createUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '创建部门',
prop: 'createDept',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '创建时间',
prop: 'createTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '修改人',
prop: 'updateUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '修改时间',
prop: 'updateTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '状态',
prop: 'status',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '是否已删除',
prop: 'isDeleted',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
],
};

View File

@@ -0,0 +1,225 @@
<template>
<basic-container>
<avue-crud :option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
<template #menu-left>
<!-- <el-button type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- v-if="permission.userCommission_delete"-->
<!-- @click="handleDelete">删 除-->
<!-- </el-button>-->
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/market/marketUserCommission";
import option from "@/option/market/marketUserCommission";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
import {getToken} from '@/utils/auth';
import {downloadXls} from "@/utils/util";
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
export default {
data() {
return {
form: {},
query: {},
search: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: option,
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.validData(this.permission.userCommission_add, false),
viewBtn: this.validData(this.permission.userCommission_view, false),
delBtn: this.validData(this.permission.userCommission_delete, false),
editBtn: this.validData(this.permission.userCommission_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
window.console.log(error);
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
console.log(error);
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleExport() {
let downloadUrl = `/blade-usercommission/userCommission/export-userCommission?${this.website.tokenHeader}=${getToken()}`;
const {
} = this.query;
let values = {
};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
NProgress.start();
exportBlob(downloadUrl, values).then(res => {
downloadXls(res.data, `用户佣金表${dateNow()}.xlsx`);
NProgress.done();
})
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
let values = {
};
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style>
</style>

View File

@@ -0,0 +1,225 @@
<template>
<basic-container>
<avue-crud :option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
<template #menu-left>
<!-- <el-button type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- v-if="permission.userCommissionLog_delete"-->
<!-- @click="handleDelete">删 除-->
<!-- </el-button>-->
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/market/marketUserCommissionLog";
import option from "@/option/market/marketUserCommissionLog";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
import {getToken} from '@/utils/auth';
import {downloadXls} from "@/utils/util";
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
export default {
data() {
return {
form: {},
query: {},
search: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: option,
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.validData(this.permission.userCommissionLog_add, false),
viewBtn: this.validData(this.permission.userCommissionLog_view, false),
delBtn: this.validData(this.permission.userCommissionLog_delete, false),
editBtn: this.validData(this.permission.userCommissionLog_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
window.console.log(error);
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
loading();
console.log(error);
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleExport() {
let downloadUrl = `/blade-usercommissionlog/userCommissionLog/export-userCommissionLog?${this.website.tokenHeader}=${getToken()}`;
const {
} = this.query;
let values = {
};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
NProgress.start();
exportBlob(downloadUrl, values).then(res => {
downloadXls(res.data, `用户佣金流水表${dateNow()}.xlsx`);
NProgress.done();
})
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
let values = {
};
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style>
</style>