Commit 77f7d9a9 by crushh

update: dist

parent 90b89618
......@@ -119,7 +119,7 @@ export default {
searchInput: '',
storeGroup: [],
storeType: '',
dateRange: []
dateRange: this.$store.state.salesDate
},
loading: false,
selectRadio: 2, // 选择当页/选择全部
......@@ -147,8 +147,11 @@ export default {
* 日期
*/
changeDate(e) {
console.log(e);
if (!e) {
this.conditionObj.dateRange = [];
this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
}
this.currentPage = 1;
this.getTableList();
......@@ -242,12 +245,6 @@ export default {
postMultDel(obj) {
const that = this;
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = {
search: that.conditionObj.searchInput || '', // 搜索字段
ecmIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.ecmId).join(','), // 门店分组,数组
......@@ -286,9 +283,6 @@ export default {
showMsg.showmsg('请选择任务', 'warning');
return false;
}
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
that.loadingBtn = true;
let para = {
......@@ -450,7 +444,6 @@ export default {
},
mounted() {
const that = this;
that.conditionObj.dateRange = that.initDataRange();
document.documentElement.style.backgroundColor = '#f0f2f5';
that.activeBrand = that.brandId;
if (!!this.brandId) {
......
......@@ -173,7 +173,11 @@ export const constantRouterMap = [{
children: [{
path: '/taskRecord',
name: '话务任务记录',
component: _import('salesleads/trafficTask', 'taskRecord')
component: _import('salesleads/trafficTask', 'taskRecord'),
meta: {
keepAlive: true
}
},
{
path: '/taskView',
......
......@@ -9,6 +9,7 @@
import Vuex from 'vuex';
import Vue from 'vue';
import * as types from './types';
import { initDataRange } from '@/utils/index';
Vue.use(Vuex);
export default new Vuex.Store({
......@@ -21,7 +22,8 @@ export default new Vuex.Store({
addDepartment: [], // 添加
editDepartment: [], // 编辑配置
delDepartment: [], // 删除配置
wxEnterpriseType: 0
wxEnterpriseType: 0,
salesDate: initDataRange()
},
mutations: {
[types.LOGIN]: (state, data) => {
......@@ -60,6 +62,9 @@ export default new Vuex.Store({
},
changeWxEntertype: (state, data) => {
state.wxEnterpriseType = data;
},
changeSalesDate: (state, data) => {
state.salesDate = data;
}
},
actions: {
......@@ -83,6 +88,9 @@ export default new Vuex.Store({
},
changeWxEntertypeData(context, data) {
context.commit('changeWxEntertype', data);
},
changeSales(context, data) {
context.commit('changeSalesDate', data);
}
}
});
......@@ -524,3 +524,22 @@ export function formatTreeData(list, needChildrens) {
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 @@
</div>
<div class="table-condition-search flex flex-space-between m-t-20">
<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-option :label="item.text" :value="item.id" v-for="item in filterOpts" :key="'filter' + item.id"></el-option>
</el-select>
......@@ -126,7 +127,7 @@ export default {
taskType: 2,
pageNum: 1,
pageSize: 20,
date: []
date: this.$store.state.salesDate
},
filterOpts: [],
overdueOpts: [
......@@ -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) {
......@@ -236,6 +219,18 @@ export default {
that.getTableList();
}, 500),
/**
* 日期
*/
changeDate(e) {
if (!e) {
this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
}
this.pageParams.pageNum = 1;
this.getTableList();
},
/**
* 分页---页码变化
* @param {Number} val
*/
......@@ -359,7 +354,6 @@ export default {
},
mounted() {
const that = this;
this.pageParams.date = this.initDataRange();
that.getFilterOpts();
that.$nextTick(() => {
that.getTableList();
......
......@@ -24,7 +24,7 @@
<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>
<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 class="table-condition-right">
<el-button :loading="loadingBtn" type="primary" @click="exportExcel">导出</el-button>
......@@ -114,7 +114,7 @@ export default {
pageNum: 1,
pageSize: 20,
storeGroup: [],
date: []
date: this.$store.state.salesDate
},
// 分页参数
total: 0,
......@@ -142,24 +142,6 @@ export default {
computed: {},
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) {
......@@ -215,6 +197,18 @@ export default {
that.getTableList();
}, 500),
/**
* 日期
*/
changeDate(e) {
if (!e) {
this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
}
this.pageParams.pageNum = 1;
this.getTableList();
},
/**
* 分页---页码变化
* @param {Number} val
*/
......@@ -300,13 +294,11 @@ export default {
}
},
mounted() {
const that = this;
this.pageParams.date = this.initDataRange();
that.getTableList();
this.getTableList();
if (this.$route.query.ecmPlanId) {
that.$emit('showTab', '212', '2121');
this.$emit('showTab', '212', '2121');
} else {
that.$emit('showTab', '211');
this.$emit('showTab', '211');
}
document.documentElement.style.backgroundColor = '#f0f2f5';
},
......
......@@ -32,7 +32,7 @@
<div class="table-condition-search flex flex-space-between m-t-20">
<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-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 class="table-condition-right">
<el-button :loading="loadingBtn" type="primary" @click="exportExcel">导出</el-button>
......@@ -113,7 +113,7 @@ export default {
pageNum: 1,
pageSize: 20,
taskType: 2,
date: []
date: this.$store.state.salesDate
},
// 分页参数
total: 0,
......@@ -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) {
......@@ -205,6 +187,19 @@ export default {
that.pageParams.pageNum = 1;
that.getTableList();
}, 500),
/**
* 日期
*/
changeDate(e) {
if (!e) {
this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
}
this.pageParams.pageNum = 1;
this.getTableList();
},
/**
* 分页---页码变化
* @param {Number} val
......@@ -272,7 +267,6 @@ export default {
},
mounted() {
const that = this;
this.pageParams.date = this.initDataRange();
that.getTableList();
that.$emit('showTab', 212);
document.documentElement.style.backgroundColor = '#f0f2f5';
......
......@@ -42,6 +42,7 @@ import expiredDialog from '@/components/company/expired-dialog.vue';
import vueOfficeHeader from '@/components/vue-office-header';
import errMsg from '@/common/js/error';
import { getRequest } from '@/api/api';
import { initDataRange } from '@/utils/index';
export default {
name: 'salesleads',
data() {
......@@ -166,6 +167,7 @@ export default {
let that = this;
that.activeTab = item.tabId;
this.navpath[2] = { name: this.navName[item.tabId], path: '' };
this.$store.dispatch('changeSales', initDataRange());
switch (item.tabId) {
case '1':
that.changeRoute(`/trafficTaskSet`);
......
......@@ -253,7 +253,8 @@ export default {
completed: '',
overdue: '',
title: '',
taskType: '1'
taskType: '1',
date: this.$store.state.salesDate
},
overdueStyle: {
已逾期: '#F5222D',
......@@ -349,6 +350,7 @@ export default {
changeExportDialog() {
this.exportDialog = false;
this.multipleSelection = [];
this.$refs.multipleTable.clearSelection();
},
/**
* 导 出
......@@ -542,8 +544,13 @@ export default {
that.currentPage = val;
that.getTableList(this.selectRadio);
},
changeSelect(val) {
changeSelect(e) {
const that = this;
if (!e) {
that.$store.dispatch('changeSales', []);
} else {
that.$store.dispatch('changeSales', e);
}
that.currentPage = 1;
that.getTableList();
},
......
......@@ -121,7 +121,7 @@ export default {
tableType: '1',
storeGroup: [],
storeType: '',
dateRange: []
dateRange: this.$store.state.salesDate
},
selectRadio: 2, // 0 选择当页/ 1 选择全部/ 2 都不选
loading: false,
......@@ -187,7 +187,9 @@ export default {
changeDate(e) {
const that = this;
if (!e) {
that.conditionObj.dateRange = [];
that.$store.dispatch('changeSales', []);
} else {
that.$store.dispatch('changeSales', e);
}
that.currentPage = 1;
that.getTableList();
......@@ -243,16 +245,13 @@ export default {
that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId);
});
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = {
search: that.conditionObj.searchInput || '', // 搜索字段
storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组
storeIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.storeId).join(','), // 门店分组,数组
storeType: that.conditionObj.storeType || '', //门店类型
startDate: that.conditionObj.dateRange[0] || '',
endDate: that.conditionObj.dateRange[1] || '',
startDate: this.conditionObj.dateRange[0] || '',
endDate: this.conditionObj.dateRange[1] || '',
enterpriseId: that.activeBrand, // 品牌 id
delTaskStatus: obj.delOptFlag, // 0:仅删除逾期任务,1:删除所有待完成任务
reason: obj.reason, // 备注
......@@ -291,8 +290,8 @@ export default {
storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组
storeIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.storeId).join(','), // 门店分组,数组
storeType: that.conditionObj.storeType || '', //门店类型
startDate: !!that.conditionObj.dateRange ? that.conditionObj.dateRange[0] : '',
endDate: !!that.conditionObj.dateRange ? that.conditionObj.dateRange[1] : '',
startDate: !!this.conditionObj.dateRange ? this.conditionObj.dateRange[0] : '',
endDate: !!this.conditionObj.dateRange ? this.conditionObj.dateRange[1] : '',
enterpriseId: that.activeBrand, // 品牌 id
selectType: that.selectRadio == 2 && that.multipleSelection.length ? 0 : this.selectRadio
};
......@@ -382,15 +381,12 @@ export default {
that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId);
});
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = {
search: that.conditionObj.searchInput || '', // 搜索字段
storeGroupIds: storeGroups.join(',') || '', // 门店分组,分组
storeType: that.conditionObj.storeType || '', //门店类型
startDate: that.conditionObj.dateRange[0] || '',
endDate: that.conditionObj.dateRange[1] || '',
startDate: this.conditionObj.dateRange[0] || '',
endDate: this.conditionObj.dateRange[1] || '',
pageNum: that.currentPage, // 当前页
pageSize: that.pageSize, // 一页显示个数
enterpriseId: that.activeBrand
......@@ -421,21 +417,6 @@ export default {
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: {
......@@ -455,7 +436,7 @@ export default {
},
mounted() {
const that = this;
that.conditionObj.dateRange = that.initDataRange();
// this.conditionObj.dateRange = that.initDataRange();
document.documentElement.style.backgroundColor = '#f0f2f5';
that.activeBrand = that.brandId;
that.$emit('showTab', 121);
......
......@@ -123,7 +123,7 @@ export default {
searchInput: '',
storeGroup: [],
storeType: '',
dateRange: []
dateRange: this.$store.state.salesDate
},
loading: false,
selectRadio: 2, // 选择当页/选择全部
......@@ -166,6 +166,7 @@ export default {
changeExportDialog() {
this.exportDialog = false;
this.multipleSelection = [];
this.$refs.multipleTable.clearSelection();
},
/**
* 导出
......@@ -180,9 +181,6 @@ export default {
that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId);
});
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
that.loadingBtn = true;
let para = {
......@@ -290,7 +288,9 @@ export default {
changeDate(e) {
let that = this;
if (!e) {
that.conditionObj.dateRange = [];
this.$store.dispatch('changeSales', []);
} else {
this.$store.dispatch('changeSales', e);
}
that.currentPage = 1;
that.getTableList();
......@@ -347,9 +347,6 @@ export default {
that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId);
});
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = {
search: that.conditionObj.searchInput || '', // 搜索字段
storeGroupIds: storeGroups.join(',') || '', // 门店分组,数组
......@@ -446,9 +443,6 @@ export default {
that.conditionObj.storeGroup.forEach(ele => {
storeGroups.push(ele.storeGroupId);
});
if (!that.conditionObj.dateRange) {
that.conditionObj.dateRange = [];
}
let para = {
ecmId: that.$route.query.ecmId,
search: that.conditionObj.searchInput || '', // 搜索字段
......@@ -486,21 +480,6 @@ export default {
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: {
......@@ -521,7 +500,6 @@ export default {
mounted() {
const that = this;
that.$emit('showTab', '122', '1221');
that.conditionObj.dateRange = that.initDataRange();
document.documentElement.style.backgroundColor = '#f0f2f5';
that.activeBrand = 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