overviewlist.vue 11.5 KB
<template>
    <a-card :bordered="false">

        <!-- 查询区域 -->
        <div class="table-page-search-wrapper">
            <a-form layout="inline" @keyup.enter.native="searchQuery">
                <a-row :gutter="24">

                    <a-col :xl="6" :lg="7" :md="8" :sm="24">
                        <a-form-item label="部门">
                            <a-select style="width: 100%" placeholder="请选择" v-model="queryParam.select">
                                <a-select-option v-for="(role,roleindex) in dataSource" :key="role.campId"
                                    :value="role.campId">
                                    {{ role.days }}
                                </a-select-option>
                            </a-select>
                        </a-form-item>
                    </a-col>
                    <a-col :xl="6" :lg="7" :md="8" :sm="24">
                        <a-form-item label="餐点">
                            <a-select style="width: 100%" placeholder="请选择" v-model="queryParam.select">
                                <a-select-option v-for="(role,roleindex) in dataSource" :key="role.campId"
                                    :value="role.campId">
                                    {{ role.days }}
                                </a-select-option>
                            </a-select>
                        </a-form-item>
                    </a-col>
                    <a-col :xl="6" :lg="7" :md="8" :sm="24">
                        <a-form-item label="用餐时段">
                            <a-select style="width: 100%" placeholder="请选择" v-model="queryParam.select">
                                <a-select-option v-for="(role,roleindex) in dataSource" :key="role.campId"
                                    :value="role.campId">
                                    {{ role.days }}
                                </a-select-option>
                            </a-select>
                        </a-form-item>
                    </a-col>
                    <template v-if="toggleSearchStatus">
                        <a-col :xl="6" :lg="7" :md="8" :sm="24">
                            <a-form-item label="售饭机">
                                <a-select style="width: 100%" placeholder="请选择" v-model="queryParam.select">
                                    <a-select-option v-for="(role,roleindex) in dataSource" :key="role.campId"
                                        :value="role.campId">
                                        {{ role.days }}
                                    </a-select-option>
                                </a-select>
                            </a-form-item>
                        </a-col>
                        <a-col :xl="10" :lg="7" :md="8" :sm="24">
                            <a-form-item label="日期">
                                <a-date-picker v-model="queryParam.entryTime" :disabled-date="disabledStartDate"
                                    show-time format="YYYY-MM-DD HH:mm:ss" placeholder="Start"
                                    @openChange="handleStartOpenChange" />

                                <a-date-picker v-model="queryParam.qurtTime" :disabled-date="disabledEndDate" show-time
                                    format="YYYY-MM-DD HH:mm:ss" placeholder="End" :open="endOpen"
                                    @openChange="handleEndOpenChange" />
                            </a-form-item>
                        </a-col>


                    </template>
                    <a-col :xl="6" :lg="7" :md="8" :sm="24">
                        <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
                            <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                            <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置
                            </a-button>
                            <a-button type="primary" icon="download" @click="handleExportXls('Biao')"
                                style="margin-left: 8px">导出</a-button>
                            <a @click="handleToggleSearch" style="margin-left: 8px">
                                {{ toggleSearchStatus ? '收起' : '展开' }}
                                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
                            </a>
                        </span>
                    </a-col>

                </a-row>
            </a-form>
        </div>

        <!-- 图表显示区域 -->
        <div style="margin:25px" id="myChart" :style="{width: '100%', height: '400px'}"></div>

        <!-- table区域-begin -->

        <div>
            <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
                :pagination="ipagination" :loading="loading" class="j-table-force-nowrap">
            </a-table>
        </div>



    </a-card>
</template>

<script>
    import '@/assets/less/TableExpand.less'
    // import VeriDetailModal from './modules/VeriDetailModal'
    import { httpAction } from '@/api/manage'
    import { JeecgListMixin } from '@/mixins/JeecgListMixin'

    export default {
        name: "VeriDetailList",
        mixins: [JeecgListMixin],
        components: {
            // VeriDetailModal
        },
        data() {
            return {
                description: 'Biao管理页面',
                // 表头
                columns: [
                    {
                        title: '#',
                        dataIndex: '',
                        key: 'rowIndex',
                        width: 60,
                        align: "center",
                        customRender: function (t, r, index) {
                            return parseInt(index) + 1;
                        }
                    },
                    {
                        title: '日期',
                        align: "center",
                        dataIndex: 'days'
                    },
                    {
                        title: '线上销售笔数',
                        align: "center",
                        dataIndex: 'mealType'
                    },
                    {
                        title: '销售额(元)',
                        align: "center",
                        dataIndex: 'adultType'
                    },
                    {
                        title: '补贴消费(元)',
                        align: "center",
                        dataIndex: 'price'
                    },
                    {
                        title: '充值消费(元)',
                        align: "center",
                        dataIndex: 'useCon'
                    },
                    {
                        title: '线下销售笔数',
                        align: "center",
                        dataIndex: 'useSun'
                    },
                    {
                        title: '销售额总额(元)',
                        align: "center",
                        dataIndex: 'useStored'
                    },
                    {
                        title: '补贴消费(元)',
                        align: "center",
                        dataIndex: 'useWechart'
                    },
                    {
                        title: '补贴消费(元)',
                        align: "center",
                        dataIndex: 'isVeri'
                    },

                ],
                url: {
                    list: "/veri/veriDetail/list",
                    delete: "/veri/veriDetail/delete",
                    deleteBatch: "/veri/veriDetail/deleteBatch",
                    exportXlsUrl: "veri/veriDetail/exportXls",
                    importExcelUrl: "veri/veriDetail/importExcel",
                },
                endOpen: false,
            }
        },
        computed: {
            importExcelUrl: function () {
                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
            }
        },
        mounted() {
            this.drawLine();

        },
        methods: {
            disabledStartDate(startValue) {
                const endValue = this.queryParam.qurtTime;
                if (!startValue || !endValue) {
                    return false;
                }
                return startValue.valueOf() > endValue.valueOf();
            },
            disabledEndDate(endValue) {
                const startValue = this.queryParam.entryTime;
                if (!endValue || !startValue) {
                    return false;
                }
                return startValue.valueOf() >= endValue.valueOf();
            },
            handleStartOpenChange(open) {
                if (!open) {
                    this.endOpen = true;
                }
            },
            handleEndOpenChange(open) {
                this.endOpen = open;
            },

            drawLine() {
                // this.load_data = true;
                // 基于准备好的dom,初始化echarts实例
                var echarts = require('echarts');
                // 基于准备好的dom,初始化echarts实例
                var myChart = echarts.init(document.getElementById('myChart'));
                var httpurl = this.url.delete
                var method = 'get'
                httpAction(httpurl, this.queryParam, method).then((res) => {
                    for (var i = 0; i < this.tableData.length; i++) {
                        xAxisdata.push(this.tableData[i].nowDate);
                        income.push(this.tableData[i].income);
                    }
                    // 绘制图表s
                    // myChart.setOption({
                    //     title: {
                    //         text: ""
                    //     },
                    //     tooltip: {},
                    //     xAxis: {
                    //         data: xAxisdata
                    //     },
                    //      : {
                    //         // orient 设置布局方式,默认水平布局,可选值:'horizontal'(水平) ¦ 'vertical'(垂直)
                    //         orient: 'vertical',
                    //         // x 设置水平安放位置,默认全图居中,可选值:'center' ¦ 'left' ¦ 'right' ¦ {number}(x坐标,单位px)
                    //         x: 'left',
                    //         // y 设置垂直安放位置,默认全图顶端,可选值:'top' ¦ 'bottom' ¦ 'center' ¦ {number}(y坐标,单位px)
                    //         y: 'top',
                    //         data: ['微信收入', '微信支出', '微信利润'],
                    //         textStyle: {
                    //             fontSize: 14
                    //         },
                    //     },
                    //     yAxis: {
                    //         // data: [500, 1000, 1500, 2000, 2500, 3000]
                    //     },

                    //     series: [{
                    //         name: "微信收入",
                    //         type: "line",
                    //         label: {
                    //             normal: {
                    //                 show: true,
                    //                 position: "top"
                    //             }
                    //         },
                    //         data: income
                    //     }]
                    // });
                });
            },
        }
    }
</script>
<style scoped>
    @import '~@assets/less/common.less';
</style>