| | |
| | | dblChooseDate(date) { |
| | | if (!this.isPastDue(date)) { |
| | | clearTimeout(time) |
| | | this.dblDate = date |
| | | this.isDbl = true |
| | | this.changeTime = this.handleDatetime(date) |
| | | this.getCapacityPlanningOnclickSelect({ |
| | | CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key, |
| | | captplanid: this.rowData.CaptPlanId, |
| | | datetime: this.handleDatetime(date) |
| | | }) |
| | | this.getDblTime() |
| | | time = setTimeout(() => { |
| | | this.time = funsdates.getYearMonthDay(date) |
| | | if (typeof this.value === 'string') { |
| | | this.value = this.value.split(',') |
| | | } |
| | | // 可以点击的日期 |
| | | if (!this.isPastDue(date)) { |
| | | if ((this.value.indexOf(this.handleDatetime(date)) < 0 && this.value !== '') || this.value === '') { // 数组添加 |
| | | this.value.push(this.handleDatetime(date)) // 新增到input里 |
| | | const data = { |
| | | name: this.handleDatetime(date), |
| | | key: this.rowData.CaptPlanWorkShiftCode |
| | | } |
| | | this.defArr.push(data) // 新增到 默认数组里 |
| | | this.dblDate = date |
| | | this.isDbl = true // 右侧展开 |
| | | |
| | | this.changeTime = this.handleDatetime(date) |
| | | |
| | | const DATA = { |
| | | CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key, |
| | | captplanid: this.rowData.CaptPlanId, |
| | | datetime: this.handleDatetime(date) |
| | | } |
| | | this.getCapacityPlanningOnclickSelect(DATA) |
| | | this.getDblTime() |
| | | } else if (this.value.indexOf(this.handleDatetime(date)) >= 0) { |
| | | this.dblDate = date |
| | | this.isDbl = true // 右侧展开 |
| | | |
| | | this.changeTime = this.handleDatetime(date) |
| | | |
| | | const DATA = { |
| | | CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key, |
| | | captplanid: this.rowData.CaptPlanId, |
| | | datetime: this.handleDatetime(date) |
| | | } |
| | | this.getCapacityPlanningOnclickSelect(DATA) |
| | | this.getDblTime() |
| | | |
| | | // const indexV = this.value.indexOf(this.handleDatetime(date)) |
| | | // this.value.splice(indexV, 1) |
| | | // for (const i in this.defArr) { |
| | | // if (this.defArr[i].name === this.handleDatetime(date)) { |
| | | // this.defArr.splice(i, 1) |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | this.$emit('input', this.value) |
| | | }, 300) |
| | | } |
| | | }, |
| | | isDblDate(date) { |