<!--
 * @Author: zwq
 * @Date: 2021-11-18 14:16:25
 * @LastEditors: zwq
 * @LastEditTime: 2023-03-03 14:33:43
 * @Description:
-->
<template>
  <el-form
    :model="dataForm"
    :rules="dataRule"
    ref="dataForm"
    @keyup.enter.native="dataFormSubmit()"
    label-width="100px"
  >
    <el-form-item label="产品名称" prop="productName">
      <el-input v-model="dataForm.productName"clearable placeholder="产品名称"></el-input>
    </el-form-item>
    <el-form-item label="批次号" prop="dateNum">
      <el-input v-model="dataForm.dateNum"clearable placeholder="批次号"></el-input>
    </el-form-item>
    <el-form-item label="货物数量" prop="quantity">
      <el-input v-model="dataForm.quantity"clearable placeholder="货物数量"></el-input>
    </el-form-item>
    <el-form-item label="是否为空" prop="isEmpty">
      <el-select v-model="dataForm.isEmpty"clearable placeholder="请选择是否为空">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="库位状态" prop="status">
      <el-select v-model="dataForm.status"clearable placeholder="请选择库位状态">
        <el-option
          v-for="item in options1"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="详细规格" prop="specModel">
      <el-input v-model="dataForm.specModel"clearable placeholder="详细规格"></el-input>
    </el-form-item>
    <el-form-item label="库位名称" prop="warehousePositionName">
      <el-input v-model="dataForm.warehousePositionName"clearable placeholder="库位名称"></el-input>
    </el-form-item>
    <el-form-item label="备注" prop="remark">
      <el-input v-model="dataForm.remark"clearable placeholder="备注"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
import basicAdd from "@/mixins/basic-add";
export default {
  mixins: [basicAdd],
  data() {
    return {
      urlOptions: {
        submitURL: "/code/mtWarehousePositionRelat/",
        infoURL: "/code/mtWarehousePositionRelat",
      },
      isGetCode: true,
      dataForm: {
        id: "",
        productName: "",
        quantity: "",
        dateNum: "",
        specModel: '',
        isEmpty: "",
        status: "",
        warehousePositionName: "",
        remark: "",
      },
      options: [
        {
          value: 0,
          label: "空",
        },
        {
          value: 1,
          label: "有货",
        },
      ],
      options1: [
        {
          value: -1,
          label: "不可用",
        },
        {
          value: 0,
          label: "空库位",
        },
        {
          value: 1,
          label: "空货架",
        },
        {
          value: 2,
          label: "货物正常",
        },
        {
          value: 3,
          label: "货物预入库",
        },
        {
          value: 4,
          label: "货物预出库",
        },
      ],
      dataRule: {
        productName: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
      },
    };
  },
  methods: {
    getCode() {
      this.$http
        .get("/code/mtWarehousePositionRelat/getCode")
        .then(({ data: res }) => {
          this.dataForm.whCode = res;
        })
        .catch(() => {});
    },
  },
};
</script>
