体检-体检报告
This commit is contained in:
parent
7bf27993b3
commit
c73e25f07d
|
|
@ -36,7 +36,9 @@ module.exports = {
|
|||
uploadUrl: 'http://192.168.0.14:19999/exam-file/file/uploadBase64',
|
||||
bmwUrl: 'http://192.168.0.14:19999/exam-bmw',
|
||||
// 体检-基础路径
|
||||
tjBaseUrl: 'http://192.168.0.14:20000/AppPeaManager',
|
||||
// tjBaseUrl: 'http://192.168.0.14:20000/AppPeaManager',
|
||||
tjBaseUrl: 'http://192.168.2.147:20000/AppPeaManager',
|
||||
tjFile: 'http://112.29.103.165:1616/medicalDocumentation/statics/',
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
// 应用名称
|
||||
|
|
|
|||
10
pages.json
10
pages.json
|
|
@ -213,13 +213,19 @@
|
|||
{
|
||||
"path": "pages/HealthExaminationApp/report/report",
|
||||
"style": {
|
||||
"navigationBarTitleText": "提交报告"
|
||||
"navigationBarTitleText": "体检报告"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/HealthExaminationApp/report/pdfView",
|
||||
"style": {
|
||||
"navigationBarTitleText": "体检报告"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/HealthExaminationApp/myAppointment/myAppointment",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的预约"
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@
|
|||
<div>联系方式: {{ hospitalInfo.telPhone }}</div>
|
||||
</div>
|
||||
|
||||
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime">
|
||||
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime && reservationNumber != 0">
|
||||
<u-button type="primary" text="确定预约" shape="circle" size="small" @click="handleSave"></u-button>
|
||||
</div>
|
||||
</view>
|
||||
|
|
@ -351,6 +351,7 @@ export default {
|
|||
res = res.data
|
||||
console.log('🚀 ~ handleSave ~ res:', res)
|
||||
if (res.res == 1) {
|
||||
uni.setStorageSync('appoint', true)
|
||||
uni.showToast({
|
||||
title: '预约成功',
|
||||
icon: 'success'
|
||||
|
|
|
|||
|
|
@ -72,6 +72,16 @@ export default {
|
|||
},
|
||||
// 跳转页面
|
||||
handlePage(url) {
|
||||
if (
|
||||
(url == 'appointment' && uni.getStorageSync('appoint')) ||
|
||||
(url == 'jobAppointment' && uni.getStorageSync('jobAppoint'))
|
||||
) {
|
||||
uni.showToast({
|
||||
title: '您已经预约过,无法再次预约!',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/HealthExaminationApp/${url}/${url}?params=${JSON.stringify(this.userInfo)}`
|
||||
})
|
||||
|
|
@ -126,7 +136,6 @@ export default {
|
|||
if (res.res === 1) {
|
||||
this.userInfo = res.obj[0]
|
||||
}
|
||||
|
||||
},
|
||||
fail: err => {
|
||||
console.log('🚀 ~ getapplogininfo ~ err:', err)
|
||||
|
|
|
|||
|
|
@ -34,67 +34,6 @@
|
|||
@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>
|
||||
|
||||
|
|
@ -109,7 +48,7 @@
|
|||
<div>联系方式: {{ hospitalInfo.telPhone }}</div>
|
||||
</div>
|
||||
|
||||
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime">
|
||||
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime && reservationNumber != 0">
|
||||
<u-button type="primary" text="确定预约" shape="circle" size="small" @click="handleSave"></u-button>
|
||||
</div>
|
||||
</view>
|
||||
|
|
@ -161,7 +100,7 @@ export default {
|
|||
this.getCheckType()
|
||||
},
|
||||
methods: {
|
||||
// 获取医院列表 app/getCareerHospital
|
||||
// 获取医院列表
|
||||
getHospitalList() {
|
||||
const params = {
|
||||
token: this.token,
|
||||
|
|
@ -169,7 +108,7 @@ export default {
|
|||
}
|
||||
console.log('🚀 ~ getHospitalList ~ params:', params)
|
||||
uni.request({
|
||||
url: config.tjBaseUrl + '/app/getCareerHospital',
|
||||
url: config.tjBaseUrl + '/app/getOccupationHospital',
|
||||
method: 'post',
|
||||
data: params,
|
||||
header: {
|
||||
|
|
@ -230,43 +169,6 @@ export default {
|
|||
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({
|
||||
|
|
@ -356,6 +258,7 @@ export default {
|
|||
res = res.data
|
||||
console.log('🚀 ~ handleSave ~ res:', res)
|
||||
if (res.res == 1) {
|
||||
uni.setStorageSync('jobAppoint', true)
|
||||
uni.showToast({
|
||||
title: '预约成功',
|
||||
icon: 'success'
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<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>
|
||||
<u-line dashed style="margin-bottom: 10px"></u-line>
|
||||
</div>
|
||||
|
||||
<div class="title" style="color: red">体检总价:{{ totalPrice }} 元</div>
|
||||
|
|
@ -33,28 +33,11 @@ export default {
|
|||
// 套餐名称
|
||||
combName: '',
|
||||
// 体检项目
|
||||
combItem: '项目1、项目2、项目3',
|
||||
combItem: '',
|
||||
// 体检内容
|
||||
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
|
||||
combContent: [],
|
||||
// 体检总价
|
||||
totalPrice: 0
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
|
|
@ -65,14 +48,14 @@ export default {
|
|||
this.token = uni.getStorageSync('tjToken')
|
||||
},
|
||||
mounted() {
|
||||
// this.getDetail()
|
||||
this.getDetail()
|
||||
},
|
||||
methods: {
|
||||
// 获取详情
|
||||
getDetail() {
|
||||
const params = {
|
||||
token: this.token,
|
||||
cancelId: this.cancelId
|
||||
cancelId: String(this.cancelId),
|
||||
token: this.token
|
||||
}
|
||||
console.log('🚀 ~ getDetail ~ params:', params)
|
||||
uni.request({
|
||||
|
|
@ -80,6 +63,7 @@ export default {
|
|||
method: 'post',
|
||||
data: params,
|
||||
header: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
token: this.token
|
||||
},
|
||||
success: res => {
|
||||
|
|
@ -88,7 +72,7 @@ export default {
|
|||
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)
|
||||
this.totalPrice = res.obj.reduce((total, item) => total + Number(item.mealPrice), 0)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -117,7 +101,5 @@ export default {
|
|||
margin-bottom: 10px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,49 +1,52 @@
|
|||
<template>
|
||||
<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 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-navbar title="我的预约" @leftClick="leftClick" placeholder></u-navbar>
|
||||
<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>
|
||||
</u-swipe-action-item>
|
||||
</u-swipe-action>
|
||||
<div class="btn">
|
||||
<u-button type="primary" text="查询" @click="handleQuery"></u-button>
|
||||
</div>
|
||||
</div>
|
||||
<u-picker :show="show" :columns="columns" keyName="label" @close="show = false" @confirm="handleSearch"></u-picker>
|
||||
|
||||
<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 != 2"
|
||||
@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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -55,16 +58,31 @@ export default {
|
|||
return {
|
||||
token: '',
|
||||
show: false,
|
||||
columns: [['全部', '已取消', '待体检', '已体检']],
|
||||
columns: [
|
||||
[
|
||||
{ label: '全部', value: 4 },
|
||||
{ label: '已取消', value: 1 },
|
||||
{ label: '待体检', value: 2 },
|
||||
{ label: '已体检', value: 3 }
|
||||
]
|
||||
],
|
||||
// 体检状态
|
||||
makeStatus: '',
|
||||
makeStatusValue: 4,
|
||||
// 列表
|
||||
makeList: [],
|
||||
// 全部列表
|
||||
allList: [],
|
||||
// 已取消列表
|
||||
canceledList: [],
|
||||
// 待体检列表
|
||||
readyList: [],
|
||||
// 已体检
|
||||
examList: [],
|
||||
isDisabled: false,
|
||||
options: [
|
||||
{
|
||||
text: '删除',
|
||||
// disabled: isDisabled,
|
||||
text: '取消',
|
||||
style: {
|
||||
backgroundColor: '#f56c6c'
|
||||
}
|
||||
|
|
@ -81,9 +99,21 @@ export default {
|
|||
methods: {
|
||||
handleSearch(e) {
|
||||
console.log('🚀 ~ handleSearch ~ e:', e)
|
||||
this.makeStatus = e.value[0]
|
||||
this.makeStatus = e.value[0].label
|
||||
this.makeStatusValue = e.value[0].value
|
||||
this.show = false
|
||||
},
|
||||
handleQuery(){
|
||||
if (this.makeStatusValue == 4) {
|
||||
this.makeList = this.allList
|
||||
} else if (this.makeStatusValue == 1) {
|
||||
this.makeList = this.canceledList
|
||||
} else if (this.makeStatusValue == 2) {
|
||||
this.makeList = this.readyList
|
||||
} else if (this.makeStatusValue == 3) {
|
||||
this.makeList = this.examList
|
||||
}
|
||||
},
|
||||
// 获取列表 getpersonappointInfo
|
||||
getList() {
|
||||
console.log('🚀 ~ 列表 ~ this.token:', this.token)
|
||||
|
|
@ -99,7 +129,10 @@ export default {
|
|||
res = res.data
|
||||
console.log('🚀 ~ 列表 ~ res:', res)
|
||||
if (res.res == 1) {
|
||||
this.makeList = res.obj
|
||||
this.makeList = this.allList = res.obj
|
||||
this.canceledList = res.obj.filter(item => item.ifCancel == 1)
|
||||
this.readyList = res.obj.filter(item => item.ifCancel == 2)
|
||||
this.examList = res.obj.filter(item => item.ifCancel == 3)
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
|
|
@ -107,23 +140,72 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
// 操作-删除
|
||||
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)
|
||||
})
|
||||
}
|
||||
// 操作-删除 cancelpoint
|
||||
handleDelete(item) {
|
||||
console.log('🚀 ~ handleDelete ~ item:', item)
|
||||
const params = {
|
||||
cancelId: item.id,
|
||||
mealType: item.setMealType,
|
||||
token: this.token
|
||||
}
|
||||
// 弹框确认
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认取消预约吗?',
|
||||
success: res => {
|
||||
console.log('🚀 ~ handleDelete ~ res:', res)
|
||||
if (res.confirm) {
|
||||
uni.request({
|
||||
url: config.tjBaseUrl + '/app/cancelpoint',
|
||||
method: 'post',
|
||||
data: params,
|
||||
header: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
token: this.token
|
||||
},
|
||||
success: res => {
|
||||
res = res.data
|
||||
console.log('🚀 ~ 取消预约 ~ res:', res)
|
||||
if (res.res == 1) {
|
||||
if (item.setMealType == '2') {
|
||||
uni.removeStorageSync('appoint')
|
||||
} else if (item.setMealType == '3') {
|
||||
uni.removeStorageSync('jobAppoint')
|
||||
}
|
||||
// 刷新 - 重定向
|
||||
uni.redirectTo({
|
||||
url: '/pages/HealthExaminationApp/myAppointment/myAppointment'
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log('🚀 ~ 列表 ~ err:', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log('🚀 ~ handleDelete ~ err:', err)
|
||||
}
|
||||
})
|
||||
},
|
||||
//
|
||||
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)
|
||||
})
|
||||
},
|
||||
leftClick() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/HealthExaminationApp/index/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,104 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<web-view :src="url" @message="handlePostMessage"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* uni页面通信文档
|
||||
* https://ask.dcloud.net.cn/article/35083
|
||||
* 组件使用pdf.js源码修改了部分内容
|
||||
* 只需要完成web-view监听页数并与uni通信即可
|
||||
* @kklxx 2022/12/09修复组件通信
|
||||
*/
|
||||
import { computed } from 'vue'
|
||||
export default {
|
||||
// props: {
|
||||
// path: {
|
||||
// type: String,
|
||||
// default: ''
|
||||
// }
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
viewerUrl: '/hybrid/html/web/viewer.html', // 注意:静态的html文件需要放在根路径下的 hybrid/html 文件夹中
|
||||
fileUrl: '', // 要访问的本地pdf的路径
|
||||
url: '', // 最终显示在web-view中的路径
|
||||
currentPage: 1, //初始页
|
||||
totalPage: 0, //总页码
|
||||
currentReadPage: 0 //当前页码
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(opt) {
|
||||
console.log('页面信息:', opt)
|
||||
this.fileUrl = opt.path
|
||||
// /* 设置标题 */
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: 'PDF预览'
|
||||
// })
|
||||
// /* 初始页面 */
|
||||
// this.pageInt() //获取pdfs数据
|
||||
},
|
||||
|
||||
mounted() {
|
||||
console.log('mounted-pdfView', this.path)
|
||||
/* H5页面通信方式 */
|
||||
// #ifdef H5
|
||||
window.addEventListener('message', this.ReceiveMessage)
|
||||
// #endif
|
||||
// this.fileUrl = this.path
|
||||
/* 设置标题 */
|
||||
uni.setNavigationBarTitle({
|
||||
title: 'PDF预览'
|
||||
})
|
||||
/* 初始页面 */
|
||||
this.pageInt() //获取pdfs数据
|
||||
},
|
||||
|
||||
//页面销毁前
|
||||
beforeDestroy() {
|
||||
uni.removeStorage({
|
||||
//清除pdf留下的缓存,不干扰新的pdf载入
|
||||
key: 'pdfjs.history',
|
||||
success() {
|
||||
// console.log("removeStorage", res)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
//页面初始化
|
||||
pageInt() {
|
||||
this.url = `${this.viewerUrl}?file=${encodeURIComponent(this.fileUrl)}&page=` + this.currentPage
|
||||
},
|
||||
/*
|
||||
* 做成监听滚动条判断更好
|
||||
*
|
||||
*/
|
||||
//uni 组件通信 监听
|
||||
handlePostMessage(data) {
|
||||
let arr = data.detail.data.pop()
|
||||
this.totalPage = arr[0].totalPage //总页数
|
||||
this.currentReadPage = arr[1].page //当前页数
|
||||
console.log('app:', this.totalPage, this.currentReadPage)
|
||||
},
|
||||
//h5 监听
|
||||
ReceiveMessage(event) {
|
||||
if (event.data && event.data.data && event.data.data.arg) {
|
||||
this.totalPage = event.data.data.arg[0].totalPage
|
||||
this.currentReadPage = event.data.data.arg[1].page + 1
|
||||
}
|
||||
console.log('app:', this.totalPage, this.currentReadPage)
|
||||
},
|
||||
|
||||
//页面销毁前动作
|
||||
addBrowseRecord() {
|
||||
// console.log("总页数:",this.totalPage);
|
||||
// console.log("当前页数:",this.currentReadPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
@ -1,19 +1,229 @@
|
|||
<template>
|
||||
<view>
|
||||
提交报告
|
||||
</view>
|
||||
<view>
|
||||
<div class="content">
|
||||
<u-search
|
||||
placeholder="查找报告"
|
||||
v-model="keyword"
|
||||
clearabled
|
||||
:showAction="false"
|
||||
@clickIcon="handleSearch"
|
||||
></u-search>
|
||||
|
||||
<div class="cont-wrapper">
|
||||
<div class="cont-title">请选择体检年度</div>
|
||||
<div class="cont-item" @click="showData = true">
|
||||
<div>{{ year }}</div>
|
||||
<u-icon name="arrow-right" size="13"></u-icon>
|
||||
</div>
|
||||
<div class="cont-item" @click="showType = true">
|
||||
<div v-if="type">{{ type }}</div>
|
||||
<div v-else style="color: #999">体检类型</div>
|
||||
<u-icon name="arrow-right" size="13"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cont-list" v-for="(item, index) in contList" :key="index">
|
||||
<div class="list-type">{{ item.fixedValue }}</div>
|
||||
<div class="center-cont">
|
||||
<div class="title">{{ item.mealName }}</div>
|
||||
<div>{{ item.createTime }}</div>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<u-button type="primary" shape="circle" text="查看报告" @click="handleSeeReport(item)"></u-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<u-picker :show="showData" :columns="dataColumns" @cancel="showData = false" @confirm="handleData"></u-picker>
|
||||
<u-picker
|
||||
:show="showType"
|
||||
:columns="typeColumns"
|
||||
keyName="label"
|
||||
@cancel="showType = false"
|
||||
@confirm="handleType"
|
||||
></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
import config from '@/config'
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: true,
|
||||
token: '',
|
||||
keyword: '',
|
||||
// 体检年度
|
||||
year: new Date().getFullYear(),
|
||||
// 体检类型
|
||||
type: '',
|
||||
typeValue: '',
|
||||
showData: false,
|
||||
showType: false,
|
||||
dataColumns: [],
|
||||
typeColumns: [
|
||||
[
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '普通体检', value: 0 },
|
||||
{ label: '职业体检', value: 1 }
|
||||
]
|
||||
],
|
||||
contList: [],
|
||||
pdfPath: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.token = uni.getStorageSync('tjToken')
|
||||
this.year = new Date().getFullYear()
|
||||
console.log('🚀 ~ mounted ~ year:', this.year)
|
||||
let arr = []
|
||||
for (let i = 0; i < 10; i++) {
|
||||
arr.push(this.year - i)
|
||||
}
|
||||
this.dataColumns = [arr]
|
||||
console.log('🚀 ~ mounted ~ this.dataColumns:', this.dataColumns)
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
console.log('🚀 ~ handleSearch ~ this.keyword:', this.keyword)
|
||||
this.getList()
|
||||
},
|
||||
// 选择体检年度
|
||||
handleData(e) {
|
||||
console.log('🚀 ~ handleData ~ this.year:', e)
|
||||
this.year = e.value[0]
|
||||
this.getList()
|
||||
this.showData = false
|
||||
},
|
||||
// 选择体检类型
|
||||
handleType(e) {
|
||||
console.log('🚀 ~ handleType ~ this.type:', e)
|
||||
this.type = e.value[0].label
|
||||
this.typeValue = e.value[0].value
|
||||
this.getList()
|
||||
this.showType = false
|
||||
},
|
||||
// 获取列表
|
||||
getList() {
|
||||
const params = {
|
||||
name: this.keyword,
|
||||
data: this.year,
|
||||
type: this.typeValue,
|
||||
token: this.token
|
||||
}
|
||||
console.log('🚀 ~ getList ~ params:', params)
|
||||
|
||||
uni.request({
|
||||
url: config.tjBaseUrl + '/app/getpackageBid',
|
||||
method: 'get',
|
||||
data: params,
|
||||
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.contList = res.obj
|
||||
}
|
||||
},
|
||||
fail: err => {
|
||||
console.log('🚀 ~ 列表 ~ err:', err)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查看报告
|
||||
handleSeeReport(item) {
|
||||
console.log('🚀 ~ handleSeeReport ~ item:', item)
|
||||
this.pdfPath = config.tjFile + item.physicalAddress
|
||||
// 跳转
|
||||
uni.navigateTo({
|
||||
url: `/pages/HealthExaminationApp/report/pdfView?path=${this.pdfPath}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
|
||||
.cont-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-content: center;
|
||||
padding: 10px 0;
|
||||
|
||||
.cont-title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.cont-item {
|
||||
padding: 0 5px;
|
||||
width: 28%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.cont-list {
|
||||
margin: 10px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
margin-top: 10px;
|
||||
|
||||
.list-type {
|
||||
padding: 10px;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
background: #9bc5c6;
|
||||
color: #fff;
|
||||
border-radius: 5px 0 0 5px;
|
||||
}
|
||||
|
||||
.center-cont {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
|
||||
.title {
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-right: 10px;
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@
|
|||
jwtToken: uni.getStorageSync('App-Token')
|
||||
}
|
||||
const tjparams = {
|
||||
username: '13708411772', // 15912575796
|
||||
username: '17681010134', // 15912575796
|
||||
password: 'YNsbd@123456'
|
||||
}
|
||||
console.log('🚀 ~ gotoYy ~ tjparams:', tjparams)
|
||||
|
|
@ -262,7 +262,7 @@
|
|||
}, 500)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: req.message,
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue