马宇豪
2023-12-19 d5f70e01396783b1d2b84b49344b6d2798eb1097
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
<template>
    <el-dialog
        :visible.sync="purchaseDetailVisible"
        :close-on-click-modal="false"
        width="70%"
        :append-to-body="true"
    >
        <div class="app-container">
            <div class="table_title">{{company}}<span v-if="timeValue!==''">({{ timeValue }})</span>进货情况</div>
            <div class="table_content">
                <el-table
                    v-loading="listLoading"
                    :key="tableKey"
                    :data="scList"
                    border
                    fit
                    highlight-current-row
                    style="width: 100%;"
                >
                    <el-table-column label="序号" type="index" align="center" width="60"/>
                    <el-table-column label="进货生产企业" prop="scCompany" align="center">
                    </el-table-column>
                    <el-table-column label="进货总数量(箱)" prop="totalcol" 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>
            </div>
        </div>
    </el-dialog>
</template>
 
<script>
    import {computePageCount} from "@/utils";
 
    export default {
        name: "index",
        data(){
            return{
                scList: [],
                timeValue: '',
                company: '',
                tableKey:'',
                listLoading:false,
                purchaseDetailVisible:false,
            }
        },
        components: {},
        methods:{
            open(data,timeRange,startTime,endTime){
                this.scList = data.scItems
                this.company = data.pifaCompany
                for(let i of this.scList){
                    i.firecracker = i.items.filter(it=>it.type === '爆竹类').length>0?i.items.filter(it=>it.type === '爆竹类')[0].boxCount:0
                    i.spray = i.items.filter(it=>it.type === '喷花类').length>0?i.items.filter(it=>it.type === '喷花类')[0].boxCount:0
                    i.rotation = i.items.filter(it=>it.type === '旋转类').length>0?i.items.filter(it=>it.type === '旋转类')[0].boxCount:0
                    i.bead = i.items.filter(it=>it.type === '吐珠类').length>0?i.items.filter(it=>it.type === '吐珠类')[0].boxCount:0
                    i.toy = i.items.filter(it=>it.type === '玩具类').length>0?i.items.filter(it=>it.type === '玩具类')[0].boxCount:0
                    i.combined = i.items.filter(it=>it.type === '组合烟花类').length>0?i.items.filter(it=>it.type === '组合烟花类')[0].boxCount:0
                    i.totalcol = i.firecracker + i.spray + i.rotation + i.bead + i.toy + i.combined
                }
                this.purchaseDetailVisible = true;
                if(timeRange){
                    this.timeValue = startTime.split(' ')[0] + '~' + endTime.split(' ')[0]
                }
 
            }
        }
    }
</script>
 
<style scoped>
    .basic_search{
        display:inline-block;
    }
    .table_title{
        font-size: 18px;
        margin-bottom: 20px;
    }
</style>