Commit 0b2c858f by 姜雷

调整储值和消费的筛选条件

parent 92db5481
...@@ -3,40 +3,6 @@ ...@@ -3,40 +3,6 @@
class="CustomerConsumption" class="CustomerConsumption"
v-loading="loading" v-loading="loading"
> >
<!-- <div class="Dashboard-SearchBar">
<search-item label="运营商">
<operator-select
:accessType="1"
:value="filters.operateId"
@input="val => getConsumeOrderList({operateId: val})"
/>
</search-item>
<search-item label="区域">
<area-select
:value="filters.areaId"
@input="val => getConsumeOrderList({areaId: val})"
type="user"
/>
</search-item>
<el-radio-group
class="Dashboard-Radio"
:value="filters.timeType"
@input="val => getConsumeOrderList({timeType: val})"
>
<el-radio
class="Dashboard-Radio-item"
:label="0"
>本日</el-radio>
<el-radio
class="Dashboard-Radio-item"
:label="1"
>本月</el-radio>
<el-radio
class="Dashboard-Radio-item"
:label="2"
>本年</el-radio>
</el-radio-group>
</div> -->
<div class="Dashboard-title">消费视图 <div class="Dashboard-title">消费视图
<div <div
class="CustomerConsumptionChart-tip" class="CustomerConsumptionChart-tip"
...@@ -69,10 +35,9 @@ export default { ...@@ -69,10 +35,9 @@ export default {
Chart, Chart,
}, },
computed: { computed: {
...mapGetters('Dashboard/customerConsumption', [ ...mapGetters('Dashboard/customerData/customerConsumption', [
'consumeList', 'consumeList',
'consumeCount', 'consumeCount',
'filters',
'loading', 'loading',
]), ]),
}, },
...@@ -80,8 +45,7 @@ export default { ...@@ -80,8 +45,7 @@ export default {
this.initData(); this.initData();
}, },
methods: { methods: {
...mapActions('Dashboard/customerConsumption', [ ...mapActions('Dashboard/customerData/customerConsumption', [
'updateFilters',
'getConsumeOrderList', 'getConsumeOrderList',
]), ]),
initData() { initData() {
......
import { getConsumeOrderList } from '@/api/dashboard/dashboard'; import { getConsumeOrderList } from '@/api/dashboard/dashboard';
import initFiltersStore from '@/store/modules/filters'; // import initFiltersStore from '@/store/modules/filters';
import { getFilters, formatDate } from '@/utils/index'; import { getFilters, formatDate } from '@/utils/index';
const FETCH_CONSUME_LIST = 'FETCH_CONSUME_LIST'; const FETCH_CONSUME_LIST = 'FETCH_CONSUME_LIST';
const FETCH_DATA = 'FETCH_DATA'; const FETCH_DATA = 'FETCH_DATA';
const initFilters = () => ({ // const initFilters = () => ({
operateId: undefined, // operateId: undefined,
areaId: undefined, // areaId: undefined,
timeType: 0, // 0 本日,1 本月, 2 本年 // timeType: 0, // 0 本日,1 本月, 2 本年
}); // });
const filtersStore = initFiltersStore(initFilters); // const filtersStore = initFiltersStore(initFilters);
const nowTime = new Date(); const nowTime = new Date();
const state = () => ({ const state = () => ({
...@@ -28,15 +28,9 @@ const getters = { ...@@ -28,15 +28,9 @@ const getters = {
}; };
const actions = { const actions = {
getConsumeOrderList({ commit, getters, dispatch }, data) { getConsumeOrderList({ commit, rootGetters }) {
commit(FETCH_DATA, true); commit(FETCH_DATA, true);
if (data) { let entity = getFilters(rootGetters['Dashboard/customerData/filters']);
if (data.operateId) {
data.areaId = undefined;
}
dispatch('updateFilters', data);
}
let entity = getFilters(getters.filters);
switch (entity.timeType) { switch (entity.timeType) {
case 1: case 1:
entity.month = formatDate(nowTime, 'yyyy-MM'); entity.month = formatDate(nowTime, 'yyyy-MM');
...@@ -76,7 +70,7 @@ const mutations = { ...@@ -76,7 +70,7 @@ const mutations = {
export default { export default {
namespaced: true, namespaced: true,
modules: { filtersStore }, // modules: { filtersStore },
state, state,
getters, getters,
actions, actions,
......
...@@ -59,18 +59,19 @@ export default { ...@@ -59,18 +59,19 @@ export default {
CustomerConsumption, CustomerConsumption,
}, },
computed: { computed: {
...mapGetters('Dashboard/customerConsumption', ['filters']), ...mapGetters('Dashboard/customerData', ['filters']),
}, },
methods: { methods: {
...mapActions('Dashboard/customerConsumption', [ ...mapActions('Dashboard/customerData', ['updateFilters']),
...mapActions('Dashboard/customerData/customerConsumption', [
'getConsumeOrderList', 'getConsumeOrderList',
'updateFilters',
]), ]),
...mapActions('Dashboard/customerRecharge', ['getRechargeOrderList']), ...mapActions('Dashboard/customerData/customerRecharge', [
'getRechargeOrderList',
]),
fetchAllData() { fetchAllData() {
let entity = getFilters(this.filters); this.getConsumeOrderList();
this.getConsumeOrderList(entity); this.getRechargeOrderList();
this.getRechargeOrderList(entity);
}, },
}, },
}; };
......
import customerRecharge from '../CustomerRecharge/CustomerRechargeStore';
import customerConsumption from '../CustomerConsumption/CustomerConsumptionStore';
import initFiltersStore from '@/store/modules/filters';
const initFilters = () => ({
operateId: undefined,
areaId: undefined,
timeType: 0, // 0 本日,1 本月, 2 本年
});
const filtersStore = initFiltersStore(initFilters);
export default {
namespaced: true,
modules: { filtersStore, customerRecharge, customerConsumption },
};
...@@ -3,33 +3,6 @@ ...@@ -3,33 +3,6 @@
class="CustomerRecharge" class="CustomerRecharge"
v-loading="loading" v-loading="loading"
> >
<!-- <div class="Dashboard-SearchBar">
<search-item label="运营商">
<operator-select
:accessType="1"
:value="filters.operateId"
@input="val => getRechargeOrderList({operateId: val})"
/>
</search-item>
<el-radio-group
class="Dashboard-Radio"
:value="filters.timeType"
@input="val => getRechargeOrderList({timeType: val})"
>
<el-radio
class="Dashboard-Radio-item"
:label="0"
>本日</el-radio>
<el-radio
class="Dashboard-Radio-item"
:label="1"
>本月</el-radio>
<el-radio
class="Dashboard-Radio-item"
:label="2"
>本年</el-radio>
</el-radio-group>
</div> -->
<div class="Dashboard-title">储值视图 <div class="Dashboard-title">储值视图
<div class="CustomerRechargeChart-tip"> <div class="CustomerRechargeChart-tip">
<span <span
...@@ -58,7 +31,7 @@ export default { ...@@ -58,7 +31,7 @@ export default {
Chart, Chart,
}, },
computed: { computed: {
...mapGetters('Dashboard/customerRecharge', [ ...mapGetters('Dashboard/customerData/customerRecharge', [
'rechargeList', 'rechargeList',
'rechargeCount', 'rechargeCount',
'loading', 'loading',
...@@ -68,8 +41,7 @@ export default { ...@@ -68,8 +41,7 @@ export default {
this.initData(); this.initData();
}, },
methods: { methods: {
...mapActions('Dashboard/customerRecharge', [ ...mapActions('Dashboard/customerData/customerRecharge', [
'updateFilters',
'getRechargeOrderList', 'getRechargeOrderList',
]), ]),
initData() { initData() {
......
import { getRechargeOrderList } from '@/api/dashboard/dashboard'; import { getRechargeOrderList } from '@/api/dashboard/dashboard';
import initFiltersStore from '@/store/modules/filters'; // import initFiltersStore from '@/store/modules/filters';
import { getFilters, formatDate } from '@/utils'; import { getFilters, formatDate } from '@/utils';
const FETCH_RECHARGE_LIST = 'FETCH_RECHARGE_LIST'; const FETCH_RECHARGE_LIST = 'FETCH_RECHARGE_LIST';
const FETCH_DATA = 'FETCH_DATA'; const FETCH_DATA = 'FETCH_DATA';
const initFilters = () => ({ // const initFilters = () => ({
operateId: undefined, // operateId: undefined,
areaId: undefined, // areaId: undefined,
timeType: 0, // 0 本日,1 本月, 2 本年 // timeType: 0, // 0 本日,1 本月, 2 本年
}); // });
const filtersStore = initFiltersStore(initFilters); // const filtersStore = initFiltersStore(initFilters);
const nowTime = new Date(); const nowTime = new Date();
const state = () => ({ const state = () => ({
...@@ -28,15 +28,9 @@ const getters = { ...@@ -28,15 +28,9 @@ const getters = {
}; };
const actions = { const actions = {
getRechargeOrderList({ commit, getters, dispatch }, data) { getRechargeOrderList({ commit, rootGetters }) {
commit(FETCH_DATA, true); commit(FETCH_DATA, true);
if (data) { let entity = getFilters(rootGetters['Dashboard/customerData/filters']);
if (data.operateId) {
data.areaId = undefined;
}
dispatch('updateFilters', data);
}
let entity = getFilters(getters.filters);
switch (entity.timeType) { switch (entity.timeType) {
case 1: case 1:
entity.month = formatDate(nowTime, 'yyyy-MM'); entity.month = formatDate(nowTime, 'yyyy-MM');
...@@ -76,7 +70,7 @@ const mutations = { ...@@ -76,7 +70,7 @@ const mutations = {
export default { export default {
namespaced: true, namespaced: true,
modules: { filtersStore }, // modules: { filtersStore },
state, state,
getters, getters,
actions, actions,
......
...@@ -3,8 +3,9 @@ import { ...@@ -3,8 +3,9 @@ import {
fetchReportList, fetchReportList,
fetchTitleList, fetchTitleList,
} from '@/api/dashboard/dashboard'; } from '@/api/dashboard/dashboard';
import customerRecharge from './CustomerRecharge/CustomerRechargeStore'; import customerData from './CustomerData/CustomerDataStore';
import customerConsumption from './CustomerConsumption/CustomerConsumptionStore'; // import customerRecharge from './CustomerRecharge/CustomerRechargeStore';
// import customerConsumption from './CustomerConsumption/CustomerConsumptionStore';
import customerFeedback from './CustomerFeedback/CustomerFeedbackStore'; import customerFeedback from './CustomerFeedback/CustomerFeedbackStore';
import initFiltersStore from '@/store/modules/filters'; import initFiltersStore from '@/store/modules/filters';
import { getFilters, formatDate } from '@/utils/index'; import { getFilters, formatDate } from '@/utils/index';
...@@ -237,8 +238,9 @@ export default { ...@@ -237,8 +238,9 @@ export default {
namespaced: true, namespaced: true,
modules: { modules: {
filtersStore, filtersStore,
customerRecharge, customerData,
customerConsumption, // customerRecharge,
// customerConsumption,
customerFeedback, customerFeedback,
}, },
state, state,
......
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 to comment