| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345 | <template>  <div class="app-container1">    <div class="search">      <el-date-picker v-model="tab.table.getdataListParm.parammaps.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />      <el-button class="el-icon-arrow-left elIconArrowLeft" @click="handleBefore" />      <el-button class="el-icon-arrow-right elIconArrowRight" @click="handleNext" />      <el-button class="successBorder" @click="handleSearch">查询</el-button>      <el-button class="export" @click="handleDownload">导出</el-button>      <svg-icon icon-class="Up" class="down" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpChart" />    </div>    <div id="table" class="table">      <el-table        :key="tab.table.tableKey"        v-loading="tab.table.listLoading"        element-loading-text="给我一点时间"        :data="tab.table.list"        border        fit        highlight-current-row        style="width: 100%;"        :row-style="rowStyle"        :cell-style="tableCellStyle"        class="elTable table-fixed"      >        <el-table-column label="牧场" min-width="110px" align="center">          <template slot-scope="{row}">            <a @click="clickPasture(row)">{{ row.pasturename }}</a>          </template>        </el-table-column>        <el-table-column label="实际牛头数" min-width="90px" align="center" prop="实际牛头数" />        <el-table-column label="应混料量(kg)" min-width="90px" align="center" prop="应混料量" />        <el-table-column label="实际混料量(kg)" min-width="90px" align="center" prop="实际混料量" />        <el-table-column label="撒料量(kg)" min-width="90px" align="center" prop="撒料量" />        <el-table-column label="混料时间" min-width="90px" align="center" prop="混料时间" />        <el-table-column label="转投剩料量(kg)" min-width="90px" align="center" prop="转投剩料量" />        <el-table-column label="今日剩料量(kg)" min-width="90px" align="center" prop="今日剩料量" />        <el-table-column label="剩料率(%)" min-width="90px" align="center" prop="剩料率" />        <el-table-column label="TMR干物质(%)" min-width="90px" align="center" prop="TMR干物质" />        <el-table-column label="配方干物质采食量(kg/头)" min-width="90px" align="center" prop="配方干物质采食量" />        <el-table-column label="实际干物质采食量(kg/头)" min-width="90px" align="center" prop="实际干物质采食量" />        <el-table-column label="采食率(%)" min-width="90px" align="center" prop="采食率" />        <el-table-column label="配方成本(元/头)" min-width="90px" align="center" prop="配方成本" />        <el-table-column label="实际成本(元/头)" min-width="90px" align="center" prop="实际成本" />        <el-table-column label="产奶量(kg/头)" min-width="90px" align="center" prop="产奶量" />        <el-table-column label="饲料转化率" min-width="90px" align="center" prop="饲料转化率" />        <el-table-column label="公斤奶饲料成本" min-width="90px" align="center" prop="公斤奶饲料成本" />      </el-table>      <!-- <pagination v-show="tab.table.total>=0" :total="tab.table.total" :page.sync="tab.table.getdataListParm.offset" :limit.sync="tab.table.getdataListParm.pagecount" @pagination="getList" /> -->    </div>    <div class="AnalysisChart">      <el-row :gutter="10">        <el-col :span="24" style="margin-bottom: 10px;margin-top: 10px;">          <span>图表查询时间:</span>          <el-date-picker v-model="tab.chartDate" :clearable="false" style="margin-left: 10px;width: 250px;margin-right: 10px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />          <el-button class="successBorder" @click="handleChartDate">确认</el-button>          <svg-icon icon-class="Up" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpTop" />        </el-col>      </el-row>      <el-row :gutter="10" class="dashboard-editor-container">        <!-- 泌乳牛干物质采食量 -->        <el-col :span="12">          <div class="grid-content">            <h4>泌乳牛干物质采食量</h4>            <div v-if="tab.chart1.isChart" class="button">              <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart1')" />              <div class="exportTable" @click="handleExport('chart1')">导出</div>              <div class="exportTable" @click="handleTable('chart1')">切换表格</div>            </div>            <div v-if="tab.chart1.isChart" id="chartLine1" style="width:100%;height:400px;" />            <div v-if="tab.chart1.isTable" class="table">              <div class="button">                <div class="exportTable" @click="handleExport('chart1')">导出</div>                <div class="exportTable" @click="handleChart('chart1')">切换图表</div>              </div>              <el-table                :key="tab.chart1.table.tableKey"                v-loading="tab.chart1.table.listLoading"                element-loading-text="给我一点时间"                :data="tab.chart1.table.list"                border                fit                highlight-current-row                style="width: 100%;"                height="400"                :row-style="rowStyle"                :cell-style="cellStyle"                class="elTable table-fixed"              >                <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />                <el-table-column label="泌乳牛采食量(kg)" sortable min-width="110px" align="center" prop="field1" />                <el-table-column label="泌乳牛产奶量(kg)" sortable min-width="110px" align="center" prop="field2" />              </el-table>            </div>          </div>        </el-col>        <!-- 剩料率 -->        <el-col :span="12">          <div class="grid-content">            <h4>剩料率</h4>            <div v-if="tab.chart2.isChart" class="button">              <el-date-picker v-model="tab.chart2.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart2')" />              <div class="exportTable" @click="handleExport('chart2')">导出</div>              <div class="exportTable" @click="handleTable('chart2')">切换表格</div>            </div>            <div v-if="tab.chart2.isChart" id="chartLine2" style="width:100%;height:400px;" />            <div v-if="tab.chart2.isTable" class="table">              <div class="button">                <div class="exportTable" @click="handleExport('chart2')">导出</div>                <div class="exportTable" @click="handleChart('chart2')">切换图表</div>              </div>              <el-table                :key="tab.chart2.table.tableKey"                v-loading="tab.chart2.table.listLoading"                element-loading-text="给我一点时间"                :data="tab.chart2.table.list"                border                fit                highlight-current-row                style="width: 100%;"                height="400"                :row-style="rowStyle"                :cell-style="cellStyle"                class="elTable table-fixed"              >                <el-table-column label="日期" sortable min-width="110px" align="center" prop="日期" />                <el-table-column label="栏舍名称" sortable min-width="110px" align="center" prop="名称" />                <el-table-column label="剩料量" sortable min-width="110px" align="center" prop="剩料量" />                <el-table-column label="撒料量" sortable min-width="110px" align="center" prop="撒料量" />                <el-table-column label="剩料率" sortable min-width="110px" align="center" prop="准确率" />              </el-table>            </div>          </div>        </el-col>      </el-row>      <el-row :gutter="10" class="dashboard-editor-container">        <!-- 混料时间统计 -->        <el-col :span="12">          <div class="grid-content">            <h4>混料时间统计</h4>            <div v-if="tab.chart3.isChart" class="button">              <el-date-picker v-model="tab.chart3.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart1')" />              <div class="exportTable" @click="handleExport('chart3')">导出</div>              <div class="exportTable" @click="handleTable('chart3')">切换表格</div>            </div>            <div v-if="tab.chart3.isChart" id="chartLine3" style="width:100%;height:400px;" />            <div v-if="tab.chart3.isTable" class="table">              <div class="button">                <div class="exportTable" @click="handleExport('chart3')">导出</div>                <div class="exportTable" @click="handleChart('chart3')">切换图表</div>              </div>              <el-table                :key="tab.chart3.table.tableKey"                v-loading="tab.chart3.table.listLoading"                element-loading-text="给我一点时间"                :data="tab.chart3.table.list"                border                fit                highlight-current-row                style="width: 100%;"                height="400"                :row-style="rowStyle"                :cell-style="cellStyle"                class="elTable table-fixed"              >                <el-table-column label="日期" min-width="110px" align="center" prop="日期" />                <el-table-column label="混料时间(分钟)" min-width="110px" align="center" prop="field1" />              </el-table>            </div>          </div>        </el-col>        <!-- 转化率 -->        <el-col :span="12" style="position: relative;">          <div class="grid-content">            <h4>转化率</h4>            <div v-if="tab.chart4.isChart" class="button">              <el-date-picker v-model="tab.chart4.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart1')" />              <div class="exportTable" @click="handleExport('chart4')">导出</div>              <div class="exportTable" @click="handleTable('chart4')">切换表格</div>            </div>            <div v-if="tab.chart4.isChart" id="chartLine4" style="width:100%;height:400px;" />            <div v-if="tab.chart4.isTable" class="table">              <div class="button">                <div class="exportTable" @click="handleExport('chart4')">导出</div>                <div class="exportTable" @click="handleChart('chart4')">切换图表</div>              </div>              <el-table                :key="tab.chart4.table.tableKey"                v-loading="tab.chart4.table.listLoading"                element-loading-text="给我一点时间"                :data="tab.chart4.table.list"                border                fit                highlight-current-row                style="width: 100%;"                height="430"                :row-style="rowStyle"                :cell-style="cellStyle"                class="elTable table-fixed"              >                <el-table-column label="日期" min-width="110px" align="center" prop="日期" />                <el-table-column label="配方名称" min-width="110px" align="center" prop="名称" />                <el-table-column label="饲料转化率" min-width="110px" align="center" prop="准确率" />              </el-table>            </div>          </div>        </el-col>      </el-row>      <el-row :gutter="10" class="dashboard-editor-container">        <!-- 成本分析 -->        <el-col :span="24">          <div class="grid-content">            <h4>成本分析</h4>            <div v-if="tab.chart5.isChart" class="button">              <el-date-picker v-model="tab.chart5.getdataListParm.parammaps.inputDatetime" style="width: 250px;" class="inputDatetime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions" @change="changeChartDate('chart1')" />              <div class="exportTable" @click="handleExport('chart5')">导出</div>              <div class="exportTable" @click="handleTable('chart5')">切换表格</div>            </div>            <div v-if="tab.chart5.isChart" id="chartLine5" style="width:100%;height:400px;" />            <div v-if="tab.chart5.isTable" class="table">              <div class="button">                <div class="exportTable" @click="handleExport('chart5')">导出</div>                <div class="exportTable" @click="handleChart('chart5')">切换图表</div>              </div>              <el-table                :key="tab.chart5.table.tableKey"                v-loading="tab.chart5.table.listLoading"                element-loading-text="给我一点时间"                :data="tab.chart5.table.list"                border                fit                highlight-current-row                style="width: 100%;"                height="430"                :row-style="rowStyle"                :cell-style="cellStyle"                class="elTable table-fixed"              >                <el-table-column label="日期" min-width="110px" align="center" prop="日期" />                <el-table-column label="牲畜类别" min-width="110px" align="center" prop="名称" />                <el-table-column label="公斤奶饲料成本(元)" min-width="110px" align="center" prop="准确率" />              </el-table>            </div>          </div>        </el-col>      </el-row>    </div>    <el-dialog :title="textMap[pasture.dialogStatus]" :destroy-on-close="true" :visible.sync="pasture.dialogFormVisible" :close-on-click-modal="false" width="90%">      <div class="app-pasture">        <div class="search">          <span style="margin-left: 10px;">统计类型:</span>          <el-radio v-model="pasture.radio" label="1" @change="changeRadio">配方</el-radio>          <el-radio v-model="pasture.radio" label="2" @change="changeRadio">栏舍</el-radio>          <el-radio v-model="pasture.radio" label="3" @change="changeRadio">牲畜类别</el-radio>          <el-input v-if="pasture.isFormulaName" v-model="pasture.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 245px;" placeholder="配方模板" />          <el-input v-if="pasture.isHouseName" v-model="pasture.table.getdataListParm.parammaps.barname" class="filter-item" style="width: 150px;" placeholder="栏舍" />          <el-input v-if="pasture.isHouseName" v-model="pasture.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 150px;" placeholder="配方模板" />          <el-input v-if="pasture.isLivestockType" v-model="pasture.table.getdataListParm.parammaps.cowclass" class="filter-item" style="width: 150px;" placeholder="牲畜类别" />          <el-button class="successBorder" @click="handlePastureSearch">查询</el-button>        </div>        <div class="table">          <el-table            :key="pasture.table.tableKey"            v-loading="pasture.table.listLoading"            element-loading-text="给我一点时间"            :data="pasture.table.list"            border            fit            highlight-current-row            style="width: 100%;"            :row-style="rowStyle"            :cell-style="cellStyle"            class="elTable table-fixed"          >            <el-table-column v-if="pasture.isFormulaName" label="配方模板" min-width="110px" align="center" prop="配方模板" />            <el-table-column v-if="pasture.isHouseName" label="栏舍" min-width="110px" align="center" prop="栏舍" />            <el-table-column v-if="pasture.isHouseName" label="配方模板" min-width="110px" align="center" prop="配方模板" />            <el-table-column v-if="pasture.isLivestockType" label="牲畜类别" min-width="110px" align="center" prop="牲畜类别" />            <el-table-column label="实际牛头数" min-width="110px" align="center" prop="实际牛头数" />            <el-table-column label="应混料量(kg)" min-width="110px" align="center" prop="应混料量" />            <el-table-column label="实际混料量(kg)" min-width="110px" align="center" prop="实际混料量" />            <el-table-column label="撒料量(kg)" min-width="110px" align="center" prop="撒料量" />            <el-table-column label="混料时间" min-width="110px" align="center" prop="混料时间" />            <el-table-column label="转投剩料量(kg)" min-width="110px" align="center" prop="转投剩料量" />            <el-table-column label="今日剩料量(kg)" min-width="110px" align="center" prop="今日剩料量" />            <el-table-column label="剩料率(%)" min-width="110px" align="center" prop="剩料率" />            <el-table-column label="TMR干物质(%)" min-width="110px" align="center" prop="TMR干物质" />            <el-table-column label="配方干物质采食量(kg/头)" min-width="110px" align="center" prop="配方干物质采食量" />            <el-table-column label="实际干物质采食量(kg/头)" min-width="110px" align="center" prop="实际干物质采食量" />            <el-table-column label="采食率(%)" min-width="110px" align="center" prop="采食率" />            <el-table-column label="配方成本(元/头)" min-width="110px" align="center" prop="配方成本" />            <el-table-column label="实际成本(元/头)" min-width="110px" align="center" prop="实际成本" />            <el-table-column label="产奶量(kg/头)" min-width="110px" align="center" prop="产奶量" />            <el-table-column label="饲料转化率" min-width="110px" align="center" prop="饲料转化率" />            <el-table-column label="公斤奶饲料成本" min-width="110px" align="center" prop="公斤奶饲料成本" />          </el-table>        </div>      </div>      <div slot="footer" class="dialog-footer" style="bottom: 10px;">        <el-button class="cancelClose" @click="pasture.dialogFormVisible = false; ">关闭</el-button>      </div>    </el-dialog>  </div></template><script>import echarts from 'echarts'require('echarts/theme/macarons')import { GetDataByName, GetReportform } from '@/api/common'import Cookies from 'js-cookie'import { parseTime } from '@/utils/index.js'import Pagination from '@/components/Pagination'import { json2excel } from '@/utils/index.js'import { MessageBox } from 'element-ui'export default {  name: 'GroupFeedingEfficiency',  components: { Pagination },  data() {    return {      pickerMinDate: '',      pickerOptions: {        onPick: ({ maxDate, minDate }) => {          this.pickerMinDate = minDate.getTime()          if (maxDate) {            this.pickerMinDate = ''          }        },        // 限制不能选择今天之后的日期        disabledDate: (time) => {          if (this.pickerMinDate !== '') {            const one = 31 * 24 * 3600 * 1000            const minTime = this.pickerMinDate - one            let maxTime = this.pickerMinDate + one            if (maxTime > new Date()) {              maxTime = new Date()            }            return time.getTime() < minTime || time.getTime() > maxTime          }          return time.getTime() > Date.now()        }      },      tab: {        chartDate: [],        table: {          getdataListParm: {            name: 'getFeedEfficiencyJT',            page: 1,            offset: 1,            pagecount: '',            returntype: 'Map',            parammaps: {              pastureid: Cookies.get('pastureid'),              date: parseTime(new Date(), '{y}-{m}-{d}'),              ftname: '',              barname: '',              cowclass: ''            }          },          tableKey: 1,          list: [],          total: 0,          listLoading: true,          temp: {}        },        chart1: {          chartLine: null,          chartLine_data: {},          getdataListParm: {            name: 'getFeedEffMRJT',            page: 1,            offset: 1,            pagecount: '',            returntype: 'Map',            parammaps: {              pastureid: Cookies.get('pastureid'),              startTime: parseTime(new Date(), '{y}-{m}-{d}'),              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),              inputDatetime: [new Date(), new Date()]            }          },          tableKey: 1,          list: [],          total: 0,          listLoading: true,          isChart: true,          isTable: false,          table: {            tableKey: 1,            list: [],            total: 0,            listLoading: false          }        },        chart2: {          chartLine: null,          chartLine_data: {},          getdataListParm: {            name: 'getFeedEffSLJT',            page: 1,            offset: 1,            pagecount: '',            returntype: 'Map',            parammaps: {              pastureid: Cookies.get('pastureid'),              startTime: parseTime(new Date(), '{y}-{m}-{d}'),              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),              inputDatetime: [new Date(), new Date()]            }          },          tableKey: 1,          list: [],          total: 0,          listLoading: true,          chart2Data3: [],          isChart: true,          isTable: false,          table: {            tableKey: 1,            list: [],            total: 0,            listLoading: false          }        },        chart3: {          chartLine: null,          chartLine_data: {},          getdataListParm: {            name: 'getFeedEffHLJT',            page: 1,            offset: 1,            pagecount: '',            returntype: 'Map',            parammaps: {              pastureid: Cookies.get('pastureid'),              startTime: parseTime(new Date(), '{y}-{m}-{d}'),              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),              inputDatetime: [new Date(), new Date()]            }          },          tableKey: 1,          list: [],          total: 0,          listLoading: true,          isChart: true,          isTable: false,          table: {            tableKey: 1,            list: [],            total: 0,            listLoading: false          }        },        chart4: {          chartLine: null,          chartLine_data: {},          getdataListParm: {            name: 'getFeedEffZHJT',            page: 1,            offset: 1,            pagecount: '',            returntype: 'Map',            parammaps: {              pastureid: Cookies.get('pastureid'),              startTime: parseTime(new Date(), '{y}-{m}-{d}'),              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),              inputDatetime: [new Date(), new Date()]            }          },          tableKey: 1,          list: [],          total: 0,          listLoading: true,          chart4Data3: [],          isChart: true,          isTable: false,          table: {            tableKey: 1,            list: [],            total: 0,            listLoading: false          }        },        chart5: {          chartLine: null,          chartLine_data: {},          getdataListParm: {            name: 'getFeedEffCBAllJT',            page: 1,            offset: 1,            pagecount: '',            returntype: 'Map',            parammaps: {              pastureid: Cookies.get('pastureid'),              startTime: parseTime(new Date(), '{y}-{m}-{d}'),              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),              inputDatetime: [new Date(), new Date()]            }          },          tableKey: 1,          list: [],          total: 0,          listLoading: true,          chart5Data3: [],          isChart: true,          isTable: false,          table: {            tableKey: 1,            list: [],            total: 0,            listLoading: false          }        }      },      pasture: {        dialogFormVisible: false,        dialogStatus: '',        radio: '1',        isFormulaName: true, // 配方名称        isHouseName: false, // 栏舍名称        isLivestockType: false, // 牲畜类别        table: {          getdataListParm: {            name: 'getFeedEfficiencyFT',            page: 1,            offset: 1,            pagecount: '',            returntype: 'Map',            parammaps: {              pastureid: Cookies.get('pastureid'),              date: parseTime(new Date(), '{y}-{m}-{d}'),              ftname: '',              barname: '',              cowclass: ''            }          },          tableKey: 1,          list: [],          total: 0,          listLoading: true,          temp: {}        }      },      textMap: {        pasture: '牧场'      },      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },      cellStyle: { padding: 0 + 'px' }    }  },  created() {    this.getList()    this.getTimeFn()    this.getChart1()    this.getChart2()    this.getChart3()    this.getChart4()    this.getChart5()  },  mounted() {  },  methods: {    getTimeFn() {      const that = this      const end = new Date()      const start = new Date()      const start2 = new Date()      start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)      that.tab.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)      that.tab.chartDate[0] = parseTime(start, '{y}-{m}-{d}')      that.tab.chartDate[1] = parseTime(end, '{y}-{m}-{d}')      that.tab.chart1.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')      that.tab.chart1.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')      that.tab.chart1.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')      that.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')      that.tab.chart2.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')      that.tab.chart2.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')      that.tab.chart2.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')      that.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')      that.tab.chart3.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')      that.tab.chart3.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')      that.tab.chart3.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')      that.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')      that.tab.chart4.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')      that.tab.chart4.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')      that.tab.chart4.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')      that.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')      that.tab.chart5.getdataListParm.parammaps.inputDatetime[0] = parseTime(start, '{y}-{m}-{d}')      that.tab.chart5.getdataListParm.parammaps.inputDatetime[1] = parseTime(end, '{y}-{m}-{d}')      that.tab.chart5.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')      that.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(end, '{y}-{m}-{d}')    },    // 导出    handleDownload() {},    // 效率统计    getList() {      this.tab.table.listLoading = true      this.tab.table.getdataListParm.parammaps.date = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')      GetDataByName(this.tab.table.getdataListParm).then(response => {        console.log('汇总统计/混料table数据', response.data.list)        if (response.data.list !== null) {          this.tab.table.list = response.data.list          this.tab.table.total = response.data.total        } else {          this.tab.table.list = []        }        setTimeout(() => {          this.tab.table.listLoading = false        }, 100)      })    },    // 查询    handleSearch() {      this.getList()    },    handleBefore() {      if (this.tab.table.getdataListParm.parammaps.date !== '' && this.tab.table.getdataListParm.parammaps.date !== null) {        this.tab.table.getdataListParm.parammaps.date = new Date(this.tab.table.getdataListParm.parammaps.date)        var start = new Date(this.tab.table.getdataListParm.parammaps.date.setDate(this.tab.table.getdataListParm.parammaps.date.getDate() - 1))        this.tab.table.getdataListParm.parammaps.date = parseTime(start, '{y}-{m}-{d}')        this.getList()      }    },    handleNext() {      if (this.tab.table.getdataListParm.parammaps.date !== '' && this.tab.table.getdataListParm.parammaps.date !== null) {        this.tab.table.getdataListParm.parammaps.date = new Date(this.tab.table.getdataListParm.parammaps.date)        var stop = new Date(this.tab.table.getdataListParm.parammaps.date.setDate(this.tab.table.getdataListParm.parammaps.date.getDate() + 1))        this.tab.table.getdataListParm.parammaps.date = parseTime(stop, '{y}-{m}-{d}')        this.getList()      }    },    tableCellStyle({ row, column, rowIndex, columnIndex }) {      if (columnIndex === 0 && row.pastureid !== '-1') {        return {          textDecoration: 'underline'        }      }      return {        textDecoration: 'none'      }    },    clickPasture(row) {      if (row.pastureid !== '-1') {        this.pasture.dialogStatus = 'pasture'        this.pasture.dialogFormVisible = true        this.pasture.table.getdataListParm.parammaps.pastureid = row.pastureid        this.getTabList()      }    },    // 效率统计    getTabList() {      this.pasture.table.listLoading = true      this.pasture.table.getdataListParm.parammaps.date = this.tab.table.getdataListParm.parammaps.date      GetDataByName(this.pasture.table.getdataListParm).then(response => {        console.log('汇总统计/混料table数据', response.data.list)        if (response.data.list !== null) {          this.pasture.table.list = response.data.list          this.pasture.table.total = response.data.total        } else {          this.pasture.table.list = []        }        setTimeout(() => {          this.pasture.table.listLoading = false        }, 100)      })    },    // 切换统计类型    changeRadio() {      console.log(this.pasture.radio)      if (this.pasture.radio == '1') {        console.log('配方名称')        this.pasture.isFormulaName = true        this.pasture.isHouseName = false        this.pasture.isLivestockType = false        this.pasture.table.getdataListParm.parammaps.ftname = ''        this.pasture.table.getdataListParm.parammaps.barname = ''        this.pasture.table.getdataListParm.parammaps.ftname = ''        this.pasture.table.getdataListParm.parammaps.cowclass = ''        this.pasture.table.getdataListParm.name = 'getFeedEfficiencyFT'        this.getTabList()      } else if (this.pasture.radio == '2') {        console.log('栏舍名称')        this.pasture.isFormulaName = false        this.pasture.isHouseName = true        this.pasture.isLivestockType = false        this.pasture.table.getdataListParm.parammaps.ftname = ''        this.pasture.table.getdataListParm.parammaps.barname = ''        this.pasture.table.getdataListParm.parammaps.ftname = ''        this.pasture.table.getdataListParm.parammaps.cowclass = ''        this.pasture.table.getdataListParm.name = 'getFeedEfficiencyLS'        this.getTabList()      } else if (this.pasture.radio == '3') {        console.log(' 牲畜类别')        this.pasture.isFormulaName = false        this.pasture.isHouseName = false        this.pasture.isLivestockType = true        this.pasture.table.getdataListParm.parammaps.ftname = ''        this.pasture.table.getdataListParm.parammaps.barname = ''        this.pasture.table.getdataListParm.parammaps.ftname = ''        this.pasture.table.getdataListParm.parammaps.cowclass = ''        this.pasture.table.getdataListParm.name = 'getFeedEfficiencySC'        this.getTabList()      }    },    handlePastureSearch() {},    // 快速跳转到图表    handleQuickJumpChart() {      var myHeight = document.getElementById('table').offsetHeight + 120      window.scrollTo(myHeight, myHeight)    },    // 快速回到顶部    handleQuickJumpTop() {      window.scrollTo(0, 0)    },    // 图表总查询    handleChartDate() {      console.log('点击了确认时间')      MessageBox.confirm('是否调整以下所有图表查询时间?', {        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'      }).then(() => {        var that = this        var startTime = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')        var stopTime = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')        that.tab.chart1.getdataListParm.parammaps.inputDatetime = this.tab.chartDate        that.tab.chart1.getdataListParm.parammaps.startTime = startTime        that.tab.chart1.getdataListParm.parammaps.stopTime = stopTime        that.getChart1()        that.tab.chart2.getdataListParm.parammaps.inputDatetime = this.tab.chartDate        that.tab.chart2.getdataListParm.parammaps.startTime = startTime        that.tab.chart2.getdataListParm.parammaps.stopTime = stopTime        that.getChart2()        that.tab.chart3.getdataListParm.parammaps.inputDatetime = this.tab.chartDate        that.tab.chart3.getdataListParm.parammaps.startTime = startTime        that.tab.chart3.getdataListParm.parammaps.stopTime = stopTime        that.getChart3()        that.tab.chart4.getdataListParm.parammaps.inputDatetime = this.tab.chartDate        that.tab.chart4.getdataListParm.parammaps.startTime = startTime        that.tab.chart4.getdataListParm.parammaps.stopTime = stopTime        that.getChart4()        that.tab.chart5.getdataListParm.parammaps.inputDatetime = this.tab.chartDate        that.tab.chart5.getdataListParm.parammaps.startTime = startTime        that.tab.chart5.getdataListParm.parammaps.stopTime = stopTime        that.getChart5()      })    },    // 泌乳牛干物质采食量    getChart1() {      this.tab.chart1.listLoading = true      GetReportform(this.tab.chart1.getdataListParm).then(response => {        console.log('泌乳牛干物质采食量图表数据', response.data.list)        if (response.data.list !== null) {          this.tab.chart1.table.list = response.data.data          this.tab.chart1.chartLine_data = response.data.list          // this.tab.chart1.chartLine_data = {          //   data1: ['1牧', '2牧', '3牧'], // 折线          //   data2: ['12/01', '12/02', '12/03'], // X轴          //   data3: [          //     { data: [1.5, 1.2, 1.7, 1.2] },          //     { data: [1.7, 0.8, 1.2, 1.8] },          //     { data: [1.3, 2.2, 1.9, 1.4] }          //   ]// 折线对应数据          // }          // this.tab.chart1.total = response.data.total          this.roadChartLine1(this.tab.chart1.chartLine_data)        } else {          this.tab.chart1.list = []        }        setTimeout(() => {          this.tab.chart1.listLoading = false        }, 100)      })    },    roadChartLine1(chartLine_data) {      if (this.tab.chart1.chartLine != null) {        this.tab.chart1.chartLine.dispose()      }      this.tab.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))      var option = {        title: {          text: ''        },        tooltip: {          trigger: 'axis'        },        legend: {          data: chartLine_data.data1,          right: 10        },        grid: {          top: '20%',          left: '3%',          right: '8%',          containLabel: true        },        toolbox: {          show: true,          right: '2%',          feature: {}        },        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },        yAxis: {          type: 'value', name: 'kg', axisLabel: { formatter: '{value}' }        },        series: (function() {          var serie = []          for (var i = 0; i < chartLine_data.data3.length; i++) {            var item = {              name: chartLine_data.data1[i],              type: 'line',              data: chartLine_data.data3[i].data            }            serie.push(item)          }          return serie        }())      }      this.tab.chart1.chartLine.setOption(option)      window.onresize = function() {        this.tab.chart1.chartLine.resize()      }    },    // 剩料率    getChart2() {      this.tab.chart2.listLoading = true      GetReportform(this.tab.chart2.getdataListParm).then(response => {        console.log('剩料率图表数据', response.data.list)        if (response.data.list !== null) {          this.tab.chart2.table.list = response.data.data          this.tab.chart2.chartLine_data = response.data.list          // this.tab.chart2.chartLine_data = {          //   data1: ['1牧', '2牧', '3牧'], // 折线          //   data2: ['12/01', '12/02', '12/03'], // X轴          //   data3: [          //     { data: [1.5, 1.2, 1.7, 1.2] },          //     { data: [1.7, 0.8, 1.2, 1.8] },          //     { data: [1.3, 2.2, 1.9, 1.4] }          //   ]// 折线对应数据          // }          this.tab.chart2.total = response.data.total          console.log('剩料率图数据', this.tab.chart2.chartLine_data)          console.log('剩料率表数据', this.tab.chart2.table.list)          this.roadChartLine2(this.tab.chart2.chartLine_data)        } else {          this.tab.chart2.list = []        }        setTimeout(() => {          this.tab.chart2.listLoading = false        }, 100)      })    },    roadChartLine2(chartLine_data) {      if (this.tab.chart2.chartLine != null) {        this.tab.chart2.chartLine.dispose()      }      this.tab.chart2.chartLine = echarts.init(document.getElementById('chartLine2'))      var option = {        title: {          text: ''        },        tooltip: {          trigger: 'axis'        },        legend: {          data: chartLine_data.data1,          right: 10        },        grid: {          top: '20%',          left: '3%',          right: '8%',          containLabel: true        },        toolbox: {          show: true,          right: '2%',          feature: {}        },        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },        yAxis: {          type: 'value', name: '剩料率', axisLabel: { formatter: '{value} %' }        },        series: (function() {          var serie = []          for (var i = 0; i < chartLine_data.data3.length; i++) {            var item = {              name: chartLine_data.data1[i],              type: 'line',              data: chartLine_data.data3[i].data            }            serie.push(item)          }          return serie        }())      }      this.tab.chart2.chartLine.setOption(option)      window.onresize = function() {        this.tab.chart2.chartLine.resize()      }    },    // 混料时间统计    getChart3() {      this.tab.chart3.listLoading = true      GetReportform(this.tab.chart3.getdataListParm).then(response => {        console.log('混料时间统计图表数据', response.data.list)        if (response.data.list !== null) {          this.tab.chart3.table.list = response.data.data          this.tab.chart3.chartLine_data = response.data.list          // this.tab.chart3.chartLine_data = {          //   data1: ['1牧', '2牧', '3牧'], // 折线          //   data2: ['12/01', '12/02', '12/03'], // X轴          //   data3: [          //     { data: [1.5, 1.2, 1.7, 1.2] },          //     { data: [1.7, 0.8, 1.2, 1.8] },          //     { data: [1.3, 2.2, 1.9, 1.4] }          //   ]// 折线对应数据          // }          this.tab.chart3.total = response.data.total          this.tab.chart3.total = response.data.total          this.roadChartLine3(this.tab.chart3.chartLine_data)        } else {          this.tab.chart3.list = []        }        setTimeout(() => {          this.tab.chart3.listLoading = false        }, 100)      })    },    roadChartLine3(chartLine_data) {      if (this.tab.chart3.chartLine != null) {        this.tab.chart3.chartLine.dispose()      }      this.tab.chart3.chartLine = echarts.init(document.getElementById('chartLine3'))      var option = {        title: {          text: ''        },        tooltip: {          trigger: 'axis'        },        legend: {          data: chartLine_data.data1,          right: 10        },        grid: {          top: '20%',          left: '3%',          right: '8%',          containLabel: true        },        toolbox: {          show: true,          right: '2%',          feature: {}        },        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },        yAxis: {          type: 'value', name: '分钟', axisLabel: { formatter: '{value}min' }        },        series: (function() {          var serie = []          for (var i = 0; i < chartLine_data.data3.length; i++) {            var item = {              name: chartLine_data.data1[i],              type: 'line',              data: chartLine_data.data3[i].data            }            serie.push(item)          }          return serie        }())      }      this.tab.chart3.chartLine.setOption(option)      window.onresize = function() {        this.tab.chart3.chartLine.resize()      }    },    // 转化率    getChart4() {      this.tab.chart4.listLoading = true      GetReportform(this.tab.chart4.getdataListParm).then(response => {        console.log('转化率图表数据', response.data.list)        if (response.data.list !== null) {          this.tab.chart4.table.list = response.data.data          this.tab.chart4.chartLine_data = response.data.list          // this.tab.chart4.chartLine_data = {          //   data1: ['1牧', '2牧', '3牧'], // 折线          //   data2: ['12/01', '12/02', '12/03'], // X轴          //   data3: [          //     { data: [1.5, 1.2, 1.7, 1.2] },          //     { data: [1.7, 0.8, 1.2, 1.8] },          //     { data: [1.3, 2.2, 1.9, 1.4] }          //   ]// 折线对应数据          // }          this.tab.chart4.total = response.data.total          console.log('转化率图数据', this.tab.chart4.chartLine_data)          console.log('转化率表数据', this.tab.chart4.table.list)          this.roadChartLine4(this.tab.chart4.chartLine_data)        } else {          this.tab.chart4.list = []        }        setTimeout(() => {          this.tab.chart4.listLoading = false        }, 100)      })    },    roadChartLine4(chartLine_data) {      if (this.tab.chart4.chartLine != null) {        this.tab.chart4.chartLine.dispose()      }      this.tab.chart4.chartLine = echarts.init(document.getElementById('chartLine4'))      var option = {        title: {          text: ''        },        tooltip: {          trigger: 'axis'        },        legend: {          data: chartLine_data.data1,          right: 10        },        grid: {          top: '20%',          left: '3%',          right: '8%',          containLabel: true        },        toolbox: {          show: true,          right: '2%',          feature: {}        },        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },        yAxis: {          type: 'value', name: '饲料转化率', axisLabel: { formatter: '{value} %' }        },        series: (function() {          var serie = []          for (var i = 0; i < chartLine_data.data3.length; i++) {            var item = {              name: chartLine_data.data1[i],              type: 'line',              data: chartLine_data.data3[i].data            }            serie.push(item)          }          return serie        }())      }      this.tab.chart4.chartLine.setOption(option)      window.onresize = function() {        this.tab.chart4.chartLine.resize()      }    },    // 成本分析    getChart5() {      this.tab.chart5.listLoading = true      GetReportform(this.tab.chart5.getdataListParm).then(response => {        console.log('转化率图表数据', response.data.list)        if (response.data.list !== null) {          this.tab.chart5.table.list = response.data.data          this.tab.chart5.chartLine_data = response.data.list          // this.tab.chart5.chartLine_data = {          //   data1: ['1牧', '2牧', '3牧'], // 折线          //   data2: ['12/01', '12/02', '12/03'], // X轴          //   data3: [          //     { data: [1.5, 1.2, 1.7, 1.2] },          //     { data: [1.7, 0.8, 1.2, 1.8] },          //     { data: [1.3, 2.2, 1.9, 1.4] }          //   ]// 折线对应数据          // }          this.tab.chart5.total = response.data.total          console.log('转化率图数据', this.tab.chart5.chartLine_data)          console.log('转化率表数据', this.tab.chart5.table.list)          this.roadChartLine5(this.tab.chart5.chartLine_data)        } else {          this.tab.chart5.list = []        }        setTimeout(() => {          this.tab.chart5.listLoading = false        }, 100)      })    },    roadChartLine5(chartLine_data) {      if (this.tab.chart5.chartLine != null) {        this.tab.chart5.chartLine.dispose()      }      this.tab.chart5.chartLine = echarts.init(document.getElementById('chartLine5'))      var option = {        title: {          text: ''        },        tooltip: {          trigger: 'axis'        },        legend: {          data: chartLine_data.data1,          right: 10        },        grid: {          top: '20%',          left: '5%',          right: '8%',          containLabel: true        },        toolbox: {          show: true,          right: '2%',          feature: {}        },        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data2, name: '日期' },        yAxis: {          type: 'value', name: '公斤奶饲料成本(元)'        },        series: (function() {          var serie = []          for (var i = 0; i < chartLine_data.data3.length; i++) {            var item = {              name: chartLine_data.data1[i],              type: 'line',              data: chartLine_data.data3[i].data            }            serie.push(item)          }          return serie        }())      }      this.tab.chart5.chartLine.setOption(option)      window.onresize = function() {        this.tab.chart5.chartLine.resize()      }    },    // 时间    changeChartDate(item) {      console.log(item)      if (item == 'chart1') {        if (this.tab.chart1.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart1.getdataListParm.parammaps.inputDatetime !== null) {          this.tab.chart1.getdataListParm.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')          this.tab.chart1.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')          this.getChart1()        } else {          this.tab.chart1.getdataListParm.parammaps.inputDatetime = ''          this.tab.chart1.getdataListParm.parammaps.startTime = ''          this.tab.chart1.getdataListParm.parammaps.stopTime = ''          this.getChart1()        }      } else if (item == 'chart2') {        if (this.tab.chart2.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart2.getdataListParm.parammaps.inputDatetime !== null) {          this.tab.chart2.getdataListParm.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')          this.tab.chart2.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')          this.getChart2()        } else {          this.tab.chart2.getdataListParm.parammaps.inputDatetime = ''          this.tab.chart2.getdataListParm.parammaps.startTime = ''          this.tab.chart2.getdataListParm.parammaps.stopTime = ''          this.getChart2()        }      } else if (item == 'chart3') {        if (this.tab.chart3.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart3.getdataListParm.parammaps.inputDatetime !== null) {          this.tab.chart3.getdataListParm.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')          this.tab.chart3.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')          this.getChart3()        } else {          this.tab.chart3.getdataListParm.parammaps.inputDatetime = ''          this.tab.chart3.getdataListParm.parammaps.startTime = ''          this.tab.chart3.getdataListParm.parammaps.stopTime = ''          this.getChart3()        }      } else if (item == 'chart4') {        if (this.tab.chart4.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart4.getdataListParm.parammaps.inputDatetime !== null) {          this.tab.chart4.getdataListParm.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')          this.tab.chart4.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')          this.getChart4()        } else {          this.tab.chart4.getdataListParm.parammaps.inputDatetime = ''          this.tab.chart4.getdataListParm.parammaps.startTime = ''          this.tab.chart4.getdataListParm.parammaps.stopTime = ''          this.getChart4()        }      } else if (item == 'chart5') {        if (this.tab.chart5.getdataListParm.parammaps.inputDatetime !== '' && this.tab.chart5.getdataListParm.parammaps.inputDatetime !== null) {          this.tab.chart5.getdataListParm.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')          this.tab.chart5.getdataListParm.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')          this.getChart5()        } else {          this.tab.chart5.getdataListParm.parammaps.inputDatetime = ''          this.tab.chart5.getdataListParm.parammaps.startTime = ''          this.tab.chart5.getdataListParm.parammaps.stopTime = ''          this.getChart5()        }      }    },    // 导出    handleExport(item) {      if (item == 'chart1') {        console.log('泌乳牛采食量导出')        var excelDatasTabChart1 = [          {            tHeader: ['日期', '泌乳牛采食量', '泌乳牛产奶量'],            filterVal: ['日期', 'field1', 'field2'],            tableDatas: this.tab.chart1.table.list,            sheetName: '泌乳牛采食量'          }        ]        json2excel(excelDatasTabChart1, '泌乳牛采食量', true, 'xlsx')      } else if (item == 'chart2') {        console.log('剩料率导出')        var excelDatasTabChart2 = [          {            tHeader: ['日期', '栏舍名称', '剩料量', '撒料量', '剩料率'],            filterVal: ['日期', '名称', '剩料量', '撒料量', '准确率'],            tableDatas: this.tab.chart2.table.list,            sheetName: '牛栏剩料率'          }        ]        json2excel(excelDatasTabChart2, '牛栏剩料率', true, 'xlsx')      } else if (item == 'chart3') {        console.log('混料时间统计导出')        var excelDatasTabChart3 = [          {            tHeader: ['日期', '混料时间(分钟)'],            filterVal: ['日期', 'field1'],            tableDatas: this.tab.chart3.table.list,            sheetName: '混料时间统计'          }        ]        json2excel(excelDatasTabChart3, '混料时间统计', true, 'xlsx')      } else if (item == 'chart4') {        console.log('转化率导出')        var excelDatasTabChart4 = [          {            tHeader: ['日期', '配方名称', '饲料转化率'],            filterVal: ['日期', '名称', '准确率'],            tableDatas: this.tab.chart4.table.list,            sheetName: '转化率统计'          }        ]        json2excel(excelDatasTabChart4, '转化率', true, 'xlsx')      } else if (item == 'chart5') {        console.log('成本分析导出')        var excelDatasTabChart5 = [          {            tHeader: ['日期', '牲畜类别', '公斤奶饲料成本(元)'],            filterVal: ['日期', '名称', '准确率'],            tableDatas: this.tab.chart5.table.list,            sheetName: '成本分析'          }        ]        json2excel(excelDatasTabChart5, '成本分析', true, 'xlsx')      }    },    // 切换表格    handleTable(item) {      // 显示切换表格      if (item == 'chart1') {        console.log('泌乳牛采食量表格')        this.tab.chart1.isTable = true        this.tab.chart1.isChart = false      } else if (item == 'chart2') {        console.log('牛栏剩料率表格')        this.tab.chart2.isTable = true        this.tab.chart2.isChart = false      } else if (item == 'chart3') {        console.log('混料时间统计表格')        this.tab.chart3.isTable = true        this.tab.chart3.isChart = false      } else if (item == 'chart4') {        console.log('转化率表格')        this.tab.chart4.isTable = true        this.tab.chart4.isChart = false      } else if (item == 'chart5') {        console.log('成本分析表格')        this.tab.chart5.isTable = true        this.tab.chart5.isChart = false      }    },    // 切换图表    handleChart(item) {      // 显示切换图表      if (item == 'chart1') {        console.log('泌乳牛采食量图表')        this.tab.chart1.isTable = false        this.tab.chart1.isChart = true        this.getChart1()      } else if (item == 'chart2') {        console.log('牛栏剩料率图表')        this.tab.chart2.isTable = false        this.tab.chart2.isChart = true        this.getChart2()      } else if (item == 'chart3') {        console.log('混料时间统计图表')        this.tab.chart3.isTable = false        this.tab.chart3.isChart = true        this.getChart3()      } else if (item == 'chart4') {        console.log('转化率图表')        this.tab.chart4.isTable = false        this.tab.chart4.isChart = true        this.getChart4()      } else if (item == 'chart5') {        console.log('成本分析图表')        this.tab.chart5.isTable = false        this.tab.chart5.isChart = true        this.getChart5()      }    }  }}</script><style lang="scss" scoped>  .button{    height: 50px;    .exportTable{float: right;margin-right: 5px;}  }  .app-container1{padding-left: 10px;background-color: #F4F4F4;}  .dashboard-editor-container {    background-color: #F4F4F4;    .grid-content{      background-color:#fff;padding: 0 10px;      h4{text-align: center;line-height: 50px;}    }  }  .table{margin-bottom: 50px;}</style>
 |