From 189adc4d8bb6b228d49678bc98935b6977d72359 Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: Wed, 28 Jan 2026 09:36:22 +0800
Subject: [PATCH] 丹灵数据 新增防抖

---
 src/views/danlinData/wholeSaleStock.vue          |  144 ++++++++++
 src/views/danlinData/components/danlinDetail.vue |  141 ++++++++++
 src/views/usermng/product.vue                    |   16 +
 src/views/danlinData/inOutRecord.vue             |  283 ++++++++++++++++++++
 src/views/danlinData/retailStock.vue             |  144 ++++++++++
 src/api/danling.js                               |   66 ++++
 6 files changed, 792 insertions(+), 2 deletions(-)

diff --git a/src/api/danling.js b/src/api/danling.js
new file mode 100644
index 0000000..8bf1dc7
--- /dev/null
+++ b/src/api/danling.js
@@ -0,0 +1,66 @@
+import {getToken} from "../utils/auth";
+import request from '@/utils/request'
+
+
+export function getDlSaleStockTotalData(data) {
+    return request({
+        headers:{
+            'Authorization': getToken()
+        },
+        url: process.env.BASE_API+ '/dlApi/selectSaleStockTotalData?dwmc=' + data,
+        method: 'get'
+    })
+}
+
+export function getDlSaleStockReq(data) {
+    return request({
+        headers:{
+            'Authorization': getToken()
+        },
+        url: process.env.BASE_API+ '/dlApi/selectPageDlSaleStockReq',
+        method: 'post',
+        data:data
+    })
+}
+
+export function getDlWholeSaleStockTotalData(data) {
+    return request({
+        headers:{
+            'Authorization': getToken()
+        },
+        url: process.env.BASE_API+ '/dlApi/selectWholeSaleStockTotalData?dwmc=' + data,
+        method: 'get'
+    })
+}
+
+export function getDlWholesaleStockReq(data) {
+    return request({
+        headers:{
+            'Authorization': getToken()
+        },
+        url: process.env.BASE_API+ '/dlApi/selectPageDlWholesaleStockReq',
+        method: 'post',
+        data:data
+    })
+}
+
+export function getDlPageInventoryRecord(data) {
+    return request({
+        headers:{
+            'Authorization': getToken()
+        },
+        url: process.env.BASE_API+ '/dlApi/selectPageInventoryRecord',
+        method: 'post',
+        data: data
+    })
+}
+
+export function getDlInventoryDetail(data) {
+    return request({
+        headers:{
+            'Authorization': getToken()
+        },
+        url: process.env.BASE_API+ '/dlApi/selectInventoryDetail?sjcqid=' + data,
+        method: 'get'
+    })
+}
diff --git a/src/views/danlinData/components/danlinDetail.vue b/src/views/danlinData/components/danlinDetail.vue
new file mode 100644
index 0000000..2d92df3
--- /dev/null
+++ b/src/views/danlinData/components/danlinDetail.vue
@@ -0,0 +1,141 @@
+<template>
+    <el-dialog :visible.sync="detailDialogVisible" :modal-append-to-body="false" :close-on-click-modal="false" title="库存详情"
+               width="900px">
+        <el-table v-loading="listLoading"
+                  :key="tableKey"
+                  :data="detailData"
+                  border
+                  fit
+                  highlight-current-row
+                  style="width: 100%;">
+            <el-table-column label="序号" type="index" align="center" width="60">
+            </el-table-column>
+            <el-table-column label="产品名称" prop="mc" align="center">
+            </el-table-column>
+            <el-table-column label="库存总数(箱)" prop="sl" align="center">
+            </el-table-column>
+        </el-table>
+        <br>
+        <el-pagination
+            v-show="recordTotal>0"
+            :current-page="currentPage"
+            :page-sizes="[10, 20]"
+            :page-size="pageSize"
+            :total="recordTotal"
+            layout="total, sizes, prev, pager, next, jumper"
+            background
+            style="float:right;"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+        />
+        <br>
+    </el-dialog>
+</template>
+
+<script>
+    import {getDlSaleStockReq, getDlWholesaleStockReq} from "../../../api/danling";
+    import {mapGetters} from "vuex";
+    import {computePageCount, parseTime} from "../../../utils";
+    import {parseError} from "../../../utils/messageDialog";
+
+    export default {
+        name: "danlinDetail",
+        data() {
+            return {
+                detailDialogVisible: false,
+                detailData: [],
+                listLoading: true,
+                pageSize: 10,
+                currentPage: 1,
+                recordTotal: 0,
+                pageTotal: 0,
+                tableKey: 0
+            }
+        },
+        computed: {
+            ...mapGetters([
+                'userType',
+                'username'
+            ])
+        },
+        methods: {
+            open(val,type){
+                if(type == 1){
+                    this.getRetailList(val);
+                }else{
+                    this.getWholeSaleList(val);
+                }
+                this.detailDialogVisible = true;
+
+            },
+
+            getRetailList(val) {
+                const _this = this;
+                let params = {
+                    pageIndex: _this.currentPage,
+                    pageSize: _this.pageSize,
+                    filter: {
+                        dwdm: val
+                    }
+                }
+                getDlSaleStockReq(params).then(response => {
+                    const res = response.data;
+                    if (res.code === "200") {
+                        const result = res.result;
+                        _this.recordTotal = result.total;
+                        _this.pageSize = result.size;
+                        _this.pageTotal = result.pages;
+                        _this.currentPage = result.current;
+                        _this.detailData = result.records
+                    }else {
+                        parseError({error: res.message, vm: _this})
+                    }
+                    _this.listLoading = false;
+                }).catch(error => {
+                    _this.listLoading = false;
+                    parseError({error: error, vm: _this})
+                })
+            },
+            getWholeSaleList(val) {
+                const _this = this;
+                let params = {
+                    pageIndex: _this.currentPage,
+                    pageSize: _this.pageSize,
+                    filter: {
+                        dwdm: val
+                    }
+                }
+                getDlWholesaleStockReq(params).then(response => {
+                    const res = response.data;
+                    if (res.code === "200") {
+                        const result = res.result;
+                        _this.recordTotal = result.total;
+                        _this.pageSize = result.size;
+                        _this.pageTotal = computePageCount(result.totalCount, result.pageSize);
+                        _this.currentPage = result.pages;
+                        _this.detailData = result.records
+                    }else {
+                        parseError({error: res.message, vm: _this})
+                    }
+                    _this.listLoading = false;
+                }).catch(error => {
+                    _this.listLoading = false;
+                    parseError({error: error, vm: _this})
+                })
+            },
+            handleSizeChange: function (val) {
+                this.pageSize = val;
+                this.currentPage = 1;
+                this.getDetailDataList();
+            },
+            handleCurrentChange: function (val) {
+                this.currentPage = val;
+                this.getDetailDataList();
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/views/danlinData/inOutRecord.vue b/src/views/danlinData/inOutRecord.vue
new file mode 100644
index 0000000..fe3b5f6
--- /dev/null
+++ b/src/views/danlinData/inOutRecord.vue
@@ -0,0 +1,283 @@
+<template>
+    <div class="app-container">
+        <div class="filter-container">
+            <div style="display: block;">
+                <div class="basic_search">
+                <span>企业名称:</span>
+                <el-input filterable clearable v-model="listQuery.filter.xsdwmc" style="width:200px">
+                </el-input>
+                </div>
+                <div class="basic_search">
+                    <span>按时间查询:</span>
+                    <el-date-picker
+                        value-format="yyyy-MM-dd HH:mm:ss"
+                        v-model="validTime"
+                        type="daterange"
+                        :default-time="['00:00:00','23:59:59']"
+                        :picker-options="pickerOptions"
+                        range-separator="-"
+                        start-placeholder="开始日期"
+                        end-placeholder="结束日期"
+                    >
+                    </el-date-picker>
+                </div>
+                <div class="basic_search">
+                    <span>交易类型:</span>
+                    <el-select filterable clearable v-model="listQuery.filter.jylx">
+                        <el-option
+                            v-for="item in typeList"
+                            :key="item.id"
+                            :label="item.text"
+                            :value="item.id"
+                        ></el-option>
+                    </el-select>
+                </div>
+                <div class="basic_search" style="margin-right: 10px">
+                    <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>
+        <div class="table_content">
+            <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="gmdwmc" align="center">】
+                </el-table-column>
+                <el-table-column label="销售单位名称" prop="xsdwmc" align="center">】
+                </el-table-column>
+                <el-table-column label="交易类型" prop="jylx" align="center">
+                    <template slot-scope="scope">
+                        {{scope.row.jylx == '02'?'运输出库':scope.row.jylx == '03'?'运输入库':scope.row.jylx == '08'?'零售出库':scope.row.jylx == '10'?'零散销售':'--'}}
+                    </template>
+                </el-table-column>
+                <el-table-column label="个人燃放类物品数量" prop="grsl" align="center">
+                </el-table-column>
+                <el-table-column label="专业燃放类物品数量" prop="zysl" align="center">
+                </el-table-column>
+                <el-table-column label="原材料物品数量" prop="yclsl" align="center">
+                </el-table-column>
+<!--                <el-table-column label="箱数量" prop="sl" align="center">-->
+<!--                </el-table-column>-->
+                <el-table-column label="零散数量" prop="lssl" align="center">
+                </el-table-column>
+                <el-table-column label="数据生成时间" prop="sjscsj" align="center">
+                </el-table-column>
+                <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
+                    <template slot-scope="scope">
+                        <el-button type="text" @click="showDetail(scope.row.id)">查看明细</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <br>
+            <el-pagination
+                v-show="recordTotal>0"
+                :current-page="listQuery.pageIndex"
+                :page-sizes="[10, 20]"
+                :page-size="listQuery.pageSize"
+                :total="recordTotal"
+                layout="total, sizes, prev, pager, next, jumper"
+                background
+                style="float:right;"
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+            />
+            <br>
+            <el-dialog
+                :visible.sync="detailVisible"
+                append-to-body
+                title="库存详情"
+                :close-on-click-modal="false"
+                @close="resetDetail"
+            >
+                <el-table
+                    :data="detailData"
+                    border
+                    fit
+                    highlight-current-row
+                    style="width: 100%;"
+                >
+                    <el-table-column label="序号" type="index" align="center" width="60">
+                    </el-table-column>
+                    <el-table-column label="产品名称" prop="cpmc" align="center">
+                    </el-table-column>
+                    <el-table-column label="箱数量" prop="xsl" align="center">
+                    </el-table-column>
+                    <el-table-column label="结余量" prop="jyl" align="center">
+                    </el-table-column>
+                    <el-table-column label="零散数量" prop="lssl" align="center">
+                    </el-table-column>
+                </el-table>
+
+                <div slot="footer" class="dialog-footer">
+                    <el-button  type="primary" @click="resetDetail">确认</el-button>
+                </div>
+            </el-dialog>
+        </div>
+    </div>
+</template>
+
+
+<script>
+import {computePageCount} from "@/utils";
+import Cookies from 'js-cookie'
+import {getDlInventoryDetail, getDlPageInventoryRecord} from "../../api/danling";
+
+export default {
+    name: 'retailStock',
+    data() {
+        return {
+            pageSize: 10,
+            recordTotal: 0,
+            pageTotal: 0,
+            listLoading: false,
+            tableData: [],
+            isSupervision: Cookies.get('isSupervision'),
+            validTime:['',''],
+            listQuery: {
+                pageSize: 10,
+                pageIndex: 1,
+                filter: {
+                    xsdwmc: '',
+                    jylx: null,
+                    starttime: '',
+                    endtime: ''
+                },
+            },
+            typeList: [
+                {
+                    id: '02',
+                    text: '运输出库'
+                },
+                {
+                    id: '03',
+                    text: '运输入库'
+                },
+                {
+                    id: '08',
+                    text: '零售出库'
+                },
+                {
+                    id: '10',
+                    text: '零散销售'
+                }
+            ],
+            detailVisible: false,
+            detailData: [],
+            pickerOptions: {
+                shortcuts: [{
+                    text: '最近一周',
+                    onClick(picker) {
+                        const end = new Date();
+                        const start = new Date();
+                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+                        picker.$emit('pick', [start, end]);
+                    }
+                }, {
+                    text: '最近一个月',
+                    onClick(picker) {
+                        const end = new Date();
+                        const start = new Date();
+                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+                        picker.$emit('pick', [start, end]);
+                    }
+                }]
+            }
+        }
+    },
+    created() {
+        this.initValidTime()
+        this.getStock()
+    },
+    methods: {
+        handleSizeChange(val) {
+            this.listQuery.pageSize = val
+            this.getStock()
+        },
+        handleCurrentChange(val) {
+            this.listQuery.pageIndex = val
+            this.getStock()
+        },
+        search() {
+            this.listQuery.pageIndex = 1
+            this.getStock()
+        },
+        resetDetail(){
+            this.detailData = []
+            this.detailVisible = false
+        },
+        initValidTime(){
+            const end = new Date();
+            this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00";
+            this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59";
+        },
+        getStock() {
+            this.listLoading = true
+            if( this.validTime !== null ){
+                this.listQuery.filter.starttime = this.validTime[0]
+                this.listQuery.filter.endtime = this.validTime[1]
+            }else{
+                this.listQuery.filter.starttime = ''
+                this.listQuery.filter.endtime = ''
+            }
+            getDlPageInventoryRecord(this.listQuery).then(res => {
+                if (res.data.code === '200') {
+                    this.tableData = res.data.result.records
+                    this.recordTotal = res.data.result.total
+                    this.pageTotal = res.data.result.pages
+                } else {
+                    this.$message({
+                        type: 'warning',
+                        message: res.data.message
+                    })
+                }
+            })
+            .finally(res => {
+                this.listLoading = false
+            })
+        },
+        showDetail(id){
+            getDlInventoryDetail(id).then(res => {
+                if (res.data.code === '200') {
+                    this.detailData = res.data.result
+                } else {
+                    this.$message({
+                        type: 'warning',
+                        message: res.data.message
+                    })
+                }
+            })
+            this.detailVisible = true
+        },
+        reset(){
+            this.listQuery= {
+                pageSize: 10,
+                pageIndex: 1,
+                filter: {
+                    xsdwmc: '',
+                    jylx: null,
+                    starttime: '',
+                    endtime: ''
+                },
+            }
+            this.validTime = ['','']
+            this.initValidTime()
+            this.getStock()
+        },
+    }
+}
+</script>
+
+<style scoped>
+.basic_search {
+    display: inline-block;
+}
+</style>
diff --git a/src/views/danlinData/retailStock.vue b/src/views/danlinData/retailStock.vue
new file mode 100644
index 0000000..5a2b771
--- /dev/null
+++ b/src/views/danlinData/retailStock.vue
@@ -0,0 +1,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>
diff --git a/src/views/danlinData/wholeSaleStock.vue b/src/views/danlinData/wholeSaleStock.vue
new file mode 100644
index 0000000..33cb06c
--- /dev/null
+++ b/src/views/danlinData/wholeSaleStock.vue
@@ -0,0 +1,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 {computePageCount} from "@/utils";
+import Cookies from 'js-cookie'
+import DanlinDetail from "./components/danlinDetail";
+import {getDlWholeSaleStockTotalData} from "../../api/danling";
+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
+            getDlWholeSaleStockTotalData(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,2)
+        },
+        reset(){
+            this.showTable = false
+            this.listQuery= {
+                dwmc: ''
+            }
+            this.getStock()
+        },
+    }
+}
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/views/usermng/product.vue b/src/views/usermng/product.vue
index 132f30a..9a22f0f 100644
--- a/src/views/usermng/product.vue
+++ b/src/views/usermng/product.vue
@@ -240,7 +240,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="dialogFormVisible = false">取消</el-button>
-        <el-button type="primary" @click="submitHandle">确认</el-button>
+        <el-button type="primary" @click="debouncedSubmit">确认</el-button>
       </div>
     </el-dialog>
     <div style="clear: both;"></div>
@@ -337,7 +337,10 @@
       ...mapGetters([
         'userType',
         'username'
-      ])
+      ]),
+        debouncedSubmit() {
+            return this.debounce(this.submitHandle, 1000);
+        }
     },
     methods: {
       async selectChange(){
@@ -412,6 +415,15 @@
           parseError({error: error, vm: _this})
         })
       },
+        debounce(func, wait) {
+            let timeout;
+            return (...args) => {
+                clearTimeout(timeout);
+                timeout = setTimeout(() => {
+                    func.apply(this, args);
+                }, wait);
+            };
+        },
       submitHandle:function(){
           if (this.dialogStatus === 'create') {
               this.createHandle();

--
Gitblit v1.9.2