<template>
  <div>
    <!-- 搜索 -->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
      <el-form-item :label="soByType ? '采购时间' : '领料时间'" prop="searchTimeArray">
        <el-date-picker
          v-model="queryParams.searchTimeArray"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="关键字" prop="soNo">
        <el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
      </el-form-item>
      <el-form-item v-if="soByType" label="规格" prop="soNo">
        <el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
      </el-form-item>
      <el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
        <CorpChoose />
      </el-form-item>
      <el-form-item v-if="soByType" label="所属库位" prop="corpId">
        <CorpChoose />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search">搜索</el-button>
        <el-button icon="el-icon-refresh">重置</el-button>
      </el-form-item>
    </el-form>
    <!-- 操作 -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-download" size="mini"
        >导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch"></right-toolbar>
    </el-row>
    <!-- 表格 -->
    <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
      <el-table-column label="序号" align="center">
        <template scope="scope">
          <span>{{ scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="单号" align="center" prop="soNo" width="180" />
      <el-table-column label="商品名称" align="center" prop="soNo" width="180" />
      <el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="soNo" width="180" />
      <el-table-column label="商品编码" align="center" prop="soNo" width="180" />
      <el-table-column v-if="soByType" label="条形码" align="center" prop="soNo" width="180" />
      <el-table-column label="规格" align="center" prop="soNo" width="180" />
      <el-table-column label="数量" align="center" prop="itemCount" width="150" />
      <el-table-column :label="soByType ? '进价' : '成本'" align="center" prop="itemCount" width="150" />
      <el-table-column label="合计" align="center" prop="itemCount" width="150" />
      <el-table-column v-if="soByType" label="供应商" align="center" prop="itemCount" width="180" />
      <el-table-column :label="soByType ? '采购仓库' : '仓库'" align="center" prop="itemCount" width="150" />
      <el-table-column label="所属门店" align="center" prop="itemCount" width="180" />
      <el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="itemCount" width="150" />
      <el-table-column label="备注" align="center" prop="itemCount" width="180" />
    </el-table>
    <!-- 分页 -->
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
    />
  </div>
</template>

<script>
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";

export default {
  name: "SoiTable",
  components: {CorpChoose},
  props: {
    soByType: {
      type: Boolean,
      defaultValue: true,
      required: true
    },
  },
  data() {
    return {
      queryParams:{
        pageNo: 1,
        pageSize: 10,
        searchTimeArray:[],
        soNo: null,
        corpId: null,
      },
      showSearch: true,
      loading: false,
      list: [],
    }
  },
  methods: {}
}
</script>

<style scoped lang="scss">

</style>
