提交
This commit is contained in:
1 parent
2716c2b6f8
commit
f3693be913
140 files changed
+799199
-11262
No files matched your search
@@ -88,6 +88,15 @@ export function getPlanProductSpec(product: { model?: string; packageSpec?: stri
|
||||
return product.model || product.packageSpec || '—'
|
||||
}
|
||||
|
||||
/** 列表「型号/规格」列:仅型号,不用包装规格兜底 */
|
||||
export function getPlanProductModel(product: { model?: string | null }) {
|
||||
return product.model || '—'
|
||||
}
|
||||
|
||||
export function getPlanProductPackageSpec(product: { packageSpec?: string | null }) {
|
||||
return product.packageSpec || '—'
|
||||
}
|
||||
|
||||
export function getPlanProductQuantity(product: {
|
||||
quantity?: number | string | null
|
||||
actualQty?: number | string | null
|
||||
@@ -112,6 +121,15 @@ export function getPlanProductPlannedQuantity(product: {
|
||||
return String(qty)
|
||||
}
|
||||
|
||||
/** 列表「实际数量」列:仅实际数量,无回退 */
|
||||
export function getPlanProductActualQuantity(product: {
|
||||
actualQty?: number | string | null
|
||||
}) {
|
||||
const qty = product.actualQty
|
||||
if (qty === undefined || qty === null || qty === '') return '—'
|
||||
return String(qty)
|
||||
}
|
||||
|
||||
export function formatPlanProductListText(
|
||||
product: {
|
||||
productName?: string
|
||||
@@ -306,6 +324,9 @@ export function canPrintSlipCommand(planType: string | undefined, command: PlPri
|
||||
|
||||
export type PlPlanTypeTab = 'all' | 'inbound' | 'outbound' | 'direct'
|
||||
|
||||
/** 危化品证上传页 Tab(在单据类型后增加「未上传证书」) */
|
||||
export type PlPlanCertTab = PlPlanTypeTab | 'cert_incomplete'
|
||||
|
||||
export const PL_PLAN_TYPE_TABS: { label: string; name: PlPlanTypeTab }[] = [
|
||||
{ label: '全部', name: 'all' },
|
||||
{ label: '入库单', name: 'inbound' },
|
||||
@@ -313,10 +334,25 @@ export const PL_PLAN_TYPE_TABS: { label: string; name: PlPlanTypeTab }[] = [
|
||||
{ label: '直销单', name: 'direct' }
|
||||
]
|
||||
|
||||
export const PL_PLAN_CERT_TABS: { label: string; name: PlPlanCertTab }[] = [
|
||||
...PL_PLAN_TYPE_TABS,
|
||||
{ label: '未上传证书', name: 'cert_incomplete' }
|
||||
]
|
||||
|
||||
export function plPlanTypeTabToFilter(tab: PlPlanTypeTab): string {
|
||||
return tab === 'all' ? '' : tab
|
||||
}
|
||||
|
||||
export function plPlanCertTabToFilters(tab: PlPlanCertTab): {
|
||||
planType: string
|
||||
certUploadStatus?: string
|
||||
} {
|
||||
if (tab === 'cert_incomplete') {
|
||||
return { planType: '', certUploadStatus: 'incomplete' }
|
||||
}
|
||||
return { planType: plPlanTypeTabToFilter(tab) }
|
||||
}
|
||||
|
||||
export function plPlanTypeFilterToTab(planType?: string): PlPlanTypeTab {
|
||||
if (planType === 'inbound' || planType === 'outbound' || planType === 'direct') {
|
||||
return planType
|
||||
|
||||
Reference in new issue
Block a user