修改我的预约分页

main
jinna 3 years ago
parent b387c11caf
commit ced3ba90c7
  1. 67
      src/views/myExam.vue

@ -5,7 +5,7 @@
<div class="no_title">查询无结果</div> <div class="no_title">查询无结果</div>
<div class="no_txt">暂无您的预约项目请选择医院后进行预约</div> <div class="no_txt">暂无您的预约项目请选择医院后进行预约</div>
</div> </div>
<van-list :finished="finished" finished-text="没有更多了" @load="onLoad"> <van-list v-model="loading" :finished="isFinished" finished-text="没有更多了" @load="onLoad">
<van-cell class="exam_box" v-for="item in examArr" :key="item.id"> <van-cell class="exam_box" v-for="item in examArr" :key="item.id">
<div class="time_box">{{ item.createDeptName }}</div> <div class="time_box">{{ item.createDeptName }}</div>
<div class="pro_box" v-for="item1 in item.details" :key="item1.id"> <div class="pro_box" v-for="item1 in item.details" :key="item1.id">
@ -55,9 +55,10 @@ export default {
return { return {
current: 1, current: 1,
size: 10, size: 10,
finished: false, isFinished: false,
examArr: [], examArr: [],
userInfo: null, userInfo: null,
loading:true,
systemTime: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'), systemTime: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
setInterval: 0, setInterval: 0,
interVal: null, interVal: null,
@ -73,7 +74,8 @@ export default {
if (userInfo) { if (userInfo) {
this.userInfo = userInfo; this.userInfo = userInfo;
this.querySystemTime(); this.querySystemTime();
this.queryMyRecord(); // this.queryMyRecord();
this.onLoad()
} }
}, },
computed: { computed: {
@ -87,7 +89,7 @@ export default {
}, },
methods: { methods: {
onLoad() { onLoad() {
this.current += 1; // this.current += 1;
this.queryMyRecord(); this.queryMyRecord();
}, },
// //
@ -121,7 +123,7 @@ export default {
let retData = JSON.parse(value); let retData = JSON.parse(value);
if (retData.code == 200) { if (retData.code == 200) {
let list = retData.data.records; let list = retData.data.records;
this.loading = false
list.map(item1 => { list.map(item1 => {
item1.details.map(item => { item1.details.map(item => {
console.log(item) console.log(item)
@ -151,8 +153,9 @@ export default {
// } // }
this.examArr = [...this.examArr, ...list]; this.examArr = [...this.examArr, ...list];
console.log(this.examArr) console.log(this.examArr)
if (retData.data.total == this.examArr.length) { if(retData.data.records.length == 0 ) {
this.finished = true // console.log('ces')
this.isFinished = true
} else { } else {
this.current++ this.current++
} }
@ -182,11 +185,9 @@ export default {
// item.lastTime = Date.parse(new Date(latime.replaceAll('-', '/'))) // item.lastTime = Date.parse(new Date(latime.replaceAll('-', '/')))
item.lastCanTime = Date.parse(new Date(lasCanTime.replace(/-/g, '/'))) item.lastCanTime = Date.parse(new Date(lasCanTime.replace(/-/g, '/')))
item.lastTime = Date.parse(new Date(latime.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.limitTime = this.intervalTime(item.starTime, item.lastTime)
item.lastExamTime = systemTime < item.lastTime ? item.lastTime - systemTime : 0 item.lastExamTime = systemTime < item.lastTime ? item.lastTime - systemTime : 0
item.limitCancelTime = systemTime < item.lastCanTime ? item.lastCanTime - 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 // console.log(latime,item.lastTime,lasCanTime,item.lastCanTime,item.limitCancelTime) //670422000
// this.$set( // this.$set(
// item,"limitTime",item.limitTime // item,"limitTime",item.limitTime
@ -196,12 +197,12 @@ export default {
this.timeList() this.timeList()
this.examArr = [...this.examArr, ...list]; this.examArr = [...this.examArr, ...list];
if (res.data.total == res.data.pages) { if (res.data.records.length === 0) {
this.finished = true this.isFinished = true;
} else { } else {
this.current++ this.current++
} }
this.loading = false
// this.examArr.map(item => { // this.examArr.map(item => {
// let systemTime = Date.parse(new Date(this.systemTime)); // let systemTime = Date.parse(new Date(this.systemTime));
// this.starTime = systemTime // this.starTime = systemTime
@ -352,19 +353,29 @@ export default {
title: "提示",// title: "提示",//
buttonLabels: ['确定', '取消'], buttonLabels: ['确定', '取消'],
success: (data) => { success: (data) => {
console.log(data)
if (JSON.parse(data).buttonIndex == 1) { if (JSON.parse(data).buttonIndex == 1) {
// console.log('ces') // console.log('ces')
this.$toast.loading({
message: '',
duration: 0,
})
if (this.GlobalConfig.appMode) { if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyjzpzp", "qdsgajjtjczdqxtjyy", JSON.stringify({ id: row.id }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => { vaildInterfacefn("cgstjyyjzpzp", "qdsgajjtjczdqxtjyy", JSON.stringify({ id: row.id }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => {
let retData = JSON.parse(value); let retData = JSON.parse(value);
if (retData.code == 200) { if (retData.code == 200) {
this.$toast('操作成功'); this.$toast('操作成功');
setTimeout(() => { this.examArr.map(item => {
this.current = 1; let tmp = item.details.find(item1 => item1.id == row.id)
this.examArr = [] if(tmp){
this.queryMyRecord(); tmp.apmStatus = 1;
}, 500); }
})
this.$toast.clear()
// setTimeout(() => {
// this.current = 1;
// this.examArr = []
// this.queryMyRecord();
// }, 500);
} }
}, err => { }, err => {
}) })
@ -374,11 +385,21 @@ export default {
console.log(res) console.log(res)
if (res.code == 200) { if (res.code == 200) {
this.$toast('操作成功'); this.$toast('操作成功');
setTimeout(() => { // let tmp = ''
this.current = 1;
this.examArr = [] this.examArr.map(item => {
this.queryMyRecord(); let tmp = item.details.find(item1 => item1.id == row.id)
}, 500); if(tmp){
tmp.apmStatus = 1
}
})
this.$toast.clear()
// setTimeout(() => {
// this.current = 1;
// this.examArr = [];
// this.loading = false
// this.queryMyRecord();
// }, 500);
} }
}) })
} }

Loading…
Cancel
Save