This commit is contained in:
2024-05-31 14:33:17 +08:00
parent 56b1c90e64
commit aab6a2e32e

View File

@ -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>