storage-release-review.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. import request from '@/utils/http'
  2. import type { QcWorkOrderReceptionDetail } from '@/api/qc-work-order'
  3. type PageList<T> = {
  4. list: T[]
  5. total: number
  6. page: number
  7. pageSize: number
  8. totalPages: number
  9. }
  10. export type StorageReleaseReview = {
  11. id: string
  12. sampleCode?: string
  13. sampleName?: string
  14. protocolNo?: string
  15. receptionSource?: string
  16. receptionSourceLabel?: string
  17. reviewConclusion?: string
  18. reviewConclusionLabel?: string
  19. reviewRemark?: string
  20. reviewAttachments?: string
  21. reviewBy?: string
  22. reviewByName?: string
  23. reviewTime?: string
  24. storageStatus?: string
  25. storageStatusLabel?: string
  26. sampleTypeName?: string
  27. handlerName?: string
  28. receptionTime?: string
  29. motherName?: string
  30. protocolStatus?: string
  31. protocolStatusLabel?: string
  32. storageBy?: string
  33. storageByName?: string
  34. storageTime?: string
  35. remark?: string
  36. createTime?: string
  37. updateTime?: string
  38. }
  39. export type ProtocolInfo = {
  40. protocolNo?: string
  41. protocolStatus?: string
  42. motherName?: string
  43. motherPhone?: string
  44. fatherName?: string
  45. fatherPhone?: string
  46. newbornName?: string
  47. sampleCode?: string
  48. sampleTypeName?: string
  49. collectAmount?: number | null
  50. storageYears?: number | null
  51. }
  52. export type TransportInfo = {
  53. transportType?: string
  54. waybillNo?: string
  55. expressFee?: number | null
  56. etaTime?: string
  57. carrierName?: string
  58. carrierPhone?: string
  59. }
  60. export type ReceptionInfo = {
  61. receptionTime?: string
  62. handlerName?: string
  63. receiveTemperature?: string
  64. volumeMl?: number | null
  65. netWeightG?: number | null
  66. acceptConclusion?: string
  67. }
  68. export type QcInfoTask = {
  69. id?: string
  70. taskType?: string
  71. taskTypeLabel?: string
  72. taskStatus?: string
  73. taskStatusLabel?: string
  74. conclusion?: string
  75. conclusionLabel?: string
  76. }
  77. export type QcInfo = {
  78. workOrderNo?: string
  79. workOrderStatus?: string
  80. workOrderStatusLabel?: string
  81. tasks?: QcInfoTask[]
  82. }
  83. export type ProductionInfoTask = {
  84. id?: string
  85. taskNo?: string
  86. taskName?: string
  87. taskStatus?: string
  88. taskStatusLabel?: string
  89. conclusion?: string
  90. conclusionLabel?: string
  91. startedTime?: string
  92. completedTime?: string
  93. }
  94. export type ProductionInfo = {
  95. workOrderNo?: string
  96. workOrderStatus?: string
  97. workOrderStatusLabel?: string
  98. tasks?: ProductionInfoTask[]
  99. }
  100. export type StorageReleaseReviewDetail = {
  101. review: StorageReleaseReview
  102. protocolInfo?: ProtocolInfo
  103. transportInfo?: TransportInfo
  104. receptionInfo?: ReceptionInfo
  105. reception?: QcWorkOrderReceptionDetail
  106. qcInfo?: QcInfo
  107. productionInfo?: ProductionInfo
  108. }
  109. export function fetchStorageReleaseReviewList(params?: {
  110. page?: number
  111. pageSize?: number
  112. receptionSource?: string
  113. reviewConclusion?: string
  114. storageStatus?: string
  115. keyword?: string
  116. }) {
  117. return request.get<PageList<StorageReleaseReview>>({
  118. url: '/web/admin/storage-release-reviews',
  119. params
  120. })
  121. }
  122. export function fetchStorageReleaseReviewDetail(id: string) {
  123. return request.get<StorageReleaseReviewDetail>({
  124. url: `/web/admin/storage-release-reviews/${id}`
  125. })
  126. }
  127. export function submitStorageReleaseReview(
  128. id: string,
  129. data: {
  130. reviewConclusion: string
  131. reviewRemark?: string
  132. reviewAttachments?: string
  133. }
  134. ) {
  135. return request.put<StorageReleaseReview>({
  136. url: `/web/admin/storage-release-reviews/${id}/review`,
  137. data
  138. })
  139. }
  140. export function batchReviewStorageRelease(data: {
  141. ids: string[]
  142. reviewConclusion: string
  143. reviewRemark?: string
  144. reviewAttachments?: string
  145. }) {
  146. return request.put<void>({
  147. url: '/web/admin/storage-release-reviews/batch-review',
  148. data
  149. })
  150. }
  151. export function storeSample(id: string) {
  152. return request.put<StorageReleaseReview>({
  153. url: `/web/admin/storage-release-reviews/${id}/store`
  154. })
  155. }
  156. export function batchStoreSample(data: { ids: string[] }) {
  157. return request.put<void>({
  158. url: '/web/admin/storage-release-reviews/batch-store',
  159. data
  160. })
  161. }