<template>
  <div class="basic-information">
    <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="请输入项目名称"
          readonly
          :disabled="disabled"
        />
      </el-form-item>
      <el-form-item label="核心企业名称" prop="enterprise">
        <el-input
          v-model="ruleForm.enterprise"
          placeholder="请输入核心企业名称"
          readonly
          :disabled="disabled"
        />
      </el-form-item>
      <el-form-item label="供应商（主体）名称" prop="mainEnterprise">
        <el-input
          v-model="ruleForm.mainEnterprise"
          placeholder="请输入供应商（主体）名称"
          readonly
          :disabled="disabled"
        />
      </el-form-item>
      <el-form-item label="贸易平台" prop="tradingPlatformId">
        <el-input
          v-model="ruleForm.platform"
          placeholder="请输入贸易平台"
          readonly
          :disabled="disabled"
        />
      </el-form-item>
      <el-form-item label="业务编号" prop="businessNumber">
        <el-input
          v-model="ruleForm.businessNumber"
          placeholder="请输入业务编号"
          readonly
          :disabled="disabled"
        />
      </el-form-item>
      <el-form-item v-if="taskName === '变更创建'" label="变更类型">
        <el-select v-model="ruleForm.value" placeholder="请选择变更类型">
          <el-option
            v-for="item in []"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    basicInformation: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      formlabel: {
        company: '公司名称'
      },
      ruleForm: {
        value: '',
        projectName: '',
        platform: '',
        enterprise: '',
        mainEnterprise: '',
        businessNumber: ''
      },
      rules: {
        projectName: [{ required: true, message: '请选择项目名称', trigger: 'change' }],
        platform: [{ required: true, message: '请选择贸易平台', trigger: 'change' }],
        enterprise: [{ required: true, message: '请输入核心企业名称', trigger: 'blur' }],
        mainEnterprise: [{ required: true, message: '请输入供应商（主体）名称', trigger: 'blur' }],
        businessNumber: [{ required: true, message: '请输入业务编号', trigger: 'blur' }]
      },
      taskName: '',
      entryNameList: [],
      platformList: []
    }
  },
  computed: {

  },
  watch: {
    basicInformation: {
      handler(newV) {
        if (Object.keys(newV).length) {
          const { projectName, platform, enterprise, mainEnterprise, businessNumber } = JSON.parse(JSON.stringify(newV))
          this.ruleForm = {
            projectName,
            enterprise,
            mainEnterprise,
            businessNumber,
            platform
          }
        }
      },
      immediate: true,
      deep: true
    }
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.basic-information {
}
</style>
