用户余额信息,铸源星记录更改

This commit is contained in:
faiz 2024-12-16 16:29:35 +08:00
parent 08dc0b82bb
commit 8180f957bb
6 changed files with 336 additions and 91 deletions

View File

@ -4,8 +4,8 @@ ENV = 'development'
# http://mer.crmeb.net/admin
# base api
# www.shop.xyz
VUE_APP_BASE_API = 'http://zkx.tropjoin.com'
# VUE_APP_BASE_API = 'http://testg.tropjoin.com'
# VUE_APP_BASE_API = 'http://zkx.tropjoin.com'
VUE_APP_BASE_API = 'http://testg.tropjoin.com'
# VUE_APP_BASE_API = 'https://api.tropjoin.com'
# socket 连接地址

View File

@ -373,6 +373,12 @@ export function integralLogTitle() {
export function integralLogLst(data) {
return request.get(`user/integral/lst`, data)
}
/**
* @description 用户余额信息 -- 列表
*/
export function userMoneyLogLst(data) {
return request.get(`user/money/list`, data)
}
/**
* @description 成长值 -- 列表
*/

View File

@ -48,6 +48,15 @@ const promoterRouter =
},
component: () => import('@/views/promoter/bankCard/index')
},
{
path: 'userInfo',
name: 'userInfo',
meta: {
title: '用户账户余额信息',
noCache: true
},
component: () => import('@/views/promoter/userInfo/index')
},
{
path: 'user',
name: 'AccountsUser',

View File

@ -1,7 +1,13 @@
<template>
<div class="divBox">
<div class="selCard mb14">
<el-form :model="tableFrom" ref="searchForm" inline size="small" label-width="85px">
<el-form
:model="tableFrom"
ref="searchForm"
inline
size="small"
label-width="85px"
>
<el-form-item label="选择时间:">
<el-date-picker
v-model="timeVal"
@ -11,14 +17,23 @@
type="daterange"
placement="bottom-end"
placeholder="自定义时间"
style="width: 280px;"
@change="onchangeTime"/>
style="width: 280px"
@change="onchangeTime"
/>
</el-form-item>
<el-form-item label="搜索:" prop="keyword">
<el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="请输入用户ID用户昵称、标题" class="selWidth" clearable />
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
placeholder="请输入用户ID用户昵称、标题、手机号、ID"
class="selWidth"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)">搜索</el-button>
<el-button type="primary" size="small" @click="getList(1)"
>搜索</el-button
>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
@ -34,8 +49,12 @@
<el-table-column label="铸源星标题" prop="title" min-width="120" />
<el-table-column label="铸源星变动" prop="number" min-width="90">
<template slot-scope="scope">
<span v-if="scope.row.pm==1" style="color: #ff3b30;">+{{scope.row.number}}</span>
<span v-if="scope.row.pm==0" style="color: #82e493;">-{{scope.row.number}}</span>
<span v-if="scope.row.pm == 1" style="color: #ff3b30"
>+{{ scope.row.number }}</span
>
<span v-if="scope.row.pm == 0" style="color: #82e493"
>-{{ scope.row.number }}</span
>
</template>
</el-table-column>
<el-table-column label="当前铸源星额度" prop="balance" min-width="90" />
@ -54,17 +73,19 @@
/>
</div>
</el-card>
</div>
</template>
<script>
import { integralLogTitle, integralLogLst, signLogExport } from '@/api/marketing'
import fileList from '@/components/exportFile/fileList'
import {
integralLogTitle,
integralLogLst,
signLogExport,
} from "@/api/marketing";
import fileList from "@/components/exportFile/fileList";
import cardsData from "@/components/cards/index";
import createWorkBook from '@/utils/newToExcel.js';
import {roterPre} from '@/settings'
import timeOptions from '@/utils/timeOptions';
import createWorkBook from "@/utils/newToExcel.js";
import { roterPre } from "@/settings";
import timeOptions from "@/utils/timeOptions";
export default {
name: "IntergralLog",
components: { fileList, cardsData },
@ -82,58 +103,63 @@ export default {
page: 1,
limit: 20,
keyword: "",
date: ""
date: "",
},
loading: false,
cardLists: [],
};
},
watch: {
},
watch: {},
mounted() {
this.getList('');
this.getList("");
this.getTitle();
},
methods: {
/**重置 */
searchReset() {
this.timeVal = []
this.tableFrom.date = ""
this.$refs.searchForm.resetFields()
this.getList(1)
this.timeVal = [];
this.tableFrom.date = "";
this.$refs.searchForm.resetFields();
this.getList(1);
},
//
onchangeTime(e) {
this.timeVal = e;
this.tableFrom.date = e ? this.timeVal.join("-") : "";
this.tableFrom.page = 1;
this.getList('');
this.getList("");
},
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
excelData.page = 1
excelData.limit = 100
let pageCount = 1
let excelData = JSON.parse(JSON.stringify(this.tableFrom)),
data = [];
excelData.page = 1;
excelData.limit = 100;
let pageCount = 1;
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData)
pageCount = Math.ceil(lebData.count/excelData.limit)
lebData = await this.downData(excelData);
pageCount = Math.ceil(lebData.count / excelData.limit);
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
data = data.concat(lebData.export);
excelData.page++;
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return
createWorkBook(
lebData.header,
lebData.title,
data,
lebData.foot,
lebData.filename
);
return;
},
/**列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
signLogExport(excelData).then((res) => {
return resolve(res.data)
})
})
return resolve(res.data);
});
});
},
//
exportRecord() {
@ -141,23 +167,25 @@ export default {
.then((res) => {
const h = this.$createElement;
this.$msgbox({
title: '提示',
message: h('p', null, [
h('span', null, '文件正在生成中,请稍后点击"'),
h('span', { style: 'color: teal' }, '导出记录'),
h('span', null, '"查看~ '),
title: "提示",
message: h("p", null, [
h("span", null, '文件正在生成中,请稍后点击"'),
h("span", { style: "color: teal" }, "导出记录"),
h("span", null, '"查看~ '),
]),
confirmButtonText: '我知道了',
}).then(action => {
confirmButtonText: "我知道了",
}).then((action) => {
this.$router.push({ path: this.roterPre + "/group/exportList" });
}); })
});
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getTitle() {
integralLogTitle().then((res) => {
integralLogTitle()
.then((res) => {
this.cardLists = res.data;
})
.catch((res) => {
@ -181,11 +209,11 @@ export default {
},
pageChange(page) {
this.tableFrom.page = page;
this.getList('');
this.getList("");
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList('');
this.getList("");
},
},
};

View File

@ -0,0 +1,203 @@
<template>
<div class="divBox">
<div class="selCard mb14">
<el-form
:model="tableFrom"
ref="searchForm"
inline
size="small"
label-width="85px"
>
<!-- <el-form-item label="选择时间:">
<el-date-picker
v-model="timeVal"
value-format="yyyy/MM/dd"
format="yyyy/MM/dd"
:picker-options="pickerOptions"
type="daterange"
placement="bottom-end"
placeholder="自定义时间"
style="width: 280px"
@change="onchangeTime"
/>
</el-form-item> -->
<el-form-item label="搜索:" prop="keyword">
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
placeholder="请输入ID,手机号,姓名,身份证号"
class="selWidth"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)"
>搜索</el-button
>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- <cards-data v-if="cardLists.length>0" :card-lists="cardLists" /> -->
<el-card>
<!-- <div class="mb20">
<el-button size="small" type="primary" @click="exports">导出</el-button>
</div> -->
<el-table v-loading="listLoading" :data="tableData.data" size="small">
<el-table-column prop="number" label="ID" min-width="50" />
<el-table-column label="姓名" prop="real_name" min-width="60" />
<el-table-column label="身份证号" prop="card_id" min-width="120" />
<el-table-column label="手机号码" prop="phone" min-width="120" />
<el-table-column label="奖励金" prop="total_bonus_price" min-width="120" />
<el-table-column label="可提现奖励金" prop="bonus_price" min-width="120" />
<el-table-column label="成长值" prop="brokerage_price" min-width="120" />
<el-table-column label="铸源星" prop="integral" min-width="120" />
<el-table-column label="能量" prop="energy_price" min-width="120" />
</el-table>
<div class="block">
<el-pagination
background
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import {
userMoneyLogLst,
signLogExport,
} from "@/api/marketing";
import createWorkBook from "@/utils/newToExcel.js";
import { roterPre } from "@/settings";
import timeOptions from "@/utils/timeOptions";
export default {
name: "userInfo",
data() {
return {
pickerOptions: timeOptions,
timeVal: [],
listLoading: false,
roterPre: roterPre,
tableData: {
data: [],
total: 0,
},
tableFrom: {
page: 1,
limit: 20,
keyword: "",
date: "",
},
loading: false,
cardLists: [],
};
},
watch: {},
mounted() {
this.getList("");
},
methods: {
/**重置 */
searchReset() {
this.timeVal = [];
this.tableFrom.date = "";
this.$refs.searchForm.resetFields();
this.getList(1);
},
//
onchangeTime(e) {
this.timeVal = e;
this.tableFrom.date = e ? this.timeVal.join("-") : "";
this.tableFrom.page = 1;
this.getList("");
},
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)),
data = [];
excelData.page = 1;
excelData.limit = 100;
let pageCount = 1;
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData);
pageCount = Math.ceil(lebData.count / excelData.limit);
if (lebData.export.length) {
data = data.concat(lebData.export);
excelData.page++;
}
}
createWorkBook(
lebData.header,
lebData.title,
data,
lebData.foot,
lebData.filename
);
return;
},
/**列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
signLogExport(excelData).then((res) => {
return resolve(res.data);
});
});
},
//
exportRecord() {
signLogExport(this.tableFrom)
.then((res) => {
const h = this.$createElement;
this.$msgbox({
title: "提示",
message: h("p", null, [
h("span", null, '文件正在生成中,请稍后点击"'),
h("span", { style: "color: teal" }, "导出记录"),
h("span", null, '"查看~ '),
]),
confirmButtonText: "我知道了",
}).then((action) => {
this.$router.push({ path: this.roterPre + "/group/exportList" });
});
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getList(num) {
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
userMoneyLogLst(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.listLoading = false;
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList("");
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList("");
},
},
};
</script>
<style scoped lang="scss">
.scollhide::-webkit-scrollbar {
display: none; /* Chrome Safari */
}
</style>

View File

@ -32,7 +32,6 @@
</template>
<script>
import guide from "@/components/settingGuide/index";
import { mapGetters } from "vuex";
import formCreate from "@form-create/element-ui";
@ -44,7 +43,7 @@ export default {
mixins: [guide],
provide() {
return {
type: this.types
type: this.types,
};
},
components: { formCreate: formCreate.$form() },
@ -57,7 +56,7 @@ export default {
roterPre: roterPre,
option: {
form: {
labelWidth: "200px"
labelWidth: "200px",
},
global: {
upload: {
@ -66,23 +65,23 @@ export default {
if (rep.status === 200) {
file.url = rep.data.src;
}
}
}
}
}
},
},
},
},
},
FromData: null,
titles: ""
titles: "",
};
},
watch: {
'$route.path': {
"$route.path": {
handler: function () {
this.setTagsViewTitle();
this.getFrom();
},
immediate: false,
deep: true
deep: true,
},
},
mounted() {
@ -90,10 +89,10 @@ export default {
this.getFrom();
},
computed: {
...mapGetters(["menuList"])
...mapGetters(["menuList"]),
},
created() {
console.log(this.$route);
console.log(this.$route.params.key);
let routerArr = this.$route.path.split("/");
let routeKey = routerArr[routerArr.length - 1];
this.getType(routeKey);
@ -103,26 +102,26 @@ export default {
getFrom() {
this.$route.params.key === "upload"
? uploadApi()
.then(async res => {
.then(async (res) => {
this.FromData = res.data;
})
.catch(res => {
.catch((res) => {
this.$message.error(res.message);
})
: configApi(this.$route.params.key)
.then(async res => {
.then(async (res) => {
this.FromData = res.data;
})
.catch(res => {
.catch((res) => {
this.$message.error(res.message);
});
},
onSubmit(formData) {
request[this.FromData.method.toLowerCase()](this.FromData.api, formData)
.then(res => {
.then((res) => {
this.$message.success(res.message || "提交成功");
})
.catch(err => {
.catch((err) => {
this.$message.error(err.message || "提交失败");
});
},
@ -134,7 +133,7 @@ export default {
deepTraversal(arr, child) {
const that = this;
function traversal(a) {
a.forEach(o => {
a.forEach((o) => {
if (
o.path &&
o.path.indexOf("Basics") !== -1 &&
@ -168,8 +167,8 @@ export default {
this.types = "";
this.title = "";
}
}
}
},
},
};
</script>