<template>
  <div class="contract-base-info">
    <el-form
      ref="ruleFormRef"
      :model="ruleForm"
      :rules="rules"
      label-position="top"
      label-width="150px"
      class="rule-form-orange"
    >
      <el-form-item label="项目名称" prop="projectInformationId">
        <el-input
          v-model="ruleForm.projectName"
          placeholder="请选择项目名称"
          disabled
        />
      </el-form-item>
      <el-form-item label="核心企业名称">
        <el-input
          v-model="ruleForm.enterprise"
          placeholder="请输入核心企业名称"
          disabled
        />
      </el-form-item>
      <el-form-item label="供应商（主体）名称">
        <el-input
          v-model="ruleForm.mainEnterprise"
          placeholder="请输入供应商（主体）名称"
          disabled
        />
      </el-form-item>
      <el-form-item label="贸易平台">
        <el-input
          v-model="ruleForm.platformName"
          placeholder="请输入贸易平台"
          disabled
        />
      </el-form-item>
      <el-form-item label="业务编号">
        <el-input
          v-model="ruleForm.businessNumber"
          placeholder="请输入业务编号"
          disabled
        />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    info: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      ruleForm: {
        enterprise: '',
        mainEnterprise: '',
        platformName: '',
        businessNumber: '',
        projectInformationId: '',
        supplierId: '',
        id: '',
        platformId: '',
        projectName: ''
      },
      rules: {
        projectInformationId: [{ required: true, message: '请选择项目名称', trigger: 'change' }]
      }
    }
  },
  watch: {
    'info.mathId': {
      handler(newV) {
        if (newV && this.info.basicInfo) {
          Object.keys(this.ruleForm).forEach(key => {
            this.ruleForm[key] = this.info.basicInfo[key]
          })
        }
      },
      immediate: true
    }
  }
}
</script>

  <style lang="scss" scoped>
  .contract-base-info {
  }
  </style>
