烟花爆竹实名登记前端
祖安之光
2026-03-09 848a45308927ea1e3a255c968e5cd5c1eb61eaaa
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<template>
    <div class="app-container">
        <div class="filter-container">
            <div style="display: block;">
                <span>企业名称:</span>
                <el-input filterable clearable v-model="listQuery.dwmc" style="width:200px" placeholder="请输入企业名称查询数据">
                </el-input>
                <el-button style="margin-left: 10px;" type="primary" @click="reset()">重置</el-button>
                <el-button style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="search()">查询
                </el-button>
 
            </div>
        </div>
        <div class="table_content" v-if="showTable">
            <el-table
                v-loading="listLoading"
                :data="tableData"
                border
                fit
                highlight-current-row
                style="width: 100%;"
            >
                <el-table-column label="序号" type="index" align="center" width="60"/>
                <el-table-column label="企业名称" prop="dwmc" align="center">】
                    <template slot-scope="scope">
                        <el-link type="primary" @click="showDetail(scope.row.dwdm)">
                            {{ scope.row.dwmc }}
                        </el-link>
                    </template>
                </el-table-column>
                <el-table-column label="库存总数(箱)" prop="stockNum" 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="launch" 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="display" align="center">
                </el-table-column>
                <el-table-column label="架子烟花类(箱)" prop="shelf" align="center">
                </el-table-column>
                <el-table-column label="组合烟花类(箱)" prop="combined" align="center">
                </el-table-column>
            </el-table>
            <br>
            <danlin-detail ref="detailRef"></danlin-detail>
        </div>
    </div>
</template>
 
 
<script>
import {getDlSaleStockTotalData} from "../../api/danling";
import {computePageCount} from "@/utils";
import Cookies from 'js-cookie'
import DanlinDetail from "./components/danlinDetail";
export default {
    name: 'retailStock',
    components: { DanlinDetail },
    data() {
        return {
            listLoading: false,
            showTable: false,
            tableData: [{
                dwmc: '',
                dwdm: '',
                firecracker: null,
                spray: null,
                rotation: null,
                launch: null,
                bead: null,
                toy: null,
                display: null,
                shelf: null,
                combined: null,
                stockNum: null
            }],
            isSupervision: Cookies.get('isSupervision'),
            listQuery: {
                dwmc: ''
            }
        }
    },
    created() {
        this.getStock()
    },
    methods: {
        search() {
            this.showTable = true
            this.getStock()
        },
        getStock() {
            this.listLoading = true
            getDlSaleStockTotalData(this.listQuery.dwmc).then(res => {
                if (res.data.code === '200') {
                    if(Array.isArray(res.data.result) && res.data.result.length > 0){
                        this.tableData[0].dwmc = res.data.result[0].dwmc
                        this.tableData[0].dwdm = res.data.result[0].dwdm
                        this.tableData[0].firecracker = (res.data.result.find(i=>i.cpdl == '110') || {}).totalNum || 0
                        this.tableData[0].spray = (res.data.result.find(i=>i.cpdl == '120') || {}).totalNum || 0
                        this.tableData[0].rotation = (res.data.result.find(i=>i.cpdl == '130') || {}).totalNum || 0
                        this.tableData[0].launch = (res.data.result.find(i=>i.cpdl == '140') || {}).totalNum || 0
                        this.tableData[0].bead = (res.data.result.find(i=>i.cpdl == '150') || {}).totalNum || 0
                        this.tableData[0].toy = (res.data.result.find(i=>i.cpdl == '160') || {}).totalNum || 0
                        this.tableData[0].display = (res.data.result.find(i=>i.cpdl == '170') || {}).totalNum || 0
                        this.tableData[0].shelf = (res.data.result.find(i=>i.cpdl == '180') || {}).totalNum || 0
                        this.tableData[0].combined = (res.data.result.find(i=>i.cpdl == '190') || {}).totalNum || 0
                        this.tableData[0].stockNum = this.tableData[0].firecracker+this.tableData[0].spray+this.tableData[0].rotation+this.tableData[0].launch+this.tableData[0].bead+this.tableData[0].toy+this.tableData[0].display+this.tableData[0].shelf+this.tableData[0].combined
                    }
                } else {
                    this.$message({
                        type: 'warning',
                        message: res.data.message
                    })
                }
            })
            .finally(res => {
                this.listLoading = false
            })
        },
        showDetail(val){
          this.$refs.detailRef.open(val,1)
        },
        reset(){
            this.showTable = false
            this.listQuery= {
                dwmc: ''
            }
            this.getStock()
        },
    }
}
</script>
 
<style scoped>
 
</style>