<!-- 全厂电量统计 -->
<template>
    <el-container>
        <el-header>
            <div class="left-panel">
                <el-date-picker
                    v-model="search_month"
                    type="month"
                    value-format="YYYY-MM"
                    format="YYYY-MM"
                    placeholder="月份"
                    style="margin-right: 6px;"
                    @change="monthChange"
                />
                <el-button
                type="primary"
                icon="el-icon-search"
                @click="getTableData"
                ></el-button>
                <el-button
                    type="primary"
                    @click="exportExcel()"
                    :loading = "exportLoading"
					v-auth="'export_excel'"
                    >导出xlsx
                </el-button>
                <el-button
                    type="primary"
                    @click="handlePrint"
                    >打印
                </el-button>
            </div>
        </el-header>
        <el-main>
            <el-card shadow="never">
                <div class="topTableDiv">
                    <table border="1"  cellspacing="0" :key="timeStamp" id="numTable" class="myTable">
                        <thead class="myTableHead">
                            <tr>
                                <th colspan="6">生产月报</th>
                            </tr>
                            <tr>
                                <th style="width:100px">序号</th>
                                <th colspan="2" style="width:280px">项目</th>
                                <th  colspan="3" style="width:100px">月数据</th>
                            </tr>
                        </thead>
                    </table>
                </div>
                <div ref="print" id="myReport" class="printContainer" style="width: 100%;">
                    <table border="1"  cellspacing="0" :key="timeStamp" id="numTable" class="myTable">
                        <thead class="myTableHead">
                            <tr>
                                <th colspan="4">生产月报</th>
                            </tr>
                            <tr>
                                <th>序号</th>
                                <th colspan="2">项目</th>
                                <th  colspan="3">月数据</th>
                            </tr>
                        </thead>
                        <tr v-for="(item,index) in tableDatas" :key="index">
                            <td class="numCell">{{item[0]}}</td>
                            <td class="numCell" v-if="index==0" rowspan="5">{{item[1]}}</td>
                            <td class="numCell" v-else-if="index==5" rowspan="9">{{item[1]}}</td>
                            <td class="numCell" v-else-if="index==14" rowspan="11">{{item[1]}}</td>
                            <td class="numCell" v-else-if="index==25" rowspan="5">{{item[1]}}</td>
                            <td class="numCell" v-else-if="index==30" rowspan="6">{{item[1]}}</td>
                            <td class="numCell" v-else-if="index>35">{{item[1]}}</td>
                            <td class="numCell" style="width: 180px !important;">{{item[2]}}</td>
                            <td class="numCell" >{{item[3]}}</td>
                            <td class="numCell" v-if="index>38">{{item[4]}}</td>
                            <td class="numCell" v-if="index>38">{{item[5]}}</td>
                        </tr>
                    </table>
                </div>
            </el-card>
        </el-main>
    </el-container>
</template>
<script>
    export default {
        data() {
            return { 
                search_month:'',
                tableDatas:[
                    [1,'主机设备台产','立磨台产（t/h）',''],
                    [2,'主机设备台产','烘干破台产（t/h）'],
                    [3,'主机设备台产','煤磨台产（t/h）'],
                    [4,'主机设备台产','回转窑台产（t/h）'],
                    [5,'主机设备台产','水泥磨台产（t/h）'],

                    [6,'能耗','熟料月综合电耗（kW·h/t）'],
                    [7,'能耗','熟料月单位标煤耗(kgce/t)'],
                    [8,'能耗','熟料月综合能耗(kgce/t)'],
                    [9,'能耗','水泥月综合能耗(kgce/t)'],
                    [10,'能耗','月电石渣分布电耗（kW·h/t）'],
                    [11,'能耗','月生料分布电耗（kW·h/t）'],
                    [12,'能耗','月熟料分布电耗（kW·h/t）'],
                    [13,'能耗','月水泥粉磨分布电耗（kW·h/t）'],
                    [14,'能耗','月水泥包装分布电耗（kW·h/t）'],

                    
                    [15,'产量','月电石渣产量(t)'],
                    [16,'产量','月电石渣产量完成率(%)'],
                    [17,'产量','月生料产量(t)'],
                    [18,'产量','月生料产量完成率(%)'],
                    [19,'产量','月熟料产量(t)'],
                    [20,'产量','月熟料产量完成率(%)'],
                    [21,'产量','月水泥产量(t)'],
                    [22,'产量','月水泥产量完成率(%)'],
                    [23,'产量','月熟料出厂量(t)'],
                    [24,'产量','月散装水泥出厂量(t)'],
                    [25,'产量','月袋装水泥出厂量(t)'],

                    [26,'成本','月电石渣成本(元/吨)'],
                    [27,'成本','月生料成本(元/吨)'],
                    [28,'成本','月熟料成本(元/吨)'],
                    [29,'成本','月水泥粉磨成本(元/吨)'],
                    // [30,'成本','月水泥包装成本(元/吨)'],
                  
                    [30,'耗电量','月电石渣耗电量（kW·h）'],
                    [31,'耗电量','月生料耗电量（kW·h）'],
                    [32,'耗电量','月熟料耗电量（kW·h）'],
                    [33,'耗电量','月水泥粉磨耗电量（kW·h）'],
                    [34,'耗电量','月水泥包装耗电量（kW·h）'],
                    [35,'耗电量','月生活区耗电量（kW·h）'],
                ],
                year:'',
                month:'',
                year_h:'',
                month_h:'',
                year_t:'',
                month_t:'',
                dataList:{},
                nowData:[],
                tableName:'',
            };
        },
        mounted() {
            let that = this;
            var myDate = new Date();
            let year = myDate.getFullYear();
            let month = myDate.getMonth()+1;
            that.year = year;
            that.month = month;
            that.year_t = year-1;
            that.month_t = month;
            if(that.year==12){
                that.year_h = year-1;
                that.month_h = 1;
            }else{
                that.year_h = year
                that.month_h = month-1;
            }
            let month0 = that.month>9?that.month :'0'+that.month ;
            that.search_month = that.year+'-'+month0;
            this.getNowData();
            let heights = document.getElementsByClassName('el-main')[0].clientHeight-30;
            document.getElementById('myReport').style.height = heights+'px';
        },
        methods: {
            monthChange(e){
                if(e){
                    let that = this;
                    let arr = e.split('-')
                    that.year = Number(arr[0]);
                    that.month = Number(arr[1]); 
                }
                
            },
            getNowData(){
                let that = this;
                let params = {};
                params.page = 0;
                params.year_s = that.year;
                params.month_s = that.month;
                that.tableName = that.year + '_' + that.month+'-生产月报表';
                params.type = 'month_s';
                let m_goal_val = "goal_val_" + that.month
                this.$API.enm.enstat.req(params).then((res) => {  
                    let dataList = {};
					res.forEach(item => {
						let label = item.mgroup_name;
						dataList[label] = item;
					});
                    //台产
                    that.nowData[0]  =  dataList.原料磨.production_hour;
                    that.tableDatas[0][3] = dataList.原料磨.production_hour;       
                    that.nowData[1]  =  dataList.电石渣.production_hour;
                    that.tableDatas[1][3]  =  dataList.电石渣.production_hour;          
                    that.nowData[2] =  dataList.煤磨.production_hour; 
                    that.tableDatas[2][3] =  dataList.煤磨.production_hour;          
                    that.nowData[3] =  dataList.回转窑.production_hour; 
                    that.tableDatas[3][3] =  dataList.回转窑.production_hour;          
                    that.nowData[4] =  dataList.水泥磨.production_hour;
                    that.tableDatas[4][3] =  dataList.水泥磨.production_hour;
                    //能耗（kW·h/t）
                    that.nowData[5] =  dataList.回转窑.celec_consume_unit;
                    that.tableDatas[5][3] =  dataList.回转窑.celec_consume_unit;
                    that.nowData[6] =  dataList.回转窑.coal_consume_unit;
                    that.tableDatas[6][3] =  dataList.回转窑.coal_consume_unit;
                    that.nowData[7] =  dataList.回转窑.cen_consume_unit;
                    that.tableDatas[7][3] =  dataList.回转窑.cen_consume_unit;
                    that.nowData[8] =  dataList.水泥磨.cen_consume_unit;
                    that.tableDatas[8][3] =  dataList.水泥磨.cen_consume_unit;
                    that.nowData[9] =  dataList.电石渣.elec_consume_unit;
                    that.tableDatas[9][3] =  dataList.电石渣.elec_consume_unit;
                    that.nowData[10] =  dataList.原料磨.elec_consume_unit;
                    that.tableDatas[10][3] =  dataList.原料磨.elec_consume_unit;
                    that.nowData[11] =  dataList.回转窑.elec_consume_unit;
                    that.tableDatas[11][3] =  dataList.回转窑.elec_consume_unit;
                    that.nowData[12] =  dataList.水泥磨.elec_consume_unit;
                    that.tableDatas[12][3] =  dataList.水泥磨.elec_consume_unit;
                    that.nowData[13] =  dataList.水泥包装.elec_consume_unit;
                    that.tableDatas[13][3] =  dataList.水泥磨.elec_consume_unit;
                    //产量(t)
                    that.nowData[14] =  dataList.电石渣.total_production;
                    that.tableDatas[14][3] =  dataList.电石渣.total_production;
                    that.nowData[16] =  dataList.原料磨.total_production;
                    that.tableDatas[16][3] =  dataList.原料磨.total_production;
                    that.nowData[18] =  dataList.回转窑.total_production;
                    that.tableDatas[18][3] =  dataList.回转窑.total_production;
                    that.nowData[20] =  dataList.水泥磨.total_production;
                    that.tableDatas[20][3] =  dataList.水泥磨.total_production;
                    
                    //成本(元/吨)
                    that.nowData[25] =  dataList.电石渣.production_cost_unit;
                    that.tableDatas[25][3] = dataList.电石渣.production_cost_unit;
                    that.nowData[26] =  dataList.原料磨.production_cost_unit;
                    that.tableDatas[26][3] = dataList.原料磨.production_cost_unit;
                    that.nowData[27] =  dataList.回转窑.production_cost_unit;
                    that.tableDatas[27][3] = dataList.回转窑.production_cost_unit;
                    that.nowData[28] =  dataList.水泥磨.production_cost_unit; 
                    that.tableDatas[28][3] = dataList.水泥磨.production_cost_unit; 
                    that.nowData[29] =  dataList.水泥包装.production_cost_unit;
                    that.tableDatas[29][3] = dataList.水泥包装.production_cost_unit;
                    //耗电量（kW·h）
                    // that.nowData[30] =  dataList.电石渣.elec_consume;
                    // that.tableDatas[30][3] = dataList.电石渣.elec_consume;
                    that.nowData[30] =  dataList.原料磨.elec_consume;
                    that.tableDatas[30][3] = dataList.原料磨.elec_consume;
                    that.nowData[31] =  dataList.回转窑.elec_consume;
                    that.tableDatas[31][3] = dataList.回转窑.elec_consume;
                    // that.nowData[36] =  dataList.煤磨.elec_consume; 
                    // that.tableDatas[36][3] = dataList.煤磨.elec_consume;
                    that.nowData[32] =  dataList.水泥磨.elec_consume; 
                    that.tableDatas[32][3] = dataList.水泥磨.elec_consume; 
                    that.nowData[33] =  dataList.水泥包装.elec_consume; 
                    that.tableDatas[33][3] = dataList.水泥包装.elec_consume; 
                    that.nowData[34] =  dataList.生活区.elec_consume;
                    that.tableDatas[34][3] = dataList.生活区.elec_consume; 
                }).then(res=>{
                    //获取月和年目标
                    let params1 = {};
                    params1.page = 0;
                    params1.goal_cate__code = 'total_production';
                    params1.year = that.year;
                    
                    console.log('m_goal_val', m_goal_val)
                    this.$API.mtm.goal.list.req(params1).then((res1) => {
                        let dataList1 = {};//目标
                        res1.forEach(item1 => {
                            let label = item1.mgroup_name;
                            dataList1[label] = item1;
                        });
                       
                        that.nowData[15] =  dataList1.电石渣&&dataList1.电石渣[m_goal_val]!==0&&dataList1.电石渣[m_goal_val]!==''&&that.nowData[14]!==''?(that.nowData[14] /dataList1.电石渣[m_goal_val])*100:'/';
                        that.tableDatas[15][3] =  dataList1.电石渣&&dataList1.电石渣[m_goal_val]!==0&&dataList1.电石渣[m_goal_val]!==''&&that.nowData[14]!==''?((that.nowData[14] /dataList1.电石渣[m_goal_val])*100).toFixed(2):'/';
                        that.nowData[17] =  dataList1.原料磨&&dataList1.原料磨[m_goal_val]!==0&&dataList1.原料磨[m_goal_val]!==''&&that.nowData[14]!==''?(that.nowData[16] /dataList1.原料磨[m_goal_val])*100:'/';
                        that.tableDatas[17][3] =  dataList1.原料磨&&dataList1.原料磨[m_goal_val]!==0&&dataList1.原料磨[m_goal_val]!==''&&that.nowData[14]!==''?((that.nowData[16] /dataList1.原料磨[m_goal_val])*100).toFixed(2):'/';
                        that.nowData[19] =  dataList1.回转窑&&dataList1.回转窑[m_goal_val]!==0&&dataList1.回转窑[m_goal_val]!==''&&that.nowData[14]!==''?(that.nowData[18] /dataList1.回转窑[m_goal_val])*100:'/';
                        that.tableDatas[19][3] =  dataList1.回转窑&&dataList1.回转窑[m_goal_val]!==0&&dataList1.回转窑[m_goal_val]!==''&&that.nowData[14]!==''?((that.nowData[18] /dataList1.回转窑[m_goal_val])*100).toFixed(2):'/';
                        that.nowData[21] =  dataList1.水泥磨&&dataList1.水泥磨[m_goal_val]!==0&&dataList1.水泥磨[m_goal_val]!==''&&that.nowData[14]!==''?(that.nowData[20] /dataList1.水泥磨[m_goal_val])*100:'/';
                        that.tableDatas[21][3] =  dataList1.水泥磨&&dataList1.水泥磨[m_goal_val]!==0&&dataList1.水泥磨[m_goal_val]!==''&&that.nowData[14]!==''?((that.nowData[20] /dataList1.水泥磨[m_goal_val])*100).toFixed(2):'/';
                    })
                }).then(res=>{
                    let obj1 = {};
                    obj1.page = 0;
                    obj1.year_s = this.year;
                    obj1.month_s =  this.month;
                    obj1.type = 'month_s';
                    that.$API.enm.enstat2.req(obj1).then((res1) => {
                        if(res1.length>0){
                            that.nowData[22]=res1[0].bulk_clinker_val;
                            that.tableDatas[22][3]=res1[0].bulk_clinker_val;
                            that.nowData[23] = res1[0].bulk_cement_val;
                            that.tableDatas[23][3] = res1[0].bulk_cement_val;
                            that.nowData[24] = res1[0].bag_cement_val;
                            that.tableDatas[24][3] = res1[0].bag_cement_val;
                        }
                    }).then(res=>{
                    // this.getHuanbiData();
                })});
            },
            canCompute(a,b){
                        debugger;
                        if(b!=0&&b!=='/'&&b!==''&&b!==null){
                            if(a!=='/'&&a!==''&&a!==null){
                                a= Number(a)
                                b= Number(b)
                                let num =((a-b)/b*100).toFixed(2)
                                return num
                            }
                        }else{
                            return 0
                        }
                    },
            // getHuanbiData(){
            //     let that = this;
            //     let params = {};
            //     params.page = 0;
            //     params.year_s = that.year_h;
            //     params.month_s = that.month_h;
            //     let m_goal_val = "goal_val_" + that.month
            //     params.type = 'month_s';
            //     this.$API.enm.enstat.req(params).then((res) => {  
            //         let dataList = {};
			// 		res.forEach(item => {
			// 			let label = item.mgroup_name;
			// 			dataList[label] = item;
			// 		});
                    
            //         //台产
            //         that.tableDatas[0][4] = this.canCompute(that.nowData[0],dataList.原料磨.production_hour);         
            //         that.tableDatas[1][4] =  this.canCompute(that.nowData[1],dataList.电石渣.production_hour);           
            //         that.tableDatas[2][4] =  this.canCompute(that.nowData[2],dataList.煤磨.production_hour);           
            //         that.tableDatas[3][4] =  this.canCompute(that.nowData[3],dataList.回转窑.production_hour);           
            //         that.tableDatas[4][4] =  this.canCompute(that.nowData[4],dataList.水泥磨.production_hour);
            //         //能耗（kW·h/t）
            //         that.tableDatas[5][4] =  this.canCompute(that.nowData[5],dataList.回转窑.celec_consume_unit);
            //         that.tableDatas[6][4] =  this.canCompute(that.nowData[6],dataList.回转窑.coal_consume_unit);
            //         that.tableDatas[7][4] =  this.canCompute(that.nowData[7],dataList.回转窑.cen_consume_unit);
            //         that.tableDatas[8][4] =  this.canCompute(that.nowData[8],dataList.水泥磨.cen_consume_unit);
            //         that.tableDatas[9][4] =  this.canCompute(that.nowData[9],dataList.电石渣.elec_consume_unit);
            //         that.tableDatas[10][4] = this.canCompute(that.nowData[10],dataList.原料磨.elec_consume_unit);
            //         that.tableDatas[11][4] = this.canCompute(that.nowData[11],dataList.回转窑.elec_consume_unit);
            //         that.tableDatas[12][4] = this.canCompute(that.nowData[12],dataList.水泥磨.elec_consume_unit);
            //         that.tableDatas[13][4] = this.canCompute(that.nowData[13], dataList.水泥包装.elec_consume_unit);
            //         //产量(t)
            //         that.tableDatas[14][4] =  this.canCompute(that.nowData[14],dataList.电石渣.total_production);
            //         that.tableDatas[16][4] =  this.canCompute(that.nowData[16],dataList.原料磨.total_production);
            //         that.tableDatas[18][4] =  this.canCompute(that.nowData[18],dataList.回转窑.total_production);
            //         that.tableDatas[20][4] =  this.canCompute(that.nowData[20],dataList.水泥磨.total_production);
            //         //成本(元/吨)
            //         that.tableDatas[25][4] =  this.canCompute(that.nowData[25],dataList.电石渣.production_cost_unit);
            //         that.tableDatas[26][4] =  this.canCompute(that.nowData[26],dataList.原料磨.production_cost_unit);
            //         that.tableDatas[27][4] =  this.canCompute(that.nowData[27],dataList.回转窑.production_cost_unit);
            //         that.tableDatas[28][4] =  this.canCompute(that.nowData[28],dataList.水泥磨.production_cost_unit); 
            //         that.tableDatas[29][4] =  this.canCompute(that.nowData[29],dataList.水泥包装.production_cost_unit);
            //         //耗电量（kW·h）
            //         // that.tableDatas[30][4] =  this.canCompute(that.nowData[30],dataList.电石渣.elec_consume);
            //         that.tableDatas[30][4] =  this.canCompute(that.nowData[30],dataList.原料磨.elec_consume);
            //         that.tableDatas[31][4] =  this.canCompute(that.nowData[31],dataList.回转窑.elec_consume);
            //         that.tableDatas[32][4] =  this.canCompute(that.nowData[32],dataList.水泥磨.elec_consume); 
            //         that.tableDatas[33][4] =  this.canCompute(that.nowData[33],dataList.水泥包装.elec_consume); 
            //         that.tableDatas[34][4] =  this.canCompute(that.nowData[34],dataList.生活区.elec_consume); 
            //         // that.tableDatas[39][3] =  dataList.生活区.elec_consume;
            //     }).then(res=>{
            //         //获取月和年目标
            //         let params1 = {};
            //         params1.page = 0;
            //         params1.goal_cate__code = 'total_production';
            //         params1.year = that.year_h;
            //         this.$API.mtm.goal.list.req(params1).then((res1) => {
            //             let dataList1 = {};//目标
            //             res1.forEach(item1 => {
            //                 let label = item1.mgroup_name;
            //                 dataList1[label] = item1;
            //             });
            //             that.tableDatas[15][4] =  dataList1.电石渣&&dataList1.电石渣[m_goal_val]!==0&&dataList1.电石渣[m_goal_val]!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[14][4] /dataList1.电石渣[m_goal_val])*100).toFixed(2):'/';
            //             that.tableDatas[17][4] =  dataList1.原料磨&&dataList1.原料磨[m_goal_val]!==0&&dataList1.原料磨[m_goal_val]!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[16][4] /dataList1.原料磨[m_goal_val])*100).toFixed(5):'/';
            //             that.tableDatas[19][4] =  dataList1.回转窑&&dataList1.回转窑[m_goal_val]!==0&&dataList1.回转窑[m_goal_val]!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[18][4] /dataList1.回转窑[m_goal_val])*100).toFixed(2):'/';
            //             that.tableDatas[21][4] =  dataList1.水泥磨&&dataList1.水泥磨[m_goal_val]!==0&&dataList1.水泥磨[m_goal_val]!==''&&that.tableDatas[14][4]!==''?((that.tableDatas[20][4] /dataList1.水泥磨[m_goal_val])*100).toFixed(2):'/';
            //         })
            //     }).then(res=>{
            //         let obj1 = {};
            //         obj1.page = 0;
            //         obj1.year_s = this.year_h;
            //         obj1.month_s =  this.month_h;
            //         obj1.type = 'month_s';
            //         that.$API.enm.enstat2.req(obj1).then((res1) => {
            //             if(res1.length>0){
            //                 that.tableDatas[22][4]= this.canCompute(that.nowData[22],res1[0].clinker_val);     
            //                 that.tableDatas[23][4] = this.canCompute(that.nowData[23],res1[0].bulk_cement_val);
            //                 that.tableDatas[24][4] = this.canCompute(that.nowData[24],res1[0].bag_cement_val);
            //             }
            //         }).then(res=>{
            //         this.getTongbiData();
            //     })});
            // },
            // getTongbiData(){
            //     let that = this;
            //     let params = {};
            //     params.page = 0;
            //     params.year_s = that.year_t;
            //     params.month_s = that.month_t;
            //     let m_goal_val = "goal_val_" + that.month
            //     params.type = 'month_s';
            //     this.$API.enm.enstat.req(params).then((res) => {  
            //         if (res.length>0){
            //             let dataList = {};
            //             res.forEach(item => {
            //                 let label = item.mgroup_name;
            //                 dataList[label] = item;
            //             });   
            //         //台产
            //         that.tableDatas[0][5] = this.canCompute(that.nowData[0],dataList.原料磨.production_hour);         
            //         that.tableDatas[1][5] =  this.canCompute(that.nowData[1],dataList.电石渣.production_hour);           
            //         that.tableDatas[2][5] =  this.canCompute(that.nowData[2],dataList.煤磨.production_hour);           
            //         that.tableDatas[3][5] =  this.canCompute(that.nowData[3],dataList.回转窑.production_hour);           
            //         that.tableDatas[4][5] =  this.canCompute(that.nowData[4],dataList.水泥磨.production_hour);
            //         //能耗（kW·h/t）
            //         that.tableDatas[5][5] =  this.canCompute(that.nowData[5],dataList.回转窑.celec_consume_unit);
            //         that.tableDatas[6][5] =  this.canCompute(that.nowData[6],dataList.回转窑.coal_consume_unit);
            //         that.tableDatas[7][5] =  this.canCompute(that.nowData[7],dataList.回转窑.cen_consume_unit);
            //         that.tableDatas[8][5] =  this.canCompute(that.nowData[8],dataList.水泥磨.cen_consume_unit);
            //         that.tableDatas[9][5] =  this.canCompute(that.nowData[9],dataList.电石渣.elec_consume_unit);
            //         that.tableDatas[10][5] = this.canCompute(that.nowData[10],dataList.原料磨.elec_consume_unit);
            //         that.tableDatas[11][5] = this.canCompute(that.nowData[11],dataList.回转窑.elec_consume_unit);
            //         that.tableDatas[12][5] = this.canCompute(that.nowData[12],dataList.水泥磨.elec_consume_unit);
            //         that.tableDatas[13][5] = this.canCompute(that.nowData[13], dataList.水泥包装.elec_consume_unit);
            //         //产量(t)
            //         that.tableDatas[14][5] =  this.canCompute(that.nowData[14],dataList.电石渣.total_production);
            //         that.tableDatas[16][5] =  this.canCompute(that.nowData[16],dataList.原料磨.total_production);
            //         that.tableDatas[18][5] =  this.canCompute(that.nowData[18],dataList.回转窑.total_production);
            //         that.tableDatas[20][5] =  this.canCompute(that.nowData[20],dataList.水泥磨.total_production);
            //         //成本(元/吨)
            //         that.tableDatas[25][5] =  this.canCompute(that.nowData[25],dataList.电石渣.production_cost_unit);
            //         that.tableDatas[26][5] =  this.canCompute(that.nowData[26],dataList.原料磨.production_cost_unit);
            //         that.tableDatas[27][5] =  this.canCompute(that.nowData[27],dataList.回转窑.production_cost_unit);
            //         that.tableDatas[28][5] =  this.canCompute(that.nowData[28],dataList.水泥磨.production_cost_unit); 
            //         that.tableDatas[29][5] =  this.canCompute(that.nowData[29],dataList.水泥包装.production_cost_unit);
            //         //耗电量（kW·h）
            //         // that.tableDatas[30][5] =  this.canCompute(that.nowData[30],dataList.电石渣.elec_consume);
            //         that.tableDatas[30][5] =  this.canCompute(that.nowData[30],dataList.原料磨.elec_consume);
            //         that.tableDatas[31][5] =  this.canCompute(that.nowData[31],dataList.回转窑.elec_consume);
            //         that.tableDatas[32][5] =  this.canCompute(that.nowData[32],dataList.水泥磨.elec_consume); 
            //         that.tableDatas[33][5] =  this.canCompute(that.nowData[33],dataList.水泥包装.elec_consume); 
            //         that.tableDatas[34][5] =  this.canCompute(that.nowData[34],dataList.生活区.elec_consume);  
            //         }
            //         // that.tableDatas[39][4] =  dataList.生活区.elec_consume;
            //     }).then(res=>{
            //         //获取月和年目标
            //         let params1 = {};
            //         params1.page = 0;
            //         params1.goal_cate__code = 'total_production';
            //         params1.year = that.year_h;
            //         this.$API.mtm.goal.list.req(params1).then((res1) => {
            //             let dataList1 = {};//目标
            //             res1.forEach(item1 => {
            //                 let label = item1.mgroup_name;
            //                 dataList1[label] = item1;
            //             });
            //             that.tableDatas[15][5] =  dataList1.电石渣&&dataList1.电石渣[m_goal_val]!==0&&dataList1.电石渣[m_goal_val]!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[14][5] /dataList1.电石渣[m_goal_val])*100:'';
            //             that.tableDatas[17][5] =  dataList1.原料磨&&dataList1.原料磨[m_goal_val]!==0&&dataList1.原料磨[m_goal_val]!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[16][5] /dataList1.原料磨[m_goal_val])*100:'';
            //             that.tableDatas[19][5] =  dataList1.回转窑&&dataList1.回转窑[m_goal_val]!==0&&dataList1.回转窑[m_goal_val]!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[18][5] /dataList1.回转窑[m_goal_val])*100:'';
            //             that.tableDatas[21][5] =  dataList1.水泥磨&&dataList1.水泥磨[m_goal_val]!==0&&dataList1.水泥磨[m_goal_val]!==''&&that.tableDatas[14][5]!==''&&that.tableDatas[14][5]!==undefined?(that.tableDatas[20][5] /dataList1.水泥磨[m_goal_val])*100:'';
            //         })
            //     }).then(res=>{
            //         let obj1 = {};
            //         obj1.page = 0;
            //         obj1.year_s = this.year_t;
            //         obj1.month_s =  this.month_h;
            //         obj1.type = 'month_s';
            //         that.$API.enm.enstat2.req(obj1).then((res1) => {
            //             if(res1.length>0){
            //                 that.tableDatas[22][5]= this.canCompute(that.nowData[22],res1[0].clinker_val);
            //                 that.tableDatas[23][5] = this.canCompute(that.nowData[23],res1[0].bulk_cement_val);
            //                 that.tableDatas[24][5] = this.canCompute(that.nowData[24],res1[0].bag_cement_val);
            //             }
            //         })
            //     })
            // },
            getTableData(){
                // for(let i=0;i<39;i++){
                //     this.tableDatas[i][3] = '';
                //     this.tableDatas[i][4] = '';
                // }
                this.getNowData();
            },
            handlePrint() {
                this.$PRINT('#myReport');
            },
            exportExcel() {
            this.exportLoading = true;
            this.$XLSX('#myReport', this.tableName)
            this.exportLoading = false;
            },
        }
    };
</script>
<style scoped>
.topTableDiv{
    position: absolute;
}
#myReport{
    overflow-y: scroll;
}
</style>