Commit 6f062f12 by 李君

优化

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