FPSMS-frontend
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

547 строки
14 KiB

  1. export interface ItemLotTraceLotInfo {
  2. inventoryLotId: number;
  3. lotNo: string;
  4. itemId: number;
  5. itemCode: string;
  6. itemName: string;
  7. expiryDate: string | null;
  8. productionDate: string | null;
  9. stockInDate: string | null;
  10. uom: string;
  11. primaryStockInLineId: number | null;
  12. }
  13. export interface ItemLotTraceWarehouseLine {
  14. inventoryLotLineId: number;
  15. warehouseCode: string;
  16. inQty: number;
  17. outQty: number;
  18. issueQty: number;
  19. status: string;
  20. availableQty: number;
  21. }
  22. export interface ItemLotTraceAlternateLocation {
  23. inventoryLotId: number;
  24. stockInLineId: number | null;
  25. inventoryLotLineId: number;
  26. warehouseCode: string;
  27. availableQty: number;
  28. }
  29. /**
  30. * Per-location lifecycle trace block for one alternate inventory_lot
  31. * sharing the same lotNo+itemId. Contains only location-scoped dimensions.
  32. * Lot-level dimensions (BOM, JO prelude, production, byproducts, lot relations)
  33. * are NOT included — they're at the top level of ItemLotTraceResponse.
  34. */
  35. export interface ItemLotTraceLocationBlock {
  36. inventoryLotId: number;
  37. lotNo: string;
  38. itemCode: string;
  39. itemName?: string;
  40. uom?: string;
  41. expiryDate?: string | null;
  42. productionDate?: string | null;
  43. stockInDate?: string | null;
  44. stockInLineId: number | null;
  45. warehouseLines: ItemLotTraceWarehouseLine[];
  46. origins: ItemLotTraceOrigin[];
  47. purchaseEvents?: ItemLotTracePurchaseEvent[];
  48. qcResults: ItemLotTraceQcResult[];
  49. putawayEvents: ItemLotTracePutawayEvent[];
  50. movements: ItemLotTraceMovement[];
  51. outboundUsage: ItemLotTraceOutboundUsage[];
  52. stockTakeEvents: ItemLotTraceStockTakeEvent[];
  53. adjustments: ItemLotTraceAdjustment[];
  54. transfers: ItemLotTraceTransfer[];
  55. openMovements: ItemLotTraceOpenMovement[];
  56. failEvents: ItemLotTraceFailEvent[];
  57. doDeliveries: ItemLotTraceDoDelivery[];
  58. replenishmentEvents?: ItemLotTraceReplenishmentEvent[];
  59. returnEvents: ItemLotTraceReturnEvent[];
  60. }
  61. export interface ItemLotTraceReplenishmentEvent {
  62. replenishmentId: number;
  63. replenishmentCode: string;
  64. sourceDoCode: string;
  65. sourceDoId: number | null;
  66. shopCode: string;
  67. shopName: string;
  68. itemNo: string;
  69. itemName: string;
  70. reason: string;
  71. replenishQty: number;
  72. handler: string;
  73. timestamp: string | null;
  74. pickOrderLineId: number | null;
  75. stockOutLineId: number | null;
  76. lotNo?: string;
  77. inventoryLotId?: number;
  78. shopContactName?: string;
  79. shopContactNo?: string;
  80. shopContactEmail?: string;
  81. shopAddress?: string;
  82. shopDistrict?: string;
  83. }
  84. export interface ItemLotTraceOrigin {
  85. stockInLineId: number;
  86. type: string;
  87. refCode: string;
  88. refId: number | null;
  89. supplierCode: string;
  90. supplierName: string;
  91. dnNo: string;
  92. receiptDate: string | null;
  93. acceptedQty: number;
  94. status: string;
  95. }
  96. export interface ItemLotTracePurchaseEvent {
  97. purchaseOrderLineId: number;
  98. purchaseOrderId: number | null;
  99. purchaseOrderCode: string;
  100. itemCode: string;
  101. itemName: string;
  102. orderQty: number;
  103. putAwayQty: number;
  104. purchaseUnit: string;
  105. supplierCode: string;
  106. supplierName: string;
  107. orderDate: string | null;
  108. status: string;
  109. }
  110. export interface ItemLotTraceQcResult {
  111. stockInLineId: number;
  112. qcPassed: boolean;
  113. failQty: number;
  114. acceptedQty: number;
  115. remarks: string;
  116. handledBy: string;
  117. created: string | null;
  118. qcItemCode?: string;
  119. qcItemName?: string;
  120. qcItemDescription?: string;
  121. qcType?: string;
  122. }
  123. export interface ItemLotTraceMovement {
  124. direction: string;
  125. qty: number;
  126. movementType: string;
  127. refType: string;
  128. refCode: string;
  129. refId: number | null;
  130. warehouseCode: string;
  131. handledBy: string;
  132. timestamp: string | null;
  133. remarks: string;
  134. pickConsoCode?: string;
  135. outboundTicketNo?: string;
  136. deliveryOrderPickOrderId?: number | null;
  137. relationshipId?: number | null;
  138. doOutboundIsExtra?: boolean;
  139. doOutboundIsReplenish?: boolean;
  140. doOutboundQtyChanged?: boolean;
  141. processingStatus?: string;
  142. matchStatus?: string;
  143. }
  144. export interface ItemLotTracePutawayEvent {
  145. inventoryLotLineId: number;
  146. stockInLineId: number | null;
  147. warehouseCode: string;
  148. qty: number;
  149. handledBy: string;
  150. timestamp: string | null;
  151. refType: string;
  152. refCode: string;
  153. refId: number | null;
  154. status?: string;
  155. }
  156. export interface ItemLotTraceOutboundUsage {
  157. stockOutLineId: number;
  158. qty: number;
  159. pickOrderCode: string;
  160. pickOrderId: number | null;
  161. consoCode: string;
  162. jobOrderCode: string;
  163. jobOrderId: number | null;
  164. deliveryOrderCode: string;
  165. handler: string;
  166. timestamp: string | null;
  167. usageType: string;
  168. }
  169. export interface ItemLotTraceStockTakeRecordDetail {
  170. stockTakeLineId: number;
  171. bookQty: number;
  172. pickerFirstQty?: number | null;
  173. pickerFirstBadQty?: number | null;
  174. pickerSecondQty?: number | null;
  175. pickerSecondBadQty?: number | null;
  176. approverQty?: number | null;
  177. approverBadQty?: number | null;
  178. stockTakerName?: string | null;
  179. approverName?: string | null;
  180. stockTakeStartTime?: string | null;
  181. stockTakeEndTime?: string | null;
  182. approverTime?: string | null;
  183. recordStatus?: string | null;
  184. lastSelect?: number | null;
  185. varianceQty?: number | null;
  186. }
  187. export interface ItemLotTraceStockTakeEvent {
  188. stockTakeCode: string;
  189. lotNo?: string;
  190. itemCode?: string;
  191. itemName?: string;
  192. warehouseCode?: string;
  193. stockTakeSection?: string;
  194. stockTakeRoundId?: number | null;
  195. stockTakeRoundName?: string;
  196. varianceQty: number;
  197. beforeQty: number;
  198. afterQty?: number | null;
  199. approver: string;
  200. timestamp: string | null;
  201. recordDetail?: ItemLotTraceStockTakeRecordDetail | null;
  202. }
  203. export interface ItemLotTraceAdjustment {
  204. adjustmentType: string;
  205. direction: string;
  206. qty: number;
  207. reason: string;
  208. handledBy: string;
  209. timestamp: string | null;
  210. refCode: string;
  211. warehouseCode?: string;
  212. }
  213. export interface ItemLotTraceTransfer {
  214. fromWarehouse: string;
  215. toWarehouse: string;
  216. qty: number;
  217. transferCode: string;
  218. timestamp: string | null;
  219. }
  220. export interface ItemLotTraceBomDownstream {
  221. jobOrderCode: string;
  222. jobOrderId: number | null;
  223. finishedItemCode: string;
  224. finishedLotNo: string;
  225. finishedStockInLineId: number | null;
  226. fgQty: number;
  227. fgUom?: string;
  228. materialQtyUsed: number;
  229. }
  230. export interface ItemLotTraceBomUpstream {
  231. jobOrderCode: string;
  232. jobOrderId: number | null;
  233. materialItemCode: string;
  234. materialLotNo: string;
  235. materialStockInLineId: number | null;
  236. materialQty: number;
  237. bomQtyPerUnit: number | null;
  238. }
  239. export interface ItemLotTraceBomRecipeLine {
  240. materialItemCode: string;
  241. materialItemName: string;
  242. qtyPerUnit: number;
  243. uom: string;
  244. bomProcessId?: number | null;
  245. bomProcessSeqNo?: number | null;
  246. assignedStepName?: string;
  247. }
  248. export interface ItemLotTraceStepMaterialRef {
  249. materialItemCode: string;
  250. materialItemName: string;
  251. qtyPerUnit: number;
  252. uom: string;
  253. }
  254. export interface ItemLotTraceBomTrace {
  255. direction: string;
  256. downstream: ItemLotTraceBomDownstream[];
  257. upstream: ItemLotTraceBomUpstream[];
  258. bomRecipe: ItemLotTraceBomRecipeLine[];
  259. }
  260. export interface ItemLotTraceJoContext {
  261. jobOrderId: number;
  262. jobOrderCode: string;
  263. planStart: string | null;
  264. /** Earliest jo_pick_order.created for this JO. */
  265. createdAt?: string | null;
  266. reqQty: number;
  267. status: string;
  268. }
  269. export interface ItemLotTraceJoPickLine {
  270. pickOrderLineId: number;
  271. itemCode: string;
  272. itemName: string;
  273. requiredQty: number;
  274. pickedQty: number;
  275. status: string;
  276. itemType?: string;
  277. stockUom?: string;
  278. bomReqQty?: number | null;
  279. bomUom?: string;
  280. bomProcessId?: number | null;
  281. bomProcessSeqNo?: number | null;
  282. assignedStepName?: string;
  283. stockAvailable?: number | null;
  284. stockStatusApplicable?: boolean;
  285. }
  286. export interface ItemLotTraceJoPickOrder {
  287. pickOrderId: number;
  288. pickOrderCode: string;
  289. consoCode: string;
  290. status: string;
  291. targetDate: string | null;
  292. completeDate: string | null;
  293. releasedDate: string | null;
  294. lines: ItemLotTraceJoPickLine[];
  295. }
  296. export interface ItemLotTraceMaterialInput {
  297. jobOrderCode: string;
  298. jobOrderId: number | null;
  299. materialItemCode: string;
  300. materialItemName: string;
  301. materialLotNo: string;
  302. materialStockInLineId: number | null;
  303. materialInventoryLotId: number | null;
  304. materialQty: number;
  305. materialUom?: string;
  306. bomQtyPerUnit: number | null;
  307. bomProcessId?: number | null;
  308. bomProcessSeqNo?: number | null;
  309. assignedStepName?: string;
  310. pickOrderCode: string;
  311. pickOrderId: number | null;
  312. consoCode: string;
  313. pickedAt: string | null;
  314. processingStatus?: string;
  315. matchStatus?: string;
  316. stockInOrigin: ItemLotTraceOrigin | null;
  317. purchaseEvents?: ItemLotTracePurchaseEvent[];
  318. qcResults: ItemLotTraceQcResult[];
  319. putawayEvents: ItemLotTracePutawayEvent[];
  320. /** When this material was produced by another JO, its upstream pick/prelude chain. */
  321. nestedJoPrelude?: ItemLotTraceJoPrelude | null;
  322. /** Production steps from the JO that produced this material lot. */
  323. productionSteps?: ItemLotTraceProductionStep[];
  324. }
  325. export interface ItemLotTraceJoPrelude {
  326. jobOrder: ItemLotTraceJoContext;
  327. pickOrders: ItemLotTraceJoPickOrder[];
  328. materialInputs: ItemLotTraceMaterialInput[];
  329. }
  330. export interface ItemLotTraceProductionStep {
  331. processLineId: number;
  332. stepName: string;
  333. description: string;
  334. equipmentCode: string;
  335. equipmentName: string;
  336. operatorName: string;
  337. startTime: string | null;
  338. endTime: string | null;
  339. outputQty: number;
  340. scrapQty: number;
  341. defectQty: number;
  342. status: string;
  343. seqNo: number | null;
  344. bomProcessId?: number | null;
  345. stepMaterials?: ItemLotTraceStepMaterialRef[];
  346. }
  347. /** Sibling byproduct lot from the same job order (independent item/lot, traceable). */
  348. export interface ItemLotTraceByproductLot {
  349. inventoryLotId: number | null;
  350. stockInLineId: number | null;
  351. lotNo: string;
  352. itemCode: string;
  353. itemName: string;
  354. qty: number;
  355. uom: string;
  356. processStepName: string;
  357. producedAt: string | null;
  358. jobOrderCode: string;
  359. jobOrderId: number | null;
  360. }
  361. export interface ItemLotTraceOpenMovement {
  362. stockInLineId: number;
  363. qty: number;
  364. warehouseCode: string;
  365. refCode: string;
  366. handledBy: string;
  367. timestamp: string | null;
  368. remarks: string;
  369. }
  370. export interface ItemLotTraceFailEvent {
  371. failId: number;
  372. failType: string;
  373. category: string;
  374. qty: number;
  375. handlerName: string;
  376. recordDate: string | null;
  377. pickOrderCode: string;
  378. pickOrderId: number | null;
  379. }
  380. export interface ItemLotTraceDoDelivery {
  381. stockOutLineId: number;
  382. qty: number;
  383. pickOrderCode: string;
  384. pickOrderId: number | null;
  385. consoCode: string;
  386. ticketNo?: string;
  387. deliveryOrderCode: string;
  388. deliveryOrderId: number | null;
  389. shopCode?: string;
  390. shopName?: string;
  391. handler: string;
  392. timestamp: string | null;
  393. releaseType?: string | null;
  394. deliveryOrderPickOrderId?: number | null;
  395. relationshipId?: number | null;
  396. deliveryNoteCode?: string;
  397. doPickOrderRecordId?: number | null;
  398. isExtra?: boolean;
  399. isReplenish?: boolean;
  400. /** True when pick_order_line.qty ≠ SUM(stock_out_line.qty) for that line (改數). */
  401. qtyChanged?: boolean;
  402. shopContactName?: string;
  403. shopContactNo?: string;
  404. shopContactEmail?: string;
  405. shopAddress?: string;
  406. shopDistrict?: string;
  407. itemCode?: string;
  408. itemName?: string;
  409. lotNo?: string;
  410. inventoryLotId?: number;
  411. }
  412. export interface ItemLotTraceReturnEvent {
  413. stockOutLineId: number;
  414. qty: number;
  415. refCode: string;
  416. movementType: string;
  417. warehouseCode: string;
  418. handler: string;
  419. timestamp: string | null;
  420. remarks: string;
  421. }
  422. export interface ItemLotTraceLotRelation {
  423. relationType: string;
  424. inventoryLotId: number | null;
  425. lotNo: string;
  426. itemCode: string;
  427. itemName: string;
  428. qty: number;
  429. productLotNo: string;
  430. timestamp: string | null;
  431. }
  432. export interface ItemLotTraceGraphEdge {
  433. fromKey: string;
  434. toKey: string;
  435. kind?: string;
  436. }
  437. export interface ItemLotTraceGraphNodeRef {
  438. key: string;
  439. kind: string;
  440. scopeKey?: string | null;
  441. refCode?: string | null;
  442. traceLotNo?: string | null;
  443. traceItemCode?: string | null;
  444. /** Warehouse code for multi-location visual differentiation. */
  445. warehouseCode?: string | null;
  446. }
  447. export interface ItemLotTraceGraph {
  448. nodes: ItemLotTraceGraphNodeRef[];
  449. edges: ItemLotTraceGraphEdge[];
  450. }
  451. export interface ItemLotTraceWhereUsed {
  452. depth: number;
  453. consumedItemCode: string;
  454. consumedItemName: string;
  455. consumedLotNo: string;
  456. materialQtyUsed: number;
  457. jobOrderCode: string;
  458. jobOrderId: number | null;
  459. producedItemCode: string;
  460. producedItemName: string;
  461. producedLotNo: string;
  462. producedQty: number;
  463. producedUom: string;
  464. producedInventoryLotId: number | null;
  465. producedStockInLineId: number | null;
  466. }
  467. export interface ItemLotTraceIssue {
  468. whereUsed: ItemLotTraceWhereUsed[];
  469. downstreamDeliveries: ItemLotTraceDoDelivery[];
  470. downstreamReplenishments: ItemLotTraceReplenishmentEvent[];
  471. }
  472. export interface ItemLotTraceResponse {
  473. lot: ItemLotTraceLotInfo;
  474. warehouseLines: ItemLotTraceWarehouseLine[];
  475. origins: ItemLotTraceOrigin[];
  476. purchaseEvents?: ItemLotTracePurchaseEvent[];
  477. qcResults: ItemLotTraceQcResult[];
  478. putawayEvents: ItemLotTracePutawayEvent[];
  479. movements: ItemLotTraceMovement[];
  480. outboundUsage: ItemLotTraceOutboundUsage[];
  481. stockTakeEvents: ItemLotTraceStockTakeEvent[];
  482. adjustments: ItemLotTraceAdjustment[];
  483. transfers: ItemLotTraceTransfer[];
  484. bomTrace: ItemLotTraceBomTrace;
  485. joPrelude: ItemLotTraceJoPrelude | null;
  486. productionSteps: ItemLotTraceProductionStep[];
  487. byproductLots: ItemLotTraceByproductLot[];
  488. openMovements: ItemLotTraceOpenMovement[];
  489. failEvents: ItemLotTraceFailEvent[];
  490. doDeliveries: ItemLotTraceDoDelivery[];
  491. replenishmentEvents?: ItemLotTraceReplenishmentEvent[];
  492. returnEvents: ItemLotTraceReturnEvent[];
  493. lotRelations: ItemLotTraceLotRelation[];
  494. alternateLocations: ItemLotTraceAlternateLocation[];
  495. /** Per-location full trace blocks for alternate inventory_lot rows sharing same lotNo+itemId.
  496. * Empty when there is only one location for this lot. */
  497. locationBlocks?: ItemLotTraceLocationBlock[];
  498. traceGraph?: ItemLotTraceGraph | null;
  499. /** Products made with this lot, and deliveries of those products. */
  500. issueTrace?: ItemLotTraceIssue;
  501. }
  502. export interface ItemLotTraceParams {
  503. stockInLineId?: number;
  504. inventoryLotLineId?: number;
  505. lotNo?: string;
  506. itemId?: number;
  507. itemCode?: string;
  508. }