<!--
  @description:物料编码库新增
  @Modifier: haofengxian
  @routerPath:
  @date: 2020-5-9-14:40
-->
<template>
  <div>
    <div class="title p0-16 clearfix">
      <div class="title-back pointer" @click="back">
        <i class="iconfont icon-fanhui mr10" />物料编码库
      </div>
    </div>
    <div class="p0-16">
      <el-form
        ref="formBidderData"
        :rules="rules"
        :model="formData"
        :inline-message="true"
      >
        <table class="from_table">
          <tr class="singleRow">
            <td>
              <el-form-item label="物料编码" prop="name" />
            </td>
            <td colspan="3">
              <el-input v-model.trim="formData.name" type="text" placeholder="物料编码" />
            </td>
          </tr>
          <tr class="singleRow">
            <td>
              <el-form-item label="物料名称" prop="name" />
            </td>
            <td colspan="3">
              <el-input v-model.trim="formData.name" type="text" placeholder="物料名称" />
            </td>
          </tr>
          <tr class="singleRow">
            <td>
              <el-form-item label="编码等级" prop="name" />
            </td>
            <td colspan="3">
              <el-select v-model="formData.name" placeholder="请选择">
                <el-option
                  v-for="(item,index) in codeLevelList"
                  :key="index"
                  :label="item.typename"
                  :value="item.typecode"
                />
              </el-select>
            </td>
          </tr>
        </table>
      </el-form>
      <!--保存按钮-->
      <div class="but_footer">
        <div class="but_footer-h">
          <div class="but_footer-but">
            <el-button :loading="confirmLoading" type="primary" @click="save">
              保 存
            </el-button>
            <el-button @click="back('form')">
              返 回
            </el-button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
/* 公用方法*/
import { characters1_50 } from '@/assets/js/validate'// 校验输入内容
export default {
  name: 'MaterialCodeAdd',
  data() {
    return {
      confirmLoading: false, // 暂存Loding
      fileList: [], // 附件列表
      formData: {
        name: '' // 用户名
      },
      rules: {
        name: [{ required: true, validator: characters1_50, trigger: 'blur' }], // 用户名
        password: [{ required: true, validator: characters1_50, trigger: 'blur' }]// 密码
      },
      codeLevelList: [{
        typecode: '00',
        typename: '一级'
      }, {
        typecode: '01',
        typename: '二级'
      }, {
        typecode: '02',
        typename: '三级'
      }, {
        typecode: '03',
        typename: '四级'
      }]
    }
  },
  methods: {
    // 保存
    save() {

    },
    // 返回
    back() {
      this.$router.push({
        path: '/informationbase/materialCodeList'
      })
    }
  }
}
</script>

<style scoped>

</style>
