马宇豪
2024-02-23 4cfbfd1b425f7b22b876ae6cae95c4fc29ae6bfb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
    <el-dialog
        :visible.sync="dialogVisible"
        width="70%"
        :append-to-body="true"
        :title="title"
    >
        <div class="app-container">
            <div class="table_content">
                <el-table
                    v-loading="listLoading"
                    :key="tableKey"
                    :data="listData"
                    border
                    fit
                    highlight-current-row
                    style="width: 100%;"
                    show-summary
                >
                    <el-table-column label="企业名称" prop="enterpriseUser" align="center">
                    </el-table-column>
                    <el-table-column label="总库存" prop="totalStock" align="center">
                    </el-table-column>
                    <el-table-column label="爆竹类(箱)" prop="firecracker" align="center">
                    </el-table-column>
                    <el-table-column label="喷花类(箱)" prop="spray" align="center">
                    </el-table-column>
                    <el-table-column label="旋转类(箱)" prop="rotation" align="center">
                    </el-table-column>
                    <el-table-column label="吐珠类(箱)" prop="bead" align="center">
                    </el-table-column>
                    <el-table-column label="玩具类(箱)" prop="toy" align="center">
                    </el-table-column>
                    <el-table-column label="组合烟花类(箱)" prop="combined" align="center">
                    </el-table-column>
                </el-table>
                <br>
<!--                <el-pagination-->
<!--                    v-show="recordTotal>0"-->
<!--                    :current-page="currentPage"-->
<!--                    :page-sizes="[10, 15]"-->
<!--                    :page-size="pageSize"-->
<!--                    :total="recordTotal"-->
<!--                    layout="total, sizes, prev, pager, next, jumper"-->
<!--                    background-->
<!--                    style="float:right;"-->
<!--                    @size-change="handleSizeChange"-->
<!--                    @current-change="handleCurrentChange"-->
<!--                />-->
<!--                <br>-->
            </div>
        </div>
    </el-dialog>
</template>
 
<script>
    import {computePageCount} from "@/utils";
    import {listStockDataByStorehouseId, listStockHzDataByStorehouseId} from "../../../api/warehouse";
 
    export default {
        name: "index",
        data(){
            return{
                title:'',
                tableKey:'',
                listLoading:false,
                listData:[],
                dialogVisible:false,
            }
        },
        components: {},
        methods:{
            open(data,type){
                console.log(data,'data')
                if(type == '监管' || type == '管理'){
                    this.getList(data.id || data.storehouseId)
                }else{
                    this.getHzList(data)
                }
                this.dialogVisible = true
            },
            async getList(id){
                this.listLoading = true
                let res = await listStockDataByStorehouseId({id: id})
                if(res.data.code === "200"){
                    this.listData = res.data.result.stockDataInfos
                    this.title = '库区:'+res.data.result.reserveName +' 仓库:'+ res.data.result.storehouseName + '各企业库存情况'
                }else{
                    this.$message({
                        type:'warning',
                        message:res.data.message
                    })
                }
                this.listLoading = false
            },
            async getHzList(data){
                this.listLoading = true
                let res = await listStockHzDataByStorehouseId({sid: data.storehouseId,eid: data.gId})
                if(res.data.code === "200"){
                    if(res.data.result && res.data.result.stockDataInfos.length>0 && res.data.result.reserveName && res.data.result.storehouseName){
                        this.listData = res.data.result.stockDataInfos
                        this.title = '库区:'+res.data.result.reserveName +' 仓库:'+ res.data.result.storehouseName + '各企业库存情况'
                    }else{
                        this.listData = []
                        this.title = '暂无企业库存情况'
                    }
                }else{
                    this.$message({
                        type:'warning',
                        message:res.data.message
                    })
                }
                this.listLoading = false
            }
        }
    }
</script>
 
<style scoped>
    .basic_search{
        display:inline-block;
    }
    .table_title{
        font-size: 18px;
        margin-bottom: 20px;
    }
</style>