Commit af8a8dd8 by 展昭

update

parent 551e2ccd
...@@ -140,7 +140,7 @@ const actions = { ...@@ -140,7 +140,7 @@ const actions = {
}, },
loadRecord({ commit }, param) { loadRecord({ commit }, param) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
api.getRecord(param.accountId, param.page, param.pagesize) api.getRecord(param.accountId, param.page, param.pageSize)
.then(res => { .then(res => {
if (res && res.status) { if (res && res.status) {
record = res.data; record = res.data;
......
...@@ -236,7 +236,10 @@ export default { ...@@ -236,7 +236,10 @@ export default {
case 1: // 充值 case 1: // 充值
break; break;
case 2: // 资金记录 case 2: // 资金记录
this.$router.push({ name: "billrecord" }); this.$router.push({
name: "billrecord",
query: { accountId: this.currentPerId }
});
break; break;
case 3: // 人事托管 case 3: // 人事托管
this.$router.push({ this.$router.push({
......
...@@ -25,7 +25,8 @@ import { Icon } from "vant"; ...@@ -25,7 +25,8 @@ import { Icon } from "vant";
import { HeaderW } from "@/components"; import { HeaderW } from "@/components";
import MescrollMixins from "../../assets/js/MescrollMixins.js"; import MescrollMixins from "../../assets/js/MescrollMixins.js";
import MescrollVue from "mescroll.js/mescroll.vue"; import MescrollVue from "mescroll.js/mescroll.vue";
import { mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import dayjs from "dayjs";
export default { export default {
components: { components: {
HeaderW, HeaderW,
...@@ -33,9 +34,13 @@ export default { ...@@ -33,9 +34,13 @@ export default {
MescrollVue MescrollVue
}, },
mixins: [MescrollMixins], mixins: [MescrollMixins],
computed: {
...mapGetters(["getBeginDate"])
},
data() { data() {
return { return {
title: "11月资金记录", title: "",
accountId: 0,
mescrollUp: { mescrollUp: {
callback: this.upCallback, // 上拉回调,此处可简写; 相当于 callback: function (page, mescroll) { getListData(page); } callback: this.upCallback, // 上拉回调,此处可简写; 相当于 callback: function (page, mescroll) { getListData(page); }
page: { page: {
...@@ -66,9 +71,13 @@ export default { ...@@ -66,9 +71,13 @@ export default {
this.mescroll = mescroll; this.mescroll = mescroll;
}, },
upCallback(page, 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 => { resdata => {
console.log(JSON.stringify(resdata));
let arr = resdata.list; let arr = resdata.list;
// 如果是第一页需手动制空列表 // 如果是第一页需手动制空列表
if (page.num === 1) this.dataList = []; if (page.num === 1) this.dataList = [];
...@@ -83,60 +92,15 @@ export default { ...@@ -83,60 +92,15 @@ export default {
mescroll.endErr(); 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() { navLeftArrowClick() {
this.$router.go(-1); 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() { mounted() {
this.globalNavLeftArrowClick(this.navLeftArrowClick); this.globalNavLeftArrowClick(this.navLeftArrowClick);
this.accountId = this.$route.query.accountId;
this.title = dayjs(this.getBeginDate).format("M") + "月" + "资金记录";
} }
}; };
</script> </script>
......
<template> <template>
<div> <div>
<div class="header"> <div class="header">
<van-nav-bar :title="title" left-arrow @click-left="onClickLeft" /> <van-nav-bar :title="title" left-arrow/>
</div> </div>
<div class="container"> <div class="container">
<div class="list" v-for="(item, index) in list" :key="index"> <div class="list" v-for="(item, index) in list" :key="index">
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<i>{{ item.dueAmount }}</i> <i>{{ item.dueAmount }}</i>
</div> </div>
<p> <p>
<span>截止扣费日期{{ item.dueDate }}</span> <span>截止扣费日期{{ item.dueDate|y-m-d }}</span>
<i>{{ item.statusDesc }}</i> <i>{{ item.statusDesc }}</i>
</p> </p>
</div> </div>
......
...@@ -72,7 +72,10 @@ export default { ...@@ -72,7 +72,10 @@ export default {
methods: { methods: {
...mapActions(["loadMoreList", "loadMoreSummary"]), ...mapActions(["loadMoreList", "loadMoreSummary"]),
toPage() { toPage() {
this.$router.push({ name: "billrecord" }); this.$router.push({
name: "billrecord",
query: { accountId: this.summary.accountId }
});
}, },
toNextPage(index, name) { toNextPage(index, name) {
this.$router.push({ name: "moredetail", query: { 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