Commit 07074e06 by 李伟康

```

feat(usedCar): 优化日报填写检查逻辑并调整日期变更流程

在用户尝试切换日期或返回上一页时,增加对日报填写状态的异步检查。若当前日期不在7天内或已填写,则允许直接跳转;否则弹出提示框引导用户完成操作。同时将相关方法改为 async/await 形式以支持异步判断。
```
1 parent 9b2467ec
......@@ -155,8 +155,10 @@ export default {
// 打开弹窗
this.$refs.notice.open()
},
backPage () {
this.openNotice()
async backPage () {
const openNotice = await this.checkReport()
if (openNotice) this.openNotice()
else uni.navigateBack()
},
// name:跳转组件名,val:跳转参数
jump (name, val) {
......@@ -165,17 +167,18 @@ export default {
this.transmissionOfData = val
}
},
changeDate (e) {
if (e.fullDate == this.currentDate) return
async checkReport () {
let dailyReportRef = this.$refs['detail-DailyReport-Ref']
if (dailyReportRef) {
console.log(dailyReportRef)
let { isDateWithin7Days, isFilled } = dailyReportRef
if (!isDateWithin7Days || isFilled) {
this.$refs.calendar.manualChangeDate(e)
return
}
if (!isDateWithin7Days || isFilled) return false
}
return true
},
async changeDate (e) {
if (e.fullDate == this.currentDate) return
const openNotice = await this.checkReport()
if (!openNotice) return this.$refs.calendar.manualChangeDate(e)
this.openNotice(null, false, _ => {
this.$refs.calendar.manualChangeDate(e)
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!