<template>
  <!-- 随访调查录入 -->
  <div>
    <ConfigForms
      v-if="refreshFlag"
      form-type="2"
      form-class="follow-form"
      :disabled="disabled"
      :tab-disabled="tabDisabled"
      :get-data="getData"
      :contrast="true"
      :patient-id="patientId"
      :screenList="screenList"
      @refreshData="refreshData"
    ></ConfigForms>
  </div>
</template>

<script>
import ConfigForms from "@/views/screening/components/ConfigForms.vue"
export default {
  name: "FollowupEntry",
  components: {
    ConfigForms,
  },
  data() {
    return {
      disabled: false,
      tabDisabled: true,
      refreshFlag: true,
      screenList: [
        {
          time: "2020-12-12 11:11:11",
          code: "UK102",
          name: "修改第一次随访计划",
        },
      ],
    }
  },
  provide() {
    return {
      tabFollowId: () => this.followId,
    }
  },
  computed: {
    patientId() {
      return this.$route.query.patientId
    },
    model() {
      return this.$route.query.model
    },
    followId() {
      return this.$route.query.followId
    },
    getData() {
      return Boolean(this.$route.query.getData - 0)
    },
  },
  mounted() {
    if (this.model == "view") {
      this.disabled = true
      this.tabDisabled = false
    } else {
      this.disabled = false
      this.tabDisabled = true
    }
  },
  methods: {
    refreshData(data) {
      // this.refreshFlag = false
      // this.$nextTick(() => {
      //   this.refreshFlag = true
      // })
    },
  },
}
</script>

<style lang="scss"></style>
