postdischarge-applet/pages/Satisfaction/Satisfaction.vue
zhuangyuanke daf9159fca 1
2024-11-01 13:36:21 +08:00

238 lines
5.3 KiB
Vue

<template>
<view class="app">
<view class="" v-if="completedSatisfactiondata.length>0">
<view :class="item.sign=='incomplete'?'body':'bodys'" v-for="(item,index) in completedSatisfactiondata"
:key="index" @tap="changefollow(item)">
<view class="follow">
<view class="itemtop">执行时间:</view>
<view class="time">{{item.executeTime?item.executeTime:''}}</view>
</view>
<view class="follow">
<view class="itemtop">问卷标题:</view>
<view class="time">{{item.questionnaireName?item.questionnaireName:'暂无'}}</view>
</view>
<!-- <view class="follow">
时间节点:<span class="time">{{item.routeNodeName}}第{{item.routeNodeDay}}天</span>
</view>
<view class="follow">
任务名称:<span class="time">{{item.manageRouteName?item.manageRouteName:'暂无'}}</span>
</view> -->
</view>
</view>
<view class="noorder" v-else>
<u-empty mode="data" icon-size='220' text='暂无内容'></u-empty>
</view>
</view>
</template>
<script>
import {
satisfactionQuestionnaire,
completedSatisfaction,
incompleteSatisfaction
} from '@/api/Satisfaction/Satisfaction.js'
export default {
data() {
return {
tabscurrent: 0,
orderStatus: '',
completedSatisfactiondata: [], //已完成列表
incompletedata: [], //未完成列表
query: {
pageNum: 1,
pageSize: 10,
residentId: '',
// residentId: uni.getStorageSync('patientId')
},
total: 0,
totalcomplete: 0,
}
},
onLoad() {
if (uni.getStorageSync('patientId')) {
this.query.residentId = uni.getStorageSync('patientId')
this.satisfactionlist()
}
uni.$on('refresh', () => {
this.query.residentId = uni.getStorageSync('patientId')
this.query.pageNum = 1
this.query.pageSize = 10
this.satisfactionlist()
})
},
onShow() {
// if (uni.getStorageSync('patientId')) {
// this.query.residentId=uni.getStorageSync('patientId')
// this.query.pageNum = 1
// this.query.pageSize = 10
// this.satisfactionlist()
// }
},
methods: {
// 问卷列表
satisfactionlist() {
satisfactionQuestionnaire(this.query).then(res => {
this.completedSatisfactiondata = res.rows
this.total = res.total
})
},
// 未完成列表
changefollow(item) {
console.log(item, 'item')
// 未完成
if (item.sign == 'incomplete') {
// 问卷量表
uni.navigateTo({
url: `/pages/questionnaire/questionnaire?item=${encodeURIComponent(JSON.stringify(item))}`
})
}
// 已完成 详情及答案
else if (item.sign == 'completed') {
// 问卷量表
uni.navigateTo({
url: `/pages/Satisfactiondetail/Satisfactiondetail?patientQuestionSubmitResultId=${item.patientQuestionSubmitResultId}&taskType=${item.taskType}`
})
}
},
onReachBottom() { //下滑加载
if (this.completedSatisfactiondata.length >= this.total) {} else {
this.query.pageNum++;
satisfactionQuestionnaire(this.query).then(res => {
if (res.rows) {
res.rows.forEach(e => {
this.completedSatisfactiondata.push(e)
})
}
})
}
},
onPullDownRefresh() { //下拉刷新
this.completedSatisfactiondata = [];
this.query.pageNum = 1;
this.satisfactionlist();
// this.completedSatisfactionlist();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
}
</script>
<style lang="scss">
page {
background-color: #F7F5F5;
}
::v-deep .u-empty {
margin-top: 100rpx !important;
}
::v-deep .u-tabs {
width: 42%;
// position: fixed;
// top: 200rpx;
z-index: 999;
background-color: #F7F5F5 !important;
}
.app {
// padding: 20rpx 0 0 0;
// overflow: scroll;
// font-size: 28rpx;
.noorder {
margin-top: 20%;
}
.bodys {
background: #E8E5E5;
width: 95%;
height: 243rpx;
// background: #fff;
margin: 40rpx auto;
padding-top: 15rpx;
box-shadow: 0px 4px 15px 4px rgba(0, 0, 0, 0.03);
border-radius: 2px;
.follow {
display: flex;
margin-top: 16rpx;
padding: 20rpx 0 0 100rpx;
.itemtop {
padding-top: 10rpx;
}
.time {
overflow: hidden;
/* 确保超出容器的内容被裁剪 */
white-space: nowrap;
/* 确保文本在一行内显示 */
text-overflow: ellipsis;
/* 超出部分显示省略号 */
display: inline-block;
width: 287rpx;
height: 55rpx;
line-height: 55rpx;
padding-left: 20rpx;
padding-right: 20rpx;
// background: #F6F6F6;
border: 1px solid #CFCECE;
}
;
}
}
.body {
width: 95%;
height: 243rpx;
background: #fff;
margin: 40rpx auto;
padding-top: 15rpx;
box-shadow: 0px 4px 15px 4px rgba(0, 0, 0, 0.03);
border-radius: 2px;
.follow {
display: flex;
margin-top: 10rpx;
padding: 20rpx 0 0 100rpx;
.itemtop {
padding-top: 10rpx;
}
.time {
overflow: hidden;
/* 确保超出容器的内容被裁剪 */
white-space: nowrap;
/* 确保文本在一行内显示 */
text-overflow: ellipsis;
/* 超出部分显示省略号 */
display: inline-block;
width: 287rpx;
height: 55rpx;
line-height: 55rpx;
padding-left: 20rpx;
padding-right: 20rpx;
// background: #F6F6F6;
border: 1px solid #CFCECE;
}
;
}
}
}
</style>