<!-- 设备清单的有select的表格 -->
<template>
    <div class='wb-list'>
        <div class='eq-list-top'>
            <a-input-search placeholder style='width: 192px;margin-bottom:12px;height:32px;' @search='onSearch' />
        </div>
        <el-table :data='tableData' style='width: 100%'>
            <el-table-column type='index' label='序号' width='80'></el-table-column>
            <el-table-column prop='sbjc' label='设备名称' width='160'></el-table-column>
            <el-table-column prop='sbjbm' label='设备编码'></el-table-column>
            <el-table-column prop='matters' label='重要事项记录'></el-table-column>
            <el-table-column prop='description' label='描述'></el-table-column>
            <el-table-column label='更换配件信息'>
                <el-table-column prop='ischangepj' label='是/否更换' width='120'></el-table-column>
                <el-table-column prop='model' label='配件名称型号' width='120'></el-table-column>
                <el-table-column prop='address' label='数量' width='300'></el-table-column>
                <el-table-column prop='cost' label='费用(万元)' width='120'></el-table-column>
                <el-table-column prop='source' label='费用出处' width='120'></el-table-column>
            </el-table-column>
            <el-table-column prop='brand' label='现场照片'></el-table-column>
            <el-table-column prop='startDate' label='填报时间'></el-table-column>
            <el-table-column prop='enddate' label='验收时间'></el-table-column>
            <el-table-column prop='wonum' label='任务编号'></el-table-column>
        </el-table>
        <div class='foot'>
            <el-pagination
                background
                layout='prev, pager, next'
                :total='total/pageSize'
                :page-size='size'
                @prev-click='pageChanged'
                @next-click='pageChanged'
                @current-change='pageChanged'
            ></el-pagination>
        </div>
    </div>
</template>
<script>
import { queryEquipmentList, queryWbsms } from '@/api/equipmentList.js'
export default {
    data() {
        return {
            pageSize: 10,
            tableData: [],
            total: 0,
            currentPage: 1,
            size: 10
        }
    },
    props: ['major', 'systemName'],
    methods: {
        onSearch() {},
        pageChanged(page, size) {
            this.currentPage = page
            this.size = size
            this.getList()
        },
        getList() {
            // let postParams = {}
            // let data = {
            //     page: this.currentPage,
            //     size: this.size,
            //     plazaId: this.$store.state.plazaId,
            //    major: this.major,

            // }
            // queryEquipmentList({ data, postParams }).then(res => {
            //     console.log(res)
            //     this.tableData = res.data.data
            //     this.total = res.data.count
            // })
            let getParams = {
                data: {
                    system: this.systemName,
                    tab: this.major,
                    plazaId: this.$store.state.plazaId,
                    page: this.currentPage,
                    size: this.size
                }
            }
            queryWbsms(getParams).then(res => {
                this.tableData = res.data.data
                this.total = res.data.count
            })
        }
    },
    mounted() {
        this.getList()
    }
}
</script>
<style lang="less" scoped>
.wb-list {
    .eq-list-top {
        display: flex;
    }
    .foot {
        position: absolute;
        height: 32px;
        right: 26px;
    }
    td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
</style>