<template>
    <div class="app-container">
        <div>
            <el-form :inline="true" class="demo-form-inline">
                <el-form-item label="废码单编号:">
                    <span>{{FMD_id}}</span>
                </el-form-item>
                <el-form-item label="时间:">
                    <span>{{FMD_time}}</span>
                </el-form-item>
                <br>
                <el-form-item label="取码单编号:">
                    <span>{{QMD_id}}</span>
                </el-form-item>
                <!-- <el-form-item class="float-right">
                    <el-button type="danger" size="mini" icon="el-icon-download" @click="addUserDialog">下载</el-button>
                </el-form-item> -->
            </el-form>
        </div>
        <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="discard_id" label="废码单号"></el-table-column>
            <el-table-column prop="code" label="防伪码"></el-table-column>
        </el-table>
        <el-pagination
            background
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-sizes="[10, 20, 50, 100]"
            :page-size="pageSize"
            layout="total,  prev, pager, next, sizes, jumper"
            :total="total">
        </el-pagination>
    </div>
</template>
<script>
import {getDiscardDetail} from "@/api/cancel"
export default {
    name: "sendCancelDetail",
    data() {
        return {
            tableData: [],                      //表格数据
            FMD_id:this.$route.query.FMD_id || '',
            currentPage: 1,                      //当前页
            pageSize: 10,                        //每页条数
            total: 0,                            //总条数
            FMD_time:'',
            QMD_id:''
        };
    },
    mounted() {
        this.initData()
    },
    methods: {
        initData() {
            const params = {
                pageNo: this.currentPage,
                pageSize: this.pageSize,
                discard_id:this.FMD_id
            }
            getDiscardDetail(params).then(res => {
                this.tableData = res.data.list.list
                this.FMD_time = res.data.record.discardTime
                this.QMD_id = res.data.record.fetch_id
                this.total = res.data.list.total
            })
        },
        //每页条数变化
        handleSizeChange(val) {
            this.pageSize = val
            this.initData()
        },
        //当前页变化
        handleCurrentChange(val) {
            this.currentPage = val
            this.initData()
        }

    }
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.input-with-select {
    float: left;
    top: 10px;
}

.el-input {
    width: 230px;
}
</style>
