|  |  |  | 
|---|
|  |  |  | this.formData.isInvalid = 0 | 
|---|
|  |  |  | this.getContaminateList() | 
|---|
|  |  |  | if (Object.entries(this.initializationData).length !== 0) { | 
|---|
|  |  |  | this.formData.startTime = this.initializationData.startTime | 
|---|
|  |  |  | this.formData.endTime = this.initializationData.endTime | 
|---|
|  |  |  | this.$set(this.formData, 'startTime', this.initializationData.startTime) | 
|---|
|  |  |  | this.$set(this.formData, 'endTime', this.initializationData.endTime) | 
|---|
|  |  |  | // total 总交办单 unComplete 进行中 complete 已完成 overdue 逾期 | 
|---|
|  |  |  | if (this.initializationData.type === 'total') { | 
|---|
|  |  |  | this.formData.state = [] | 
|---|
|  |  |  | 
|---|
|  |  |  | this.formData.state = [40] | 
|---|
|  |  |  | } else if (this.initializationData.type === 'overdue') { | 
|---|
|  |  |  | this.formData.state = [] | 
|---|
|  |  |  | this.formData.changeType = 2 | 
|---|
|  |  |  | this.$set(this.formData, 'changeType', 2) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getPeriods (month) { | 
|---|
|  |  |  | const now = new Date() | 
|---|
|  |  |  | const today = new Date() | 
|---|
|  |  |  | const end = new Date(new Date()) | 
|---|
|  |  |  | const today = new Date(now.getFullYear(), now.getMonth(), now.getDate()) | 
|---|
|  |  |  | // 获取近一个月的时间段 | 
|---|
|  |  |  | const oneMonthAgo = new Date(today) | 
|---|
|  |  |  | oneMonthAgo.setMonth(oneMonthAgo.getMonth() - month) | 
|---|
|  |  |  | const startTime = oneMonthAgo.toISOString().split('T')[0] | 
|---|
|  |  |  | const startTime = oneMonthAgo.toISOString().substring(0, 10) | 
|---|
|  |  |  | const endTime = end.toISOString().substring(0, 10) | 
|---|
|  |  |  | console.log('startTime', startTime, 'endTime', endTime) | 
|---|
|  |  |  | return [startTime, endTime] | 
|---|