| | |
| | | labelWidth="200" |
| | | label="选择期望批单生效期:" |
| | | prop="startDate" |
| | | @click="show1 = true" |
| | | @click="openTime" |
| | | > |
| | | <u--input v-model="model.startDate" disabled disabledColor="#ffffff" placeholder="请选择" border="none"></u--input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | |
| | | this.getCodeList() |
| | | }, |
| | | methods: { |
| | | openTime() { |
| | | if (!this.model.code) return uni.showToast({ |
| | | title: '请选择保单号', |
| | | icon: 'none' |
| | | }) |
| | | this.show1 = true |
| | | }, |
| | | getCodeList() { |
| | | this.$u.api.insuranceApplyFindListByDTO({ |
| | | status: 5, |
| | | status: '5,27', |
| | | isEffective: 0 |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | confirm(e) { |
| | | this.model.id = e.value[0].solutionId |
| | | this.model.code = e.value[0].code |
| | | this.id = e.value[0].id |
| | | if ([1,3].includes(this.compareDates(this.getDate(), e.value[0].startTime)) && !e.value[0].lastChangeDate) { |
| | | // 当前日期大于等于生效日期并且最后一次操作时间等于空 |
| | | this.minDate = new Date(this.getTomorrow()).getTime() |
| | | this.maxDate = new Date(e.value[0].endTime).getTime() |
| | | } else if (this.compareDates(this.getDate(), e.value[0].startTime) === 2 && !e.value[0].lastChangeDate) { |
| | | // 当前日期小于生效日期并且最后一次操作时间等于空 |
| | | this.minDate = new Date(e.value[0].startTime).getTime() |
| | | this.maxDate = new Date(e.value[0].endTime).getTime() |
| | | } else if (e.value[0].lastChangeDate) { |
| | | // 最后一次操作时间有值 |
| | | if ([1,3].includes(this.compareDates(this.getDate(), e.value[0].lastChangeDate))) { |
| | | // 当前日期大于最后一次操作时间 |
| | | this.minDate = new Date(this.getTomorrow()).getTime() |
| | | this.maxDate = new Date(e.value[0].endTime).getTime() |
| | | } else if (this.compareDates(this.getDate(), e.value[0].lastChangeDate) === 2) { |
| | | // 当前时间小于最后一次操作时间 |
| | | this.minDate = new Date(e.value[0].lastChangeDate).getTime() |
| | | this.maxDate = new Date(e.value[0].endTime).getTime() |
| | | async confirm(e) { |
| | | // 获取最新方案id |
| | | let res = await this.$u.api.insuranceApplyById(e.value[0].id) |
| | | if (res.code === 200) { |
| | | this.model.id = res.data.newVersionSolutionId |
| | | this.model.code = e.value[0].code |
| | | this.id = e.value[0].id |
| | | if ([1,3].includes(this.compareDates(this.getDate(), e.value[0].startTime)) && !e.value[0].lastChangeDate) { |
| | | // 当前日期大于等于生效日期并且最后一次操作时间等于空 |
| | | // this.minDate = new Date(this.getTomorrow()).getTime() |
| | | // this.maxDate = new Date(e.value[0].endTime).getTime() |
| | | this.minDate = this.formatTimeStamp(this.getTomorrow()) |
| | | this.maxDate = this.formatTimeStamp(e.value[0].endTime) |
| | | } else if (this.compareDates(this.getDate(), e.value[0].startTime) === 2 && !e.value[0].lastChangeDate) { |
| | | // 当前日期小于生效日期并且最后一次操作时间等于空 |
| | | // this.minDate = new Date(e.value[0].startTime).getTime() |
| | | // this.maxDate = new Date(e.value[0].endTime).getTime() |
| | | this.minDate = this.formatTimeStamp(e.value[0].startTime) |
| | | this.maxDate = this.formatTimeStamp(e.value[0].endTime) |
| | | } else if (e.value[0].lastChangeDate) { |
| | | // 最后一次操作时间有值 |
| | | if ([1,3].includes(this.compareDates(this.getDate(), e.value[0].lastChangeDate))) { |
| | | // 当前日期大于最后一次操作时间 |
| | | // this.minDate = new Date(this.getTomorrow()).getTime() |
| | | // this.maxDate = new Date(e.value[0].endTime).getTime() |
| | | this.minDate = this.formatTimeStamp(this.getTomorrow()) |
| | | this.maxDate = this.formatTimeStamp(e.value[0].endTime) |
| | | } else if (this.compareDates(this.getDate(), e.value[0].lastChangeDate) === 2) { |
| | | // 当前时间小于最后一次操作时间 |
| | | // this.minDate = new Date(e.value[0].lastChangeDate).getTime() |
| | | // this.maxDate = new Date(e.value[0].endTime).getTime() |
| | | this.minDate = this.formatTimeStamp(e.value[0].lastChangeDate) |
| | | this.maxDate = this.formatTimeStamp(e.value[0].endTime) |
| | | } |
| | | } |
| | | this.show = false |
| | | } |
| | | this.show = false |
| | | }, |
| | | //封装函数(data格式为2017-11-11) |
| | | formatTimeStamp(date){ |
| | | console.log(Date.parse(new Date(`${date}`)) || Date.parse(new Date(`${date.replace(/-/g,'/')}`))) |
| | | return Date.parse(new Date(`${date}`)) || Date.parse(new Date(`${date.replace(/-/g,'/')}`)) |
| | | }, |
| | | // 选择时间 |
| | | confirm1(e) { |
| | | this.model.startDate = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + ' 00:00:00' |
| | | this.$u.api.getChangeCountCyclePriceVO({ |
| | | applyId: this.model.id, |
| | | applyId: this.id, |
| | | validTime: this.model.startDate |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.model.cyclePrice = res.data.cyclePrice |
| | | this.show1 = false |
| | | } else { |
| | | this.model.startDate = '' |
| | | } |
| | | }) |
| | | }, |