Commit 77f7d9a9 by crushh

update: dist

parent 90b89618
...@@ -119,7 +119,7 @@ export default { ...@@ -119,7 +119,7 @@ export default {
searchInput: '', searchInput: '',
storeGroup: [], storeGroup: [],
storeType: '', storeType: '',
dateRange: [] dateRange: this.$store.state.salesDate
}, },
loading: false, loading: false,
selectRadio: 2, // 选择当页/选择全部 selectRadio: 2, // 选择当页/选择全部
...@@ -147,8 +147,11 @@ export default { ...@@ -147,8 +147,11 @@ export default {
* 日期 * 日期
*/ */
changeDate(e) { changeDate(e) {
console.log(e);
if (!e) { if (!e) {
this.conditionObj.dateRange = []; this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
} }
this.currentPage = 1; this.currentPage = 1;
this.getTableList(); this.getTableList();
...@@ -242,12 +245,6 @@ export default { ...@@ -242,12 +245,6 @@ export default {
postMultDel(obj) { postMultDel(obj) {
const that = this; const that = this;
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = { let para = {
search: that.conditionObj.searchInput || '', // 搜索字段 search: that.conditionObj.searchInput || '', // 搜索字段
ecmIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.ecmId).join(','), // 门店分组,数组 ecmIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.ecmId).join(','), // 门店分组,数组
...@@ -286,9 +283,6 @@ export default { ...@@ -286,9 +283,6 @@ export default {
showMsg.showmsg('请选择任务', 'warning'); showMsg.showmsg('请选择任务', 'warning');
return false; return false;
} }
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
that.loadingBtn = true; that.loadingBtn = true;
let para = { let para = {
...@@ -450,7 +444,6 @@ export default { ...@@ -450,7 +444,6 @@ export default {
}, },
mounted() { mounted() {
const that = this; const that = this;
that.conditionObj.dateRange = that.initDataRange();
document.documentElement.style.backgroundColor = '#f0f2f5'; document.documentElement.style.backgroundColor = '#f0f2f5';
that.activeBrand = that.brandId; that.activeBrand = that.brandId;
if (!!this.brandId) { if (!!this.brandId) {
......
...@@ -173,7 +173,11 @@ export const constantRouterMap = [{ ...@@ -173,7 +173,11 @@ export const constantRouterMap = [{
children: [{ children: [{
path: '/taskRecord', path: '/taskRecord',
name: '话务任务记录', name: '话务任务记录',
component: _import('salesleads/trafficTask', 'taskRecord') component: _import('salesleads/trafficTask', 'taskRecord'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/taskView', path: '/taskView',
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
import Vuex from 'vuex'; import Vuex from 'vuex';
import Vue from 'vue'; import Vue from 'vue';
import * as types from './types'; import * as types from './types';
import { initDataRange } from '@/utils/index';
Vue.use(Vuex); Vue.use(Vuex);
export default new Vuex.Store({ export default new Vuex.Store({
...@@ -21,7 +22,8 @@ export default new Vuex.Store({ ...@@ -21,7 +22,8 @@ export default new Vuex.Store({
addDepartment: [], // 添加 addDepartment: [], // 添加
editDepartment: [], // 编辑配置 editDepartment: [], // 编辑配置
delDepartment: [], // 删除配置 delDepartment: [], // 删除配置
wxEnterpriseType: 0 wxEnterpriseType: 0,
salesDate: initDataRange()
}, },
mutations: { mutations: {
[types.LOGIN]: (state, data) => { [types.LOGIN]: (state, data) => {
...@@ -60,6 +62,9 @@ export default new Vuex.Store({ ...@@ -60,6 +62,9 @@ export default new Vuex.Store({
}, },
changeWxEntertype: (state, data) => { changeWxEntertype: (state, data) => {
state.wxEnterpriseType = data; state.wxEnterpriseType = data;
},
changeSalesDate: (state, data) => {
state.salesDate = data;
} }
}, },
actions: { actions: {
...@@ -83,6 +88,9 @@ export default new Vuex.Store({ ...@@ -83,6 +88,9 @@ export default new Vuex.Store({
}, },
changeWxEntertypeData(context, data) { changeWxEntertypeData(context, data) {
context.commit('changeWxEntertype', data); context.commit('changeWxEntertype', data);
},
changeSales(context, data) {
context.commit('changeSalesDate', data);
} }
} }
}); });
...@@ -524,3 +524,22 @@ export function formatTreeData(list, needChildrens) { ...@@ -524,3 +524,22 @@ export function formatTreeData(list, needChildrens) {
arr arr
}; };
} }
/**
*
* 当前日期的前一天的三个月--当前日期的前一天
*/
export function initDataRange() {
let date = new Date(new Date().getTime() - 24 * 3600 * 1000);
let nowTime = date.getTime() - 90 * 24 * 3600 * 1000;
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
let newMonth = month < 10 ? '0' + month : month;
let startDate = new Date(nowTime);
let startYear = startDate.getFullYear();
let startMonth = startDate.getMonth() + 1;
let startDay = startDate.getDate() < 10 ? '0' + startDate.getDate() : startDate.getDate();
let startNewMonth = startMonth < 10 ? '0' + startMonth : startMonth;
return [`${startYear}-${startNewMonth}-${startDay}`, `${year}-${newMonth}-${day}`];
}
\ No newline at end of file
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
</div> </div>
<div class="table-condition-search flex flex-space-between m-t-20"> <div class="table-condition-search flex flex-space-between m-t-20">
<div class="table-condition-left"> <div class="table-condition-left">
<span style="font-size:14px;margin-right:-4px;">创建时间:</span><el-date-picker prefix-icon="el-icon-time" :picker-options="pickerOptions" v-model="pageParams.date" @change="reFetch" :value-format="'yyyy-MM-dd'" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> </el-date-picker> <span style="font-size:14px;margin-right:-4px;">创建时间:</span>
<el-date-picker prefix-icon="el-icon-time" :picker-options="pickerOptions" v-model="pageParams.date" @change="changeDate" :value-format="'yyyy-MM-dd'" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> </el-date-picker>
<el-select class="w-103 m-l-10" v-model="pageParams.finishOverStatus" slot="prepend" placeholder="所有完成情况" @change="reFetch"> <el-select class="w-103 m-l-10" v-model="pageParams.finishOverStatus" slot="prepend" placeholder="所有完成情况" @change="reFetch">
<el-option :label="item.text" :value="item.id" v-for="item in filterOpts" :key="'filter' + item.id"></el-option> <el-option :label="item.text" :value="item.id" v-for="item in filterOpts" :key="'filter' + item.id"></el-option>
</el-select> </el-select>
...@@ -126,7 +127,7 @@ export default { ...@@ -126,7 +127,7 @@ export default {
taskType: 2, taskType: 2,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
date: [] date: this.$store.state.salesDate
}, },
filterOpts: [], filterOpts: [],
overdueOpts: [ overdueOpts: [
...@@ -204,24 +205,6 @@ export default { ...@@ -204,24 +205,6 @@ export default {
}); });
}, },
/** /**
* 取得间隔三个月的日期
*/
initDataRange() {
let date = new Date(new Date().getTime() - 24 * 3600 * 1000);
let nowTime = date.getTime() - 90 * 24 * 3600 * 1000;
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
let newMonth = month < 10 ? '0' + month : month;
let startDate = new Date(nowTime);
let startYear = startDate.getFullYear();
let startMonth = startDate.getMonth() + 1;
let startDay = startDate.getDate() < 10 ? '0' + startDate.getDate() : startDate.getDate();
let startNewMonth = startMonth < 10 ? '0' + startMonth : startMonth;
return [`${startYear}-${startNewMonth}-${startDay}`, `${year}-${newMonth}-${day}`];
},
/**
* 路由跳转 * 路由跳转
*/ */
changeRoute(path) { changeRoute(path) {
...@@ -236,6 +219,18 @@ export default { ...@@ -236,6 +219,18 @@ export default {
that.getTableList(); that.getTableList();
}, 500), }, 500),
/** /**
* 日期
*/
changeDate(e) {
if (!e) {
this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
}
this.pageParams.pageNum = 1;
this.getTableList();
},
/**
* 分页---页码变化 * 分页---页码变化
* @param {Number} val * @param {Number} val
*/ */
...@@ -359,7 +354,6 @@ export default { ...@@ -359,7 +354,6 @@ export default {
}, },
mounted() { mounted() {
const that = this; const that = this;
this.pageParams.date = this.initDataRange();
that.getFilterOpts(); that.getFilterOpts();
that.$nextTick(() => { that.$nextTick(() => {
that.getTableList(); that.getTableList();
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div class="table-condition-left"> <div class="table-condition-left">
<el-input placeholder="请输入门店名称" prefix-icon="el-icon-search" v-model="pageParams.storeName" class="w-260" @change="reFetch" clearable> </el-input> <el-input placeholder="请输入门店名称" prefix-icon="el-icon-search" v-model="pageParams.storeName" class="w-260" @change="reFetch" clearable> </el-input>
<gic-select-group :brandId="brandId" class="m-l-10" :width="213" :selectData="pageParams.storeGroup" @checkGroupIds="checkGroupIds"> </gic-select-group> <gic-select-group :brandId="brandId" class="m-l-10" :width="213" :selectData="pageParams.storeGroup" @checkGroupIds="checkGroupIds"> </gic-select-group>
<el-date-picker class="m-l-10" prefix-icon="el-icon-time" :picker-options="pickerOptions" v-model="pageParams.date" @change="reFetch" :value-format="'yyyy-MM-dd'" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> </el-date-picker> <el-date-picker class="m-l-10" prefix-icon="el-icon-time" :picker-options="pickerOptions" v-model="pageParams.date" @change="changeDate" :value-format="'yyyy-MM-dd'" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> </el-date-picker>
</div> </div>
<div class="table-condition-right"> <div class="table-condition-right">
<el-button :loading="loadingBtn" type="primary" @click="exportExcel">导出</el-button> <el-button :loading="loadingBtn" type="primary" @click="exportExcel">导出</el-button>
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
storeGroup: [], storeGroup: [],
date: [] date: this.$store.state.salesDate
}, },
// 分页参数 // 分页参数
total: 0, total: 0,
...@@ -142,24 +142,6 @@ export default { ...@@ -142,24 +142,6 @@ export default {
computed: {}, computed: {},
methods: { methods: {
/** /**
* 取得间隔三个月的日期
*/
initDataRange() {
let date = new Date(new Date().getTime() - 24 * 3600 * 1000);
let nowTime = date.getTime() - 90 * 24 * 3600 * 1000;
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
let newMonth = month < 10 ? '0' + month : month;
let startDate = new Date(nowTime);
let startYear = startDate.getFullYear();
let startMonth = startDate.getMonth() + 1;
let startDay = startDate.getDate() < 10 ? '0' + startDate.getDate() : startDate.getDate();
let startNewMonth = startMonth < 10 ? '0' + startMonth : startMonth;
return [`${startYear}-${startNewMonth}-${startDay}`, `${year}-${newMonth}-${day}`];
},
/**
* 导出 * 导出
*/ */
exportExcel(type) { exportExcel(type) {
...@@ -215,6 +197,18 @@ export default { ...@@ -215,6 +197,18 @@ export default {
that.getTableList(); that.getTableList();
}, 500), }, 500),
/** /**
* 日期
*/
changeDate(e) {
if (!e) {
this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
}
this.pageParams.pageNum = 1;
this.getTableList();
},
/**
* 分页---页码变化 * 分页---页码变化
* @param {Number} val * @param {Number} val
*/ */
...@@ -300,13 +294,11 @@ export default { ...@@ -300,13 +294,11 @@ export default {
} }
}, },
mounted() { mounted() {
const that = this; this.getTableList();
this.pageParams.date = this.initDataRange();
that.getTableList();
if (this.$route.query.ecmPlanId) { if (this.$route.query.ecmPlanId) {
that.$emit('showTab', '212', '2121'); this.$emit('showTab', '212', '2121');
} else { } else {
that.$emit('showTab', '211'); this.$emit('showTab', '211');
} }
document.documentElement.style.backgroundColor = '#f0f2f5'; document.documentElement.style.backgroundColor = '#f0f2f5';
}, },
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="table-condition-search flex flex-space-between m-t-20"> <div class="table-condition-search flex flex-space-between m-t-20">
<div class="table-condition-left"> <div class="table-condition-left">
<el-input placeholder="请输入计划名称" prefix-icon="el-icon-search" v-model="pageParams.ecmPlanName" class="w-260" @change="reFetch" clearable @clear="clearInput"> </el-input> <el-input placeholder="请输入计划名称" prefix-icon="el-icon-search" v-model="pageParams.ecmPlanName" class="w-260" @change="reFetch" clearable @clear="clearInput"> </el-input>
<el-date-picker class="m-l-10" prefix-icon="el-icon-time" :picker-options="pickerOptions" v-model="pageParams.date" @change="reFetch" :value-format="'yyyy-MM-dd'" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> </el-date-picker> <el-date-picker class="m-l-10" prefix-icon="el-icon-time" :picker-options="pickerOptions" v-model="pageParams.date" @change="changeDate" :value-format="'yyyy-MM-dd'" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> </el-date-picker>
</div> </div>
<div class="table-condition-right"> <div class="table-condition-right">
<el-button :loading="loadingBtn" type="primary" @click="exportExcel">导出</el-button> <el-button :loading="loadingBtn" type="primary" @click="exportExcel">导出</el-button>
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
taskType: 2, taskType: 2,
date: [] date: this.$store.state.salesDate
}, },
// 分页参数 // 分页参数
total: 0, total: 0,
...@@ -174,24 +174,6 @@ export default { ...@@ -174,24 +174,6 @@ export default {
}); });
}, },
/** /**
* 取得间隔三个月的日期
*/
initDataRange() {
let date = new Date(new Date().getTime() - 24 * 3600 * 1000);
let nowTime = date.getTime() - 90 * 24 * 3600 * 1000;
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
let newMonth = month < 10 ? '0' + month : month;
let startDate = new Date(nowTime);
let startYear = startDate.getFullYear();
let startMonth = startDate.getMonth() + 1;
let startDay = startDate.getDate() < 10 ? '0' + startDate.getDate() : startDate.getDate();
let startNewMonth = startMonth < 10 ? '0' + startMonth : startMonth;
return [`${startYear}-${startNewMonth}-${startDay}`, `${year}-${newMonth}-${day}`];
},
/**
* 路由跳转 * 路由跳转
*/ */
changeRoute(path) { changeRoute(path) {
...@@ -205,6 +187,19 @@ export default { ...@@ -205,6 +187,19 @@ export default {
that.pageParams.pageNum = 1; that.pageParams.pageNum = 1;
that.getTableList(); that.getTableList();
}, 500), }, 500),
/**
* 日期
*/
changeDate(e) {
if (!e) {
this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
}
this.pageParams.pageNum = 1;
this.getTableList();
},
/** /**
* 分页---页码变化 * 分页---页码变化
* @param {Number} val * @param {Number} val
...@@ -272,7 +267,6 @@ export default { ...@@ -272,7 +267,6 @@ export default {
}, },
mounted() { mounted() {
const that = this; const that = this;
this.pageParams.date = this.initDataRange();
that.getTableList(); that.getTableList();
that.$emit('showTab', 212); that.$emit('showTab', 212);
document.documentElement.style.backgroundColor = '#f0f2f5'; document.documentElement.style.backgroundColor = '#f0f2f5';
......
...@@ -42,6 +42,7 @@ import expiredDialog from '@/components/company/expired-dialog.vue'; ...@@ -42,6 +42,7 @@ import expiredDialog from '@/components/company/expired-dialog.vue';
import vueOfficeHeader from '@/components/vue-office-header'; import vueOfficeHeader from '@/components/vue-office-header';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
import { getRequest } from '@/api/api'; import { getRequest } from '@/api/api';
import { initDataRange } from '@/utils/index';
export default { export default {
name: 'salesleads', name: 'salesleads',
data() { data() {
...@@ -166,6 +167,7 @@ export default { ...@@ -166,6 +167,7 @@ export default {
let that = this; let that = this;
that.activeTab = item.tabId; that.activeTab = item.tabId;
this.navpath[2] = { name: this.navName[item.tabId], path: '' }; this.navpath[2] = { name: this.navName[item.tabId], path: '' };
this.$store.dispatch('changeSales', initDataRange());
switch (item.tabId) { switch (item.tabId) {
case '1': case '1':
that.changeRoute(`/trafficTaskSet`); that.changeRoute(`/trafficTaskSet`);
......
...@@ -253,7 +253,8 @@ export default { ...@@ -253,7 +253,8 @@ export default {
completed: '', completed: '',
overdue: '', overdue: '',
title: '', title: '',
taskType: '1' taskType: '1',
date: this.$store.state.salesDate
}, },
overdueStyle: { overdueStyle: {
已逾期: '#F5222D', 已逾期: '#F5222D',
...@@ -349,6 +350,7 @@ export default { ...@@ -349,6 +350,7 @@ export default {
changeExportDialog() { changeExportDialog() {
this.exportDialog = false; this.exportDialog = false;
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.multipleTable.clearSelection();
}, },
/** /**
* 导 出 * 导 出
...@@ -542,8 +544,13 @@ export default { ...@@ -542,8 +544,13 @@ export default {
that.currentPage = val; that.currentPage = val;
that.getTableList(this.selectRadio); that.getTableList(this.selectRadio);
}, },
changeSelect(val) { changeSelect(e) {
const that = this; const that = this;
if (!e) {
that.$store.dispatch('changeSales', []);
} else {
that.$store.dispatch('changeSales', e);
}
that.currentPage = 1; that.currentPage = 1;
that.getTableList(); that.getTableList();
}, },
......
...@@ -121,7 +121,7 @@ export default { ...@@ -121,7 +121,7 @@ export default {
tableType: '1', tableType: '1',
storeGroup: [], storeGroup: [],
storeType: '', storeType: '',
dateRange: [] dateRange: this.$store.state.salesDate
}, },
selectRadio: 2, // 0 选择当页/ 1 选择全部/ 2 都不选 selectRadio: 2, // 0 选择当页/ 1 选择全部/ 2 都不选
loading: false, loading: false,
...@@ -187,7 +187,9 @@ export default { ...@@ -187,7 +187,9 @@ export default {
changeDate(e) { changeDate(e) {
const that = this; const that = this;
if (!e) { if (!e) {
that.conditionObj.dateRange = []; that.$store.dispatch('changeSales', []);
} else {
that.$store.dispatch('changeSales', e);
} }
that.currentPage = 1; that.currentPage = 1;
that.getTableList(); that.getTableList();
...@@ -243,16 +245,13 @@ export default { ...@@ -243,16 +245,13 @@ export default {
that.conditionObj.storeGroup.forEach(ele => { that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId); storeGroups.push(ele.storeGroupId);
}); });
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = { let para = {
search: that.conditionObj.searchInput || '', // 搜索字段 search: that.conditionObj.searchInput || '', // 搜索字段
storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组 storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组
storeIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.storeId).join(','), // 门店分组,数组 storeIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.storeId).join(','), // 门店分组,数组
storeType: that.conditionObj.storeType || '', //门店类型 storeType: that.conditionObj.storeType || '', //门店类型
startDate: that.conditionObj.dateRange[0] || '', startDate: this.conditionObj.dateRange[0] || '',
endDate: that.conditionObj.dateRange[1] || '', endDate: this.conditionObj.dateRange[1] || '',
enterpriseId: that.activeBrand, // 品牌 id enterpriseId: that.activeBrand, // 品牌 id
delTaskStatus: obj.delOptFlag, // 0:仅删除逾期任务,1:删除所有待完成任务 delTaskStatus: obj.delOptFlag, // 0:仅删除逾期任务,1:删除所有待完成任务
reason: obj.reason, // 备注 reason: obj.reason, // 备注
...@@ -291,8 +290,8 @@ export default { ...@@ -291,8 +290,8 @@ export default {
storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组 storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组
storeIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.storeId).join(','), // 门店分组,数组 storeIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.storeId).join(','), // 门店分组,数组
storeType: that.conditionObj.storeType || '', //门店类型 storeType: that.conditionObj.storeType || '', //门店类型
startDate: !!that.conditionObj.dateRange ? that.conditionObj.dateRange[0] : '', startDate: !!this.conditionObj.dateRange ? this.conditionObj.dateRange[0] : '',
endDate: !!that.conditionObj.dateRange ? that.conditionObj.dateRange[1] : '', endDate: !!this.conditionObj.dateRange ? this.conditionObj.dateRange[1] : '',
enterpriseId: that.activeBrand, // 品牌 id enterpriseId: that.activeBrand, // 品牌 id
selectType: that.selectRadio == 2 && that.multipleSelection.length ? 0 : this.selectRadio selectType: that.selectRadio == 2 && that.multipleSelection.length ? 0 : this.selectRadio
}; };
...@@ -382,15 +381,12 @@ export default { ...@@ -382,15 +381,12 @@ export default {
that.conditionObj.storeGroup.forEach(ele => { that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId); storeGroups.push(ele.storeGroupId);
}); });
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = { let para = {
search: that.conditionObj.searchInput || '', // 搜索字段 search: that.conditionObj.searchInput || '', // 搜索字段
storeGroupIds: storeGroups.join(',') || '', // 门店分组,分组 storeGroupIds: storeGroups.join(',') || '', // 门店分组,分组
storeType: that.conditionObj.storeType || '', //门店类型 storeType: that.conditionObj.storeType || '', //门店类型
startDate: that.conditionObj.dateRange[0] || '', startDate: this.conditionObj.dateRange[0] || '',
endDate: that.conditionObj.dateRange[1] || '', endDate: this.conditionObj.dateRange[1] || '',
pageNum: that.currentPage, // 当前页 pageNum: that.currentPage, // 当前页
pageSize: that.pageSize, // 一页显示个数 pageSize: that.pageSize, // 一页显示个数
enterpriseId: that.activeBrand enterpriseId: that.activeBrand
...@@ -421,21 +417,6 @@ export default { ...@@ -421,21 +417,6 @@ export default {
message: error.message message: error.message
}); });
}); });
},
initDataRange() {
let date = new Date(new Date().getTime() - 24 * 3600 * 1000);
let nowTime = date.getTime() - 90 * 24 * 3600 * 1000;
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
let newMonth = month < 10 ? '0' + month : month;
let startDate = new Date(nowTime);
let startYear = startDate.getFullYear();
let startMonth = startDate.getMonth() + 1;
let startDay = startDate.getDate() < 10 ? '0' + startDate.getDate() : startDate.getDate();
let startNewMonth = startMonth < 10 ? '0' + startMonth : startMonth;
return [`${startYear}-${startNewMonth}-${startDay}`, `${year}-${newMonth}-${day}`];
} }
}, },
watch: { watch: {
...@@ -455,7 +436,7 @@ export default { ...@@ -455,7 +436,7 @@ export default {
}, },
mounted() { mounted() {
const that = this; const that = this;
that.conditionObj.dateRange = that.initDataRange(); // this.conditionObj.dateRange = that.initDataRange();
document.documentElement.style.backgroundColor = '#f0f2f5'; document.documentElement.style.backgroundColor = '#f0f2f5';
that.activeBrand = that.brandId; that.activeBrand = that.brandId;
that.$emit('showTab', 121); that.$emit('showTab', 121);
......
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
searchInput: '', searchInput: '',
storeGroup: [], storeGroup: [],
storeType: '', storeType: '',
dateRange: [] dateRange: this.$store.state.salesDate
}, },
loading: false, loading: false,
selectRadio: 2, // 选择当页/选择全部 selectRadio: 2, // 选择当页/选择全部
...@@ -166,6 +166,7 @@ export default { ...@@ -166,6 +166,7 @@ export default {
changeExportDialog() { changeExportDialog() {
this.exportDialog = false; this.exportDialog = false;
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.multipleTable.clearSelection();
}, },
/** /**
* 导出 * 导出
...@@ -180,9 +181,6 @@ export default { ...@@ -180,9 +181,6 @@ export default {
that.conditionObj.storeGroup.forEach(ele => { that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId); storeGroups.push(ele.storeGroupId);
}); });
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
that.loadingBtn = true; that.loadingBtn = true;
let para = { let para = {
...@@ -290,7 +288,9 @@ export default { ...@@ -290,7 +288,9 @@ export default {
changeDate(e) { changeDate(e) {
let that = this; let that = this;
if (!e) { if (!e) {
that.conditionObj.dateRange = []; this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
} }
that.currentPage = 1; that.currentPage = 1;
that.getTableList(); that.getTableList();
...@@ -347,9 +347,6 @@ export default { ...@@ -347,9 +347,6 @@ export default {
that.conditionObj.storeGroup.forEach(ele => { that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId); storeGroups.push(ele.storeGroupId);
}); });
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = { let para = {
search: that.conditionObj.searchInput || '', // 搜索字段 search: that.conditionObj.searchInput || '', // 搜索字段
storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组 storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组
...@@ -446,9 +443,6 @@ export default { ...@@ -446,9 +443,6 @@ export default {
that.conditionObj.storeGroup.forEach(ele => { that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId); storeGroups.push(ele.storeGroupId);
}); });
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = { let para = {
ecmId: that.$route.query.ecmId, ecmId: that.$route.query.ecmId,
search: that.conditionObj.searchInput || '', // 搜索字段 search: that.conditionObj.searchInput || '', // 搜索字段
...@@ -486,21 +480,6 @@ export default { ...@@ -486,21 +480,6 @@ export default {
message: error.message message: error.message
}); });
}); });
},
initDataRange() {
let date = new Date(new Date().getTime() - 24 * 3600 * 1000);
let nowTime = date.getTime() - 90 * 24 * 3600 * 1000;
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
let newMonth = month < 10 ? '0' + month : month;
let startDate = new Date(nowTime);
let startYear = startDate.getFullYear();
let startMonth = startDate.getMonth() + 1;
let startDay = startDate.getDate() < 10 ? '0' + startDate.getDate() : startDate.getDate();
let startNewMonth = startMonth < 10 ? '0' + startMonth : startMonth;
return [`${startYear}-${startNewMonth}-${startDay}`, `${year}-${newMonth}-${day}`];
} }
}, },
watch: { watch: {
...@@ -521,7 +500,6 @@ export default { ...@@ -521,7 +500,6 @@ export default {
mounted() { mounted() {
const that = this; const that = this;
that.$emit('showTab', '122', '1221'); that.$emit('showTab', '122', '1221');
that.conditionObj.dateRange = that.initDataRange();
document.documentElement.style.backgroundColor = '#f0f2f5'; document.documentElement.style.backgroundColor = '#f0f2f5';
that.activeBrand = that.brandId; that.activeBrand = that.brandId;
if (!!that.brandId) { if (!!that.brandId) {
......
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