add dateFilter.ts
This commit is contained in:
@@ -198,6 +198,7 @@ import ProductAPI from "@/api/ProductAPI";
|
||||
import ProductSelectPopup from "@/components/productSelector/ProductSelectPopup.vue";
|
||||
import type { ProductSkuSelectionValue } from "@/types/ProductSkuSelection";
|
||||
import { buildPresetDateRange, parseDateFilterType, parseDateTime } from "@/utils/date";
|
||||
import { DATE_FILTER_OPTIONS as dateOptions, type DateFilterType } from "@/utils/dateFilter";
|
||||
import { getErrorMessage } from "@/utils/error";
|
||||
import { getProductBaseUnitName, getProductPhotoURL, getProductQuantityText, getProductTypeText, getStockOperationText } from "@/utils/product";
|
||||
import { Message } from "@/utils/message";
|
||||
@@ -209,7 +210,6 @@ import type { Product, ProductSelection, ProductSku, StockOperationType, StockRe
|
||||
|
||||
defineOptions({ name: "ProductStockRecordList" });
|
||||
|
||||
type DateFilterType = "today" | "yesterday" | "thisWeek" | "thisMonth" | "lastMonth" | "all" | "custom";
|
||||
type OperationFilter = "ALL" | StockOperationType;
|
||||
type DirectionFilter = "ALL" | StockRecordDirection;
|
||||
|
||||
@@ -239,15 +239,6 @@ const activeReservationRequested = getQueryText("activeReservationOnly") === "tr
|
||||
const operationType = ref<OperationFilter>(getQueryText("operationType") as OperationFilter || (activeReservationRequested ? "ORDER_RESERVE" : "ALL"));
|
||||
const direction = ref<DirectionFilter>(getQueryText("direction") as DirectionFilter || "ALL");
|
||||
const keyword = ref(getQueryText("keyword"));
|
||||
const dateOptions: Array<{ label: string; value: DateFilterType }> = [
|
||||
{ label: "今天", value: "today" },
|
||||
{ label: "昨天", value: "yesterday" },
|
||||
{ label: "本周", value: "thisWeek" },
|
||||
{ label: "本月", value: "thisMonth" },
|
||||
{ label: "上个月", value: "lastMonth" },
|
||||
{ label: "全部", value: "all" },
|
||||
{ label: "自定义范围", value: "custom" }
|
||||
];
|
||||
const dateFilterType = ref<DateFilterType>(parseDateFilterType(getQueryText("dateType"), dateOptions, "all"));
|
||||
const dateRange = ref<[string, string]>(parseDateRange(dateFilterType.value));
|
||||
const startDraft = ref("");
|
||||
|
||||
Reference in New Issue
Block a user