This commit is contained in:
binbin_pan 2024-09-04 18:29:27 +08:00
parent 76ccdca662
commit e7a1274dbf
9 changed files with 820 additions and 23 deletions

View File

@ -248,6 +248,13 @@
{
"navigationBarTitleText" : "体检预约"
}
},
{
"path" : "pages/HealthExaminationApp/myAppointment/healthExamDetails",
"style" :
{
"navigationBarTitleText" : "体检预约单"
}
}
],
"globalStyle": {

View File

@ -158,7 +158,7 @@ export default {
this.getCheckType()
},
methods: {
// app/getCareerHospital
// app/gethospital
getHospitalList() {
const params = {
token: this.token,
@ -166,7 +166,7 @@ export default {
}
console.log('🚀 ~ getHospitalList ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getCareerHospital',
url: config.tjBaseUrl + '/app/gethospital',
method: 'post',
data: params,
header: {
@ -356,7 +356,7 @@ export default {
icon: 'success'
})
uni.reLaunch({
// url: '/pages/HealthExaminationApp/index/index'
url: '/pages/HealthExaminationApp/myAppointment/bookSuccessfully'
})
}
},

View File

@ -1,19 +1,512 @@
<template>
<view>
职业预约
</view>
<view>
<div class="content">
<h3>选择医院</h3>
<div class="item" @click="show = true">
<div v-if="!hospital">点击选择医院</div>
<div v-else>{{ hospital }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
<h3 style="margin-top: 20px">职工套餐</h3>
<!-- <div class="item" @click="showPropup = true"> -->
<div class="item">
<div>{{ checkType }}</div>
<!-- <div v-if="!checkType">点击选择检查类型</div>
<div v-else>{{ checkType }}</div>
<div><u-icon name="arrow-right"></u-icon></div> -->
</div>
<h3 style="margin-top: 20px">体检时间</h3>
<div class="item" @click="handleShowTime">
<div v-if="!healthTime">点击选择时间</div>
<div v-else>{{ healthTime }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
</div>
<!-- 选择医院 -->
<u-picker
:show="show"
:columns="[hospitalList]"
keyName="hospitalName"
@cancel="show = false"
@confirm="confirmHospital"
></u-picker>
<!-- 检查类型 -->
<u-popup :show="showPropup" :round="10" mode="bottom" closeable @close="showPropup = false">
<div class="propup-content">
<h3>请选择套餐</h3>
<div class="title-wrapper">
<div class="title title-tip" v-if="!checkType">
<div>请选择</div>
<div class="line"></div>
</div>
<div v-else>
<div class="title">{{ checkType }}</div>
<div class="line"></div>
</div>
</div>
<div>
<div
class="list-item"
:class="{ active: active == index }"
v-for="(item, index) in checkTypeList"
:key="index"
@click="handleCheckType(item, index)"
>
<!-- {{ item.combName }} -->
</div>
</div>
<div class="cont-title" v-if="checkTypeContent">
<div class="cont">{{ checkTypeContent }}</div>
<div v-if="showIcon" class="cont-icon" @click="showIcon = false">
<div style="margin-right: 3px">展开</div>
<div>
<u-icon name="arrow-down" color="#1989fa" size="16" />
</div>
</div>
<div v-else class="cont-icon" @click="showIcon = true">
<div style="margin-right: 3px">收起</div>
<div>
<u-icon name="arrow-up" color="#1989fa" size="16" />
</div>
</div>
</div>
<div class="cont-line"></div>
<div v-show="!showIcon" class="contList-wrapper">
<div class="contList-item" v-for="(item, index) in checkTypeContentList" :key="index">
<div class="cont-title">{{ item.combinName }}</div>
<div>项目内容{{ item.combinContent }}</div>
<div>
项目价格
<span style="color: red">{{ item.combinPrice }}</span>
</div>
</div>
</div>
<div class="btn" v-if="checkType">
<u-button type="primary" text="确认套餐" size="small" @click="showPropup = false"></u-button>
</div>
</div>
</u-popup>
<!-- 体检时间 -->
<u-calendar :show="showTime" mode="single" @confirm="confirmTime" @close="showTime = false"></u-calendar>
<div v-if="healthTime" class="reservation-number">当天剩余可预约人数{{ reservationNumber }}</div>
<div class="content" v-if="hospitalInfo.hospitalName">
<h3>医院信息</h3>
<div class="hospital-name">{{ hospitalInfo.hospitalName }}</div>
<div>地址: {{ hospitalInfo.address }}</div>
<div>营业时间: 周一至周五 {{ hospitalInfo.businessEnd }}-{{ hospitalInfo.businessHours }}</div>
<div>负责人: {{ hospitalInfo.responsible }}</div>
<div>联系方式: {{ hospitalInfo.telPhone }}</div>
</div>
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime">
<u-button type="primary" text="确定预约" shape="circle" size="small" @click="handleSave"></u-button>
</div>
</view>
</template>
<script>
export default {
data() {
return {
import config from '@/config'
import Crypoto from '@/utils/aescbc'
};
}
}
export default {
data() {
return {
token: uni.getStorageSync('tjToken'),
idcard: '',
active: null,
//
hospitalList: [],
//
hospital: '',
//
hospitalInfo: {},
//
healthTime: '',
show: false,
showTime: false,
columns: [],
showPropup: false,
checkId: '',
setMealId: '',
//
checkType: '',
// -
checkTypeList: [],
// -
checkTypeContent: '',
checkTypeContentList: [],
showIcon: false,
reservationNumber: 0,
isDisabled: true
}
},
onLoad(opt) {
opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ opt:', opt)
this.idcard = opt.idcard
},
mounted() {
this.getHospitalList()
this.getCheckType()
},
methods: {
// app/getCareerHospital
getHospitalList() {
const params = {
token: this.token,
idcard: this.idcard
}
console.log('🚀 ~ getHospitalList ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getCareerHospital',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getHospitalList ~ res:', res)
if (res.res == 1) {
this.hospitalList = res.obj
// this.hospitalInfo = res.obj[0]
// this.columns , pushcolumns
this.columns.push(this.hospitalList)
console.log('🚀 ~ getHospitalList ~ this.hospitalList:', this.hospitalList)
}
},
fail: err => {
console.log('🚀 ~ getHospitalList ~ err:', err)
}
})
},
//
getCheckType() {
const params = {
token: this.token,
idcard: this.idcard
}
console.log('🚀 ~ getCheckType ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getworkexamination',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getCheckType ~ res:', res)
if (res.res == 1) {
// this.checkTypeList = res.obj
this.checkType = res.obj.combName
this.setMealId = res.obj.id
}
},
fail: err => {
console.log('🚀 ~ getCheckType ~ err:', err)
}
})
},
//
confirmHospital(e) {
console.log('🚀 ~ confirmHospital ~ e:', e)
this.hospital = e.value[0].hospitalName
this.hospitalInfo = e.value[0]
console.log('🚀 ~ confirmHospital ~ this.hospitalInfo:', this.hospitalInfo)
if (this.hospitalInfo.id) this.isDisabled = false
this.show = false
},
//
handleCheckType(item, index) {
console.log('🚀 ~ handleCheckType ~ item:', item)
this.active = index
this.checkType = item.combName
this.getCheckTypeContent(item)
},
//
getCheckTypeContent(item) {
const params = {
token: this.token,
checkId: item.id,
combType: 2
}
console.log('🚀 ~ getCheckTypeContent ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getexamination',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getCheckTypeContent ~ res:', res)
if (res.res == 1) {
this.setMealId = res.obj.tibean[0].id
this.checkTypeContent = res.obj.tibean[0].combName
this.checkTypeContentList = res.obj.tibeanson
}
},
fail: err => {
console.log('🚀 ~ getCheckTypeContent ~ err:', err)
}
})
},
handleShowTime() {
if (this.isDisabled) {
uni.showToast({
title: '请选择医院',
icon: 'none'
})
} else {
this.showTime = true
}
},
getCurrentDate() {
const date = new Date()
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
//
confirmTime(e) {
console.log('🚀 ~ confirmTime ~ e:', e)
const today = this.getCurrentDate()
if (e[0] == today) {
uni.showToast({
title: '不可以预约今天',
icon: 'none'
})
return
}
this.healthTime = e[0]
this.showTime = false
this.getReservationNumber()
},
//
getReservationNumber() {
const params = {
token: this.token,
hosId: this.hospitalInfo.id,
phyAppontTime: this.healthTime,
type: '2'
}
console.log('🚀 ~ getReservationNumber ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getphyappointnum',
method: 'post',
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getReservationNumber ~ res:', res)
if (res.res == 1) {
this.reservationNumber = res.obj
}
},
fail: err => {
console.log('🚀 ~ getReservationNumber ~ err:', err)
}
})
},
// phyappoint
handleSave() {
const cry = new Crypoto()
const params = {
hospitalId: this.hospitalInfo.id,
setMealId: this.setMealId,
checkId: '',
phyAppontTime: this.healthTime,
setMealType: '3',
combName: this.checkType,
token: this.token
}
console.log('🚀 ~ handleSave ~ params:', params)
console.log('🚀 ~ handleSave ~ params:', cry.encrypt(JSON.stringify(params)))
uni.request({
url: config.tjBaseUrl + '/app/phyappoint',
method: 'post',
// data: { encryptedData: params, token: this.token },
data: params,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ handleSave ~ res:', res)
if (res.res == 1) {
uni.showToast({
title: '预约成功',
icon: 'success'
})
uni.reLaunch({
url: '/pages/HealthExaminationApp/myAppointment/bookSuccessfully'
})
}
},
fail: err => {
console.log('🚀 ~ handleSave ~ err:', err)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
margin: 10px;
padding: 10px;
border-radius: 5px;
background: #fff;
h3 {
margin-bottom: 10px;
}
.hospital-wrapper {
/* display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center; */
margin-bottom: 20px;
}
.item {
padding: 0 15px;
width: calc(100% -30px);
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
background: #f5f5f5;
border-radius: 50px;
font-size: 14px;
}
.hospital-name {
font-weight: 600;
font-size: 16px;
color: #1989fa;
line-height: 35px;
}
}
.propup-content {
height: 500px;
padding: 20px;
.title-wrapper {
display: flex;
justify-content: flex-start;
align-items: center;
}
.title {
margin-top: 20px;
color: #333;
display: flex;
flex-direction: column;
align-items: center;
}
.title-tip {
color: #999;
}
.line {
margin: 10px 0;
width: 42px;
height: 2px;
background: #1989fa;
border-radius: 2px;
}
.list-item {
margin-right: 10px;
color: #333;
&.active {
color: #1989fa;
}
}
.cont-title {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
color: #1989fa;
font-size: 16px;
.cont-icon {
display: flex;
align-items: center;
}
}
.cont-line {
margin-top: 6px;
width: 100%;
height: 1px;
background: #ccc;
}
.contList-wrapper {
max-height: 300px;
overflow: auto;
}
.contList-item {
margin: 10px 0;
color: #333;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
word-break: break-all;
overflow: auto;
.cont-title {
font-size: 16px;
color: #1989fa;
line-height: 30px;
}
}
.btn {
//
position: absolute;
bottom: 20px;
left: 20px;
/* width: 80px; */
}
}
.reservation-number {
height: 20px;
margin: 10px;
margin-top: 0;
padding: 10px;
color: #999;
background: #fff;
border-radius: 5px;
font-size: 15px;
/* text-align: start; */
}
</style>

View File

@ -0,0 +1,123 @@
<template>
<view>
<div class="content">
<h2 style="text-align: center">体检单据</h2>
<div class="title">套餐名称:</div>
<div>{{ combName }}</div>
<div class="title">体检项目:</div>
<div>{{ combItem }}</div>
<div class="title">体检内容:</div>
<div v-for="(item, index) in combContent" :key="index">
<div class="item-content">
<div style="width: 240px">{{ item.mealName }}{{ item.mealContent }}</div>
<div style="color: red; margin-left: 15px">{{ item.mealPrice }} </div>
</div>
<u-line dashed style="margin-bottom: 10px;"></u-line>
</div>
<div class="title" style="color: red">体检总价{{ totalPrice }} </div>
</div>
</view>
</template>
<script>
import config from '@/config'
export default {
data() {
return {
token: '',
cancelId: '',
//
combName: '',
//
combItem: '项目1、项目2、项目3',
//
combContent: [
{
mealName: '项目1',
mealContent:
'项目1内容项目1内容项目1内容项目1内容项目1内容项目1内容项目1内容项目1内容项目1内容项目1内容项目1内容项目1内容',
mealPrice: '100'
},
{
mealName: '项目2',
mealContent: '项目2内容',
mealPrice: '200'
},
{
mealName: '项目3',
mealContent: '项目3内容',
mealPrice: '300'
}
],
//
totalPrice: 0
}
},
onLoad(opt) {
opt = JSON.parse(opt.params)
this.combName = opt.combName
this.cancelId = opt.id
console.log('🚀 ~ onLoad ~ onLoad', opt)
this.token = uni.getStorageSync('tjToken')
},
mounted() {
// this.getDetail()
},
methods: {
//
getDetail() {
const params = {
token: this.token,
cancelId: this.cancelId
}
console.log('🚀 ~ getDetail ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getcontentByid',
method: 'post',
data: params,
header: {
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ getDetail ~ res:', res)
if (res.res == 1) {
this.combContent = res.obj
this.combItem = res.obj.map(item => item.mealName).join('、')
this.totalPrice = res.obj.reduce((total, item) => total + Number(item.mealPrice), 0)
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
margin: 10px;
padding: 10px;
background: #fff;
border-radius: 5px;
.title {
font-size: 16px;
font-weight: bold;
color: #333;
line-height: 2.5;
}
.item-content {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
word-break: break-all;
}
}
</style>

View File

@ -1,20 +1,194 @@
<template>
<div>
<div class="content">
<div class="item-wrapper">
<div class="item" @click="show = true">
<div v-if="!makeStatus">请选择体检状态</div>
<div v-else>{{ makeStatus }}</div>
<div><u-icon name="arrow-right"></u-icon></div>
</div>
<div class="btn">
<u-button type="primary" text="查询"></u-button>
</div>
</div>
<u-picker :show="show" :columns="columns" @close="show = false" @confirm="handleSearch"></u-picker>
</div>
<div class="tip">提示向左滑动取消预约</div>
<u-swipe-action class="swipe-wrapper">
<u-swipe-action-item
class="swipe-item"
:options="options"
v-for="(item, index) in makeList"
:key="index"
:disabled="item.ifCancel == 1 || item.ifCancel == 4"
@click="handleDelete(item)"
>
<div class="swipe-action" @click="handleOption(item)">
<div class="item-icon">
<u-icon
v-if="item.ifCancel == 1 || item.ifCancel == 4"
name="/static/images-tijian/isCanceled.png"
size="120"
></u-icon>
<u-icon v-else-if="item.ifCancel == 2" name="/static/images-tijian/readyExam.png" size="120"></u-icon>
<u-icon v-else name="/static/images-tijian/isExamed.png" size="120"></u-icon>
</div>
<div class="item-cont">
<div class="hospital-name">{{ item.hospitalName }}</div>
<div class="combName">
<div>{{ item.combName }}</div>
<div style="color: red">{{ item.setMealPrice || '0.0' }}</div>
</div>
<div>预约时间{{ item.phyAppontTime }}</div>
</div>
</div>
</u-swipe-action-item>
</u-swipe-action>
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {
import config from '@/config'
export default {
data() {
return {
token: '',
show: false,
columns: [['全部', '已取消', '待体检', '已体检']],
//
makeStatus: '',
//
makeList: [],
isDisabled: false,
options: [
{
text: '删除',
// disabled: isDisabled,
style: {
backgroundColor: '#f56c6c'
}
}
]
}
},
created() {
this.token = uni.getStorageSync('tjToken')
},
mounted() {
this.getList()
},
methods: {
handleSearch(e) {
console.log('🚀 ~ handleSearch ~ e:', e)
this.makeStatus = e.value[0]
this.show = false
},
// getpersonappointInfo
getList() {
console.log('🚀 ~ 列表 ~ this.token:', this.token)
uni.request({
url: config.tjBaseUrl + '/app/getpersonappointInfo',
method: 'post',
data: this.token,
header: {
'Content-Type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
res = res.data
console.log('🚀 ~ 列表 ~ res:', res)
if (res.res == 1) {
this.makeList = res.obj
}
},
fail: err => {
console.log('🚀 ~ 列表 ~ err:', err)
}
})
},
// -
handleDelete(item) {
console.log('🚀 ~ handleDelete ~ item:', item)
},
//
handleOption(item) {
console.log('🚀 ~ handleOption ~ item:', item)
const params = {
id: item.id,
combName: item.combName,
}
console.log('🚀 ~ handleOption ~ params:', params)
uni.navigateTo({
url: '/pages/HealthExaminationApp/myAppointment/healthExamDetails?params=' + JSON.stringify(params)
})
}
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 10px;
}
.item-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.item {
padding: 0 15px;
width: calc(100vw - 100px);
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
background: #f5f5f5;
border-radius: 50px;
font-size: 14px;
margin-right: 10px;
}
.btn {
width: 50px;
}
}
.tip {
margin-left: 10px;
margin-bottom: 20px;
color: #999;
font-size: 15px;
}
.swipe-item {
border-radius: 5px;
margin: 10px 0;
.swipe-action {
padding: 10px;
border-radius: 5px;
word-break: break-all;
.item-icon {
//
position: absolute;
top: -42px;
left: -36px;
}
.item-cont {
margin-left: 50px;
.hospital-name {
font-size: 15px;
font-weight: bold;
line-height: 1.5;
}
.combName {
display: flex;
justify-content: space-between;
}
}
}
}
</style>

View File

@ -197,7 +197,7 @@
jwtToken: uni.getStorageSync('App-Token')
}
const tjparams = {
username: '13708411772',
username: '13708411772', // 15912575796
password: 'YNsbd@123456'
}
console.log('🚀 ~ gotoYy ~ tjparams:', tjparams)

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB