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

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 # http://mer.crmeb.net/admin
# base api # base api
# www.shop.xyz # www.shop.xyz
VUE_APP_BASE_API = 'http://zkx.tropjoin.com' # VUE_APP_BASE_API = 'http://zkx.tropjoin.com'
# VUE_APP_BASE_API = 'http://testg.tropjoin.com' VUE_APP_BASE_API = 'http://testg.tropjoin.com'
# VUE_APP_BASE_API = 'https://api.tropjoin.com' # VUE_APP_BASE_API = 'https://api.tropjoin.com'
# socket 连接地址 # socket 连接地址

View File

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

View File

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

View File

@ -1,7 +1,13 @@
<template> <template>
<div class="divBox"> <div class="divBox">
<div class="selCard mb14"> <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-form-item label="选择时间:">
<el-date-picker <el-date-picker
v-model="timeVal" v-model="timeVal"
@ -11,14 +17,23 @@
type="daterange" type="daterange"
placement="bottom-end" placement="bottom-end"
placeholder="自定义时间" placeholder="自定义时间"
style="width: 280px;" style="width: 280px"
@change="onchangeTime"/> @change="onchangeTime"
/>
</el-form-item> </el-form-item>
<el-form-item label="搜索:" prop="keyword"> <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-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-button size="small" @click="searchReset()">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -34,8 +49,12 @@
<el-table-column label="铸源星标题" prop="title" min-width="120" /> <el-table-column label="铸源星标题" prop="title" min-width="120" />
<el-table-column label="铸源星变动" prop="number" min-width="90"> <el-table-column label="铸源星变动" prop="number" min-width="90">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.pm==1" style="color: #ff3b30;">+{{scope.row.number}}</span> <span v-if="scope.row.pm == 1" style="color: #ff3b30"
<span v-if="scope.row.pm==0" style="color: #82e493;">-{{scope.row.number}}</span> >+{{ scope.row.number }}</span
>
<span v-if="scope.row.pm == 0" style="color: #82e493"
>-{{ scope.row.number }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="当前铸源星额度" prop="balance" min-width="90" /> <el-table-column label="当前铸源星额度" prop="balance" min-width="90" />
@ -54,17 +73,19 @@
/> />
</div> </div>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import {
import { integralLogTitle, integralLogLst, signLogExport } from '@/api/marketing' integralLogTitle,
import fileList from '@/components/exportFile/fileList' integralLogLst,
signLogExport,
} from "@/api/marketing";
import fileList from "@/components/exportFile/fileList";
import cardsData from "@/components/cards/index"; import cardsData from "@/components/cards/index";
import createWorkBook from '@/utils/newToExcel.js'; import createWorkBook from "@/utils/newToExcel.js";
import {roterPre} from '@/settings' import { roterPre } from "@/settings";
import timeOptions from '@/utils/timeOptions'; import timeOptions from "@/utils/timeOptions";
export default { export default {
name: "IntergralLog", name: "IntergralLog",
components: { fileList, cardsData }, components: { fileList, cardsData },
@ -82,58 +103,63 @@ export default {
page: 1, page: 1,
limit: 20, limit: 20,
keyword: "", keyword: "",
date: "" date: "",
}, },
loading: false, loading: false,
cardLists: [], cardLists: [],
}; };
}, },
watch: { watch: {},
},
mounted() { mounted() {
this.getList(''); this.getList("");
this.getTitle(); this.getTitle();
}, },
methods: { methods: {
/**重置 */ /**重置 */
searchReset() { searchReset() {
this.timeVal = [] this.timeVal = [];
this.tableFrom.date = "" this.tableFrom.date = "";
this.$refs.searchForm.resetFields() this.$refs.searchForm.resetFields();
this.getList(1) this.getList(1);
}, },
// //
onchangeTime(e) { onchangeTime(e) {
this.timeVal = e; this.timeVal = e;
this.tableFrom.date = e ? this.timeVal.join("-") : ""; this.tableFrom.date = e ? this.timeVal.join("-") : "";
this.tableFrom.page = 1; this.tableFrom.page = 1;
this.getList(''); this.getList("");
}, },
async exports() { async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = [] let excelData = JSON.parse(JSON.stringify(this.tableFrom)),
excelData.page = 1 data = [];
excelData.limit = 100 excelData.page = 1;
let pageCount = 1 excelData.limit = 100;
let pageCount = 1;
let lebData = {}; let lebData = {};
for (let i = 0; i < pageCount; i++) { for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData) lebData = await this.downData(excelData);
pageCount = Math.ceil(lebData.count/excelData.limit) pageCount = Math.ceil(lebData.count / excelData.limit);
if (lebData.export.length) { if (lebData.export.length) {
data = data.concat(lebData.export) data = data.concat(lebData.export);
excelData.page++ excelData.page++;
} }
} }
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename); createWorkBook(
return lebData.header,
lebData.title,
data,
lebData.foot,
lebData.filename
);
return;
}, },
/**列表 */ /**列表 */
downData(excelData) { downData(excelData) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
signLogExport(excelData).then((res) => { signLogExport(excelData).then((res) => {
return resolve(res.data) return resolve(res.data);
}) });
}) });
}, },
// //
exportRecord() { exportRecord() {
@ -141,23 +167,25 @@ export default {
.then((res) => { .then((res) => {
const h = this.$createElement; const h = this.$createElement;
this.$msgbox({ this.$msgbox({
title: '提示', title: "提示",
message: h('p', null, [ message: h("p", null, [
h('span', null, '文件正在生成中,请稍后点击"'), h("span", null, '文件正在生成中,请稍后点击"'),
h('span', { style: 'color: teal' }, '导出记录'), h("span", { style: "color: teal" }, "导出记录"),
h('span', null, '"查看~ '), h("span", null, '"查看~ '),
]), ]),
confirmButtonText: '我知道了', confirmButtonText: "我知道了",
}).then(action => { }).then((action) => {
this.$router.push({ path: this.roterPre + "/group/exportList" }); this.$router.push({ path: this.roterPre + "/group/exportList" });
}); }) });
})
.catch((res) => { .catch((res) => {
this.$message.error(res.message); this.$message.error(res.message);
}); });
}, },
// //
getTitle() { getTitle() {
integralLogTitle().then((res) => { integralLogTitle()
.then((res) => {
this.cardLists = res.data; this.cardLists = res.data;
}) })
.catch((res) => { .catch((res) => {
@ -181,11 +209,11 @@ export default {
}, },
pageChange(page) { pageChange(page) {
this.tableFrom.page = page; this.tableFrom.page = page;
this.getList(''); this.getList("");
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.tableFrom.limit = 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> </template>
<script> <script>
import guide from "@/components/settingGuide/index"; import guide from "@/components/settingGuide/index";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import formCreate from "@form-create/element-ui"; import formCreate from "@form-create/element-ui";
@ -44,7 +43,7 @@ export default {
mixins: [guide], mixins: [guide],
provide() { provide() {
return { return {
type: this.types type: this.types,
}; };
}, },
components: { formCreate: formCreate.$form() }, components: { formCreate: formCreate.$form() },
@ -57,7 +56,7 @@ export default {
roterPre: roterPre, roterPre: roterPre,
option: { option: {
form: { form: {
labelWidth: "200px" labelWidth: "200px",
}, },
global: { global: {
upload: { upload: {
@ -66,23 +65,23 @@ export default {
if (rep.status === 200) { if (rep.status === 200) {
file.url = rep.data.src; file.url = rep.data.src;
} }
} },
} },
} },
} },
}, },
FromData: null, FromData: null,
titles: "" titles: "",
}; };
}, },
watch: { watch: {
'$route.path': { "$route.path": {
handler: function () { handler: function () {
this.setTagsViewTitle(); this.setTagsViewTitle();
this.getFrom(); this.getFrom();
}, },
immediate: false, immediate: false,
deep: true deep: true,
}, },
}, },
mounted() { mounted() {
@ -90,10 +89,10 @@ export default {
this.getFrom(); this.getFrom();
}, },
computed: { computed: {
...mapGetters(["menuList"]) ...mapGetters(["menuList"]),
}, },
created() { created() {
console.log(this.$route); console.log(this.$route.params.key);
let routerArr = this.$route.path.split("/"); let routerArr = this.$route.path.split("/");
let routeKey = routerArr[routerArr.length - 1]; let routeKey = routerArr[routerArr.length - 1];
this.getType(routeKey); this.getType(routeKey);
@ -103,26 +102,26 @@ export default {
getFrom() { getFrom() {
this.$route.params.key === "upload" this.$route.params.key === "upload"
? uploadApi() ? uploadApi()
.then(async res => { .then(async (res) => {
this.FromData = res.data; this.FromData = res.data;
}) })
.catch(res => { .catch((res) => {
this.$message.error(res.message); this.$message.error(res.message);
}) })
: configApi(this.$route.params.key) : configApi(this.$route.params.key)
.then(async res => { .then(async (res) => {
this.FromData = res.data; this.FromData = res.data;
}) })
.catch(res => { .catch((res) => {
this.$message.error(res.message); this.$message.error(res.message);
}); });
}, },
onSubmit(formData) { onSubmit(formData) {
request[this.FromData.method.toLowerCase()](this.FromData.api, formData) request[this.FromData.method.toLowerCase()](this.FromData.api, formData)
.then(res => { .then((res) => {
this.$message.success(res.message || "提交成功"); this.$message.success(res.message || "提交成功");
}) })
.catch(err => { .catch((err) => {
this.$message.error(err.message || "提交失败"); this.$message.error(err.message || "提交失败");
}); });
}, },
@ -134,7 +133,7 @@ export default {
deepTraversal(arr, child) { deepTraversal(arr, child) {
const that = this; const that = this;
function traversal(a) { function traversal(a) {
a.forEach(o => { a.forEach((o) => {
if ( if (
o.path && o.path &&
o.path.indexOf("Basics") !== -1 && o.path.indexOf("Basics") !== -1 &&
@ -168,8 +167,8 @@ export default {
this.types = ""; this.types = "";
this.title = ""; this.title = "";
} }
} },
} },
}; };
</script> </script>