Commit 16b2d65d by liuchenxi

update: 消费详情导出时间限制

parent 279378a9
......@@ -3,7 +3,7 @@
<div class="alert">
<i class="iconfont icon-warning-circle-fill"></i>
<span class="ml10">若要修改门店请前往【企业管理-权限管理-用户列表】进行修改</span>
<el-button v-if="$getButtonLimit($buttonCode.marketingToUserList)" :limit-code="$buttonCode.marketingToUserList" type="text" class="ml10" @click="toUserList">立即前往</el-button>
<el-button :limit-code="$buttonCode.marketingToUserList" type="text" class="ml10" @click="toUserList">立即前往</el-button>
</div>
<el-input class="mt20 mb20 w260" v-model="search" clearable prefix-icon="el-icon-search" placeholder="请输入门店名称或code" @change="onSearch" />
<el-table :data="tableData.data" element-loading-text="拼命加载中" max-height="288">
......@@ -84,6 +84,7 @@ export default {
this.tableData.currentPage = 1;
},
toUserList() {
if (!this.$getButtonLimit(this.$buttonCode.marketingToUserList)) return this.$message.warning({ message: '无部门管理权限,请联系管理员开启权限配置', showClose: true });
window.open('/gic-web/#/userManager');
}
},
......
......@@ -310,17 +310,15 @@ export default {
// 只能筛选半年之内得数据,并且最大跨度为一个月
const halfYearBefore = Date.now() - 6 * 30 * 24 * 60 * 60 * 1000;
const oneMothods = 30 * 24 * 60 * 60 * 1000;
if (this.minDate) {
const curTime = this.minDate.getTime();
const min = curTime - oneMothods > halfYearBefore ? curTime - oneMothods : halfYearBefore;
return val.getTime() > curTime + oneMothods || val.getTime() < min;
}
return val.getTime() <= halfYearBefore;
const curTime = this.minDate.getTime();
const min = curTime - oneMothods > halfYearBefore ? curTime - oneMothods : halfYearBefore;
return val.getTime() > curTime + oneMothods || val.getTime() < min;
},
onPick: ({ maxDate, minDate }) => {
this.minDate = minDate;
}
},
minDate: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
videoListParams: {
currentPage: 1,
pageSize: 20,
......@@ -343,26 +341,25 @@ export default {
departId: '', // 选中时得id
zbFlag: 1
},
minDate: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
exportDialog: {
dialogVisible: false,
pickerOptions: {
disabledDate: val => {
const isSms = this.$route.params.type == 'marketing'; // 是否为营销类型
const beforeDay = Date.now() - 24 * 60 * 60 * 1000; // 营销类型最大选择时间为当天的前一天
// 只能筛选一年之内得数据,并且最大跨度为三个月
const oneYearBefore = Date.now() - 12 * 30 * 24 * 60 * 60 * 1000;
const threeMothods = 3 * 30 * 24 * 60 * 60 * 1000;
if (this.exportDialog.minDate) {
const curTime = this.exportDialog.minDate.getTime();
const min = curTime - threeMothods > oneYearBefore ? curTime - threeMothods : oneYearBefore;
return val.getTime() > curTime + threeMothods || val.getTime() < min;
}
return val.getTime() <= oneYearBefore;
const curTime = this.exportDialog.minDate.getTime();
const min = curTime - threeMothods > oneYearBefore ? curTime - threeMothods : oneYearBefore;
const max = isSms ? beforeDay : curTime + threeMothods;
return val.getTime() > max || val.getTime() < min;
},
onPick: ({ maxDate, minDate }) => {
this.exportDialog.minDate = minDate;
}
},
time: [Date.now() - 30 * 24 * 60 * 60 * 1000, Date.now()],
time: [],
minDate: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000)
},
exportData: {
......@@ -710,6 +707,20 @@ export default {
return this.$buttonCode[code];
};
}
},
watch: {
'exportDialog.dialogVisible': {
handler: function(newVal) {
if (newVal) {
const isSms = this.$route.params.type == 'marketing'; // 是否为短信营销
const beforeDay = Date.now() - 24 * 60 * 60 * 1000;
const begenTime = isSms && this.dateTime[0] > beforeDay ? beforeDay : this.dateTime[0];
const endTime = isSms && this.dateTime[1] > beforeDay ? beforeDay : this.dateTime[1];
this.exportDialog.time = [begenTime, endTime];
this.exportDialog.minDate = new Date(begenTime);
}
}
}
}
};
</script>
......
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