<template>
  <div class="orderCount">
    <el-form ref="searchFrom" inline :model="searchFrom" label-width="100px">
      <el-form-item label="商品">
        <el-select
          style="width: 600px"
          v-model="searchFrom.priceList"
          collapse-tags
          multiple
          filterable
          placeholder="请选择">
          <el-option
            v-for="item in goodsList"
            :key="item.id"
            :label="item.name"
            :value="item.current_price">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="起止日期">
        <el-date-picker
          v-model="searchFrom.dateValue"
          unlink-panels
          type="daterange"
          value-format="yyyy-MM-dd"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="">
        <el-button type="primary">
          搜索
        </el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  import {getGoodsListApi,orderCountApi} from "../../service/api";
  export default {
    name: "index",
    data(){
      return {
        goodsList:[],
        searchFrom:{
          priceList:[],
          dateValue:[]
        },
      }
    },
    mounted(){
      this.initPage()
    },
    methods:{
      initPage(){
        getGoodsListApi({limit:99999}).then(res=>{
          res.list.forEach(i=>{
            i.current_price =( i.current_price / 100 ).toFixed(2);
            this.searchFrom.priceList.push(i.current_price)
          });
          this.goodsList=res.list
        })
      },
      searchPage(){

      }
    }
  }
</script>

<style scoped lang="less">
  .orderCount{
    padding: 10px;
  }

</style>
