| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 }; |
| | | } |
| | | |