<template>
    <el-container>
        <el-header>
            <div class="left-panel">
                <el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
            </div>
            <div class="right-panel">
                <el-date-picker
                    v-model="query.date"
                    type="date"
                    value-format="YYYY-MM-DD"
                />
                <el-button
                    type="primary"
                    icon="el-icon-search"
                    @click="handleQuery"
                >查询</el-button>
            </div>
        </el-header>
        <el-main class="nopadding">
            <scTable
                ref="table"
                :apiObj="apiObj"
                row-key="id"
                stripe
                :params="query"
            >
                <el-table-column type="index" width="50"/>
                <el-table-column label="棒编号" prop="name" show-overflow-tooltip>
                </el-table-column>
                <el-table-column label="棒最大外径/mm" prop="number">
                </el-table-column>
                <el-table-column label="锥度/mm" prop="model">
                </el-table-column>
                <el-table-column label="管编号" prop="factory" show-overflow-tooltip>
                </el-table-column>
                <el-table-column label="管最大内径/mm" prop="production_date">
                </el-table-column>
                <el-table-column label="是否合格" prop="production_date">
                    <template #default="scope">
                        <el-tag>{{ state_[scope.row.equip_state] }}</el-tag>
                    </template>
                </el-table-column>
            </scTable>
        </el-main>
    </el-container>
</template>
<script>
    export default {
        name: "rparty",
        data() {
            return {
                // apiObj: this.$API.qm.list,
                apiObj:null,
                query: {
                    page:1,
                    page_size:20,
                    type:10
                },
                selection: [],
                state_: {
                    'R': '不合格',
                    'S': '合格',
                },
            };
        },
        methods: {
            //查看
            table_show(row) {
                this.dialog.save = true;
                this.$nextTick(() => {
                    this.$refs.saveDialog.open("show",10).setData(row);
                });
            },
            handleQuery() {
                this.$refs.table.queryData(this.query)
            },
            resetQuery() {
                this.query = {};
            },
        },
    };
</script>