Commit 500b0360 by 展昭

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

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