<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="projectName">
        <el-input
          v-model="ruleForm.projectName"
          placeholder="请输入项目名称"
          disabled
        />
      </el-form-item>
      <el-form-item label="核心企业名称" prop="enterprise">
        <el-input
          v-model="ruleForm.enterprise"
          placeholder="请输入核心企业名称"
          disabled
        />
      </el-form-item>
      <el-form-item label="供应商（主体）名称" prop="mainEnterprise">
        <el-input
          v-model="ruleForm.mainEnterprise"
          placeholder="请输入供应商（主体）名称"
          disabled
        />
      </el-form-item>
      <el-form-item label="贸易平台" prop="platform">
        <el-input
          v-model="ruleForm.platform"
          placeholder="请输入贸易平台"
          disabled
        />
      </el-form-item>
      <el-form-item label="业务编号" prop="businessNumber">
        <el-input
          v-model="ruleForm.businessNumber"
          placeholder="请输入业务编号"
          disabled
        />
      </el-form-item>
      <el-form-item v-if="this.businessName === '变更合同创建'" label="变更类型" prop="businessNumber">
        <el-select
          v-model="ruleForm.changeType"
          placeholder="请选择变更类型"
          disabled
        >
          <el-option label="经办人变更" :value="1" />
          <el-option label="合同条款变更" :value="0" />
        </el-select>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
// import { getInformationDeatail } from '@/api/myTrade/salesContractManagement/salesContractManagement'
export default {
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    basicInformation: {
      type: Object,
      default: () => {}
    },
    businessName: {
      type: String,
      default: () => ''
    }
  },
  data() {
    return {
      ruleForm: {
        changeType: '',
        projectName: '',
        platform: '',
        enterprise: '',
        mainEnterprise: '',
        businessNumber: ''
      },
      rules: {
        projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
        platform: [{ required: true, message: '请输入贸易平台', trigger: 'blur' }],
        enterprise: [{ required: true, message: '请输入核心企业名称', trigger: 'blur' }],
        mainEnterprise: [{ required: true, message: '请输入供应商（主体）名称', trigger: 'blur' }],
        businessNumber: [{ required: true, message: '请输入业务编号', trigger: 'blur' }]
      },
      taskName: ''
    }
  },
  computed: {

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

  }
}
</script>

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