|
@@ -3,7 +3,7 @@
|
|
|
<div class="business">
|
|
|
<Head :headText="headText"></Head>
|
|
|
<div class="count-top-right">
|
|
|
- <date-temp :types="1" @pickerVal="pickerVal"></date-temp>
|
|
|
+ <month-temp @pickerVal="pickerVal"></month-temp>
|
|
|
</div>
|
|
|
<el-calendar class="doBusinessContainer" :first-day-of-week="7">
|
|
|
<template slot="dateCell" slot-scope="{date, data}">
|
|
@@ -17,6 +17,7 @@
|
|
|
end-placeholder="结束时间"
|
|
|
placeholder="选择时间范围"
|
|
|
format="hh:mm"
|
|
|
+ value-format="hh:mm"
|
|
|
@change="setHours"
|
|
|
></el-time-picker>
|
|
|
</div>
|
|
@@ -27,21 +28,29 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import Head from "../main/index";
|
|
|
-import DateTemp from "../evaluate/dateTemp";
|
|
|
+import MonthTemp from "./monthTemp";
|
|
|
import {queryHours,updateHours} from '@/api/doBusiness/business.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
headText: "营业时间调整",
|
|
|
value1: [new Date(), new Date()],
|
|
|
- date:""
|
|
|
+ date:"",
|
|
|
+ today:''
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
|
Head,
|
|
|
- DateTemp
|
|
|
+ MonthTemp
|
|
|
},
|
|
|
methods: {
|
|
|
+ formatTime(){
|
|
|
+ let year = new Date().getFullYear()
|
|
|
+ let month = new Date().getMonth()+1>10?(new Date().getMonth()+1): ('0'+(new Date().getMonth()+1))
|
|
|
+ let date = new Date().getDate()>10?new Date().getDate():('0'+new Date.getDate())
|
|
|
+ console.log(year,month,date)
|
|
|
+ return this.today = year + ''+ month+''+date
|
|
|
+ },
|
|
|
pickerVal(val) {
|
|
|
console.log(val);
|
|
|
this.date = val
|
|
@@ -51,7 +60,7 @@ export default {
|
|
|
postParams:{
|
|
|
criteria:{
|
|
|
projectId:'Pj4419000005',
|
|
|
- date:'201902'
|
|
|
+ date:this.today
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -60,12 +69,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
setHours(){
|
|
|
+ console.log(this.value1)
|
|
|
let params = {
|
|
|
postParams:{
|
|
|
projectId:'Pj4419000005',
|
|
|
- date:'201902',
|
|
|
- openTime:'080000',
|
|
|
- endTime:'220000'
|
|
|
+ date: this.today,
|
|
|
+ openTime:this.value1.split('-')[0].slice(0,2)+''+this.value1.split('-')[0].slice(2,4),
|
|
|
+ endTime:this.value1.split('-')[1].slice(0,2)+''+this.value1.split('-')[1].slice(2,4),
|
|
|
}
|
|
|
}
|
|
|
updateHours(params).then(res=>{
|
|
@@ -74,6 +84,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
+ this.formatTime()
|
|
|
this.getHours()
|
|
|
}
|
|
|
};
|