<script>
import {
  updateFangpaishuiPumpoperationrecordApi,
  deleteFangpaishuiPumpoperationrecordApi,
  findPumpoperationrecordByDetailApi,
  addFangpaishuiPumpoperationrecordApi,
  findFangpaishuiPumpoperationrecordByMonthApi,
} from "@@/apis/tables/drainageWorkshop/pumpOperationLog.ts";
import { getSpecificDate } from "@@/utils/datetime";
export default {
  data() {
    return {
      date: "",
      tableList: [],
      oreQuantity: "88",
    };
  },
  created() {
    // 页面渲染之前执行，一般调用methods定义的方法
    this.getList();
  },
  methods: {
    //获取列表
    async getList() {
      const res = await findAllMiningglossApi();
      console.log(res);
    },
    //按月查询
    async getMouthLoss() {
      let data = getSpecificDate(this.date);
      const res = await findTotalMiningByMonthApi(data);
      console.log(res);
    },
  },
};
</script>

<template>
  <div class="app-container">
    <div
      style="margin-bottom: 20px; display: flex; justify-content: space-between"
    >
      <div>
        <el-date-picker v-model="date" type="month" placeholder="选择年月">
        </el-date-picker>
        <el-button
          type="primary"
          size="mini"
          style="margin-left: 20px"
          @click="getMouthLoss"
          >查询</el-button
        >
      </div>
      <div>
        <el-tag type="info" size="large" color="#Fff"
          ><span style="color: #000"
            >计划运矿量{{ this.oreQuantity }}万吨</span
          ></el-tag
        >
      </div>
    </div>
    <div class="title" style="text-align: right; margin-bottom: 10px"></div>
    <el-table
      :data="tableList"
      border
      style="width: 100%"
      :header-align="center"
      :cell-style="rowStyle"
    >
      <el-table-column
        align="center"
        prop="index"
        label="项目"
        fixed
      ></el-table-column>
      <el-table-column align="center" label="计划">
        <el-table-column align="center" label="车数">
          <el-table-column
            align="center"
            prop="amount"
            label="日计"
          ></el-table-column
          ><el-table-column
            align="center"
            prop="amount"
            label="累计"
          ></el-table-column>
        </el-table-column>
        <el-table-column align="center" prop="amount" label="车数">
          <el-table-column
            align="center"
            prop="amount"
            label="东站"
          ></el-table-column
          ><el-table-column
            align="center"
            prop="amount"
            label="西站"
          ></el-table-column>
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="实际完成">
        <el-table-column align="center" label="作业班数" />
        <el-table-column align="center" prop="amount" label="车数">
          <el-table-column
            align="center"
            prop="amount"
            label="日计"
          ></el-table-column
          ><el-table-column
            align="center"
            prop="amount"
            label="累计"
          ></el-table-column>
        </el-table-column>
        <el-table-column align="center"></el-table-column>
      </el-table-column>
      <el-table-column align="center" label="各班运矿量">
        <el-table-column align="center" label="甲班">
          <el-table-column
            align="center"
            prop="amount"
            label="车数"
          ></el-table-column
          ><el-table-column
            align="center"
            prop="amount"
            label="列数"
          ></el-table-column>
        </el-table-column>
        <el-table-column align="center" label="乙班">
          <el-table-column
            align="center"
            prop="amount"
            label="车数"
          ></el-table-column
          ><el-table-column
            align="center"
            prop="amount"
            label="列数"
          ></el-table-column>
        </el-table-column>
        <el-table-column align="center" label="丙班">
          <el-table-column
            align="center"
            prop="amount"
            label="车数"
          ></el-table-column
          ><el-table-column
            align="center"
            prop="amount"
            label="列数"
          ></el-table-column>
        </el-table-column>
      </el-table-column>
      <el-table-column
        align="center"
        prop="index"
        label="总列数"
      ></el-table-column>
      <!-- 空数据时的显示 -->
      <template #empty>
        <div style="display: grid; place-items: center center">
          <el-empty :image-size="242" :description="暂无数据" />
        </div>
      </template>
    </el-table>
  </div>
</template>
