马宇豪
2024-02-23 4cfbfd1b425f7b22b876ae6cae95c4fc29ae6bfb
src/views/warehouse/components/enterpriseStock.vue
@@ -55,7 +55,7 @@
<script>
    import {computePageCount} from "@/utils";
    import {listStockDataByStorehouseId} from "../../../api/warehouse";
    import {listStockDataByStorehouseId, listStockHzDataByStorehouseId} from "../../../api/warehouse";
    export default {
        name: "index",
@@ -70,8 +70,13 @@
        },
        components: {},
        methods:{
            open(data){
            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){
@@ -87,6 +92,25 @@
                    })
                }
                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
            }
        }
    }