This commit is contained in:
zlwu committed 2026-06-26 00:50:04 +08:00
1 parent 0b50eff3d8
commit ee364e24aa
323 files changed
+57731 -35766

No files matched your search

+3
View File
@@ -12,6 +12,7 @@ export type EnvDetectRecord = {
id: string
recordNo: string
detectTime: string
resultTime?: string
inspectorIds: string[]
inspectorNames: string[]
inspectorDisplay: string
@@ -48,6 +49,7 @@ export function fetchEnvDetectRecordDetail(id: string) {
export function fetchCreateEnvDetectRecord(data: {
detectTime: string
resultTime?: string
inspectorIds: string[]
envDetectItemId: string
resultDesc: string
@@ -64,6 +66,7 @@ export function fetchUpdateEnvDetectRecord(
id: string,
data: {
detectTime?: string
resultTime?: string
inspectorIds?: string[]
envDetectItemId?: string
resultDesc?: string
@@ -6,6 +6,7 @@ import type {
OutboundQcDetailInfusionSchedule,
OutboundQcDetailProduct
} from '@/api/qc-work-order'
import type { QcInspectionBatch } from '@/utils/qc-inspection-batch'
type PageList<T> = {
list: T[]
@@ -82,19 +83,24 @@ export type OutboundProductionInfo = {
export type OutboundQcTask = {
id?: string
taskNo?: string
itemName?: string
taskType?: string
taskTypeLabel?: string
taskStatus?: string
taskStatusLabel?: string
conclusion?: string
conclusionLabel?: string
batchId?: string
}
export type OutboundQcInfo = {
id?: string
workOrderNo?: string
workOrderStatus?: string
workOrderStatusLabel?: string
tasks?: OutboundQcTask[]
inspectionBatches?: QcInspectionBatch[]
}
export type OutboundReleaseReviewDetail = {
+3
View File
@@ -39,6 +39,7 @@ export type ProductionMaterialBatch = {
stockInNo: string
stockInDate: string
expireDate: string
productionDate?: string
catalogNo: string
batchNo: string
manufacturer: string
@@ -72,6 +73,7 @@ export type ProductionMaterialBatchOption = {
stockInNo: string
stockInDate?: string
expireDate?: string
productionDate?: string
materialId: string
materialCode: string
materialName: string
@@ -92,6 +94,7 @@ export type StockInPayload = {
stockInNo: string
stockInDate: string
expireDate: string
productionDate?: string
catalogNo: string
batchNo: string
manufacturer: string
@@ -1,4 +1,5 @@
import request from '@/utils/http'
import type { ProductionWorkOrderTabKey } from '@/utils/production-work-order-tabs'
import type {
QcWorkOrderReceptionDetail,
OutboundQcDetailApplication,
@@ -188,3 +189,50 @@ export function fetchCreateQcFromProduction(
data
})
}
export type ProductionWorkOrderTabStepCount = {
overdueIncomplete: number
unassigned: number
}
export type ProductionWorkOrderTabStepCounts = Record<
ProductionWorkOrderTabKey,
ProductionWorkOrderTabStepCount
>
export function formatProductionWorkOrderTabStepBadge(count: ProductionWorkOrderTabStepCount): string {
const fmt = (n: number) => (n > 99 ? '99+' : String(n))
return `${fmt(count.overdueIncomplete)}+${fmt(count.unassigned)}`
}
export function isProductionWorkOrderTabStepBadgeZero(count: ProductionWorkOrderTabStepCount): boolean {
return (count.overdueIncomplete || 0) === 0 && (count.unassigned || 0) === 0
}
/** 汇总可见 Tab 的步骤角标(左侧菜单展示各 Tab 数值之和) */
export function sumProductionWorkOrderTabStepCounts(
counts: Partial<ProductionWorkOrderTabStepCounts> | null | undefined,
tabKeys: ProductionWorkOrderTabKey[]
): ProductionWorkOrderTabStepCount {
return tabKeys.reduce(
(acc, key) => {
const c = counts?.[key]
acc.overdueIncomplete += c?.overdueIncomplete || 0
acc.unassigned += c?.unassigned || 0
return acc
},
{ overdueIncomplete: 0, unassigned: 0 }
)
}
export function fetchProductionWorkOrderTabStepCounts() {
return request.get<ProductionWorkOrderTabStepCounts>({
url: '/web/admin/production-work-orders/tab-step-counts'
})
}
export function fetchMineProductionWorkOrderTabStepCounts() {
return request.get<ProductionWorkOrderTabStepCounts>({
url: '/web/admin/production-work-orders/mine-tab-step-counts'
})
}
+4
View File
@@ -6,8 +6,12 @@ export type QcItemParam = {
paramCode: string
paramUnit?: string
paramType: string
options?: string
defaultValue?: string
requiredFlag: string
orderNum?: number
/** 表单编辑单选选项文本,逗号分隔(仅前端) */
_optionText?: string
}
export function fetchQcItemParams(itemSource: string, itemId: string) {
+3
View File
@@ -7,6 +7,9 @@ export type QcTaskResultItem = {
paramCode?: string
paramUnit?: string
paramType: string
options?: string
defaultValue?: string
requiredFlag?: string
paramValue: string
}
+3
View File
@@ -78,6 +78,9 @@ export type QcTask = {
assigneeUserIds?: string[]
assigneeUserNames?: string
sourceLineId?: string
batchId?: string
batchName?: string
batchNo?: string
remark?: string
createTime?: string
updateTime?: string
+35 -4
View File
@@ -1,4 +1,6 @@
import request from '@/utils/http'
import type { QcInspectionBatch } from '@/utils/qc-inspection-batch'
import type { QcWorkOrderTabKey } from '@/utils/qc-work-order-tabs'
type PageList<T> = {
list: T[]
@@ -176,6 +178,25 @@ export type QcWorkOrderDetail = QcWorkOrder & {
assigneeUserNames?: string
attachmentFiles?: Array<{ id?: string; fileUrl?: string; fileName?: string }>
}>
inspectionBatches?: QcInspectionBatch[]
}
export type QcWorkOrderTabUnfinishedCounts = Record<QcWorkOrderTabKey, number>
export function formatQcWorkOrderTabBadgeCount(count: number): string {
return count > 99 ? '99+' : String(count)
}
export function fetchQcWorkOrderTabUnfinishedCounts() {
return request.get<QcWorkOrderTabUnfinishedCounts>({
url: '/web/admin/qc-work-orders/tab-unfinished-counts'
})
}
export function fetchMineQcWorkOrderTabUnfinishedCounts() {
return request.get<QcWorkOrderTabUnfinishedCounts>({
url: '/web/admin/qc-work-orders/mine-tab-unfinished-counts'
})
}
export function fetchQcWorkOrderList(params?: {
@@ -207,10 +228,19 @@ export function fetchQcWorkOrderDetail(id: string) {
export function fetchConfigureQcWorkOrder(
id: string,
data: {
hasLab: boolean
hasThirdParty: boolean
labItemIds: string[]
thirdPartyItemIds: string[]
batches?: Array<{
id?: string
batchName?: string
assigneeUserIds: string[]
hasLab: boolean
hasThirdParty: boolean
labItemIds: string[]
thirdPartyItemIds: string[]
}>
hasLab?: boolean
hasThirdParty?: boolean
labItemIds?: string[]
thirdPartyItemIds?: string[]
labItemAssignees?: Record<string, string[]>
thirdPartyItemAssignees?: Record<string, string[]>
}
@@ -317,6 +347,7 @@ export type OutboundQcDetail = {
infusionSchedule?: OutboundQcDetailInfusionSchedule
products?: OutboundQcDetailProduct[]
tasks?: QcWorkOrderDetail['tasks']
inspectionBatches?: QcInspectionBatch[]
}
export function fetchOutboundQcDetail(id: string) {
@@ -1,4 +1,5 @@
import request from '@/utils/http'
import type { QcInspectionBatch } from '@/utils/qc-inspection-batch'
import type { QcWorkOrderReceptionDetail } from '@/api/qc-work-order'
type PageList<T> = {
@@ -74,15 +75,19 @@ export type ReceptionInfo = {
export type QcInfoTask = {
id?: string
taskNo?: string
itemName?: string
taskType?: string
taskTypeLabel?: string
taskStatus?: string
taskStatusLabel?: string
conclusion?: string
conclusionLabel?: string
batchId?: string
}
export type QcInfo = {
id?: string
workOrderNo?: string
workOrderStatus?: string
workOrderStatusLabel?: string
@@ -98,6 +103,7 @@ export type QcInfo = {
productionWorkOrderId?: string
productionWorkOrderNo?: string
tasks?: QcInfoTask[]
inspectionBatches?: QcInspectionBatch[]
}
export type ProductionInfoTask = {