// 储备轮换计划执行（企业）
<template>
  <div class="content-main">
    <div class="search-bm-boder">

      <el-row>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          
          <el-form-item label="监测点:" prop="jhmc">
            <el-input clearable v-model="formInline.orgName" placeholder="请选择"></el-input>
          </el-form-item>
          <el-form-item label="上报地区:" prop="sbdq">
             <el-select v-model="form.areaCode" clearable placeholder="全部" class="w180 search-width">
                <el-option v-for="item in dataDictioPubArr" :key="item.countyCode" :label="item.countyName" :value="item.countyCode">
                </el-option>
              </el-select>
            <!-- <el-input clearable v-model="formInline.sbdq" placeholder="请选择"></el-input> -->
          </el-form-item>
          <el-form-item label="状态:" prop="zt">
            <el-input clearable v-model="formInline.zt" placeholder="请选择"></el-input>
          </el-form-item>

          <div class="search-button">
            <span class="search-line"></span>
            <div class="search-select" @click="searchShowMore">更多条件
              <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="getList" size="small" class="iconfont iconchaxun"> 查询</el-button>
            <el-button type="primary" @click="resetInfo('form')" size="small" class="iconfont iconzhongzhi"> 重置</el-button>
          </div>
          <div v-show="searchShowMoreBool">
            <el-form-item label="上报时间:" label-width="60PX;" prop="sbsj">
            <el-input clearable v-model="formInline.sbsj" placeholder="请选择"></el-input>
          </el-form-item>
           

          </div>

        </el-form>
      </el-row>

    </div>

    <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="70">
          <template slot-scope="scope">
            <span>{{ scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" :show-overflow-tooltip="true" prop="sbdq" label="上报地区"></el-table-column>
        <el-table-column :show-overflow-tooltip="true" align="center" prop="sbjcd" label="上报监测点"></el-table-column>
        <el-table-column align="center" prop="sbr" label="上报人"></el-table-column>
        <el-table-column align="center" prop="sbsj" label="上报时间"></el-table-column>
        <el-table-column align="center" width="120" prop="sbkssj" label="上报开始时间"></el-table-column>
        <el-table-column align="center" width="130" prop="sbjssj" label="上报结束时间"></el-table-column>
        <el-table-column align="center" prop="zt" label="状态"></el-table-column>
        <el-table-column align="center" label="操作">
          <template slot-scope="scope">
            <el-tooltip class="item" effect="light" content="查看" placement="top">
              <el-button
                @click="handleClick(scope.row)"
                type="primary"
                size="small"
                class="operate_show_btn iconfont iconchakan2"
              ></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.page"
        :page-sizes="[10, 20, 30, 40]"
        :page-size="pageForm.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="pageForm.total"
      ></el-pagination>
    </el-row>
  </div>
</template>

<script>
// import { reportArea } from '@/api/myuser/index'
// import { selectBreedSummary } from  "@/api/grainReserves/alternationPlanManage/alternationImple/index";
export default {
  data() {
    return {
       reportStatuss: [
            {
              key: '1',
              value: '提交',
            },
            {
                key: '2',
                value: '发布',
            },
            {
              key: '3',
              value: '驳回',
            }
        ],
      dataDictioPubArr: [],
      pzOptions: [],
      lxOptions: [
        {
          dictCode: 1,
          dictName: '包干入库'
        },
        {
          dictCode: 2,
          dictName: '兜底入库'
        },
        {
          dictCode: 3,
          dictName: '兜底出库'
        }
      ],
      formInline: {
        kdmc: '',
        htbh: '',
        pz: ''
      },
      listLoading: false,
      searchShowMoreBool: false,
      tableData: [
        {
          sbdq: '内蒙古',
          sbjcd: '内蒙粮油信息中心',
          sbr: '测试',
          sbsj: '2019-09-16',
          sbkssj: '2019-09-16',
          sbkssj: '2019-09-17',
          sbjssj: '2019-09-17',
          zt: '发布'
        }
      ],
      pageForm: {
        page: 1,
        size: 10,
        total: 0
      }
    }
  },
  created() {
    reportArea().then(res => {
          if(res.status == 'SUCCESS') {
              this.dataDictioPubArr = res.data
          }
      })
    this.getList();
  },
  methods: {
    resetInfo(formName) {
      this.$refs[formName].resetFields();
      this.getList()
    },
    //更多条件点击事件
    searchShowMore() {
      this.searchShowMoreBool = !this.searchShowMoreBool;
    },
    getList() {
    //   let data = {
    //     zdrbm: sessionStorage.getItem("orgCode"),
    //     pageSize: this.pageForm.size,
    //     pageNum: this.pageForm.page
    //   };
    //   selectBreedSummary(data).then(res => {
    //     if (res.infoCode == 200) {
    //       res.data.items.map(item=>{
    //         if(item.lrsl == 0 && item.lcsl == 0){
    //           item.ztmc = '未开始'
    //         }else{
    //           if(item.lrsl+item.lcsl == item.lhsl*2){
    //             item.ztmc = '已完成'
    //           }else if(item.lrsl+item.lcsl < item.lhsl*2){
    //             item.ztmc = '进行中'
    //           }
    //         }
    //       })
    //       this.tableData = res.data.items;
    //     }
    //   });
    },
    handleClick(row) {
      this.$router.push({ name: 'monitorWarningDetail' })
    },
    handleSizeChange(val) {
      this.pageForm.size = val
      this.getList()
    },
    handleCurrentChange(val) {
      this.pageForm.page = val
      this.getList()
    }
  },
  beforeCreate() {}
}
</script>
