xinelu-applet-ui/pagesB/Prescriptionrecords/Prescriptionrecords.vue

325 lines
7.7 KiB
Vue
Raw Normal View History

2024-05-08 10:14:53 +08:00
<template>
<view class="app">
<view class="body">
<view class="left">
2024-05-08 15:44:08 +08:00
<u-collapse :accordion='false'>
<u-collapse-item :title="item.year" v-for="(item, index) in itemlistleft" :key="index"
2024-05-12 11:31:23 +08:00
:class="item.check?'headcollapse':''" @change='tapcollapseleft(item)' :open="item.open">
2024-05-08 15:44:08 +08:00
<view class="itemtext" v-for="aitem in item.list" @tap="dataies(aitem)">
2024-05-12 13:44:23 +08:00
<view :style="recordCode == aitem.recordCode ? 'color:#26A888' : ''">
2024-05-08 15:44:08 +08:00
{{aitem.recordDate}}
2024-05-08 10:14:53 +08:00
</view>
</view>
</u-collapse-item>
</u-collapse>
</view>
<view class="right">
<u-collapse :item-style="itemStyle" :arrow="false" :accordion='false'>
2024-05-17 09:30:34 +08:00
<u-collapse-item :title="item.tempName" v-for="(item, index) in itemList" :open="item.open"
2024-05-12 11:31:23 +08:00
:key="index" @change='tapcollapse(item)' :class="item.check?'headcollapse':''">
2024-05-17 09:30:34 +08:00
<view class="" v-if="item.onelist">
<view class="uitemtitle">健康生活方式</view>
<view class="itemtext" v-for="(uitem,uindex) in item.onelist" :key="uindex">
<view class="collapse_top">
<view class="itemsdata">
<view class="itemword">
<u-checkbox active-color="#26A888" v-model="uitem.val" disabled>
<view class="checkboxtitle">
{{ uitem.content }}
</view>
<view v-if="uitem.ptValList">
<view class="checkboxtext" v-for="bitem in uitem.ptValList"
:key="bitem.id">
{{ bitem.content }}
</view>
</view>
</u-checkbox>
</view>
2024-05-08 10:14:53 +08:00
</view>
2024-05-17 09:30:34 +08:00
</view>
</view>
</view>
<view class="" v-if="item.twolist">
<view class="uitemtitle">治疗与康复</view>
<view class="itemtext" v-for="(uitem,uindex) in item.twolist" :key="uindex">
<view class="collapse_top">
<view class="itemsdata">
<view class="itemword">
<u-checkbox active-color="#26A888" v-model="uitem.val" disabled>
<view class="checkboxtitle">
{{ uitem.content }}
</view>
<view v-if="uitem.ptValList">
<view class="checkboxtext" v-for="bitem in uitem.ptValList"
:key="bitem.id">
{{ bitem.content }}
</view>
</view>
</u-checkbox>
</view>
</view>
</view>
</view>
</view>
<view class="" v-if="item.threelist">
<view class="uitemtitle">急症处理</view>
<view class="itemtext" v-for="(uitem,uindex) in item.threelist" :key="uindex">
<view class="collapse_top">
<view class="itemsdata">
<view class="itemword">
<u-checkbox active-color="#26A888" v-model="uitem.val" disabled>
<view class="checkboxtitle">
{{ uitem.content }}
</view>
<view v-if="uitem.ptValList">
<view class="checkboxtext" v-for="bitem in uitem.ptValList"
:key="bitem.id">
{{ bitem.content }}
</view>
</view>
</u-checkbox>
</view>
2024-05-08 10:14:53 +08:00
</view>
</view>
</view>
</view>
</u-collapse-item>
</u-collapse>
</view>
</view>
2024-05-12 11:31:23 +08:00
<u-loading :show="show" mode="flower" size="40"></u-loading>
2024-05-08 10:14:53 +08:00
</view>
</template>
<script>
2024-05-12 11:31:23 +08:00
import {
dayList,
detail
} from "@/api/pagesB/threeHundredAndSixty/threeHundredAndSixty.js"
2024-05-08 10:14:53 +08:00
export default {
data() {
return {
2024-05-12 11:31:23 +08:00
show: true,
lastrecodedata: null,
cardNo: '',
2024-05-08 15:44:08 +08:00
itemlistleft: [],
itemList: [],
2024-05-12 11:31:23 +08:00
recordCode: '',
2024-05-08 10:14:53 +08:00
}
},
2024-05-08 15:44:08 +08:00
mounted() {
this.lastrecodelist()
},
2024-05-08 10:14:53 +08:00
methods: {
2024-05-08 15:44:08 +08:00
lastrecodelist() {
2024-05-12 11:31:23 +08:00
if (uni.getStorageSync("userinfo")) {
this.cardNo = uni.getStorageSync("userinfo").cardNo
2024-05-08 15:44:08 +08:00
dayList(this.cardNo).then(res => {
2024-05-12 13:44:23 +08:00
if (res.data && res.data.length > 0) {
res.data.forEach(e => {
if (e.list && e.list.length > 0) {
e.list.forEach(el => {
const parts =
el.recordDate = el.recordDate.substr(5, 9);
})
}
2024-05-12 11:39:42 +08:00
})
2024-05-12 13:44:23 +08:00
}
2024-05-08 15:44:08 +08:00
this.itemlistleft = res.data
2024-05-12 13:44:23 +08:00
this.itemlistleft && this.itemlistleft.length > 0 ? this.itemlistleft[0].open = true : ''
2024-05-12 11:31:23 +08:00
res.data && res.data[0].list.length > 0 ? this.recordCode = res.data[0].list[0]
.recordCode : ''
2024-05-08 15:44:08 +08:00
detail(this.recordCode).then(res => {
2024-05-17 09:30:34 +08:00
res.data && res.data.ptList && res.data.ptList.length > 0 ? res.data.ptList[0]
2024-05-12 11:31:23 +08:00
.open = true : ''
2024-05-17 09:30:34 +08:00
res.data.ptList.forEach(e => {
e.ptValList.forEach(el => {
el.val == "true" ? el.val = true : el.val = false
})
e.onelist = e.ptValList.filter(el => el.itemType == '1')
e.twolist = e.ptValList.filter(el => el.itemType == '2')
e.threelist = e.ptValList.filter(el => el.itemType == '3')
})
this.itemList = res.data.ptList
2024-05-12 11:31:23 +08:00
this.show = false
2024-05-08 15:44:08 +08:00
})
})
}
},
2024-05-08 10:14:53 +08:00
tapcollapse(item) {
item.check = !item.check
},
2024-05-12 11:31:23 +08:00
dataies(aitem) {
this.recordCode = aitem.recordCode
2024-05-08 15:44:08 +08:00
detail(this.recordCode).then(res => {
this.itemList = res.data
})
},
2024-05-12 11:31:23 +08:00
tapcollapseleft(item) {
2024-05-08 10:14:53 +08:00
item.check = !item.check
}
}
}
</script>
<style lang="scss">
2024-05-12 11:31:23 +08:00
::v-deep .u-checkbox__icon-wrap--disabled--checked {
background-color: #2979ff !important;
border-color: #2979ff !important;
}
2024-05-08 15:44:08 +08:00
page {
2024-05-08 10:14:53 +08:00
background-color: #fff;
2024-05-08 15:44:08 +08:00
}
2024-05-12 11:31:23 +08:00
2024-05-17 09:30:34 +08:00
.checkboxtitle {
font-size: 24rpx;
margin-bottom: 10rpx;
font-weight: 600;
}
.checkboxtext {
font-weight: 550;
font-size: 20rpx;
padding-left: 20rpx;
}
2024-05-08 15:44:08 +08:00
.app {
// height: 100vh;
padding: 32rpx 10rpx;
2024-05-08 10:14:53 +08:00
text-align: center;
font-size: 36rpx;
.body {
width: 100%;
2024-05-08 15:44:08 +08:00
// height: 100vh;
2024-05-08 10:14:53 +08:00
display: flex;
2024-05-12 11:31:23 +08:00
2024-05-08 10:14:53 +08:00
.left {
2024-05-08 15:44:08 +08:00
// height: 100vh;
2024-05-12 11:39:42 +08:00
width: 30%;
2024-05-08 17:27:34 +08:00
2024-05-08 10:14:53 +08:00
::v-deep .u-collapse-title {
font-size: 26rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #000;
padding-left: 10rpx;
font-weight: 600;
}
2024-05-12 11:31:23 +08:00
2024-05-08 10:14:53 +08:00
::v-deep .u-collapse-head {
width: 96%;
margin: 0 auto;
}
.itemtext {
font-size: 28rpx;
background: #FFFFFF;
font-weight: 500;
color: #333333;
height: 100rpx;
padding-left: 10rpx;
line-height: 100rpx;
border-bottom: 2rpx solid #E6E6E6;
margin: 0 auto;
display: flex;
justify-content: space-between;
}
.headcollapse {
::v-deep .u-collapse-head {
border-bottom: 2rpx solid #E6E6E6;
}
::v-deep .u-collapse-item {
padding-bottom: 4rpx;
}
}
2024-05-08 17:27:34 +08:00
2024-05-08 10:14:53 +08:00
::v-deep .u-collapse-head {
width: 96%;
margin: 0 auto;
// background: #169BD5 !important;
text-align: center;
color: #fff;
}
::v-deep .u-collapse-item {
// background-color: #4271B9;
margin-bottom: 2rpx;
}
}
.right {
2024-05-08 15:44:08 +08:00
// height: 100vh;
2024-05-12 11:39:42 +08:00
width: 70%;
2024-05-12 11:31:23 +08:00
2024-05-08 10:14:53 +08:00
::v-deep .u-collapse-title {
font-size: 30rpx;
font-weight: 600;
padding-left: 10rpx;
}
2024-05-12 11:31:23 +08:00
2024-05-08 15:44:08 +08:00
::v-deep .u-icon--right {
color: #26A888 !important;
}
2024-05-12 11:31:23 +08:00
2024-05-08 10:14:53 +08:00
.headcollapse {
::v-deep .u-collapse-head {
border-bottom: 2rpx solid #E6E6E6;
text-align: center !important;
}
::v-deep .u-collapse-title {
color: #26A888;
}
}
::v-deep .u-collapse-head {
width: 96%;
margin: 0 auto;
2024-05-08 15:44:08 +08:00
background: #26A888 !important;
2024-05-08 10:14:53 +08:00
text-align: center;
color: #fff;
}
2024-05-17 09:30:34 +08:00
.uitemtitle {
font-weight: 600;
font-size: 28rpx;
color: #000;
margin-top: 15rpx;
padding-left: 30rpx;
}
2024-05-08 10:14:53 +08:00
// background-color: red;
.itemtext {
.collapse_top {
2024-05-17 09:30:34 +08:00
font-size: 22rpx;
2024-05-08 10:14:53 +08:00
font-weight: 500;
color: #000;
width: 94%;
line-height: 40rpx;
margin: 0 auto;
2024-05-17 09:30:34 +08:00
padding: 10rpx;
2024-05-08 10:14:53 +08:00
.itemsdata {
width: 100%;
.itemword {
margin: 15rpx;
}
}
}
}
}
}
}
2024-05-12 11:31:23 +08:00
</style>