<template>
  <div class="edit-add-detail">
    <div class="crumbs">
      <Breadcrumb
        :breadcrumbOpt="breadcrumbOpt"
        svg-name="#icon-icon_analysis_patent"
        @breadcrumb-click="handleClose"
      />
    </div>
    <div class="form-content">
      <div class="company-information">
        <el-form
        ref="formInfo"
        :model="parameter"
        label-width="auto"
        label-position="right"
        :rules="rules"
      >
        <div class="rows">
          <div class="rows-left">
            <div class="rows-hr"></div>
          </div>
          <div class="rows-title">
            <div class="text-overflow">资质类型信息</div>
          </div>
        </div>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="资质类型编码" prop="code">
              <el-input
                
                readonly
                v-model="parameter.code"
                placeholder="请输入资质类型编码"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="资质类型名称" prop="name">
              <el-input
                readonly
                v-model="parameter.name"
                placeholder="请输入资质类型名称"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="限制文件大小(MB)" prop="fileSize">
              <el-input
                readonly
                v-model="parameter.fileSize"
                placeholder="请输入限制文件大小(MB)"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="限制文件数量" prop="fileNum">
              <el-input
                readonly
                v-model="parameter.fileNum"
                placeholder="请输入限制文件数量"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="是否限制有限期" prop="limitation">
              <el-select
                style="width:100%"
                readonly
                v-model="parameter.limitation"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in limitationList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item
              label="到期处理方式"
              prop="expirationProcessingMethod"
            >
              <el-select
                style="width:100%"
                readonly
                v-model="parameter.expirationProcessingMethod"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in expirationProcessingMethodList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="是否需要审批" prop="changeApproval">
              <el-select
                style="width:100%"
                readonly
                v-model="parameter.changeApproval"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in changeApprovalList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="审批方式" prop="changeApprovalMethod">
              <el-select
                style="width:100%"
                readonly
                v-model="parameter.changeApprovalMethod"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in changeApprovalMethodList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- <el-row :gutter="23">
          <el-col :span="12">
            <el-form-item label="创建人姓名" prop="createName">
              <el-input
                readonly
                v-model="parameter.createName"
                placeholder="请输入创建人姓名"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row> -->
      </el-form>
      </div>
    </div>
    <div slot="footer" class="footer">
        <el-button @click="handleClose">{{ $t('domestic.cancel') }}</el-button>
      </div>
  </div>
</template>

<script>
import Breadcrumb from '@/components/Breadcrumb/index.vue'
import basicData from '@/api/basicData'
export default {
  name: 'domesticDialog',
  components: {Breadcrumb},
  data() {
    return {
      breadcrumbOpt: [{breadcrumbName: '资质类型'}, {breadcrumbName: '详情'}],
      parameter: {},
      expirationProcessingMethodList: [
        {
          label: '冻结',
          value: 0
        },
        {
          label: '提醒',
          value: 1
        }
      ],
      limitationList: [
        {
          label: '不限制',
          value: '0'
        },
        {
          label: '限制',
          value: '1'
        }
      ],
      saveing: false,
      changeApprovalList: [
        {
          label: '不需要审批',
          value: 0
        },
        {
          label: '需要审批',
          value: 1
        }
      ],
      changeApprovalMethodList: [
        {
          label: '企业审批',
          value: 0
        },
        {
          label: '平台审批',
          value: 1
        }
      ],
    }
  },
  created() {
    this.parameter = this.$route.query.detailRows
    this.detail(this.parameter.id)
  },
  mounted() {},
  methods: {
    // 关闭//面包屑点击
    handleClose() {
      this.$router.push({
        name: 'qualificationType',
      })
      this.parameter = {}
    },
    //获取详情
    detail(val) {
      basicData.bizQualificationCategoryId(val).then(res => {
        res.changeApproval =
          res.changeApproval === '0' ? '不需要审批' : '需要审批'
        res.changeApprovalMethod =
          res.changeApprovalMethod === '0' ? '企业审批' : '平台审批'
        res.expirationProcessingMethod =
          res.expirationProcessingMethod === '0' ? '冻结' : '提醒'
        this.parameter = res
      })
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .el-form-item__label {
  width: 120px;
  font-size: 14px;
  color: #828282;
  font-weight: 500;
}

::v-deep .el-form-item__content span {
  font-size: 14px;
  color: #000;
  font-weight: 500;
}

::v-deep .el-form-item {
  margin-bottom: 10px;
}

.rows {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ebebeb;
  margin-bottom: 16px;
  padding: 10px 0;

  .rows-left {
    margin-right: 10px;

    .rows-hr {
      width: 3px;
      height: 18px;
      background-color: #0e6eff;
      border-radius: 2px;
    }
  }

  .rows-title {
    .text-overflow {
      width: 100%;
      font-size: 16px;
    }
  }
}
</style>
