<template>
  <div class="app-container">
    <!-- 筛选条件 -->
    <div>
      <el-form label-width="70px" size="small" label-position="left">
        <el-row :gutter="20">
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="仓库名称" prop="account">
              <el-input placeholder="请输入仓库名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :lg="6">
            <el-form-item label="仓位名称" prop="nickname">
              <el-input placeholder="请输入仓位名称"></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :lg="12" class="tr">
            <el-form-item label="">
              <el-button size="small" @click="resetScreenForm">清空</el-button>
              <el-button size="small" type="primary" @click="submitScreenForm"
                >搜索</el-button
              >
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 按钮 -->
    <div class="btn-group clearfix">
      <div class="fl">
        <el-button type="primary">新增</el-button>
        <el-button type="primary">编辑</el-button>
        <el-button type="primary">删除</el-button>
      </div>
    </div>
    <div class="mymain-container">
      <!-- 列表 -->
      <div class="table">
        <el-table
          v-loading="listLoading"
          :data="dataList"
          element-loading-text="Loading"
          border
          fit
          highlight-current-row
          stripe
        >
          <el-table-column
            align="center"
            label="序号"
            prop="num"
            min-width="60"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="仓库名称"
            prop="storeName"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="仓位名称"
            prop="positionName"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="库存警戒线"
            prop="alert"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="库存充足"
            prop="adequate"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="创建人"
            prop="createUser"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="创建时间"
            prop="createDate"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="更新人"
            prop="updateUser"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            align="center"
            label="更新时间"
            prop="updateDate"
            min-width="160"
            show-overflow-tooltip
          ></el-table-column>

          <el-table-column
            align="center"
            label="操作"
            min-width="160"
            show-overflow-tooltip
          >
            <el-button type="text" class="textColor" @click="editFn"
              >编辑</el-button
            >
            <el-button type="text" class="textColor">删除</el-button>
          </el-table-column>
        </el-table>
      </div>
      <!-- 分页 -->
      <div class="fr">
        <el-pagination
          :current-page="currentPage"
          :page-sizes="[10, 20, 30, 50]"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="listTotal"
        >
        </el-pagination>
      </div>
    </div>

    <!-- 弹窗 -->
    <el-dialog
      title="仓库仓位对应关系"
      :visible.sync="showDialogForm"
      width="30%"
      :show-close="false"
      :close-on-click-modal="false"
    >
      <el-form ref="form" :model="diaLogForm" label-width="100px">
        <el-form-item label="仓库名称">
          <el-input v-model="diaLogForm.storeName"></el-input>
        </el-form-item>
        <el-form-item label="仓位名称">
          <el-select
            v-model="diaLogForm.positionName"
            multiple
            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="库存警戒线">
          <el-input v-model="diaLogForm.alert"></el-input>
        </el-form-item>
        <el-form-item label="库存状态"> - </el-form-item>
        <el-form-item label="备注">
          <el-input type="textarea" v-model="diaLogForm.text"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="showDialogForm = false">取 消</el-button>
        <el-button type="primary" @click="showDialogForm = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      currentPage: 1, // 当前页码
      pageSize: 10, // 每页数量
      listTotal: 0, // 列表总数
      options: [
        {
          value: "选项1",
          label: "1",
        },
        {
          value: "选项2",
          label: "2",
        },
        {
          value: "选项3",
          label: "3",
        },
        {
          value: "选项4",
          label: "4",
        },
        {
          value: "选项5",
          label: "5",
        },
      ],
      diaLogForm: {
        storeName: "",
        positionName: [],
        alert: "",
        text: "",
      },
      showDialogForm: false,
      dataList: [
        {
          num: "1",
          storeName: "万豪仓",
          positionName: "万豪普通仓",
          alert: "122台",
          adequate: "充足",
          createUser: "LID",
          createDate: "2022-05-12 12:00",
          updateUser: "LID",
          updateDate: "2022-05-24 12:08",
        },
        {
          num: "1",
          storeName: "万豪仓",
          positionName: "万豪普通仓",
          alert: "122台",
          adequate: "充足",
          createUser: "LID",
          createDate: "2022-05-12 12:00",
          updateUser: "LID",
          updateDate: "2022-05-24 12:08",
        },
        {
          num: "1",
          storeName: "万豪仓",
          positionName: "万豪普通仓",
          alert: "122台",
          adequate: "充足",
          createUser: "LID",
          createDate: "2022-05-12 12:00",
          updateUser: "LID",
          updateDate: "2022-05-24 12:08",
        },
      ],
      searchForm: {
        positionName: "",
        storeName: "",
      },
    };
  },
  methods: {
    addFn() {
      this.showDialogForm = true;
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep .el-date-editor {
  width: 100%;
}
::v-deep .el-select {
  width: 100%;
}
::v-deep .el-col-9 .el-button {
  padding: 5px;
}
::v-deep .el-dialog__header {
  background-color: #dddddd;
}
.base {
  padding: 20px 20px 0;
}
.table {
  margin-top: 12px;
}
.right {
  float: right;
}
</style>