|
@@ -240,9 +240,21 @@
|
|
|
<el-radio-button label="本周"></el-radio-button>
|
|
<el-radio-button label="本周"></el-radio-button>
|
|
|
<el-radio-button label="本月"></el-radio-button>
|
|
<el-radio-button label="本月"></el-radio-button>
|
|
|
<el-radio-button label="上月"></el-radio-button>
|
|
<el-radio-button label="上月"></el-radio-button>
|
|
|
|
|
+ <el-radio-button label="指定日期" v-if="!showCompanyField"></el-radio-button>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-if="queryTime === '指定日期'"
|
|
|
|
|
+ v-model="specificDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="请选择日期"
|
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
|
+ format="yyyy-MM-dd"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ style=" width: 150px;"
|
|
|
|
|
+ @change="handleAnalysis"
|
|
|
|
|
+ ></el-date-picker>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
<div class="action-group">
|
|
<div class="action-group">
|
|
|
<el-radio-group v-model="userTypeText" @change="handleUserType">
|
|
<el-radio-group v-model="userTypeText" @change="handleUserType">
|
|
|
<el-radio-button label="会员"></el-radio-button>
|
|
<el-radio-button label="会员"></el-radio-button>
|
|
@@ -1018,9 +1030,44 @@ export default {
|
|
|
// 商品总数
|
|
// 商品总数
|
|
|
goodsTotalNum: 0,
|
|
goodsTotalNum: 0,
|
|
|
// 今日商品总数
|
|
// 今日商品总数
|
|
|
- todayGoodsNum: 0
|
|
|
|
|
|
|
+ todayGoodsNum: 0,
|
|
|
|
|
+ // 指定选择的日期
|
|
|
|
|
+ specificDate:null,
|
|
|
|
|
+ pickerOptions: {
|
|
|
|
|
+ disabledDate(time) {
|
|
|
|
|
+ // 可选:限制只能选择今天及以前的日期
|
|
|
|
|
+ return time.getTime() > Date.now();
|
|
|
|
|
+ },
|
|
|
|
|
+ // // 快捷选择
|
|
|
|
|
+ // shortcuts: [{
|
|
|
|
|
+ // text: '今天',
|
|
|
|
|
+ // onClick(picker) {
|
|
|
|
|
+ // picker.$emit('pick', new Date());
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // text: '昨天',
|
|
|
|
|
+ // onClick(picker) {
|
|
|
|
|
+ // const date = new Date();
|
|
|
|
|
+ // date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
|
|
|
+ // picker.$emit('pick', date);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }, {
|
|
|
|
|
+ // text: '一周前',
|
|
|
|
|
+ // onClick(picker) {
|
|
|
|
|
+ // const date = new Date();
|
|
|
|
|
+ // date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
|
+ // picker.$emit('pick', date);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }]
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ // 计算属性判断是否显示
|
|
|
|
|
+ showCompanyField() {
|
|
|
|
|
+ return process.env.VUE_APP_TITLE_INDEX === '恒春来';
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.initViewerChart()
|
|
this.initViewerChart()
|
|
@@ -1349,7 +1396,11 @@ export default {
|
|
|
param.startTime = this.formatDate(lastMonth.startOf('month'));
|
|
param.startTime = this.formatDate(lastMonth.startOf('month'));
|
|
|
param.endTime = this.formatDate(lastMonth.endOf('month'));
|
|
param.endTime = this.formatDate(lastMonth.endOf('month'));
|
|
|
type = 4;
|
|
type = 4;
|
|
|
- } else {
|
|
|
|
|
|
|
+ }else if(this.queryTime === '指定日期'){
|
|
|
|
|
+ param.startTime = this.formatDate(this.specificDate);
|
|
|
|
|
+ param.endTime = this.formatDate(this.specificDate);
|
|
|
|
|
+ type = 5;
|
|
|
|
|
+ }else {
|
|
|
console.warn(`未知的 queryTime: ${this.queryTime}, 默认使用今日`);
|
|
console.warn(`未知的 queryTime: ${this.queryTime}, 默认使用今日`);
|
|
|
param.startTime = this.formatDate(today);
|
|
param.startTime = this.formatDate(today);
|
|
|
param.endTime = this.formatDate(today);
|
|
param.endTime = this.formatDate(today);
|
|
@@ -1360,7 +1411,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 分析概览
|
|
// 分析概览
|
|
|
handleAnalysis(e) {
|
|
handleAnalysis(e) {
|
|
|
-
|
|
|
|
|
|
|
+ if(this.queryTime === '指定日期' && this.specificDate === null ){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(this.queryTime != '指定日期')this.specificDate = null;
|
|
|
let param = this.getParam();
|
|
let param = this.getParam();
|
|
|
analysisPreview(param).then(res => {
|
|
analysisPreview(param).then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -1387,7 +1441,7 @@ export default {
|
|
|
} else if (this.selectedDiv === 2) {
|
|
} else if (this.selectedDiv === 2) {
|
|
|
this.handleAnswerRedPackViewerChart()
|
|
this.handleAnswerRedPackViewerChart()
|
|
|
this.handleAnswerRedPackMoneyViewerChart()
|
|
this.handleAnswerRedPackMoneyViewerChart()
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
handleAnswerRedPackViewerChart(){
|
|
handleAnswerRedPackViewerChart(){
|
|
|
let param = this.getParam();
|
|
let param = this.getParam();
|