<template>
  <div class="page">
    <topBar
      v-if="topList.length > 0"
      :topList="topList"
      :moren="moren"
    ></topBar>
    <div class="main">
      <div class="form_all">
        <el-form ref="select" :model="select" label-width="auto">
          <el-row :gutter="10">
            <el-col :span="4">
              <el-form-item :label="'统计时间'" prop="queryTime">
                <el-date-picker
                  v-model="select.queryTime"
                  type="month"
                  value-format="yyyy-MM"
                  :placeholder="'请选择'"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-button type="primary" @click="getDataList">
                {{ '搜索' }}</el-button
              >
              <el-button type="" @click="reset"> {{ '重置' }}</el-button>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <div class="maintop">
        <div class="mainbtn">
          <el-button
            size="small"
            @click="handleExport"
            v-hasButtons="['regionalPerformanceExport']"
            style="background-color: #ffad41"
            class="thebtn1"
          >
            {{ '导出' }}</el-button
          >
        </div>
      </div>
      <div class="maintable">
        <el-table
          :data="tableData"
          v-loading="loading"
          style="width: 100%"
          :header-cell-style="{ background: '#EEEEEE', border: '1px' }"
          :row-class-name="tableRowClassName"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"> </el-table-column>

          <el-table-column align="center" prop="prName" label="区域">
          </el-table-column>
          <el-table-column align="center" label="1">
            <el-table-column align="center" prop="orderAmount1" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve1" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="2">
            <el-table-column align="center" prop="orderAmount2" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve2" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="3">
            <el-table-column align="center" prop="orderAmount3" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve3" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="4">
            <el-table-column align="center" prop="orderAmount4" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve4" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="5">
            <el-table-column align="center" prop="orderAmount5" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve5" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="6">
            <el-table-column align="center" prop="orderAmount6" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve6" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="7">
            <el-table-column align="center" prop="orderAmount7" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve7" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="8">
            <el-table-column align="center" prop="orderAmount8" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve8" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="9">
            <el-table-column align="center" prop="orderAmount9" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve9" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="10">
            <el-table-column align="center" prop="orderAmount10" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve10" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="11">
            <el-table-column align="center" prop="orderAmount11" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve11" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="12">
            <el-table-column align="center" prop="orderAmount12" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve12" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="13">
            <el-table-column align="center" prop="orderAmount13" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve13" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="14">
            <el-table-column align="center" prop="orderAmount14" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve14" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="15">
            <el-table-column align="center" prop="orderAmount15" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve15" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="16">
            <el-table-column align="center" prop="orderAmount16" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve16" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="17">
            <el-table-column align="center" prop="orderAmount17" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve17" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="18">
            <el-table-column align="center" prop="orderAmount18" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve18" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="19">
            <el-table-column align="center" prop="orderAmount19" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve19" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="20">
            <el-table-column align="center" prop="orderAmount20" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve20" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="21">
            <el-table-column align="center" prop="orderAmount21" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve21" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="22">
            <el-table-column align="center" prop="orderAmount22" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve22" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="23">
            <el-table-column align="center" prop="orderAmount23" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve23" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="24">
            <el-table-column align="center" prop="orderAmount24" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve24" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="25">
            <el-table-column align="center" prop="orderAmount25" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve25" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="26">
            <el-table-column align="center" prop="orderAmount26" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve26" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="27">
            <el-table-column align="center" prop="orderAmount27" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve27" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="28">
            <el-table-column align="center" prop="orderAmount28" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve28" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="29">
            <el-table-column align="center" prop="orderAmount29" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve29" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="30">
            <el-table-column align="center" prop="orderAmount30" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve30" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" label="31">
            <el-table-column align="center" prop="orderAmount31" label="金额">
            </el-table-column>
            <el-table-column align="center" prop="orderAchieve31" label="业绩">
            </el-table-column>
          </el-table-column>
          <el-table-column align="center" prop="orderAmountSum" label="金额总计">
          </el-table-column>
          <el-table-column align="center" prop="orderAchieveSum" label="业绩总计">
          </el-table-column>
        </el-table>
      </div>
    </div>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getDataList"
    />
  </div>
</template>
        
        <script>
import topBar from "@/components/topBar";
import * as api from "@/api/statistics.js";
export default {
  name: "RegionalPerformance",
  components: {
    topBar,
  },
  data() {
    return {
      select: {},
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 50,
      },
      total: 0,
      tableData: [],
      loading:false,
      moren: "regionalPerformance",
      topList: [
        {
          name: "地区业绩统计",
          path: "regionalPerformance",
        },
      ],
    };
  },
  mounted() {},
  methods: {
    reset() {
      this.select = {};
    },

    getDataList() {
        this.loading = true
      api
        .getAreaAchieveStatList(
          Object.assign({}, this.queryParams, this.select)
        )
        .then((res) => {
          this.tableData = res.rows;
          this.total = res.total;
          this.loading = false
        });
    },

    handleSelectionChange(val) {},
    /** 导出按钮操作 */
    handleExport() {
      this.$confirm(this.$t("MN_F_T_407"), this.$t("MN_F_T_304"), {
        confirmButtonText: this.$t("w_0035"),
        cancelButtonText: this.$t("ENU_P_TYPE0"),
        type: "warning",
      }).then((_) => {
        this.download(
          "/report/manager/member-awards/export-areaAchieveStat",
          Object.assign({}, this.queryParams, this.select),
          `${this.select.queryTime}订单统计表.xlsx`
        );
      });
    },
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 == 1) {
        return "warning-row";
      } else if (rowIndex % 2 == 0) {
        return "success-row";
      }
      return "";
    },
  },
};
</script>
        <style scoped lang="scss">
::v-deep .el-table .warning-row {
  background: #f9f9f9;
}

::v-deep .el-table .success-row {
  background: #ffffff;
}
::v-deep .el-table thead {
  color: #000000;
}


::v-deep .el-select {
  width: 100%;
}
.uploadIcon ::v-deep .el-upload--picture-card {
  display: none !important; /* 上传按钮隐藏 */
}
.page {
  padding: 20px;
  background: #f9f9f9;
  font-size: 14px;
  .main {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
    .form_all {
      padding: 0px 20px 0 20px;
      // margin-bottom: 20px;
      background: #fff;
      border-radius: 8px;
    }
    .maintop {
      display: flex;
      padding: 0px 0px;
      justify-content: space-between;
      align-items: center;

      background: #f8f8f8;
      .mainbtn {
        .thebtn1 {
          background: #3181e5;
          color: #ffffff;
        }
        .thebtn2 {
          background: #ffad41;
          color: #ffffff;
        }
      }
      .maintitle {
        font-size: 10px;
        font-family: MicrosoftYaHei;
        color: #999999;
      }
    }
  }
  .tem {
    display: flex;
    align-items: center;
    justify-content: center;
    img {
      width: 28px;
      height: 20px;
      margin-right: 3px;
    }
  }
  .isRed {
    color: #ed1d25;
  }
  .isGreen {
    color: #1ab62b;
  }
  .bgImg {
    width: 48px;
    height: 48px;
  }
}
.openClose {
  text-align: right;
  margin-right: 10px;
  color: #3181e5;
}
.dizhi {
  ::v-deep .el-cascader {
    width: 100%;
  }
}
::v-deep .el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: auto;
}
.lan {
  text-decoration: underline;
  color: #48b2fd;
  cursor: pointer;
}
</style>
        