<template>
  <div>
      <el-card>

        <el-form :model="query" v-if="showSearch" label-width="auto">
          <el-row :gutter="20">
            <el-col :span="6">
              <el-form-item label="设备编码">
                <el-input v-model="query.deviceCode" clearable/>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="设备名称">
                <el-input v-model="query.productName" clearable/>
              </el-form-item>
            </el-col>
<!--            <el-col :span="6">-->
<!--              <el-form-item label="设备状态">-->
<!--                <el-select v-model="query.status"-->
<!--                           style="width: 100%"-->
<!--                           clearable>-->
<!--                  <el-option-->
<!--                      v-for="item in deviceStatus"-->
<!--                      :key="item.key"-->
<!--                      :label="item.desc"-->
<!--                      :value="item.key">-->
<!--                  </el-option>-->
<!--                </el-select>-->
<!--              </el-form-item>-->
<!--            </el-col>-->
          </el-row>
        </el-form>
        <div class="top-right-btn">
          <el-button-group>
            <el-button icon="el-icon-view" type="primary" @click="showSearch = !showSearch">显示/隐藏搜索栏</el-button>
            <el-button
                type="primary"
                icon="el-icon-refresh"
                @click="onReset"
            >重置
            </el-button>
            <el-button type="primary" icon="el-icon-search" @click="query.page=1;getList()"
            >查询
            </el-button>
          </el-button-group>
        </div>
        <el-divider style="margin: 15px"></el-divider>
        <el-table :data="list" v-loading="loading" @selection-change="(val)=>{selectChangeFunc(val)}"
                  @row-click="(row)=>{$refs.table.toggleRowSelection(row)}" ref="table" row-key="deviceCode">
          <el-table-column type="selection" width="55"></el-table-column>
          <el-table-column label="序号" width="50" type="index"/>
          <el-table-column label="科室" width="150" prop="deptName"/>
          <el-table-column label="设备编码" width="150" prop="deviceCode"/>
          <el-table-column label="最小销售标识" width="150" prop="nameCode"/>
          <el-table-column label="名称" width="150" prop="productName"/>
          <el-table-column label="规格型号" width="160" prop="ggxh"/>
<!--          <el-table-column label="状态" width="120" prop="statusName">-->
<!--            <template scope="scope">-->
<!--              <el-tag :type="deviceStatus[scope.row.status].tagType">{{ scope.row.statusName }}</el-tag>-->
<!--            </template>-->
<!--          </el-table-column>-->
          <el-table-column label="变更次数" width="100" prop="changeCount"/>
          <el-table-column label="维修次数" width="100" prop="repairCount"/>
          <el-table-column label="巡检次数" width="100" prop="checkCount"/>
          <el-table-column label="计量单位" width="100" prop="measname"/>
          <el-table-column label="生产企业" width="180" prop="manufactory"/>
          <el-table-column label="批次号" width="100" prop="batchNo"/>
          <el-table-column label="序列号" width="100" prop="serialNo"/>
          <el-table-column label="生产日期" width="140" prop="productionDate"/>
          <el-table-column label="过期时间" width="140" prop="expireDate"/>
          <el-table-column label="供应商" width="100" prop="supName"/>
          <el-table-column label="udi码" width="150" prop="udi"/>
          <el-table-column label="注册/备案号" width="150" prop="zczbhhzbapzbh"/>
        </el-table>
        <pagination
            v-show="total>0"
            :total="total"
            :page.sync="query.page"
            :limit.sync="query.limit"
            @pagination="getList"
        />
      </el-card>
  </div>
</template>

<script src="./index.js"/>

<style scoped>

</style>
