<template>
  <div class="plate-box">
    <h2 class="title">
      <span class="line"></span>
      <p>{{ title }}</p>
      <span class="line"></span>
    </h2>
    <div class="plate">
      <ul>
        <li>
          <label>下机护士 :</label>
          <span class="content">{{ nurse }}</span>
        </li>
        <li>
          <label>状态 :</label>
          <span class="content">{{ stage }}</span>
        </li>
        <li>
          <label>下机时间 :</label>
          <span class="content" style="font-size: 0.34rem">{{ end_time }}</span>
        </li>
       <li v-if="org_id!=0&&org_id!=10460">
          <label>宣教知识 :</label>
          <span class="content" style="font-size: 0.34rem">{{ this.record.mission }}</span>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { parseTime } from '@/utils'

export default {
  name: 'DialysisComputer',
  data () {
    return {
      title: '透析下机 ',
      org_id:0,
    }
  },
  props: {
    record: {
      type: Object
    },
    admin_map: {
      type: Object
    }
  },
  computed: {
    stage: function () {
      if (this.record == null || this.record.id == '') {
        return '未上机'
      }
      return this.record.stage == 1 ? '未下机' : '已下机'
    },
    nurse: function () {
      if (this.record == null || this.record.id == '') {
        return '-'
      } else if (this.record.stage == 1) {
        return '-'
      } else {
        return this.admin_map[this.record.finish_nurse] == null
          ? ''
          : this.admin_map[this.record.finish_nurse].name
      }
    },
    end_time: function () {
      if (this.record == null || this.record.id == '') {
        return '-'
      } else if (this.record.stage == 1) {
        return '-'
      } else {
        return parseTime(this.record.end_time, '{y}年{m}月{d}日 {h}时{i}分')
      }
    }
  },
  methods: {},
  created(){
     this.org_id = this.$store.getters.user.template_info.org_id;
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped></style>
