<template>
  <div class="page-container row-container">
    <!-- 左侧区域 -->
    <section class="list-part-container" style="flex: 1">
      <!-- 搜索区 -->
      <el-form
        class="list-search-container"
        :model="queryDayworkParams"
        ref="queryRef"
        :inline="true"
        style="margin-right: 0px"
      >
        <el-form-item class="section-title" label="生产批次" />
        <el-form-item label="产品描述：">
          <el-input
            placeholder="请输入产品描述"
            v-model="queryDayworkParams.productDescription"
            @keydown.enter.prevent
            clearable
            style="width: 200px"
          />
        </el-form-item>
        <el-form-item label="批次号：">
          <el-input
            placeholder="请输入批次号"
            v-model="queryDayworkParams.productionPlanNo"
            @keydown.enter.prevent
            clearable
            style="width: 140px"
          />
        </el-form-item>

        <el-form-item label="生产状态：" prop="status" align="center">
          <el-select
            v-model="queryDayworkParams.status"
            clearable
            placeholder="请选择生产状态"
            style="width: 80px"
            @change="handleChangeStatus"
          >
            <el-option
              v-for="dict in statusOptions"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="批次状态：">
          <el-select
            style="width: 160px"
            multiple
            v-model="queryDayworkParams.flags"
            clearable
            placeholder="请选择标识"
            @change="handleFlagChange"
          >
            <el-option
              v-for="item in is_identification"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="批次状态：" prop="status" align="center">
          <el-select v-model="queryDayworkParams.reportStatus" clearable placeholder="请选择生产状态" style="width: 200px"
            @change="handleChangeStatus">
            <el-option v-for="dict in daywork_status" :key="dict.value" :label="dict.label"
              :value="dict.value"></el-option>
          </el-select>
        </el-form-item> -->
        <el-form-item label="炉号：">
          <el-input
            placeholder="请输入炉号"
            v-model="queryDayworkParams.furnaceNumber"
            @keydown.enter.prevent
            clearable
            style="width: 160px"
          />
        </el-form-item>
        <el-form-item label="下达日期：">
          <el-date-picker
            v-model="queryDayworkParams.queryStartTime"
            type="date"
            value-format="YYYY-MM-DD"
            :editable="false"
            :clearable="false"
            placeholder="请选择开始时间"
            style="width: 130px"
            @change="handleDateChange"
          />
          <span>到</span>
          <el-date-picker
            v-model="queryDayworkParams.queryEndTime"
            type="date"
            value-format="YYYY-MM-DD"
            :editable="false"
            :clearable="false"
            placeholder="请选择结束时间"
            style="width: 130px"
            @change="handleDateChange"
          />
        </el-form-item>
        <!-- <el-form-item label="下达日期：">
          <el-date-picker
            placeholder="请选择"
            type="daterange"
            v-model="dateRange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            value-format="YYYY-MM-DD"
            style="width: 240px"
            @change="dateRangeChange"
          />
        </el-form-item> -->
        <el-form-item style="margin-left: 0">
          <el-button type="info" icon="Search" @click="handleQuery"
            >搜索
          </el-button>
        </el-form-item>
      </el-form>
      <div class="el-table-container">
        <div class="el-table-inner-container">
          <el-table
            ref="dayworkTable"
            :data="dayworkList"
            v-loading="dayworkLoading"
            highlight-current-row
            height="100%"
            @current-change="handleDayworkCurrentChange"
          >
            <el-table-column
              label="客户简称"
              prop="companyAlias"
              width="120"
              align="center"
            />
            <!-- <el-table-column label="生产计划单号" prop="productionPlanNo" width="100" align="center" /> -->
            <el-table-column
              label="批次号"
              min-width="120"
              prop="lotCode"
              align="center"
            >
              <template #default="scope">
                <el-button
                  link
                  type="primary"
                  @click="handleColumnClick(scope.row)"
                  ><span>{{ scope.row.lotCode }}</span></el-button
                >
                <!-- <span v-else>{{ scope.row.lotCode }}</span> -->
              </template>
            </el-table-column>
            <el-table-column
              label="产品描述"
              prop="product.description"
              align="center"
            />
            <el-table-column
              label="图纸版本"
              prop="technologyVersion"
              width="60"
              align="center"
            />
            <el-table-column
              label="炉号"
              prop="furnaceNumber"
              width="120"
              align="center"
            />
            <el-table-column
              label="投产量"
              prop="daywork.productionQuantity"
              width="60"
              align="center"
            >
              <template #default="scope">
                {{
                  scope.row.daywork != null
                    ? scope.row.daywork.productionQuantity
                    : scope.row.productionQuantity
                }}
              </template>
            </el-table-column>
            <el-table-column
              label="生产状态"
              prop="status"
              width="80"
              align="center"
            >
              <template #default="scope">
                <el-tag
                  :type="
                    statusFilter(
                      scope.row.daywork != null
                        ? scope.row.daywork.status == 0
                          ? 1
                          : scope.row.daywork.status
                        : 0
                    )
                  "
                  >{{
                    statusFilterText(
                      scope.row.daywork != null
                        ? scope.row.daywork.status == 0
                          ? 1
                          : scope.row.daywork.status
                        : 0
                    )
                  }}</el-tag
                >
              </template>
            </el-table-column>
            <el-table-column label="批次状态" align="center" prop="lotID">
              <template #default="scope">
                <el-tag
                  v-if="scope.row.isAmend == 1"
                  class="spacing"
                  type="danger"
                  >{{ "工艺修改" }}</el-tag
                >
                <!-- <el-tag v-if="scope.row.isWasteRecycling == 1" class="spacing" type="danger">{{ "废品回用" }}</el-tag> -->
                <!-- <el-tag v-if="scope.row.isWasteRecycling == 0 && scope.row.isAmend == 0" class="spacing">{{
                  "正常批次" }}</el-tag> -->
                <el-tag
                  v-if="scope.row.isSuperaddition == 1"
                  class="warning"
                  type="warning"
                  >{{ "追增" }}</el-tag
                >
                <el-tag v-if="scope.row.isWaste == 1" class="" type="danger">{{
                  "批废"
                }}</el-tag>
                <!-- <el-tag v-if="scope.row.fromId != 0" class="" type="warning">{{
                  "分批" }}</el-tag> -->
              </template>
            </el-table-column>
            <el-table-column label="报工状态" width="80" align="center">
              <template #default="scope">
                <dict-tag
                  :options="daywork_status"
                  :value="
                    scope.row.daywork ? scope.row.daywork.reportStatus : 0
                  "
                />
              </template>
            </el-table-column>
            <el-table-column
              label="总批数"
              width="80"
              prop="totalLotNumber"
              align="center"
            ></el-table-column>
            <el-table-column
              label="合格量"
              width="80"
              prop="daywork.temporaryProcessQualifiedNum"
              align="center"
            ></el-table-column>
            <el-table-column
              label="完工日期"
              width="100"
              prop="daywork.finishedTime"
              align="center"
            ></el-table-column>
            <el-table-column
              label="下达日期"
              prop="createTime"
              width="100"
              align="center"
            >
              <template #default="scope">
                <span>{{
                  proxy.moment(scope.row.createTime).format("YYYY-MM-DD")
                }}</span>
              </template>
            </el-table-column>
            <el-table-column
              label="报工总时长"
              prop="totalWorkingHours"
              width="150"
              align="center"
            />
          </el-table>
        </div>
      </div>
      <!-- 分页 -->
      <pagination
        v-show="total > 0"
        :total="total"
        v-model:page="queryDayworkParams.pageNum"
        v-model:limit="queryDayworkParams.pageSize"
        @pagination="getDayworks"
      />
    </section>
    <!-- 报工信息表单 -->
    <daywork-item-form
      ref="dayworkItemRef"
      @handleSaveSuccess="handleGetDayworkItems"
    />
    <!-- 分选报工信息表单 -->
    <sort-item-form
      ref="sortItemRef"
      @handleSaveSuccess="handleGetDayworkItems"
    />
    <!-- 报工历史修改表单 -->
    <dialog-daywork-item-history ref="dialogDayworkItemHistoryRef" />
  </div>
</template>

<script setup name="dayworkSelect">
import {
  listDaywork,
  listDayworkItem,
  getProcessList,
  delDayworkItem,
  lotList,
} from "@/api/business/daywork.js";
import { listDeptProcess } from "@/api/business/deptProcess";
import { selectUserPermissionList } from "@/api/system/user.js";
import router from "@/router";
import dayworkItemForm from "./form";
import sortItemForm from "./sortForm";
import useUserStore from "@/store/modules/user";
import productionPlanDetailStore from "@/store/modules/productionPlanDetail";
import { stubArray } from "lodash-es";

const is_identification = ref([
  //   {
  //   value: '1',
  //   label: '废品回用'
  // },
  {
    value: "2",
    label: "工艺修改",
  },
  {
    value: "4",
    label: "追增",
  },
  {
    value: "3",
    label: "正常批次",
  },
  {
    value: "0",
    label: "批废",
  },
  // , {
  //   value: '5',
  //   label: '分批'
  // }
]);

const { proxy } = getCurrentInstance();

/** 字典 */
const { daywork_status } = proxy.useDict("daywork_status");

/** 生产批次 */
const dayworkList = ref([]);
const dayworkTable = ref(null);
const currentDaywork = ref({});
const dayworkLoading = ref(false);
const total = ref(0);
/**工段 */
const permissionFlag = ref(false);
const loading = ref(false);
/** 报工信息 */
const dayworkItemList = ref([]);
const dayworkItemLoading = ref(false);
const itemTotal = ref(0);
const lastStatus = ref(null);
const latestProcessId = ref(null);
const latestDeptId = ref(null);
const permissionList = ref(null);
const deptProcessList = ref([]);
const dateRange = ref([
  proxy.moment().subtract(3, "month").format("YYYY-MM-DD"),
  proxy.moment().format("YYYY-MM-DD"),
]);
const statusOptions = [
  {
    value: 0,
    label: "下达",
  },
  {
    value: 1,
    label: "在产",
  },
  {
    value: 2,
    label: "完工",
  },
];
/**工序 */
const processList = ref([]);
/** 查询对象 */
const queryDayworkParams = ref({
  productDescription: "",
  deptId: "",
  lotCode: "",
  pageNum: 1,
  pageSize: 10,
  status: 1,
  queryStartTime: proxy.moment().subtract(3, "month").format("YYYY-MM-DD"),
  queryEndTime: proxy.moment().format("YYYY-MM-DD"),
});
const queryItemParams = ref({
  dayworkId: "0",
  isAmend: 0,
  isWasteRecycling: 0,
  pageNum: 1,
  pageSize: 10,
  technologicalProcessDetailId: null,
});
const route = useRoute();

/***********************  工段相关事件  ****************************/
function getList() {
  loading.value = true;
  console.log(route.params);
  console.log(productionPlanDetailStore().productionPlanNo);
  if (productionPlanDetailStore().productionPlanNo != null) {
    queryDayworkParams.value.productionPlanNo =
      productionPlanDetailStore().productionPlanNo;
    productionPlanDetailStore().setProductionPlanNo(null);
  }
  getPremission();
  getDayworks();
}

//切换工段
function handleDeptChange() {
  getDayworks();
}

/***********************  生产批次相关事件  ****************************/

/** 查询计划明细 */
function getDayworks() {
  dayworkLoading.value = true;
  const productionPlanDetailQueryParams =
    productionPlanDetailStore().productionPlanDetailQueryParams;

  if (productionPlanDetailQueryParams != null) {
    queryDayworkParams.value = productionPlanDetailQueryParams;
    dateRange.value =
      productionPlanDetailQueryParams.queryStartTime != null
        ? [
            productionPlanDetailQueryParams.queryStartTime,
            productionPlanDetailQueryParams.queryEndTime,
          ]
        : null;
  }
  lotList(queryDayworkParams.value).then((res) => {
    dayworkList.value = res.rows;
    for (var i = 0; i < dayworkList.value.length; i++) {
      // console.log(i, dayworkList.value[i], dayworkList.value[i].daywork)
      let timeStamp =
        dayworkList.value[i].daywork &&
        dayworkList.value[i].daywork.totalWorkingHours
          ? dayworkList.value[i].daywork.totalWorkingHours
          : 0;
      let seconds = Math.floor((timeStamp / 1000) % 60);
      let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
      let hours = Math.floor(timeStamp / (1000 * 60 * 60));
      let time = `${hours}小时${minutes}分钟${seconds}秒`;
      dayworkList.value[i].totalWorkingHours = time;
    }
    total.value = res.total;
    dayworkLoading.value = false;
    // 批次
    if (dayworkList.value.length > 0) {
      proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[0]);
      // console.log(dayworkList.value[0]);
    } else {
      dayworkItemList.value = [];
      itemTotal.value = 0;
    }
  });
}
function getPremission() {
  // console.log("888");
  selectUserPermissionList({ userId: useUserStore().user.userId }).then(
    (res) => {
      permissionList.value = res.data;
      // console.log(permissionList.value);
      if (permissionList.value.indexOf("business:productionPlan:query") != -1) {
        permissionFlag.value = true;
      } else {
        permissionFlag.value = false;
      }
    }
  );
}

/** 打开批次详情页 */
function handleColumnClick(row) {
  router.push({ path: "/reviseBath/lotFormParticulars/" + row.lotCode });
}
// 打开历史修改弹窗
function handleOpenHistory() {
  proxy.$refs.dialogDayworkItemHistoryRef.open(currentDaywork.value.id);
}

/** 生产计划明细 current-change 事件 */
function handleDayworkCurrentChange(row) {
  if (row) {
    queryItemParams.value.processId = null;
    currentDaywork.value = row;
    queryItemParams.value.dayworkId = currentDaywork.value.id;
    queryItemParams.value.isAmend = row.isAmend;
    queryItemParams.value.isWasteRecycling = row.isWasteRecycling;
    queryItemParams.value.technologicalProcessDetailId = null;
    queryItemParams.value.technologicalProcessId = row.technologicalProcessId;
    getDayworkItems();
    getProcess();
  } else {
    dayworkItemList.value = [];
    itemTotal.value = 0;
  }
}

/***********************  报工信息相关事件  ****************************/
//查询报工信息数据
function handleGetDayworkItems() {
  dayworkLoading.value = true;
  lotList(queryDayworkParams.value).then((res) => {
    dayworkList.value = res.rows;
    for (var i = 0; i < dayworkList.value.length; i++) {
      console.log(
        i,
        dayworkList.value[i],
        dayworkList.value[i].daywork,
        dayworkList.value[i].daywork.totalWorkingHours
      );
      let timeStamp = dayworkList.value[i].daywork
        ? dayworkList.value[i].daywork.totalWorkingHours
        : 0;
      let seconds = Math.floor((timeStamp / 1000) % 60);
      let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
      let hours = Math.floor(timeStamp / (1000 * 60 * 60));
      let time = `${hours}小时${minutes}分钟${seconds}秒`;
      dayworkList.value[i].totalWorkingHours = time;
    }
    total.value = res.total;
    dayworkLoading.value = false;
    if (dayworkList.value.length > 0) {
      for (var i = 0; i < dayworkList.value.length; i++) {
        if (dayworkList.value[i].id == currentDaywork.value.id) {
          var index = i;
          break;
        }
      }
    }
    proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[index]);
  });
}
//删除报工信息
function handleDeletedItem(id) {
  proxy.$modal.confirm("是否确认删除选中的数据项？").then(function () {
    delDayworkItem(id).then((res) => {
      if (res.code == 200) {
        proxy.$modal.msgSuccess("删除成功");
        lotList(queryDayworkParams.value).then((res) => {
          dayworkList.value = res.rows;
          for (var i = 0; i < dayworkList.value.length; i++) {
            let timeStamp = dayworkList.value[i].daywork
              ? dayworkList.value[i].daywork.totalWorkingHours
              : 0;
            let seconds = Math.floor((timeStamp / 1000) % 60);
            let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
            let hours = Math.floor(timeStamp / (1000 * 60 * 60));
            let time = `${hours}小时${minutes}分钟${seconds}秒`;
            dayworkList.value[i].totalWorkingHours = time;
          }
          total.value = res.total;
          // 批次
          proxy.$refs.dayworkTable.setCurrentRow(
            dayworkList.value[
              dayworkList.value.findIndex(
                (daywork) => daywork.id == currentDaywork.value.id
              )
            ]
          );
        });
      }
    });
  });
}
//修改报工信息
function handleSelectDayworkItem(row) {
  //同工序下状态是否有工序已完成
  let processFinish = false;
  //除了编辑此条以外的同工序合格数
  let totalQuailifiedNum = 0;
  for (let i = 0; i < dayworkItemList.value.length; i++) {
    if (
      row.processId == dayworkItemList.value[i].processId &&
      (dayworkItemList.value[i].status == 2 ||
        dayworkItemList.value[i].status == 3) &&
      row.id != dayworkItemList.value[i].id
    ) {
      totalQuailifiedNum += dayworkItemList.value[i].qualifiedNum;
    }
    if (
      row.processId == dayworkItemList.value[i].processId &&
      dayworkItemList.value[i].status == 3 &&
      row.id != dayworkItemList.value[i].id
    ) {
      processFinish = true;
    }
  }
  let maxQuailifiedNum =
    Math.floor(row.prodNum * 1.03 - totalQuailifiedNum) > 0
      ? Math.floor(row.prodNum * 1.03 - totalQuailifiedNum)
      : 0;
  //该daywork合格数总数不能超过投产数的103%
  row.technologicalProcessId = queryItemParams.value.technologicalProcessId;
  row.deptId = queryDayworkParams.value.deptId;
  row.productionPlanNo = currentDaywork.value.productionPlanNo;
  row.productDescription = currentDaywork.value.productDescription;
  row.productionPlanDetailId = currentDaywork.value.productionPlanDetailId;
  row.dayworkId = currentDaywork.value.id;
  row.lotId = currentDaywork.value.lotId;
  row.isAmend = currentDaywork.value.isAmend;
  row.isWasteRecycling = currentDaywork.value.isWasteRecycling;
  row.maxQuailifiedNum = maxQuailifiedNum;
  row.technologyVersion = currentDaywork.value.technologyVersion;
  row.lotCode = currentDaywork.value.lotCode;
  row.totalQuailifiedNum = totalQuailifiedNum;
  // console.log(row, currentDaywork)
  row.productId = currentDaywork.value.productId;
  //判断是否是当前工段
  if (row.deptId == currentDaywork.value.deptId) {
    row.currentDept = true;
  } else {
    row.currentDept = false;
  }
  //如果为true，则同工序已有工序已完成
  row.processFinish = processFinish;
  if (row.isSort == 0) {
    proxy.$refs.dayworkItemRef.open(row);
  } else {
    proxy.$refs.sortItemRef.open(row);
  }
}

//查看报工信息
function handleCheckDayworkItem(row) {
  row.technologicalProcessId = queryItemParams.value.technologicalProcessId;
  row.deptId = queryDayworkParams.value.deptId;
  row.productionPlanDetailId = currentDaywork.value.productionPlanDetailId;
  row.isAmend = currentDaywork.value.isAmend;
  row.isWasteRecycling = currentDaywork.value.isWasteRecycling;
  row.dayworkId = currentDaywork.value.id;
  row.lotId = currentDaywork.value.lotId;
  //判断是否是当前工段
  if (row.deptId == currentDaywork.value.deptId) {
    row.currentDept = true;
  } else {
    row.currentDept = false;
  }
  //修改向form表单传一个状态值
  row.editStatus = false;
  // row.returnFlag = false;
  // //如果是最新工序的已接收，则传一个状态值，给form表单一个退回按钮
  // if (row.processId == latestProcessId.value && row.status == 7) {
  //   row.returnFlag = true;
  // }
  if (row.isSort == 0) {
    proxy.$refs.dayworkItemRef.open(row);
  } else {
    proxy.$refs.sortItemRef.open(row);
  }
}

/**切换工序 */
function handleProcessChange() {
  getDayworkItems();
}

/** 报工详情列表 */
function getDayworkItems() {
  dayworkItemLoading.value = true;
  //查询该工段在工段资源分配时绑定的工序，传一个flag，如果flag有值则后端查询不分页
  listDeptProcess({ deptId: queryDayworkParams.value.deptId, flag: 1 }).then(
    (res) => {
      deptProcessList.value = res.rows;
      listDayworkItem(queryItemParams.value).then((res) => {
        console.log(currentDaywork.value);
        for (let i = 0; i < res.rows.length; i++) {
          //如果时首序，投产数是单批数
          if (
            res.rows[i].processStepNumber === res.others.isFirst &&
            res.rows[i].prodNum == 0
          ) {
            if (currentDaywork.value.isLast == 1) {
              res.rows[i].prodNum = currentDaywork.value.lastLotQuantity;
            } else {
              res.rows[i].prodNum = currentDaywork.value.oneLotQuantity;
            }
          }
          //拿到最新一条报工信息的工序id，只能编辑当前序
          // if (res.rows[i] == res.rows[res.rows.length - 1]) {
          //   latestProcessId.value = res.rows[i].processId;
          // }
        }
        if (res.others != null && res.others.latestProcessId != null) {
          latestProcessId.value = res.others.latestProcessId;
        }
        if (res.others != null && res.others.lastItem != null) {
          latestDeptId.value = res.others.lastItem.deptId;
          lastStatus.value = res.others.lastItem.status;
        }
        for (var i = 0; i < res.rows.length; i++) {
          let timeStamp = res.rows[i].workingHours;
          let seconds = Math.floor((timeStamp / 1000) % 60);
          let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
          let hours = Math.floor(timeStamp / (1000 * 60 * 60));
          let time = `${hours}小时${minutes}分钟${seconds}秒`;
          res.rows[i].workingHours = time;
          res.rows[i].deptProcessStatus = false;
          //报工记录的工序id是该工段绑定的工序时，允许编辑
          for (var item = 0; item < deptProcessList.value.length; item++) {
            if (
              res.rows[i].processId == deptProcessList.value[item].processId
            ) {
              res.rows[i].deptProcessStatus = true;
            }
          }
          console.log(res.rows[i].deptProcessStatus);
        }
        dayworkItemList.value = res.rows;
        getProcess();
        itemTotal.value = res.total;
        dayworkItemLoading.value = false;
      });
    }
  );
}
//工序信息
function getProcess() {
  //工序下拉框
  getProcessList({
    technologicalProcessId: queryItemParams.value.technologicalProcessId,
    isWasteRecycling: currentDaywork.value.isWasteRecycling,
    isAmend: currentDaywork.value.isAmend,
    lotId: currentDaywork.value.lotId,
  }).then((res) => {
    processList.value = res.data;
  });
}

/** 搜索按钮操作 */
function handleQuery() {
  if (
    queryDayworkParams.value.queryEndTime <
      queryDayworkParams.value.queryStartTime &&
    queryDayworkParams.value.queryStartTime != "" &&
    queryDayworkParams.value.queryEndTime != ""
  ) {
    return proxy.$modal.msgError("结束时间不能小于开始时间");
  }

  const query = queryDayworkParams.value;
  if (query.productDescription) {
    queryDayworkParams.value.productDescription =
      query.productDescription.trim();
  }
  if (query.productionPlanNo) {
    queryDayworkParams.value.productionPlanNo = query.productionPlanNo.trim();
  }
  if (query.furnaceNumber) {
    queryDayworkParams.value.furnaceNumber = query.furnaceNumber.trim();
  }

  const dayworkQueryParams = JSON.parse(
    JSON.stringify(queryDayworkParams.value)
  );
  // console.log("lotQueryParams", lotQueryParams);
  productionPlanDetailStore().setProductionPlanDetailQueryParams(
    dayworkQueryParams
  );
  getDayworks();
}

function statusFilter(status) {
  switch (status) {
    case 0:
      return "info";
    case 1:
      return "primary";
    case 2:
      return "success";
    default:
      return "default";
  }
}

function statusFilterText(status) {
  switch (status) {
    case 0:
      return "下达";
    case 1:
      return "在产";
    case 2:
      return "完工";
    default:
      return "";
  }
}

// function dateRangeChange(arg) {
//   console.log(arg);
//   if (arg != null && arg.length > 0) {
//     queryDayworkParams.value.queryStartTime = arg[0];
//     queryDayworkParams.value.queryEndTime = arg[1];
//   } else {
//     queryDayworkParams.value.queryStartTime = null;
//     queryDayworkParams.value.queryEndTime = null;
//   }
// }

function handleDateChange() {}

onMounted(() => {
  getList();
});
</script>
<style scoped>
.el-form--inline .el-form-item {
  margin-right: 20px;
}
</style>
