<template>
  <div>
    <d2-container>
      <template slot="header">仓房展示/仓房信息</template>
        <div>
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="仓房名称:">
          <el-input v-model="formInline.cfName" placeholder="请选择"></el-input>
         
        </el-form-item>
        <el-form-item label="扫描时间">
          <el-date-picker
            v-model="formInline.scanTime"
            type="daterange"
            align="right"
            unlink-panels
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :picker-options="pickerOptions"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="search"
            >查询</el-button
          >
        </el-form-item>

        <el-form-item>
          <el-button type="primary" icon="el-icon-refresh-left" @click="reset"
            >重置</el-button
          >
        </el-form-item>
      </el-form>

      <el-table :data="cfInfoList" border style="width: 100%">
        <el-table-column prop="branchOffice" label="所属分公司" align="center">
        </el-table-column>
        <el-table-column prop="directLibrary" label="所属直属库" align="center">
        </el-table-column>
        <el-table-column prop="subTreasury" label="所属分库" align="center">
        </el-table-column>
        <el-table-column prop="cfName" label="仓房名称" align="center">
        </el-table-column>
        <el-table-column prop="keeper" label="保管员" align="center">
        </el-table-column>
        <el-table-column prop="lxfs" label="联系方式" align="center">
        </el-table-column>

        <el-table-column
          prop="lastScan"
          label="最近一次扫描时间"
          align="center"
        >
        </el-table-column>

        <el-table-column prop="cfState" label="当前仓房状态" align="center">
        </el-table-column>
        <el-table-column align="center" label="操作"  width="180">
          <template slot-scope="scope">
            <el-button
              @click="handleCheck(scope.row)"
              type="text"
              size="small"
              icon="el-icon-circle-check"
              >查看</el-button
            >
            <el-button type="text" size="small" icon="el-icon-edit"
              >编辑</el-button
            >
            <el-button type="text" size="small" icon="el-icon-delete"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
       <!-- <pagination
        
          :total="total"
          :page.sync="listQuery.page"
          :limit.sync="listQuery.limit"
          @pagination="getList"
        /> -->
    </div>
    </d2-container>
 
  </div>
</template>
<script>
// 引入分页
import Pagination from '@/components/pagination'
export default {
   
  name: "warehouseInfo",
  components: { Pagination },
  data() {
    return {
      
      //头部查询条件
      formInline: {
        cfName: "",
        scanTime: "",
      },
      //表格字段
      cfInfoList: [
        {
          branchOffice: "",
          directLibrary: "",
          subTreasury: "",
          cfName: "",
          keeper: "",
          lxfs: "",
          lastScan: "",
          cfState: "",
        },
      ],
      // 日期插件
      //
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      //分页
      total:30,
       listQuery: {
        page: 1,
        limit: 10,
        importance: undefined,
        title: undefined,
        type: undefined,
        sort: '+id'
      },
    };
  },
  methods: {
    search() {},
    reset() {},
    getList(){},
    //查看
    handleCheck(){
      this.$router.push(
        {
          path:"/warehouseInfo-check"
        }
      )
    },
    
  },
};
</script>