@gct-paas/excel 0.1.28-beta.4 → 0.1.28-beta.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (345) hide show
  1. package/dist/{BaseComponent-xTm5lvAr.js → BaseComponent-Dio66Q4V.js} +3 -1
  2. package/dist/{VueVideoPlayer-1-3CIikO.js → VueVideoPlayer-fbbATSVv.js} +2 -2
  3. package/dist/{agg-props-BJHg6Z1O.js → agg-props-CMsKO8rC.js} +1 -1
  4. package/dist/{agg-style-Zv_v2UJO.js → agg-style-BLty-2Va.js} +1 -1
  5. package/dist/{align-editor-CO7dorCE.js → align-editor-C47_89tH.js} +1 -1
  6. package/dist/{attach-fields-editor-DXkqkRw1.js → attach-fields-editor-lWavsh0o.js} +2 -2
  7. package/dist/{barcode-design-CSx6gAAf.js → barcode-design-DoY0f9ek.js} +2 -2
  8. package/dist/base/index.es.js +1126 -803
  9. package/dist/{base-font-editor-C9cqqGi5.js → base-font-editor-BILGqtPM.js} +2 -2
  10. package/dist/{boolean-props-DwIp4Zwq.js → boolean-props-_9-Om5Uf.js} +3 -3
  11. package/dist/{boolean-style-D0H564L3.js → boolean-style-V0rx03tL.js} +4 -4
  12. package/dist/{date-range-editor-DWkiA_QD.js → date-range-editor-BsHod39Z.js} +2 -2
  13. package/dist/{date-time-props-hqyioMkM.js → date-time-props-B-36Vc7E.js} +7 -3
  14. package/dist/{date-time-style-B_aaS3da.js → date-time-style-Bsy3-CYA.js} +1 -1
  15. package/dist/{decimal-display-mode-CaKgCz10.js → decimal-display-mode-DdovfpS-.js} +2 -2
  16. package/dist/{decimal-props-DiLtaPxV.js → decimal-props-BiSX0DGP.js} +4 -4
  17. package/dist/{decimal-style-9re81oM7.js → decimal-style-DP5d1MOq.js} +1 -1
  18. package/dist/{default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-CNJIhHnD.js → default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-DEECXjMT.js} +2 -2
  19. package/dist/{diagonal-design-U5XWysqi.js → diagonal-design-lvT12hKa.js} +2 -2
  20. package/dist/{double-props-Cpaybvo3.js → double-props-DzrnDy3Q.js} +6 -5
  21. package/dist/{double-style-cBxhJhQX.js → double-style-lKogK-ui.js} +1 -1
  22. package/dist/{dynamic-table-action-7ukFUpJU.js → dynamic-table-action-CbzpJwJU.js} +946 -389
  23. package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-A4vSXZDM.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BSXG64m5.js} +2424 -548
  24. package/dist/{edit.utils-CXmmCnxE-Cf_9ualz.js → edit.utils-CXmmCnxE-Di_XolJP.js} +1 -1
  25. package/dist/{enum-props-vXkzHR4Z.js → enum-props-D-2_57nx.js} +3 -3
  26. package/dist/{enum-style-DmGVd8bC.js → enum-style-CTWoNDE8.js} +3 -3
  27. package/dist/excel.css +3044 -2337
  28. package/dist/{exceljs.min-MSYDxng4.js → exceljs.min-BzomwWUc.js} +2 -2
  29. package/dist/{expression-props-B3IfAn_n.js → expression-props-XIRO6Vzc.js} +1 -1
  30. package/dist/{expression-style-qcOgk-rk.js → expression-style-D4Aj_gms.js} +1 -1
  31. package/dist/{file-props-D8ScpaOl.js → file-props-DaZEM-Wp.js} +5 -4
  32. package/dist/{file-style-KTLlX1Xk.js → file-style-DtvNI1CP.js} +1 -1
  33. package/dist/{font-editor-BZKTSTUt.js → font-editor-0R_xLJ0f.js} +3 -3
  34. package/dist/{image-design-Dxqw3EYz.js → image-design-GomPjTsv.js} +4 -2
  35. package/dist/{image-props-DoulASx_.js → image-props-DD1W160b.js} +1 -1
  36. package/dist/{image-style-D1x-8NR-.js → image-style-CQMtdudV.js} +1 -1
  37. package/dist/{index-724k4MNR.js → index--qaw6LuE.js} +8 -8
  38. package/dist/{index-CCvgTGlG.js → index-BAA5uIKR.js} +2 -2
  39. package/dist/{index-8G5s2ZQ6.js → index-BDXAe3vq.js} +2 -2
  40. package/dist/{index-CP9739XL.js → index-BDg6-kiS.js} +1 -1
  41. package/dist/{index-DQ9uX7Vt.js → index-BE21apEd.js} +2 -2
  42. package/dist/{index-DQXeogJQ.js → index-BIfQL6TO.js} +2 -2
  43. package/dist/{index-BWCBcNdV.js → index-BJKS6jkq.js} +2 -2
  44. package/dist/{index-JgFlFQ4I.js → index-BMxssGYv.js} +16965 -43412
  45. package/dist/{index-LZV2l4WV.js → index-BahcMUUG.js} +2 -2
  46. package/dist/{index-CwMFbS5U.js → index-BcHMi5sq.js} +1 -1
  47. package/dist/{index-DoMwWvfm.js → index-BeDCePZN.js} +2 -2
  48. package/dist/{index-05ayf14V.js → index-BpC9lGhH.js} +2 -2
  49. package/dist/{index-DRk6x0JJ.js → index-CVBI7100.js} +2 -2
  50. package/dist/{index-CIBFgcGY.js → index-CZabvPzA.js} +3 -3
  51. package/dist/{index-D2Kc_f3x.js → index-CdepWnj0.js} +128 -538
  52. package/dist/{index-CpZxd4no.js → index-CmNoKy0o.js} +2 -2
  53. package/dist/{index-CkOKxCir.js → index-ComsbvRo.js} +3 -3
  54. package/dist/{index-Dg3kgEbz.js → index-Coq30TEJ.js} +2 -2
  55. package/dist/{index-DsgxTMoz.js → index-CvC1wNC9.js} +4 -7
  56. package/dist/{index-CbTKJ8Vb.js → index-Cvjk1Ghz.js} +2 -2
  57. package/dist/{index-B2y2QeqF.js → index-D6ymgNmB.js} +1 -1
  58. package/dist/{index-DQGijVov.js → index-DBph4_gw.js} +1 -1
  59. package/dist/{index-Be1nADWM.js → index-DCnLRb0P.js} +2 -2
  60. package/dist/{index-S2TfP2Vh.js → index-DXx8CzWw.js} +2 -2
  61. package/dist/{index-BzieZby5.js → index-DZnnCx2q.js} +2 -2
  62. package/dist/{index-BXr7raUl.js → index-DemaNyI5.js} +8 -8
  63. package/dist/{index-IK2pHAVC.js → index-DjjEZIoX.js} +1 -1
  64. package/dist/{index-5MXIxcWc.js → index-Dt99DruI.js} +1 -1
  65. package/dist/{index-D9A5qfUO.js → index-OoIYeAWy.js} +8 -5
  66. package/dist/{index-BF8VHGxb.js → index-QeQoujhM.js} +1 -1
  67. package/dist/{index-CNCp92QR.js → index-gcPYH5cS.js} +1 -1
  68. package/dist/{index-C6Su_s3z.js → index-h_vJhTRb.js} +2 -2
  69. package/dist/{index-D-Z8UXii.js → index-llRmxDxY.js} +2 -2
  70. package/dist/index.es.js +49 -47
  71. package/dist/{integer-props-mbP0KfxR.js → integer-props-zgVWcIXZ.js} +4 -4
  72. package/dist/{integer-style-Dj634CGy.js → integer-style-BlDXqk63.js} +1 -1
  73. package/dist/{mb-render-9ra8O2Uw.js → mb-render-rnVNOOQ8.js} +4 -3
  74. package/dist/{org-props-BgHRD1sc.js → org-props-BPC6u3PB.js} +2 -2
  75. package/dist/{org-style-Ce-wyVlF.js → org-style-RsV4jECv.js} +1 -1
  76. package/dist/{pagination-design-2AaEUsW_.js → pagination-design-Bv4IHdEV.js} +2 -2
  77. package/dist/paper-widget-design-ivIYLMaH.js +4 -0
  78. package/dist/{qrcode-design-DyvGWhZf.js → qrcode-design-Ci2kB6UJ.js} +1 -1
  79. package/dist/{ref-autofill-editor-CTI8hdiv.js → ref-autofill-editor-1NkGOLVm.js} +141 -159
  80. package/dist/{ref-props-Cp7j_jms.js → ref-props-BQj3DXMB.js} +15 -17
  81. package/dist/{ref-style-B8IL_Liq.js → ref-style-DvDku07C.js} +1 -1
  82. package/dist/{regex-editor-DvkeklNp.js → regex-editor-Dg9kwmC-.js} +2 -2
  83. package/dist/{revo-grid.entry-BEHoqd3N.js → revo-grid.entry-4F__oaAX.js} +1 -1
  84. package/dist/{revogr-attribution_7.entry-CCbwjKQa.js → revogr-attribution_7.entry-B7aSIa3g.js} +3 -3
  85. package/dist/{revogr-clipboard_3.entry-g_n_i8Qx.js → revogr-clipboard_3.entry-YFE9GnOt.js} +2 -2
  86. package/dist/{revogr-data_4.entry-BiefA7eT.js → revogr-data_4.entry-BZlnJvbc.js} +2 -2
  87. package/dist/{revogr-filter-panel.entry-BoTWkxWM.js → revogr-filter-panel.entry-DLhPsqVI.js} +1 -1
  88. package/dist/{select-render-type-editor.vue_vue_type_script_setup_true_lang-CbfUBnrw.js → select-render-type-editor.vue_vue_type_script_setup_true_lang-DRO9BoHE.js} +2 -2
  89. package/dist/{serialnumber-design-C952ChSv.js → serialnumber-design-DCa6zAyd.js} +1 -1
  90. package/dist/shared/index.es.js +24 -29
  91. package/dist/{signature-props-DuhWgn75.js → signature-props-sf1hL4mn.js} +3 -3
  92. package/dist/{signature-style-DjWhk9Ap.js → signature-style-yKnTH3hm.js} +1 -1
  93. package/dist/{single-field-drop-BL9v1Qs8.js → single-field-drop-CX6oLtYN.js} +2 -2
  94. package/dist/{size-editor-7VfFq73X.js → size-editor-BzPQyU-s.js} +1 -1
  95. package/dist/src/adapter/adapter.d.ts +12 -0
  96. package/dist/src/adapter/setup.d.ts +19 -3
  97. package/dist/src/domain/field/auto-complete/material-container-manifest.d.ts +2 -0
  98. package/dist/src/domain/field/auto-complete/material-no-manifest.d.ts +2 -0
  99. package/dist/src/domain/field/auto-complete/related-lot-no-manifest.d.ts +2 -0
  100. package/dist/src/domain/field/auto-complete/scrap-material-no-manifest.d.ts +2 -0
  101. package/dist/src/domain/field/auto-complete/sterilization-container-manifest.d.ts +2 -0
  102. package/dist/src/domain/field/date/date-manifest.d.ts +2 -0
  103. package/dist/src/domain/field/date/date-time-manifest.d.ts +2 -0
  104. package/dist/src/domain/field/date/production-date-manifest.d.ts +2 -0
  105. package/dist/src/domain/field/date/re-inspection-date-manifest.d.ts +2 -0
  106. package/dist/src/domain/field/date/report-end-time-manifest.d.ts +2 -0
  107. package/dist/src/domain/field/date/report-start-time-manifest.d.ts +2 -0
  108. package/dist/src/domain/field/date/time-manifest.d.ts +2 -0
  109. package/dist/src/domain/field/date/trace-date-manifest.d.ts +2 -0
  110. package/dist/src/domain/field/date/validity-manifest.d.ts +2 -0
  111. package/dist/src/domain/field/date/warehouse-receipt-date-manifest.d.ts +2 -0
  112. package/dist/src/domain/field/index.d.ts +8 -0
  113. package/dist/src/domain/field/number/decimal-manifest.d.ts +2 -0
  114. package/dist/src/domain/field/number/destructive-test-qty-manifest.d.ts +2 -0
  115. package/dist/src/domain/field/number/double-manifest.d.ts +2 -0
  116. package/dist/src/domain/field/number/good-qty-manifest.d.ts +2 -0
  117. package/dist/src/domain/field/number/inspection-qty-manifest.d.ts +2 -0
  118. package/dist/src/domain/field/number/integer-manifest.d.ts +2 -0
  119. package/dist/src/domain/field/number/long-manifest.d.ts +2 -0
  120. package/dist/src/domain/field/number/material-check-qty-manifest.d.ts +2 -0
  121. package/dist/src/domain/field/number/not-good-qty-manifest.d.ts +2 -0
  122. package/dist/src/domain/field/number/of-inst-num-manifest.d.ts +2 -0
  123. package/dist/src/domain/field/number/operation-output-qty-manifest.d.ts +2 -0
  124. package/dist/src/domain/field/number/operation-receive-qty-manifest.d.ts +2 -0
  125. package/dist/src/domain/field/number/product-check-qty-manifest.d.ts +2 -0
  126. package/dist/src/domain/field/number/production-qty-manifest.d.ts +2 -0
  127. package/dist/src/domain/field/number/qty-consumed-manifest.d.ts +2 -0
  128. package/dist/src/domain/field/number/qty-manifest.d.ts +2 -0
  129. package/dist/src/domain/field/number/qty-required-manifest.d.ts +2 -0
  130. package/dist/src/domain/field/number/scrap-qty-manifest.d.ts +2 -0
  131. package/dist/src/domain/field/number/work-hours-manifest.d.ts +2 -0
  132. package/dist/src/domain/field/option/boolean-manifest.d.ts +2 -0
  133. package/dist/src/domain/field/option/enum-manifest.d.ts +2 -0
  134. package/dist/src/domain/field/option/enum-multi-manifest.d.ts +2 -0
  135. package/dist/src/domain/field/option/option-manifest.d.ts +2 -0
  136. package/dist/src/domain/field/option/option-multi-manifest.d.ts +2 -0
  137. package/dist/src/domain/field/rdo-select/product-manifest.d.ts +2 -0
  138. package/dist/src/domain/field/rdo-select/scrap-material-manifest.d.ts +2 -0
  139. package/dist/src/domain/field/select/device-manifest.d.ts +2 -0
  140. package/dist/src/domain/field/select/device-ref-manifest.d.ts +2 -0
  141. package/dist/src/domain/field/select/device-ref-multi-manifest.d.ts +2 -0
  142. package/dist/src/domain/field/select/e-sop-manifest.d.ts +2 -0
  143. package/dist/src/domain/field/select/location-manifest.d.ts +2 -0
  144. package/dist/src/domain/field/select/mfg-order-manifest.d.ts +2 -0
  145. package/dist/src/domain/field/select/model-relation-manifest.d.ts +2 -0
  146. package/dist/src/domain/field/select/not-good-group-manifest.d.ts +2 -0
  147. package/dist/src/domain/field/select/not-good-reason-manifest.d.ts +2 -0
  148. package/dist/src/domain/field/select/org-manifest.d.ts +2 -0
  149. package/dist/src/domain/field/select/org-multi-manifest.d.ts +2 -0
  150. package/dist/src/domain/field/select/production-container-manifest.d.ts +2 -0
  151. package/dist/src/domain/field/select/ref-manifest.d.ts +2 -0
  152. package/dist/src/domain/field/select/ref-multi-manifest.d.ts +2 -0
  153. package/dist/src/domain/field/select/routing-operation-manifest.d.ts +2 -0
  154. package/dist/src/domain/field/select/scrap-group-manifest.d.ts +2 -0
  155. package/dist/src/domain/field/select/scrap-reason-manifest.d.ts +2 -0
  156. package/dist/src/domain/field/select/shopfloor-manifest.d.ts +2 -0
  157. package/dist/src/domain/field/select/target-warehouse-manifest.d.ts +2 -0
  158. package/dist/src/domain/field/select/user-manifest.d.ts +2 -0
  159. package/dist/src/domain/field/select/user-multi-manifest.d.ts +2 -0
  160. package/dist/src/domain/field/select/warehouse-manifest.d.ts +2 -0
  161. package/dist/src/domain/field/text/e-sop-version-manifest.d.ts +2 -0
  162. package/dist/src/domain/field/text/external-reference-no-manifest.d.ts +2 -0
  163. package/dist/src/domain/field/text/long-text-manifest.d.ts +2 -0
  164. package/dist/src/domain/field/text/order-no-manifest.d.ts +2 -0
  165. package/dist/src/domain/field/text/record-no-manifest.d.ts +2 -0
  166. package/dist/src/domain/field/text/text-manifest.d.ts +2 -0
  167. package/dist/src/domain/field/text/warehouse-receipt-no-manifest.d.ts +2 -0
  168. package/dist/src/domain/field/types.d.ts +15 -0
  169. package/dist/src/domain/field/upload/attachment-manifest.d.ts +2 -0
  170. package/dist/src/domain/field/upload/image-manifest.d.ts +2 -0
  171. package/dist/src/domain/field/upload/reporter-manifest.d.ts +2 -0
  172. package/dist/src/domain/field/upload/signature-manifest.d.ts +2 -0
  173. package/dist/src/domain/field/upload/warehouse-manager-manifest.d.ts +2 -0
  174. package/dist/src/domain/index.d.ts +1 -0
  175. package/dist/src/domain/object/date-object/index.d.ts +5 -0
  176. package/dist/src/domain/object/date-object/profile/field-keys.d.ts +19 -0
  177. package/dist/src/domain/object/date-object/profile/fields.d.ts +2 -0
  178. package/dist/src/domain/object/date-object/profile/index.d.ts +3 -0
  179. package/dist/src/domain/object/date-object/runtime/date-object-context.d.ts +30 -0
  180. package/dist/src/domain/object/date-object/runtime/date-object-runtime.d.ts +43 -0
  181. package/dist/src/domain/object/date-object/runtime/fetch-records.d.ts +13 -0
  182. package/dist/src/domain/object/date-object/runtime/object-handlers.d.ts +4 -0
  183. package/dist/src/domain/object/date-object/runtime/re-inspection-date.d.ts +25 -0
  184. package/dist/src/domain/object/date-object/runtime/register-handlers.d.ts +1 -0
  185. package/dist/src/domain/object/date-object/runtime/row-change-handlers.d.ts +6 -0
  186. package/dist/src/domain/object/date-object/runtime/utils.d.ts +13 -0
  187. package/dist/src/domain/object/date-object/types.d.ts +53 -0
  188. package/dist/src/domain/object/index.d.ts +1 -0
  189. package/dist/src/domain/table/business/warehouse/device-part-consume/profile/field-keys.d.ts +14 -0
  190. package/dist/src/domain/table/business/warehouse/part-stocktake/profile/field-keys.d.ts +14 -0
  191. package/dist/src/domain/table/business/warehouse/shared/eqm-part-api.d.ts +13 -0
  192. package/dist/src/domain/table/business/warehouse/warehouse-in/profile/field-keys.d.ts +40 -3
  193. package/dist/src/domain/table/business/warehouse/warehouse-in/runtime/row-change-handlers.d.ts +9 -1
  194. package/dist/src/domain/table/business/warehouse/warehouse-inbound/profile/field-keys.d.ts +17 -0
  195. package/dist/src/domain/table/business/warehouse/warehouse-inventory/index.d.ts +3 -0
  196. package/dist/src/domain/table/business/warehouse/warehouse-inventory/profile/api.d.ts +14 -0
  197. package/dist/src/domain/table/business/warehouse/warehouse-inventory/profile/field-keys.d.ts +0 -2
  198. package/dist/src/domain/table/business/warehouse/warehouse-inventory/runtime/stocktake-dimension.d.ts +13 -0
  199. package/dist/src/domain/table/business/warehouse/warehouse-inventory/types.d.ts +20 -0
  200. package/dist/src/domain/table/business/warehouse/warehouse-outbound/profile/field-keys.d.ts +14 -0
  201. package/dist/src/domain/table/design/panel-features.d.ts +1 -0
  202. package/dist/src/index.d.ts +4 -2
  203. package/dist/src/nocode-base/src/components/document-sub-table-action/type.d.ts +2 -0
  204. package/dist/src/nocode-base/src/core/sub-table/allocate-table-core.d.ts +3 -4
  205. package/dist/src/nocode-base/src/core/sub-table/index.d.ts +2 -0
  206. package/dist/src/nocode-base/src/core/sub-table/pretreatment-list-table-core.d.ts +3 -12
  207. package/dist/src/nocode-base/src/core/sub-table/profile-driven-sub-table-core.d.ts +32 -14
  208. package/dist/src/nocode-base/src/core/sub-table/sterilize-batch-table-core.d.ts +3 -14
  209. package/dist/src/nocode-base/src/core/sub-table/stocktake-table-core.d.ts +6 -5
  210. package/dist/src/nocode-base/src/core/sub-table/sub-table-core.d.ts +15 -0
  211. package/dist/src/nocode-base/src/core/sub-table/utils/scan/index.d.ts +3 -0
  212. package/dist/src/nocode-base/src/core/sub-table/utils/scan/inventory-scan-api.d.ts +9 -0
  213. package/dist/src/nocode-base/src/core/sub-table/utils/scan/production-identification-scan-api.d.ts +9 -0
  214. package/dist/src/nocode-base/src/core/sub-table/utils/scan/scan-helpers.d.ts +40 -0
  215. package/dist/src/nocode-base/src/core/sub-table/utils/stocktake/stocktake-calc.d.ts +6 -59
  216. package/dist/src/nocode-base/src/core/sub-table/warehouse-in-table-core.d.ts +26 -0
  217. package/dist/src/nocode-base/src/core/sub-table/warehouse-out-table-core.d.ts +22 -0
  218. package/dist/src/nocode-base/src/hooks/date-object/use-date-object.d.ts +2 -0
  219. package/dist/src/nocode-base/src/hooks/index.d.ts +2 -1
  220. package/dist/src/nocode-base/src/hooks/label-parse-rule/type.d.ts +6 -0
  221. package/dist/src/nocode-base/src/hooks/material-consume/bom-validator.d.ts +18 -76
  222. package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +34 -20
  223. package/dist/src/nocode-base/src/hooks/material-consume/service.d.ts +12 -0
  224. package/dist/src/nocode-base/src/hooks/material-consume/tmpl-bom-controller.d.ts +4 -4
  225. package/dist/src/nocode-base/src/hooks/material-consume/types.d.ts +1 -0
  226. package/dist/src/nocode-base/src/hooks/material-consume-object/bom-validator.d.ts +71 -0
  227. package/dist/src/nocode-base/src/hooks/material-consume-object/index.d.ts +3 -0
  228. package/dist/src/nocode-base/src/hooks/material-consume-object/product-lot-link.d.ts +32 -0
  229. package/dist/src/nocode-base/src/hooks/material-consume-object/use-tmpl-bom.d.ts +13 -0
  230. package/dist/src/nocode-base/src/hooks/operation-receive-qty.d.ts +2 -0
  231. package/dist/src/nocode-base/src/hooks/useRenderData.d.ts +1 -1
  232. package/dist/src/nocode-base/src/hooks/useRenderPageFactory.d.ts +12 -0
  233. package/dist/src/nocode-base/src/hooks/validation/useFormValidator.d.ts +2 -0
  234. package/dist/src/nocode-base/src/interface/device-query.d.ts +40 -0
  235. package/dist/src/nocode-base/src/interface/index.d.ts +1 -0
  236. package/dist/src/nocode-base/src/interface/render.d.ts +11 -0
  237. package/dist/src/nocode-base/src/interface/transform.d.ts +1 -1
  238. package/dist/src/nocode-base/src/types/business/index.d.ts +11 -1
  239. package/dist/src/nocode-base/src/types/business/pretreatment-list.d.ts +3 -1
  240. package/dist/src/nocode-base/src/types/business/sterilize-batch.d.ts +3 -1
  241. package/dist/src/nocode-base/src/types/business/stocktake.d.ts +5 -1
  242. package/dist/src/nocode-base/src/types/common/base.d.ts +8 -0
  243. package/dist/src/nocode-base/src/types/render/sub-table-render.d.ts +7 -0
  244. package/dist/src/nocode-base/src/types/widgets/i-paper.d.ts +4 -8
  245. package/dist/src/nocode-web-render/src/render/parse-rule/add-rule-btn.vue.d.ts +2 -0
  246. package/dist/src/nocode-web-render/src/render/parse-rule/parse-rule-modal.vue.d.ts +1 -0
  247. package/dist/src/nocode-web-render/src/render/sub-table/common/scan-modal.vue.d.ts +0 -1
  248. package/dist/src/nocode-web-render/src/render/sub-table/common/sub-table-render.d.ts +2 -1
  249. package/dist/src/nocode-web-render/src/render/sub-table/stocktake/index.d.ts +0 -1
  250. package/dist/src/nocode-web-render/src/render/sub-table/stocktake/stocktake-web-render.d.ts +12 -2
  251. package/dist/src/online-form/src/views/__cell_widgets__/common/display-fields-editor/display-fields-editor.vue.d.ts +3 -3
  252. package/dist/src/online-form/src/views/__cell_widgets__/common/display-fields-editor/display-fields.util.d.ts +15 -0
  253. package/dist/src/online-form/src/views/__cell_widgets__/common/field-config-visibility.d.ts +2 -0
  254. package/dist/src/online-form/src/views/__cell_widgets__/common/quick-search-editor/quick-search-editor.vue.d.ts +1 -4
  255. package/dist/src/online-form/src/views/__cell_widgets__/common/quick-search-editor/quick-search.util.d.ts +10 -10
  256. package/dist/src/online-form/src/views/__cell_widgets__/fake-field/fake-input.vue.d.ts +13 -0
  257. package/dist/src/{nocode-web-render/src/render/sub-table/stocktake/scan-modal.vue.d.ts → online-form/src/views/__cell_widgets__/fake-field/fake-number-input.vue.d.ts} +5 -1
  258. package/dist/src/online-form/src/views/__cell_widgets__/fake-field/fake-option-select.vue.d.ts +11 -0
  259. package/dist/src/online-form/src/views/__cell_widgets__/fake-field/fake-select.vue.d.ts +11 -0
  260. package/dist/src/online-form/src/views/__cell_widgets__/fake-field/index.d.ts +4 -0
  261. package/dist/src/online-form/src/views/__cell_widgets__/field-design-components.d.ts +4 -0
  262. package/dist/src/online-form/src/views/__cell_widgets__/index.d.ts +0 -1
  263. package/dist/src/online-form/src/views/designer/constants/index.d.ts +4 -4
  264. package/dist/src/online-form/src/views/designer/hooks/useAllSpreadSheets.d.ts +417 -0
  265. package/dist/src/online-form/src/views/designer/hooks/useModelFields.d.ts +7 -0
  266. package/dist/src/online-form/src/views/designer/hooks/useSpreadSheet.d.ts +541 -3
  267. package/dist/src/online-form/src/views/designer/modules/base/drag-box.vue.d.ts +1 -1
  268. package/dist/src/online-form/src/views/designer/modules/panel/comps/signature-config/index.d.ts +1 -1
  269. package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/object-init/hooks/useObjectInit.d.ts +63 -1
  270. package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/object-init/index.d.ts +0 -1
  271. package/dist/src/online-form/src/views/designer/modules/panel/panel-tmpl-config/ai-tmpl/ai-tmpl-editor-modal.vue.d.ts +30 -0
  272. package/dist/src/online-form/src/views/designer/modules/panel/panel-tmpl-config/ai-tmpl/ai-tmpl-editor.vue.d.ts +6 -17
  273. package/dist/src/online-form/src/views/designer/modules/panel/panel-tmpl-config/ai-tmpl/types.d.ts +20 -0
  274. package/dist/src/online-form/src/views/designer/modules/panel/sub-table/comps/use-dynamic-sub-table-panel.d.ts +248 -0
  275. package/dist/src/online-form/src/views/designer/modules/panel/sub-table/material-consumption/bom-entry-editor.vue.d.ts +2 -1
  276. package/dist/src/online-form/src/views/designer/modules/panel/sub-table/material-consumption/edit-parse-rule.vue.d.ts +1 -0
  277. package/dist/src/online-form/src/views/designer/modules/toolkit/model-field/add-field-btn.vue.d.ts +1 -3
  278. package/dist/src/online-form/src/views/designer/types/index.d.ts +3 -0
  279. package/dist/src/online-form/src/views/designer/utils/cell-content-style.d.ts +30 -0
  280. package/dist/src/online-form/src/views/designer/utils/field-type-label.d.ts +1 -0
  281. package/dist/src/online-form/src/views/render/__components__/_field_/trace/composables/assoc-filter.d.ts +3 -8
  282. package/dist/src/online-form/src/views/render/__components__/_field_/trace/utils/columns.d.ts +15 -1
  283. package/dist/src/shared/components/FieldStateIcon/field-state-icon.vue.d.ts +17 -0
  284. package/dist/src/shared/components/FieldStateIcon/index.d.ts +3 -0
  285. package/dist/src/shared/components/Preview/src/Functional.vue.d.ts +1 -1
  286. package/dist/src/shared/components/Signature/card-signer.vue.d.ts +14 -0
  287. package/dist/src/shared/components/Signature/logic/index.d.ts +1 -0
  288. package/dist/src/shared/components/Signature/security-config.d.ts +6 -0
  289. package/dist/src/shared/components/Signature/ui/password-signer.vue.d.ts +1 -0
  290. package/dist/src/shared/components/Signature/ui/sign-switcher-modal.vue.d.ts +8 -5
  291. package/dist/src/shared/components/Signature/ui/sign-switcher.vue.d.ts +1 -0
  292. package/dist/src/shared/components/registerGlobComp.d.ts +5 -0
  293. package/dist/src/shared/enum/field-type.d.ts +31 -285
  294. package/dist/src/shared/enum/index.d.ts +1 -1
  295. package/dist/src/shared/utils/field-size.d.ts +3 -0
  296. package/dist/src/shared/utils/lot2sn.d.ts +44 -0
  297. package/dist/{text-design-B3gNBFg1.js → text-design-Ce1iAn-r.js} +2 -2
  298. package/dist/{text-props-C0cys7hK.js → text-props-Cw9dmSVT.js} +4 -4
  299. package/dist/{text-style-Ebi16KlJ.js → text-style-C5q6-trU.js} +1 -1
  300. package/dist/{throttle-Cpk1LoGk-BUMzCKSe.js → throttle-Cpk1LoGk-44j4ybYK.js} +1 -1
  301. package/dist/{timediff-design-SR372i6S.js → timediff-design-NKD0h1nu.js} +1 -1
  302. package/dist/{trace-props--7WlopZy.js → trace-props-DPR0VfDQ.js} +70 -39
  303. package/dist/{trace-style-DtOncSoX.js → trace-style-C5VGNaRB.js} +1 -1
  304. package/dist/{user-props-BN5AUBD6.js → user-props-DIReQ_rO.js} +2 -2
  305. package/dist/{user-style-DMtM30Mt.js → user-style-DTJNo88h.js} +1 -1
  306. package/dist/{value-editor.vue_vue_type_style_index_0_lang-ByQlVnL6.js → value-editor.vue_vue_type_style_index_0_lang-CbBOxOm8.js} +2 -2
  307. package/dist/{version-select-Bt8nfEu4.js → version-select-6uapTDFS.js} +15 -18
  308. package/dist/web-render/index.es.js +397 -24
  309. package/dist/{widget-barcode-cQ7U31QM.js → widget-barcode-CJ59VtwF.js} +4 -4
  310. package/dist/{widget-diagonal-Dx0b5_zP.js → widget-diagonal-qmMxl3Fk.js} +3 -3
  311. package/dist/{widget-image-YKYe4xWv.js → widget-image-DrszP-IE.js} +7 -5
  312. package/dist/{widget-line-BRJ-WX96.js → widget-line-C3zF-KZd.js} +4 -4
  313. package/dist/{widget-pagination-B1RkybXu.js → widget-pagination-Ce4-e6vR.js} +5 -5
  314. package/dist/{widget-power-CX8Ti_0j.js → widget-power-BnFPz86a.js} +3 -3
  315. package/dist/{widget-qrcode-BLQcWqEI.js → widget-qrcode-BEtxp9WY.js} +3 -3
  316. package/dist/{widget-rangelimit-_S-cju39.js → widget-rangelimit-BYkZI_TW.js} +3 -3
  317. package/dist/{widget-serialnumber-DkdIucNK.js → widget-serialnumber-Cgil1aU2.js} +1 -1
  318. package/dist/{widget-text-BhMc6TtO.js → widget-text-DEr8KWI5.js} +5 -5
  319. package/dist/{widget-timediff-fowoxFrK.js → widget-timediff-BoxDXQE8.js} +2 -2
  320. package/package.json +17 -5
  321. package/dist/agg-design-Bzf3ZZhF.js +0 -24
  322. package/dist/boolean-design-Dw4DatRy.js +0 -124
  323. package/dist/cell-upload-9JWJhPHO.js +0 -35
  324. package/dist/date-time-design-BpS-Do_p.js +0 -64
  325. package/dist/decimal-design-BkSj6vZv.js +0 -29
  326. package/dist/double-design-Soz2qnO_.js +0 -28
  327. package/dist/enum-design-B67vcgY-.js +0 -97
  328. package/dist/expression-design-BRlReq5s.js +0 -24
  329. package/dist/file-design-Z5ecxQwk.js +0 -17
  330. package/dist/image-design-DXkjLbSR.js +0 -23
  331. package/dist/integer-design-D95d-Pt_.js +0 -28
  332. package/dist/number-input-ex-B1VK06Km.js +0 -69
  333. package/dist/org-design-DWZI8xev.js +0 -24
  334. package/dist/paper-widget-design-BrLma-qH.js +0 -4
  335. package/dist/ref-design-BQ8o1gKm.js +0 -24
  336. package/dist/signature-design-DHw3-abX.js +0 -20
  337. package/dist/src/nocode-base/src/hooks/material-date/material-date.d.ts +0 -44
  338. package/dist/src/nocode-base/src/hooks/material-date/service.d.ts +0 -4
  339. package/dist/src/nocode-base/src/hooks/material-date/use-material-date.d.ts +0 -2
  340. package/dist/src/nocode-base/src/hooks/material-stocktake/index.d.ts +0 -1
  341. package/dist/src/nocode-base/src/hooks/material-stocktake/useMaterialStocktake.d.ts +0 -8
  342. package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/object-init/object-init-modal.vue.d.ts +0 -26
  343. package/dist/text-design-BTTZpXWL.js +0 -39
  344. package/dist/trace-design-BTM_TXK7.js +0 -77
  345. package/dist/user-design-fMF_h4IG.js +0 -24
@@ -1,11 +1,11 @@
1
- import { aW as fetchHistoryConsume, aX as isBomGranted, F as FIELD_TYPE, w as api, c as getProfileByTableType, b as isBusinessSubTableProfile, aY as runRowHandler, aZ as F$1, a_ as FILL_FROM_INVENTORY_OPTION, a$ as F$2, b0 as INVENTORY_BASE_FIELDS, b1 as WAREHOUSE_IDENTITY_GROUP_KEYS, b2 as SCAN_MERGE_GROUP_KEYS, b3 as AUTO_LOAD_READONLY_SELECT_FIELDS, aH as getParseRuleInfo, b4 as FILL_FROM_INVENTORY_OPTION$1, aI as getParseRuleValue, b5 as F$3, b6 as FILL_FROM_INVENTORY_OPTION$2, b7 as calcFillData, b8 as extractKeywordFromQueryData, b9 as F$4, ba as isProductManuallyEditable, bb as applyFillFromMfgOrderOption, bc as applyFillFromOption$1, bd as applyFillFromProductOption, be as CLEAR_ON_MATERIAL_CONTAINER_SELECT, M as FormTypeEnum, bf as transformUtils, d as SubTableType, aE as NCB_PROVIDE, bg as settleAndValidateDisplay, bh as unregisterValidationContext, bi as clearFormRules, bj as registerValidationContext, m as ComponentTypeEnum, aM as RenderModeEnum, bk as requestFullValidation, bl as requestDisplayValidation, bm as closeValidatorPopovers, bn as baseDataUtils, bo as getRawFormRuleMeta, bp as enrichFormChangeRowDetails, bq as settleAfterModeSwitch, br as calcUtils, an as CheckDsTypeEnum, aB as renderUtils, Q as PlatformEnum, bs as uuid2, bt as normalizeToArray, bu as safeParseArray, bv as BpmnNodeTypeEnum, bw as mergeByMultiKey, aV as useNocodeEmitter, bx as commonUtils, am as EntityModelCategoryEnum, by as getRowId, bz as collectFormChangeFieldLocations, bA as nextFormChangeRowViewHistoryId } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-A4vSXZDM.js";
2
- import { aq, as, aC, T, bB, bC, B, bD, t, a1, bE, bF, bG, aA, aD, ar, ao, ap, a2, a6, bH, aO, af, bI, al, au, R, a4, L, bJ, bK, O, j, P, Z, h, G, at, bL, bM, aL, X, V, W, Y, bN, a5, a9, a3, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, b_, aK, b$, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, cd, aF, ce, cf, cg, aG, ch, ci, cj, ck, a7, cl, cm, ay, cn, ax, av, co, H, aJ, aN, az, cp, u, aw } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-A4vSXZDM.js";
3
- import { M as MaterialConsumptionPatternEnum, e as MaterialConsumeTableController, f as SubTableCore, g as SubTableActionMenuTypeEnum, h as getMenuByAction, i as SubTableActionEnum, j as getCopySubMenu, k as getInsertSubMenu, l as useMaterialBalance, v as validate } from "../dynamic-table-action-7ukFUpJU.js";
4
- import { B as B2, m, D, _, n, c, o, d, F, p, I, q, O as O2, u as u2, a, b } from "../dynamic-table-action-7ukFUpJU.js";
5
- import { ref, provide, watch, computed, onBeforeMount } from "vue";
1
+ import { bh as fetchHistoryConsume, bi as isBomGranted, F as FIELD_TYPE, A as api, bj as F$1, bk as F$2, bl as runRowHandler, h as getProfileByTableType, f as isBusinessSubTableProfile, bm as F$3, bn as F$4, bo as FILL_FROM_INVENTORY_OPTION, bp as FILL_FROM_PART_OPTION, bq as FILL_FROM_INVENTORY_OPTION$1, br as TABLE_TYPE, bs as FILL_FROM_INVENTORY_OPTION$2, bt as F$5, bu as INVENTORY_BASE_FIELDS, bv as WAREHOUSE_IDENTITY_GROUP_KEYS, bw as resolveGroupByWarehouse, bx as AUTO_LOAD_READONLY_SELECT_FIELDS, b4 as STOCKTAKE_DIMENSION, aX as getParseRuleInfo, by as FILL_FROM_INVENTORY_OPTION$3, bz as calcFillData, bA as resolveStocktakeInventoryApi, aY as getParseRuleValue, bB as F$6, bC as FILL_FROM_INVENTORY_OPTION$4, bD as extractKeywordFromQueryData, bE as composeProductionLotListQuery, ax as resolveLotDisplayLabel, bF as F$7, bG as isProductManuallyEditable, bH as applyFillFromMfgOrderOption, bI as applyFillFromOption$1, bJ as applyFillFromProductOption, aU as LOT_CONTAINER_ROLE, bK as MATERIAL_CONTAINER_ID, bL as F$8, bM as PRODUCT_QUICK_SEARCH_FIELDS, bN as PRODUCT_QUICK_SEARCH_EXP, bO as isProductManuallyEditable$1, bP as applyFillFromMaterialNoOption, bQ as applyFillFromProductOption$1, bR as F$9, bS as FILL_FROM_INVENTORY_OPTION$5, V as FormTypeEnum, aW as transformUtils, l as SubTableType, aP as NCB_PROVIDE, bT as settleAndValidateDisplay, bU as unregisterValidationContext, bV as clearFormRules, bW as registerValidationContext, q as ComponentTypeEnum, b7 as RenderModeEnum, bX as requestFullValidation, bY as requestDisplayValidation, aM as renderUtils, bZ as closeValidatorPopovers, b_ as baseDataUtils, b$ as getRawFormRuleMeta, c0 as enrichFormChangeRowDetails, c1 as settleAfterModeSwitch, c2 as calcUtils, ay as CheckDsTypeEnum, Z as PlatformEnum, c3 as uuid2, c4 as normalizeToArray, c5 as safeParseArray, c6 as BpmnNodeTypeEnum, c7 as mergeByMultiKey, bg as useNocodeEmitter, c8 as commonUtils, aw as EntityModelCategoryEnum, c9 as getRowId, ca as collectFormChangeFieldLocations, cb as nextFormChangeRowViewHistoryId } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BSXG64m5.js";
2
+ import { aB, aD, aN, $, cc, cd, B, ce, y, ab, cf, cg, ch, b3, ci, aL, aO, aC, az, aA, cj, ac, ag, ck, cl, ap, aa, av, aF, _, ae, L, cm, cn, O, o, P, a5, n, M, aE, co, cp, b6, a2, a0, a1, a3, cq, af, aj, ad, cr, cs, ct, b2, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, b0, cF, cG, cH, cI, cJ, cK, cL, cM, cN, cO, cP, cQ, cR, cS, a$, cT, aQ, cU, cV, cW, aT, cX, cY, cZ, c_, ah, c$, d0, aJ, d1, aI, aG, d2, N, aZ, b8, aK, d3, u, aH, b1 } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BSXG64m5.js";
3
+ import { M as MaterialConsumptionPatternEnum, m as MaterialConsumeTableController, i as isEdhrSuite, o as SubTableCore, p as SubTableActionMenuTypeEnum, q as getMenuByAction, s as SubTableActionEnum, t as getInsertSubMenu, w as resolveScanAdjustType, x as resolveScanQty, y as toDateOnly, z as getCopySubMenu, A as resolveScanParsedValue, C as resolveScanFillData, F as isProductBatchEmptyRow, G as useMaterialBalance, H as validate, J as validateObjectBomQtyOnSubmit } from "../dynamic-table-action-CbzpJwJU.js";
4
+ import { B as B2, K, D, _ as _2, L as L2, k, N as N2, l, E, O as O2, P as P2, I, Q, T, e, c, f, U, b, g, V, W, X, Y, r, d, u as u2, h, a, j, v } from "../dynamic-table-action-CbzpJwJU.js";
5
+ import { ref, provide, watch, computed, onUnmounted, onBeforeMount } from "vue";
6
6
  import { defaults, has, merge, isEmpty, cloneDeep, debounce } from "lodash-es";
7
- import dayjs from "dayjs";
8
- import { B as B3, F as F2, M, a as a8, u as u3 } from "../mb-render-9ra8O2Uw.js";
7
+ import "dayjs";
8
+ import { B as B3, F, M as M2, a as a4, u as u3 } from "../mb-render-rnVNOOQ8.js";
9
9
  var MaterialStatusEnum = /* @__PURE__ */ ((MaterialStatusEnum2) => {
10
10
  MaterialStatusEnum2["LOT"] = "LOT";
11
11
  MaterialStatusEnum2["SN"] = "SN";
@@ -56,6 +56,8 @@ class FormTmplBomController {
56
56
  operationId;
57
57
  /** 批次/sn */
58
58
  materialNo;
59
+ /** 接收数量 */
60
+ productQty;
59
61
  /** 历史填报数据 */
60
62
  historyData = [];
61
63
  /** 表单控制器(key是tableKey) */
@@ -96,7 +98,7 @@ class FormTmplBomController {
96
98
  * @readonly
97
99
  */
98
100
  get materialNoNum() {
99
- return this.formInstBom?.qty ?? 1;
101
+ return this.productQty ?? this.formInstBom?.qty ?? 1;
100
102
  }
101
103
  /**
102
104
  * bom模块配置关联过来的bom明细集合
@@ -126,6 +128,7 @@ class FormTmplBomController {
126
128
  this.operationId = data.operationId;
127
129
  this.materialNo = data.materialNo;
128
130
  this.formInstBom = data.formInstBom;
131
+ this.productQty = data.productQty ?? 0;
129
132
  this.historyData = await fetchHistoryConsume({
130
133
  production_identification_id_: this.formInstBom.productionIdentificationId,
131
134
  routing_operation_id_: this.operationId
@@ -188,41 +191,21 @@ class FormTmplBomController {
188
191
  });
189
192
  }
190
193
  async submitValidate() {
191
- const results = await Promise.allSettled(
192
- Object.values(this.tableControllers).map((c10) => c10.submitValidate())
194
+ const results = await Promise.all(
195
+ Object.values(this.tableControllers).map((c2) => c2.submitValidate())
193
196
  );
194
- const successful = results.filter((result) => result.status === "fulfilled").map((result) => result.value);
195
- const fieldArr = successful.filter(Boolean);
196
- if (fieldArr.length) {
197
- const fields = fieldArr.reduce((acc, cur) => {
198
- acc[cur.field] = [cur];
199
- return acc;
200
- }, {});
201
- return {
202
- isValid: false,
203
- fields
204
- };
205
- }
197
+ const fields = {};
198
+ let isValid = true;
199
+ results.forEach((res) => {
200
+ if (!res?.isValid) isValid = false;
201
+ Object.assign(fields, res?.fields ?? {});
202
+ });
206
203
  return {
207
- isValid: true
204
+ isValid,
205
+ fields: Object.keys(fields).length ? fields : void 0
208
206
  };
209
207
  }
210
208
  }
211
- function getAppInfo() {
212
- return api.apaas.designerCommon.getGetApp();
213
- }
214
- async function getSuiteKey() {
215
- const appInfo = await getAppInfo();
216
- return appInfo?.suiteKey;
217
- }
218
- async function isEdhrSuite() {
219
- const suiteKey = await getSuiteKey();
220
- return suiteKey === "eDHR";
221
- }
222
- async function isEqmSuite() {
223
- const suiteKey = await getSuiteKey();
224
- return suiteKey === "EQM";
225
- }
226
209
  async function getModelQueries(opts) {
227
210
  const isEdhr = await isEdhrSuite();
228
211
  if (!isEdhr || !opts.mainMaterialNo) {
@@ -242,7 +225,86 @@ async function getModelQueries(opts) {
242
225
  console.log("getModelQueries", res);
243
226
  return res;
244
227
  }
245
- function isBlank$2(value) {
228
+ const SCAN_NOT_FOUND_MSG$2 = "扫描的物料不存在";
229
+ const SCAN_LOT_OR_UNIQUE_REQUIRED_MSG = "条码中未解析到物料批号或唯一码";
230
+ function hasLotOrUniqueCode(parsed) {
231
+ return Boolean(String(parsed.lot ?? "").trim() || String(parsed.uniqueCode ?? "").trim());
232
+ }
233
+ function buildInventoryScanRequestBody(parsed, warehouseId) {
234
+ const body = {};
235
+ if (parsed.materialCode) body.product_code_ = parsed.materialCode;
236
+ if (parsed.lot) body.material_no_ = parsed.lot;
237
+ if (parsed.uniqueCode) body.unique_code_ = parsed.uniqueCode;
238
+ if (parsed.mfgOrderCode) body.mfg_order_code_ = parsed.mfgOrderCode;
239
+ if (warehouseId) body.warehouse_id_ = warehouseId;
240
+ return body;
241
+ }
242
+ function unwrapBizServiceList$1(result) {
243
+ if (!result) return [];
244
+ if (Array.isArray(result)) return result;
245
+ const data = result.data;
246
+ if (Array.isArray(data)) return data;
247
+ if (data && typeof data === "object") return [data];
248
+ return [];
249
+ }
250
+ async function matchInventoryScanRecords(parsed, warehouseId) {
251
+ const body = buildInventoryScanRequestBody(parsed, warehouseId);
252
+ if (!body.material_no_ && !body.unique_code_) return [];
253
+ const result = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
254
+ {
255
+ modelCategory: "entity",
256
+ modelKey: "em_inventory",
257
+ bsKey: "biz_inventory_production_identification_scan"
258
+ },
259
+ {},
260
+ body
261
+ );
262
+ return unwrapBizServiceList$1(result);
263
+ }
264
+ const PRODUCTION_IDENTIFICATION_SCAN_NOT_FOUND_MSG = "扫描的物料不存在";
265
+ const PRODUCTION_IDENTIFICATION_SCAN_LOT_OR_UNIQUE_REQUIRED_MSG = "条码中未解析到物料批号或唯一码";
266
+ function hasProductionIdentificationScanKey(parsed) {
267
+ return Boolean(String(parsed.lot ?? "").trim() || String(parsed.uniqueCode ?? "").trim());
268
+ }
269
+ function buildProductionIdentificationScanBody(parsed) {
270
+ const body = {};
271
+ if (parsed.materialCode) body.product_code_ = parsed.materialCode;
272
+ if (parsed.lot) body.material_no_ = parsed.lot;
273
+ if (parsed.qty != null) body.qty_ = parsed.qty;
274
+ if (parsed.expiration) body.vaildate_ = parsed.expiration;
275
+ if (parsed.deviceCode) body.device_code_ = parsed.deviceCode;
276
+ if (parsed.uniqueCode) body.unique_code = parsed.uniqueCode;
277
+ if (parsed.mfgOrderCode) body.mfg_order_code_ = parsed.mfgOrderCode;
278
+ if (parsed.sterilizationLot) body.sterilization_code_ = parsed.sterilizationLot;
279
+ const productionContainerName = parsed.productionContainerName ?? parsed.production_container_name_ ?? parsed.productionLot;
280
+ if (productionContainerName) {
281
+ body.production_container_name_ = productionContainerName;
282
+ }
283
+ return body;
284
+ }
285
+ function unwrapBizServiceList(result) {
286
+ if (!result) return [];
287
+ if (Array.isArray(result)) return result;
288
+ const data = result.data;
289
+ if (Array.isArray(data)) return data;
290
+ if (data && typeof data === "object") return [data];
291
+ return [];
292
+ }
293
+ async function matchProductionIdentificationScanRecords(parsed) {
294
+ const body = buildProductionIdentificationScanBody(parsed);
295
+ if (!body.material_no_ && !body.unique_code) return [];
296
+ const result = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
297
+ {
298
+ modelCategory: "entity",
299
+ modelKey: "em_production_identification",
300
+ bsKey: "biz_production_identification_scan"
301
+ },
302
+ {},
303
+ body
304
+ );
305
+ return unwrapBizServiceList(result);
306
+ }
307
+ function isBlank$4(value) {
246
308
  return value === void 0 || value === null || value === "";
247
309
  }
248
310
  function matchFieldKey(match, fieldKey) {
@@ -261,7 +323,7 @@ function buildDefaultMapFromProfile(profile, paramsConfig) {
261
323
  );
262
324
  for (const assignment of assignments) {
263
325
  const value = paramsConfig?.[assignment.paramKey];
264
- if (isBlank$2(value)) continue;
326
+ if (isBlank$4(value)) continue;
265
327
  result[assignment.fieldKey] = value;
266
328
  }
267
329
  return result;
@@ -332,54 +394,115 @@ class ProfileDrivenSubTableCore extends SubTableCore {
332
394
  super.handleChange(params);
333
395
  }
334
396
  }
335
- class WarehouseInTableCore extends ProfileDrivenSubTableCore {
397
+ function isBlank$3(value) {
398
+ return value === void 0 || value === null || value === "";
399
+ }
400
+ function resolveOptionRecord$1(option) {
401
+ if (!option) return void 0;
402
+ const nested = option._item;
403
+ if (nested && typeof nested === "object") {
404
+ return nested;
405
+ }
406
+ return option;
407
+ }
408
+ function applyOptionFill(rowData, option, mappings) {
409
+ const record = resolveOptionRecord$1(option) ?? option;
410
+ for (const { optionField, toField } of mappings) {
411
+ if (record[optionField] !== void 0) {
412
+ rowData[toField] = record[optionField];
413
+ }
414
+ }
415
+ }
416
+ function applyAllocatePartTd(params, partField, mode) {
417
+ const { field, tdHandler } = params;
418
+ if (field !== partField) return;
419
+ tdHandler.mergeTd({
420
+ cellWidget: {
421
+ props: {
422
+ customRenderTag: "allocatePart",
423
+ partSelectMode: mode,
424
+ newSpecificConfig: {
425
+ newOptions: []
426
+ }
427
+ }
428
+ }
429
+ });
336
430
  }
337
431
  class WarehouseInboundTableCore extends ProfileDrivenSubTableCore {
432
+ handleFieldTd = (params) => {
433
+ applyAllocatePartTd(params, F$3.part, "master");
434
+ super.handleFieldTd(params);
435
+ };
436
+ handleChange(params) {
437
+ super.handleChange(params);
438
+ const { field, value, option, rowData } = params;
439
+ if (field !== F$3.part || isBlank$3(value) || !option) return;
440
+ applyOptionFill(rowData, option, FILL_FROM_PART_OPTION);
441
+ }
338
442
  }
339
- class WarehouseOutTableCore extends ProfileDrivenSubTableCore {
443
+ class WarehouseOutboundTableCore extends ProfileDrivenSubTableCore {
340
444
  get warehouseId() {
341
445
  return this.factory.ctx.paramsConfig?.warehouseId;
342
446
  }
343
447
  handleFieldTd = (params) => {
344
- const { field, tdHandler } = params;
345
- if (field === F$1.product) {
346
- tdHandler.mergeTd({
347
- cellWidget: {
348
- props: {
349
- customRenderTag: "allocateProduct",
350
- newSpecificConfig: {
351
- newOptions: []
352
- }
353
- }
354
- }
355
- });
356
- }
448
+ applyAllocatePartTd(params, F$4.part, "inventory");
357
449
  super.handleFieldTd(params);
358
450
  };
359
451
  calcFieldQuery = (params) => {
360
- const { field } = params;
361
- if (field === F$1.product) {
362
- return {
363
- warehouse_id_: this.warehouseId
364
- };
452
+ if (params.field === F$4.part) {
453
+ return { warehouse_id_: this.warehouseId };
365
454
  }
366
455
  };
367
456
  handleChange(params) {
368
457
  super.handleChange(params);
369
458
  const { field, value, option, rowData } = params;
370
- if (field !== F$1.product || !option || value === void 0 || value === null || value === "") {
371
- return;
372
- }
373
- for (const { optionField, toField } of FILL_FROM_INVENTORY_OPTION) {
374
- rowData[toField] = option[optionField];
375
- }
459
+ if (field !== F$4.part || isBlank$3(value) || !option) return;
460
+ applyOptionFill(rowData, option, FILL_FROM_INVENTORY_OPTION$1);
376
461
  }
377
462
  }
378
- class WarehouseOutboundTableCore extends ProfileDrivenSubTableCore {
379
- }
380
463
  class PartStocktakeTableCore extends ProfileDrivenSubTableCore {
464
+ get warehouseId() {
465
+ return this.factory.ctx.paramsConfig?.warehouseId;
466
+ }
467
+ handleFieldTd = (params) => {
468
+ applyAllocatePartTd(params, F$2.part, "inventory");
469
+ super.handleFieldTd(params);
470
+ };
471
+ calcFieldQuery = (params) => {
472
+ if (params.field === F$2.part) {
473
+ return { warehouse_id_: this.warehouseId };
474
+ }
475
+ };
476
+ handleChange(params) {
477
+ super.handleChange(params);
478
+ const { field, value, option, rowData } = params;
479
+ if (field !== F$2.part || isBlank$3(value) || !option) return;
480
+ applyOptionFill(rowData, option, FILL_FROM_INVENTORY_OPTION);
481
+ runRowHandler(TABLE_TYPE, "stocktake-derived", {
482
+ rowData,
483
+ changedField: field
484
+ });
485
+ }
381
486
  }
382
487
  class DevicePartConsumeTableCore extends ProfileDrivenSubTableCore {
488
+ get warehouseId() {
489
+ return this.factory.ctx.paramsConfig?.warehouseId;
490
+ }
491
+ handleFieldTd = (params) => {
492
+ applyAllocatePartTd(params, F$1.part, "inventory");
493
+ super.handleFieldTd(params);
494
+ };
495
+ calcFieldQuery = (params) => {
496
+ if (params.field === F$1.part) {
497
+ return { warehouse_id_: this.warehouseId };
498
+ }
499
+ };
500
+ handleChange(params) {
501
+ super.handleChange(params);
502
+ const { field, value, option, rowData } = params;
503
+ if (field !== F$1.part || isBlank$3(value) || !option) return;
504
+ applyOptionFill(rowData, option, FILL_FROM_INVENTORY_OPTION$2);
505
+ }
383
506
  }
384
507
  class MaterialRequisitionTableCore extends ProfileDrivenSubTableCore {
385
508
  }
@@ -402,7 +525,7 @@ function toNumber(value, fallback = 0) {
402
525
  const num = Number(value);
403
526
  return Number.isNaN(num) ? fallback : num;
404
527
  }
405
- function isBlank$1(value) {
528
+ function isBlank$2(value) {
406
529
  return value == null || value === "";
407
530
  }
408
531
  function pickInventoryBase(record) {
@@ -413,23 +536,20 @@ function pickInventoryBase(record) {
413
536
  function mapInventoryRecordToRow(record) {
414
537
  return {
415
538
  ...pickInventoryBase(record),
416
- [F$2.location]: record[F$2.location],
417
- [F$2.stock]: toNumber(record[F$2.stock])
539
+ [F$5.location]: record[F$5.location],
540
+ [F$5.stock]: toNumber(record[F$5.stock])
418
541
  };
419
542
  }
420
543
  function mergeInventoryByWarehouse(items) {
421
544
  const [first] = items;
422
545
  return {
423
546
  ...pickInventoryBase(first),
424
- [F$2.stock]: items.reduce((sum, item) => sum + toNumber(item[F$2.stock]), 0)
547
+ [F$5.stock]: items.reduce((sum, item) => sum + toNumber(item[F$5.stock]), 0)
425
548
  };
426
549
  }
427
550
  function buildWarehouseGroupKey(record) {
428
551
  return buildRowGroupKey(record, WAREHOUSE_IDENTITY_GROUP_KEYS);
429
552
  }
430
- function buildScanMergeKey(record) {
431
- return buildRowGroupKey(record, SCAN_MERGE_GROUP_KEYS);
432
- }
433
553
  function groupByWarehouseIdentity(records) {
434
554
  const groups = /* @__PURE__ */ new Map();
435
555
  for (const record of records) {
@@ -444,7 +564,7 @@ function groupByWarehouseIdentity(records) {
444
564
  return groups;
445
565
  }
446
566
  function getStocktakeDiff(stocktakeNum, stockNum) {
447
- if (isBlank$1(stocktakeNum)) {
567
+ if (isBlank$2(stocktakeNum)) {
448
568
  return void 0;
449
569
  }
450
570
  const stocktake = toNumber(stocktakeNum);
@@ -471,89 +591,31 @@ function buildStocktakeDerived(stocktakeNum, stockNum) {
471
591
  statusLabel: STOCKTAKE_STATUS[status]
472
592
  };
473
593
  }
474
- function groupRecordsByInventoryIdentity(records) {
475
- return Array.from(groupByWarehouseIdentity(records).values());
476
- }
477
- function dispositionScanRecord(record, visibleRows, groupByWarehouse) {
478
- if (groupByWarehouse) {
479
- const key = buildWarehouseGroupKey(record);
480
- const index = visibleRows.findIndex((row) => buildWarehouseGroupKey(row) === key);
481
- return index >= 0 ? { kind: "accumulate", index } : { kind: "unprocessed" };
482
- }
483
- const scanKey = buildScanMergeKey(record);
484
- const warehouseKey = buildWarehouseGroupKey(record);
485
- let hasWaitingRow = false;
486
- for (let i = 0; i < visibleRows.length; i++) {
487
- const row = visibleRows[i];
488
- if (buildScanMergeKey(row) === scanKey) {
489
- if (isBlank$1(row[F$2.location])) {
490
- return { kind: "skip-location-not-selected" };
491
- }
492
- return { kind: "accumulate", index: i };
493
- }
494
- if (!hasWaitingRow && buildWarehouseGroupKey(row) === warehouseKey && isBlank$1(row[F$2.location])) {
495
- hasWaitingRow = true;
496
- }
497
- }
498
- return hasWaitingRow ? { kind: "skip-location-not-selected" } : { kind: "unprocessed" };
499
- }
500
- function pickRecordsForNewScanRow(unprocessed, groupByWarehouse) {
501
- if (!unprocessed.length) {
502
- return {
503
- records: [],
504
- productGroupCount: 0
505
- };
506
- }
507
- const productGroups = groupRecordsByInventoryIdentity(unprocessed);
508
- const productRecords = productGroups[0] ?? [];
509
- if (!productRecords.length) {
510
- return {
511
- records: [],
512
- productGroupCount: productGroups.length
513
- };
514
- }
515
- return {
516
- records: groupByWarehouse || productRecords.length > 1 ? productRecords : [productRecords[0]],
517
- productGroupCount: productGroups.length
518
- };
519
- }
520
- function applyScanQtyToStocktake(current, scanQty, type) {
521
- if (isBlank$1(scanQty)) {
594
+ function applyScanQtyToStocktake(current, scanQty, type = "add") {
595
+ if (isBlank$2(scanQty)) {
522
596
  return current;
523
597
  }
524
598
  const qtyNum = toNumber(scanQty);
525
599
  if (Number.isNaN(qtyNum)) {
526
600
  return current;
527
601
  }
528
- const base = isBlank$1(current) ? 0 : toNumber(current);
602
+ const base = isBlank$2(current) ? 0 : toNumber(current);
529
603
  return base + (type === "minus" ? -qtyNum : qtyNum);
530
604
  }
531
- function accumulateScanQtyOnRow(visibleRows, rowIndex, scanQty, type) {
532
- const nextRows = [...visibleRows];
533
- const caculateNum = applyScanQtyToStocktake(nextRows[rowIndex][F$2.stocktake], scanQty, type);
534
- if (toNumber(caculateNum) >= 0) {
535
- nextRows[rowIndex] = {
536
- ...nextRows[rowIndex],
537
- [F$2.stocktake]: caculateNum
538
- };
605
+ const MIN_STOCKTAKE_NUM = 0;
606
+ function getScanQtyDeductionBlockReason(current, scanQty, type = "add") {
607
+ if (type !== "minus" || isBlank$2(scanQty)) {
608
+ return void 0;
539
609
  }
540
- return {
541
- rows: nextRows,
542
- mergedIndex: rowIndex,
543
- shouldWarning: toNumber(caculateNum) < 0
544
- };
545
- }
546
- function appendScanRowFromResolve(visibleRows, rowData) {
547
- return {
548
- rows: [
549
- ...visibleRows,
550
- {
551
- ...rowData,
552
- [F$2.rowSource]: "scan"
553
- }
554
- ],
555
- mergedIndex: visibleRows.length
556
- };
610
+ const qtyNum = Number(scanQty);
611
+ if (Number.isNaN(qtyNum) || qtyNum <= 0) {
612
+ return void 0;
613
+ }
614
+ const base = isBlank$2(current) ? 0 : toNumber(current);
615
+ if (base - qtyNum >= MIN_STOCKTAKE_NUM) {
616
+ return void 0;
617
+ }
618
+ return "当前实盘数量小于本次条码扫码数量,无法扣减";
557
619
  }
558
620
  function groupInventoryToStocktakeRows(records, groupByWarehouse) {
559
621
  if (!groupByWarehouse) {
@@ -561,52 +623,97 @@ function groupInventoryToStocktakeRows(records, groupByWarehouse) {
561
623
  }
562
624
  return Array.from(groupByWarehouseIdentity(records).values()).map(mergeInventoryByWarehouse);
563
625
  }
564
- function shouldAssignScanQty(options) {
565
- const { assignScanQty, scanQty, rowIndex, qtyAssignedRowIndexes } = options;
566
- if (!assignScanQty || scanQty == null || scanQty === "") {
567
- return false;
568
- }
569
- return !qtyAssignedRowIndexes.has(rowIndex);
570
- }
571
- function resolveScanRecords(groupByWarehouse, records) {
572
- const row = { ...records[0] };
573
- if (!groupByWarehouse) {
574
- const allLocationIds = records.map((e) => e[F$2.location]);
575
- row[F$2.location] = allLocationIds.length > 1 ? void 0 : allLocationIds[0];
576
- row[F$2.inventoryLocationIds] = allLocationIds;
577
- } else {
578
- row[F$2.stock] = records.reduce((acc, cur) => acc + toNumber(cur[F$2.stock]), 0);
579
- }
580
- return row;
581
- }
582
626
  async function getStockData({
583
627
  warehouse_id_,
584
628
  material_no_,
585
629
  location_id_,
586
630
  product_code_,
587
- production_identification_id_
631
+ production_identification_id_,
632
+ stocktakeDimension
588
633
  }) {
634
+ const inventoryApi = resolveStocktakeInventoryApi({ stocktakeDimension });
635
+ const body = {
636
+ warehouse_id_,
637
+ material_no_,
638
+ location_id_,
639
+ product_code_,
640
+ production_identification_id_
641
+ };
642
+ if (inventoryApi.paginated) {
643
+ body.pageNo = 1;
644
+ body.pageSize = 9999;
645
+ }
589
646
  const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
590
647
  {
591
- modelCategory: "entity",
592
- bsKey: "biz_get_inventory_info",
593
- modelKey: "em_inventory"
648
+ modelCategory: inventoryApi.modelCategory,
649
+ bsKey: inventoryApi.bsKey,
650
+ modelKey: inventoryApi.modelKey
594
651
  },
595
652
  {},
596
- {
597
- warehouse_id_,
598
- material_no_,
599
- location_id_,
600
- product_code_,
601
- production_identification_id_
602
- }
653
+ body
603
654
  );
604
- return res || [];
655
+ if (Array.isArray(res)) return res;
656
+ if (Array.isArray(res?.data)) return res.data;
657
+ return [];
658
+ }
659
+ function isSameStocktakeIdentity(row, record, groupByWarehouse) {
660
+ if (row[F$5.product] !== record.product_id_) return false;
661
+ const rowBatch = row[F$5.batch];
662
+ const recordBatch = record.production_identification_id_;
663
+ if (rowBatch && recordBatch && rowBatch !== recordBatch) return false;
664
+ if (!rowBatch || !recordBatch) {
665
+ const rowNo = row[F$5.matno];
666
+ const recordNo = record.material_no_ ?? record.name_;
667
+ if (!(rowNo && recordNo && rowNo === recordNo)) return false;
668
+ }
669
+ if ((row[F$5.warehouse] ?? "") !== (record.warehouse_id_ ?? "")) return false;
670
+ if (!groupByWarehouse) {
671
+ if ((row[F$5.location] ?? "") !== (record.location_id_ ?? "")) return false;
672
+ }
673
+ return true;
674
+ }
675
+ function buildInventoryScanRow(record, parsed, fillData, stocktakeQty) {
676
+ const row = {
677
+ [F$5.inventory]: record.id_,
678
+ [F$5.batch]: record.production_identification_id_,
679
+ [F$5.product]: record.product_id_,
680
+ [F$5.productName]: record.product_id_name_,
681
+ [F$5.productCode]: record.product_id_code_ ?? record.product_code_,
682
+ [F$5.productSpec]: record.product_id_spec_,
683
+ [F$5.warehouse]: record.warehouse_id_,
684
+ [F$5.location]: record.location_id_,
685
+ [F$5.stock]: record.stock_num_,
686
+ [F$5.matno]: record.material_no_ ?? record.name_,
687
+ [F$5.reInspectionDate]: record.re_inspection_date_,
688
+ [F$5.stocktake]: stocktakeQty,
689
+ [F$5.rowSource]: "scan",
690
+ ...fillData
691
+ };
692
+ const validityFromRecord = record.validate_ ?? record.validity_;
693
+ if (parsed.expiration) {
694
+ row[F$5.validity] = toDateOnly(parsed.expiration);
695
+ } else if (validityFromRecord != null) {
696
+ row[F$5.validity] = toDateOnly(validityFromRecord);
697
+ }
698
+ return row;
699
+ }
700
+ function calcRowData(rowData, stocktakeNum) {
701
+ const { stock_num_, stocktake_num_ } = rowData;
702
+ const { diff, status, statusLabel } = buildStocktakeDerived(
703
+ stocktake_num_,
704
+ stock_num_
705
+ );
706
+ rowData.diff_num_ = diff;
707
+ rowData.stocktake_status_ = status;
708
+ rowData.stocktake_status__lb_ = $t(statusLabel);
605
709
  }
606
710
  class StocktakeTableCore extends ProfileDrivenSubTableCore {
607
711
  initData = [];
608
712
  get isGroupByWarehouse() {
609
- return !!this.ctx.widget?.props?.isGroupByWarehouse;
713
+ return resolveGroupByWarehouse(
714
+ this.bizTableConfig,
715
+ !!this.ctx.widget?.props?.isGroupByWarehouse
716
+ );
610
717
  }
611
718
  get paramsWarehouseId() {
612
719
  return (this.pageCtx?.paramsConfig || {}).warehouseId;
@@ -626,10 +733,10 @@ class StocktakeTableCore extends ProfileDrivenSubTableCore {
626
733
  const result = super.calcFieldStatus(params);
627
734
  const { field, rowData } = params;
628
735
  const { row_source_: source } = rowData;
629
- if (field === F$2.stocktake) return result;
630
- if (!Object.values(F$2).includes(field)) return result;
736
+ if (field === F$5.stocktake) return result;
737
+ if (!Object.values(F$5).includes(field)) return result;
631
738
  if (source === WarehouseInventoryRowSource.SCAN) {
632
- result.disabled = F$2.location !== field;
739
+ result.disabled = F$5.location !== field;
633
740
  } else if (source === WarehouseInventoryRowSource.AUTO) {
634
741
  result.disabled = true;
635
742
  } else if (!source || source === WarehouseInventoryRowSource.MANUAL) {
@@ -641,12 +748,12 @@ class StocktakeTableCore extends ProfileDrivenSubTableCore {
641
748
  }
642
749
  calcFieldQuery = (params) => {
643
750
  const { field, rowData } = params;
644
- if (field === F$2.location && rowData[F$2.inventoryLocationIds]) {
751
+ if (field === F$5.location && rowData[F$5.inventoryLocationIds]) {
645
752
  return {
646
- "id_.in": rowData[F$2.inventoryLocationIds]
753
+ "id_.in": rowData[F$5.inventoryLocationIds]
647
754
  };
648
755
  }
649
- if (field === F$2.product) {
756
+ if (field === F$5.product) {
650
757
  return {
651
758
  warehouse_id_: this.paramsWarehouseId
652
759
  };
@@ -654,11 +761,12 @@ class StocktakeTableCore extends ProfileDrivenSubTableCore {
654
761
  };
655
762
  handleFieldTd = (params) => {
656
763
  const { field, tdHandler } = params;
657
- if (field === F$2.product) {
764
+ if (field === F$5.product) {
658
765
  tdHandler.mergeTd({
659
766
  cellWidget: {
660
767
  props: {
661
768
  customRenderTag: "allocateProduct",
769
+ stocktakeDimension: this.bizTableConfig?.stocktakeDimension ?? STOCKTAKE_DIMENSION.locationDetail,
662
770
  newSpecificConfig: {
663
771
  newOptions: []
664
772
  }
@@ -675,7 +783,6 @@ class StocktakeTableCore extends ProfileDrivenSubTableCore {
675
783
  label: $t("sys.edhr.bizOperation")
676
784
  },
677
785
  getMenuByAction(SubTableActionEnum.SCAN),
678
- getMenuByAction(SubTableActionEnum.CHANGE_PARSE_RULE),
679
786
  {
680
787
  type: SubTableActionMenuTypeEnum.DIVIDER
681
788
  },
@@ -684,6 +791,7 @@ class StocktakeTableCore extends ProfileDrivenSubTableCore {
684
791
  label: $t("sys.edhr.editRow")
685
792
  },
686
793
  getMenuByAction(SubTableActionEnum.Insert1RowAfter),
794
+ getInsertSubMenu(),
687
795
  ...params.showDelBtn ? [
688
796
  {
689
797
  type: SubTableActionMenuTypeEnum.DIVIDER
@@ -694,17 +802,21 @@ class StocktakeTableCore extends ProfileDrivenSubTableCore {
694
802
  return menus;
695
803
  };
696
804
  async init() {
697
- const { autoLoadStock, barcodeParsingRules } = this.bizTableConfig || {};
805
+ const config = this.bizTableConfig || {};
806
+ const { autoLoadStock, barcodeParsingRules, stocktakeDimension } = config;
698
807
  if (barcodeParsingRules) {
699
- this.scanRuleProps = this.bizTableConfig.barcodeParsingRules;
808
+ this.scanRuleProps = barcodeParsingRules;
700
809
  this.scanRuleInfo = await getParseRuleInfo({ id: this.scanRuleProps.parsingRuleId });
701
810
  }
702
811
  if (this.isDataProcessed || !autoLoadStock || !this.paramsWarehouseId) return;
703
- const res = await getStockData({ warehouse_id_: this.paramsWarehouseId });
704
- this.initData = groupInventoryToStocktakeRows(res, this.isGroupByWarehouse).map((e) => {
705
- calcRowData(e);
706
- e.row_source_ = "auto";
707
- return e;
812
+ const res = await getStockData({
813
+ warehouse_id_: this.paramsWarehouseId,
814
+ stocktakeDimension
815
+ });
816
+ this.initData = groupInventoryToStocktakeRows(res, this.isGroupByWarehouse).map((e2) => {
817
+ calcRowData(e2);
818
+ e2.row_source_ = "auto";
819
+ return e2;
708
820
  });
709
821
  }
710
822
  handleInitializeFormState(_params) {
@@ -713,203 +825,96 @@ class StocktakeTableCore extends ProfileDrivenSubTableCore {
713
825
  handleChange(params) {
714
826
  super.handleChange(params);
715
827
  const { field, value, option, rowData } = params;
716
- if (field === F$2.product && option && value !== void 0 && value !== null && value !== "") {
717
- for (const { optionField, toField } of FILL_FROM_INVENTORY_OPTION$1) {
828
+ if (field === F$5.product && option && value !== void 0 && value !== null && value !== "") {
829
+ for (const { optionField, toField } of FILL_FROM_INVENTORY_OPTION$3) {
718
830
  rowData[toField] = option[optionField];
719
831
  }
720
832
  calcRowData(rowData);
721
833
  }
722
834
  }
723
- async onScan({ barcode, type }) {
724
- const { lot, materialCode, qty = 0 } = getParseRuleValue(barcode, this.scanRuleInfo.rules_);
725
- if (!lot) {
726
- this.warning({ content: "条码中未解析到批次号" });
835
+ /**
836
+ * 盘点扫码弹窗回传 { barcode, type };在此解析并走库存扫码接口
837
+ */
838
+ async onScan(input) {
839
+ const parsed = resolveScanParsedFromInput(input, this.scanRuleInfo?.rules_);
840
+ if (!parsed || !hasLotOrUniqueCode(parsed)) {
841
+ this.error({ content: SCAN_LOT_OR_UNIQUE_REQUIRED_MSG });
727
842
  return;
728
843
  }
729
- const res = await getStockData({
730
- material_no_: lot,
731
- product_code_: materialCode,
732
- warehouse_id_: this.paramsWarehouseId
733
- });
734
- if (res?.length) {
735
- const materialGroups = groupRecordsByInventoryIdentity(res);
736
- const assignScanQty = materialGroups.length === 1;
737
- const mergedIndexes = [];
738
- let totalSkippedForLocation = 0;
739
- const visibleRows = this.tableData.filter((e) => !e.deleted_);
740
- const deletedRows = this.tableData.filter((e) => e.deleted_);
741
- const warningList = [];
742
- for (let i = 0; i < materialGroups.length; i += 1) {
743
- const groupRecords = materialGroups[i];
744
- const result = processScanRecordGroup({
745
- groupRecords,
746
- visibleRows,
747
- groupByWarehouse: this.isGroupByWarehouse,
748
- scanQty: qty || 1,
749
- scanAdjustType: type,
750
- assignScanQty
751
- });
752
- this.tableData = [...result.rows, ...deletedRows];
753
- mergedIndexes.push(...result.mergedIndexes);
754
- totalSkippedForLocation += result.skippedForLocation;
755
- warningList.push(...result.messageList);
756
- }
757
- if (totalSkippedForLocation > 0) {
758
- this.warning({
759
- content: totalSkippedForLocation === 1 ? "相同物料行尚未选择库位,已忽略 1 条扫码数据" : `相同物料行尚未选择库位,已忽略 ${totalSkippedForLocation} 条扫码数据`
760
- });
761
- }
762
- if (warningList.length) {
763
- warningList.forEach((e) => {
764
- this.warning({ content: e });
765
- });
766
- }
767
- if (!mergedIndexes.length) {
768
- if (totalSkippedForLocation === 0) {
769
- this.error({ content: "扫描结果解析失败" });
770
- }
771
- return;
772
- }
844
+ const records = await matchInventoryScanRecords(parsed, this.paramsWarehouseId);
845
+ if (!records.length) {
846
+ this.error({ content: SCAN_NOT_FOUND_MSG$2 });
847
+ return;
773
848
  }
774
- }
775
- }
776
- function calcRowData(rowData, stocktakeNum) {
777
- const { stock_num_, stocktake_num_ } = rowData;
778
- const { diff, status, statusLabel } = buildStocktakeDerived(
779
- stocktake_num_,
780
- stock_num_
781
- );
782
- rowData.diff_num_ = diff;
783
- rowData.stocktake_status_ = status;
784
- rowData.stocktake_status__lb_ = $t(statusLabel);
785
- }
786
- function processScanRecordGroup(options) {
787
- const { groupRecords, groupByWarehouse, scanQty, scanAdjustType, assignScanQty } = options;
788
- let visibleRows = options.visibleRows;
789
- const mergedIndexes = [];
790
- const unprocessed = [];
791
- let skippedForLocation = 0;
792
- let accumulated = 0;
793
- const qtyAssignedRowIndexes = /* @__PURE__ */ new Set();
794
- const messageList = [];
795
- for (const record of groupRecords) {
796
- const disposition = dispositionScanRecord(record, visibleRows, groupByWarehouse);
797
- if (disposition.kind === "accumulate") {
798
- accumulated += 1;
799
- const qtyCheck = {
800
- assignScanQty,
849
+ const selected = await this.pickScanRecord(records);
850
+ if (!selected) return;
851
+ const scanAdjustType = resolveScanAdjustType(input);
852
+ const scanQty = resolveScanQty(parsed.qty, selected.qty_);
853
+ const fillData = this.scanRuleProps?.fillMapArr?.length && parsed ? calcFillData(parsed, this.scanRuleProps.fillMapArr) : {};
854
+ const visibleRows = this.showTableData;
855
+ const deletedRows = this.tableData.filter((e2) => e2.deleted_);
856
+ const existIndex = visibleRows.findIndex(
857
+ (row2) => isSameStocktakeIdentity(row2, selected, this.isGroupByWarehouse)
858
+ );
859
+ if (existIndex >= 0) {
860
+ const existRow = visibleRows[existIndex];
861
+ const blockReason = getScanQtyDeductionBlockReason(
862
+ existRow[F$5.stocktake],
801
863
  scanQty,
802
- rowIndex: disposition.index,
803
- qtyAssignedRowIndexes
804
- };
805
- const shouldAddQty = shouldAssignScanQty(qtyCheck);
806
- const result = accumulateScanQtyOnRow(
807
- visibleRows,
808
- disposition.index,
809
- shouldAddQty ? scanQty : void 0,
810
864
  scanAdjustType
811
865
  );
812
- if (result.shouldWarning) {
813
- messageList.push($t("sys.edhr.stocktakeScanWarning"));
814
- }
815
- if (shouldAddQty) {
816
- qtyAssignedRowIndexes.add(disposition.index);
817
- }
818
- calcRowData(result.rows[disposition.index]);
819
- visibleRows = result.rows;
820
- if (!mergedIndexes.includes(result.mergedIndex)) {
821
- mergedIndexes.push(result.mergedIndex);
866
+ if (blockReason) {
867
+ this.error({ content: blockReason });
868
+ return;
822
869
  }
823
- continue;
824
- }
825
- if (disposition.kind === "skip-location-not-selected") {
826
- skippedForLocation += 1;
827
- continue;
828
- }
829
- unprocessed.push(record);
830
- }
831
- const appended = appendUnresolvedScanRecords({
832
- unprocessed,
833
- visibleRows,
834
- groupByWarehouse,
835
- scanQty,
836
- scanAdjustType,
837
- assignScanQty: assignScanQty && mergedIndexes.length === 0
838
- });
839
- visibleRows = appended.rows;
840
- const appendedCount = appended.mergedIndex != null ? 1 : 0;
841
- if (appended.mergedIndex != null) {
842
- mergedIndexes.push(appended.mergedIndex);
843
- }
844
- const stats = {
845
- total: groupRecords.length,
846
- accumulated,
847
- skipped: skippedForLocation,
848
- unprocessed: unprocessed.length,
849
- appended: appendedCount
850
- };
851
- return { rows: visibleRows, mergedIndexes, skippedForLocation, stats, messageList };
852
- }
853
- function appendUnresolvedScanRecords(options) {
854
- const { unprocessed, visibleRows, groupByWarehouse, scanQty, scanAdjustType, assignScanQty } = options;
855
- if (!unprocessed.length) return { rows: visibleRows };
856
- const { records: recordsForNewRow, productGroupCount } = pickRecordsForNewScanRow(
857
- unprocessed,
858
- groupByWarehouse
859
- );
860
- if (!recordsForNewRow.length) return { rows: visibleRows };
861
- const rowData = buildRowFromResolve(
862
- resolveScanRecords(groupByWarehouse, recordsForNewRow),
863
- scanQty,
864
- assignScanQty,
865
- scanAdjustType
866
- );
867
- calcRowData(rowData);
868
- const appended = appendScanRowFromResolve(visibleRows, rowData);
869
- return {
870
- rows: appended.rows,
871
- mergedIndex: appended.mergedIndex,
872
- appendMeta: {
873
- unprocessedCount: unprocessed.length,
874
- productGroupCount,
875
- usedForNewRow: recordsForNewRow.length,
876
- multiLocationPending: !groupByWarehouse && recordsForNewRow.length > 1
870
+ existRow[F$5.stocktake] = applyScanQtyToStocktake(
871
+ existRow[F$5.stocktake],
872
+ scanQty,
873
+ scanAdjustType
874
+ );
875
+ calcRowData(existRow);
876
+ this.tableData = [...visibleRows, ...deletedRows];
877
+ return;
877
878
  }
879
+ const stocktakeQty = applyScanQtyToStocktake(void 0, scanQty, scanAdjustType);
880
+ const row = buildInventoryScanRow(selected, parsed, fillData, stocktakeQty);
881
+ calcRowData(row);
882
+ this.appendOrFillScanRow(row);
883
+ }
884
+ }
885
+ function resolveScanParsedFromInput(input, rules) {
886
+ if (input.parsedValue && typeof input.parsedValue === "object") {
887
+ return input.parsedValue;
888
+ }
889
+ const raw = input.barcode ?? input.str;
890
+ if (!raw || !rules) return void 0;
891
+ return getParseRuleValue(raw, rules);
892
+ }
893
+ function buildAllocateScanRow(record, parsed, fillData) {
894
+ const row = {
895
+ [F$6.inventory]: record.id_,
896
+ [F$6.product]: record.product_id_,
897
+ [F$6.productName]: record.product_id_name_,
898
+ [F$6.productCode]: record.product_id_code_,
899
+ [F$6.productSpec]: record.product_id_spec_,
900
+ [F$6.batch]: record.production_identification_id_,
901
+ [F$6.originLocation]: record.location_id_,
902
+ [F$6.originWarehouse]: record.warehouse_id_,
903
+ [F$6.stock]: record.stock_num_,
904
+ [F$6.mfgOrder]: record.mfg_order_id_,
905
+ [F$6.lotSn]: record.lot_sn_id_,
906
+ [F$6.uniqueCode]: record.unique_code_,
907
+ [F$6.reInspectionDate]: record.re_inspection_date_,
908
+ [F$6.allocateNum]: resolveScanQty(parsed.qty, record.qty_),
909
+ ...fillData
878
910
  };
879
- }
880
- function buildRowFromResolve(row, scanQty, assignScanQty = false, scanAdjustType = "add") {
881
- const rowData = {
882
- ...row,
883
- [F$2.rowSource]: "scan"
884
- };
885
- if (assignScanQty && scanQty != null && scanQty !== "") {
886
- rowData[F$2.stocktake] = applyScanQtyToStocktake(void 0, scanQty, scanAdjustType);
911
+ const validityFromRecord = record.validate_ ?? record.validity_;
912
+ if (parsed.expiration) {
913
+ row[F$6.validity] = toDateOnly(parsed.expiration);
914
+ } else if (validityFromRecord != null) {
915
+ row[F$6.validity] = toDateOnly(validityFromRecord);
887
916
  }
888
- return rowData;
889
- }
890
- async function fetchInventoryInfo({
891
- warehouse_id_,
892
- material_no_,
893
- location_id_,
894
- product_code_,
895
- production_identification_id_
896
- }) {
897
- const res = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
898
- {
899
- modelCategory: "entity",
900
- bsKey: "biz_get_inventory_info",
901
- modelKey: "em_inventory"
902
- },
903
- {},
904
- {
905
- warehouse_id_,
906
- material_no_,
907
- location_id_,
908
- product_code_,
909
- production_identification_id_
910
- }
911
- );
912
- return res || [];
917
+ return row;
913
918
  }
914
919
  class AllocateTableCore extends ProfileDrivenSubTableCore {
915
920
  /** 绘制UI相关工具 */
@@ -926,7 +931,7 @@ class AllocateTableCore extends ProfileDrivenSubTableCore {
926
931
  }
927
932
  handleFieldTd = (params) => {
928
933
  const { field, tdHandler } = params;
929
- if (field === F$3.product) {
934
+ if (field === F$6.product) {
930
935
  tdHandler.mergeTd({
931
936
  cellWidget: {
932
937
  props: {
@@ -942,17 +947,17 @@ class AllocateTableCore extends ProfileDrivenSubTableCore {
942
947
  };
943
948
  calcFieldQuery = (params) => {
944
949
  const { field, rowData } = params;
945
- if (field === F$3.location) {
950
+ if (field === F$6.location) {
946
951
  return {
947
- "warehouse_id_.eq": rowData[F$3.warehouse]
952
+ "warehouse_id_.eq": rowData[F$6.warehouse]
948
953
  };
949
954
  }
950
- if (field === F$3.originLocation) {
955
+ if (field === F$6.originLocation) {
951
956
  return {
952
- "warehouse_id_.eq": rowData[F$3.originWarehouse]
957
+ "warehouse_id_.eq": rowData[F$6.originWarehouse]
953
958
  };
954
959
  }
955
- if (field === F$3.product) {
960
+ if (field === F$6.product) {
956
961
  return {
957
962
  warehouse_id_: this.warehouseId
958
963
  };
@@ -960,7 +965,19 @@ class AllocateTableCore extends ProfileDrivenSubTableCore {
960
965
  };
961
966
  calcSubTableActionMenu = (params) => {
962
967
  const { showDelBtn } = params;
963
- const menus = [
968
+ return [
969
+ {
970
+ type: SubTableActionMenuTypeEnum.SUBTITLE,
971
+ label: $t("sys.edhr.bizOperation")
972
+ },
973
+ getMenuByAction(SubTableActionEnum.SCAN),
974
+ {
975
+ type: SubTableActionMenuTypeEnum.DIVIDER
976
+ },
977
+ {
978
+ type: SubTableActionMenuTypeEnum.SUBTITLE,
979
+ label: $t("sys.edhr.editRow")
980
+ },
964
981
  getMenuByAction(SubTableActionEnum.Insert1RowAfter),
965
982
  getCopySubMenu(),
966
983
  getInsertSubMenu(),
@@ -971,55 +988,32 @@ class AllocateTableCore extends ProfileDrivenSubTableCore {
971
988
  getMenuByAction(SubTableActionEnum.DeleteRowCurrent)
972
989
  ] : []
973
990
  ].filter(Boolean);
974
- return menus;
975
991
  };
976
992
  handleChange(params) {
977
993
  super.handleChange(params);
978
994
  const { field, value, option, rowData } = params;
979
- if (field !== F$3.product || !option || value === void 0 || value === null || value === "") {
995
+ if (field !== F$6.product || !option || value === void 0 || value === null || value === "") {
980
996
  return;
981
997
  }
982
- for (const { optionField, toField } of FILL_FROM_INVENTORY_OPTION$2) {
998
+ for (const { optionField, toField } of FILL_FROM_INVENTORY_OPTION$4) {
983
999
  rowData[toField] = option[optionField];
984
1000
  }
985
1001
  }
986
- async onScan({ str }) {
987
- const data = getParseRuleValue(str, this.scanRuleInfo.rules_);
988
- console.log("parseScanStr", data);
989
- const arr = await fetchInventoryInfo({
990
- warehouse_id_: this.warehouseId,
991
- product_code_: data.materialCode
992
- });
993
- if (!arr?.length) {
994
- this.error({ content: "扫描的物料不存在" });
1002
+ async onScan(input) {
1003
+ const parsed = resolveScanParsedValue(input);
1004
+ if (!parsed || !hasLotOrUniqueCode(parsed)) {
1005
+ this.error({ content: SCAN_LOT_OR_UNIQUE_REQUIRED_MSG });
995
1006
  return;
996
1007
  }
997
- const info = arr[0];
998
- const row = {
999
- product_id_: info.product_id_,
1000
- product_id_name_: info.product_id_name_,
1001
- product_id_code_: info.product_id_code_,
1002
- product_id_spec_: info.product_id_spec_,
1003
- production_identification_id_: info.production_identification_id_,
1004
- origin_location_id_: info.location_id_,
1005
- origin_warehouse_id_: info.warehouse_id_,
1006
- stock_num_: info.stock_num_,
1007
- inventory_id_: info.id_,
1008
- mfg_order_id_: info.mfg_order_id_,
1009
- lot_sn_id_: info.lot_sn_id_,
1010
- re_inspection_date_: info.re_inspection_date_
1011
- };
1012
- if (data.expiration) {
1013
- row.validity_ = dayjs(data.expiration).format("YYYY-MM-DD");
1014
- } else if (info.validate_) {
1015
- row.validity_ = info.validate_;
1016
- }
1017
- if (this.scanRuleProps?.fillMapArr?.length) {
1018
- const fillData = calcFillData(data, this.scanRuleProps.fillMapArr);
1019
- console.log("fillData", fillData);
1020
- Object.assign(row, fillData);
1008
+ const records = await matchInventoryScanRecords(parsed, this.warehouseId);
1009
+ if (!records.length) {
1010
+ this.error({ content: SCAN_NOT_FOUND_MSG$2 });
1011
+ return;
1021
1012
  }
1022
- this.tableData = [...this.tableData, row];
1013
+ const selected = await this.pickScanRecord(records);
1014
+ if (!selected) return;
1015
+ const row = buildAllocateScanRow(selected, parsed, resolveScanFillData(input));
1016
+ this.appendOrFillScanRow(row);
1023
1017
  }
1024
1018
  beforeBtnClick = async (params) => {
1025
1019
  const { btn } = params;
@@ -1039,7 +1033,7 @@ class AllocateTableCore extends ProfileDrivenSubTableCore {
1039
1033
  }
1040
1034
  };
1041
1035
  }
1042
- const F3 = {
1036
+ const F2 = {
1043
1037
  /** 产品 */
1044
1038
  product: "product_id_",
1045
1039
  /** 产品标签 */
@@ -1064,59 +1058,59 @@ const F3 = {
1064
1058
  productionDate: "production_date_"
1065
1059
  };
1066
1060
  const STERILIZE_ALWAYS_DISABLED_FIELDS = [
1067
- F3.product,
1068
- F3.productCode,
1069
- F3.productSpec,
1070
- F3.productName,
1071
- F3.mfgOrderCode,
1072
- F3.mfgOrder
1061
+ F2.product,
1062
+ F2.productCode,
1063
+ F2.productSpec,
1064
+ F2.productName,
1065
+ F2.mfgOrderCode,
1066
+ F2.mfgOrder
1073
1067
  ];
1074
1068
  const CLEAR_ON_PROD_CONTAINER_EMPTY = [
1075
- F3.product,
1076
- F3.productLb,
1077
- F3.productName,
1078
- F3.productCode,
1079
- F3.productSpec,
1080
- F3.qty,
1081
- F3.mfgOrderCode,
1082
- F3.mfgOrder,
1083
- F3.mfgOrderLb,
1084
- F3.productionDate
1069
+ F2.product,
1070
+ F2.productLb,
1071
+ F2.productName,
1072
+ F2.productCode,
1073
+ F2.productSpec,
1074
+ F2.qty,
1075
+ F2.mfgOrderCode,
1076
+ F2.mfgOrder,
1077
+ F2.mfgOrderLb,
1078
+ F2.productionDate
1085
1079
  ];
1086
1080
  const fillFromOption = [
1087
1081
  {
1088
- optionField: F3.product,
1089
- toField: F3.product
1082
+ optionField: F2.product,
1083
+ toField: F2.product
1090
1084
  },
1091
1085
  {
1092
- optionField: F3.productName,
1093
- toField: F3.productName
1086
+ optionField: F2.productName,
1087
+ toField: F2.productName
1094
1088
  },
1095
1089
  {
1096
- optionField: F3.productCode,
1097
- toField: F3.productCode
1090
+ optionField: F2.productCode,
1091
+ toField: F2.productCode
1098
1092
  },
1099
1093
  {
1100
- optionField: F3.productSpec,
1101
- toField: F3.productSpec
1094
+ optionField: F2.productSpec,
1095
+ toField: F2.productSpec
1102
1096
  },
1103
1097
  {
1104
- optionField: F3.mfgOrder,
1105
- toField: F3.mfgOrder
1098
+ optionField: F2.mfgOrder,
1099
+ toField: F2.mfgOrder
1106
1100
  },
1107
1101
  {
1108
- optionField: F3.mfgOrderCode,
1102
+ optionField: F2.mfgOrderCode,
1109
1103
  //工单号
1110
- toField: F3.mfgOrderCode
1104
+ toField: F2.mfgOrderCode
1111
1105
  },
1112
1106
  {
1113
1107
  optionField: "real_start_date_",
1114
1108
  //生产日期
1115
- toField: F3.productionDate
1109
+ toField: F2.productionDate
1116
1110
  },
1117
1111
  {
1118
- optionField: F3.qty,
1119
- toField: F3.qty
1112
+ optionField: F2.qty,
1113
+ toField: F2.qty
1120
1114
  }
1121
1115
  ];
1122
1116
  function applyFillFromOption(A, B4) {
@@ -1130,38 +1124,29 @@ function applyFillFromOption(A, B4) {
1130
1124
  }
1131
1125
  function mapContainerRowsToOptions(data = []) {
1132
1126
  return data.map((item) => ({
1133
- label: item.__LABEL__ ?? item.name_ ?? String(item.id_ ?? item.id ?? ""),
1127
+ label: resolveLotDisplayLabel(item, item.name_),
1134
1128
  value: item.id_ || item.id,
1135
1129
  disabled: !!item.deleted_,
1136
1130
  _item: item
1137
1131
  }));
1138
1132
  }
1139
- async function fetchProductionContainerByName$1(name_) {
1140
- const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
1141
- {
1142
- modelCategory: "entity",
1143
- modelKey: "em_production_identification",
1144
- bsKey: "biz_get_production_identification"
1145
- },
1146
- {},
1147
- {
1148
- query: { "production_identification_type_.in": ["LOT", "SN"], name_ },
1149
- exp: "AND(production_identification_type_.in,name_)"
1150
- }
1151
- );
1152
- return normalizeContainerResult$1(res);
1153
- }
1154
- function normalizeContainerResult$1(res) {
1155
- if (!res) return void 0;
1156
- const data = res?.data ?? res;
1157
- if (Array.isArray(data)) return data[0];
1158
- if (typeof data === "object") return data;
1159
- return void 0;
1133
+ const SCAN_NOT_FOUND_MSG$1 = "扫描的物料批次不存在";
1134
+ function buildEntrustScanRow(record, parsed, fillData) {
1135
+ return {
1136
+ [F2.productionContainer]: record.lot_sn_id_ ?? record.production_container_id_,
1137
+ [F2.product]: record.product_id_,
1138
+ [F2.productName]: record.product_id_name_,
1139
+ [F2.productCode]: record.product_id_code_,
1140
+ [F2.productSpec]: record.product_id_spec_,
1141
+ [F2.mfgOrderCode]: record.mfg_order_code_,
1142
+ [F2.mfgOrder]: record.mfg_order_id_,
1143
+ [F2.qty]: parsed.qty ?? record.qty_,
1144
+ [F2.productionDate]: toDateOnly(record.production_date_),
1145
+ ...fillData
1146
+ };
1160
1147
  }
1161
1148
  class SterilizeBatchTableCore extends SubTableCore {
1162
- /** 触发扫码时的目标行 */
1163
- scanTargetRow;
1164
- /** 绘制UI相关工具,一期复用调拨表扫码弹窗 */
1149
+ /** 绘制UI相关工具,复用调拨表扫码弹窗 */
1165
1150
  get render() {
1166
1151
  return window.NocodeAdapter.allocateRender;
1167
1152
  }
@@ -1179,16 +1164,14 @@ class SterilizeBatchTableCore extends SubTableCore {
1179
1164
  calcSubTableActionMenu = (params) => {
1180
1165
  const { showDelBtn } = params;
1181
1166
  return [
1182
- // 一期暂不支持扫码
1183
- // {
1184
- // type: SubTableActionMenuTypeEnum.SUBTITLE,
1185
- // label: $t('sys.edhr.bizOperation'),
1186
- // },
1187
- // getMenuByAction(SubTableActionEnum.SCAN),
1188
- // getMenuByAction(SubTableActionEnum.CHANGE_PARSE_RULE),
1189
- // {
1190
- // type: SubTableActionMenuTypeEnum.DIVIDER,
1191
- // },
1167
+ {
1168
+ type: SubTableActionMenuTypeEnum.SUBTITLE,
1169
+ label: $t("sys.edhr.bizOperation")
1170
+ },
1171
+ getMenuByAction(SubTableActionEnum.SCAN),
1172
+ {
1173
+ type: SubTableActionMenuTypeEnum.DIVIDER
1174
+ },
1192
1175
  {
1193
1176
  type: SubTableActionMenuTypeEnum.SUBTITLE,
1194
1177
  label: $t("sys.edhr.editRow")
@@ -1203,26 +1186,14 @@ class SterilizeBatchTableCore extends SubTableCore {
1203
1186
  ] : []
1204
1187
  ].filter(Boolean);
1205
1188
  };
1206
- handleMenuClick(params) {
1207
- const { actionKey, rowData } = params;
1208
- if (actionKey === SubTableActionEnum.SCAN) {
1209
- this.scanTargetRow = rowData;
1210
- this.openScanModal();
1211
- return;
1212
- }
1213
- if (actionKey === SubTableActionEnum.CHANGE_PARSE_RULE) {
1214
- this.changeScanRule();
1215
- }
1216
- }
1217
1189
  handleFieldTd = (params) => {
1218
1190
  const { field, tdHandler } = params;
1219
- if (field === F3.productionContainer) {
1191
+ if (field === F2.productionContainer) {
1220
1192
  tdHandler.mergeTd({
1221
1193
  cellWidget: {
1222
1194
  props: {
1223
1195
  newSpecificConfig: {
1224
1196
  newOptions: []
1225
- // 禁用初始选项,数据源完全由 customLoader 提供
1226
1197
  }
1227
1198
  }
1228
1199
  }
@@ -1239,21 +1210,13 @@ class SterilizeBatchTableCore extends SubTableCore {
1239
1210
  }
1240
1211
  calcFieldDataSource = (params) => {
1241
1212
  const { field } = params;
1242
- if (field !== F3.productionContainer) return;
1213
+ if (field !== F2.productionContainer) return;
1243
1214
  const loader = async (loaderParams) => {
1244
1215
  const { mode, queryData = {}, pageNo = 1, pageSize = 100, ids = [] } = loaderParams;
1245
- const query = {
1246
- ...queryData,
1247
- is_rework_: 0,
1248
- "production_identification_type_.in": ["LOT", "SN"]
1249
- };
1216
+ const keyword = mode === "byIds" ? "" : extractKeywordFromQueryData(queryData) || "";
1217
+ const { queryData: query, exp } = composeProductionLotListQuery(queryData, keyword);
1250
1218
  if (mode === "byIds" && ids.length) {
1251
1219
  query["id_.in"] = ids;
1252
- } else {
1253
- const keyword = extractKeywordFromQueryData(queryData);
1254
- if (keyword && !query["name_.like"] && !query["name_.iLike"]) {
1255
- query["name_.like"] = keyword;
1256
- }
1257
1220
  }
1258
1221
  const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
1259
1222
  {
@@ -1263,6 +1226,7 @@ class SterilizeBatchTableCore extends SubTableCore {
1263
1226
  },
1264
1227
  {},
1265
1228
  {
1229
+ exp,
1266
1230
  query,
1267
1231
  pageNo,
1268
1232
  pageSize,
@@ -1270,11 +1234,14 @@ class SterilizeBatchTableCore extends SubTableCore {
1270
1234
  }
1271
1235
  );
1272
1236
  const data = res?.data || [];
1237
+ const dict = res?.dict;
1273
1238
  const totalCount = Number(res?.totalCount ?? data.length);
1274
1239
  const totalPage = Number(res?.totalPage ?? Math.max(1, Math.ceil(totalCount / pageSize)));
1275
1240
  const options = mapContainerRowsToOptions(data);
1276
1241
  if (mode === "byIds") {
1277
1242
  return {
1243
+ data,
1244
+ dict,
1278
1245
  options,
1279
1246
  finished: true,
1280
1247
  totalCount
@@ -1282,6 +1249,7 @@ class SterilizeBatchTableCore extends SubTableCore {
1282
1249
  }
1283
1250
  return {
1284
1251
  data,
1252
+ dict,
1285
1253
  options,
1286
1254
  finished: pageNo >= totalPage,
1287
1255
  totalCount,
@@ -1292,9 +1260,8 @@ class SterilizeBatchTableCore extends SubTableCore {
1292
1260
  };
1293
1261
  handleChange = (params) => {
1294
1262
  const { field, option, value, rowData } = params;
1295
- if (field !== F3.productionContainer) return;
1263
+ if (field !== F2.productionContainer) return;
1296
1264
  if (option) {
1297
- console.log(option);
1298
1265
  applyFillFromOption(rowData, option);
1299
1266
  return;
1300
1267
  }
@@ -1304,36 +1271,26 @@ class SterilizeBatchTableCore extends SubTableCore {
1304
1271
  });
1305
1272
  }
1306
1273
  };
1307
- async onScan({ str }) {
1308
- if (!this.scanRuleInfo) {
1309
- this.error({ content: $t("sys.edhr.mcTable.scanRuleNotFound") });
1274
+ async onScan(input) {
1275
+ const parsed = resolveScanParsedValue(input);
1276
+ if (!parsed || !hasProductionIdentificationScanKey(parsed)) {
1277
+ this.error({ content: PRODUCTION_IDENTIFICATION_SCAN_LOT_OR_UNIQUE_REQUIRED_MSG });
1310
1278
  return;
1311
1279
  }
1312
- const data = getParseRuleValue(str, this.scanRuleInfo.rules_);
1313
- const name = data.lot;
1314
- if (!name) {
1315
- this.warning({ content: "条码中未解析到批次号/SN" });
1280
+ const records = await matchProductionIdentificationScanRecords(parsed);
1281
+ if (!records.length) {
1282
+ this.error({ content: SCAN_NOT_FOUND_MSG$1 });
1316
1283
  return;
1317
1284
  }
1318
- let containerInfo;
1319
- try {
1320
- containerInfo = await fetchProductionContainerByName$1(name);
1321
- console.log(this.scanTargetRo);
1322
- } catch {
1323
- this.error({ content: "查询生产批次失败" });
1324
- return;
1325
- }
1326
- if (!containerInfo) {
1327
- this.error({ content: "未查询到匹配的生产批次" });
1328
- return;
1329
- }
1330
- const merged = { ...data, ...containerInfo };
1331
- this.tableData = [...this.showTableData, applyFillFromOption({}, merged)];
1285
+ const selected = await this.pickScanRecord(records);
1286
+ if (!selected) return;
1287
+ const row = buildEntrustScanRow(selected, parsed, resolveScanFillData(input));
1288
+ this.appendOrFillScanRow(row);
1332
1289
  }
1333
1290
  }
1334
- function mapRefRowsToOptions(data = [], labelKey = "name_") {
1291
+ function mapRefRowsToOptions(data = [], labelKey = "name_", displayRelatedParent = false) {
1335
1292
  return data.map((item) => ({
1336
- label: item.__LABEL__ ?? item[labelKey] ?? String(item.id_ ?? item.id ?? ""),
1293
+ label: displayRelatedParent ? resolveLotDisplayLabel(item, item[labelKey]) : item.__LABEL__ ?? item[labelKey] ?? String(item.id_ ?? item.id ?? ""),
1337
1294
  value: item.id_ || item.id,
1338
1295
  disabled: !!item.deleted_,
1339
1296
  _item: item
@@ -1342,18 +1299,10 @@ function mapRefRowsToOptions(data = [], labelKey = "name_") {
1342
1299
  function createProductionContainerLoader() {
1343
1300
  return async (loaderParams) => {
1344
1301
  const { mode, queryData = {}, pageNo = 1, pageSize = 100, ids = [] } = loaderParams;
1345
- const query = {
1346
- ...queryData,
1347
- is_rework_: 0,
1348
- "production_identification_type_.in": ["LOT", "SN"]
1349
- };
1302
+ const keyword = mode === "byIds" ? "" : extractKeywordFromQueryData(queryData) || "";
1303
+ const { queryData: query, exp } = composeProductionLotListQuery(queryData, keyword);
1350
1304
  if (mode === "byIds" && ids.length) {
1351
1305
  query["id_.in"] = ids;
1352
- } else {
1353
- const keyword = extractKeywordFromQueryData(queryData);
1354
- if (keyword && !query["name_.like"] && !query["name_.iLike"]) {
1355
- query["name_.like"] = keyword;
1356
- }
1357
1306
  }
1358
1307
  const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
1359
1308
  {
@@ -1363,6 +1312,7 @@ function createProductionContainerLoader() {
1363
1312
  },
1364
1313
  {},
1365
1314
  {
1315
+ exp,
1366
1316
  query,
1367
1317
  pageNo,
1368
1318
  pageSize,
@@ -1370,11 +1320,14 @@ function createProductionContainerLoader() {
1370
1320
  }
1371
1321
  );
1372
1322
  const data = res?.data || [];
1323
+ const dict = res?.dict;
1373
1324
  const totalCount = Number(res?.totalCount ?? data.length);
1374
1325
  const totalPage = Number(res?.totalPage ?? Math.max(1, Math.ceil(totalCount / pageSize)));
1375
- const options = mapRefRowsToOptions(data);
1326
+ const options = mapRefRowsToOptions(data, "name_", true);
1376
1327
  if (mode === "byIds") {
1377
1328
  return {
1329
+ data,
1330
+ dict,
1378
1331
  options,
1379
1332
  finished: true,
1380
1333
  totalCount
@@ -1382,6 +1335,7 @@ function createProductionContainerLoader() {
1382
1335
  }
1383
1336
  return {
1384
1337
  data,
1338
+ dict,
1385
1339
  options,
1386
1340
  finished: pageNo >= totalPage,
1387
1341
  totalCount,
@@ -1442,7 +1396,8 @@ function createMaterialContainerLoader() {
1442
1396
  const query = {
1443
1397
  ...queryData,
1444
1398
  "production_identification_type_.eq": "MATERIAL",
1445
- "production_identification_type_.isNull": null
1399
+ "production_identification_type_.isNull": null,
1400
+ "container_role_.ne": LOT_CONTAINER_ROLE.RELATED_PARENT
1446
1401
  };
1447
1402
  const keyword = query["material_no_.like"] ?? query["name_.like"];
1448
1403
  if (keyword) {
@@ -1460,7 +1415,7 @@ function createMaterialContainerLoader() {
1460
1415
  },
1461
1416
  {},
1462
1417
  {
1463
- exp: "OR(production_identification_type_.eq,production_identification_type_.isNull)",
1418
+ exp: "AND(OR(production_identification_type_.eq,production_identification_type_.isNull),container_role_.ne)",
1464
1419
  query,
1465
1420
  pageNo,
1466
1421
  pageSize
@@ -1488,35 +1443,47 @@ function createMaterialContainerLoader() {
1488
1443
  };
1489
1444
  };
1490
1445
  }
1491
- async function fetchProductionContainerByName(name_) {
1492
- const res = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
1493
- {
1494
- modelCategory: "entity",
1495
- modelKey: "em_production_identification",
1496
- bsKey: "biz_get_production_identification"
1497
- },
1498
- {},
1499
- {
1500
- query: { "production_identification_type_.in": ["LOT", "SN"], name_ },
1501
- exp: "AND(production_identification_type_.in,name_)"
1502
- }
1503
- );
1504
- return normalizeContainerResult(res);
1446
+ function isBlank$1(value) {
1447
+ return value === void 0 || value === null || value === "";
1505
1448
  }
1506
- function normalizeContainerResult(res) {
1507
- if (!res) return void 0;
1508
- const data = res?.data ?? res;
1509
- if (Array.isArray(data)) return data[0];
1510
- if (typeof data === "object") return data;
1511
- return void 0;
1449
+ const SCAN_NOT_FOUND_MSG = "扫描的批次/物料不存在";
1450
+ function isProductionLotOrSn(record) {
1451
+ const type = record.production_identification_type_;
1452
+ return type === "LOT" || type === "SN";
1512
1453
  }
1513
- function isBlank(value) {
1514
- return value === void 0 || value === null || value === "";
1454
+ function buildProductionContainerRow(record, parsed, fillData) {
1455
+ return {
1456
+ [F$7.productionContainer]: record.lot_sn_id_ ?? record.production_container_id_,
1457
+ [F$7.product]: record.product_id_,
1458
+ [F$7.productName]: record.product_id_name_,
1459
+ [F$7.productCode]: record.product_id_code_,
1460
+ [F$7.productSpec]: record.product_id_spec_,
1461
+ [F$7.mfgOrderCode]: record.mfg_order_code_,
1462
+ [F$7.qty]: parsed.qty ?? record.qty_,
1463
+ [F$7.productionDate]: toDateOnly(record.production_date_),
1464
+ [F$7.materialContainerNo]: void 0,
1465
+ [MATERIAL_CONTAINER_ID]: void 0,
1466
+ [F$7.mfgOrder]: void 0,
1467
+ ...fillData
1468
+ };
1469
+ }
1470
+ function buildMaterialContainerRow(record, parsed, fillData) {
1471
+ return {
1472
+ [F$7.materialContainerNo]: record.material_no_,
1473
+ [MATERIAL_CONTAINER_ID]: record.production_identification_id_,
1474
+ [F$7.product]: record.product_id_,
1475
+ [F$7.productName]: record.product_id_name_,
1476
+ [F$7.productCode]: record.product_id_code_,
1477
+ [F$7.productSpec]: record.product_id_spec_,
1478
+ [F$7.mfgOrderCode]: record.mfg_order_code_,
1479
+ [F$7.mfgOrder]: record.mfg_order_id_,
1480
+ [F$7.qty]: parsed.qty ?? record.qty_,
1481
+ [F$7.productionContainer]: void 0,
1482
+ ...fillData
1483
+ };
1515
1484
  }
1516
1485
  class PretreatmentListTableCore extends ProfileDrivenSubTableCore {
1517
- /** 触发扫码时的目标行 */
1518
- scanTargetRow;
1519
- /** 绘制UI相关工具,一期复用调拨表扫码弹窗 */
1486
+ /** 绘制UI相关工具,复用调拨表扫码弹窗 */
1520
1487
  get render() {
1521
1488
  return window.NocodeAdapter.allocateRender;
1522
1489
  }
@@ -1534,6 +1501,14 @@ class PretreatmentListTableCore extends ProfileDrivenSubTableCore {
1534
1501
  calcSubTableActionMenu = (params) => {
1535
1502
  const { showDelBtn } = params;
1536
1503
  return [
1504
+ {
1505
+ type: SubTableActionMenuTypeEnum.SUBTITLE,
1506
+ label: $t("sys.edhr.bizOperation")
1507
+ },
1508
+ getMenuByAction(SubTableActionEnum.SCAN),
1509
+ {
1510
+ type: SubTableActionMenuTypeEnum.DIVIDER
1511
+ },
1537
1512
  {
1538
1513
  type: SubTableActionMenuTypeEnum.SUBTITLE,
1539
1514
  label: $t("sys.edhr.editRow")
@@ -1548,79 +1523,303 @@ class PretreatmentListTableCore extends ProfileDrivenSubTableCore {
1548
1523
  ] : []
1549
1524
  ].filter(Boolean);
1550
1525
  };
1551
- handleMenuClick(params) {
1552
- const { actionKey, rowData } = params;
1553
- if (actionKey === SubTableActionEnum.SCAN) {
1554
- this.scanTargetRow = rowData;
1555
- this.openScanModal();
1556
- return;
1557
- }
1558
- if (actionKey === SubTableActionEnum.CHANGE_PARSE_RULE) {
1559
- this.changeScanRule();
1560
- }
1561
- }
1562
1526
  calcFieldStatus(params) {
1563
1527
  const result = super.calcFieldStatus(params);
1564
1528
  const { field, rowData } = params;
1565
- if (field === F$4.product) {
1529
+ if (field === F$7.product) {
1566
1530
  result.disabled = !isProductManuallyEditable(rowData);
1567
1531
  }
1568
1532
  return result;
1569
1533
  }
1570
1534
  calcFieldDataSource = (params) => {
1571
1535
  const { field } = params;
1572
- if (field === F$4.productionContainer) return createProductionContainerLoader();
1573
- if (field === F$4.mfgOrder) return createMfgOrderLoader();
1574
- if (field === F$4.materialContainerNo) return createMaterialContainerLoader();
1536
+ if (field === F$7.productionContainer) return createProductionContainerLoader();
1537
+ if (field === F$7.mfgOrder) return createMfgOrderLoader();
1538
+ if (field === F$7.materialContainerNo) return createMaterialContainerLoader();
1575
1539
  };
1576
1540
  handleChange(params) {
1577
1541
  super.handleChange(params);
1578
1542
  const { field, option, value, rowData } = params;
1579
- if (!option || isBlank(value)) return;
1543
+ if (!option || isBlank$1(value)) return;
1580
1544
  const source = option._item ?? option;
1581
- if (field === F$4.mfgOrder) {
1545
+ if (field === F$7.mfgOrder) {
1582
1546
  applyFillFromMfgOrderOption(rowData, source);
1583
1547
  return;
1584
1548
  }
1585
- if (field === F$4.productionContainer || field === F$4.materialContainerNo) {
1549
+ if (field === F$7.productionContainer || field === F$7.materialContainerNo) {
1586
1550
  applyFillFromOption$1(rowData, source);
1587
1551
  return;
1588
1552
  }
1589
- if (field === F$4.product) {
1553
+ if (field === F$7.product) {
1590
1554
  applyFillFromProductOption(rowData, source);
1591
1555
  }
1592
1556
  }
1593
- async onScan({ str }) {
1594
- if (!this.scanRuleInfo) {
1595
- this.error({ content: $t("sys.edhr.mcTable.scanRuleNotFound") });
1557
+ async onScan(input) {
1558
+ const parsed = resolveScanParsedValue(input);
1559
+ if (!parsed || !hasProductionIdentificationScanKey(parsed)) {
1560
+ this.error({ content: PRODUCTION_IDENTIFICATION_SCAN_LOT_OR_UNIQUE_REQUIRED_MSG });
1596
1561
  return;
1597
1562
  }
1598
- const data = getParseRuleValue(str, this.scanRuleInfo.rules_);
1599
- const name = data.lot;
1600
- if (!name) {
1601
- this.warning({ content: "条码中未解析到批次号/SN" });
1563
+ const records = await matchProductionIdentificationScanRecords(parsed);
1564
+ if (!records.length) {
1565
+ this.error({ content: SCAN_NOT_FOUND_MSG });
1602
1566
  return;
1603
1567
  }
1604
- let containerInfo;
1605
- try {
1606
- containerInfo = await fetchProductionContainerByName(name);
1607
- } catch {
1608
- this.error({ content: "查询生产批次失败" });
1568
+ const selected = await this.pickScanRecord(records);
1569
+ if (!selected) return;
1570
+ const fillData = resolveScanFillData(input);
1571
+ const row = isProductionLotOrSn(selected) ? buildProductionContainerRow(selected, parsed, fillData) : buildMaterialContainerRow(selected, parsed, fillData);
1572
+ this.appendOrFillScanRow(row);
1573
+ }
1574
+ }
1575
+ function buildWarehouseInScanRow(record, parsed, fillData) {
1576
+ const row = {
1577
+ [F$8.product]: record.product_id_,
1578
+ [F$8.productName]: record.product_id_name_,
1579
+ [F$8.productCode]: record.product_id_code_,
1580
+ [F$8.productSpec]: record.product_id_spec_,
1581
+ [F$8.materialNo]: record.material_no_,
1582
+ [F$8.materialNoId]: record.production_identification_id_,
1583
+ [F$8.mfgOrder]: record.mfg_order_id_,
1584
+ [F$8.lotSn]: record.lot_sn_id_,
1585
+ [F$8.uniqueCode]: record.unique_code_,
1586
+ [F$8.reInspectionDate]: record.re_inspection_date_,
1587
+ [F$8.qty]: resolveScanQty(parsed.qty, record.qty_),
1588
+ ...fillData
1589
+ };
1590
+ const validityFromRecord = record.validity_;
1591
+ if (parsed.expiration && row[F$8.validity] == null) {
1592
+ row[F$8.validity] = toDateOnly(parsed.expiration);
1593
+ } else if (validityFromRecord != null && row[F$8.validity] == null) {
1594
+ row[F$8.validity] = toDateOnly(validityFromRecord);
1595
+ }
1596
+ return row;
1597
+ }
1598
+ function isBlank(value) {
1599
+ return value === void 0 || value === null || value === "";
1600
+ }
1601
+ function resolveOptionRecord(option) {
1602
+ if (!option) return void 0;
1603
+ const nested = option._item;
1604
+ if (nested && typeof nested === "object") {
1605
+ return nested;
1606
+ }
1607
+ return option;
1608
+ }
1609
+ class WarehouseInTableCore extends ProfileDrivenSubTableCore {
1610
+ isEmptyScanRow(row) {
1611
+ return isProductBatchEmptyRow(row);
1612
+ }
1613
+ handleFieldTd = (params) => {
1614
+ const { field, tdHandler } = params;
1615
+ if (field === F$8.product) {
1616
+ const current = tdHandler.td.cellWidget?.props;
1617
+ const searchFields = current?.quickSearchField ?? PRODUCT_QUICK_SEARCH_FIELDS;
1618
+ tdHandler.mergeTd({
1619
+ cellWidget: {
1620
+ props: {
1621
+ quickSearchable: searchFields.length > 0,
1622
+ ...current?.quickSearchField !== void 0 ? {} : {
1623
+ quickSearchField: [...PRODUCT_QUICK_SEARCH_FIELDS],
1624
+ quickSearchExp: PRODUCT_QUICK_SEARCH_EXP
1625
+ }
1626
+ }
1627
+ }
1628
+ });
1629
+ }
1630
+ super.handleFieldTd(params);
1631
+ };
1632
+ calcFieldStatus(params) {
1633
+ const result = super.calcFieldStatus(params);
1634
+ if (params.field === F$8.product) {
1635
+ result.disabled = !isProductManuallyEditable$1(params.rowData);
1636
+ }
1637
+ return result;
1638
+ }
1639
+ handleChange(params) {
1640
+ super.handleChange(params);
1641
+ const { field, value, option, rowData } = params;
1642
+ if (isBlank(value) || !option) return;
1643
+ const source = resolveOptionRecord(option);
1644
+ if (!source) return;
1645
+ if (field === F$8.materialNo) {
1646
+ applyFillFromMaterialNoOption(rowData, source);
1609
1647
  return;
1610
1648
  }
1611
- if (!containerInfo) {
1612
- this.error({ content: "未查询到匹配的生产批次" });
1649
+ if (field === F$8.product) {
1650
+ applyFillFromProductOption$1(rowData, source);
1651
+ }
1652
+ }
1653
+ calcSubTableActionMenu = (params) => {
1654
+ const { showDelBtn } = params;
1655
+ return [
1656
+ {
1657
+ type: SubTableActionMenuTypeEnum.SUBTITLE,
1658
+ label: $t("sys.edhr.bizOperation")
1659
+ },
1660
+ getMenuByAction(SubTableActionEnum.SCAN),
1661
+ {
1662
+ type: SubTableActionMenuTypeEnum.DIVIDER
1663
+ },
1664
+ {
1665
+ type: SubTableActionMenuTypeEnum.SUBTITLE,
1666
+ label: $t("sys.edhr.editRow")
1667
+ },
1668
+ getMenuByAction(SubTableActionEnum.Insert1RowAfter),
1669
+ getCopySubMenu(),
1670
+ getInsertSubMenu(),
1671
+ ...showDelBtn ? [
1672
+ {
1673
+ type: SubTableActionMenuTypeEnum.DIVIDER
1674
+ },
1675
+ getMenuByAction(SubTableActionEnum.DeleteRowCurrent)
1676
+ ] : []
1677
+ ].filter(Boolean);
1678
+ };
1679
+ async onScan(input) {
1680
+ const parsed = resolveScanParsedValue(input);
1681
+ if (!parsed || !hasProductionIdentificationScanKey(parsed)) {
1682
+ this.error({ content: PRODUCTION_IDENTIFICATION_SCAN_LOT_OR_UNIQUE_REQUIRED_MSG });
1613
1683
  return;
1614
1684
  }
1615
- const merged = { ...data, ...containerInfo };
1616
- const applyScanFill = (row) => {
1617
- applyFillFromOption$1(row, merged);
1618
- CLEAR_ON_MATERIAL_CONTAINER_SELECT.forEach((key) => {
1619
- row[key] = void 0;
1685
+ const records = await matchProductionIdentificationScanRecords(parsed);
1686
+ if (!records.length) {
1687
+ this.error({ content: PRODUCTION_IDENTIFICATION_SCAN_NOT_FOUND_MSG });
1688
+ return;
1689
+ }
1690
+ const selected = await this.pickScanRecord(records);
1691
+ if (!selected) return;
1692
+ const row = buildWarehouseInScanRow(selected, parsed, resolveScanFillData(input));
1693
+ this.appendOrFillScanRow(row);
1694
+ }
1695
+ }
1696
+ function isSameMaterialBatch(row, record) {
1697
+ if (row[F$9.product] !== record.product_id_) return false;
1698
+ const rowBatchId = row[F$9.materialNoId];
1699
+ const recordBatchId = record.production_identification_id_;
1700
+ if (rowBatchId && recordBatchId) return rowBatchId === recordBatchId;
1701
+ const rowBatchNo = row[F$9.materialNo];
1702
+ const recordBatchNo = record.material_no_ ?? record.name_;
1703
+ return Boolean(rowBatchNo && recordBatchNo && rowBatchNo === recordBatchNo);
1704
+ }
1705
+ function buildWarehouseOutScanRow(record, parsed, fillData, qty) {
1706
+ const row = {
1707
+ [F$9.inventory]: record.id_,
1708
+ [F$9.product]: record.product_id_,
1709
+ [F$9.productName]: record.product_id_name_,
1710
+ [F$9.productCode]: record.product_id_code_,
1711
+ [F$9.productSpec]: record.product_id_spec_,
1712
+ [F$9.materialNo]: record.material_no_,
1713
+ [F$9.materialNoId]: record.production_identification_id_,
1714
+ [F$9.warehouse]: record.warehouse_id_,
1715
+ [F$9.location]: record.location_id_,
1716
+ [F$9.mfgOrder]: record.mfg_order_id_,
1717
+ [F$9.lotSn]: record.lot_sn_id_,
1718
+ [F$9.uniqueCode]: record.unique_code_,
1719
+ [F$9.reInspectionDate]: record.re_inspection_date_,
1720
+ [F$9.qty]: qty,
1721
+ ...fillData
1722
+ };
1723
+ const validityFromRecord = record.validate_ ?? record.validity_;
1724
+ if (parsed.expiration) {
1725
+ row[F$9.validity] = toDateOnly(parsed.expiration);
1726
+ } else if (validityFromRecord != null) {
1727
+ row[F$9.validity] = toDateOnly(validityFromRecord);
1728
+ }
1729
+ return row;
1730
+ }
1731
+ class WarehouseOutTableCore extends ProfileDrivenSubTableCore {
1732
+ get warehouseId() {
1733
+ return this.factory.ctx.paramsConfig?.warehouseId;
1734
+ }
1735
+ isEmptyScanRow(row) {
1736
+ return isProductBatchEmptyRow(row);
1737
+ }
1738
+ handleFieldTd = (params) => {
1739
+ const { field, tdHandler } = params;
1740
+ if (field === F$9.product) {
1741
+ tdHandler.mergeTd({
1742
+ cellWidget: {
1743
+ props: {
1744
+ customRenderTag: "allocateProduct",
1745
+ newSpecificConfig: {
1746
+ newOptions: []
1747
+ }
1748
+ }
1749
+ }
1620
1750
  });
1621
- return row;
1622
- };
1623
- this.tableData = [...this.showTableData, applyScanFill({})];
1751
+ }
1752
+ super.handleFieldTd(params);
1753
+ };
1754
+ calcFieldQuery = (params) => {
1755
+ const { field } = params;
1756
+ if (field === F$9.product) {
1757
+ return {
1758
+ warehouse_id_: this.warehouseId
1759
+ };
1760
+ }
1761
+ };
1762
+ calcSubTableActionMenu = (params) => {
1763
+ const { showDelBtn } = params;
1764
+ return [
1765
+ {
1766
+ type: SubTableActionMenuTypeEnum.SUBTITLE,
1767
+ label: $t("sys.edhr.bizOperation")
1768
+ },
1769
+ getMenuByAction(SubTableActionEnum.SCAN),
1770
+ {
1771
+ type: SubTableActionMenuTypeEnum.DIVIDER
1772
+ },
1773
+ {
1774
+ type: SubTableActionMenuTypeEnum.SUBTITLE,
1775
+ label: $t("sys.edhr.editRow")
1776
+ },
1777
+ getMenuByAction(SubTableActionEnum.Insert1RowAfter),
1778
+ getCopySubMenu(),
1779
+ getInsertSubMenu(),
1780
+ ...showDelBtn ? [
1781
+ {
1782
+ type: SubTableActionMenuTypeEnum.DIVIDER
1783
+ },
1784
+ getMenuByAction(SubTableActionEnum.DeleteRowCurrent)
1785
+ ] : []
1786
+ ].filter(Boolean);
1787
+ };
1788
+ handleChange(params) {
1789
+ super.handleChange(params);
1790
+ const { field, value, option, rowData } = params;
1791
+ if (field !== F$9.product || !option || value === void 0 || value === null || value === "") {
1792
+ return;
1793
+ }
1794
+ for (const { optionField, toField } of FILL_FROM_INVENTORY_OPTION$5) {
1795
+ rowData[toField] = option[optionField];
1796
+ }
1797
+ }
1798
+ async onScan(input) {
1799
+ const parsed = resolveScanParsedValue(input);
1800
+ if (!parsed || !hasLotOrUniqueCode(parsed)) {
1801
+ this.error({ content: SCAN_LOT_OR_UNIQUE_REQUIRED_MSG });
1802
+ return;
1803
+ }
1804
+ const records = await matchInventoryScanRecords(parsed, this.warehouseId);
1805
+ if (!records.length) {
1806
+ this.error({ content: SCAN_NOT_FOUND_MSG$2 });
1807
+ return;
1808
+ }
1809
+ const selected = await this.pickScanRecord(records);
1810
+ if (!selected) return;
1811
+ const scanQty = resolveScanQty(parsed.qty, selected.qty_);
1812
+ const fillData = resolveScanFillData(input);
1813
+ const visibleRows = this.showTableData;
1814
+ const existIndex = visibleRows.findIndex((row2) => isSameMaterialBatch(row2, selected));
1815
+ if (existIndex >= 0) {
1816
+ const existRow = visibleRows[existIndex];
1817
+ existRow[F$9.qty] = Number(existRow[F$9.qty] ?? 0) + scanQty;
1818
+ this.tableData = [...visibleRows];
1819
+ return;
1820
+ }
1821
+ const row = buildWarehouseOutScanRow(selected, parsed, fillData, scanQty);
1822
+ this.appendOrFillScanRow(row);
1624
1823
  }
1625
1824
  }
1626
1825
  function getClassByType(type) {
@@ -1751,6 +1950,20 @@ class SubTableCoreFactory {
1751
1950
  await Promise.all(Object.values(this.coreMap).map(async (core) => core.beforeBtnClick(params)));
1752
1951
  }
1753
1952
  }
1953
+ function pickMainModelDisplay(dataCenter, modelKey) {
1954
+ for (const item of Object.values(dataCenter || {})) {
1955
+ const props = item?.cellWidget?.props || item?.props;
1956
+ const name = props?.newSpecificConfig?.newModelName;
1957
+ if (!name) continue;
1958
+ if (props.subFieldKey) continue;
1959
+ if (modelKey && props.modelKey && props.modelKey !== modelKey) continue;
1960
+ return {
1961
+ showModelName: name,
1962
+ showModelKey: props.modelKey || modelKey || ""
1963
+ };
1964
+ }
1965
+ return { showModelName: "", showModelKey: modelKey || "" };
1966
+ }
1754
1967
  function useRenderPageFactory(props, payload) {
1755
1968
  const counter = ref(0);
1756
1969
  const finisher = ref(0);
@@ -1767,6 +1980,7 @@ function useRenderPageFactory(props, payload) {
1767
1980
  const { getConsumeData } = useMaterialBalance();
1768
1981
  const validationSyncStops = /* @__PURE__ */ new Map();
1769
1982
  const validationSuppressUntil = /* @__PURE__ */ new Map();
1983
+ const mcRuntimeStops = /* @__PURE__ */ new Map();
1770
1984
  function unbindFormValidationSync(uniqueId) {
1771
1985
  validationSyncStops.get(uniqueId)?.forEach((stop) => stop());
1772
1986
  validationSyncStops.delete(uniqueId);
@@ -1793,6 +2007,61 @@ function useRenderPageFactory(props, payload) {
1793
2007
  );
1794
2008
  validationSyncStops.set(uniqueId, stops);
1795
2009
  }
2010
+ function unbindMcRuntime(uniqueId) {
2011
+ const stops = mcRuntimeStops.get(uniqueId);
2012
+ if (!stops) return;
2013
+ stops.forEach((stop) => stop());
2014
+ mcRuntimeStops.delete(uniqueId);
2015
+ }
2016
+ function destroyMcModals() {
2017
+ MaterialConsumeTableController.render?.destroyAllModals();
2018
+ }
2019
+ function clearMcRuntime() {
2020
+ [...mcRuntimeStops.keys()].forEach(unbindMcRuntime);
2021
+ destroyMcModals();
2022
+ }
2023
+ function bindMcRuntime(uniqueId, dataStatus) {
2024
+ unbindMcRuntime(uniqueId);
2025
+ const paper = dataCenterMap.value[uniqueId]?.[ComponentTypeEnum.PAPER];
2026
+ const mcList = paper?.props?.materialConsumeTableList ?? [];
2027
+ if (!mcList.length) return;
2028
+ const tmplBomC = tmplBomCMap.value[uniqueId];
2029
+ if (!tmplBomC) return;
2030
+ const stops = [];
2031
+ for (const item of mcList) {
2032
+ const controller = tmplBomC.tableControllers[item.tableKey];
2033
+ if (!controller) continue;
2034
+ const field = item.masterSubField;
2035
+ controller.bindRuntime({
2036
+ tableDataRef: computed({
2037
+ get: () => formStateMap.value[uniqueId]?.[field] ?? [],
2038
+ set: (val) => {
2039
+ if (formStateMap.value[uniqueId]) {
2040
+ formStateMap.value[uniqueId][field] = val;
2041
+ }
2042
+ updatePageData(uniqueId);
2043
+ }
2044
+ }),
2045
+ mainFormState: computed(() => formStateMap.value[uniqueId] ?? {}),
2046
+ dataStatus,
2047
+ defaultRowData: renderUtils.getDefaultValueInfo({
2048
+ defaultDataMap: defaultDataMap.value[uniqueId],
2049
+ key: field
2050
+ })
2051
+ });
2052
+ stops.push(
2053
+ watch(
2054
+ () => controller.materialNoNum,
2055
+ () => {
2056
+ if (controller.dataStatus === "SUBMIT") return;
2057
+ controller.syncQtyRequiredFromBom();
2058
+ },
2059
+ { immediate: true }
2060
+ )
2061
+ );
2062
+ }
2063
+ if (stops.length) mcRuntimeStops.set(uniqueId, stops);
2064
+ }
1796
2065
  const callbackName = {
1797
2066
  template: requestTemplateInfo,
1798
2067
  instance: requestSelfInfo,
@@ -1808,7 +2077,7 @@ function useRenderPageFactory(props, payload) {
1808
2077
  });
1809
2078
  watch(
1810
2079
  [() => props.selfId, () => counter.value],
1811
- async ([newRequestId, _2]) => {
2080
+ async ([newRequestId, _3]) => {
1812
2081
  console.log("aaaaaaaaaa", newRequestId);
1813
2082
  if (isEmpty(newRequestId)) {
1814
2083
  invalidateFetch();
@@ -1834,6 +2103,7 @@ function useRenderPageFactory(props, payload) {
1834
2103
  selfInfoList.value.push(res.selfInfo);
1835
2104
  registerFormValidationContext(res.basicInfo.uniqueId);
1836
2105
  bindFormValidationSync(res.basicInfo.uniqueId);
2106
+ bindMcRuntime(res.basicInfo.uniqueId, res.selfInfo?.dataStatus);
1837
2107
  }
1838
2108
  });
1839
2109
  console.log(
@@ -1918,8 +2188,18 @@ function useRenderPageFactory(props, payload) {
1918
2188
  btnModelType = fillModeType;
1919
2189
  }
1920
2190
  }
2191
+ const rawTxnConfig = selfInfo?.txnConfig;
2192
+ let txnConfig = rawTxnConfig;
2193
+ if (typeof rawTxnConfig === "string") {
2194
+ try {
2195
+ txnConfig = JSON.parse(rawTxnConfig);
2196
+ } catch {
2197
+ txnConfig = void 0;
2198
+ }
2199
+ }
1921
2200
  const paramsConfig = {
1922
2201
  ...JSON.parse(selfInfo.params || "{}"),
2202
+ ...txnConfig == null ? {} : { txnConfig },
1923
2203
  ...payload.paramExtraProps || {}
1924
2204
  };
1925
2205
  if (paramsConfig?._gct_useDynRowHeight_) {
@@ -2107,7 +2387,9 @@ function useRenderPageFactory(props, payload) {
2107
2387
  await tmplBomC.init({
2108
2388
  formInstBom: selfInfo.formInstBom,
2109
2389
  operationId: paramsConfig?.routingOperationId,
2110
- materialNo
2390
+ materialNo,
2391
+ productQty: paramsConfig?.productQty
2392
+ // 接收数量
2111
2393
  // relatedLotNo: paramsConfig?.relatedLotNo,
2112
2394
  });
2113
2395
  const materialConsumeData = tmplBomC.calcFormState(paper);
@@ -2227,8 +2509,8 @@ function useRenderPageFactory(props, payload) {
2227
2509
  paramsConfig,
2228
2510
  instanceId: id,
2229
2511
  subTableInfo
2230
- }).catch((e) => {
2231
- console.error("Error in requestCustomSourceData:", e);
2512
+ }).catch((e2) => {
2513
+ console.error("Error in requestCustomSourceData:", e2);
2232
2514
  return null;
2233
2515
  }),
2234
2516
  transformUtils.getEventInitDataLoad({
@@ -2243,8 +2525,8 @@ function useRenderPageFactory(props, payload) {
2243
2525
  findBasicInsInfo,
2244
2526
  findFormInsInfo
2245
2527
  }
2246
- }).catch((e) => {
2247
- console.error("Error in getEventInitDataLoad:", e);
2528
+ }).catch((e2) => {
2529
+ console.error("Error in getEventInitDataLoad:", e2);
2248
2530
  return null;
2249
2531
  })
2250
2532
  ]);
@@ -2324,6 +2606,8 @@ function useRenderPageFactory(props, payload) {
2324
2606
  annRowDetails: [],
2325
2607
  validatorLocationList: [],
2326
2608
  validatorMessageMap: {},
2609
+ mcValidatorLocationList: [],
2610
+ mcValidatorMessageMap: {},
2327
2611
  mobileTdIdGroups: fieldInfoMap.tdIdGroups,
2328
2612
  mobileSelectTdId: void 0,
2329
2613
  contentHighlight: paramsConfig?._gct_nocode_of_instance_id_ === props.selfId ? {
@@ -2332,7 +2616,9 @@ function useRenderPageFactory(props, payload) {
2332
2616
  )
2333
2617
  } : {},
2334
2618
  productSearchFields: payload?.deviceConfig?.defaultProductSearchFields,
2335
- showPrintFieldBg: paramsConfig?.showPrintFieldBg
2619
+ showPrintFieldBg: paramsConfig?.showPrintFieldBg,
2620
+ paramsConfig,
2621
+ instanceStatus: selfInfo.instanceStatus
2336
2622
  },
2337
2623
  selfInfo: {
2338
2624
  ...selfInfo,
@@ -2342,6 +2628,7 @@ function useRenderPageFactory(props, payload) {
2342
2628
  foreignFields: fieldInfoMap.foreignFields,
2343
2629
  subModelFields: fieldInfoMap.subModelFields,
2344
2630
  appendixFields: fieldInfoMap.useAppendixFields,
2631
+ signatureFields: fieldInfoMap.useSignatureFields,
2345
2632
  subTableInfo
2346
2633
  }
2347
2634
  }
@@ -2351,8 +2638,10 @@ function useRenderPageFactory(props, payload) {
2351
2638
  function clear() {
2352
2639
  basicInfoList.value.forEach((info) => {
2353
2640
  unbindFormValidationSync(info.uniqueId);
2641
+ unbindMcRuntime(info.uniqueId);
2354
2642
  unregisterValidationContext(info.uniqueId);
2355
2643
  });
2644
+ clearMcRuntime();
2356
2645
  clearFormRules();
2357
2646
  dataCenterMap.value = {};
2358
2647
  pageDataMap.value = {};
@@ -2372,11 +2661,11 @@ function useRenderPageFactory(props, payload) {
2372
2661
  if (info.uniqueId !== uniqueId) return;
2373
2662
  const prevLocations = info.validatorLocationList ?? [];
2374
2663
  const prevMap = info.validatorMessageMap ?? {};
2375
- const sameLocations = prevLocations.length === nextLocations.length && nextLocations.every((k, i) => k === prevLocations[i]);
2376
- const sameMessages = sameLocations && nextLocations.every((k) => {
2377
- const a10 = prevMap[k];
2378
- const b2 = map[k];
2379
- return JSON.stringify(a10) === JSON.stringify(b2);
2664
+ const sameLocations = prevLocations.length === nextLocations.length && nextLocations.every((k2, i) => k2 === prevLocations[i]);
2665
+ const sameMessages = sameLocations && nextLocations.every((k2) => {
2666
+ const a6 = prevMap[k2];
2667
+ const b4 = map[k2];
2668
+ return JSON.stringify(a6) === JSON.stringify(b4);
2380
2669
  });
2381
2670
  if (sameMessages) return;
2382
2671
  closeValidatorPopovers();
@@ -2384,9 +2673,29 @@ function useRenderPageFactory(props, payload) {
2384
2673
  info.validatorMessageMap = map;
2385
2674
  });
2386
2675
  }
2676
+ function applyMcValidatorComments(uniqueId, comments) {
2677
+ const map = comments && Object.keys(comments).length ? comments : {};
2678
+ const nextLocations = Object.keys(map);
2679
+ basicInfoList.value.forEach((info) => {
2680
+ if (info.uniqueId !== uniqueId) return;
2681
+ const prevLocations = info.mcValidatorLocationList ?? [];
2682
+ const prevMap = info.mcValidatorMessageMap ?? {};
2683
+ const sameLocations = prevLocations.length === nextLocations.length && nextLocations.every((k2, i) => k2 === prevLocations[i]);
2684
+ const sameMessages = sameLocations && nextLocations.every((k2) => {
2685
+ const a6 = prevMap[k2];
2686
+ const b4 = map[k2];
2687
+ return JSON.stringify(a6) === JSON.stringify(b4);
2688
+ });
2689
+ if (sameMessages) return;
2690
+ closeValidatorPopovers();
2691
+ info.mcValidatorLocationList = nextLocations;
2692
+ info.mcValidatorMessageMap = map;
2693
+ });
2694
+ }
2387
2695
  function registerFormValidationContext(uniqueId) {
2388
2696
  registerValidationContext({
2389
2697
  uniqueId,
2698
+ platformType: payload.platformType,
2390
2699
  getFormData: () => formStateMap.value?.[uniqueId] ?? {},
2391
2700
  getPaper: () => dataCenterMap.value?.[uniqueId]?.[ComponentTypeEnum.PAPER],
2392
2701
  getKeepExceptionHighlight: () => {
@@ -2441,14 +2750,31 @@ function useRenderPageFactory(props, payload) {
2441
2750
  const res = await validate(formState, dataCenter[ComponentTypeEnum.PAPER], uniqueId);
2442
2751
  if (bomC) {
2443
2752
  const bomRes = await bomC.submitValidate();
2753
+ applyMcValidatorComments(uniqueId, bomRes.fields ?? null);
2444
2754
  if (!bomRes.isValid) {
2445
2755
  merge(res, bomRes);
2446
- const info = basicInfoList.value.find((item) => item.uniqueId === uniqueId);
2447
- const current = {
2756
+ return res;
2757
+ }
2758
+ const paper = dataCenter?.[ComponentTypeEnum.PAPER];
2759
+ const info = basicInfoList.value.find((item) => item.uniqueId === uniqueId);
2760
+ const { showModelName, showModelKey } = pickMainModelDisplay(dataCenter, info?.modelKey);
2761
+ const objErrs = await validateObjectBomQtyOnSubmit({
2762
+ formState: formState ?? {},
2763
+ objectFieldList: paper?.props?.objectFieldList,
2764
+ formInstBom: bomC.formInstBom,
2765
+ showModelKey
2766
+ });
2767
+ if (objErrs.length) {
2768
+ const fields = {};
2769
+ objErrs.forEach((e2) => {
2770
+ (fields[e2.field] ??= []).push(e2);
2771
+ });
2772
+ const objectBomRes = { isValid: false, fields };
2773
+ merge(res, objectBomRes);
2774
+ applyValidatorComments(uniqueId, {
2448
2775
  ...info?.validatorMessageMap ?? {},
2449
- ...bomRes.fields ?? {}
2450
- };
2451
- applyValidatorComments(uniqueId, Object.keys(current).length ? current : null);
2776
+ ...fields
2777
+ });
2452
2778
  return res;
2453
2779
  }
2454
2780
  }
@@ -2493,6 +2819,8 @@ function useRenderPageFactory(props, payload) {
2493
2819
  if (status) {
2494
2820
  info.validatorLocationList = [];
2495
2821
  info.validatorMessageMap = {};
2822
+ info.mcValidatorLocationList = [];
2823
+ info.mcValidatorMessageMap = {};
2496
2824
  closeValidatorPopovers();
2497
2825
  }
2498
2826
  }
@@ -2566,7 +2894,10 @@ function useRenderPageFactory(props, payload) {
2566
2894
  viewMode: RenderModeEnum.ViewMode,
2567
2895
  dataStatus: selfInfo.dataStatus
2568
2896
  });
2569
- const idsFormState = transformUtils.getFormDataIdsMap(newFormState);
2897
+ const signatureKeys = (currentSelfInfo.newBackupInfo.signatureFields || []).map(
2898
+ (item) => item.fieldId
2899
+ );
2900
+ const idsFormState = transformUtils.getFormDataIdsMap(newFormState, signatureKeys);
2570
2901
  merge(formStateMap.value?.[uniqueId], idsFormState);
2571
2902
  if (payload.afterProcessData && typeof payload.afterProcessData === "function") {
2572
2903
  payload.afterProcessData(formStateMap.value?.[uniqueId]);
@@ -2596,6 +2927,9 @@ function useRenderPageFactory(props, payload) {
2596
2927
  const modelValue = formState?.[fieldId];
2597
2928
  return modelValue ? modelValue.split(",") : [];
2598
2929
  };
2930
+ onUnmounted(() => {
2931
+ clearMcRuntime();
2932
+ });
2599
2933
  return {
2600
2934
  counter,
2601
2935
  finisher,
@@ -2720,7 +3054,7 @@ function useEbrWikiFactoryV2(props, payload) {
2720
3054
  }
2721
3055
  watch(
2722
3056
  [() => props.materialNo, () => edhrCounter.value],
2723
- async ([newMaterialNo, _2]) => {
3057
+ async ([newMaterialNo, _3]) => {
2724
3058
  if (isEmpty(newMaterialNo)) return;
2725
3059
  loading.value = true;
2726
3060
  clear();
@@ -2899,7 +3233,7 @@ function useEbrWikiFactoryV2(props, payload) {
2899
3233
  );
2900
3234
  watch(
2901
3235
  [() => selectSelfInfo.value, () => instanceCounter.value],
2902
- ([newSelectSelfInfo, _2]) => {
3236
+ ([newSelectSelfInfo, _3]) => {
2903
3237
  if (newSelectSelfInfo && payload.pageType === "record-change") {
2904
3238
  emitter.emit(EmitterEnum.__on_select_ebr_doc_instance_id, {
2905
3239
  instanceId: newSelectSelfInfo.id
@@ -3122,27 +3456,27 @@ function useFormulaExpWatcher(options) {
3122
3456
  let calcReqId = 0;
3123
3457
  async function computeMinMaxOnce() {
3124
3458
  const myId = ++calcReqId;
3125
- const getValue = (v) => {
3459
+ const getValue = (v2) => {
3126
3460
  if (returnType === "number") {
3127
- const parsed = v == null ? null : parseFloat(String(v));
3461
+ const parsed = v2 == null ? null : parseFloat(String(v2));
3128
3462
  return Number.isFinite(parsed) ? parsed : null;
3129
3463
  }
3130
- return v;
3464
+ return v2;
3131
3465
  };
3132
3466
  if (needMinValidateCalc) {
3133
3467
  try {
3134
- const v = await onCalculateFormula("min");
3468
+ const v2 = await onCalculateFormula("min");
3135
3469
  if (myId !== calcReqId) return;
3136
- onMinComputed?.(getValue(v));
3137
- } catch (e) {
3470
+ onMinComputed?.(getValue(v2));
3471
+ } catch (e2) {
3138
3472
  }
3139
3473
  }
3140
3474
  if (needMaxValidateCalc) {
3141
3475
  try {
3142
- const v = await onCalculateFormula("max");
3476
+ const v2 = await onCalculateFormula("max");
3143
3477
  if (myId !== calcReqId) return;
3144
- onMaxComputed?.(getValue(v));
3145
- } catch (e) {
3478
+ onMaxComputed?.(getValue(v2));
3479
+ } catch (e2) {
3146
3480
  }
3147
3481
  }
3148
3482
  }
@@ -3154,14 +3488,14 @@ function useFormulaExpWatcher(options) {
3154
3488
  const s = topStops.shift();
3155
3489
  try {
3156
3490
  s && s();
3157
- } catch (e) {
3491
+ } catch (e2) {
3158
3492
  }
3159
3493
  }
3160
3494
  for (const [, rowMap] of hashRowStops) {
3161
3495
  for (const stop2 of rowMap.values()) {
3162
3496
  try {
3163
3497
  stop2 && stop2();
3164
- } catch (e) {
3498
+ } catch (e2) {
3165
3499
  }
3166
3500
  }
3167
3501
  }
@@ -3175,8 +3509,8 @@ function useFormulaExpWatcher(options) {
3175
3509
  debouncedCompute();
3176
3510
  return;
3177
3511
  }
3178
- for (const p2 of parseInfos) {
3179
- const { type, processed, hashValue } = p2;
3512
+ for (const p of parseInfos) {
3513
+ const { type, processed, hashValue } = p;
3180
3514
  if (type === "plain") {
3181
3515
  const stop2 = watch(
3182
3516
  () => currentPageFormState.value?.[processed],
@@ -3218,9 +3552,9 @@ function useFormulaExpWatcher(options) {
3218
3552
  }
3219
3553
  }
3220
3554
  const existingIds = new Set(arr.map(getRowId));
3221
- for (const r of Array.from(rowMap.keys())) {
3222
- if (!existingIds.has(r)) {
3223
- const rid = `${r}_${processed}`;
3555
+ for (const r2 of Array.from(rowMap.keys())) {
3556
+ if (!existingIds.has(r2)) {
3557
+ const rid = `${r2}_${processed}`;
3224
3558
  const s = rowMap.get(rid);
3225
3559
  s && s();
3226
3560
  rowMap.delete(rid);
@@ -3355,9 +3689,9 @@ class FormAnnotationController {
3355
3689
  const items = this.normalizeAllResponse(res);
3356
3690
  this.applyAnnotationItems(items, () => true);
3357
3691
  return items;
3358
- } catch (e) {
3359
- console.error("加载所有批注信息 error", e);
3360
- throw e;
3692
+ } catch (e2) {
3693
+ console.error("加载所有批注信息 error", e2);
3694
+ throw e2;
3361
3695
  }
3362
3696
  };
3363
3697
  handleOpenAnnotation = async () => {
@@ -3403,219 +3737,208 @@ function filterAnnotationItemsUpToCurrent(items) {
3403
3737
  return ts <= currentTs;
3404
3738
  });
3405
3739
  }
3406
- function useMaterialStocktake() {
3407
- async function getStockDataByWarehouse({ cloneRuntimeJson, warehouseId, locationId }) {
3408
- const stocktakeTables = cloneRuntimeJson?.paper?.props?.materialStocktakeList;
3409
- if (!stocktakeTables?.length || !warehouseId) return {};
3410
- const res = await api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey(
3411
- {
3412
- modelCategory: "entity",
3413
- bsKey: "listAll",
3414
- modelKey: "em_inventory"
3415
- },
3416
- {
3417
- query: {
3418
- "warehouse_id_.eq": warehouseId,
3419
- "location_id_.eq": locationId
3420
- }
3421
- }
3422
- );
3423
- return stocktakeTables.reduce((obj, e) => {
3424
- obj[e.masterSubField] = res?.data;
3425
- return obj;
3426
- }, {});
3427
- }
3428
- async function openScanModal() {
3429
- console.log("materialStocktake openScanModal");
3430
- }
3431
- return {
3432
- getStockDataByWarehouse,
3433
- openScanModal
3434
- };
3435
- }
3436
3740
  export {
3437
- aq as AITooltips,
3741
+ aB as AITooltips,
3438
3742
  AllocateTableCore,
3439
3743
  B3 as BaseFormModelFetcher,
3440
- as as BinarizeMethodOptions,
3441
- aC as BindCmpStyleEnum,
3442
- T as BooleanShowMode,
3744
+ aD as BinarizeMethodOptions,
3745
+ aN as BindCmpStyleEnum,
3746
+ $ as BooleanShowMode,
3443
3747
  B2 as BorderTD,
3444
3748
  BpmnNodeTypeEnum,
3445
- bB as BpmnSignatureTypeEnum,
3446
- bC as ButtonTypeEnum,
3749
+ cc as BpmnSignatureTypeEnum,
3750
+ cd as ButtonTypeEnum,
3447
3751
  B as BwipCodeType,
3448
- bD as CHECK_TABLE_MEDPRO_PROTOCOL_KEY,
3449
- t as CellType,
3450
- a1 as CellWidgetViewState,
3752
+ ce as CHECK_TABLE_MEDPRO_PROTOCOL_KEY,
3753
+ y as CellType,
3754
+ ab as CellWidgetViewState,
3451
3755
  CheckDsTypeEnum,
3452
- bE as CodeRunner,
3756
+ cf as CodeRunner,
3453
3757
  ComponentTypeEnum,
3454
- bF as Config_Fields,
3455
- bG as ControlStatusEnum,
3456
- aA as DateFormat,
3457
- aD as DecimalDisplayMode,
3458
- ar as DenoiseMethodOptions,
3459
- m as DeviceConnector,
3460
- ao as DeviceLink,
3758
+ cg as Config_Fields,
3759
+ ch as ControlStatusEnum,
3760
+ b3 as DEVICE_GROUP_QUERY_KEY,
3761
+ ci as DEVICE_SEARCH_API,
3762
+ aL as DateFormat,
3763
+ aO as DecimalDisplayMode,
3764
+ aC as DenoiseMethodOptions,
3765
+ K as DeviceConnector,
3766
+ az as DeviceLink,
3461
3767
  D as DeviceLinkTmplUtil,
3462
- ap as DeviceParamsTypeTitle,
3768
+ aA as DeviceParamsTypeTitle,
3463
3769
  DevicePartConsumeTableCore,
3464
- a2 as DiagonalDirection,
3465
- a6 as DiagonalVertex,
3466
- _ as DocumentLayout,
3467
- n as DocumentLoading,
3468
- c as DocumentPaper,
3469
- o as DynamicQuickFillModal,
3470
- d as DynamicTableAction,
3471
- bH as EBR_PROVIDE_ENUM,
3472
- aO as EFieldBizTypeEnum,
3473
- af as EmptySymbol,
3474
- bI as FieldSysVarDefaultValueEnum,
3770
+ cj as DeviceStatus,
3771
+ ac as DiagonalDirection,
3772
+ ag as DiagonalVertex,
3773
+ _2 as DocumentLayout,
3774
+ L2 as DocumentLoading,
3775
+ k as DocumentPaper,
3776
+ N2 as DynamicQuickFillModal,
3777
+ l as DynamicTableAction,
3778
+ ck as EBR_PROVIDE_ENUM,
3779
+ cl as EFieldBizTypeEnum,
3780
+ E as EMPTY_PRODUCT_VERSION_ID,
3781
+ ap as EmptySymbol,
3782
+ aa as FieldSysVarDefaultValueEnum,
3475
3783
  FillingTypeEnum,
3476
- F as FixedQuickFillModal,
3784
+ O2 as FixedQuickFillModal,
3477
3785
  FormAnnotationController,
3478
- F2 as FormModelController,
3786
+ F as FormModelController,
3479
3787
  FormTmplBomController,
3480
- p as FormTmplConfigController,
3788
+ P2 as FormTmplConfigController,
3481
3789
  FormTypeEnum,
3482
- al as ImageDisplayModeEnum,
3790
+ av as ImageDisplayModeEnum,
3483
3791
  I as InstanceStatusValues,
3484
- au as JoinModelTypeEum,
3485
- R as LabelPosition,
3486
- a4 as LineDirection,
3792
+ aF as JoinModelTypeEum,
3793
+ _ as LabelPosition,
3794
+ ae as LineDirection,
3487
3795
  L as LineType,
3488
- M as MBRender,
3489
- q as MCDataUtil,
3490
- a8 as MCRender,
3796
+ M2 as MBRender,
3797
+ Q as MCDataUtil,
3798
+ a4 as MCRender,
3491
3799
  MaterialConsumeTableController,
3492
3800
  MaterialConsumptionPatternEnum,
3493
3801
  MaterialRequisitionTableCore,
3494
3802
  MaterialStatusEnum,
3495
- bJ as MobileFillTypeEnum,
3803
+ cm as MobileFillTypeEnum,
3496
3804
  NCB_PROVIDE,
3497
- O2 as OCR_MODEL_PRECISION_ENUM_KEY,
3498
- bK as OfficeTypeEnum,
3805
+ T as OCR_MODEL_PRECISION_ENUM_KEY,
3806
+ cn as OfficeTypeEnum,
3499
3807
  O as Orientation,
3500
- j as PageSizeEnum,
3808
+ o as PageSizeEnum,
3501
3809
  P as PaginationFormat,
3502
- Z as PaperSizeMap,
3503
- h as PaperWidgeType,
3504
- G as PaperWidgeValueType,
3505
- at as ParamModelTypeEnum,
3810
+ a5 as PaperSizeMap,
3811
+ n as PaperWidgeType,
3812
+ M as PaperWidgeValueType,
3813
+ aE as ParamModelTypeEnum,
3506
3814
  PartStocktakeTableCore,
3507
3815
  PlatformEnum,
3508
- bL as PosEnum,
3816
+ co as PosEnum,
3509
3817
  PretreatmentListTableCore,
3510
3818
  ProfileDrivenSubTableCore,
3511
- bM as RangeCompareOp,
3512
- aL as RangeValidateMode,
3819
+ cp as RangeCompareOp,
3820
+ b6 as RangeValidateMode,
3513
3821
  RenderModeEnum,
3514
- X as SignShowTypeEnum,
3515
- V as SignatureNumberTypeEnum,
3516
- W as SignatureTimeTypeEnum,
3517
- Y as SignatureTypeEnum,
3822
+ a2 as SignShowTypeEnum,
3823
+ a0 as SignatureNumberTypeEnum,
3824
+ a1 as SignatureTimeTypeEnum,
3825
+ a3 as SignatureTypeEnum,
3518
3826
  SterilizeBatchTableCore,
3519
3827
  StocktakeTableCore,
3520
3828
  SubTableCore,
3521
3829
  SubTableCoreFactory,
3522
3830
  SubTableType,
3523
- bN as SummaryApproveHisTypeEnum,
3524
- a5 as TimeDiffFormat,
3525
- a9 as ViewTypeEnum,
3831
+ cq as SummaryApproveHisTypeEnum,
3832
+ af as TimeDiffFormat,
3833
+ aj as ViewTypeEnum,
3526
3834
  WarehouseInTableCore,
3527
3835
  WarehouseInboundTableCore,
3528
3836
  WarehouseOutTableCore,
3529
3837
  WarehouseOutboundTableCore,
3530
- a3 as WidgetImageSizeMode,
3531
- bO as applyCheckDsDataToRuntime,
3532
- bP as applyMedProCheckDsDataToRuntime,
3838
+ ad as WidgetImageSizeMode,
3839
+ cr as applyCheckDsDataToRuntime,
3840
+ e as applyConsumeObjectTraceChange,
3841
+ cs as applyMedProCheckDsDataToRuntime,
3533
3842
  baseDataUtils,
3534
- bQ as buildFormChangeDisplayRows,
3535
- bR as buildStableFieldLocation,
3843
+ ct as buildDeviceBaseQuery,
3844
+ b2 as buildDeviceFilterQuery,
3845
+ cu as buildFormChangeDisplayRows,
3846
+ c as buildObjectLotExtraQuery,
3847
+ cv as buildStableFieldLocation,
3536
3848
  calcFillData,
3537
3849
  calcUtils,
3538
3850
  clearFormRules,
3539
3851
  collectAnnotationItemsByLocation,
3540
3852
  collectFormChangeFieldLocations,
3541
3853
  commonUtils,
3542
- bS as deleteSubtableRow,
3543
- bT as detailsHaveFormChangeRowOps,
3854
+ cw as deleteSubtableRow,
3855
+ cx as detailsHaveFormChangeRowOps,
3544
3856
  enrichFormChangeRowDetails,
3545
- bU as extractFormChangeRowDetails,
3857
+ cy as extractFormChangeRowDetails,
3546
3858
  extractKeywordFromQueryData,
3547
- bV as fetchCheckDsDataForTable,
3548
- bW as fetchCustomCheckDsData,
3859
+ cz as fetchCheckDsDataForTable,
3860
+ cA as fetchCustomCheckDsData,
3549
3861
  fetchHistoryConsume,
3550
- bX as fetchMedProCheckDsData,
3862
+ cB as fetchMedProCheckDsData,
3863
+ f as fetchOperationReceiveQty,
3551
3864
  filterAnnotationItemsUpToCurrent,
3552
- getAppInfo,
3553
- bY as getCheckTableSnapshotKey,
3554
- bZ as getFormChangeRowKey,
3555
- b_ as getFormChangeRowOp,
3556
- aK as getLotLockedReason,
3557
- b$ as getParseRuleConfig,
3865
+ U as getAppInfo,
3866
+ cC as getCheckTableSnapshotKey,
3867
+ cD as getFormChangeRowKey,
3868
+ cE as getFormChangeRowOp,
3869
+ b0 as getLotLockedReason,
3870
+ b as getObjectBomMaterialLotQuery,
3871
+ g as getObjectBomProductQuery,
3872
+ cF as getParseRuleConfig,
3558
3873
  getParseRuleInfo,
3559
3874
  getParseRuleValue,
3560
- c0 as getSubTableQuickFillInfo,
3561
- getSuiteKey,
3562
- c1 as handleOldConfig,
3563
- c2 as hasAnyCheckTableSnapshot,
3564
- c3 as hasByTableCheckTableSnapshot,
3565
- c4 as hasSharedCheckTableSnapshot,
3566
- c5 as insertSubtableRows,
3567
- c6 as isAnnLocationSelected,
3875
+ cG as getReinspectionDate,
3876
+ cH as getSubTableQuickFillInfo,
3877
+ V as getSuiteKey,
3878
+ cI as handleOldConfig,
3879
+ cJ as hasAnyCheckTableSnapshot,
3880
+ cK as hasByTableCheckTableSnapshot,
3881
+ cL as hasSharedCheckTableSnapshot,
3882
+ cM as insertSubtableRows,
3883
+ cN as isAnnLocationSelected,
3884
+ W as isBlank,
3568
3885
  isBomGranted,
3569
3886
  isEdhrSuite,
3570
- isEqmSuite,
3571
- c7 as isFormChangeGhostRow,
3572
- c8 as isMedProSuite,
3573
- c9 as isRowAddedInCurrentFormChange,
3574
- ca as jsonSchemaUtils,
3575
- cb as judgeUnique,
3576
- cc as materialCheck,
3577
- cd as migrateDiagonalDirectionToVertex,
3887
+ X as isEqmSuite,
3888
+ cO as isFormChangeGhostRow,
3889
+ cP as isMedProSuite,
3890
+ cQ as isRowAddedInCurrentFormChange,
3891
+ cR as jsonSchemaUtils,
3892
+ cS as judgeUnique,
3893
+ a$ as materialCheck,
3894
+ cT as migrateDiagonalDirectionToVertex,
3578
3895
  nextFormChangeRowViewHistoryId,
3579
- aF as normalizeRefLoaderResult,
3580
- ce as parseFrontConfig,
3581
- cf as recordSubtableRowAdd,
3582
- cg as recordSubtableRowDelete,
3583
- aG as refUtils,
3896
+ aQ as normalizeRefLoaderResult,
3897
+ cU as parseFrontConfig,
3898
+ Y as pickObjectFieldKeys,
3899
+ cV as recordSubtableRowAdd,
3900
+ cW as recordSubtableRowDelete,
3901
+ aT as refUtils,
3584
3902
  registerValidationContext,
3585
- ch as relocateDeletedRowsToEnd,
3903
+ cX as relocateDeletedRowsToEnd,
3586
3904
  renderUtils,
3587
3905
  requestDisplayValidation,
3588
3906
  requestFullValidation,
3589
- ci as requestMedProCheckDsData,
3590
- cj as requestNonMedProCheckDsData,
3591
- ck as resolveAnnotationFieldLocation,
3592
- a7 as resolveDiagonalVertex,
3593
- cl as resolveFormChangeRowUi,
3594
- cm as resolveRowFormChangeMark,
3595
- ay as setSelectAnnotationId,
3596
- cn as setSelectMobileTdId,
3597
- ax as setSelectValidatorId,
3907
+ cY as requestMedProCheckDsData,
3908
+ cZ as requestNonMedProCheckDsData,
3909
+ c_ as resolveAnnotationFieldLocation,
3910
+ ah as resolveDiagonalVertex,
3911
+ c$ as resolveFormChangeRowUi,
3912
+ r as resolveObjectFieldKeys,
3913
+ d0 as resolveRowFormChangeMark,
3914
+ d as runWithFillProduct,
3915
+ aJ as setSelectAnnotationId,
3916
+ d1 as setSelectMobileTdId,
3917
+ aI as setSelectValidatorId,
3598
3918
  settleAndValidateDisplay,
3599
- av as sqlUtils,
3600
- co as stockCheck,
3919
+ aG as sqlUtils,
3920
+ d2 as stockCheck,
3601
3921
  transformUtils,
3602
3922
  unregisterValidationContext,
3603
- H as useCalculateFormula,
3604
- aJ as useCurrentPageFormState,
3605
- aN as useDependency,
3923
+ N as useCalculateFormula,
3924
+ aZ as useCurrentPageFormState,
3925
+ b8 as useDependency,
3606
3926
  useEbrWikiFactoryV2,
3607
3927
  u3 as useFormModel,
3608
3928
  u2 as useFormTmplConfig,
3609
3929
  useFormulaExpWatcher,
3610
3930
  useMaterialBalance,
3611
- useMaterialStocktake,
3612
3931
  useNocodeEmitter,
3613
- az as useNocodeFormWidget,
3614
- cp as useOnlineFormActionButton,
3932
+ aK as useNocodeFormWidget,
3933
+ d3 as useOnlineFormActionButton,
3615
3934
  u as useOnlineFormTransformField2Component,
3616
3935
  useRenderPageFactory,
3617
- a as useStyles,
3618
- b as useValidator,
3619
- aw as useWidgetStaticAttrs,
3620
- validate
3936
+ h as useStyles,
3937
+ a as useTmplBom,
3938
+ j as useValidator,
3939
+ aH as useWidgetStaticAttrs,
3940
+ validate,
3941
+ v as validateObjectBomForScan,
3942
+ validateObjectBomQtyOnSubmit,
3943
+ b1 as validateReinspectionDate
3621
3944
  };