Commit 6f062f12 by 李君

优化

1 parent eaa5fd77
......@@ -13,10 +13,17 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('table.date')">
<el-date-picker type="date" :placeholder="$t('pholder.date')" v-model="searchForm.countDate"></el-date-picker>
<el-date-picker
v-model="searchForm.countDate"
type="datetimerange"
:range-separator="$t('dialog.to')"
:start-placeholder="$t('table.startTime')"
:end-placeholder="$t('table.endTime')">
</el-date-picker>
<!-- <el-date-picker type="date" :placeholder="$t('pholder.date')" v-model="searchForm.countDate"></el-date-picker> -->
</el-form-item>
<el-form-item>
<el-time-picker is-range v-model="searchForm.time" :range-separator="$t('dialog.to')" :start-placeholder="$t('pholder.startDate')" :end-placeholder="$t('pholder.endDate')" placeholder="选择时间范围"> </el-time-picker>
<!-- <el-time-picker is-range v-model="searchForm.time" :range-separator="$t('dialog.to')" :start-placeholder="$t('pholder.startDate')" :end-placeholder="$t('pholder.endDate')" placeholder="选择时间范围"> </el-time-picker> -->
</el-form-item>
<el-form-item :label="$t('table.granularity')">
<el-select v-model="searchForm.granularity" :placeholder="$t('pholder.select')">
......@@ -279,7 +286,7 @@
searchForm: {
mallId: '',
cashierAreaId: '',
countDate: new Date(),
countDate: ['','' ],
time:[new Date(), new Date()],
granularity:5
},
......@@ -408,6 +415,9 @@
}
}
},
created() {
this.searchForm.countDate = [moment().format('YYYY-MM-DD')+' 08:00:00',moment().format('YYYY-MM-DD')+' 23:00:00']
},
mounted() {
this.getMallListForTerm();
this.getCounterType()
......@@ -425,6 +435,7 @@
this.chart_right.resize();
});
this.loading = true;
console.log(this.searchForm)
},
computed: {
tableHeight() {
......@@ -503,8 +514,8 @@
getCountData(time){
this.$api.queueManagementApi.getCountData({
cashierAreaId: this.searchForm.cashierAreaId,
countDate: moment(this.searchForm.countDate).format('YYYY-MM-DD'),
startCountTime: moment(this.searchForm.countDate).format('YYYY-MM-DD')+' ' + time
countDate: moment(this.searchForm.countDate[0]).format('YYYY-MM-DD'),
startCountTime: time?moment(this.progressTime).format('YYYY-MM-DD HH:mm:ss'):moment(this.searchForm.countDate[0]).format('YYYY-MM-DD HH:mm:ss')
}).then(res => {
let result = res.data;
if (result.code == 200) {
......@@ -525,7 +536,7 @@
cashierAreaId: this.searchForm.cashierAreaId,
mallId: this.searchForm.mallId,
chartType: "line",
countDate: moment(this.searchForm.countDate).format('YYYY-MM-DD'),
countDate: moment(this.searchForm.countDate[0]).format('YYYY-MM-DD'),
cashierChannelId: this.laneId,
});
......@@ -551,7 +562,7 @@
this.$api.queueManagementApi.getCustomersOverview({
mallId: this.searchForm.mallId,
chartType: "line",
countDate: moment(this.searchForm.countDate).format('YYYY-MM-DD'),
countDate: moment(this.searchForm.countDate[0]).format('YYYY-MM-DD'),
}).then(res => {
if(res.data.code==200){
let resData = res.data.data;
......@@ -583,7 +594,7 @@
this.searchForm.mallId = result.data[0].id;
this.setSessionLocal("mallId", this.searchForm.mallId);
}
this.getOpenTime()
// this.getOpenTime()
this.mallListForTerm = result.data;
}
this.getAreaList(this.searchForm.mallId);
......@@ -593,7 +604,7 @@
this.setSessionLocal("mallId", val);
this.searchForm.cashierAreaId = ''
// this.channelNum = 0
this.getOpenTime()
// this.getOpenTime()
this.getAreaList(val)
},
// 获取门店开门关闭时间
......@@ -663,20 +674,20 @@
// })
// },
playFun(){
this.startTime = moment(this.searchForm.time[0]).format('HH:mm:ss')
this.endTime = moment(this.searchForm.time[1]).format('HH:mm:ss')
// this.startTime = moment(this.searchForm.time[0]).format('HH:mm:ss')
// this.endTime = moment(this.searchForm.time[1]).format('HH:mm:ss')
let openT='',closeT='';
if(this.pauseBtn){
openT = new Date(this.progressTime).getTime();
closeT = new Date(this.searchForm.time[1]).getTime();
closeT = new Date(this.searchForm.countDate[1]).getTime();
}else{
openT = new Date(this.searchForm.time[0]).getTime();
closeT = new Date(this.searchForm.time[1]).getTime();
openT = new Date(this.searchForm.countDate[0]).getTime();
closeT = new Date(this.searchForm.countDate[1]).getTime();
}
this.searchFun()
this.getCountData(moment(openT).format('HH:mm:ss'))
this.getDistribution(moment(openT).format('HH:mm:ss'))
// this.getCountData(moment(openT).format('HH:mm:ss'))
// this.getDistribution(moment(openT).format('HH:mm:ss'))
this.playBtnShow = true
this.progressShow = true;
......@@ -689,8 +700,8 @@
return false
}else{
this.progressTime = moment(openT).format('YYYY-MM-DD HH:mm:ss')
this.getCountData(moment(openT).format('HH:mm:ss'))
this.getDistribution(moment(openT).format('HH:mm:ss'))
this.getCountData(this.progressTime)
this.getDistribution(this.progressTime)
}
}, 1500);
},
......@@ -706,20 +717,15 @@
this.pauseBtn = false
this.progressTime = ''
this.getDistribution()
this.getCountData(moment(this.searchForm.time[0]).format('HH:mm:ss'))
this.getCountData()
this.getCustomersOverview()
this.getchart()
},
// 获取主页大屏人员点位分布
async getDistribution(time) {
if(time){
this.searchForm.countDate = moment(this.searchForm.countDate).format('YYYY-MM-DD') +' '+time
}else{
this.searchForm.countDate = moment(this.searchForm.countDate).format('YYYY-MM-DD') +' '+moment(this.searchForm.time[0]).format('HH:mm:ss')
}
let parmas = {
cashierAreaId:this.searchForm.cashierAreaId,
countDate: this.searchForm.countDate,
countDate: time?moment(this.progressTime).format('YYYY-MM-DD HH:mm:ss'):moment(this.searchForm.countDate[0]).format('YYYY-MM-DD HH:mm:ss'),
}
let res = await this.$api.queueManagementApi.getdistribution(parmas);
let { code, data } = res.data;
......@@ -947,7 +953,7 @@
width: 180px;
}
/deep/.el-date-editor{
width: 180px;
// width: 180px;
}
/deep/.el-date-editor--timerange.el-input__inner{
width: 220px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!