新增销售和采购订单扫码出库功能的前端页面支持,优化API接口以处理合格和不合格出库情况
已添加2个文件
98 ■■■■■ 文件已修改
src/pages/inventoryManagement/scanOut/scanOut.constants.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/inventoryManagement/scanOut/scanOut.fields.ts 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/inventoryManagement/scanOut/scanOut.constants.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
export const QUALITY_TYPE = {
  qualified: "qualified",
  unqualified: "unqualified",
} as const;
export type QualityType = (typeof QUALITY_TYPE)[keyof typeof QUALITY_TYPE];
export const CONTRACT_KIND = {
  sales: "sales",
  purchase: "purchase",
} as const;
export type ContractKind = (typeof CONTRACT_KIND)[keyof typeof CONTRACT_KIND];
src/pages/inventoryManagement/scanOut/scanOut.fields.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,84 @@
import { computed, type Ref } from "vue";
import { CONTRACT_KIND, type ContractKind } from "./scanOut.constants";
export const detailFieldRowsSales = [
  { label: "楼层编号", key: "floorCode" },
  { label: "产品大类", key: "productCategory" },
  { label: "规格型号", key: "specificationModel" },
  { label: "厚度", key: "thickness" },
  { label: "宽(mm)", key: "width" },
  { label: "高(mm)", key: "height" },
  { label: "周长(cm)", key: "perimeter" },
  { label: "总面积(m²)", key: "actualTotalArea" },
  { label: "加工要求", key: "processRequirement" },
  { label: "备注", key: "remark" },
  { label: "重箱", key: "heavyBox" },
  { label: "产品状态", key: "approveStatus" },
  { label: "入库状态", key: "productStockStatus" },
  { label: "快递公司", key: "expressCompany" },
  { label: "快递单号", key: "expressNumber" },
  { label: "发货车牌", key: "shippingCarNumber" },
  { label: "发货日期", key: "shippingDate" },
  { label: "数量", key: "quantity" },
  { label: "剩余数量", key: "remainingQuantity" },
  { label: "税率(%)", key: "taxRate" },
  { label: "含税单价(元)", key: "taxInclusiveUnitPrice" },
  { label: "含税总价(元)", key: "taxInclusiveTotalPrice" },
  { label: "不含税总价(元)", key: "taxExclusiveTotalPrice" },
] as const;
export const detailFieldRowsPurchase = [
  { label: "产品大类", key: "productCategory" },
  { label: "规格型号", key: "specificationModel" },
  { label: "单位", key: "unit" },
  { label: "数量", key: "quantity" },
  { label: "可用数量", key: "availableQuality" },
  { label: "剩余数量", key: "remainingQuantity" },
  { label: "退货数量", key: "returnQuality" },
  { label: "税率(%)", key: "taxRate" },
  { label: "含税单价(元)", key: "taxInclusiveUnitPrice" },
  { label: "含税总价(元)", key: "taxInclusiveTotalPrice" },
  { label: "不含税总价(元)", key: "taxExclusiveTotalPrice" },
] as const;
export const summaryFieldRowsSales = [
  { label: "楼层编号", key: "floorCode" },
  { label: "产品大类", key: "productCategory" },
  { label: "规格型号", key: "specificationModel" },
  { label: "数量", key: "quantity" },
  { label: "剩余数量", key: "remainingQuantity" },
  { label: "产品状态", key: "approveStatus" },
  { label: "入库状态", key: "productStockStatus" },
] as const;
export const summaryFieldRowsPurchase = [
  { label: "产品大类", key: "productCategory" },
  { label: "规格型号", key: "specificationModel" },
  { label: "单位", key: "unit" },
  { label: "数量", key: "quantity" },
  { label: "可用数量", key: "availableQuality" },
  { label: "剩余数量", key: "remainingQuantity" },
] as const;
type FieldRow = { label: string; key: string };
export function useScanOutFieldRows(contractKindRef: Ref<ContractKind>) {
  const fieldRowsByContractKind = {
    [CONTRACT_KIND.sales]: {
      detail: detailFieldRowsSales,
      summary: summaryFieldRowsSales,
    },
    [CONTRACT_KIND.purchase]: {
      detail: detailFieldRowsPurchase,
      summary: summaryFieldRowsPurchase,
    },
  } as const satisfies Record<ContractKind, { detail: readonly FieldRow[]; summary: readonly FieldRow[] }>;
  const currentContractFieldRows = computed(() => fieldRowsByContractKind[contractKindRef.value]);
  const detailFieldRows = computed(() => currentContractFieldRows.value.detail);
  const summaryFieldRows = computed(() => currentContractFieldRows.value.summary);
  return { detailFieldRows, summaryFieldRows };
}