优化后台界面显示

This commit is contained in:
2026-03-01 13:39:37 +08:00
parent 6bdad9b4f0
commit b19d99d201
11 changed files with 936 additions and 885 deletions

View File

@@ -2,14 +2,14 @@ import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/market/benefit-commission/list',
url: '/market/benefit-commission/page',
method: 'get',
params: {
...params,
current,
size,
}
})
},
});
}
export const getDetail = (id) => {

View File

@@ -2,14 +2,14 @@ import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/market/benefit-commission-log/list',
url: '/market/benefit-commission-log/page',
method: 'get',
params: {
...params,
current,
size,
}
})
},
});
}
export const getDetail = (id) => {

View File

@@ -1,5 +1,5 @@
export default {
height:'auto',
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
@@ -14,216 +14,216 @@ export default {
dialogClickModal: false,
column: [
{
label: "主键",
prop: "id",
type: "input",
label: '主键',
prop: 'id',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "统计日期",
prop: "statisticalDate",
type: "input",
width : 140,
label: '统计日期',
prop: 'statisticalDate',
type: 'input',
width: 140,
overHidden: true,
},
{
label: "用户id",
prop: "userId",
type: "input",search : true,
label: '用户id',
prop: 'userId',
type: 'input',
hide: true,
overHidden: true,
},
{
label: "用户手机号",
prop: "phone",
type: "input",
width : 140,
search : true,
label: '用户账号',
prop: 'phone',
type: 'input',
width: 140,
search: true,
overHidden: true,
},
{
label: "用户名",
prop: "userName",
type: "input",
label: '用户名',
prop: 'userName',
type: 'input',
overHidden: true,
},
{
label: "积分包id",
prop: "packageId",
type: "input",
label: '积分包id',
prop: 'packageId',
type: 'input',
hide: true,
overHidden: true,
},
{
label: "积分包名称",
prop: "packageName",
type: "input",
width : 150,
label: '积分包名称',
prop: 'packageName',
type: 'input',
width: 150,
overHidden: true,
},
{
label: "来源",
prop: "type",
type: "select",
dicUrl: "/api/blade-system/dict/dictionary?code=app_package_type",
dataType: "number",
label: '来源',
prop: 'type',
type: 'select',
dicUrl: '/api/blade-system/dict/dictionary?code=app_package_type',
dataType: 'number',
props: {
label: "dictValue",
value: "dictKey"
label: 'dictValue',
value: 'dictKey',
},
width : 140,
width: 140,
},
{
label: "兑换包需要的福利积分",
prop: "userBenefit",
type: "input",
width : 180,
label: '兑换包需要的福利积分',
prop: 'userBenefit',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "兑换包需要的现金券",
prop: "userCash",
type: "input",width : 180,
overHidden: true,
},
{
label: "购买赠与福利值",
prop: "giveAmount",
type: "input",
width : 180,
label: '兑换包需要的现金券',
prop: 'userCash',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "产出总天数",
prop: "dayTotal",
type: "input",
width : 180,
label: '购买赠与福利值',
prop: 'giveAmount',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "总产出福利积分",
prop: "amountTotal",
type: "input",
width : 180,
label: '产出总天数',
prop: 'dayTotal',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "每日产出福利积分",
prop: "amountDay",
type: "input",
width : 180,
label: '总产出福利积分',
prop: 'amountTotal',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "已产出福利积分",
prop: "amountOut",
type: "input",
width : 180,
label: '每日产出福利积分',
prop: 'amountDay',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "已产出天数",
prop: "outDay",
type: "input",
width : 180,
label: '已产出福利积分',
prop: 'amountOut',
type: 'input',
width: 180,
overHidden: true,
},
{
label: '已产出天数',
prop: 'outDay',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "过期时间",
prop: "expiredDate",
type: "input",
width : 180,
overHidden: true,
},
{
label: "激活时间",
prop: "activeTime",
type: "input",
width : 180,
label: '过期时间',
prop: 'expiredDate',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "备注",
prop: "remark",
type: "input",
width : 180,
label: '激活时间',
prop: 'activeTime',
type: 'input',
width: 180,
overHidden: true,
},
{
label: '备注',
prop: 'remark',
type: 'input',
width: 180,
overHidden: true,
},
{
label: "创建人",
prop: "createUser",
type: "input",
label: '创建人',
prop: 'createUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "创建部门",
prop: "createDept",
type: "input",
label: '创建部门',
prop: 'createDept',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "创建时间",
prop: "createTime",
type: "input",
label: '创建时间',
prop: 'createTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "修改人",
prop: "updateUser",
type: "input",
label: '修改人',
prop: 'updateUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "修改时间",
prop: "updateTime",
type: "input",
label: '修改时间',
prop: 'updateTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "状态",
prop: "status",
type: "input",
label: '状态',
prop: 'status',
type: 'input',
addDisplay: false,
editDisplay: false,
hide: false,
dicUrl: "/api/blade-system/dict/dictionary?code=app_package_status",
dataType: "number",
dicUrl: '/api/blade-system/dict/dictionary?code=app_package_status',
dataType: 'number',
props: {
label: "dictValue",
value: "dictKey"
label: 'dictValue',
value: 'dictKey',
},
width : 140,
width: 140,
},
{
label: "是否已删除",
prop: "isDeleted",
type: "input",
label: '是否已删除',
prop: 'isDeleted',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
]
}
],
};

View File

@@ -31,12 +31,12 @@ export default {
{
label: '用户id',
prop: 'userId',
search: true,
type: 'input',
hide: true,
overHidden: true,
},
{
label: '用户手机号',
label: '用户账号',
prop: 'phone',
type: 'input',
search: true,
@@ -62,6 +62,7 @@ export default {
label: '积分包id',
prop: 'userPackageId',
type: 'input',
hide: true,
overHidden: true,
},
{

View File

@@ -20,8 +20,16 @@ export default {
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: '用户账户',
prop: 'account',
type: 'input',
search: true,
},
{
label: '佣金金额',
prop: 'amount',

View File

@@ -26,7 +26,17 @@ export default {
label: '用户id',
prop: 'userId',
type: 'input',
hide: true,
},
{
label: '用户账户',
prop: 'account',
type: 'input',
search: true,
overHidden: true,
},
{
label: '金额',
prop: 'amount',
@@ -37,6 +47,11 @@ export default {
prop: 'lastAmount',
type: 'input',
},
{
label: '手续费',
prop: 'fee',
type: 'input',
},
{
label: '业务类型',
prop: 'sourceType',

View File

@@ -1,6 +1,7 @@
<template>
<basic-container>
<avue-crud :option="option"
<avue-crud
:option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
@@ -18,36 +19,37 @@
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
@on-load="onLoad"
>
<template #menu-left>
<!-- <el-button type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- v-if="permission.userMarketBenefitPackage_delete"-->
<!-- @click="handleDelete">删 除-->
<!-- </el-button>-->
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
<!-- <el-button type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- v-if="permission.userMarketBenefitPackage_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/marketBenefitPackage";
import option from "@/option/market/marketBenefitPackage";
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';
import { getList, getDetail, add, update, remove } from '@/api/market/marketBenefitPackage';
import option from '@/option/market/marketBenefitPackage';
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 {
export default {
data() {
return {
form: {},
@@ -57,21 +59,21 @@
page: {
pageSize: 10,
currentPage: 1,
total: 0
total: 0,
},
selectionList: [],
option: option,
data: []
data: [],
};
},
computed: {
...mapGetters(["permission"]),
...mapGetters(['permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.userMarketBenefitPackage_add, false),
viewBtn: this.validData(this.permission.userMarketBenefitPackage_view, false),
delBtn: this.validData(this.permission.userMarketBenefitPackage_delete, false),
editBtn: this.validData(this.permission.userMarketBenefitPackage_edit, false)
editBtn: this.validData(this.permission.userMarketBenefitPackage_edit, false),
};
},
ids() {
@@ -79,41 +81,47 @@
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
return ids.join(',');
},
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
add(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
done();
}, error => {
},
error => {
loading();
window.console.log(error);
});
}
);
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
done();
}, error => {
},
error => {
loading();
console.log(error);
});
}
);
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
@@ -121,20 +129,20 @@
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
@@ -142,32 +150,32 @@
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
this.$refs.crud.toggleSelection();
});
},
handleExport() {
let downloadUrl = `/blade-usermarketbenefitpackage/userMarketBenefitPackage/export-userMarketBenefitPackage?${this.website.tokenHeader}=${getToken()}`;
const {
} = this.query;
let values = {
};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
let downloadUrl = `/blade-usermarketbenefitpackage/userMarketBenefitPackage/export-userMarketBenefitPackage?${
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)) {
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
@@ -191,10 +199,10 @@
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
@@ -203,10 +211,10 @@
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
const {} = this.query;
let values = {
phone : params.phone,
};
getList(page.currentPage, page.pageSize, values).then(res => {
@@ -216,10 +224,9 @@
this.loading = false;
this.selectionClear();
});
}
}
};
},
},
};
</script>
<style>
</style>
<style></style>

View File

@@ -1,6 +1,7 @@
<template>
<basic-container>
<avue-crud :option="option"
<avue-crud
:option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
@@ -18,36 +19,37 @@
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
@on-load="onLoad"
>
<template #menu-left>
<!-- <el-button type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- v-if="permission.userMarketBenefitPackageLog_delete"-->
<!-- @click="handleDelete">删 除-->
<!-- </el-button>-->
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
<!-- <el-button type="danger"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- v-if="permission.userMarketBenefitPackageLog_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/marketBenefitPackageLog";
import option from "@/option/market/marketBenefitPackageLog";
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';
import { getList, getDetail, add, update, remove } from '@/api/market/marketBenefitPackageLog';
import option from '@/option/market/marketBenefitPackageLog';
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 {
export default {
data() {
return {
form: {},
@@ -57,21 +59,21 @@
page: {
pageSize: 10,
currentPage: 1,
total: 0
total: 0,
},
selectionList: [],
option: option,
data: []
data: [],
};
},
computed: {
...mapGetters(["permission"]),
...mapGetters(['permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.userMarketBenefitPackageLog_add, false),
viewBtn: this.validData(this.permission.userMarketBenefitPackageLog_view, false),
delBtn: this.validData(this.permission.userMarketBenefitPackageLog_delete, false),
editBtn: this.validData(this.permission.userMarketBenefitPackageLog_edit, false)
editBtn: this.validData(this.permission.userMarketBenefitPackageLog_edit, false),
};
},
ids() {
@@ -79,41 +81,47 @@
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
return ids.join(',');
},
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
add(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
done();
}, error => {
},
error => {
loading();
window.console.log(error);
});
}
);
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
done();
}, error => {
},
error => {
loading();
console.log(error);
});
}
);
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
@@ -121,20 +129,20 @@
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
@@ -142,32 +150,32 @@
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
this.$refs.crud.toggleSelection();
});
},
handleExport() {
let downloadUrl = `/blade-usermarketbenefitpackagelog/userMarketBenefitPackageLog/export-userMarketBenefitPackageLog?${this.website.tokenHeader}=${getToken()}`;
const {
} = this.query;
let values = {
};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
let downloadUrl = `/blade-usermarketbenefitpackagelog/userMarketBenefitPackageLog/export-userMarketBenefitPackageLog?${
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)) {
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
@@ -191,10 +199,10 @@
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
@@ -203,10 +211,10 @@
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
const {} = this.query;
let values = {
phone: params.phone,
};
getList(page.currentPage, page.pageSize, values).then(res => {
@@ -216,10 +224,9 @@
this.loading = false;
this.selectionClear();
});
}
}
};
},
},
};
</script>
<style>
</style>
<style></style>

View File

@@ -73,7 +73,6 @@ import { downloadXls } from '@/utils/util';
import { dateNow } from '@/utils/date';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import { doGivePack } from '@/api/market/marketBenefitPackageTemplate';
export default {
data() {

View File

@@ -1,6 +1,7 @@
<template>
<basic-container>
<avue-crud :option="option"
<avue-crud
:option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
@@ -18,36 +19,37 @@
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
@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>-->
<!-- <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';
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 {
export default {
data() {
return {
form: {},
@@ -57,21 +59,21 @@
page: {
pageSize: 10,
currentPage: 1,
total: 0
total: 0,
},
selectionList: [],
option: option,
data: []
data: [],
};
},
computed: {
...mapGetters(["permission"]),
...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)
editBtn: this.validData(this.permission.userCommission_edit, false),
};
},
ids() {
@@ -79,41 +81,47 @@
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
return ids.join(',');
},
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
add(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
done();
}, error => {
},
error => {
loading();
window.console.log(error);
});
}
);
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
done();
}, error => {
},
error => {
loading();
console.log(error);
});
}
);
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
@@ -121,20 +129,20 @@
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
@@ -142,32 +150,32 @@
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
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"
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)) {
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
@@ -191,10 +199,10 @@
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
@@ -203,10 +211,10 @@
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
const {} = this.query;
let values = {
account: params.account,
};
getList(page.currentPage, page.pageSize, values).then(res => {
@@ -216,10 +224,9 @@
this.loading = false;
this.selectionClear();
});
}
}
};
},
},
};
</script>
<style>
</style>
<style></style>

View File

@@ -1,6 +1,7 @@
<template>
<basic-container>
<avue-crud :option="option"
<avue-crud
:option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
@@ -18,36 +19,37 @@
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
@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>-->
<!-- <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';
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 {
export default {
data() {
return {
form: {},
@@ -57,21 +59,21 @@
page: {
pageSize: 10,
currentPage: 1,
total: 0
total: 0,
},
selectionList: [],
option: option,
data: []
data: [],
};
},
computed: {
...mapGetters(["permission"]),
...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)
editBtn: this.validData(this.permission.userCommissionLog_edit, false),
};
},
ids() {
@@ -79,41 +81,47 @@
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
return ids.join(',');
},
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
add(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
done();
}, error => {
},
error => {
loading();
window.console.log(error);
});
}
);
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
done();
}, error => {
},
error => {
loading();
console.log(error);
});
}
);
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
@@ -121,20 +129,20 @@
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
@@ -142,32 +150,32 @@
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
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"
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)) {
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
@@ -191,10 +199,10 @@
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
@@ -203,10 +211,10 @@
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
const {} = this.query;
let values = {
account: params.account,
};
getList(page.currentPage, page.pageSize, values).then(res => {
@@ -216,10 +224,9 @@
this.loading = false;
this.selectionClear();
});
}
}
};
},
},
};
</script>
<style>
</style>
<style></style>