<template>
  <div id="audit-detail">
    <div class="audit-detail_header p-24">
      <div class="left">
        <span>当前审核</span>
        <span class="f-b">【无锡市人民医院医联体】【剩余7】</span>
      </div>
      <div class="right">
        <el-button class="btn">返回</el-button>
      </div>
    </div>
    <div class="choose-handle p-24">
      <span>请选择审核结果:</span>
      <div class="btn_group">
        <el-button
          v-for="(item, index) in btnGroup"
          :key="index"
          type="primary"
          class="p-btn"
          size="medium"
          @click="showDialog(item.value)"
          >{{ item.text }}</el-button
        >
      </div>
    </div>
    <div class="table-content p-24">
      <!-- <component :is="curComponent"></component> -->
    </div>
    <public-dialog ref="publicDialog" @onSubmit="onSubmit" @onCancel="onCancel">
      <template v-if="!confirmStatus" slot="content">
        <span class="tips">确定提交审核?</span>
      </template>
      <template v-if="confirmStatus" slot="content">
        {{ btnGroup[curBtn - 1].text }}
      </template>
    </public-dialog>
  </div>
</template>
<script>
import publicDialog from "./components/publicDialog.vue"
export default {
  components: { publicDialog },
  data() {
    return {
      btnGroup: [
        {
          text: "合格",
          value: 1,
        },
        {
          text: "不合格",
          value: 2,
        },
        {
          text: "驳回修改",
          value: 3,
        },
      ],
      curBtn: 0,
      curComponent: "",
      confirmStatus: false,
    }
  },
  watch: {},
  mounted() {},
  methods: {
    showDialog(val) {
      this.curBtn = val
      this.$refs.publicDialog.dialogVisible = true
    },
    onSubmit() {
      this.confirmStatus = true
      // this.$refs.publicDialog.dialogVisible = true
    },
    onCancel() {
      this.confirmStatus = false
    },
  },
}
</script>
<style lang="scss" scoped>
::v-deep .el-dialog__body {
  border-top: none;
  text-align: center;
  .tips {
    font-size: 16px;
  }
}
.p-24 {
  padding: 0 24px;
}
.f-b {
  font-weight: bold;
  font-size: 14px;
}

#audit-detail {
  // padding: 22px 24px;
  .audit-detail_header {
    height: 65px;
    border-bottom: 1px solid #f3f3f3;
    line-height: 65px;
    display: flex;
    justify-content: space-between;
    .right {
      .btn {
        width: 80px;
        height: 32px;
        border-radius: 4px;
      }
    }
  }
  .choose-handle {
    width: 100%;
    height: 72px;
    line-height: 72px;
    font-size: 14px;
    font-family: AlibabaPuHuiTiM;
    color: #333333;
    box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.1);
    display: flex;
    .btn_group {
      margin-left: 24px;
      ::v-deep .p-btn {
        width: 100px;
        border-radius: 4px;
      }
    }
  }
}
</style>
