我的预约列表接口对接

main
xuechunyuan 3 years ago
parent 74dae93467
commit 51bce6fbc8
  1. 27
      src/api/hospital.js
  2. 283
      src/views/myExam.vue

@ -12,7 +12,7 @@ export const queryArticleDetail = (createDept) => {
return request({ return request({
url: '/api/blade-business/article/detail-publish', url: '/api/blade-business/article/detail-publish',
method: 'get', method: 'get',
params:{ params: {
createDept createDept
} }
}) })
@ -22,8 +22,31 @@ export const checkBacklist = (cupCardNo) => {
return request({ return request({
url: '/api/blade-business/blacklist/user-blacklist', url: '/api/blade-business/blacklist/user-blacklist',
method: 'get', method: 'get',
params:{ params: {
cupCardNo cupCardNo
} }
}) })
}; };
//我的预约列表
export const myRecord = (createDept, cupCardNo, current,size) => {
return request({
url: '/api/blade-business/apm-record/page',
method: 'get',
params: {
createDept,
cupCardNo,
current,
size,
}
})
};
//取消预约
export const recordCancel = (id) => {
return request({
url: '/api/blade-business/apm-record/cancel',
method: 'get',
params: {
id,
}
})
};

@ -1,7 +1,7 @@
<template> <template>
<div class="my_exam"> <div class="my_exam">
<div class="exam_box" v-for="item in examArr" :key="item.time"> <div class="exam_box" v-for="item in examArr" :key="item.time">
<div class="time_box">{{item.time}}</div> <div class="time_box">{{ item.time }}</div>
<div class="pro_box" v-for="item1 in item.examData" :key="item1.name"> <div class="pro_box" v-for="item1 in item.examData" :key="item1.name">
<div class="pro_top"> <div class="pro_top">
<div class="img_box"> <div class="img_box">
@ -9,8 +9,8 @@
<img v-else src="~@/assets/image/time_gray.png" alt="" /> <img v-else src="~@/assets/image/time_gray.png" alt="" />
</div> </div>
<div class="time_box"> <div class="time_box">
<div class="time_text">{{item1.time}}</div> <div class="time_text">{{ item1.time }}</div>
<div class="date_txt">{{item1.monment}}</div> <div class="date_txt">{{ item1.monment }}</div>
</div> </div>
</div> </div>
<div class="pro_bottom"> <div class="pro_bottom">
@ -19,11 +19,16 @@
<img v-if="item1.status !== 3" src="~@/assets/image/pro.png" alt="" /> <img v-if="item1.status !== 3" src="~@/assets/image/pro.png" alt="" />
<img v-else src="~@/assets/image/pro_gray.png" alt="" /> <img v-else src="~@/assets/image/pro_gray.png" alt="" />
</div> </div>
<div class="pro_name">{{item1.name}}</div> <div class="pro_name">{{ item1.name }}</div>
<div class="pro_pos" :class="item1.status == 1 ? 'tips' : item1.status == 3 ? 'cancel_tip' : ''">{{item1.tip}}</div> <div class="pro_pos" :class="item1.status == 1 ? 'tips' : item1.status == 3 ? 'cancel_tip' : ''">
{{ item1.tip }}</div>
</div> </div>
<div class="pro_right"> <div class="pro_right">
<div class="cancel" @click="cancelRegisiter" :class="item1.status == 2 ? 'finish' : item1.status == 3 ? 'cancel_item' : ''">{{item1.status == 1 ? '取消预约' : item1.status == 2 ? '已完成' : item1.status == 3 ? '已取消' : ''}}</div> <div class="cancel" @click="cancelRegisiter(item1)"
:class="item1.status == 2 ? 'finish' : item1.status == 3 ? 'cancel_item' : ''">{{
item1.status == 1 ?
'取消预约' : item1.status == 2 ? '已完成' : item1.status == 3 ? '已取消' : ''
}}</div>
</div> </div>
</div> </div>
</div> </div>
@ -32,42 +37,71 @@
</template> </template>
<script> <script>
import { myRecord,recordCancel } from "@/api/hospital";
export default { export default {
data() { data() {
return { return {
examArr:[ current: 1,
{time:'2023-02-08',examData:[ size: 10,
{ examArr: [
name:'单眼视力',monment:'上午 9:00-9:30',time:'2023-01-08',tip:'门诊楼3楼眼科门诊',status:1 {
}, time: '2023-02-08', examData: [
{ {
name:'听力',monment:'上午 9:00-9:30',time:'2023-01-08',tip:'门诊楼3楼耳科门诊',status:2 name: '单眼视力', monment: '上午 9:00-9:30', time: '2023-01-08', tip: '门诊楼3楼眼科门诊', status: 1
} },
]}, {
{time:'2022-01-15',examData:[ name: '听力', monment: '上午 9:00-9:30', time: '2023-01-08', tip: '门诊楼3楼耳科门诊', status: 2
{ }
name:'单眼视力',monment:'上午 9:00-9:30',time:'2022-01-15',tip:'门诊楼3楼眼科门诊',status:3 ]
}, },
]} {
] time: '2022-01-15', examData: [
{
name: '单眼视力', monment: '上午 9:00-9:30', time: '2022-01-15', tip: '门诊楼3楼眼科门诊', status: 3
},
]
} }
],
userInfo: null
}
},
mounted() {
let userInfo = sessionStorage.getItem('userInfo') ? JSON.parse(sessionStorage.getItem('userInfo')) : null;
if (userInfo) {
this.userInfo = userInfo;
this.queryMyRecord();
}
},
methods: {
//
queryMyRecord() {
myRecord("",this.userInfo.papersnumber, this.current, this.size).then(res => {
})
}, },
methods: { //
cancelRegisiter(){ cancelRegisiter(row) {
lightAppJssdk.notification.alert({ lightAppJssdk.notification.alert({
message: "是否取消该体检项目", message: "是否取消该体检项目",
title: "提示",// title: "提示",//
buttonName: "收到", buttonName: "收到",
success: function (data) { success: function (data) {
//onSuccessbutton //onSuccessbutton
/*回调*/ /*回调*/
console.log('取消===>',data) console.log('取消===>', data)
recordCancel(row.id).then(res => {
this.$message({
type: "success",
message: "操作成功!"
});
this.queryMyRecord();
})
}, },
fail: function (data) { // fail: function (data) { //
} }
}); });
} }
}, },
}; };
</script> </script>
@ -77,6 +111,7 @@ export default {
height: 100%; height: 100%;
background: #f9f9f9; background: #f9f9f9;
position: absolute; position: absolute;
.exam_box { .exam_box {
background: #fff; background: #fff;
padding: 0.5rem 0.24rem 0 0.24rem; padding: 0.5rem 0.24rem 0 0.24rem;
@ -91,120 +126,130 @@ export default {
} }
.pro_box { .pro_box {
width: 98%; width: 98%;
margin-top: 0.4rem; margin-top: 0.4rem;
background: #fff; background: #fff;
// margin: 0.4rem auto; // margin: 0.4rem auto;
// margin-bottom: 0.7rem; // margin-bottom: 0.7rem;
.pro_top{ .pro_top {
display: flex; display: flex;
padding-bottom: 0.26rem; padding-bottom: 0.26rem;
border-bottom: 1px solid #EEEEEE; border-bottom: 1px solid #EEEEEE;
.img_box{
display: flex; .img_box {
align-items: center; display: flex;
margin-right: 0.24rem; align-items: center;
img{ margin-right: 0.24rem;
width: 0.5rem;
height: 0.5rem; img {
} width: 0.5rem;
height: 0.5rem;
}
} }
.time_box{
.time_text{ .time_box {
width: 1.46rem; .time_text {
height: 0.32rem; width: 1.46rem;
text-align: center; height: 0.32rem;
background: #F6F6F6; text-align: center;
border-radius: 0.08rem; background: #F6F6F6;
line-height: 0.32rem; border-radius: 0.08rem;
font-size: 0.24rem; line-height: 0.32rem;
color: #999999; font-size: 0.24rem;
} color: #999999;
.date_txt{ }
font-size: 0.3rem;
font-weight: bold; .date_txt {
color: #333; font-size: 0.3rem;
line-height: 0.46rem; font-weight: bold;
} color: #333;
line-height: 0.46rem;
}
} }
} }
.pro_bottom{ .pro_bottom {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 1.2rem; height: 1.2rem;
.pro_left{ .pro_left {
display: flex; display: flex;
.img_box{ .img_box {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
img{
width: 0.5rem;
height: 0.5rem;
} img {
} width: 0.5rem;
.pro_name{ height: 0.5rem;
height: 100%;
display: flex;
align-items: center;
font-size: 0.3rem;
color: #333;
font-weight: bold;
margin-left: 0.24rem;
}
.pro_pos{
height: 100%;
display: flex;
align-items: center;
font-size: 0.24rem;
color: #999;
margin-left: 0.24rem;
}
.tips{
color: #00B578;
}
.cancel_tip{
color: #F93A4A;
} }
} }
.pro_right{
.pro_name {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 0.3rem;
color: #333;
font-weight: bold;
margin-left: 0.24rem;
}
.cancel{ .pro_pos {
width: 1.5rem; height: 100%;
height: 0.5rem; display: flex;
background: rgba(22, 119, 255,.1); align-items: center;
border-radius: 0.26rem; font-size: 0.24rem;
display: flex; color: #999;
align-items: center; margin-left: 0.24rem;
justify-content: center; }
font-size: 0.24rem;
color: #1677FF;
}
.finish{
background: #E5E5E5;
color: #999;
pointer-events: none;
}
.cancel_item{ .tips {
background: rgba(125, 125, 125,.2); color: #00B578;
color: #999; }
pointer-events: none;
} .cancel_tip {
color: #F93A4A;
}
} }
.pro_right {
height: 100%;
display: flex;
align-items: center;
.cancel {
width: 1.5rem;
height: 0.5rem;
background: rgba(22, 119, 255, .1);
border-radius: 0.26rem;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.24rem;
color: #1677FF;
}
.finish {
background: #E5E5E5;
color: #999;
pointer-events: none;
}
.cancel_item {
background: rgba(125, 125, 125, .2);
color: #999;
pointer-events: none;
}
}
}
} }
} }
}
} }
</style> </style>

Loading…
Cancel
Save