<template>
  <div class="finish-followup" v-if="showThisPage">
    <el-dialog
      title="恢复随访"
      :visible.sync="showFinishFollowup"
      v-if="showThisPage"
      :before-close="clickClose"
      width="30%"
      center>
      <div class="finish-content">
        <el-form
          :model="recoverData"
          :rules="rules"
          label-width="100px">
          <el-form-item label="居民：">
            {{recoverData.patientName}}
          </el-form-item>
          <el-form-item label="恢复原因：" prop="finishReason">
            <el-input
              type="textarea"
              v-model="recoverData.finishReason"
              placeholder="请输入原因"
              maxlength="30"
              rows="3"
              resize="none"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="button-green" @click="clickClose" size="small" type="primary">取 消</el-button>
        <el-button class="button-white" @click="clickClose" size="small" plain>确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
  export default {
    name: "recover-followup",
    props: {
      showThisPage: { //是否显示model
        type: Boolean,
        default: function () {
          return false;
        }
      },
      recoverData: {
        type: Object,
        default: function () {
          return {};
        }
      }
    },
    data() {
      return {
        showFinishFollowup: true,
        rules: {
          recoverData: [
            { required: true, message: '请输入恢复原因', trigger: 'blur' },
            { min: 1, max: 30, message: '长度在30个字符内', trigger: 'blur' }
          ],
        }
      }
    },
    methods: {
      clickClose() {
        this.$emit('closeRecoverFollowup',false)
      },
    }
  }
</script>
<style scoped>
  .el-input__inner:disabled {
    background-color: #ffffff!important;
  }
</style>
<style lang="scss" scoped>
  @import '../../../../style/followup/followup-common';
  @import '../../../../style/followup/element-reset.css';

</style>
