import type { DocumentType } from "@/common/enums/DocumentType";
import { DOCUMENT_TYPE_CONFIG } from "@/common/enums/DocumentTypeConfig";
import { dayjs } from "element-plus";

export const generateDucumentNo = (code: DocumentType | string) => {
  var prefix;
  if (typeof code === "string") {
    prefix = code;
  } else {
    prefix = DOCUMENT_TYPE_CONFIG[code].documentNoPrefix;
  }
  return prefix + dayjs().format("YYYYMMDDHHmmss");
};
