From ced3ba90c72f12d72302bc897e598d5161b6e7f4 Mon Sep 17 00:00:00 2001 From: jinna Date: Wed, 22 Feb 2023 10:53:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=91=E7=9A=84=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/myExam.vue | 67 +++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/src/views/myExam.vue b/src/views/myExam.vue index a728c11..e446d1d 100644 --- a/src/views/myExam.vue +++ b/src/views/myExam.vue @@ -5,7 +5,7 @@
查询无结果
暂无您的预约项目,请选择医院后进行预约
- +
{{ item.createDeptName }}
@@ -55,9 +55,10 @@ export default { return { current: 1, size: 10, - finished: false, + isFinished: false, examArr: [], userInfo: null, + loading:true, systemTime: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'), setInterval: 0, interVal: null, @@ -73,7 +74,8 @@ export default { if (userInfo) { this.userInfo = userInfo; this.querySystemTime(); - this.queryMyRecord(); + // this.queryMyRecord(); + this.onLoad() } }, computed: { @@ -87,7 +89,7 @@ export default { }, methods: { onLoad() { - this.current += 1; + // this.current += 1; this.queryMyRecord(); }, //系统时间 @@ -121,7 +123,7 @@ export default { let retData = JSON.parse(value); if (retData.code == 200) { let list = retData.data.records; - + this.loading = false list.map(item1 => { item1.details.map(item => { console.log(item) @@ -151,8 +153,9 @@ export default { // } this.examArr = [...this.examArr, ...list]; console.log(this.examArr) - if (retData.data.total == this.examArr.length) { - this.finished = true + if(retData.data.records.length == 0 ) { + // console.log('ces') + this.isFinished = true } else { this.current++ } @@ -182,11 +185,9 @@ export default { // item.lastTime = Date.parse(new Date(latime.replaceAll('-', '/'))) item.lastCanTime = Date.parse(new Date(lasCanTime.replace(/-/g, '/'))) item.lastTime = Date.parse(new Date(latime.replace(/-/g, '/'))) - console.log('las', item.lastTime) item.limitTime = this.intervalTime(item.starTime, item.lastTime) item.lastExamTime = systemTime < item.lastTime ? item.lastTime - systemTime : 0 item.limitCancelTime = systemTime < item.lastCanTime ? item.lastCanTime - systemTime : 0;//距离取消预约剩余毫秒数 - console.log(item.limitCancelTime) // console.log(latime,item.lastTime,lasCanTime,item.lastCanTime,item.limitCancelTime) //670422000 // this.$set( // item,"limitTime",item.limitTime @@ -196,12 +197,12 @@ export default { this.timeList() this.examArr = [...this.examArr, ...list]; - if (res.data.total == res.data.pages) { - this.finished = true + if (res.data.records.length === 0) { + this.isFinished = true; } else { this.current++ } - + this.loading = false // this.examArr.map(item => { // let systemTime = Date.parse(new Date(this.systemTime)); // this.starTime = systemTime @@ -352,19 +353,29 @@ export default { title: "提示",//可传空 buttonLabels: ['确定', '取消'], success: (data) => { - console.log(data) if (JSON.parse(data).buttonIndex == 1) { // console.log('ces') + this.$toast.loading({ + message: '', + duration: 0, + }) if (this.GlobalConfig.appMode) { vaildInterfacefn("cgstjyyjzpzp", "qdsgajjtjczdqxtjyy", JSON.stringify({ id: row.id }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { let retData = JSON.parse(value); if (retData.code == 200) { this.$toast('操作成功'); - setTimeout(() => { - this.current = 1; - this.examArr = [] - this.queryMyRecord(); - }, 500); + this.examArr.map(item => { + let tmp = item.details.find(item1 => item1.id == row.id) + if(tmp){ + tmp.apmStatus = 1; + } + }) + this.$toast.clear() + // setTimeout(() => { + // this.current = 1; + // this.examArr = [] + // this.queryMyRecord(); + // }, 500); } }, err => { }) @@ -374,11 +385,21 @@ export default { console.log(res) if (res.code == 200) { this.$toast('操作成功'); - setTimeout(() => { - this.current = 1; - this.examArr = [] - this.queryMyRecord(); - }, 500); + // let tmp = '' + + this.examArr.map(item => { + let tmp = item.details.find(item1 => item1.id == row.id) + if(tmp){ + tmp.apmStatus = 1 + } + }) + this.$toast.clear() + // setTimeout(() => { + // this.current = 1; + // this.examArr = []; + // this.loading = false + // this.queryMyRecord(); + // }, 500); } }) }