Commit 0b2c858f by 姜雷

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

parent 92db5481
......@@ -3,40 +3,6 @@
class="CustomerConsumption"
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="CustomerConsumptionChart-tip"
......@@ -69,10 +35,9 @@ export default {
Chart,
},
computed: {
...mapGetters('Dashboard/customerConsumption', [
...mapGetters('Dashboard/customerData/customerConsumption', [
'consumeList',
'consumeCount',
'filters',
'loading',
]),
},
......@@ -80,8 +45,7 @@ export default {
this.initData();
},
methods: {
...mapActions('Dashboard/customerConsumption', [
'updateFilters',
...mapActions('Dashboard/customerData/customerConsumption', [
'getConsumeOrderList',
]),
initData() {
......
import { getConsumeOrderList } from '@/api/dashboard/dashboard';
import initFiltersStore from '@/store/modules/filters';
// import initFiltersStore from '@/store/modules/filters';
import { getFilters, formatDate } from '@/utils/index';
const FETCH_CONSUME_LIST = 'FETCH_CONSUME_LIST';
const FETCH_DATA = 'FETCH_DATA';
const initFilters = () => ({
operateId: undefined,
areaId: undefined,
timeType: 0, // 0 本日,1 本月, 2 本年
});
const filtersStore = initFiltersStore(initFilters);
// const initFilters = () => ({
// operateId: undefined,
// areaId: undefined,
// timeType: 0, // 0 本日,1 本月, 2 本年
// });
// const filtersStore = initFiltersStore(initFilters);
const nowTime = new Date();
const state = () => ({
......@@ -28,15 +28,9 @@ const getters = {
};
const actions = {
getConsumeOrderList({ commit, getters, dispatch }, data) {
getConsumeOrderList({ commit, rootGetters }) {
commit(FETCH_DATA, true);
if (data) {
if (data.operateId) {
data.areaId = undefined;
}
dispatch('updateFilters', data);
}
let entity = getFilters(getters.filters);
let entity = getFilters(rootGetters['Dashboard/customerData/filters']);
switch (entity.timeType) {
case 1:
entity.month = formatDate(nowTime, 'yyyy-MM');
......@@ -76,7 +70,7 @@ const mutations = {
export default {
namespaced: true,
modules: { filtersStore },
// modules: { filtersStore },
state,
getters,
actions,
......
......@@ -59,18 +59,19 @@ export default {
CustomerConsumption,
},
computed: {
...mapGetters('Dashboard/customerConsumption', ['filters']),
...mapGetters('Dashboard/customerData', ['filters']),
},
methods: {
...mapActions('Dashboard/customerConsumption', [
...mapActions('Dashboard/customerData', ['updateFilters']),
...mapActions('Dashboard/customerData/customerConsumption', [
'getConsumeOrderList',
'updateFilters',
]),
...mapActions('Dashboard/customerRecharge', ['getRechargeOrderList']),
...mapActions('Dashboard/customerData/customerRecharge', [
'getRechargeOrderList',
]),
fetchAllData() {
let entity = getFilters(this.filters);
this.getConsumeOrderList(entity);
this.getRechargeOrderList(entity);
this.getConsumeOrderList();
this.getRechargeOrderList();
},
},
};
......
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 @@
class="CustomerRecharge"
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="CustomerRechargeChart-tip">
<span
......@@ -58,7 +31,7 @@ export default {
Chart,
},
computed: {
...mapGetters('Dashboard/customerRecharge', [
...mapGetters('Dashboard/customerData/customerRecharge', [
'rechargeList',
'rechargeCount',
'loading',
......@@ -68,8 +41,7 @@ export default {
this.initData();
},
methods: {
...mapActions('Dashboard/customerRecharge', [
'updateFilters',
...mapActions('Dashboard/customerData/customerRecharge', [
'getRechargeOrderList',
]),
initData() {
......
import { getRechargeOrderList } from '@/api/dashboard/dashboard';
import initFiltersStore from '@/store/modules/filters';
// import initFiltersStore from '@/store/modules/filters';
import { getFilters, formatDate } from '@/utils';
const FETCH_RECHARGE_LIST = 'FETCH_RECHARGE_LIST';
const FETCH_DATA = 'FETCH_DATA';
const initFilters = () => ({
operateId: undefined,
areaId: undefined,
timeType: 0, // 0 本日,1 本月, 2 本年
});
const filtersStore = initFiltersStore(initFilters);
// const initFilters = () => ({
// operateId: undefined,
// areaId: undefined,
// timeType: 0, // 0 本日,1 本月, 2 本年
// });
// const filtersStore = initFiltersStore(initFilters);
const nowTime = new Date();
const state = () => ({
......@@ -28,15 +28,9 @@ const getters = {
};
const actions = {
getRechargeOrderList({ commit, getters, dispatch }, data) {
getRechargeOrderList({ commit, rootGetters }) {
commit(FETCH_DATA, true);
if (data) {
if (data.operateId) {
data.areaId = undefined;
}
dispatch('updateFilters', data);
}
let entity = getFilters(getters.filters);
let entity = getFilters(rootGetters['Dashboard/customerData/filters']);
switch (entity.timeType) {
case 1:
entity.month = formatDate(nowTime, 'yyyy-MM');
......@@ -76,7 +70,7 @@ const mutations = {
export default {
namespaced: true,
modules: { filtersStore },
// modules: { filtersStore },
state,
getters,
actions,
......
......@@ -3,8 +3,9 @@ import {
fetchReportList,
fetchTitleList,
} from '@/api/dashboard/dashboard';
import customerRecharge from './CustomerRecharge/CustomerRechargeStore';
import customerConsumption from './CustomerConsumption/CustomerConsumptionStore';
import customerData from './CustomerData/CustomerDataStore';
// import customerRecharge from './CustomerRecharge/CustomerRechargeStore';
// import customerConsumption from './CustomerConsumption/CustomerConsumptionStore';
import customerFeedback from './CustomerFeedback/CustomerFeedbackStore';
import initFiltersStore from '@/store/modules/filters';
import { getFilters, formatDate } from '@/utils/index';
......@@ -237,8 +238,9 @@ export default {
namespaced: true,
modules: {
filtersStore,
customerRecharge,
customerConsumption,
customerData,
// customerRecharge,
// customerConsumption,
customerFeedback,
},
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