Commit af8a8dd8 by 展昭

update

parent 551e2ccd
......@@ -140,7 +140,7 @@ const actions = {
},
loadRecord({ commit }, param) {
return new Promise((resolve, reject) => {
api.getRecord(param.accountId, param.page, param.pagesize)
api.getRecord(param.accountId, param.page, param.pageSize)
.then(res => {
if (res && res.status) {
record = res.data;
......
......@@ -236,7 +236,10 @@ export default {
case 1: // 充值
break;
case 2: // 资金记录
this.$router.push({ name: "billrecord" });
this.$router.push({
name: "billrecord",
query: { accountId: this.currentPerId }
});
break;
case 3: // 人事托管
this.$router.push({
......
......@@ -25,7 +25,8 @@ import { Icon } from "vant";
import { HeaderW } from "@/components";
import MescrollMixins from "../../assets/js/MescrollMixins.js";
import MescrollVue from "mescroll.js/mescroll.vue";
import { mapActions } from "vuex";
import { mapGetters, mapActions } from "vuex";
import dayjs from "dayjs";
export default {
components: {
HeaderW,
......@@ -33,9 +34,13 @@ export default {
MescrollVue
},
mixins: [MescrollMixins],
computed: {
...mapGetters(["getBeginDate"])
},
data() {
return {
title: "11月资金记录",
title: "",
accountId: 0,
mescrollUp: {
callback: this.upCallback, // 上拉回调,此处可简写; 相当于 callback: function (page, mescroll) { getListData(page); }
page: {
......@@ -66,9 +71,13 @@ export default {
this.mescroll = mescroll;
},
upCallback(page, mescroll) {
this.loadRecord({ accountId: "2319680", page: page.num, pageSize: "10" }).then(
this.loadRecord({
accountId: this.accountId,
page: page.num,
pageSize: "10"
}).then(
resdata => {
console.log(JSON.stringify(resdata));
let arr = resdata.list;
// 如果是第一页需手动制空列表
if (page.num === 1) this.dataList = [];
......@@ -83,60 +92,15 @@ export default {
mescroll.endErr();
}
);
// 模拟联网
// this.getListDataFromNet(
// this.pdType,
// page.num,
// page.size,
// arr => {
// // 如果是第一页需手动制空列表
// if (page.num === 1) this.dataList = [];
// // 把请求到的数据添加到列表
// this.dataList = this.dataList.concat(arr);
// // 数据渲染成功后,隐藏下拉刷新的状态
// this.$nextTick(() => {
// mescroll.endSuccess(arr.length);
// });
// },
// () => {
// // 联网异常,隐藏上拉和下拉的加载进度
// mescroll.endErr();
// }
// );
},
onClickLeft() {
console.log(1);
},
navLeftArrowClick() {
this.$router.go(-1);
},
mescrollInit(mescroll) {
this.mescroll = mescroll;
},
upCallback(page, mescroll) {
this.loadRecord({
accountId: "2319680",
page: page.num.toString(),
pagesize: "10"
}).then(
resdata => {
console.log('resdata=',JSON.stringify(resdata));
let data = page.num == 1 ? [] : this.articleList;
data.push(...resdata.list);
this.articleList = data;
// 数据渲染成功后,隐藏下拉刷新的状态
this.$nextTick(() => {
mescroll.endSuccess(resdata.list.length);
});
},
err => {
console.log(err);
}
);
}
},
mounted() {
this.globalNavLeftArrowClick(this.navLeftArrowClick);
this.accountId = this.$route.query.accountId;
this.title = dayjs(this.getBeginDate).format("M") + "月" + "资金记录";
}
};
</script>
......
<template>
<div>
<div class="header">
<van-nav-bar :title="title" left-arrow @click-left="onClickLeft" />
<van-nav-bar :title="title" left-arrow/>
</div>
<div class="container">
<div class="list" v-for="(item, index) in list" :key="index">
......@@ -10,7 +10,7 @@
<i>{{ item.dueAmount }}</i>
</div>
<p>
<span>截止扣费日期{{ item.dueDate }}</span>
<span>截止扣费日期{{ item.dueDate|y-m-d }}</span>
<i>{{ item.statusDesc }}</i>
</p>
</div>
......
......@@ -72,7 +72,10 @@ export default {
methods: {
...mapActions(["loadMoreList", "loadMoreSummary"]),
toPage() {
this.$router.push({ name: "billrecord" });
this.$router.push({
name: "billrecord",
query: { accountId: this.summary.accountId }
});
},
toNextPage(index, name) {
this.$router.push({ name: "moredetail", query: { index, name } });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment