修改
This commit is contained in:
parent
56b1c90e64
commit
aab6a2e32e
@ -150,13 +150,23 @@ export default {
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var pastDate = new Date()
|
||||
this.query.visitDateStart = this.haflYear();
|
||||
this.visitDate = [this.haflYear(), year + seperator1 + month + seperator1 + strDate]
|
||||
this.query.visitDateEnd = year + seperator1 + month + seperator1 + strDate
|
||||
this.query.patientId = this.$route.query.patientId
|
||||
this.getListinfo();
|
||||
},
|
||||
haflYear() {
|
||||
// 先获取当前时间
|
||||
var curDate = (new Date()).getTime()
|
||||
// 将半年的时间单位换算成毫秒
|
||||
var halfYear = 365 / 2 * 24 * 3600 * 1000
|
||||
// 半年前的时间(毫秒单位)
|
||||
var pastResult = curDate - halfYear
|
||||
// 日期函数,定义起点为半年前
|
||||
var pastDate = new Date(pastResult)
|
||||
var pastYear = pastDate.getFullYear()
|
||||
var pastMonth = pastDate.getMonth() + 1 - 6
|
||||
if (pastMonth < 0) {
|
||||
pastYear = pastYear - 1
|
||||
pastMonth = 12 + pastMonth
|
||||
}
|
||||
var pastMonth = pastDate.getMonth() + 1
|
||||
var pastDay = pastDate.getDate()
|
||||
if (pastMonth >= 1 && pastMonth <= 9) {
|
||||
pastMonth = '0' + pastMonth
|
||||
@ -164,12 +174,9 @@ export default {
|
||||
if (pastDay >= 0 && pastDay <= 9) {
|
||||
pastDay = '0' + pastDay
|
||||
}
|
||||
this.visitDate = [pastYear + '-' + pastMonth + '-' + pastDay, year + seperator1 + month + seperator1 + strDate]
|
||||
this.query.visitDateStart = pastYear + '-' + pastMonth + '-' + pastDay
|
||||
this.query.visitDateEnd = year + seperator1 + month + seperator1 + strDate
|
||||
this.query.patientId = this.$route.query.patientId
|
||||
this.getListinfo();
|
||||
},
|
||||
var endDate = pastYear + '-' + pastMonth + '-' + pastDay
|
||||
return endDate
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user