<template>
  <div class="content-main">
    <el-form :inline="true" :model="searchForm" class="search-bm-boder">
      <el-row>
        <el-form-item>
          <label slot="label">企业名称:</label>
          <el-input v-model="searchForm.lhxybm" class="inputCompatible"></el-input>
        </el-form-item>
        <el-form-item label="库点名称:">
          <el-input v-model="searchForm.sskdmc" class="inputCompatible"></el-input>
        </el-form-item>
        <el-form-item>
          <label slot="label">状态:</label>
          <el-select v-model="searchForm.ztbm" clearable placeholder="请选择" class="inputCompatible">
            <el-option
              v-for="item in yearOptions"
              :key="item.value"
              :label="item.name"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <div class="search-button">
            <span class="search-line"></span>
            <!-- <div class="search-select" @click="searchShowMoreBool=!searchShowMoreBool">更多条件 <i class="el-icon-arrow-up" v-show="searchShowMoreBool"></i><i class="el-icon-arrow-down" v-show="!searchShowMoreBool"></i></div> -->
            <el-button
              type="primary"
              @click="searchInfo"
              size="small"
              class="iconfont iconchaxun"
            >查询</el-button>
            <el-button
              type="primary"
              @click="searchForm = {}"
              size="small"
              class="iconfont iconzhongzhi"
            >重置</el-button>
          </div>
        </el-form-item>
      </el-row>
    </el-form>
    <el-row class="addBtnBg">
      <el-button
        type="primary"
        class="iconfont iconxinzeng"
        size="small"
        @click="addApply('add')"
      >新增</el-button>
    </el-row>
    <el-row>
      <el-table
        :data="tableData"
        stripe
        v-loading="listLoading"
        border
        fit
        highlight-current-row
        style="width: 100%"
      >
        <el-table-column align="center" label="序号" width="60" type="index"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="dwmc" label="单位名称"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="jydz" label="经营地址"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="qyxz" label="企业性质"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="zyccywlx" label="主要仓储业务类型"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="kqgs" label="库区个数"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="zdmj" width="110" label="占地面积"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="zcr" label="总仓容"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="whcr" label="完好仓容"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="jycr" label="简易仓容"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="zgr" label="总罐容"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="yggs" label="油罐个数"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="clzp" label="储粮罩棚"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="hgss" label="烘干设施"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="hgnl" label="烘干能力"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="rcknl" label="日出库能力"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="clzp" label="应用环流熏蒸仓容"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="clzp" label="应用粮情测控仓容"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="clzp" label="应用机械通风仓容"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="clzp" label="实现气调储粮仓容"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="clzp" label="保管员"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="clzp" label="质量检验员"></el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="ztmc" width="120" label="状态"></el-table-column>
        <el-table-column align="center" width="200" label="操作">
          <template slot-scope="scope">
            <el-tooltip class="item" effect="light" content="查看" placement="top">
              <el-button
                type="primary"
                @click="showInfo(scope.row)"
                class="operate_show_btn iconfont iconchakan2"
                size="small"
              ></el-button>
            </el-tooltip>
            <el-tooltip class="item" effect="light" content="编辑" placement="top">
              <el-button
                v-if="scope.row.zt != '1'"
                @click="update(scope.row)"
                type="primary"
                class="operate_edit_btn iconfont iconxiugai"
                size="small"
              ></el-button>
            </el-tooltip>
            <el-tooltip class="item" effect="light" content="删除" placement="top">
              <el-button
                v-if="scope.row.zt != '1'"
                @click="delate(scope.row)"
                type="primary"
                class="operate_delete_btn iconfont iconshanchu"
                size="small"
              ></el-button>
            </el-tooltip>
            <!-- <el-tooltip class="item" effect="light" content="提交" placement="top">
							<el-button
								v-if="scope.row.zt != '1'"
								@click="tujiao(scope.row)"
								type="primary"
								class="operate_show_btn iconfont icontijiao"
								size="small"
							></el-button>
            </el-tooltip>-->
          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <el-row>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="pageForm.pageNum"
        :page-sizes="[10, 20, 30, 40]"
        :page-size="pageForm.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="pageForm.total"
      ></el-pagination>
    </el-row>
  </div>
</template>

<script>
// import { selectList } from "@/api/grainReserves/overheadPeriodAdmin/overheadTurnin";
export default {
  name: "index",
  data() {
    return {
      listLoading: false,
      searchForm: {},
      pageForm: {
        pageNum: 1,
        pageSize: 10,
        total: 0
      },
      yearOptions: [],
      tableData: [{}]
    };
  },
  created() {
    this.getListInfo();
  },
  methods: {
    getListInfo() {
      let data = {
        lhxybm: this.searchForm.lhxybm,
        sskdmc: this.searchForm.sskdmc,
        lhnd: this.searchForm.lhnd,
        ztbm: this.searchForm.lhxybm,
        pageNum: this.pageForm.pageNum,
        pageSize: this.pageForm.pageSize
      };
      //   selectList(data).then(res => {
      //     if (res.infoCode == "200") {
      //       this.tableData = res.data.items;
      //       this.pageForm.total = Number(res.data.total);
      //     }
      //   });
    },
    searchInfo() {
      this.getListInfo();
    },
    showInfo() {
      this.$router.push({
        path:
          "/grainCoManage/warehousingLogistics/recordAudit/details?type=show"
      });
    },
    update() {
      this.$router.push({
        path:
          "/grainCoManage/warehousingLogistics/recordAudit/details?type=edit"
      });
    },
    addApply() {
      this.$router.push({
        path: "/grainCoManage/warehousingLogistics/recordAudit/details?type=add"
      });
    },
    delate() {
      this.$message({
        type: "success",
        message: "删除成功"
      });
    },

    tujiao() {
      this.$message({
        type: "success",
        message: "提交成功"
      });
    },
    handleSizeChange(val) {
      this.pageForm.pageSize = val;
      this.getInfo();
    },
    handleCurrentChange(val) {
      this.pageForm.pageNum = val;
      this.getInfo();
    }
  }
};
</script>

<style scoped>
.input-w-220 {
  width: 220px;
}
</style>
