You need to sign in or sign up before continuing.
goodsUploadLog.vue 2.49 KB
<template>
    <div style="padding:10px">
        <div style="margin-bottom:10px">
            <el-button type="primary" icon="el-icon-refresh" size="small" :loading="loading" @click="selectLog(1)">查 询
            </el-button>
        </div>
        <Tables ref="goodsLogStation" ductName="goodsLogStation" :data="logTabelData" :headerData="logTabelHeader"
            :selection="false" :order="true" :selectFixed="false" :loading="loading" :totalCount="logCount"
            :limitSize="logData.size" :page="logData.page" layout="total,prev, pager, next, jumper, ->"
            :pageSizes="[100]" :height="tableHeight" @currentChange="logCurrentChange">
        </Tables>
    </div>
</template>

<script>
import { userImportLog } from "@/api/goodsStation"

export default {
    name: 'GoodsUploadLog',
    data() {
        return {
            logData: {
                page: 1,
                size: 50
            },
            logTabelData: [],
            logTabelHeader: this.tableHeaders['goodsLogStation'],
            logCount: 0,
            tableHeight: null,
            loading: false,
        }
    },
    created() {
        this.selectLog()
    },
    watch: {
        $route(to, from) {
            if (to.name == 'GoodsUploadLog') {
                this.selectLog()
            }
        }
    },
    methods: {
        //日志查询
        selectLog(val) {
            this.logTabelData = []
            if (val === 1) {
                this.logData.page = 1
            }
            this.loading = true
            userImportLog(this.logData).then(res => {
                this.loading = false
                if (res.code === 200) {
                    res.data.list.forEach(item => {
                        if (this.$route.params.type == 1 && item.module == '白名单导入') {
                            this.logTabelData.push(item)
                        } else if (this.$route.params.type == 2 && item.module == '黑名单导入') {
                            this.logTabelData.push(item)
                        }
                    })
                    this.logCount = this.logTabelData.length
                } else {
                    this.msgWarning(res.msg)
                }
            }).catch(err => {
                this.loading = false
                console.log(err)
            })
        },
        //日志分页
        logCurrentChange(val) {
            this.logData.page = val.page
            this.selectLog()
        },
    }
}

</script>

<style lang="scss" scoped>

</style>