<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryRef"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <!-- <el-form-item label="周数" prop="periods">
        <el-input
          v-model="queryParams.periods"
          placeholder="请输入周数"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="周数">
        <el-date-picker
          style="width: 180px"
          v-model="queryParams1.periods"
          type="week"
          format="ww[周]"
          placeholder="选择周"
          :weekdays="[1, 2, 3, 4, 5, 6, 0]"
          :first-day-of-week="1"
          @change="changeWeekNum"
        />
      </el-form-item>

      <el-form-item label="周报状态" prop="state">
        <el-select
          style="width: 180px"
          v-model="queryParams.state"
          placeholder="请选择周报状态"
          clearable
        >
          <el-option
            v-for="dict in zb_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>

      <el-form-item label="提交人" prop="createBy">
        <el-input
          style="width: 180px"
          v-model="queryParams.createBy"
          placeholder="请输入"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门名称" prop="deptName">
        <el-input
          v-model="queryParams.deptName"
          placeholder="请输入部门名称"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="提交时间" prop="createTime">
        <el-date-picker
          style="width: 220px"
          v-model="dateRange"
          type="daterange"
          value-format="YYYY-MM-DD "
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        />
      </el-form-item>
      <el-form-item label-width="0px">
        <el-button type="primary" icon="Search" @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="Plus"
          @click="handleAdd"
          v-hasPermi="['offcial:weekly:add']"
          >提交周报</el-button
        >
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="Edit"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['offcial:weekly:edit']"
          >修改</el-button
        >
      </el-col>
     -->
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="Delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['offcial:weekly:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="Download"
          @click="handleExport"
          v-hasPermi="['offcial:weekly:export']"
          >导出汇总表</el-button
        >
        <el-button
          type="warning"
          plain
          icon="Download"
          v-hasPermi="['offcial:weekly:allexport']"
          @click="handleMergerMultiRowExport"
          >导出处室汇总</el-button
        >
        <el-button
          v-hasPermi="['offcial:weekly:yl']"
          type="success"
          plain
          icon="view"
          @click="handleView"
          >预览汇总</el-button
        >
      </el-col>
      <right-toolbar
        v-model:showSearch="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="weeklyList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" type="index" width="55" align="center" />
      <el-table-column label="周数" align="center" prop="periods" />
      <!-- <el-table-column label="事务名称" align="center" prop="periods" /> -->
      <el-table-column label="提交人" align="center" prop="createBy" />
      <el-table-column label="部门名称" align="center" prop="deptName" />
      <el-table-column label="提交时间" align="center" prop="createTime" />
      <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template #default="scope" >
          <el-button v-if="userId==scope.row.userId"
            link
            type="primary"
            icon="Edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['offcial:weekly:edit']"
            >修改</el-button >
          <el-button v-if="userId==scope.row.userId"
            link
            type="primary"
            icon="Delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['offcial:weekly:remove']"
            >删除</el-button  >
          <el-button v-else
              link
              type="primary"
              icon="view"
              @click="handleUpdate(scope.row)"
          >查看</el-button >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改周报对话框 -->
    <el-dialog :title="title" v-model="open" width="80%" append-to-body>
      <el-form
        ref="weeklyRef"
        :model="form"
        :inline="true"
        :rules="rules"
        label-width="80px"
      >
        <!-- <el-form-item label="周数" prop="periods">

        </el-form-item> -->
        <el-form-item label="周数">
          <el-input disabled v-model="form1.periods" />
          <!-- <el-date-picker
            style="width: 180px"
            v-model="form1.periods"
            type="week"
            disabled
            format="ww[周]"
            placeholder="选择周"
            :weekdays="[1, 2, 3, 4, 5, 6, 0]"
            :first-day-of-week="1"
          /> -->
        </el-form-item>
        <el-form-item label="提交人" prop="createBy">
          <el-input disabled v-model="form.createBy" placeholder="" />
        </el-form-item>
        <el-form-item label="部门名称" prop="deptName">
          <el-input disabled v-model="form.deptName" placeholder="" />
        </el-form-item>
        <el-divider content-position="center">周报事务信息</el-divider>
        <el-row :gutter="10" class="mb8"  v-if="!form.userId||userId==form.userId">
          <el-col :span="1.5">
            <el-button type="primary" icon="Plus" @click="handleAddYwWeeklyItem"
              >添加</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              icon="Delete"
              @click="handleDeleteYwWeeklyItem"
              >删除</el-button
            >
          </el-col>
          <!-- <el-col :span="1.5">
            <el-button type="warning" icon="" @click="handleJinzhanYwWeeklyItem"
              >督办进展</el-button
            >
          </el-col> -->
        </el-row>
        <el-table
          style="margin-top: 20px"
          :data="ywWeeklyItemList"
          :row-class-name="rowYwWeeklyItemIndex"
          @selection-change="handleYwWeeklyItemSelectionChange"
          ref="ywWeeklyItem"
        >
          <el-table-column
            :selectable="isRowSelectable"
            type="selection"
            width="50"
            align="center"
          />
          <el-table-column
            label="序号"
            align="center"
            prop="index"
            width="55"
          />
          <el-table-column
            align="center"
            label="事务名称"
            prop="itemName"
            width="250"
          >
            <template #default="scope">
              <el-input
                type="textarea"
                :rows="3"
                v-model="scope.row.itemName"
                placeholder="请输入事务名称"
              />
            </template>
          </el-table-column>
          <el-table-column align="center" label="本周推进情况" prop="weekPace">
            <template #default="scope">
              <el-input
                type="textarea"
                :rows="3"
                v-model="scope.row.weekPace"
                placeholder="请输入本周推进情况"
              />
            </template>
          </el-table-column>
          <el-table-column align="center" label="下周计划" prop="weekNextPlan">
            <template #default="scope">
              <el-input
                :rows="3"
                type="textarea"
                v-model="scope.row.weekNextPlan"
                placeholder="请输入下周计划"
              />
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            label=" 完成时限"
            prop="doneTime"
            width="180"
          >
            <template #default="scope">
              <el-date-picker
                clearable
                style="width: 150px"
                v-model="scope.row.doneTime"
                type="date"
                value-format="YYYY-MM-DD"
                placeholder="完成时限"
              >
              </el-date-picker>
            </template>
          </el-table-column>
          <!-- <el-table-column
            align="center"
            label="督办事项"
            prop="isDb"
            width="180"
          >
            <template #default="scope">
              <el-button
                v-if="
                  scope.row.supervistionId == null ||
                  scope.row.supervistionId == '' ||
                  scope.row.supervistionId == undefined
                "
                @click="addThing(scope.row)"
                type="primary"
                >快速填写</el-button
              >
              <div v-else></div>
            </template>
          </el-table-column> -->
        </el-table>
      </el-form>
      <template #footer  v-if="!form.userId||userId==form.userId">
        <div class="dialog-footer">
          <el-button @click="cancel">取 消</el-button>
          <el-button type="primary" @click="submitForm">确 定</el-button>
        </div>
      </template>
    </el-dialog>
    <el-dialog v-model="dialogTableVisible" title="督办事项" width="800">
      <el-table
        ref="multipleTable1"
        :row-key="getRowKeys"
        @selection-change="handleSelectionChange1"
        @select="setSelectRows"
        @select-all="selectAll"
        :data="gridData"
      >
        <el-table-column
          :selectable="getSelectable"
          :reserve-selection="true"
          type="selection"
          width="50"
          align="center"
        />
        <el-table-column
          align="center"
          property="title"
          label="事务名称"
          width="200"
        />
        <el-table-column align="center" label="本周推进情况" width="250">
          <template #default="scope">
            {{ scope.row.ywSupervisionItemList[0].progress }}
          </template>
        </el-table-column>
        <el-table-column align="center" property="doneTime" label="完成时限" />
      </el-table>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="dialogTableVisible = false">取消</el-button>
          <el-button type="primary" @click="submitInfo"> 确认 </el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="Weekly">
import {
  listWeekly,
  getWeekly,
  delWeekly,
  addWeekly,
  updateWeekly,
  myselfDb,
  leaderViewWeekReport,
} from "@/api/offcial/weekly";
import { getInfo } from "@/api/login";
import { Base64 } from "js-base64";
import moment from "moment"; //导入文件
import { init } from "echarts";
const { proxy } = getCurrentInstance();
const weeklyList = ref([]);
const gridData = ref([]);
const ywWeeklyItemList = ref([]);
const open = ref(false);
const dialogTableVisible = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const dateYear = ref({});
const form1 = ref({});
const queryParams1 = ref({});
const checkedYwWeeklyItem = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const weekNum = ref(null);
const selectionValue = ref(null);
const rowValue = ref(null);
const userId = ref(null);
const dateRange = ref("");
const { sys_yes_no, zb_type } = proxy.useDict("sys_yes_no", "zb_type");
const data = reactive({
  form: { params: {} },
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    userId: null,
    deptId: null,
    periods: null,
    createBy: null,
    workId: null,
    orderByColumn: "createTime",
    isAsc: "Desc",
    params: {},
  },
  rules: {
    periods: [{ required: true, message: "请输入周报周数", trigger: "blur" }],
  },
});

const { queryParams, form, rules } = toRefs(data);
// function getWeekNum() {
//   queryParams.value.periods = moment(new Date()); //获得今天是第几周
//   console.log(queryParams.value.periods);
// }
// 预览
function handleView() {
  leaderViewWeekReport(
    proxy.addDateRange(queryParams.value, dateRange.value)
  ).then((res) => {
    var url = import.meta.env.VITE_APP_KKFILE1 + res.msg;
    var b64Encoded = Base64.encode(url);
    window.open(
      import.meta.env.VITE_APP_KKFILE2 + encodeURIComponent(b64Encoded)
    );
  });
}
huoquUserId()
function huoquUserId(){
  getInfo().then((res) => {
    userId.value=res.user.userId
  });
}
function handleJinzhanYwWeeklyItem() {
  myselfDb({ orderByColumn: "createTime", isAsc: "Desc" }).then((res) => {
    if (res.rows.length > 0) {
      dialogTableVisible.value = true;
      gridData.value = res.rows;
    } else {
      // proxy.$modal.msgError("暂无可选督办事项，请手动填写");
    }
  });
}
// 新增周报;
function addThing(row) {
  rowValue.value = row;
  myselfDb({ orderByColumn: "createTime", isAsc: "Desc" }).then((res) => {
    if (res.rows.length > 0) {
      dialogTableVisible.value = true;
      gridData.value = res.rows;
    } else {
      // proxy.$modal.msgError("暂无可选督办事项，请手动填写");
    }
  });
}
function submitInfo() {
  rowValue.value.itemName = selectionValue.value[0].title;
  rowValue.value.weekPace =
    selectionValue.value[0].ywSupervisionItemList[0].progress;
  rowValue.value.doneTime = selectionValue.value[0].doneTime;
  rowValue.value.supervistionId = selectionValue.value[0].id;
  dialogTableVisible.value = false;
  proxy.$refs.multipleTable1.clearSelection();
}
// 点击表头的全选复选框触发
const selectAll = (selection) => {
  proxy.$modal.msgError("只能选一个！");
  proxy.$refs.multipleTable1.clearSelection();
  return;
};
const getRowKeys = (row) => {
  return row.id;
};

// el-table只能选一个
const setSelectRows = (selection) => {
  if (selection.length > 1) {
    const del_row = selection.shift();
    proxy.$refs.multipleTable1.toggleRowSelection(del_row, false); //设置这一行取消选中
  }
};
// // 多选框选中数据  常用联系人
const handleSelectionChange1 = (selection) => {
  selectionValue.value = selection;
  // this.userNames = selection.map((item) => item.NO);
};
//获取当前日期是第几周
function getWeekNum() {
  //获得当前日期是第几周的方法
  dateYear.value.year = moment(new Date()).format("YYYY"); //获得当前年份
  queryParams.value.params["year"] = dateYear.value.year;

  queryParams1.value.periods = moment(new Date()); //获得今天是第几周
  var year = new Date().getFullYear();
  dateYear.value = year;
  var week = moment(new Date()).format("E"); //获得今天是星期几
  var startweek = moment(new Date(year + "-01-01")).format("E"); //获得今年的1月1号是星期几
  //今天到1月1号的时间戳之差
  var millisDiff =
    new Date(moment().format("yyyy-MM-DD")).getTime() -
    new Date(year + "-01-01").getTime();
  var days =
    (millisDiff -
      week * (24 * 60 * 60 * 1000) -
      (7 - startweek) * (24 * 60 * 60 * 1000)) /
    86400000;
  weekNum.value = days / 7 + 2;
  queryParams.value.periods = weekNum.value;
  form.value.periods = weekNum.value;
  getList();
  return weekNum.value;

  //这里加的2代表的是本周和今年1月1号所在的那一周
}
/** 查询周报列表 */
function getList() {
  loading.value = true;
  listWeekly(proxy.addDateRange(queryParams.value, dateRange.value)).then(
    (response) => {
      weeklyList.value = response.rows;
      total.value = response.total;
      loading.value = false;
    }
  );
}
function changeWeekNum(val) {
  //获得当前日期是第几周的方法
  if (val != null) {
    let d = new Date(val);
    // 年份
    queryParams.value.params["year"] = d.getFullYear();
    d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
    // 设置日期为当年的1月1日
    d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
    // 获取当年的1月1日
    var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
    // 计算两个日期之间的差值，并转换为周数
    var weekNo = Math.ceil(((d - yearStart) / 86400000 + 1) / 7);
    queryParams.value.periods = weekNo;
    console.log(weekNo);
    form.value.periods = weekNo;
  } else {
    queryParams.value.periods = "";
    queryParams.value.params["year"] = "";
  }
}
function changeWeekNum1(val) {
  //获得当前日期是第几周的方法
  if (val != null) {
    let d = new Date(val);
    // 年份
    form.value.params["year"] = d.getFullYear();
    d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
    // 设置日期为当年的1月1日
    d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
    // 获取当年的1月1日
    var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
    // 计算两个日期之间的差值，并转换为周数
    var weekNo = Math.ceil(((d - yearStart) / 86400000 + 1) / 7);
    form.value.periods = weekNo;
  } else {
    form.value.periods = "";
    form.value.params["year"] = "";
  }
}
// 取消按钮
function cancel() {
  open.value = false;
  reset();
}

// 表单重置
function reset() {
  form.value = {
    id: null,
    userId: null,
    deptId: null,
    periods: null,
    createBy: null,
    createTime: null,
    remark: null,
    workId: null,
  };
  ywWeeklyItemList.value = [];
  proxy.resetForm("weeklyRef");
}

/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1;
  getList();
}

/** 重置按钮操作 */
function resetQuery() {
  proxy.resetForm("queryRef");
  dateRange.value = [];
  queryParams1.value.periods = "";
  queryParams.value.periods = "";
  handleQuery();
}

// 多选框选中数据
function handleSelectionChange(selection) {
  ids.value = selection.map((item) => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

/** 新增按钮操作 */
function handleAdd() {
  reset();
  open.value = true;
  title.value = "提交周报";
  // form1.value.periods = moment(new Date()); //获得今天是第几周
  var year = new Date().getFullYear();
  dateYear.value = year;
  // form.value.params["year"] = dateYear.value;

  var week = moment(new Date()).format("E"); //获得今天是星期几
  var startweek = moment(new Date(year + "-01-01")).format("E"); //获得今年的1月1号是星期几
  //今天到1月1号的时间戳之差
  var millisDiff =
    new Date(moment().format("yyyy-MM-DD")).getTime() -
    new Date(year + "-01-01").getTime();
  var days =
    (millisDiff -
      week * (24 * 60 * 60 * 1000) -
      (7 - startweek) * (24 * 60 * 60 * 1000)) /
    86400000;
  weekNum.value = days / 7 + 2;
  form1.value.periods = weekNum.value + "周";
  form.value.periods = weekNum.value;
  getInfo().then((res) => {
    form.value.createBy = res.user.nickName;
    form.value.deptName = res.user.dept.deptName;
    form.value.periods = weekNum.value;
  });
  myselfDb({ orderByColumn: "createTime", isAsc: "Desc" }).then((res) => {
    if (res.rows.length > 0) {
      // dialogTableVisible.value = true;
      for (let i = 0; i < res.rows.length; i++) {
        ywWeeklyItemList.value.push({
          itemName: res.rows[i].title,
          weekPace: res.rows[i].ywSupervisionItemList[0].progress,
          doneTime: res.rows[i].doneTime,
          submitState: res.rows[i].ywSupervisionItemList[0].submitState,
          supervistionId: res.rows[i].ywSupervisionItemList[0].id,
        });
      }
    } else {
      // proxy.$modal.msgError("暂无可选督办事项，请手动填写");
    }
  });
}

/** 修改按钮操作 */
function handleUpdate(row) {
  reset();
  const _id = row.id || ids.value;
  getWeekly(_id).then((response) => {
    form1.value.periods = Number(response.data.periods) + "周";
    console.log("form1.value.periods", form1.value.periods);
    form.value = response.data;
    ywWeeklyItemList.value = response.data.ywWeeklyItemList;
    open.value = true;
    title.value = "修改周报";
  });
}
/** 修改按钮操作 */
function selWeek(row) {
  reset();
  const _id = row.id || ids.value;
  getWeekly(_id).then((response) => {
    form1.value.periods = Number(response.data.periods) + "周";
    console.log("form1.value.periods", form1.value.periods);
    form.value = response.data;
    ywWeeklyItemList.value = response.data.ywWeeklyItemList;
    open.value = true;
    title.value = "查看周报";
  });
}

/** 提交按钮 */
function submitForm() {
  var sumflg = true;

  ywWeeklyItemList.value.forEach((item) => {
    if (!sumflg) return; // 如果sumflg为false，直接返回

    if (
      item.weekPace == null ||
      item.weekPace == "" ||
      item.weekPace == undefined
    ) {
      proxy.$modal.msgError(
        "督办事项“" + item.itemName + "”本周推进情况不能为空"
      );
      sumflg = false;
      return;
    }
    if (
      item.weekNextPlan == null ||
      item.weekNextPlan == "" ||
      item.weekNextPlan == undefined
    ) {
      proxy.$modal.msgError("督办事项“" + item.itemName + "”下周计划不能为空");
      sumflg = false;
      return;
    }
  });
  if (sumflg) {
    proxy.$refs["weeklyRef"].validate((valid) => {
      if (valid) {
        form.value.ywWeeklyItemList = ywWeeklyItemList.value;
        if (form.value.id != null) {
          updateWeekly(form.value).then((response) => {
            proxy.$modal.msgSuccess("修改成功");
            open.value = false;
            getList();
          });
        } else {
          // form.value.periods = form1.value.periods;
          addWeekly(form.value).then((response) => {
            proxy.$modal.msgSuccess("新增成功");
            open.value = false;
            getList();
          });
        }
      }
    });
  }
}

/** 删除按钮操作 */
function handleDelete(row) {
  const _ids = row.id || ids.value;
  proxy.$modal
    .confirm("是否确认删除该周报？")
    .then(function () {
      return delWeekly(_ids);
    })
    .then(() => {
      getList();
      proxy.$modal.msgSuccess("删除成功");
    })
    .catch(() => {});
}

/** 周报从序号 */
function rowYwWeeklyItemIndex({ row, rowIndex }) {
  row.index = rowIndex + 1;
  console.log("row", row.ywSupervisionItem);
  if (title.value == "提交周报") {
    if (row.submitState == "0") {
      return "warning-row";
    } else if (row.submitState == "1") {
      return "success-row";
    } else {
    }
    return "";
  } else if (title.value == "修改周报") {
    if (row.ywSupervisionItem != null) {
      if (row.ywSupervisionItem.submitState == "0") {
        return "warning-row";
      } else if (row.ywSupervisionItem.submitState == "1") {
        return "success-row";
      }
    } else {
      return "";
    }
  }
}

/** 周报从添加按钮操作 */
function handleAddYwWeeklyItem() {
  let obj = {};
  obj.itemName = "";
  obj.weekPace = "";
  obj.weekNextPlan = "";
  obj.doneTime = "";
  obj.isDb = "";
  obj.remark = "";
  ywWeeklyItemList.value.push(obj);
}

/** 周报从删除按钮操作 */
function handleDeleteYwWeeklyItem() {
  if (checkedYwWeeklyItem.value.length == 0) {
    proxy.$modal.msgError("请先选择要删除的周报从数据");
  } else {
    const ywWeeklyItems = ywWeeklyItemList.value;
    const checkedYwWeeklyItems = checkedYwWeeklyItem.value;
    ywWeeklyItemList.value = ywWeeklyItems.filter(function (item) {
      return checkedYwWeeklyItems.indexOf(item.index) == -1;
    });
  }
}

/** 复选框选中数据 */
function handleYwWeeklyItemSelectionChange(selection) {
  checkedYwWeeklyItem.value = selection.map((item) => item.index);
  console.log(checkedYwWeeklyItem.value);
}

/** 导出按钮操作 */
function handleExport() {
  getInfo().then((res) => {
    form.value.createBy = res.user.nickName;
    form.value.deptName = res.user.dept.deptName;
    proxy.download(
      "offcial/weekly/exportCurrWeekReport",
      {
        ...queryParams.value,
      },
      form.value.deptName + "周报汇总表" + `_${new Date().getTime()}.xlsx`
    );
  });
}
function isRowSelectable(row) {
  // 只有状态为'active'的行可选
  return row.submitState == null;
}
/** 导出按钮操作 */
function handleMergerMultiRowExport() {
  proxy.download(
    "offcial/weekly/mergeExport",
    {
      ...queryParams.value,
    },
    `各处室周报汇总表_${new Date().getTime()}.xlsx`
  );
}

// getList();

getWeekNum();
</script>
<style>
.el-table .warning-row {
  --el-table-tr-bg-color: var(--el-color-error-light-8);
}
.el-table .success-row {
  --el-table-tr-bg-color: var(--el-color-success-light-8);
}
</style>
