<template>
  <el-dialog
    title="驳回"
    :visible.sync="dataObj.detailDialog"
    width="800px"
    :close-on-click-modal="false"
  >
      <div class="content-box">
        <!-- 申报表审核情况 -->
          <div class="top" v-if="dataObj.key == 'apply'">
            <span class="title">临安区规范化农民专业合作社申报表</span>
            <el-descriptions class="margin-top" :column="1" :size="size" border>
                <el-descriptions-item>
                  <template slot="label">
                    镇（街道）意见
                  </template>
                  <span class="rejectinfo ct" style="color:#2ab999;cursor:pointer;" v-if="dataObj.paramInfo[0].status == -1" @click="rejectHandle()"><el-tag type="danger">驳 回</el-tag></span>
                  <span class="ct" v-if="dataObj.paramInfo[0].status !== -1"><el-tag type="success">{{dataObj.paramInfo[0].status==1?'通 过':'待审核'}}</el-tag></span>
                </el-descriptions-item>
                <el-descriptions-item>
                  <template slot="label">
                    区供销总社意见
                  </template>
                  <span class="rejectinfo ct" style="color:#2ab999;cursor:pointer;" v-if="dataObj.paramInfo[1].status == -1" @click="rejectHandle()"><el-tag type="danger">驳 回</el-tag></span>
                  <span class="ct" v-if="dataObj.paramInfo[1].status !== -1"><el-tag type="success">{{dataObj.paramInfo[1].status==1?'通 过':'待审核'}}</el-tag></span>
                </el-descriptions-item>
              </el-descriptions>
          </div>
        <!-- 监测表审核情况 -->
          <div class="bottom"  v-if="dataObj.key == 'monitor'">
            <span class="title">临安区规范化农民专业合作社监测表</span>
            <!-- 监测表数据展示描述 -->
              <el-descriptions class="margin-top" title="区审核状态" :column="1" :size="size" border>
                <el-descriptions-item v-for="(item,index) in dataObj.param" :key="index">
                  <template slot="label">
                    {{item.name}}
                  </template>
                  <span class="rejectinfo ct" style="color:#2ab999;cursor:pointer;" v-if="item.status == -1" @click="rejectHandle()"><el-tag type="danger">驳 回</el-tag></span>
                  <span class="ct" v-if="item.status !== -1"><el-tag type="success">{{item.status==1?'通 过':'待审核'}}</el-tag></span>
                </el-descriptions-item>
              </el-descriptions>
              <el-descriptions class="margin-top" style="margin-top:30px;" title="区总供销社意见状态" :column="1" :size="size" border>
                <el-descriptions-item>
                  <template slot="label">
                    区供销总社意见
                  </template>
                  <span class="rejectinfo ct" style="color:#2ab999;cursor:pointer;" v-if="dataObj.paramInfo[1].status == -1" @click="rejectHandle()"><el-tag type="danger">驳 回</el-tag></span>
                  <span class="ct" v-if="dataObj.paramInfo[1].status !== -1"><el-tag type="success">{{dataObj.paramInfo[1].status==1?'通 过':'待审核'}}</el-tag></span>
                </el-descriptions-item>
              </el-descriptions>
            </div>
          </div>
          <el-form v-if="rejectshow" :model="rejectData" :rules="rules" ref="ruleForm" label-width="100px" class="rejectcontainer">
            <div class="cause">驳回原因</div>
            <el-form-item>
              <div class="rejectInfo">{{dataObj.rejectInfo}}</div>
            </el-form-item>
            <el-form-item class="btn">
              <el-button @click="cancelFn()">取消</el-button>
            </el-form-item>
          </el-form> 
  </el-dialog>
</template>
<script>
export default {
  props: ["dataObj"],
  data() {
    return {
      size:'',
      key:'',
      rejectData: {
          rejecttitle: ''
      },
      rejectshow: false,
      rules: {
          rejecttitle: [
            { required: true, message: '请填写驳回内容', trigger: 'blur' }
          ]
      },
    };
  },
  methods:{
      // 显示驳回弹框
      rejectHandle(){
        this.rejectshow = true
      },
      // 取消
      cancelFn(){
        this.rejectshow = false
        this.rejectData = {}
      }
  },
};
</script>
<style lang="scss" scoped>
.el-tag{
  width: 58px;
}
.content-box {
  /* display: flex; */
  /* justify-content: center; */
  .title{
    display: block;
    height: 50px;
    text-align: center;
    font-size: 24px;
  }
}
.rejectcontainer{
  background-color: #fff;
  .cause{
    color: #fff;
    width: 100%;
    text-align: center;
    font-size: 18px;
    line-height: 40px;
    background-color: #2ab999;
  }
  .rejectInfo{
    margin: 20px;
  }
  border: 1px solid #cccccc;
  position: absolute;
  width: 65%;
  left: 0;top: 0;bottom: 0;right: 0;margin: auto;
  height: 240px;
/deep/ .el-form-item__content{
    width: 90%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0 !important;
  }
  .btn{
    position: absolute;
    width: 100px;
    bottom: 30px;
    right: 0px;
  }
}
/* 弹框滚动条 */
/deep/ .el-dialog__body {
  max-height: 62vh;
  overflow: auto;
}
/* 描述样式 */
/deep/ .el-descriptions-item__label{
  width: 70%;
}
.ct{
  display: block;
  text-align: center;
}
.rejectbtn{
  color: #2ab999;
  cursor: pointer;
}
.rejectInfo{
  border: 1px solid #ccc;
  padding: 0 20px;
  height: 120px;
}
</style>
