Commit 500b0360 by 展昭

修改数据获取方式及接入托管数据

parent 4c46ab49
import { AjaxRequest } from "../index";
import urls from "./urls";
import token from "../../store/modules/token"
const usermemberId = token.state.usermemberId;
export default {
// get数据
getPeriod(usermemberId) {
getPeriod() {
console.log('usermenberId=', usermemberId);
let url = urls.getPeriod(usermemberId);
return AjaxRequest.get(url);
},
getBillSummary(accountId, usermemberId) {
getBillSummary(accountId) {
let url = urls.getBillSummary(accountId, usermemberId);
return AjaxRequest.get(url);
},
getBillHosting(accountId, usermemberId) {
getBillHosting(accountId) {
let url = urls.getBillHosting(accountId, usermemberId);
return AjaxRequest.get(url);
},
getRecord(accountId, usermemberId, page, pageSize) {
getRecord(accountId, page, pageSize) {
let url = urls.getFlow(usermemberId, accountId, page, pageSize);
return AjaxRequest.get(url);
},
getReceiptList(accountId, usermemberId){
getReceiptList(accountId) {
let url = urls.getReceiptList(accountId, usermemberId);
return AjaxRequest.get(url);
},
getReceiptDetail(accountId, usermemberId,type){
let url = urls.getReceiptDetail(accountId, usermemberId,type);
getReceiptDetail(accountId, type) {
let url = urls.getReceiptDetail(accountId, usermemberId, type);
return AjaxRequest.get(url);
}
};
......@@ -3,12 +3,14 @@ import Vuex from 'vuex'
import { vuexOidcCreateStoreModule } from 'vuex-oidc';
import oidcSettings from "../utils/oidcSettings";
import bill from './modules/bill'
import token from './modules/token'
Vue.use(Vuex)
export default new Vuex.Store({
modules: {
bill,
token,
oidc: vuexOidcCreateStoreModule(oidcSettings)
}
});
......@@ -93,9 +93,9 @@ const mutations = {
};
const actions = {
loadBillPeriod({ commit }, usermemberId) {
loadBillPeriod({ commit }) {
return new Promise((resolve, reject) => {
api.getPeriod(usermemberId)
api.getPeriod()
.then(res => {
if (res && res.status) {
period = res.data;
......@@ -110,7 +110,7 @@ const actions = {
},
loadBillSummary({ commit }, param) {
return new Promise((resolve, reject) => {
api.getBillSummary(param.accountId, param.usermemberId)
api.getBillSummary(param.accountId)
.then(res => {
if (res && res.status) {
summary = res.data;
......@@ -125,7 +125,7 @@ const actions = {
},
loadBillHosting({ commit }, param) {
return new Promise((resolve, reject) => {
api.getBillHosting(param.accountId, param.usermemberId)
api.getBillHosting(param.accountId)
.then(res => {
if (res && res.status) {
hosting = res.data;
......@@ -140,7 +140,7 @@ const actions = {
},
loadRecord({ commit }, param) {
return new Promise((resolve, reject) => {
api.getRecord(param.accountId, param.usermemberId, param.page, param.pagesize)
api.getRecord(param.accountId, param.page, param.pagesize)
.then(res => {
if (res && res.status) {
record = res.data;
......@@ -155,7 +155,7 @@ const actions = {
},
loadReceiptList({ commit }, param) {
return new Promise((resolve, reject) => {
api.getReceiptList(param.accountId, param.usermemberId)
api.getReceiptList(param.accountId)
.then(res => {
if (res && res.status) {
receiptList = res.data;
......@@ -170,7 +170,7 @@ const actions = {
},
loadReceiptDetail({ commit }, param) {
return new Promise((resolve, reject) => {
api.getReceiptDetail(param.accountId, param.usermemberId, param.type)
api.getReceiptDetail(param.accountId, param.type)
.then(res => {
if (res && res.status) {
receiptDetail = res.data;
......
let usermemberId = '206484'
const state = { usermemberId }
export default {
state
}
\ No newline at end of file
//定义类型常量,默认全部大写义类型常量,默认全部大写
const CHANGE_TOKEN = 'CHANGE_TOKEN';
const CHANGE_BILL_PERIOD = 'CHANGE_BILL_PERIOD';
const CHANGE_BILL_SUMMARY = 'CHANGE_BILL_SUMMARY';
const CHANGE_BILL_HOSTING = 'CHANGE_BILL_HOSTING';
......
......@@ -156,7 +156,7 @@
<script>
//TODO: 根据当前时间显示日期
import { Icon } from "vant";
import { Icon, Loading } from "vant";
import { TabHeader } from "@/components";
import * as utils from "../../utils/common";
import { mapGetters, mapActions } from "vuex";
......@@ -170,7 +170,6 @@ export default {
data() {
return {
title: "人事服务",
usermemberId: 206484, // 这里需要问,这个值是怎么来的
currentPerIndex: 0,
currentPerId: 0,
period: [{ name: "" }],
......@@ -231,7 +230,13 @@ export default {
this.$router.push({ name: "billrecord" });
break;
case 3: // 人事托管
this.$router.push({ name: "trusteeship" });
this.$router.push({
name: "trusteeship",
query: {
currentPerIndex: this.currentPerIndex,
currentPerId: this.currentPerId
}
});
break;
case 4: // 社保/公积金/个税
this.$router.push({ name: "sociallist" });
......@@ -267,18 +272,12 @@ export default {
await this.loadBillPeriod(this.usermemberId).then(
data => {
this.period = data;
const nowDate=dayjs().format('YYYY年MM月账户');
const nowDate = dayjs().format("YYYY年M月账户");
for (let index = 0; index < this.period.length; index++) {
const element = this.period[index];
console.log(element.name);
console.log(nowDate);
console.log("element.name.indexOf('2020年04月账户') > -1=",element.name.indexOf('2020年04月账户') > -1);
if (element.name.indexOf('2020年04月账户') > -1) {
if (element.name.indexOf(nowDate) > -1) {
this.currentPerIndex = index;
this.currentPerId = element.id;
break;
}
}
......@@ -291,7 +290,6 @@ export default {
async loadBillSummaryData(accountId) {
let param = {
accountId,
usermemberId: this.usermemberId
};
await this.loadBillSummary(param).then(
data => {
......@@ -306,7 +304,6 @@ export default {
async loadBillHostingData(accountId) {
let param = {
accountId,
usermemberId: this.usermemberId
};
await this.loadBillHosting(param).then(
data => {
......
......@@ -49,7 +49,7 @@
<div class="list" v-for="(item,index) in hosting.fund.list" :key="index">
<div class="list_title">
<div class="title">{{item.cityName}}</div>
<van-icon name="arrow" class="arrow_right" @click="openDetail(item.detail)"/>
<van-icon name="arrow" class="arrow_right" @click="openDetail(item.detail)" />
</div>
<p>
<span>总备款金额</span>
......@@ -89,7 +89,7 @@
<script>
import { Icon, Popup } from "vant";
import { Header } from "@/components";
import { mapGetters } from "vuex";
import { mapGetters, mapActions } from "vuex";
import MescrollVue from "mescroll.js/mescroll.vue";
export default {
components: {
......@@ -163,7 +163,10 @@ export default {
}
},
methods: {
...mapActions(["loadBillHosting"]),
getData() {
this.currentPer = this.$route.query.currentPerIndex;
this.currentPerId = this.$route.query.currentPerId;
// console.log("this.getPeriod=", this.getPeriod);
if (this.getPeriod && this.getPeriod.length > 0) {
this.period = this.getPeriod;
......@@ -190,6 +193,20 @@ export default {
this.currentPerId = this.period[this.currentPer].id;
}
}
this.loadBillHostingData(this.currentPerId);
},
async loadBillHostingData(accountId) {
let param = {
accountId,
};
await this.loadBillHosting(param).then(
data => {
this.data.hosting = data;
},
err => {
console.log(err);
}
);
},
navLeftArrowClick() {
this.$router.go(-1);
......
......@@ -45,11 +45,12 @@ export default {
"removeOidcUser" // Signs out user in vuex and browser storage, but not in open id provider
]),
getOidcUserMy() {
// this.getOidcUser().then(res => {
// console.log("res=", JSON.stringify(res));
// });
const token=this.oidcAccessToken;
console.log('token=',token);
console.log('store=',store);
this.getOidcUser().then(res => {
console.log("res=", JSON.stringify(res));
});
// const token=this.oidcAccessToken;
// console.log('token=',token);
}
},
......
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