<!--
 * @Author: zwq
 * @Date: 2021-11-18 14:16:25
 * @LastEditors: zwq
 * @LastEditTime: 2023-03-03 14:10:01
 * @Description:
-->
<template>
  <el-form
    :model="dataForm"
    :rules="dataRule"
    ref="dataForm"
    @keyup.enter.native="dataFormSubmit()"
    label-width="100px"
  >
    <el-form-item label="仓库名称" prop="whName">
      <el-input v-model="dataForm.whName"clearable placeholder="仓库名称"></el-input>
    </el-form-item>
    <el-form-item label="仓库编码" prop="whCode">
      <el-input v-model="dataForm.whCode"clearable placeholder="仓库编码"></el-input>
    </el-form-item>
    <el-form-item label="地址" prop="address">
      <el-input v-model="dataForm.address"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/mtWarehouse/",
        infoURL: "/code/mtWarehouse",
      },
      isGetCode: true,
      dataForm: {
        id: "",
        whName: "",
        address: "",
        whCode: "",
        remark: "",
      },
      dataRule: {
        whName: [{ required: true, message: "仓库名称不能为空", trigger: "blur" }],
      },
    };
  },
  methods: {
    getCode() {
      this.$http
        .get("/code/mtWarehouse/getCode")
        .then(({ data: res }) => {
          this.dataForm.whCode = res;
        })
        .catch(() => {});
    },
  },
};
</script>
