2026-03-03后台功能需求
1,积分流水以及订单新增导出,新增时间搜索 2,优化后台划拨福利包
This commit is contained in:
@@ -48,3 +48,16 @@ export const update = (row) => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const revokeBenefitPackInfo = (id) => {
|
||||
return request({
|
||||
url: '/market/benefit-package/revokeBenefitPackInfo',
|
||||
method: 'post',
|
||||
params: {
|
||||
id,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import request from '@/axios';
|
||||
|
||||
export const getList = (current, size, params) => {
|
||||
return request({
|
||||
url: '/market/benefit-package-log/list',
|
||||
url: '/market/benefit-package-log/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
|
||||
@@ -48,3 +48,5 @@ export const update = (row) => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import request from '@/axios';
|
||||
|
||||
|
||||
|
||||
export const getList = (current, size, params) => {
|
||||
return request({
|
||||
url: '/market-info/page',
|
||||
@@ -58,3 +60,38 @@ export const resetPassword = userIds => {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const benefitPackCountByUser = (userId) => {
|
||||
return request({
|
||||
url: '/market-info/benefitPackCountByUser',
|
||||
method: 'get',
|
||||
params: {
|
||||
userId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const getUserPointInfo = (userId) => {
|
||||
return request({
|
||||
url: '/market-info/getUserPointInfo',
|
||||
method: 'get',
|
||||
params: {
|
||||
userId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getUserMallSpend(userId) {
|
||||
return request({
|
||||
url: '/market-info/getUserMallSpend',
|
||||
method: 'get',
|
||||
params: {
|
||||
userId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
33
src/axios.js
33
src/axios.js
@@ -100,10 +100,41 @@ axios.interceptors.request.use(
|
||||
|
||||
//http response拦截
|
||||
axios.interceptors.response.use(
|
||||
res => {
|
||||
async res => {
|
||||
NProgress.done();
|
||||
//获取配置信息
|
||||
const config = res.config;
|
||||
|
||||
const isExportRequest = config.meta?.isExport || config.url.includes('/export');
|
||||
|
||||
// 如果是导出请求,且返回的数据是 Blob 类型
|
||||
// 处理导出excel时 , 后端参数报错能正确显示
|
||||
if (isExportRequest && res.data instanceof Blob) {
|
||||
// 检查 Blob 的类型,如果是 JSON,说明是后端报错了
|
||||
if (res.data.type && res.data.type.toLowerCase().indexOf('application/json') !== -1) {
|
||||
// 必须使用 FileReader 读取 Blob 内容
|
||||
const text = await res.data.text(); // 读取为文本
|
||||
let errorData;
|
||||
try {
|
||||
errorData = JSON.parse(text); // 尝试解析 JSON
|
||||
} catch (e) {
|
||||
// 如果解析失败(比如服务器500直接报错,不是标准JSON),直接抛出文本
|
||||
ElMessage.error('导出错误: ' + text);
|
||||
return Promise.reject(new Error('Export Error: ' + text));
|
||||
}
|
||||
|
||||
// 此时拿到了后端真正的错误信息
|
||||
const message = errorData.msg || errorData.error_description || '导出失败';
|
||||
|
||||
// 这里直接提示错误,阻止后续逻辑
|
||||
ElMessage.error(message);
|
||||
|
||||
// 返回一个 reject,这样你的 .then 会走到 .catch
|
||||
return Promise.reject(new Error(message));
|
||||
}
|
||||
// 如果不是 JSON Blob,说明是正常的文件流,直接返回 res,交给后续下载逻辑
|
||||
}
|
||||
|
||||
const cryptoData = config.cryptoData === true;
|
||||
//解析加密报文
|
||||
if (cryptoData) {
|
||||
|
||||
@@ -67,6 +67,37 @@ export default {
|
||||
url: 'link'
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
label: "规格",
|
||||
prop: "specs",
|
||||
type: "dynamic",
|
||||
span: 24,
|
||||
children:{
|
||||
rowAdd: (done)=>{
|
||||
done();
|
||||
},
|
||||
rowDel: (row, done) => {
|
||||
done();
|
||||
},
|
||||
column: [
|
||||
{
|
||||
label: "名称",
|
||||
prop: "attr",
|
||||
},
|
||||
{
|
||||
label: "值",
|
||||
prop: "value",
|
||||
}
|
||||
],
|
||||
},
|
||||
formatter: (row, value, cellValue) => {
|
||||
if (!Array.isArray(value)) return '';
|
||||
return value.map(s => `${s.attr} : ${s.value}`).join('; ');
|
||||
},
|
||||
overHidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
label: "数量",
|
||||
prop: "quantity",
|
||||
@@ -156,6 +187,22 @@ export default {
|
||||
type: "input",
|
||||
overHidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
label: "下单时间",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
search: true,
|
||||
searchRange: true,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
label: "修改人",
|
||||
prop: "updateUser",
|
||||
|
||||
@@ -80,6 +80,22 @@ export default {
|
||||
type: 'input',
|
||||
overHidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
search: true,
|
||||
searchRange: true,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
|
||||
@@ -87,6 +87,22 @@ export default {
|
||||
type: 'input',
|
||||
overHidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
search: true,
|
||||
searchRange: true,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
label: '创建人',
|
||||
prop: 'createUser',
|
||||
|
||||
@@ -26,46 +26,65 @@ export default {
|
||||
label: "积分包名称",
|
||||
prop: "packageName",
|
||||
type: "input",
|
||||
labelWidth: 160,
|
||||
},
|
||||
{
|
||||
label: "最大购买数量",
|
||||
prop: "userLimit",
|
||||
type: "input",
|
||||
type: "number",
|
||||
labelWidth: 160,
|
||||
},
|
||||
{
|
||||
label: "全网最大兑换数量",
|
||||
prop: "maxLimit",
|
||||
type: "input",
|
||||
type: "number",
|
||||
labelWidth: 160,
|
||||
},
|
||||
{
|
||||
label: "产出总天数",
|
||||
prop: "dayLimit",
|
||||
type: "input",
|
||||
type: "number",
|
||||
labelWidth: 120,
|
||||
},
|
||||
{
|
||||
label: "总产出福利积分",
|
||||
prop: "benefitPointAmount",
|
||||
type: "input",
|
||||
type: "number",
|
||||
labelWidth: 160,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: "购买赠与福利值",
|
||||
prop: "benefitValueAmount",
|
||||
type: "input",
|
||||
type: "number",
|
||||
labelWidth: 160,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: "兑换包需要的福利积分",
|
||||
prop: "benefitPointPrice",
|
||||
type: "input",
|
||||
type: "number",
|
||||
labelWidth: 170,
|
||||
width : 170,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: "兑换包需要的现金券",
|
||||
prop: "cashCouponPrice",
|
||||
type: "input",
|
||||
type: "number",
|
||||
labelWidth: 160,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: "已兑换数量",
|
||||
prop: "exchangedQuantity",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: "创建人",
|
||||
|
||||
@@ -84,9 +84,27 @@ export default {
|
||||
{
|
||||
label: '统计时间',
|
||||
prop: 'statisticalDate',
|
||||
type: 'input',
|
||||
type: 'date',
|
||||
overHidden: true,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
search: true,
|
||||
searchRange: true,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
|
||||
@@ -81,6 +81,22 @@ export default {
|
||||
type: 'input',
|
||||
overHidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
search: true,
|
||||
searchRange: true,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
|
||||
@@ -87,6 +87,22 @@ export default {
|
||||
type: 'input',
|
||||
overHidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
search: true,
|
||||
searchRange: true,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
@size-change="sizeChange"
|
||||
@refresh-change="refreshChange"
|
||||
@on-load="onLoad">
|
||||
<!-- <template #menu-left>-->
|
||||
<template #menu-left>
|
||||
<!-- <el-button type="danger"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- plain-->
|
||||
@@ -31,7 +31,18 @@
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- @click="handleExport">导 出-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </template>-->
|
||||
<el-button type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="openExportBox">导 出 订 单
|
||||
</el-button>
|
||||
|
||||
<el-button type="success"
|
||||
plain
|
||||
icon="el-icon-upload"
|
||||
@click="openImportOrderBox">批 量 导 入 补 单
|
||||
</el-button>
|
||||
</template>
|
||||
<template #menu="{ row }">
|
||||
<el-button type="text"
|
||||
icon="el-icon-circle-check"
|
||||
@@ -45,6 +56,27 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog :title="`导出用户订单`" append-to-body v-model="exportOrderBox" width="1000px">
|
||||
<avue-form
|
||||
:option="exportOrderOption"
|
||||
:data="exportOrderData"
|
||||
v-model="exportOrderFrom"
|
||||
@submit="exportOrderSubmit"
|
||||
ref="stateCrud"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="批量导入补单" append-to-body v-model="excelBox" width="555px">
|
||||
<avue-form :option="excelOption" v-model="excelForm" :upload-after="excelUploadAfter">
|
||||
<template #excelTemplate>
|
||||
<el-button type="primary" @click="handleTemplate">
|
||||
点击下载<i class="el-icon-download el-icon--right"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-form>
|
||||
</el-dialog>
|
||||
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -73,7 +105,65 @@ import {getList, getDetail, add, update, remove, confirmPayment, fillExpress} fr
|
||||
},
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: []
|
||||
data: [],
|
||||
|
||||
|
||||
exportOrderBox: false,
|
||||
exportOrderOption: {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '账号',
|
||||
prop: 'account',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
searchRange: true,
|
||||
rules: [
|
||||
{ required: true, message: "时间范围不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
exportOrderData: '',
|
||||
exportOrderFrom: {},
|
||||
|
||||
excelBox: false,
|
||||
excelForm: {},
|
||||
excelOption: {
|
||||
submitBtn: false,
|
||||
emptyBtn: false,
|
||||
column: [
|
||||
{
|
||||
label: '上传补单',
|
||||
labelWidth: 200,
|
||||
prop: 'excelFile',
|
||||
type: 'upload',
|
||||
drag: true,
|
||||
loadText: '模板上传中,请稍等',
|
||||
span: 24,
|
||||
propsHttp: {
|
||||
res: 'data',
|
||||
},
|
||||
tip: '请上传 .xls,.xlsx 标准格式文件',
|
||||
action: '/common/order/import-user-back-order',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -256,7 +346,55 @@ import {getList, getDetail, add, update, remove, confirmPayment, fillExpress} fr
|
||||
this.loading = false;
|
||||
this.selectionClear();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
openExportBox(){
|
||||
this.exportOrderBox = true;
|
||||
},
|
||||
|
||||
exportOrderSubmit(form, done){
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
`/common/order/exportOrderToExcel?${
|
||||
this.website.tokenHeader
|
||||
}=${getToken()}&account=${form.account}&searchDateRange=${form.searchDateRange}`
|
||||
).then(res => {
|
||||
console.log("打印:" , res)
|
||||
downloadXls(res.data, `用户订单表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
|
||||
NProgress.done();
|
||||
|
||||
});
|
||||
|
||||
done();
|
||||
this.exportOrderBox = false;
|
||||
},
|
||||
|
||||
openImportOrderBox(){
|
||||
this.excelBox = true;
|
||||
},
|
||||
|
||||
excelUploadAfter(res, done, loading, column) {
|
||||
window.console.log(column);
|
||||
|
||||
if (res.length) {
|
||||
const errMsg = res
|
||||
.map(
|
||||
(item, idx) =>
|
||||
`${idx + 1}. ${item.errorMsg} 订单号: ${item.orderNo} 金额: ${item.amount}`
|
||||
)
|
||||
.join('<br><br>');
|
||||
|
||||
this.$alert(errMsg, '导入失败', {
|
||||
confirmButtonText: '我知道了',
|
||||
type: 'error',
|
||||
dangerouslyUseHTMLString: true, //
|
||||
customClass: 'alert-error-list', //
|
||||
});
|
||||
}
|
||||
this.excelBox = false;
|
||||
done();
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -33,8 +33,26 @@
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- @click="handleExport">导 出-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<el-button type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="openExportBox">导 出 流 水
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog :title="`导出用户积分流水`" append-to-body v-model="exportFlowBox" width="1000px">
|
||||
<avue-form
|
||||
:option="exportFlowOption"
|
||||
:data="exportFlowData"
|
||||
v-model="exportFlowFrom"
|
||||
@submit="exportFlowSubmit"
|
||||
ref="stateCrud"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -64,6 +82,40 @@ export default {
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
|
||||
exportFlowBox: false,
|
||||
exportFlowOption: {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '账号',
|
||||
prop: 'account',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
searchRange: true,
|
||||
rules: [
|
||||
{ required: true, message: "时间范围不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
exportFlowData: '',
|
||||
exportFlowFrom: {},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -225,6 +277,25 @@ export default {
|
||||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
|
||||
openExportBox(){
|
||||
this.exportFlowBox = true;
|
||||
},
|
||||
|
||||
exportFlowSubmit(form, done){
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
`/common/user-point-log/exportFlowToExcel?${
|
||||
this.website.tokenHeader
|
||||
}=${getToken()}&account=${form.account}&searchDateRange=${form.searchDateRange}`
|
||||
).then(res => {
|
||||
downloadXls(res.data, `用户积分流水表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
|
||||
NProgress.done();
|
||||
});
|
||||
this.exportFlowBox = false;
|
||||
done();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -33,13 +33,55 @@
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- @click="handleExport">导 出-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<el-button type="success" plain icon="el-icon-upload" @click="importBenefitPackage">
|
||||
批量导入福利包
|
||||
</el-button>
|
||||
|
||||
<el-button type="success" plain icon="el-icon-upload" @click="openGivePack">
|
||||
划拨福利包
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
|
||||
<template #menu="{ row }">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-document"
|
||||
size="small"
|
||||
v-if="row.type === 2 && row.status === 2 && row.outDay === 0"
|
||||
@click="revokeBenefitPackage(row)">
|
||||
撤销福利包
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog :title="`划拨积分包`" append-to-body v-model="givePackBox" width="1000px">
|
||||
<avue-form
|
||||
:option="givePackOption"
|
||||
:data="givePackData"
|
||||
v-model="givePackFrom"
|
||||
@submit="allocatePackageSubmit"
|
||||
ref="stateCrud"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="用户福利包导入" append-to-body v-model="excelBox" width="555px">
|
||||
<avue-form :option="excelOption" v-model="excelForm" :upload-after="excelUploadAfter">
|
||||
<template #excelTemplate>
|
||||
<el-button type="primary" @click="handleTemplate">
|
||||
点击下载<i class="el-icon-download el-icon--right"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-form>
|
||||
</el-dialog>
|
||||
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getList, getDetail, add, update, remove } from '@/api/market/marketBenefitPackage';
|
||||
import { getList, getDetail, add, update, remove , revokeBenefitPackInfo} from '@/api/market/marketBenefitPackage';
|
||||
import option from '@/option/market/marketBenefitPackage';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { exportBlob } from '@/api/common';
|
||||
@@ -48,6 +90,7 @@ import { downloadXls } from '@/utils/util';
|
||||
import { dateNow } from '@/utils/date';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
import { allocatePackage } from '@/api/market/marketBenefitPackageTemplate';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -64,6 +107,102 @@ export default {
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
|
||||
givePackBox: false,
|
||||
givePackOption: {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
|
||||
{
|
||||
label: '福利包',
|
||||
prop: 'packId',
|
||||
type: 'select',
|
||||
props: {
|
||||
label: 'name',
|
||||
value: 'code'
|
||||
},
|
||||
dicUrl: `/api/market/benefit-package-template/list`,
|
||||
dicFormatter: (res) => {
|
||||
console.log("打印原始数据:",res);
|
||||
const list = res.data.records || res || [];
|
||||
|
||||
// 2. 使用 map 遍历数组,将 packageName -> name, id -> code
|
||||
return list.map(item => {
|
||||
return {
|
||||
name: item.packageName, // 把后端的 packageName 赋值给 name
|
||||
code: item.id // 把后端的 id 赋值给 code
|
||||
};
|
||||
});
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择福利包',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
label: '账号',
|
||||
prop: 'userPhone',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '划拨数量',
|
||||
prop: 'giveNumber',
|
||||
type: 'number',
|
||||
value : 1,
|
||||
rules: [
|
||||
{ required: true, message: "划拨数量不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
givePackData: '',
|
||||
givePackFrom: {
|
||||
id: '',
|
||||
},
|
||||
|
||||
excelBox: false,
|
||||
excelForm: {},
|
||||
excelOption: {
|
||||
submitBtn: false,
|
||||
emptyBtn: false,
|
||||
column: [
|
||||
{
|
||||
label: '上传用户福利包',
|
||||
labelWidth: 200,
|
||||
prop: 'excelFile',
|
||||
type: 'upload',
|
||||
drag: true,
|
||||
loadText: '模板上传中,请稍等',
|
||||
span: 24,
|
||||
propsHttp: {
|
||||
res: 'data',
|
||||
},
|
||||
tip: '请上传 .xls,.xlsx 标准格式文件',
|
||||
action: '/market/benefit-package-template/import-benefit-package',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -225,6 +364,89 @@ export default {
|
||||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
openGivePack() {
|
||||
this.givePackBox = true;
|
||||
|
||||
},
|
||||
|
||||
allocatePackageSubmit(form, done) {
|
||||
const data = {
|
||||
packId: form.packId,
|
||||
phone: form.userPhone,
|
||||
giveNumber: form.giveNumber,
|
||||
remark: form.remark,
|
||||
};
|
||||
|
||||
allocatePackage(data).then(
|
||||
() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
});
|
||||
done();
|
||||
this.givePackBox = false;
|
||||
this.givePackFrom = {
|
||||
id: '',
|
||||
userPhone: '',
|
||||
giveNumber: '',
|
||||
remark: '',
|
||||
};
|
||||
},
|
||||
error => {
|
||||
done();
|
||||
this.givePackBox = false;
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
importBenefitPackage() {
|
||||
this.excelBox = true;
|
||||
},
|
||||
|
||||
excelUploadAfter(res, done, loading, column) {
|
||||
window.console.log(column);
|
||||
|
||||
if (res.length) {
|
||||
const errMsg = res
|
||||
.map(
|
||||
(item, idx) =>
|
||||
`${idx + 1}. ${item.errorMsg} 账户: ${item.account} 福利包: ${item.benefitPackage}`
|
||||
)
|
||||
.join('<br><br>');
|
||||
|
||||
this.$alert(errMsg, '导入失败', {
|
||||
confirmButtonText: '我知道了',
|
||||
type: 'error',
|
||||
dangerouslyUseHTMLString: true, //
|
||||
customClass: 'alert-error-list', //
|
||||
});
|
||||
}
|
||||
this.excelBox = false;
|
||||
done();
|
||||
},
|
||||
|
||||
revokeBenefitPackage(row){
|
||||
this.$confirm('确定将划拨的福利包撤回吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
return revokeBenefitPackInfo(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -33,8 +33,26 @@
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- @click="handleExport">导 出-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<el-button type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="openExportBox">导 出 划 拨 记 录
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog :title="`导出福利积分流水`" append-to-body v-model="exportFlowBox" width="1000px">
|
||||
<avue-form
|
||||
:option="exportFlowOption"
|
||||
:data="exportFlowData"
|
||||
v-model="exportFlowFrom"
|
||||
@submit="exportFlowSubmit"
|
||||
ref="stateCrud"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -64,6 +82,40 @@ export default {
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
|
||||
exportFlowBox: false,
|
||||
exportFlowOption: {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '账号',
|
||||
prop: 'account',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
searchRange: true,
|
||||
rules: [
|
||||
{ required: true, message: "时间范围不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
exportFlowData: '',
|
||||
exportFlowFrom: {},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -215,6 +267,7 @@ export default {
|
||||
|
||||
let values = {
|
||||
phone: params.phone,
|
||||
searchDateRange : params.searchDateRange,
|
||||
};
|
||||
|
||||
getList(page.currentPage, page.pageSize, values).then(res => {
|
||||
@@ -225,6 +278,25 @@ export default {
|
||||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
|
||||
openExportBox(){
|
||||
this.exportFlowBox = true;
|
||||
},
|
||||
|
||||
exportFlowSubmit(form, done){
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
`/market/benefit-package-log/exportFlowToExcel?${
|
||||
this.website.tokenHeader
|
||||
}=${getToken()}&account=${form.account}&searchDateRange=${form.searchDateRange}`
|
||||
).then(res => {
|
||||
downloadXls(res.data, `划拨福利包记录表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
|
||||
NProgress.done();
|
||||
});
|
||||
this.exportFlowBox = false;
|
||||
done();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -34,15 +34,15 @@
|
||||
<!-- @click="handleExport">导 出-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<el-button type="success" plain icon="el-icon-upload" @click="importBenefitPackage"
|
||||
>批量导入福利包
|
||||
</el-button>
|
||||
<!-- <el-button type="success" plain icon="el-icon-upload" @click="importBenefitPackage"-->
|
||||
<!-- >批量导入福利包-->
|
||||
<!-- </el-button>-->
|
||||
</template>
|
||||
|
||||
<template #menu="{ row }">
|
||||
<el-button type="text" icon="el-icon-document" size="small" @click="openGivePack(row)"
|
||||
>划拨福利包
|
||||
</el-button>
|
||||
<!-- <el-button type="text" icon="el-icon-document" size="small" @click="openGivePack(row)"-->
|
||||
<!-- >划拨福利包-->
|
||||
<!-- </el-button>-->
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
@@ -111,20 +111,29 @@ export default {
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '账户',
|
||||
label: '账号',
|
||||
prop: 'userPhone',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '划拨数量',
|
||||
prop: 'giveNumber',
|
||||
type: 'input',
|
||||
type: 'number',
|
||||
rules: [
|
||||
{ required: true, message: "划拨数量不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -33,8 +33,26 @@
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- @click="handleExport">导 出-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<el-button type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="openExportBox">导 出 流 水
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog :title="`导出福利积分流水`" append-to-body v-model="exportFlowBox" width="1000px">
|
||||
<avue-form
|
||||
:option="exportFlowOption"
|
||||
:data="exportFlowData"
|
||||
v-model="exportFlowFrom"
|
||||
@submit="exportFlowSubmit"
|
||||
ref="stateCrud"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -64,6 +82,40 @@ export default {
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
|
||||
exportFlowBox: false,
|
||||
exportFlowOption: {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '账号',
|
||||
prop: 'account',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
searchRange: true,
|
||||
rules: [
|
||||
{ required: true, message: "时间范围不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
exportFlowData: '',
|
||||
exportFlowFrom: {},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -212,9 +264,9 @@ export default {
|
||||
this.loading = true;
|
||||
|
||||
const {} = this.query;
|
||||
|
||||
let values = {
|
||||
account: params.account,
|
||||
searchDateRange : params.searchDateRange,
|
||||
};
|
||||
|
||||
getList(page.currentPage, page.pageSize, values).then(res => {
|
||||
@@ -225,6 +277,25 @@ export default {
|
||||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
|
||||
openExportBox(){
|
||||
this.exportFlowBox = true;
|
||||
},
|
||||
|
||||
exportFlowSubmit(form, done){
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
`/market/benefit-point-log/exportFlowToExcel?${
|
||||
this.website.tokenHeader
|
||||
}=${getToken()}&account=${form.account}&searchDateRange=${form.searchDateRange}`
|
||||
).then(res => {
|
||||
downloadXls(res.data, `用户福利值流水表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
|
||||
NProgress.done();
|
||||
});
|
||||
this.exportFlowBox = false;
|
||||
done();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -33,8 +33,25 @@
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- @click="handleExport">导 出-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<el-button type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="openExportBox">导 出 流 水
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog :title="`导出现金券流水`" append-to-body v-model="exportFlowBox" width="1000px">
|
||||
<avue-form
|
||||
:option="exportFlowOption"
|
||||
:data="exportFlowData"
|
||||
v-model="exportFlowFrom"
|
||||
@submit="exportFlowSubmit"
|
||||
ref="stateCrud"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -64,6 +81,40 @@ export default {
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
|
||||
exportFlowBox: false,
|
||||
exportFlowOption: {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '账户',
|
||||
prop: 'account',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
searchRange: true,
|
||||
rules: [
|
||||
{ required: true, message: "时间范围不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
exportFlowData: '',
|
||||
exportFlowFrom: {},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -225,6 +276,26 @@ export default {
|
||||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
|
||||
openExportBox(){
|
||||
this.exportFlowBox = true;
|
||||
},
|
||||
|
||||
exportFlowSubmit(form, done){
|
||||
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
`/market/cash-coupon-log/exportFlowToExcel?${
|
||||
this.website.tokenHeader
|
||||
}=${getToken()}&account=${form.account}&searchDateRange=${form.searchDateRange}`
|
||||
).then(res => {
|
||||
downloadXls(res.data, `用户现金券流水表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
|
||||
NProgress.done();
|
||||
});
|
||||
this.exportFlowBox = false;
|
||||
done();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -39,8 +39,63 @@
|
||||
v-if="row.paymentType === 99 && row.orderStatus === 0"
|
||||
@click.stop="handleConfirm(row)">团队详情
|
||||
</el-button>
|
||||
|
||||
<el-button type="text"
|
||||
icon="el-icon-document"
|
||||
@click.stop="benefitPackInfoOpen(row)">福利包信息
|
||||
</el-button>
|
||||
|
||||
<el-button type="text"
|
||||
icon="el-icon-document"
|
||||
@click.stop="userPointInfoOpen(row)">查询积分
|
||||
</el-button>
|
||||
|
||||
<el-button type="text"
|
||||
icon="el-icon-document"
|
||||
@click.stop="userMallSpendOpen(row)">累计消费
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
|
||||
</avue-crud>
|
||||
|
||||
<el-drawer :title="`账户 [${userAccount}] 福利包明细`" v-model="benefitPackBox" :direction="direction" append-to-body
|
||||
size="800px">
|
||||
<basic-container>
|
||||
<avue-crud :option="benefitPackOption"
|
||||
:data="benefitPackData"
|
||||
ref="crudSub"
|
||||
>
|
||||
</avue-crud>
|
||||
</basic-container>
|
||||
</el-drawer>
|
||||
|
||||
<el-drawer :title="`账户 [${userAccount}] 积分信息`" v-model="userPointInfoBox" :direction="direction" append-to-body
|
||||
size="800px">
|
||||
<basic-container>
|
||||
<avue-crud :option="userPointInfoOption"
|
||||
:data="userPointInfoData"
|
||||
ref="crudSub"
|
||||
>
|
||||
</avue-crud>
|
||||
</basic-container>
|
||||
</el-drawer>
|
||||
|
||||
|
||||
<el-drawer :title="`账户 [${userAccount}] 累计消费`" v-model="userMallSpendBox" :direction="direction" append-to-body
|
||||
size="800px">
|
||||
<basic-container>
|
||||
<avue-crud :option="userMallSpendOption"
|
||||
:data="userMallSpendData"
|
||||
ref="crudSub"
|
||||
>
|
||||
</avue-crud>
|
||||
</basic-container>
|
||||
</el-drawer>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <el-drawer :title="`${username} ${serialNumber} `" v-model="subVisible" :direction="direction"-->
|
||||
<!-- append-to-body-->
|
||||
<!-- :before-close="handleSubClose" size="90%">-->
|
||||
@@ -87,7 +142,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getList, getDetail, add, update, remove, resetPassword} from "@/api/market/marketInfo";
|
||||
import {getList, getDetail, add, update, remove, resetPassword , benefitPackCountByUser , getUserPointInfo , getUserMallSpend} from "@/api/market/marketInfo";
|
||||
import option from "@/option/market/marketInfo";
|
||||
import {mapGetters} from "vuex";
|
||||
import {exportBlob} from "@/api/common";
|
||||
@@ -112,7 +167,89 @@
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
username: "用户账号"
|
||||
username: "用户账号",
|
||||
|
||||
userAccount : "",
|
||||
direction : "rtl",
|
||||
benefitPackBox: false,
|
||||
benefitPackOption : {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '福利包',
|
||||
prop: 'packName',
|
||||
type: 'input',
|
||||
},
|
||||
{
|
||||
label: '数量',
|
||||
prop: 'count',
|
||||
type: 'number',
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
benefitPackData : [],
|
||||
|
||||
|
||||
userPointInfoBox: false,
|
||||
userPointInfoOption : {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '用户积分',
|
||||
prop: 'userPoint',
|
||||
type: 'input',
|
||||
},
|
||||
|
||||
{
|
||||
label: '福利积分',
|
||||
prop: 'benefitPoint',
|
||||
type: 'input',
|
||||
},
|
||||
|
||||
{
|
||||
label: '现金券',
|
||||
prop: 'cashCoupon',
|
||||
type: 'input',
|
||||
},
|
||||
|
||||
{
|
||||
label: '佣金',
|
||||
prop: 'userCommission',
|
||||
type: 'input',
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
},
|
||||
userPointInfoData : [],
|
||||
|
||||
userMallSpendBox: false,
|
||||
userMallSpendOption : {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '商城消费(元)',
|
||||
prop: 'amount',
|
||||
type: 'input',
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
userMallSpendData : [],
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -281,7 +418,38 @@
|
||||
this.loading = false;
|
||||
this.selectionClear();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
benefitPackInfoOpen(row){
|
||||
this.benefitPackBox = true;
|
||||
this.userAccount = row.account;
|
||||
benefitPackCountByUser(row.id)
|
||||
.then(res => {
|
||||
this.benefitPackData = res.data.data;
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
userPointInfoOpen(row){
|
||||
this.userPointInfoBox = true;
|
||||
this.userAccount = row.account;
|
||||
getUserPointInfo(row.id)
|
||||
.then(res => {
|
||||
this.userPointInfoData.push(res.data.data);
|
||||
})
|
||||
},
|
||||
|
||||
userMallSpendOpen(row){
|
||||
this.userMallSpendBox = true;
|
||||
this.userAccount = row.account;
|
||||
|
||||
getUserMallSpend(row.id)
|
||||
.then(res => {
|
||||
this.userMallSpendData.push(res.data.data);
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -33,8 +33,26 @@
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- @click="handleExport">导 出-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<el-button type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="openExportBox">导 出 流 水
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog :title="`导出佣金流水`" append-to-body v-model="exportFlowBox" width="1000px">
|
||||
<avue-form
|
||||
:option="exportFlowOption"
|
||||
:data="exportFlowData"
|
||||
v-model="exportFlowFrom"
|
||||
@submit="exportFlowSubmit"
|
||||
ref="stateCrud"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -64,6 +82,40 @@ export default {
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: [],
|
||||
|
||||
exportFlowBox: false,
|
||||
exportFlowOption: {
|
||||
addBtn: false,
|
||||
editBtn: true,
|
||||
delBtn: false,
|
||||
menu: false,
|
||||
labelWidth: 200,
|
||||
column: [
|
||||
{
|
||||
label: '账号',
|
||||
prop: 'account',
|
||||
type: 'input',
|
||||
rules: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "时间范围",
|
||||
prop: "searchDateRange", // 关键点:这个prop将绑定一个数组
|
||||
type: 'datetimerange',
|
||||
format: 'YYYY-MM-DD hh:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
||||
searchRange: true,
|
||||
rules: [
|
||||
{ required: true, message: "时间范围不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
exportFlowData: '',
|
||||
exportFlowFrom: {},
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -225,6 +277,25 @@ export default {
|
||||
this.selectionClear();
|
||||
});
|
||||
},
|
||||
|
||||
openExportBox(){
|
||||
this.exportFlowBox = true;
|
||||
},
|
||||
|
||||
exportFlowSubmit(form, done){
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
`/market/benefit-commission-log/exportFlowToExcel?${
|
||||
this.website.tokenHeader
|
||||
}=${getToken()}&account=${form.account}&searchDateRange=${form.searchDateRange}`
|
||||
).then(res => {
|
||||
downloadXls(res.data, `用户佣金流水表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`);
|
||||
NProgress.done();
|
||||
});
|
||||
this.exportFlowBox = false;
|
||||
done();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user