123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453 |
- <template>
- <div class="newRescueRecord">
- <div>
- <div class="toolBox">
- <div class="toolOne" @click="startShow = true">
- <div style="display: flex;align-items: center;">
- {{ startTime }}
- <van-icon name="arrow-down" />
- </div>
- </div>
- <div class="toolOne" @click="endShow = true">
- <div style="display: flex;align-items: center;">
- {{ endTime }}
- <van-icon name="arrow-down" />
- </div>
- </div>
- </div>
- <div class="adviceBox" v-if="rescueRecords.length > 0">
- <van-list
- v-model="loading"
- :finished="finished"
- finished-text="没有更多了"
- @load="onLoad"
- >
- <div class="adviceMain">
- <div
- class="adviceOne"
- v-for="(item, index) in this.rescueRecords"
- :key="index"
- >
- <div class="adviceTitle">
- <p>{{ getTime(item.record_time) }}</p>
- <van-icon
- class="ellipsis"
- name="ellipsis"
- @click="toDeleteRescueRecord(item.id, item.index)"
- />
- </div>
- <div class="statOrder">
- <div class="orderContent" @click="toRescueRecord(item.id)">
- <p>
- <span v-html="item.content"></span>
- </p>
- </div>
- <div class="doctorBox">
- <p>记录医生:{{ item.user_name }}</p>
- </div>
- </div>
- <div class="all">全部</div>
- </div>
- </div>
- </van-list>
- </div>
- <div class="noimgBox" v-else>
- <img src="../../../assets/images/none.png" alt />
- </div>
- </div>
- <!-- <div class="add">
- <div style="display: flex;align-items: center;">
- <van-icon class="addIcon" name="add" />新增
- </div>
- </div>-->
-
- <!-- 弹出层 -->
- <div>
- <van-popup
- v-model="startShow"
- position="bottom"
- :style="{ height: '40%' }"
- >
- <van-datetime-picker
- v-model="currentDate"
- type="date"
- :min-date="minDate"
- :max-date="maxDate"
- @confirm="getstartTime"
- @cancel="startShow = false"
- />
- </van-popup>
- <van-popup v-model="endShow" position="bottom" :style="{ height: '40%' }">
- <van-datetime-picker
- v-model="currentDate"
- type="date"
- :min-date="minDate"
- :max-date="maxDate"
- @confirm="getstartTime2"
- @cancel="endShow = false"
- />
- </van-popup>
- <van-action-sheet
- v-model="newShow"
- :actions="actions"
- cancel-text="取消"
- @select="Delete"
- />
- </div>
- </div>
- </template>
-
- <script>
- import {
- getNewPatientId,
- getPatientDetail,
- getRescueRecord,
- DeleteRescueRecord
- } from '@/api/patient/patient'
- import { uParseTime } from '@/utils/tools'
- import Vue from 'vue'
- import { Dialog } from 'vant'
- const moment = require('moment')
- export default {
- props: {
- active: Number
- },
- data () {
- return {
- newShow: false,
- startShow: false,
- endShow: false,
- startTime: '请选择',
- endTime: '请选择',
- endTimes: '',
- minDate: new Date(1970, 0, 1),
- maxDate: new Date(2025, 10, 1),
- currentDate: new Date(),
- actions: [{ name: '查看全部' }, { name: '全部删除' }],
- showOne: true,
- showTwo: false,
- limit: 10,
- page: 1,
- total: 0,
- loading: false,
- finished: false,
- rescueRecords: [],
- patient_id: 0,
- list: [],
- id: 0,
- index: 0
- }
- },
- methods: {
- onCancel () {
- this.typeShow = false
- },
- onConfirm (value) {
- this.type = value
- this.typeShow = false
- },
- getstartTime (value) {
- this.page = 1
- let year = value.getFullYear()
- let month = value.getMonth() + 1
- let day = value.getDate()
- if (month >= 1 && month <= 9) {
- month = `0${month}`
- }
- if (day >= 1 && day <= 9) {
- day = `0${day}`
- }
-
- this.startTime = `${year}-${month}-${day}`
- this.rescueRecords = []
- this.getRescueRecord(
- this.patient_id,
- this.limit,
- this.page,
- this.startTime,
- this.endTime
- )
- this.startShow = false
- },
- getstartTime2 (value) {
- this.page = 1
- let year = value.getFullYear()
- let month = value.getMonth() + 1
- let day = value.getDate()
- if (month >= 1 && month <= 9) {
- month = `0${month}`
- }
- if (day >= 1 && day <= 9) {
- day = `0${day}`
- }
-
- this.endTime = `${year}-${month}-${day}`
- this.rescueRecords = []
- this.getRescueRecord(
- this.patient_id,
- this.limit,
- this.page,
- this.startTime,
- this.endTime
- )
- this.endShow = false
- },
- getPatientDetail (patientid) {
- getPatientDetail(patientid).then(response => {
- if (response.data.state === 1) {
- var patientDetail = response.data.data.patientDetail
- if (patientDetail.blood_patients == 0) {
- this.rescueRecords = []
- this.showOne = false
- this.showTwo = true
- }
- if (patientDetail.blood_patients == 1) {
- this.showOne = true
- this.showTwo = false
- }
- // console.log("病人详情", patientDetail);
- this.patientName = patientDetail.name
- }
- })
- },
- getRescueRecord (id) {
- getRescueRecord(
- id,
- this.limit,
- this.page,
- this.startTime,
- this.endTime
- ).then(response => {
- if (response.data.state === 1) {
- var rescuerecord = response.data.data.rescuerecord
- // console.log("抢救记录", rescuerecord);
- let arr = this.rescueRecords
- arr.push(...rescuerecord)
- this.rescueRecords = arr
- var total = response.data.data.total
- // console.log("总计", total);
- this.loading = false
- }
- })
- },
- onLoad () {
- setTimeout(() => {
- this.page++
- // console.log(this.page)
- if (this.page <= Math.ceil(this.total / 10)) {
- this.getRescueRecord(
- this.patient_id,
- this.startTime,
- this.endTimes,
- this.limit,
- this.page
- )
- } else {
- this.loading = false
- this.finished = true
- }
- }, 1000)
- },
- getTime (time) {
- // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
- return uParseTime(time, '{y}-{m}-{d}')
- },
- toRescueRecord (id) {
- var patientid = this.$route.query.patientid
- this.$router.push(
- '/rescuerecord?id=' +
- id +
- '&patientid=' +
- patientid +
- '&active=' +
- this.active
- )
- },
- toDeleteRescueRecord (id, index) {
- this.id = id
- this.index = index
- this.newShow = true
- },
- Delete (value) {
- if (value.name == '查看全部') {
- var patientid = this.$route.query.patientid
- this.$router.push(
- '/rescuerecord?id=' +
- this.id +
- '&patientid=' +
- patientid +
- '&active=' +
- this.active
- )
- }
- if (value.name == '全部删除') {
- this.DeleteRescueRecord(this.id, this.index)
- }
- },
- DeleteRescueRecord (id, index) {
- Dialog.confirm({
- title: '删除提示!',
- message: '确认删除该条信息吗?,删除后将无法恢复!'
- }).then(() => {
- DeleteRescueRecord(id).then(response => {
- if (response.data.state === 1) {
- var msg = response.data.data.msg
- console.log('msg', msg)
- this.rescueRecords.splice(index, 1)
- this.newShow = false
- }
- })
- })
- },
- getNewPatientId (id) {
- getNewPatientId(id).then(response => {
- if (response.data.state == 1) {
- var patient = response.data.data.patient
- this.patient_id = patient.id
- this.getPatientDetail(patient.id)
- this.getRescueRecord(patient.id)
- }
- })
- }
- },
- created () {
- var patientid = this.$route.query.patient_id
- this.getNewPatientId(patientid)
- // console.log("病人id能否获取", patientid);
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .newRescueRecord {
- height: 100%;
- overflow-y: auto;
- background: #fff;
- .toolBox {
- display: flex;
- height: 1.6rem;
- align-items: center;
- .toolOne {
- width: 3.4rem;
- height: 1rem;
- background: rgba(246, 246, 246, 1);
- border-radius: 5px;
- text-align: center;
- font-size: 0.42rem;
- color: #8d8d8d;
- display: flex;
- align-items: center;
- justify-content: space-around;
- margin-left: 0.42rem;
- }
- }
- .adviceBox {
- padding: 0 0.66rem;
- margin-bottom: 1.6rem;
- }
- .adviceMain {
- > div:last-child {
- border: none;
- }
- }
- .adviceOne {
- // box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);
- border-bottom: 1px solid #e5e5e5;
- padding-bottom: 0.34rem;
- }
- .adviceTitle {
- padding-top: 0.34rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
- p {
- color: #000000;
- font-weight: bold;
- font-size: 0.5rem;
- }
- .ellipsis {
- font-size: 0.66rem;
- color: #cccccc;
- }
- }
- .orderContent {
- font-size: 0.46rem;
- color: rgba(49, 50, 52, 1);
- margin-top: 0.34rem;
- p {
- line-height: 0.8rem;
- width: 50%;
- }
- }
- .doctorBox {
- font-size: 0.4rem;
- color: rgba(152, 152, 152, 1);
- line-height: 0.6rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 0.34rem;
- }
- .all {
- font-size: 0.43rem;
- color: #5b98ff;
- margin-top: 0.34rem;
- }
- .noimgBox {
- margin-top: 40%;
- img {
- width: 5rem;
- height: 5rem;
- margin: 0 auto;
- display: block;
- }
- }
- // .add {
- // position: fixed;
- // bottom: 0;
- // left: 0;
- // width: 100%;
- // height: 2.75rem;
- // background: rgba(255, 255, 255, 1);
- // box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.1);
- // display: flex;
- // align-items: center;
- // justify-content: space-around;
- // font-size: 0.9375rem;
- // color: #979798;
- // .addIcon {
- // color: #5b98ff;
- // font-size: 1.25rem;
- // margin-right: 0.25rem;
- // }
- // }
- .van-popup {
- border-radius: 0;
- transform: translate3d(0, 0, 0);
- top: initial;
- }
-
- }
- ::-webkit-scrollbar {
- width: 0;
- }
- </style>
- <style lang="scss">
- .newRescueRecord{
- .van-picker__toolbar{
- height: 1.46rem;
- line-height: 1.46rem;
- }
- .van-picker__cancel, .van-picker__confirm{
- padding: 0 0.53rem;
- font-size: 0.46rem;
- }
- .van-picker-column{
- font-size: 0.53rem;
- }
- .van-picker-column__item{
- padding: 0 0.14rem;
- }
- }
- </style>
|