<template>
  <div class="app-container1">
    <el-tabs v-model="activeName" @tab-click="handleTabClick">
      <el-tab-pane label="效率统计" name="first">
        <div class="search">
          <!-- <el-date-picker v-model="tab2.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTab2Date" /> -->
          <el-date-picker v-model="tab.table.getdataListParm.parammaps.date" :clearable="false" style="width: 140px;margin-top: 5px;" type="date" placeholder="选择日期" @change="changeTab1Date"> </el-date-picker>
          <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled1" @click="handleBefore" />
          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled1" @click="handleNext" />
          <span style="margin-left: 10px;">统计类型：</span>
          <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方</el-radio>
          <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍</el-radio>
          <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
          <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 245px;" placeholder="配方模板" />
          <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.barname" class="filter-item" style="width: 150px;" placeholder="栏舍" />
          <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 150px;" placeholder="配方模板" />
          <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.cowclass" class="filter-item" style="width: 150px;" placeholder="牲畜类别" />
          <el-button class="successBorder" @click="handleSearch">查询</el-button>
          <el-button class="export" icon="el-icon-upload2" @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="cellStyle"
            class="elTable table-fixed"
            :max-height="myHeight"
          >
            <el-table-column v-if="tab.isFormulaName" sortable label="配方模板" min-width="70px" align="center" prop="配方模板" />
            <el-table-column v-if="tab.isHouseName" sortable label="栏舍" min-width="70px" align="center" prop="栏舍" />
            <el-table-column v-if="tab.isHouseName" sortable label="配方模板" min-width="70px" align="center" prop="配方模板" />
            <el-table-column v-if="tab.isLivestockType" sortable label="牲畜类别" min-width="70px" align="center" prop="牲畜类别" />
            <el-table-column sortable label="实际牛头数" min-width="60px" align="center" prop="实际牛头数" />
            <el-table-column sortable label="应混料量（kg）" min-width="60px" align="center" prop="应混料量" />
            <el-table-column sortable label="实际混料量（kg）" min-width="70px" align="center" prop="实际混料量" />
            <el-table-column sortable label="撒料量（kg）" min-width="60px" align="center" prop="撒料量" />
            <el-table-column sortable label="平均混料时间" min-width="70px" align="center" prop="混料时间" />
            <el-table-column sortable label="转投剩料量（kg）" min-width="70px" align="center" prop="转投剩料量" />
            <el-table-column sortable label="今日剩料量（kg）" min-width="70px" align="center" prop="今日剩料量" />
            <el-table-column sortable label="剩料率（%）" min-width="60px" align="center" prop="剩料率" />
            <el-table-column sortable label="TMR干物质（%）" min-width="65px" align="center" prop="TMR干物质" />
            <el-table-column sortable label="配方干物质采食量（kg/头）" min-width="80px" align="center" prop="配方干物质采食量" />
            <el-table-column sortable label="实际干物质采食量（kg/头）" min-width="80px" align="center" prop="实际干物质采食量" />
            <el-table-column sortable label="采食率（%）" min-width="60px" align="center" prop="采食率" />
            <el-table-column sortable label="配方成本(元/头)" min-width="65px" align="center" prop="配方成本" />
            <el-table-column sortable label="实际成本(元/头)" min-width="65px" align="center" prop="实际成本" />
            <el-table-column sortable label="产奶量（kg/头）" min-width="65px" align="center" prop="产奶量" />
            <el-table-column sortable label="饲料转化率(%)" min-width="60px" align="center" prop="饲料转化率" />
            <el-table-column sortable label="公斤奶饲料成本" min-width="60px" align="center" prop="公斤奶饲料成本" />
          </el-table>
          <span v-if="tab.table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ tab.table.total }}条</span>
        </div>
        <div class="AnalysisChart">
          <el-row :gutter="10">
            <el-col :span="23">
              <span>图表查询时间：</span>
              <el-radio-group v-model="tab.specificDate" class="specificDate" size="mini" style="display: inline-block;" @change="changeAllSpecificDate">
                <el-radio-button label="1" border>日</el-radio-button>
                <!-- <el-radio-button label="2" border>周</el-radio-button> -->
                <el-radio-button label="3" border>月</el-radio-button>
              </el-radio-group>
              <div v-show="tab.specificDate == '1'" class="day" style="display: inline-block;margin-left:10px;">
                <el-date-picker v-model="tab.chartDate" :clearable="false" class="inputDatetime filter-item" style="width:250px;" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptionsDate" />
              </div>
              <div v-show="tab.specificDate == '2'" class="week" style="display: inline-block; clear: both;margin-left:10px;">
                <el-select v-model="tab.selectYear" class="filter-item" style="width:130px;margin-right:10px;" placeholder="请选择年份" @change="changeAllYear">
                  <el-option v-for="item in tab.yearList" :key="item" :label="item" :value="item" />
                </el-select>
                <el-select v-model="tab.selectWeek" class="filter-item" style="width:170px;" multiple :multiple-limit="2" placeholder="请选择周">
                  <el-option v-for="(item,index) in tab.weekList" :key="index" :label="item.name" :value="item.id" />
                </el-select>
              </div>
              <div v-show="tab.specificDate == '3'" class="month" style="display: inline-block;margin-left:10px;">
                <el-date-picker v-model="tab.chartMonth" :clearable="false" value-format="yyyy-MM-dd" type="monthrange" style="width:250px;" class="inputDatetime filter-item" range-separator="至" :picker-options="pickerOptionsMonth" />
              </div>
              <el-button class="successBorder" style="margin-left:10px;" @click="handleAllDate">确认</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 style="text-align:center;">泌乳牛干物质采食量</h4>
                <div v-if="tab.chart1.isChart" class="button">
                  <div class="chartButton">
                    <el-radio-group v-model="tab.chart1.getdataListParm.parammaps.specificDate" class="specificDate" size="mini" style="display: inline-block;" @change="changeChartSpecificDate('chart1')">
                      <el-radio-button label="1" border>日</el-radio-button>
                      <!-- <el-radio-button label="2" border>周</el-radio-button> -->
                      <el-radio-button label="3" border>月</el-radio-button>
                    </el-radio-group>
                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '1'" class="day" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.inputDatetime" style="width:220px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptionsDate" />
                    </div>
                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '2'" class="week" style="display: inline-block; clear: both;margin-left:10px;">
                      <el-select v-model="tab.chart1.getdataListParm.parammaps.selectYear" class="filter-item" style="width:80px;margin-right:10px;" placeholder="年份" @change="changeChartYear('chart1')">
                        <el-option v-for="item in tab.yearList" :key="item" :label="item" :value="item" />
                      </el-select>
                      <el-select v-model="tab.chart1.getdataListParm.parammaps.selectWeek" class="filter-item" style="width:160px;" multiple :multiple-limit="2" placeholder="请选择周">
                        <el-option v-for="(item,index) in tab.chart1.getdataListParm.parammaps.weekList" :key="index" :label="item.name" :value="item.id" />
                      </el-select>
                    </div>
                    <div v-show="tab.chart1.getdataListParm.parammaps.specificDate == '3'" class="month" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart1.getdataListParm.parammaps.chartMonth" style="width:220px;" :clearable="false" value-format="yyyy-MM-dd" type="monthrange" class="inputDatetime filter-item" range-separator="至" :picker-options="pickerOptionsMonth" />
                    </div>
                    <el-button class="successBorder" style="margin-left:10px;" @click="handleChartDate('chart1')">确认</el-button>
                  </div>
                  <div>
                    <div class="exportTable2" @click="handleExport('chart1')">导出</div>
                    <div class="exportTable2" @click="handleTable('chart1')">切换表格</div>
                  </div>
                </div>
                <div v-if="tab.chart1.isChart" id="chartLine1" style="width:100%;height:385px;" />
                <div v-if="tab.chart1.isTable" class="table">
                  <div class="button">
                    <div class="exportTable2" @click="handleExport('chart1')">导出</div>
                    <div class="exportTable2" @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="385"
                    :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 style="text-align:center;">牛栏剩料率</h4>
                <div v-if="tab.chart2.isChart" class="button">
                  <div class="chartButton">
                    <my-select ref="tenantselect" :model="tab.chart2.getdataListParm.parammaps.statisticsList" :option="tab.chart2.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart2" />
                    <el-radio-group v-model="tab.chart2.getdataListParm.parammaps.specificDate" class="specificDate" size="mini" style="display: inline-block;" @change="changeChartSpecificDate('chart2')">
                      <el-radio-button label="1" border>日</el-radio-button>
                      <!-- <el-radio-button label="2" border>周</el-radio-button> -->
                      <el-radio-button label="3" border>月</el-radio-button>
                    </el-radio-group>
                    <div v-show="tab.chart2.getdataListParm.parammaps.specificDate == '1'" class="day" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart2.getdataListParm.parammaps.inputDatetime" style="width:220px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptionsDate" />
                    </div>
                    <div v-show="tab.chart2.getdataListParm.parammaps.specificDate == '2'" class="week" style="display: inline-block; clear: both;margin-left:10px;">
                      <el-select v-model="tab.chart2.getdataListParm.parammaps.selectYear" class="filter-item" style="width:80px;margin-right:10px;" placeholder="年份" @change="changeChartYear('chart2')">
                        <el-option v-for="item in tab.yearList" :key="item" :label="item" :value="item" />
                      </el-select>
                      <el-select v-model="tab.chart2.getdataListParm.parammaps.selectWeek" class="filter-item" style="width:160px;" multiple :multiple-limit="2" placeholder="请选择周">
                        <el-option v-for="(item,index) in tab.chart2.getdataListParm.parammaps.weekList" :key="index" :label="item.name" :value="item.id" />
                      </el-select>
                    </div>
                    <div v-show="tab.chart2.getdataListParm.parammaps.specificDate == '3'" class="month" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart2.getdataListParm.parammaps.chartMonth" style="width:220px;" :clearable="false" value-format="yyyy-MM-dd" type="monthrange" class="inputDatetime filter-item" range-separator="至" :picker-options="pickerOptionsMonth" />
                    </div>
                    <el-button class="successBorder" style="margin-left:10px;" @click="handleChartDate('chart2')">确认</el-button>
                  </div>
                  <div>
                    <div class="exportTable2" @click="handleExport('chart2')">导出</div>
                    <div class="exportTable2" @click="handleTable('chart2')">切换表格</div>
                  </div>
                </div>
                <div v-if="tab.chart2.isChart" id="chartLine2" style="width:100%;height:385px;" />
                <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="385"
                    :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 style="text-align:center;">混料时间统计</h4>
                <div v-if="tab.chart3.isChart" class="button">
                  <div class="chartButton">
                    <el-radio-group v-model="tab.chart3.getdataListParm.parammaps.specificDate" class="specificDate" size="mini" style="display: inline-block;" @change="changeChartSpecificDate('chart3')">
                      <el-radio-button label="1" border>日</el-radio-button>
                      <!-- <el-radio-button label="2" border>周</el-radio-button> -->
                      <el-radio-button label="3" border>月</el-radio-button>
                    </el-radio-group>
                    <div v-show="tab.chart3.getdataListParm.parammaps.specificDate == '1'" class="day" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart3.getdataListParm.parammaps.inputDatetime" style="width:220px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptionsDate" />
                    </div>
                    <div v-show="tab.chart3.getdataListParm.parammaps.specificDate == '2'" class="week" style="display: inline-block; clear: both;margin-left:10px;">
                      <el-select v-model="tab.chart3.getdataListParm.parammaps.selectYear" class="filter-item" style="width:80px;margin-right:10px;" placeholder="年份" @change="changeChartYear('chart3')">
                        <el-option v-for="item in tab.yearList" :key="item" :label="item" :value="item" />
                      </el-select>
                      <el-select v-model="tab.chart3.getdataListParm.parammaps.selectWeek" class="filter-item" style="width:160px;" multiple :multiple-limit="2" placeholder="请选择周">
                        <el-option v-for="(item,index) in tab.chart3.getdataListParm.parammaps.weekList" :key="index" :label="item.name" :value="item.id" />
                      </el-select>
                    </div>
                    <div v-show="tab.chart3.getdataListParm.parammaps.specificDate == '3'" class="month" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart3.getdataListParm.parammaps.chartMonth" style="width:220px;" :clearable="false" value-format="yyyy-MM-dd" type="monthrange" class="inputDatetime filter-item" range-separator="至" :picker-options="pickerOptionsMonth" />
                    </div>
                    <el-button class="successBorder" style="margin-left:10px;" @click="handleChartDate('chart3')">确认</el-button>
                  </div>
                  <div>
                    <div class="exportTable2" @click="handleExport('chart3')">导出</div>
                    <div class="exportTable2" @click="handleTable('chart3')">切换表格</div>
                  </div>
                </div>
                <div v-if="tab.chart3.isChart" id="chartLine3" style="width:100%;height:385px;" />
                <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="385"
                    :row-style="rowStyle"
                    :cell-style="cellStyle"
                    class="elTable table-fixed"
                  >
                    <el-table-column sortable label="日期" min-width="110px" align="center" prop="日期" />
                    <el-table-column sortable label="混料时间（分钟）" min-width="110px" align="center" prop="field1" />
                  </el-table>
                </div>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="grid-content">
                <h4 style="text-align:center;">转化率</h4>
                <div v-if="tab.chart4.isChart" class="button">
                  <div class="chartButton">
                    <my-select ref="tenantselect" :model="tab.chart4.getdataListParm.parammaps.statisticsList" :option="tab.chart4.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart4" />
                    <el-radio-group v-model="tab.chart4.getdataListParm.parammaps.specificDate" class="specificDate" size="mini" style="display: inline-block;" @change="changeChartSpecificDate('chart4')">
                      <el-radio-button label="1" border>日</el-radio-button>
                      <!-- <el-radio-button label="2" border>周</el-radio-button> -->
                      <el-radio-button label="3" border>月</el-radio-button>
                    </el-radio-group>
                    <div v-show="tab.chart4.getdataListParm.parammaps.specificDate == '1'" class="day" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart4.getdataListParm.parammaps.inputDatetime" style="width:220px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptionsDate" />
                    </div>
                    <div v-show="tab.chart4.getdataListParm.parammaps.specificDate == '2'" class="week" style="display: inline-block; clear: both;margin-left:10px;">
                      <el-select v-model="tab.chart4.getdataListParm.parammaps.selectYear" class="filter-item" style="width:80px;margin-right:10px;" placeholder="年份" @change="changeChartYear('chart4')">
                        <el-option v-for="item in tab.yearList" :key="item" :label="item" :value="item" />
                      </el-select>
                      <el-select v-model="tab.chart4.getdataListParm.parammaps.selectWeek" class="filter-item" style="width:160px;" multiple :multiple-limit="2" placeholder="请选择周">
                        <el-option v-for="(item,index) in tab.chart4.getdataListParm.parammaps.weekList" :key="index" :label="item.name" :value="item.id" />
                      </el-select>
                    </div>
                    <div v-show="tab.chart4.getdataListParm.parammaps.specificDate == '3'" class="month" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart4.getdataListParm.parammaps.chartMonth" style="width:220px;" :clearable="false" value-format="yyyy-MM-dd" type="monthrange" class="inputDatetime filter-item" range-separator="至" :picker-options="pickerOptionsMonth" />
                    </div>
                    <el-button class="successBorder" style="margin-left:10px;" @click="handleChartDate('chart4')">确认</el-button>
                  </div>
                  <div>
                    <div class="exportTable2" @click="handleExport('chart4')">导出</div>
                    <div class="exportTable2" @click="handleTable('chart4')">切换表格</div>
                  </div>
                </div>
                <div v-if="tab.chart4.isChart" id="chartLine4" style="width:100%;height:385px;" />
                <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="385"
                    :row-style="rowStyle"
                    :cell-style="cellStyle"
                    class="elTable table-fixed"
                  >
                    <el-table-column sortable label="日期" min-width="110px" align="center" prop="日期" />
                    <el-table-column sortable label="配方名称" min-width="110px" align="center" prop="名称" />
                    <el-table-column sortable label="饲料转化率" min-width="110px" align="center" prop="准确率" />
                  </el-table>
                </div>
              </div>
            </el-col>
          </el-row>
          <el-row :gutter="10" class="dashboard-editor-container" style="margin-bottom: 30px;">
            <el-col :span="24">
              <div class="grid-content">
                <h4 style="text-align:center;">成本分析</h4>
                <div v-if="tab.chart5.isChart" class="button">
                  <div class="chartButton">
                    <my-select ref="tenantselect" :model="tab.chart5.getdataListParm.parammaps.statisticsList" :option="tab.chart5.statisticsList" :value="'name'" :label="'name'" style="width: 150px;margin-right: 5px;float: left;" placeholder="请选择统计参数" @searchSelect="changeStatisticChart5" />
                    <el-radio-group v-model="tab.chart5.getdataListParm.parammaps.specificDate" class="specificDate" size="mini" style="display: inline-block;" @change="changeChartSpecificDate('chart5')">
                      <el-radio-button label="1" border>日</el-radio-button>
                      <!-- <el-radio-button label="2" border>周</el-radio-button> -->
                      <el-radio-button label="3" border>月</el-radio-button>
                    </el-radio-group>
                    <div v-show="tab.chart5.getdataListParm.parammaps.specificDate == '1'" class="day" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart5.getdataListParm.parammaps.inputDatetime" style="width:220px;" :clearable="false" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptionsDate" />
                    </div>
                    <div v-show="tab.chart5.getdataListParm.parammaps.specificDate == '2'" class="week" style="display: inline-block; clear: both;margin-left:10px;">
                      <el-select v-model="tab.chart5.getdataListParm.parammaps.selectYear" class="filter-item" style="width:80px;margin-right:10px;" placeholder="年份" @change="changeChartYear('chart5')">
                        <el-option v-for="item in tab.yearList" :key="item" :label="item" :value="item" />
                      </el-select>
                      <el-select v-model="tab.chart5.getdataListParm.parammaps.selectWeek" class="filter-item" style="width:160px;" multiple :multiple-limit="2" placeholder="请选择周">
                        <el-option v-for="(item,index) in tab.chart5.getdataListParm.parammaps.weekList" :key="index" :label="item.name" :value="item.id" />
                      </el-select>
                    </div>
                    <div v-show="tab.chart5.getdataListParm.parammaps.specificDate == '3'" class="month" style="display: inline-block;margin-left:10px;">
                      <el-date-picker v-model="tab.chart5.getdataListParm.parammaps.chartMonth" style="width:220px;" :clearable="false" value-format="yyyy-MM-dd" type="monthrange" class="inputDatetime filter-item" range-separator="至" :picker-options="pickerOptionsMonth" />
                    </div>
                    <el-button class="successBorder" style="margin-left:10px;" @click="handleChartDate('chart5')">确认</el-button>
                  </div>
                  <div>
                    <div class="exportTable2" @click="handleExport('chart5')">导出</div>
                    <div class="exportTable2" @click="handleTable('chart5')">切换表格</div>
                  </div>
                </div>
                <div v-if="tab.chart5.isChart" id="chartLine5" style="width:100%;height:385px;" />
                <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="385"
                    :row-style="rowStyle"
                    :cell-style="cellStyle"
                    class="elTable table-fixed"
                  >
                    <el-table-column sortable label="日期" min-width="110px" align="center" prop="日期" />
                    <el-table-column sortable label="牲畜类别" min-width="110px" align="center" prop="名称" />
                    <el-table-column sortable label="公斤奶饲料成本（元）" min-width="110px" align="center" prop="准确率" />
                  </el-table>
                </div>
              </div>
            </el-col>
          </el-row>
        </div>
      </el-tab-pane>
      <el-tab-pane label="牛群评估" name="second">
        <div class="search">
          <el-date-picker v-model="tab2.date" :clearable="false" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTab2Date" />
          <el-button class="export" style="float: right;" icon="el-icon-upload2" @click="handleDownload2">导出</el-button>
          <!-- <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled2" @click="handleBefore2" />
          <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled2" @click="handleNext2" /> -->
        </div>
        <div class="table">
          <el-row :gutter="10">
            <el-col :span="12">
              <h4 style="text-align:center;">宾州筛分析</h4>
              <el-table
                :key="tab2.table.tableKey"
                v-loading="tab2.table.listLoading"
                element-loading-text="给我一点时间"
                :data="tab2.table.list"
                border
                fit
                highlight-current-row
                style="width: 100%;"
                :row-style="rowStyle"
                :cell-style="cellStyle"
                class="elTable table-fixed"
                height="400px"
              >
                <el-table-column sortable label="宾州筛" min-width="60px" align="center" prop="barname" />
                <el-table-column sortable label="第一层重量" min-width="60px" align="center" prop="oneweight" />
                <el-table-column sortable label="第一层百分比" min-width="60px" align="center" prop="onerate" />
                <el-table-column sortable label="第二层重量" min-width="60px" align="center" prop="twoweight" />
                <el-table-column sortable label="第二层百分比" min-width="60px" align="center" prop="tworate" />
                <el-table-column sortable label="第三层重量" min-width="60px" align="center" prop="threeweight" />
                <el-table-column sortable label="第三层百分比" min-width="60px" align="center" prop="threerate" />
                <el-table-column sortable label="第四层重量" min-width="60px" align="center" prop="fourweight" />
                <el-table-column sortable label="第四层百分比" min-width="60px" align="center" prop="fourrate" />
                <el-table-column sortable label="参考标准" min-width="50px" align="center" prop="standard" />
              </el-table>
            </el-col>
            <el-col :span="12">
              <h4 style="text-align:center;">粪便筛分析</h4>
              <el-table
                :key="tab2.table2.tableKey"
                v-loading="tab2.table2.listLoading"
                element-loading-text="给我一点时间"
                :data="tab2.table2.list"
                border
                fit
                highlight-current-row
                style="width: 100%;"
                :row-style="rowStyle"
                :cell-style="cellStyle"
                class="elTable table-fixed"
                height="400px"
              >
                <el-table-column sortable label="粪便筛" min-width="60px" align="center" prop="barname" />
                <el-table-column sortable label="第一层重量" min-width="60px" align="center" prop="oneweight" />
                <el-table-column sortable label="第一层百分比" min-width="60px" align="center" prop="onerate" />
                <el-table-column sortable label="第二层重量" min-width="60px" align="center" prop="twoweight" />
                <el-table-column sortable label="第二层百分比" min-width="60px" align="center" prop="tworate" />
                <el-table-column sortable label="第三层重量" min-width="60px" align="center" prop="threeweight" />
                <el-table-column sortable label="第三层百分比" min-width="60px" align="center" prop="threerate" />
                <el-table-column sortable label="参考标准" min-width="50px" align="center" prop="standard" />
              </el-table>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="12">
              <h4 style="text-align:center;">体况评分</h4>
              <el-table
                :key="tab2.table3.tableKey"
                v-loading="tab2.table3.listLoading"
                element-loading-text="给我一点时间"
                :data="tab2.table3.list"
                border
                fit
                highlight-current-row
                style="width: 100%;"
                :row-style="rowStyle"
                :cell-style="cellStyle"
                class="elTable table-fixed"
                height="400px"
              >
                <el-table-column sortable label="栏舍" min-width="60px" align="center" prop="barname" />
                <el-table-column sortable label="抽查样本数" min-width="60px" align="center" prop="sumcowcount" />
                <el-table-column sortable label="单产" min-width="60px" align="center" prop="product" />
                <el-table-column sortable label="干物质采食量" min-width="60px" align="center" prop="dryweight" />
                <el-table-column sortable label="泌乳天数" min-width="50px" align="center" prop="avgdim" />
                <el-table-column sortable label="标准分数" min-width="50px" align="center" prop="standardscore" />
                <el-table-column sortable label="2.5-分（数量、百分比）" min-width="100px" align="center" prop="score25" />
                <el-table-column sortable label="2.75分（数量、百分比)" min-width="100px" align="center" prop="score275" />
                <el-table-column sortable label="3分（数量、百分比）" min-width="90px" align="center" prop="score3" />
                <el-table-column sortable label="3.25分（数量、百分比）" min-width="100px" align="center" prop="score325" />
                <el-table-column sortable label="3.5分（数量、百分比）" min-width="100px" align="center" prop="score35" />
                <el-table-column sortable label="3.75分（数量、百分比）" min-width="100px" align="center" prop="score375" />
                <el-table-column sortable label="4+分（数量、百分比）" min-width="100px" align="center" prop="score4" />
              </el-table>
            </el-col>
            <!-- 粪便评分 -->
            <el-col :span="12">
              <h4 style="text-align:center;">粪便评分</h4>
              <el-table
                :key="tab2.table4.tableKey"
                v-loading="tab2.table4.listLoading"
                element-loading-text="给我一点时间"
                :data="tab2.table4.list"
                border
                fit
                highlight-current-row
                style="width: 100%;"
                :row-style="rowStyle"
                :cell-style="cellStyle"
                class="elTable table-fixed"
                height="400px"
              >
                <el-table-column sortable label="栏舍" min-width="60px" align="center" prop="barname" />
                <el-table-column sortable label="抽查样本数" min-width="60px" align="center" prop="sumcowcount" />
                <el-table-column sortable label="单产" min-width="60px" align="center" prop="product" />
                <el-table-column sortable label="干物质采食量" min-width="60px" align="center" prop="dryweight" />
                <el-table-column sortable label="泌乳天数" min-width="60px" align="center" prop="avgdim" />
                <el-table-column sortable label="标准分数" min-width="60px" align="center" prop="standardscore" />
                <el-table-column sortable label="1分（数量、百分比）" min-width="90px" align="center" prop="score1" />
                <el-table-column sortable label="2分（数量、百分比）" min-width="90px" align="center" prop="score2" />
                <el-table-column sortable label="3分（数量、百分比）" min-width="90px" align="center" prop="score3" />
                <el-table-column sortable label="4分（数量、百分比）" min-width="90px" align="center" prop="score4" />
                <el-table-column sortable label="5分（数量、百分比）" min-width="90px" align="center" prop="score5" />
              </el-table>
            </el-col>
          </el-row>
        </div>
      </el-tab-pane>
    </el-tabs>
    <!-- 导出 -->
    <el-dialog :title="textMap[exportList.dialogStatus]" :visible.sync="exportList.dialogFormVisible" :close-on-click-modal="false" width="20%">
    <div>
      <span>导出时间范围：</span>
      <el-date-picker v-model="exportList.inputDatetime" :clearable="false" style="width: 230px;" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" />
    </div>
    <div slot="footer" class="dialog-footer" style="margin-bottom: 10px;">
      <el-button class="cancelClose" @click="exportList.dialogFormVisible = false">关闭</el-button>
      <el-button  class="save" v-if="activeName=='first'" :disabled="isokDisable" @click="exportList1()">确认</el-button>
      <el-button  class="save" v-else :disabled="isokDisable" @click="exportList2()">确认</el-button>
    </div>
    </el-dialog>
  </div>
</template>

<script>
import echarts from 'echarts'

require('echarts/theme/macarons')
import { GetDataByName, postJson, GetReportform, whichWeek } 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'
import mySelect from '@/components/mySelect'
import * as common from '@/api/common'
export default {
  name: 'PastureFeedingEfficiency',
  components: { Pagination, mySelect },
  data() {
    return {
      Beforedisabled1: false,
      Nextdisabled1: false,
      Beforedisabled2: false,
      Nextdisabled2: false,
      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()
        }
      },
      pickerMinMonth: '',
      pickerOptionsMonth: {
        onPick: ({ maxDate, minDate }) => {
          this.pickerMinMonth = minDate.getTime()
          if (maxDate) {
            this.pickerMinMonth = ''
          }
        },
        // 限制不能选择今天之后的日期
        disabledDate: (time) => {
          if (this.pickerMinMonth !== '') {
            const one = 24 * 3600 * 1000 * 365 * 5
            const minTime = this.pickerMinMonth - 0
            let maxTime = this.pickerMinMonth + one
            if (maxTime > new Date()) {
              maxTime = new Date()
            }
            return time.getTime() < minTime || time.getTime() > maxTime
          }
          return time.getTime() >= Date.now()
        }
      },
      pickerMinDate: '',
      pickerOptionsDate: {
        showWeekNumber: false,
        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()
        }
      },
      activeName: 'first',
      tab: {
        radio: '1',
        isFormulaName: true, // 配方名称
        isHouseName: false, // 栏舍名称
        isLivestockType: false, // 牲畜类别
        chartDate: [],
        selectWeek: [],
        chartMonth: [],
        specificDate: '1',
        selectYear: parseTime(new Date(), '{y}'),
        yearList: [],
        weekList: [],
        table: {
          getdataListParm: {
            name: 'getFeedEfficiencyFT',
            page: 1,
            offset: 1,
            pagecount: '',
            returntype: 'Map',
            parammaps: {
              pastureid: Cookies.get('pastureid'),
              date: parseTime(new Date(), '{y}-{m}-{d}'),
              startTime: parseTime(new Date(), '{y}-{m}-{d}'),
              stopTime: parseTime(new Date(), '{y}-{m}-{d}'),
              ftname: '',
              barname: '',
              cowclass: ''
            }
          },
          tableKey: 1,
          list: [],
          total: 0,
          listLoading: true,
          temp: {}
        },
        chart1: {
          chartLine: null,
          chartLine_data: {},
          getdataListParm: {
            name: 'getFeedEffMR',
            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()],
              specificDate: '1',
              selectYear: parseTime(new Date(), '{y}'),
              selectWeek: '',
              chartMonth: '',
              yearList: [],
              weekList: [],
              status: 0
            }
          },
          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: 'getFeedEffSL',
            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()],
              specificDate: '1',
              selectYear: parseTime(new Date(), '{y}'),
              selectWeek: '',
              chartMonth: '',
              yearList: [],
              weekList: [],
              status: 0
            }
          },
          tableKey: 1,
          list: [],
          total: 0,
          listLoading: true,
          statisticsList: [],
          chart2Data3: [],
          isChart: true,
          isTable: false,
          table: {
            tableKey: 1,
            list: [],
            total: 0,
            listLoading: false
          }
        },

        chart3: {
          chartLine: null,
          chartLine_data: {},
          getdataListParm: {
            name: 'getFeedEffHL',
            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()],
              specificDate: '1',
              selectYear: parseTime(new Date(), '{y}'),
              selectWeek: '',
              chartMonth: '',
              yearList: [],
              weekList: [],
              status: 0
            }
          },
          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: 'getFeedEffZH',
            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()],
              specificDate: '1',
              selectYear: parseTime(new Date(), '{y}'),
              selectWeek: '',
              chartMonth: '',
              yearList: [],
              weekList: [],
              status: 0
            }
          },
          tableKey: 1,
          list: [],
          total: 0,
          listLoading: true,
          statisticsList: [],
          chart4Data3: [],
          isChart: true,
          isTable: false,
          table: {
            tableKey: 1,
            list: [],
            total: 0,
            listLoading: false
          }
        },

        chart5: {
          chartLine: null,
          chartLine_data: {},
          getdataListParm: {
            name: 'getFeedEffCBFT',
            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()],
              specificDate: '1',
              selectYear: parseTime(new Date(), '{y}'),
              selectWeek: '',
              chartMonth: '',
              yearList: [],
              weekList: [],
              status: 0
            }
          },
          tableKey: 1,
          list: [],
          total: 0,
          listLoading: true,
          statisticsList: [],
          chart5Data3: [],
          isChart: true,
          isTable: false,
          table: {
            tableKey: 1,
            list: [],
            total: 0,
            listLoading: false
          }
        }
      },

      tab2: {
        date:parseTime(new Date(), '{y}-{m}-{d}'),
        table: {
          getdataListParm: {
            name: 'getAssessCowPenn',
            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}')
            }
          },
          tableKey: 1,
          list: [],
          total: 0,
          listLoading: true,
          temp: {}
        },
        table2: {
          getdataListParm: {
            name: 'getAssessCowDung',
            page: 1,
            offset: 1,
            pagecount: '',
            returntype: 'Map',
            parammaps: {
              pastureid: Cookies.get('pastureid'),
              date: ''
            }
          },
          tableKey: 1,
          list: [],
          total: 0,
          listLoading: true,
          temp: {}
        },
        table3: {
          getdataListParm: {
            name: 'getAssessBodyscore',
            page: 1,
            offset: 1,
            pagecount: '',
            returntype: 'Map',
            parammaps: {
              pastureid: Cookies.get('pastureid'),
              date: ''
            }
          },
          tableKey: 1,
          list: [],
          total: 0,
          listLoading: true,
          temp: {}
        },
        table4: {
          getdataListParm: {
            name: 'getAssessDungscore',
            page: 1,
            offset: 1,
            pagecount: '',
            returntype: 'Map',
            parammaps: {
              pastureid: Cookies.get('pastureid'),
              date: ''
            }
          },
          tableKey: 1,
          list: [],
          total: 0,
          listLoading: true,
          temp: {}
        }
      },
      exportList:{
        dialogFormVisible:false,
        inputDatetime: [new Date(), new Date()]
      },
      textMap: {
        exportList: '导出',
      },
      isokDisable:false,
      tab2Download2List1:[],
      tab2Download2List2:[],
      tab2Download2List3:[],
      tab2Download2List4:[],
      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
      cellStyle: { padding: 0 + 'px' },
      myHeight: document.documentElement.clientHeight - 85 - 210
    }
  },
  created() {
    this.getAllYear()
    this.getTabList()
    this.getTimeFn()
    this.getChart1()
    this.getChart2()
    this.getChart3()
    this.getChart4()
    this.getChart5()
  },
  methods: {
    getAllYear() {
      var myDate = new Date()
      var thisYear = myDate.getFullYear() // 获取当年年份
      var Section = thisYear - 2001 // 声明一个变量 获得当前年份至想获取年份差 eg.2008
      this.tab.yearList = [] // 声明一个空数组 把遍历出的年份添加到数组里
      for (var i = 0; i <= Section; i++) {
        this.tab.yearList.push(thisYear--)
      }
      console.log(this.tab.yearList)
    },
    changeAllYear() {
      console.log('this.selectYear==>', this.tab.selectYear)
      this.tab.weekList = []
      this.tab.selectWeek = []
      var myWeekList = whichWeek(this.tab.selectYear)
      console.log(myWeekList)
      for (let i = 0; i <= myWeekList.length; i++) {
        var obj = {}
        var a = i + 1
        obj.name = '第' + a + '周(' + myWeekList[i].month + '.' + myWeekList[i].date + '~' + myWeekList[i].last.month + '.' + myWeekList[i].last.date + ')'
        obj.id = i
        this.tab.weekList.push(obj)
      }
    },
    changeAllSpecificDate() {
      var start = ''
      var end = ''
      if (this.tab.specificDate == '2') {
        this.tab.selectYear = parseTime(new Date(), '{y}')
        this.changeAllYear()
      } else if (this.tab.specificDate == '3') {
        start = parseTime(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 31 * 12), '{y}-{m}') + '-01'
        end = parseTime(new Date(), '{y}-{m}-{d}')
        this.tab.chartMonth = []
        this.tab.chartMonth.push(start, end)
      }
    },
    handleAllDate() {
      console.log('点击了确认时间')
      MessageBox.confirm('是否调整以下所有图表查询时间?', {
        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
      }).then(() => {
        var startDate = ''
        var endDate = ''
        var status = ''
        if (this.tab.specificDate == '1') {
          startDate = parseTime(this.tab.chartDate[0], '{y}-{m}-{d}')
          endDate = parseTime(this.tab.chartDate[1], '{y}-{m}-{d}')
          this.tab.chart1.getdataListParm.parammaps.inputDatetime = [startDate, endDate]
          this.tab.chart2.getdataListParm.parammaps.inputDatetime = [startDate, endDate]
          this.tab.chart3.getdataListParm.parammaps.inputDatetime = [startDate, endDate]
          this.tab.chart4.getdataListParm.parammaps.inputDatetime = [startDate, endDate]
          this.tab.chart5.getdataListParm.parammaps.inputDatetime = [startDate, endDate]
          status = 0
          console.log('开始日时==>', startDate)
          console.log('结束日时==>', endDate)
        } else if (this.tab.specificDate == '2') {
          if (this.tab.selectYear == '') {
            this.$message({ type: 'error', message: '请输入年', duration: 2000 })
            return
          }
          if (this.tab.selectWeek.length !== 2) {
            this.$message({ type: 'error', message: '请输入查询开始周跟结束周', duration: 2000 })
            return
          }
          startDate = this.tab.selectYear + '-' + whichWeek(this.tab.selectYear)[this.tab.selectWeek[0]].month + '-' + whichWeek(this.tab.selectYear)[this.tab.selectWeek[0]].date
          endDate = this.tab.selectYear + '-' + whichWeek(this.tab.selectYear)[this.tab.selectWeek[1]].last.month + '-' + whichWeek(this.tab.selectYear)[this.tab.selectWeek[1]].last.date
          status = 1
          this.tab.chart1.getdataListParm.parammaps.selectYear = this.tab.selectYear
          this.tab.chart1.getdataListParm.parammaps.selectWeek = this.tab.selectWeek
          this.tab.chart1.getdataListParm.parammaps.weekList = this.tab.weekList
          this.tab.chart2.getdataListParm.parammaps.selectYear = this.tab.selectYear
          this.tab.chart2.getdataListParm.parammaps.selectWeek = this.tab.selectWeek
          this.tab.chart2.getdataListParm.parammaps.weekList = this.tab.weekList
          this.tab.chart3.getdataListParm.parammaps.selectYear = this.tab.selectYear
          this.tab.chart3.getdataListParm.parammaps.selectWeek = this.tab.selectWeek
          this.tab.chart3.getdataListParm.parammaps.weekList = this.tab.weekList
          this.tab.chart4.getdataListParm.parammaps.selectYear = this.tab.selectYear
          this.tab.chart4.getdataListParm.parammaps.selectWeek = this.tab.selectWeek
          this.tab.chart4.getdataListParm.parammaps.weekList = this.tab.weekList
          this.tab.chart5.getdataListParm.parammaps.selectYear = this.tab.selectYear
          this.tab.chart5.getdataListParm.parammaps.selectWeek = this.tab.selectWeek
          this.tab.chart5.getdataListParm.parammaps.weekList = this.tab.weekList
          console.log('开始周时间==>', startDate)
          console.log('结束周时间==>', endDate)
        } else if (this.tab.specificDate == '3') {
          if (this.tab.chartMonth.length > 0) {
            startDate = this.tab.chartMonth[0]
            var dataArr = this.tab.chartMonth[1].substring(0, 7).split('-')
            let temp = new Date(dataArr[0],dataArr[1],0);
            let mm = temp.getDate(); //这里mm就是天数啦
            endDate = this.tab.chartMonth[1].substring(0, 8) + mm
            status = 2
            this.tab.chart1.getdataListParm.parammaps.chartMonth = [startDate, endDate]
            this.tab.chart2.getdataListParm.parammaps.chartMonth = [startDate, endDate]
            this.tab.chart3.getdataListParm.parammaps.chartMonth = [startDate, endDate]
            this.tab.chart4.getdataListParm.parammaps.chartMonth = [startDate, endDate]
            this.tab.chart5.getdataListParm.parammaps.chartMonth = [startDate, endDate]
            console.log('开始月时间==>', startDate)
            console.log('结束月时间==>', endDate)
          } else {
            this.$message({ type: 'error', message: '请输入月', duration: 2000 })
          }
        }
        this.tab.chart1.getdataListParm.parammaps.specificDate = this.tab.specificDate
        this.tab.chart1.getdataListParm.parammaps.startTime = startDate
        this.tab.chart1.getdataListParm.parammaps.stopTime = endDate
        this.tab.chart1.getdataListParm.parammaps.status = status
        this.tab.chart2.getdataListParm.parammaps.startTime = startDate
        this.tab.chart2.getdataListParm.parammaps.stopTime = endDate
        this.tab.chart2.getdataListParm.parammaps.status = status
        this.tab.chart2.getdataListParm.parammaps.specificDate = this.tab.specificDate
        this.tab.chart3.getdataListParm.parammaps.startTime = startDate
        this.tab.chart3.getdataListParm.parammaps.stopTime = endDate
        this.tab.chart3.getdataListParm.parammaps.status = status
        this.tab.chart3.getdataListParm.parammaps.specificDate = this.tab.specificDate
        this.tab.chart4.getdataListParm.parammaps.startTime = startDate
        this.tab.chart4.getdataListParm.parammaps.stopTime = endDate
        this.tab.chart4.getdataListParm.parammaps.status = status
        this.tab.chart4.getdataListParm.parammaps.specificDate = this.tab.specificDate
        this.tab.chart5.getdataListParm.parammaps.startTime = startDate
        this.tab.chart5.getdataListParm.parammaps.stopTime = endDate
        this.tab.chart5.getdataListParm.parammaps.status = status
        this.tab.chart5.getdataListParm.parammaps.specificDate = this.tab.specificDate
        this.getChart1()
        this.getChart2()
        this.getChart3()
        this.getChart4()
        this.getChart5()
      })
    },
    changeChartSpecificDate(item) {
      var start = ''
      var end = ''
      if (item == 'chart1') {
        if (this.tab.chart1.getdataListParm.parammaps.specificDate == '2') {
          this.tab.chart1.getdataListParm.parammaps.selectYear = parseTime(new Date(), '{y}')
          this.changeChartYear(item)
        } else if (this.tab.chart1.getdataListParm.parammaps.specificDate == '3') {
          start = parseTime(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 31 * 12), '{y}-{m}') + '-01'
          end = parseTime(new Date(), '{y}-{m}-{d}')
          this.tab.chart1.getdataListParm.parammaps.weekList = []
          this.tab.chart1.getdataListParm.parammaps.chartMonth = []
          this.tab.chart1.getdataListParm.parammaps.chartMonth.push(start, end)
        }
      } else if (item == 'chart2') {
        if (this.tab.chart2.getdataListParm.parammaps.specificDate == '2') {
          this.tab.chart2.getdataListParm.parammaps.selectYear = parseTime(new Date(), '{y}')
          this.changeChartYear(item)
        } else if (this.tab.chart2.getdataListParm.parammaps.specificDate == '3') {
          start = parseTime(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 31 * 12), '{y}-{m}') + '-01'
          end = parseTime(new Date(), '{y}-{m}-{d}')
          this.tab.chart2.getdataListParm.parammaps.weekList = []
          this.tab.chart2.getdataListParm.parammaps.chartMonth = []
          this.tab.chart2.getdataListParm.parammaps.chartMonth.push(start, end)
        }
      } else if (item == 'chart3') {
        if (this.tab.chart3.getdataListParm.parammaps.specificDate == '2') {
          this.tab.chart3.getdataListParm.parammaps.selectYear = parseTime(new Date(), '{y}')
          this.changeChartYear(item)
        } else if (this.tab.chart3.getdataListParm.parammaps.specificDate == '3') {
          start = parseTime(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 31 * 12), '{y}-{m}') + '-01'
          end = parseTime(new Date(), '{y}-{m}-{d}')
          this.tab.chart3.getdataListParm.parammaps.weekList = []
          this.tab.chart3.getdataListParm.parammaps.chartMonth = []
          this.tab.chart3.getdataListParm.parammaps.chartMonth.push(start, end)
        }
      } else if (item == 'chart4') {
        if (this.tab.chart4.getdataListParm.parammaps.specificDate == '2') {
          this.tab.chart4.getdataListParm.parammaps.selectYear = parseTime(new Date(), '{y}')
          this.changeChartYear(item)
        } else if (this.tab.chart4.getdataListParm.parammaps.specificDate == '3') {
          start = parseTime(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 31 * 12), '{y}-{m}') + '-01'
          end = parseTime(new Date(), '{y}-{m}-{d}')
          this.tab.chart4.getdataListParm.parammaps.weekList = []
          this.tab.chart4.getdataListParm.parammaps.chartMonth = []
          this.tab.chart4.getdataListParm.parammaps.chartMonth.push(start, end)
        }
      } else if (item == 'chart5') {
        if (this.tab.chart5.getdataListParm.parammaps.specificDate == '2') {
          this.tab.chart5.getdataListParm.parammaps.selectYear = parseTime(new Date(), '{y}')
          this.changeChartYear(item)
        } else if (this.tab.chart5.getdataListParm.parammaps.specificDate == '3') {
          start = parseTime(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 31 * 12), '{y}-{m}') + '-01'
          end = parseTime(new Date(), '{y}-{m}-{d}')
          this.tab.chart5.getdataListParm.parammaps.weekList = []
          this.tab.chart5.getdataListParm.parammaps.chartMonth = []
          this.tab.chart5.getdataListParm.parammaps.chartMonth.push(start, end)
        }
      }
    },
    changeChartYear(item) {
      var myWeekList = ''
      if (item == 'chart1') {
        this.tab.chart1.getdataListParm.parammaps.weekList = []
        this.tab.chart1.getdataListParm.parammaps.selectWeek = []
        myWeekList = whichWeek(this.tab.chart1.getdataListParm.parammaps.selectYear)
        console.log(myWeekList)
        for (let i = 0; i <= myWeekList.length; i++) {
          var obj = {}
          var a = i + 1
          obj.name = '第' + a + '周(' + myWeekList[i].month + '.' + myWeekList[i].date + '~' + myWeekList[i].last.month + '.' + myWeekList[i].last.date + ')'
          obj.id = i
          this.tab.chart1.getdataListParm.parammaps.weekList.push(obj)
        }
      } else if (item == 'chart2') {
        this.tab.chart2.getdataListParm.parammaps.selectWeek = []
        this.tab.chart2.getdataListParm.parammaps.weekList = []
        myWeekList = whichWeek(this.tab.chart2.getdataListParm.parammaps.selectYear)
        console.log(myWeekList)
        for (let i = 0; i <= myWeekList.length; i++) {
          var obj = {}
          var a = i + 1
          obj.name = '第' + a + '周(' + myWeekList[i].month + '.' + myWeekList[i].date + '~' + myWeekList[i].last.month + '.' + myWeekList[i].last.date + ')'
          obj.id = i
          this.tab.chart2.getdataListParm.parammaps.weekList.push(obj)
        }
      } else if (item == 'chart3') {
        this.tab.chart3.getdataListParm.parammaps.selectWeek = []
        this.tab.chart3.getdataListParm.parammaps.weekList = []
        myWeekList = whichWeek(this.tab.chart3.getdataListParm.parammaps.selectYear)
        console.log(myWeekList)
        for (let i = 0; i <= myWeekList.length; i++) {
          var obj = {}
          var a = i + 1
          obj.name = '第' + a + '周(' + myWeekList[i].month + '.' + myWeekList[i].date + '~' + myWeekList[i].last.month + '.' + myWeekList[i].last.date + ')'
          obj.id = i
          this.tab.chart3.getdataListParm.parammaps.weekList.push(obj)
        }
      } else if (item == 'chart4') {
        this.tab.chart4.getdataListParm.parammaps.selectWeek = []
        this.tab.chart4.getdataListParm.parammaps.weekList = []
        myWeekList = whichWeek(this.tab.chart4.getdataListParm.parammaps.selectYear)
        console.log(myWeekList)
        for (let i = 0; i <= myWeekList.length; i++) {
          var obj = {}
          var a = i + 1
          obj.name = '第' + a + '周(' + myWeekList[i].month + '.' + myWeekList[i].date + '~' + myWeekList[i].last.month + '.' + myWeekList[i].last.date + ')'
          obj.id = i
          this.tab.chart4.getdataListParm.parammaps.weekList.push(obj)
        }
      } else if (item == 'chart5') {
        this.tab.chart5.getdataListParm.parammaps.selectWeek = []
        this.tab.chart5.getdataListParm.parammaps.weekList = []
        myWeekList = whichWeek(this.tab.chart5.getdataListParm.parammaps.selectYear)
        console.log(myWeekList)
        for (let i = 0; i <= myWeekList.length; i++) {
          var obj = {}
          var a = i + 1
          obj.name = '第' + a + '周(' + myWeekList[i].month + '.' + myWeekList[i].date + '~' + myWeekList[i].last.month + '.' + myWeekList[i].last.date + ')'
          obj.id = i
          this.tab.chart5.getdataListParm.parammaps.weekList.push(obj)
        }
      }
    },
    handleChartDate(item) {
      console.log(item)
      var startDate = ''
      var endDate = ''
      if (item == 'chart1') {
        if (this.tab.chart1.getdataListParm.parammaps.specificDate == '1') {
          startDate = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
          endDate = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
          console.log('泌乳牛干物质采食量开始日期==>', startDate)
          console.log('泌乳牛干物质采食量结束日期==>', endDate)
          this.tab.chart1.getdataListParm.parammaps.status = 0
        } else if (this.tab.chart1.getdataListParm.parammaps.specificDate == '2') {
          if (this.tab.chart1.getdataListParm.parammaps.selectYear == '') {
            this.$message({ type: 'error', message: '请输入年', duration: 2000 })
            return
          }
          if (this.tab.chart1.getdataListParm.parammaps.selectWeek.length !== 2) {
            this.$message({ type: 'error', message: '请输入查询开始周跟结束周', duration: 2000 })
            return
          }
          startDate = this.tab.chart1.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart1.getdataListParm.parammaps.selectYear)[this.tab.chart1.getdataListParm.parammaps.selectWeek[0]].month + '-' + whichWeek(this.tab.chart1.getdataListParm.parammaps.selectYear)[this.tab.chart1.getdataListParm.parammaps.selectWeek[0]].date
          endDate = this.tab.chart1.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart1.getdataListParm.parammaps.selectYear)[this.tab.chart1.getdataListParm.parammaps.selectWeek[1]].last.month + '-' + whichWeek(this.tab.chart1.getdataListParm.parammaps.selectYear)[this.tab.chart1.getdataListParm.parammaps.selectWeek[1]].last.date
          console.log('泌乳牛干物质采食量开始周日期==>', startDate)
          console.log('泌乳牛干物质采食量结束周日期==>', endDate)
          this.tab.chart1.getdataListParm.parammaps.status = 1
        } else if (this.tab.chart1.getdataListParm.parammaps.specificDate == '3') {
          startDate = this.tab.chart1.getdataListParm.parammaps.chartMonth[0]
          endDate = this.tab.chart1.getdataListParm.parammaps.chartMonth[1].substring(0, 8) + '31'
          console.log('泌乳牛干物质采食量开始月日期==>', startDate)
          console.log('泌乳牛干物质采食量结束月日期==>', endDate)
          this.tab.chart1.getdataListParm.parammaps.status = 2
        }
        this.tab.chart1.getdataListParm.parammaps.startTime = startDate
        this.tab.chart1.getdataListParm.parammaps.stopTime = endDate
        this.getChart1()
      } else if (item == 'chart2') {
        if (this.tab.chart2.getdataListParm.parammaps.specificDate == '1') {
          startDate = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
          endDate = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
          this.tab.chart2.getdataListParm.parammaps.status = 0
          console.log('牛栏剩料率开始日期==>', startDate)
          console.log('牛栏剩料率结束日期==>', endDate)
        } else if (this.tab.chart2.getdataListParm.parammaps.specificDate == '2') {
          if (this.tab.chart2.getdataListParm.parammaps.selectYear == '') {
            this.$message({ type: 'error', message: '请输入年', duration: 2000 })
            return
          }
          if (this.tab.chart2.getdataListParm.parammaps.selectWeek.length !== 2) {
            this.$message({ type: 'error', message: '请输入查询开始周跟结束周', duration: 2000 })
            return
          }
          startDate = this.tab.chart2.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart2.getdataListParm.parammaps.selectYear)[this.tab.chart2.getdataListParm.parammaps.selectWeek[0]].month + '-' + whichWeek(this.tab.chart2.getdataListParm.parammaps.selectYear)[this.tab.chart2.getdataListParm.parammaps.selectWeek[0]].date
          endDate = this.tab.chart2.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart2.getdataListParm.parammaps.selectYear)[this.tab.chart2.getdataListParm.parammaps.selectWeek[1]].last.month + '-' + whichWeek(this.tab.chart2.getdataListParm.parammaps.selectYear)[this.tab.chart2.getdataListParm.parammaps.selectWeek[1]].last.date
          this.tab.chart2.getdataListParm.parammaps.status = 1
          console.log('牛栏剩料率开始周日期==>', startDate)
          console.log('牛栏剩料率结束周日期==>', endDate)
        } else if (this.tab.chart2.getdataListParm.parammaps.specificDate == '3') {
          console.log('牛栏剩料率开始月日期==>', this.tab.chart2.getdataListParm.parammaps.chartMonth)
          startDate = this.tab.chart2.getdataListParm.parammaps.chartMonth[0]
          endDate = this.tab.chart2.getdataListParm.parammaps.chartMonth[1].substring(0, 8) + '31'
          this.tab.chart2.getdataListParm.parammaps.status = 2
          console.log('牛栏剩料率开始月日期==>', startDate)
          console.log('牛栏剩料率结束月日期==>', endDate)
        }
        this.tab.chart2.getdataListParm.parammaps.startTime = startDate
        this.tab.chart2.getdataListParm.parammaps.stopTime = endDate
        this.getChart2()
      } else if (item == 'chart3') {
        if (this.tab.chart3.getdataListParm.parammaps.specificDate == '1') {
          startDate = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
          endDate = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
          this.tab.chart3.getdataListParm.parammaps.status = 0
          console.log('混料时间统计开始日期==>', startDate)
          console.log('混料时间统计结束日期==>', endDate)
        } else if (this.tab.chart3.getdataListParm.parammaps.specificDate == '2') {
          if (this.tab.chart3.getdataListParm.parammaps.selectYear == '') {
            this.$message({ type: 'error', message: '请输入年', duration: 2000 })
            return
          }
          if (this.tab.chart3.getdataListParm.parammaps.selectWeek.length !== 2) {
            this.$message({ type: 'error', message: '请输入查询开始周跟结束周', duration: 2000 })
            return
          }
          startDate = this.tab.chart3.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart3.getdataListParm.parammaps.selectYear)[this.tab.chart3.getdataListParm.parammaps.selectWeek[0]].month + '-' + whichWeek(this.tab.chart3.getdataListParm.parammaps.selectYear)[this.tab.chart3.getdataListParm.parammaps.selectWeek[0]].date
          endDate = this.tab.chart3.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart3.getdataListParm.parammaps.selectYear)[this.tab.chart3.getdataListParm.parammaps.selectWeek[1]].last.month + '-' + whichWeek(this.tab.chart3.getdataListParm.parammaps.selectYear)[this.tab.chart3.getdataListParm.parammaps.selectWeek[1]].last.date
          this.tab.chart3.getdataListParm.parammaps.status = 1
          console.log('混料时间统计开始周日期==>', startDate)
          console.log('混料时间统计结束周日期==>', endDate)
        } else if (this.tab.chart3.getdataListParm.parammaps.specificDate == '3') {
          startDate = this.tab.chart3.getdataListParm.parammaps.chartMonth[0]
          endDate = this.tab.chart3.getdataListParm.parammaps.chartMonth[1].substring(0, 8) + '31'
          this.tab.chart3.getdataListParm.parammaps.status = 2
          console.log('混料时间统计开始月日期==>', startDate)
          console.log('混料时间统计结束月日期==>', endDate)
        }
        this.tab.chart3.getdataListParm.parammaps.startTime = startDate
        this.tab.chart3.getdataListParm.parammaps.stopTime = endDate
        this.getChart3()
      } else if (item == 'chart4') {
        if (this.tab.chart4.getdataListParm.parammaps.specificDate == '1') {
          startDate = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
          endDate = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
          this.tab.chart4.getdataListParm.parammaps.status = 0
          console.log('转化率开始日期==>', startDate)
          console.log('转化率结束日期==>', endDate)
        } else if (this.tab.chart4.getdataListParm.parammaps.specificDate == '2') {
          if (this.tab.chart4.getdataListParm.parammaps.selectYear == '') {
            this.$message({ type: 'error', message: '请输入年', duration: 2000 })
            return
          }
          if (this.tab.chart4.getdataListParm.parammaps.selectWeek.length !== 2) {
            this.$message({ type: 'error', message: '请输入查询开始周跟结束周', duration: 2000 })
            return
          }
          startDate = this.tab.chart4.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart4.getdataListParm.parammaps.selectYear)[this.tab.chart4.getdataListParm.parammaps.selectWeek[0]].month + '-' + whichWeek(this.tab.chart4.getdataListParm.parammaps.selectYear)[this.tab.chart4.getdataListParm.parammaps.selectWeek[0]].date
          endDate = this.tab.chart4.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart4.getdataListParm.parammaps.selectYear)[this.tab.chart4.getdataListParm.parammaps.selectWeek[1]].last.month + '-' + whichWeek(this.tab.chart4.getdataListParm.parammaps.selectYear)[this.tab.chart4.getdataListParm.parammaps.selectWeek[1]].last.date
          this.tab.chart4.getdataListParm.parammaps.status = 1
          console.log('转化率开始周日期==>', startDate)
          console.log('转化率结束周日期==>', endDate)
        } else if (this.tab.chart4.getdataListParm.parammaps.specificDate == '3') {
          startDate = this.tab.chart4.getdataListParm.parammaps.chartMonth[0]
          endDate = this.tab.chart4.getdataListParm.parammaps.chartMonth[1].substring(0, 8) + '31'
          this.tab.chart4.getdataListParm.parammaps.status = 2
          console.log('转化率开始月日期==>', startDate)
          console.log('转化率结束月日期==>', endDate)
        }
        this.tab.chart4.getdataListParm.parammaps.startTime = startDate
        this.tab.chart4.getdataListParm.parammaps.stopTime = endDate
        this.getChart4()
      } else if (item == 'chart5') {
        if (this.tab.chart5.getdataListParm.parammaps.specificDate == '1') {
          startDate = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
          endDate = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
          this.tab.chart5.getdataListParm.parammaps.status = 0
          console.log('成本分析开始日期==>', startDate)
          console.log('成本分析结束日期==>', endDate)
        } else if (this.tab.chart5.getdataListParm.parammaps.specificDate == '2') {
          if (this.tab.chart5.getdataListParm.parammaps.selectYear == '') {
            this.$message({ type: 'error', message: '请输入年', duration: 2000 })
            return
          }
          if (this.tab.chart5.getdataListParm.parammaps.selectWeek.length !== 2) {
            this.$message({ type: 'error', message: '请输入查询开始周跟结束周', duration: 2000 })
            return
          }
          startDate = this.tab.chart5.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart5.getdataListParm.parammaps.selectYear)[this.tab.chart5.getdataListParm.parammaps.selectWeek[0]].month + '-' + whichWeek(this.tab.chart5.getdataListParm.parammaps.selectYear)[this.tab.chart5.getdataListParm.parammaps.selectWeek[0]].date
          endDate = this.tab.chart5.getdataListParm.parammaps.selectYear + '-' + whichWeek(this.tab.chart5.getdataListParm.parammaps.selectYear)[this.tab.chart5.getdataListParm.parammaps.selectWeek[1]].last.month + '-' + whichWeek(this.tab.chart5.getdataListParm.parammaps.selectYear)[this.tab.chart5.getdataListParm.parammaps.selectWeek[1]].last.date
          this.tab.chart5.getdataListParm.parammaps.status = 1
          console.log('成本分析开始周日期==>', startDate)
          console.log('成本分析结束周日期==>', endDate)
        } else if (this.tab.chart5.getdataListParm.parammaps.specificDate == '3') {
          startDate = this.tab.chart5.getdataListParm.parammaps.chartMonth[0]
          endDate = this.tab.chart5.getdataListParm.parammaps.chartMonth[1].substring(0, 8) + '31'
          this.tab.chart5.getdataListParm.parammaps.status = 2
          console.log('成本分析开始月日期==>', startDate)
          console.log('成本分析结束月日期==>', endDate)
        }
        this.tab.chart5.getdataListParm.parammaps.startTime = startDate
        this.tab.chart5.getdataListParm.parammaps.stopTime = endDate
        this.getChart5()
      }
    },
    getTimeFn() {
      const that = this
      const end = new Date()
      const start = new Date()
      const start2 = new Date()
      start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 10)
      end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)

      that.tab.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
      that.tab.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
      that.tab.table.getdataListParm.parammaps.stopTime = 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() {
      this.exportList.dialogFormVisible = true
      this.exportList.dialogStatus = 'exportList'
    },
    exportList1(){
      this.isokDisable = true
      var url = 'authdata/GetDataByName'
      var data = {
        'name':"getFeedEfficiencyFT",
        "page":1,"offset":1,"pagecount":"","returntype":"Map",
        "parammaps":{"pastureid":Cookies.get('pastureid'),"startTime":"","stopTime":"","barname":"","cowclass":"",'ftname':''}
      }
      data.parammaps.startTime = parseTime(this.exportList.inputDatetime[0],'{y}-{m}-{d}')
      data.parammaps.stopTime = parseTime(this.exportList.inputDatetime[1],'{y}-{m}-{d}')
      data.parammaps.barname = this.tab.table.getdataListParm.parammaps.barname
      data.parammaps.ftname = this.tab.table.getdataListParm.parammaps.ftname
      data.parammaps.cowclass = this.tab.table.getdataListParm.parammaps.cowclass
      postJson(url,data).then(response => {
        var exportList = []
        if (response.data.list !== null) {
          exportList = response.data.list
        } else {
          exportList = []
        }
        if (this.tab.radio == '1') {
          var excelDatas = [
            {
              tHeader: ['配方模板', '实际牛头数', '应混料量（kg）', '实际混料量（kg）', '撒料量（kg）', '平均混料时间（min）', '转投剩料量（kg）', '今日剩料量（kg）', '剩料率（%）', 'TMR干物质（%）', '配方干物质采食量（kg/头）', '实际干物质采食量（kg/头）', '采食率（%）', '配方成本(元/头 )', '实际成本(元/ 头)', '产奶量（kg /头）', '饲料转化率', '公斤奶饲料成本'],
              filterVal: ['配方模板', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', '采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
              tableDatas: this.tab.table.list,
              sheetName: '配方'
            }
          ]
          json2excel(excelDatas, '效率统计-配方', true, 'xlsx')
        } else if (this.tab.radio == '2') {
          var excelDatas2 = [
            {
              tHeader: ['栏舍', '配方模板', '实际牛头数', '应混料量（kg）', '实际混料量（kg）', '撒料量（kg）', '平均混料时间（min）', '转投剩料量（kg）', '今日剩料量（kg）', '剩料率（%）', 'TMR干物质（%）', '配方干物质采食量（kg/头）', ' 实际干物质采食量（ kg/头）', '采食率 （%）', '配方成本( 元/头)', '实际成本 (元/头)', '产奶量（kg/头）', '饲料转化率', '公斤奶饲料成本'],
              filterVal: ['栏舍', '配方模板', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', '采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
              tableDatas: this.tab.table.list,
              sheetName: '栏舍'
            }
          ]
          json2excel(excelDatas2, '效率统计-栏舍', true, 'xlsx')
        } else if (this.tab.radio == '3') {
          var excelDatas3 = [
            {
              tHeader: ['牲畜类别', '实际牛头数', '应混料量（kg）', '实际混料量（kg）', '撒料量（kg）', '平均混料时间（min）', '转投剩料量（kg）', '今日剩料量（kg）', '剩料率（%）', 'TMR干物质（%）', '配方 物质采食量（kg/ 头）', '实际干物质采 食量（kg/头）', ' 采食率（%）', '配方 成本(元/头)', '实际成本(元/头)', '产奶量（kg/头）', '饲料转化率', '公斤奶饲料成本'],
              filterVal: ['牲畜类别', '实际牛头数', '应混料量', '实际混料量', '撒料量', '混料时间', '转投剩料量', '今日剩料量', '剩料率', 'TMR干物质', '配方干物质采食量', '实际干物质采食量', ' 采食率', '配方成本', '实际成本', '产奶量', '饲料转化率', '公斤奶饲料成本'],
              tableDatas: this.tab.table.list,
              sheetName: '牲畜类别'
            }
          ]
          json2excel(excelDatas3, '效率统计-牲畜类别', true, 'xlsx')
        }
        this.isokDisable = false
        this.exportList.dialogFormVisible = false
      })
    },
    handleDownload2(){
      this.exportList.dialogFormVisible = true
      this.exportList.dialogStatus = 'exportList'
    },
    exportList2(){
      this.isokDisable = true
      this.getTab2Download2List()
    },
    // 宾州筛分析
    getTab2Download2List() {
      var url = 'authdata/GetDataByName'
      var data = {
        'name':"getAssessCowPenn",
        "page":1,"offset":1,"pagecount":"","returntype":"Map",
        "parammaps":{"pastureid":Cookies.get('pastureid'),"startTime":"","stopTime":""}
      }
      data.parammaps.startTime = parseTime(this.exportList.inputDatetime[0],'{y}-{m}-{d}')
      data.parammaps.stopTime = parseTime(this.exportList.inputDatetime[1],'{y}-{m}-{d}')
      postJson(url,data).then(response => {
        if (response.data.list !== null) {
          this.tab2Download2List1 = response.data.list
        } else {
          this.tab2Download2List1 = []
        }
        this.getTab2Download2List2()
      })
    },

    // 粪便筛分析
    getTab2Download2List2() {
      var url = 'authdata/GetDataByName'
      var data = {
        'name':"getAssessCowDung",
        "page":1,"offset":1,"pagecount":"","returntype":"Map",
        "parammaps":{"pastureid":Cookies.get('pastureid'),"startTime":"","stopTime":""}
      }
      data.parammaps.startTime = parseTime(this.exportList.inputDatetime[0],'{y}-{m}-{d}')
      data.parammaps.stopTime = parseTime(this.exportList.inputDatetime[1],'{y}-{m}-{d}')
      postJson(url,data).then(response => {
        if (response.data.list !== null) {
          this.tab2Download2List2 = response.data.list
        } else {
          this.tab2Download2List2 = []
        }
        this.getTab2Download2List3()
      })
    },

    // BCS评分
    getTab2Download2List3() {
      var url = 'authdata/GetDataByName'
      var data = {
        'name':"getAssessBodyscore",
        "page":1,"offset":1,"pagecount":"","returntype":"Map",
        "parammaps":{"pastureid":Cookies.get('pastureid'),"startTime":"","stopTime":""}
      }
      data.parammaps.startTime = parseTime(this.exportList.inputDatetime[0],'{y}-{m}-{d}')
      data.parammaps.stopTime = parseTime(this.exportList.inputDatetime[1],'{y}-{m}-{d}')
      postJson(url,data).then(response => {
        if (response.data.list !== null) {
          this.tab2Download2List3 = response.data.list
        } else {
          this.tab2Download2List3 = []
        }
        this.getTab2Download2List4()
      })
    },

    // 粪便评分
    getTab2Download2List4() {
      var url = 'authdata/GetDataByName'
      var data = {
        'name':"getAssessDungscore",
        "page":1,"offset":1,"pagecount":"","returntype":"Map",
        "parammaps":{"pastureid":Cookies.get('pastureid'),"startTime":"","stopTime":""}
      }
      data.parammaps.startTime = parseTime(this.exportList.inputDatetime[0],'{y}-{m}-{d}')
      data.parammaps.stopTime = parseTime(this.exportList.inputDatetime[1],'{y}-{m}-{d}')
      postJson(url,data).then(response => {
        if (response.data.list !== null) {
          this.tab2Download2List4 = response.data.list
        } else {
          this.tab2Download2List4 = []
        }
        var excelDatas0 = [
          {
            tHeader: ['宾州筛','第一层重量','第一层百分比','第二层重量','第二层百分比','第三层重量','第三层百分比','第四层重量','第四层百分比','参考标准'],
            filterVal: ['barname','oneweight','onerate','twoweight','tworate','threeweight','threerate','fourweight','fourrate','standard'],
            tableDatas: this.tab2Download2List1,
            sheetName: '宾州筛分析'
          },
          {
            tHeader: ['粪便筛','第一层重量','第一层百分比','第二层重量','第二层百分比','第三层重量','第三层百分比','参考标准'],
            filterVal: ['barname','oneweight','onerate','twoweight','tworate','threeweight','threerate','standard'],
            tableDatas: this.tab2Download2List2,
            sheetName: '粪便筛分析'
          },
          {
            tHeader: ['栏舍','抽查样本数','单产','干物质采食量','泌乳天数','标准分数','2.5-分（数量、百分比）','2.75分（数量、百分比)','3分（数量、百分比）','3.25分（数量、百分比）','3.5分（数量、百分比）','3.75分（数量、百分比）','4+分（数量、百分比）'],
            filterVal: ['barname','sumcowcount','product','dryweight','avgdim','standardscore','score25','score275','score3','score325','score35','score375','score4'],
            tableDatas: this.tab2Download2List3,
            sheetName: '体况评分'
          },
          {
            tHeader: ['栏舍','抽查样本数','单产','干物质采食量','泌乳天数','标准分数','1分（数量、百分比）','2分（数量、百分比）','3分（数量、百分比）','4分（数量、百分比）','5分（数量、百分比）'],
            filterVal: ['barname','sumcowcount','product','dryweight','avgdim','standardscore','score1','score2','score3','score4','score5',],
            tableDatas: this.tab2Download2List4,
            sheetName: '粪便评分'
          }
        ]
        json2excel(excelDatas0, '饲喂效率—牛群评估', true, 'xlsx')
        this.exportList.dialogFormVisible = false
        this.isokDisable = false
      })
    },
    // Tab切换
    handleTabClick() {
      if (this.activeName == 'first') {
        const start2 = new Date()
        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
        this.tab.table.getdataListParm.parammaps.date = parseTime(start2, '{y}-{m}-{d}')
        this.tab.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
        this.tab.table.getdataListParm.parammaps.stopTime = parseTime(start2, '{y}-{m}-{d}')
        this.getTabList()
        this.getChart1()
        this.getChart2()
        this.getChart3()
        this.getChart4()
        this.getChart5()
      } else if (this.activeName == 'second') {
        const start2 = new Date()
        start2.setTime(start2.getTime() - 3600 * 1000 * 24 * 1)
        this.tab2.date = parseTime(start2, '{y}-{m}-{d}')
        this.tab2.table.getdataListParm.parammaps.startTime = parseTime(start2, '{y}-{m}-{d}')
        this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(start2, '{y}-{m}-{d}')
        this.getTab2List()
        this.getTab2List2()
        this.getTab2List3()
        this.getTab2List4()
      }
    },
    // 切换统计类型
    changeRadio() {
      console.log(this.tab.radio)
      if (this.tab.radio == '1') {
        console.log('配方名称')
        this.tab.isFormulaName = true
        this.tab.isHouseName = false
        this.tab.isLivestockType = false
        this.tab.table.getdataListParm.parammaps.ftname = ''
        this.tab.table.getdataListParm.parammaps.barname = ''
        this.tab.table.getdataListParm.parammaps.ftname = ''
        this.tab.table.getdataListParm.parammaps.cowclass = ''
        this.tab.table.getdataListParm.name = 'getFeedEfficiencyFT'
        this.getTabList()
        this.tab.chart5.statisticsList = []
        this.tab.chart5.getdataListParm.name = 'getFeedEffCBFT'
        this.getChart5()
        this.tab.chart4.getdataListParm.name = 'getFeedEffZH'
        this.getChart4()
      } else if (this.tab.radio == '2') {
        console.log('栏舍名称')
        this.tab.isFormulaName = false
        this.tab.isHouseName = true
        this.tab.isLivestockType = false
        this.tab.table.getdataListParm.parammaps.ftname = ''
        this.tab.table.getdataListParm.parammaps.barname = ''
        this.tab.table.getdataListParm.parammaps.ftname = ''
        this.tab.table.getdataListParm.parammaps.cowclass = ''
        this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
        this.getTabList()
        this.tab.chart5.statisticsList = []
        this.tab.chart5.getdataListParm.name = 'getFeedEffCBLS'
        this.getChart5()
        this.tab.chart4.getdataListParm.name = 'getFeedEffZHLS'
        this.getChart4()
      } else if (this.tab.radio == '3') {
        console.log(' 牲畜类别')
        this.tab.isFormulaName = false
        this.tab.isHouseName = false
        this.tab.isLivestockType = true
        this.tab.table.getdataListParm.parammaps.ftname = ''
        this.tab.table.getdataListParm.parammaps.barname = ''
        this.tab.table.getdataListParm.parammaps.ftname = ''
        this.tab.table.getdataListParm.parammaps.cowclass = ''
        this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
        this.getTabList()
        this.tab.chart5.statisticsList = []
        this.tab.chart5.getdataListParm.name = 'getFeedEffCB'
        this.getChart5()
        this.tab.chart4.getdataListParm.name = 'getFeedEffZHSC'
        this.getChart4()
      }
    },

    // 效率统计
    getTabList() {
      this.tab.table.listLoading = true
      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() {
      if (this.tab.radio == '1') {
        console.log('配方名称/查询')
        this.tab.isFormulaName = true
        this.tab.isHouseName = false
        this.tab.isLivestockType = false
        this.tab.table.getdataListParm.name = 'getFeedEfficiencyFT'
        this.getTabList()
      } else if (this.tab.radio == '2') {
        console.log('栏舍名称/查询')
        this.tab.isFormulaName = false
        this.tab.isHouseName = true
        this.tab.isLivestockType = false
        this.tab.table.getdataListParm.name = 'getFeedEfficiencyLS'
        this.getTabList()
      } else if (this.tab.radio == '3') {
        console.log(' 牲畜类别/查询')
        this.tab.isFormulaName = false
        this.tab.isHouseName = false
        this.tab.isLivestockType = true
        this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
        this.getTabList()
      }
    },
    changeTab1Date(){
      this.tab.table.getdataListParm.parammaps.startTime = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')
      this.tab.table.getdataListParm.parammaps.stopTime = parseTime(this.tab.table.getdataListParm.parammaps.date, '{y}-{m}-{d}')
      this.getTabList()
    },
    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))
        if (start > Date.now() - 8.64e7) {
          this.Nextdisabled1 = true
          this.Beforedisabled1 = false
        } else {
          this.Nextdisabled1 = false
          this.Beforedisabled1 = false
        }
        this.tab.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
        this.tab.table.getdataListParm.parammaps.stopTime = parseTime(start, '{y}-{m}-{d}')
        this.getTabList()
      }
    },
    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))
        if (stop > Date.now() - 8.64e7) {
          this.Nextdisabled1 = true
          this.Beforedisabled1 = false
        } else {
          this.Nextdisabled1 = false
          this.Beforedisabled1 = false
        }
        this.tab.table.getdataListParm.parammaps.date = parseTime(stop, '{y}-{m}-{d}')
        this.tab.table.getdataListParm.parammaps.startTime = parseTime(stop, '{y}-{m}-{d}')
        this.tab.table.getdataListParm.parammaps.stopTime = parseTime(stop, '{y}-{m}-{d}')
        this.getTabList()
      }
    },
    handleBefore2() {
      if (this.tab2.date !== '' && this.tab2.date !== null) {
        this.tab2.date = new Date(this.tab2.date)
        var start = new Date(this.tab2.date.setDate(this.tab2.date.getDate() - 1))
        if (start > Date.now() - 8.64e7) {
          this.Nextdisabled2 = true
          this.Beforedisabled2 = false
        } else {
          this.Nextdisabled2 = false
          this.Beforedisabled2 = false
        }
        this.tab2.date = parseTime(start, '{y}-{m}-{d}')
        this.tab2.table.getdataListParm.parammaps.startTime = parseTime(start, '{y}-{m}-{d}')
        this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(start, '{y}-{m}-{d}')
        this.getTab2List()
        this.getTab2List2()
        this.getTab2List3()
        this.getTab2List4()
      }
    },
    handleNext2() {
      if (this.tab2.date !== '' && this.tab2.date !== null) {
        this.tab2.date = new Date(this.tab2.date)
        var stop = new Date(this.tab2.date.setDate(this.tab2.date.getDate() + 1))
        if (stop > Date.now() - 8.64e7) {
          this.Nextdisabled2 = true
          this.Beforedisabled2 = false
        } else {
          this.Nextdisabled2 = false
          this.Beforedisabled2 = false
        }
        this.tab2.date = parseTime(stop, '{y}-{m}-{d}')
        this.tab2.table.getdataListParm.parammaps.startTime = parseTime(stop, '{y}-{m}-{d}')
        this.tab2.table.getdataListParm.parammaps.stopTime = parseTime(stop, '{y}-{m}-{d}')
        this.getTab2List()
        this.getTab2List2()
        this.getTab2List3()
        this.getTab2List4()
      }
    },
    // 快速跳转到图表
    handleQuickJumpChart() {
      var myHeight = document.getElementById('table').offsetHeight + 120
      window.scrollTo(myHeight, myHeight)
    },
    // 快速回到顶部
    handleQuickJumpTop() {
      window.scrollTo(0, 0)
    },
    // 泌乳牛干物质采食量
    getChart1() {
      this.tab.chart1.listLoading = true
      const url = 'authdata/chart/feedEffMR'
      const data = {}
      data.parammaps = {}
      if (this.tab.chart1.getdataListParm.parammaps.specificDate == '1') {
        data.parammaps.pastureid = this.tab.chart1.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
        data.parammaps.stopTime = parseTime(this.tab.chart1.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
        data.parammaps.status = this.tab.chart1.getdataListParm.parammaps.status
      } else {
        data.parammaps.pastureid = this.tab.chart1.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = this.tab.chart1.getdataListParm.parammaps.startTime
        data.parammaps.stopTime = this.tab.chart1.getdataListParm.parammaps.stopTime
        data.parammaps.status = this.tab.chart1.getdataListParm.parammaps.status
      }
      postJson(url, data).then(response => {
        if (response.data !== null && response.data.list !== null && response.data.data !== null) {
          console.log('泌乳牛干物质采食量图表数据', response.data.list)
          for (let i = 0; i < response.data.data.length; i++) {
            if (response.data.data[i].field1 !== '' && response.data.data[i].field1 !== undefined) {
              response.data.data[i].field1 = parseFloat(response.data.data[i].field1)
            }
            if (response.data.data[i].field2 !== '' && response.data.data[i].field2 !== undefined) {
              response.data.data[i].field2 = parseFloat(response.data.data[i].field2)
            }
          }
          this.tab.chart1.table.list = response.data.data
          this.tab.chart1.chartLine_data = response.data.list
          // this.tab.chart1.total = response.data.total
        } else {
          this.tab.chart1.list = []
          this.tab.chart1.chartLine_data = {}
        }
        this.roadChartLine1(this.tab.chart1.chartLine_data)
        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 = {
        tooltip: { trigger: 'axis', axisPointer: { type: 'cross', crossStyle: { color: '#999' }}},
        legend: { data: ['泌乳牛干物质采食量', '泌乳牛产奶量'], right: 10, show: true, type: 'scroll' },
        grid: { top: '15%', left: '8%', right: '8%', containLabel: true },
        xAxis: [{ type: 'category', data: chartLine_data.data1 }],
        yAxis: [
          { splitLine: { show: false }, type: 'value', name: '泌乳牛干物质\n采食量', axisLabel: { formatter: '{value} ' }},
          { splitLine: { show: false }, type: 'value', name: '泌乳牛产奶量', axisLabel: { formatter: '{value} ' }}
        ],
        series: [
          { name: '泌乳牛干物质采食量', type: 'bar', itemStyle: { normal: { color: '#61a5e8' }}, data: chartLine_data.data2 },
          { name: '泌乳牛产奶量', type: 'line', itemStyle: { normal: { color: '#ff2d2d' }}, yAxisIndex: 1, data: chartLine_data.data3 }
        ]
      }
      this.tab.chart1.chartLine.setOption(option)
      window.onresize = function() {
        this.tab.chart1.chartLine.resize()
      }
    },

    // 牛栏剩料率
    changeStatisticChart2(arr) {
      var arr1 = []
      for (let i = 0; i < arr.length; i++) {
        if (arr[i] !== 'all') {
          arr1.push(arr[i])
        }
      }
      this.tab.chart2.getdataListParm.parammaps.statisticsList = arr1
      var arrData3 = []
      for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
        const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
        for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
          if (j == myId) {
            arrData3.push(this.tab.chart2.chart2Data3[j])
          }
        }
      }
      this.tab.chart2.chartLine_data.data3 = arrData3
      this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
      this.roadChartLine2(this.tab.chart2.chartLine_data)
    },

    // 牛栏剩料率
    getChart2() {
      this.tab.chart2.listLoading = true
      const url = 'authdata/chart/feedEffSL'
      const data = {}
      data.parammaps = {}
      if (this.tab.chart2.getdataListParm.parammaps.specificDate == '1') {
        data.parammaps.pastureid = this.tab.chart2.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
        data.parammaps.stopTime = parseTime(this.tab.chart2.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
        data.parammaps.status = this.tab.chart2.getdataListParm.parammaps.status
      } else {
        data.parammaps.pastureid = this.tab.chart2.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = this.tab.chart2.getdataListParm.parammaps.startTime
        data.parammaps.stopTime = this.tab.chart2.getdataListParm.parammaps.stopTime
        data.parammaps.status = this.tab.chart2.getdataListParm.parammaps.status
      }
      postJson(url, data).then(response => {
        if (response.data !== null && response.data.list !== null && response.data.data !== null) {
          console.log('牛栏剩料率图表数据', response.data.list)
          for (let i = 0; i < response.data.data.length; i++) {
            if (response.data.data[i].剩料量 !== '' && response.data.data[i].剩料量 !== undefined) {
              response.data.data[i].剩料量 = parseFloat(response.data.data[i].剩料量)
            }
            if (response.data.data[i].撒料量 !== '' && response.data.data[i].撒料量 !== undefined) {
              response.data.data[i].撒料量 = parseFloat(response.data.data[i].撒料量)
            }
            if (response.data.data[i].准确率 !== '' && response.data.data[i].准确率 !== undefined) {
              response.data.data[i].准确率 = parseFloat(response.data.data[i].准确率)
            }
          }
          this.tab.chart2.table.list = response.data.data
          this.tab.chart2.chartLine_data = response.data.list
          this.tab.chart2.total = response.data.total
          this.tab.chart2.statisticsList = []
          this.tab.chart2.getdataListParm.parammaps.statisticsList = []
          for (let i = 0; i < response.data.list.data1.length; i++) {
            // if (i < 10) {
              this.tab.chart2.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
            // }
            var obj = {}
            obj.id = i
            obj.name = response.data.list.data1[i]
            this.tab.chart2.statisticsList.push(obj)
          }
          this.tab.chart2.chart2Data3 = response.data.list.data3
          this.tab.chart2.total = response.data.total
          console.log('牛栏剩料率图数据', this.tab.chart2.chartLine_data)
          console.log('牛栏剩料率表数据', this.tab.chart2.table.list)
          var arrData3 = []
          for (let i = 0; i < this.tab.chart2.getdataListParm.parammaps.statisticsList.length; i++) {
            const myId = this.tab.chart2.statisticsList.find(obj => obj.name == this.tab.chart2.getdataListParm.parammaps.statisticsList[i]).id
            for (let j = 0; j < this.tab.chart2.chart2Data3.length; j++) {
              if (j == myId) {
                arrData3.push(this.tab.chart2.chart2Data3[j])
              }
            }
          }
          this.tab.chart2.chartLine_data.data3 = arrData3
          this.tab.chart2.chartLine_data.data1 = this.tab.chart2.getdataListParm.parammaps.statisticsList
        } else {
          this.tab.chart2.list = []
          this.tab.chart2.chartLine_data = {}
        }
        console.log(this.tab.chart2.statisticsList,'statisticsList======888')
        console.log(this.tab.chart2.getdataListParm.parammaps.statisticsList,'statisticsList======999')
        this.roadChartLine2(this.tab.chart2.chartLine_data)
        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, show: true, type: 'scroll' },
        grid: {
          top: '15%',
          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 = []
          if (chartLine_data.data3 !== undefined) {
            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)
      if (this.tab.chart2.chartLine != null) {
        window.onresize = function() {
          this.tab.chart2.chartLine.resize()
        }
      }
    },

    // 混料时间统计
    getChart3() {
      this.tab.chart3.listLoading = true
      const url = 'authdata/chart/feedEffHL'
      const data = {}
      data.parammaps = {}
      if (this.tab.chart3.getdataListParm.parammaps.specificDate == '1') {
        data.parammaps.pastureid = this.tab.chart3.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
        data.parammaps.stopTime = parseTime(this.tab.chart3.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
        data.parammaps.status = this.tab.chart3.getdataListParm.parammaps.status
      } else {
        data.parammaps.pastureid = this.tab.chart3.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = this.tab.chart3.getdataListParm.parammaps.startTime
        data.parammaps.stopTime = this.tab.chart3.getdataListParm.parammaps.stopTime
        data.parammaps.status = this.tab.chart3.getdataListParm.parammaps.status
      }
      postJson(url, data).then(response => {
        if (response.data !== null && response.data.list !== null) {
          console.log('混料时间统计图表数据', response.data.list)
          this.tab.chart3.table.list = response.data.data
          this.tab.chart3.chartLine_data = response.data.list
          this.tab.chart3.total = response.data.total
          this.tab.chart3.total = response.data.total
        } else {
          this.tab.chart3.list = []
          this.tab.chart3.chartLine_data = {}
        }
        this.roadChartLine3(this.tab.chart3.chartLine_data)
        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: ['混料时间'],
          right: 10, show: true, type: 'scroll'
        },
        grid: {
          top: '15%',
          left: '5%',
          right: '8%',
          containLabel: true
        },
        toolbox: {
          show: true,
          right: '2%',
          feature: {}
        },
        xAxis: { type: 'category', boundaryGap: false, data: chartLine_data.data1, name: '日期' },
        yAxis: {
          type: 'value', name: '分钟',
          axisLabel: {
            formatter: '{value}min'
          }
        },
        series: [
          {
            name: '混料时间',
            type: 'line',
            stack: '总量',
            data: chartLine_data.data2
          }
        ]
      }
      this.tab.chart3.chartLine.setOption(option)
      window.onresize = function() {
        this.tab.chart3.chartLine.resize()
      }
    },

    // 转化率
    changeStatisticChart4(arr) {
      var arr1 = []
      for (let i = 0; i < arr.length; i++) {
        if (arr[i] !== 'all') {
          arr1.push(arr[i])
        }
      }
      this.tab.chart4.getdataListParm.parammaps.statisticsList = arr1
      var arrData3 = []
      for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
        const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
        for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
          if (j == myId) {
            arrData3.push(this.tab.chart4.chart4Data3[j])
          }
        }
      }
      this.tab.chart4.chartLine_data.data3 = arrData3
      this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
      this.roadChartLine4(this.tab.chart4.chartLine_data)
    },
    getChart4() {
      this.tab.chart4.listLoading = true
      const url = 'authdata/chart/feedEffZH'
      const data = {}
      data.parammaps = {}
      if (this.tab.chart4.getdataListParm.parammaps.specificDate == '1') {
        data.parammaps.pastureid = this.tab.chart4.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
        data.parammaps.stopTime = parseTime(this.tab.chart4.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
        data.parammaps.status = this.tab.chart4.getdataListParm.parammaps.status
      } else {
        data.parammaps.pastureid = this.tab.chart4.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = this.tab.chart4.getdataListParm.parammaps.startTime
        data.parammaps.stopTime = this.tab.chart4.getdataListParm.parammaps.stopTime
        data.parammaps.status = this.tab.chart4.getdataListParm.parammaps.status
      }
      postJson(url, data).then(response => {
        if (response.data !== null && response.data.list !== null) {
          console.log('转化率图表数据', response.data.list)
          this.tab.chart4.table.list = response.data.data
          this.tab.chart4.chartLine_data = response.data.list
          this.tab.chart4.total = response.data.total
          this.tab.chart4.statisticsList = []
          this.tab.chart4.getdataListParm.parammaps.statisticsList = []
          for (let i = 0; i < response.data.list.data1.length; i++) {
            // if (i < 10) {
              this.tab.chart4.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
            // }
            var obj = {}
            obj.id = i
            obj.name = response.data.list.data1[i]
            this.tab.chart4.statisticsList.push(obj)
          }
          this.tab.chart4.chart4Data3 = response.data.list.data3
          this.tab.chart4.total = response.data.total
          console.log('转化率图数据', this.tab.chart4.chartLine_data)
          console.log('转化率表数据', this.tab.chart4.table.list)
          var arrData3 = []
          console.log('statisticsList', this.tab.chart4.getdataListParm.parammaps.statisticsList)
          for (let i = 0; i < this.tab.chart4.getdataListParm.parammaps.statisticsList.length; i++) {
            const myId = this.tab.chart4.statisticsList.find(obj => obj.name == this.tab.chart4.getdataListParm.parammaps.statisticsList[i]).id
            for (let j = 0; j < this.tab.chart4.chart4Data3.length; j++) {
              if (j == myId) {
                arrData3.push(this.tab.chart4.chart4Data3[j])
              }
            }
          }
          this.tab.chart4.chartLine_data.data3 = arrData3
          this.tab.chart4.chartLine_data.data1 = this.tab.chart4.getdataListParm.parammaps.statisticsList
        } else {
          this.tab.chart4.list = []
          this.tab.chart4.chartLine_data = {}
        }
        this.roadChartLine4(this.tab.chart4.chartLine_data)
        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, show: true, type: 'scroll' },
        grid: {
          top: '15%',
          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 = []
          if (chartLine_data.data3 !== undefined) {
            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()
      }
    },

    // 成本分析
    changeStatisticChart5(arr) {
      var arr1 = []
      for (let i = 0; i < arr.length; i++) {
        if (arr[i] !== 'all') {
          arr1.push(arr[i])
        }
      }
      this.tab.chart5.getdataListParm.parammaps.statisticsList = arr1
      var arrData3 = []
      for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
        const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
        for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
          if (j == myId) {
            arrData3.push(this.tab.chart5.chart5Data3[j])
          }
        }
      }
      this.tab.chart5.chartLine_data.data3 = arrData3
      this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
      this.roadChartLine5(this.tab.chart5.chartLine_data)
    },
    getChart5() {
      this.tab.chart5.listLoading = true
      const url = 'authdata/chart/feedEffCBFT'
      const data = {}
      data.parammaps = {}
      if (this.tab.chart5.getdataListParm.parammaps.specificDate == '1') {
        data.parammaps.pastureid = this.tab.chart5.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
        data.parammaps.stopTime = parseTime(this.tab.chart5.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
        data.parammaps.status = this.tab.chart5.getdataListParm.parammaps.status
      } else {
        data.parammaps.pastureid = this.tab.chart5.getdataListParm.parammaps.pastureid
        data.parammaps.startTime = this.tab.chart5.getdataListParm.parammaps.startTime
        data.parammaps.stopTime = this.tab.chart5.getdataListParm.parammaps.stopTime
        data.parammaps.status = this.tab.chart5.getdataListParm.parammaps.status
      }
      postJson(url, data).then(response => {
        if (response.data !== null && response.data.list !== null) {
          console.log('转化率图表数据', response.data.list)
          this.tab.chart5.table.list = response.data.data
          this.tab.chart5.chartLine_data = response.data.list
          this.tab.chart5.total = response.data.total
          this.tab.chart5.statisticsList = []
          this.tab.chart5.getdataListParm.parammaps.statisticsList = []
          for (let i = 0; i < response.data.list.data1.length; i++) {
            // if (i < 10) {
              this.tab.chart5.getdataListParm.parammaps.statisticsList.push(response.data.list.data1[i])
            // }
            var obj = {}
            obj.id = i
            obj.name = response.data.list.data1[i]
            this.tab.chart5.statisticsList.push(obj)
          }
          this.tab.chart5.chart5Data3 = response.data.list.data3
          this.tab.chart5.total = response.data.total
          console.log('转化率图数据', this.tab.chart5.chartLine_data)
          console.log('转化率表数据', this.tab.chart5.table.list)
          var arrData3 = []
          for (let i = 0; i < this.tab.chart5.getdataListParm.parammaps.statisticsList.length; i++) {
            const myId = this.tab.chart5.statisticsList.find(obj => obj.name == this.tab.chart5.getdataListParm.parammaps.statisticsList[i]).id
            for (let j = 0; j < this.tab.chart5.chart5Data3.length; j++) {
              if (j == myId) {
                arrData3.push(this.tab.chart5.chart5Data3[j])
              }
            }
          }
          this.tab.chart5.chartLine_data.data3 = arrData3
          this.tab.chart5.chartLine_data.data1 = this.tab.chart5.getdataListParm.parammaps.statisticsList
        } else {
          this.tab.chart5.list = []
        }
        this.roadChartLine5(this.tab.chart5.chartLine_data)
        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, show: true, type: 'scroll' },
        grid: {
          top: '15%',
          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 = []
          if (chartLine_data.data3 !== undefined) {
            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()
      }
    },
    // 导出
    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()
      }
    },
    // 切换tab2日期
    changeTab2Date() {
      this.getTab2List()
      this.getTab2List2()
      this.getTab2List3()
      this.getTab2List4()
    },
    // 宾州筛分析
    getTab2List() {
      this.tab2.table.listLoading = true
      this.tab2.table.getdataListParm.parammaps.startTime = this.tab2.date
      this.tab2.table.getdataListParm.parammaps.stopTime = this.tab2.date
      GetDataByName(this.tab2.table.getdataListParm).then(response => {
        console.log('宾州筛分析table数据', response.data.list)
        if (response.data.list !== null) {
          this.tab2.table.list = response.data.list
          this.tab2.table.total = response.data.total
        } else {
          this.tab2.table.list = []
        }
        setTimeout(() => {
          this.tab2.table.listLoading = false
        }, 100)
      })
    },

    // 粪便筛分析
    getTab2List2() {
      this.tab2.table2.listLoading = true
      this.tab2.table2.getdataListParm.parammaps.startTime = this.tab2.date
      this.tab2.table2.getdataListParm.parammaps.stopTime = this.tab2.date
      GetDataByName(this.tab2.table2.getdataListParm).then(response => {
        console.log('粪便筛分析table数据', response.data.list)
        if (response.data.list !== null) {
          this.tab2.table2.list = response.data.list
          this.tab2.table2.total = response.data.total
        } else {
          this.tab2.table2.list = []
        }
        setTimeout(() => {
          this.tab2.table2.listLoading = false
        }, 100)
      })
    },

    // BCS评分
    getTab2List3() {
      this.tab2.table3.listLoading = true
      this.tab2.table3.getdataListParm.parammaps.startTime = this.tab2.date
      this.tab2.table3.getdataListParm.parammaps.stopTime = this.tab2.date
      GetDataByName(this.tab2.table3.getdataListParm).then(response => {
        console.log('BCS评分table数据', response.data.list)
        if (response.data.list !== null) {
          this.tab2.table3.list = response.data.list
          this.tab2.table3.total = response.data.total
        } else {
          this.tab2.table3.list = []
        }
        setTimeout(() => {
          this.tab2.table3.listLoading = false
        }, 100)
      })
    },

    // 粪便评分
    getTab2List4() {
      this.tab2.table4.listLoading = true
      this.tab2.table4.getdataListParm.parammaps.startTime = this.tab2.date
      this.tab2.table4.getdataListParm.parammaps.stopTime = this.tab2.date
      GetDataByName(this.tab2.table4.getdataListParm).then(response => {
        console.log('成本分析table数据', response.data.list)
        if (response.data.list !== null) {
          this.tab2.table4.list = response.data.list
          this.tab2.table4.total = response.data.total
        } else {
          this.tab2.table4.list = []
        }
        setTimeout(() => {
          this.tab2.table4.listLoading = false
        }, 100)
      })
    }

  }
}
</script>
<style lang="scss" scoped>
  .button{
    height: 95px;
    .exportTable2{float: right;margin-right: 5px;margin-top: 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;}
    }
  }
  /deep/ .specificDate .el-radio{margin-right: 0px;}
  /deep/ .el-radio-button__inner{padding: 7px 7px ;}
  /deep/ .el-range-editor.el-input__inner .el-input__icon{width: 0;}
</style>
