<template>
  <div>
    <el-form label-width="100px" ref="form" :model="attributeData">
      <el-row>
        <el-col :span="16" label-width="100px">
          <el-form-item label="类型" prop="type">
            <el-select
              style="width: 100%"
              :disabled="true"
              v-model="attributeData.bomType"
              placeholder="请选择"
            >
              <el-option
                v-for="item in bomTypeOptions"
                :label="item.label"
                :value="item.value"
                :key="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="16" label-width="100px">
          <el-form-item label="编码" prop="code">
            <el-input placeholder="" v-model="attributeData.code"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="16" label-width="100px">
          <el-form-item label="图号" prop="code">
            <el-input placeholder="" v-model="attributeData.imgCode"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="16" label-width="100px">
          <el-form-item label="名称" prop="name">
            <el-input placeholder="" v-model="attributeData.name"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" label-width="100px">
          <el-form-item label="型号" prop="name">
            <el-input
              placeholder=""
              v-model="attributeData.modeType"
            ></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8" label-width="100px">
          <el-form-item label="规格" prop="name">
            <el-input
              placeholder=""
              v-model="attributeData.specification"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" label-width="100px">
          <el-form-item label="材料" prop="name">
            <el-input
              placeholder=""
              v-model="attributeData.materialsName"
            ></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8" label-width="100px">
          <el-form-item label="物料编码" prop="name">
            <el-input
              placeholder=""
              v-model="attributeData.materialsCode"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" label-width="100px">
          <el-form-item label="来源" prop="name">
            <el-input
              placeholder=""
              v-model="attributeData.sourceData"
            ></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8" label-width="100px">
          <el-form-item label="用量" prop="name">
            <el-input placeholder="" v-model="attributeData.dosage"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" label-width="100px">
          <el-form-item label="单位" prop="name">
            <el-input placeholder="" v-model="attributeData.unit"></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8" label-width="100px">
          <el-form-item label="状态" prop="name">
            <el-select
              style="width: 100%"
              v-model="attributeData.status"
              placeholder="请选择"
            >
              <el-option
                v-for="item in statusOptions"
                :label="item.label"
                :value="item.value"
                :key="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" label-width="100px">
          <el-form-item label="物料库路径" prop="name">
            <el-input
              placeholder=""
              v-model="attributeData.materielPath"
            ></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8" label-width="100px">
          <el-form-item label="版本" prop="name">
            <el-input
              placeholder=""
              v-model="attributeData.versions"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="20" label-width="100px">
          <el-form-item label="备注" prop="name">
            <el-input
              placeholder=""
              v-model="attributeData.remake"
              type="textarea"
              :rows="2"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" label-width="100px">
          <el-form-item label="创建人" prop="name">
            <el-input
              placeholder=""
              disabled
              v-model="attributeData.createName"
            ></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8" label-width="100px">
          <el-form-item label="创建时间" prop="name">
            <el-input
              placeholder=""
              disabled
              v-model="attributeData.createTime"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

   <div class="btn_box">
    <el-button type="primary" >修改</el-button>
   </div>
    </el-form>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        form: {},
        statusOptions: [
          {
            label: '默认',
            value: '0'
          },
          {
            label: '归档',
            value: '1'
          }
        ],
        bomTypeOptions: [
          {
            label: 'PBOM',
            value: 1
          },
          {
            label: 'MBOM',
            value: 2
          }
        ]
      };
    },
    props: {
      attributeData: {
        type: Object,
        default: {}
      }
    }
  };
</script>

<style lang="scss" scoped>
.btn_box{
  display: flex;
  align-items: center;
  justify-content: center;
}</style>
