<template>
  <!-- 随访调查录入 -->
  <div>
    <ConfigForms
      v-if="refreshFlag"
      form-type="2"
      form-class="follow-form"
      :disabled="disabled"
      :tab-disabled="tabDisabled"
      :get-data="getData"
      :patient-id="patientId"
      @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,
    }
  },
  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>
