@gct-paas/excel 0.1.0 → 0.1.1
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.
- package/README.md +9 -12
- package/dist/Scrollbar-B03peMkg.js +4851 -0
- package/dist/{agg-design-DWIMjEFt.js → agg-design-TY6bw773.js} +1 -1
- package/dist/{agg-props-DIGVuiAa.js → agg-props-BP6ebrkg.js} +1 -1
- package/dist/{agg-style-DlzoL0bC.js → agg-style-Boe0wZpC.js} +1 -1
- package/dist/{align-editor-ScnNPek-.js → align-editor-BJnNlh17.js} +1 -1
- package/dist/{attach-fields-editor-D9OGMSPM.js → attach-fields-editor-sLbxGVa5.js} +3 -4
- package/dist/{barcode-design-DnpsOpYP.js → barcode-design-Dw6Fawyd.js} +6 -4
- package/dist/base/index.d.ts +1 -0
- package/dist/base/index.es.js +4095 -137
- package/dist/{base-font-editor-B5vjmXrI.js → base-font-editor-PcA-lLrM.js} +3 -3
- package/dist/{boolean-design-BH6ZgOfX.js → boolean-design-C6kCxcau.js} +6 -4
- package/dist/{boolean-props-DO08nUUl.js → boolean-props-CDv966ML.js} +4 -4
- package/dist/{boolean-style-B0KZHMId.js → boolean-style-DSo2KNU9.js} +8 -4
- package/dist/{cell-upload-7FJulof-.js → cell-upload-B75edlb1.js} +3 -3
- package/dist/{date-format-editor-dKlZ1BtF.js → date-format-editor-B4kyj8d4.js} +3 -4
- package/dist/{date-time-design-CTMy_f8u.js → date-time-design-CEzOl4VQ.js} +1 -2
- package/dist/{date-time-props-Bi1QXvJc.js → date-time-props-2Spc7-nD.js} +7 -6
- package/dist/{date-time-style-C4RYfnSX.js → date-time-style-eDhjVKXK.js} +1 -1
- package/dist/{decimal-design-DQ_UVmC2.js → decimal-design-9zPlMQeR.js} +1 -1
- package/dist/{decimal-display-mode-CcPkHB5x.js → decimal-display-mode-BwQvXjYM.js} +7 -4
- package/dist/{decimal-props-mTLDaVNL.js → decimal-props-D6gWZQS2.js} +5 -6
- package/dist/{decimal-style-DpUp6S2P.js → decimal-style-BSmJ__JJ.js} +1 -1
- package/dist/{default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-BIW4XxoA.js → default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-DChBBAdl.js} +7 -5
- package/dist/{diagonal-design-CY_Znj5B.js → diagonal-design-CSShf9oU.js} +3 -3
- package/dist/{index-CfpMuCWW.js → document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-CRHt8g_6.js} +48303 -48392
- package/dist/{double-design-BPS3g1PG.js → double-design-B47Ui8Tf.js} +1 -1
- package/dist/{double-props-3Nr9HK6o.js → double-props-BXrUIA33.js} +4 -5
- package/dist/{double-style-fbwalibj.js → double-style-DNHerXvB.js} +1 -1
- package/dist/{edit.utils-CXmmCnxE-DBxW-dJF.js → edit.utils-CXmmCnxE-BaswarHv.js} +1 -1
- package/dist/{enum-design-BbBJ8RgJ.js → enum-design-S0FDbkIJ.js} +3 -4
- package/dist/{enum-props-DWXPyfcY.js → enum-props-DSHvCsX8.js} +9 -10
- package/dist/{enum-style-Cjl2-1cH.js → enum-style-CymSjOf9.js} +2 -2
- package/dist/excel.css +19817 -19817
- package/dist/{expression-design-SALSc8oz.js → expression-design-CxhDs-iW.js} +1 -1
- package/dist/{expression-props-DrBlBbh8.js → expression-props-D3doisK_.js} +1 -1
- package/dist/{expression-style-3epADkjE.js → expression-style-CwIasd6-.js} +1 -1
- package/dist/{file-design-DW3po1Zv.js → file-design-m-nNectv.js} +1 -1
- package/dist/{file-props-CLCHi5eO.js → file-props-i0juzKr3.js} +6 -4
- package/dist/{file-style-CSq3-qvW.js → file-style-BKREaYYI.js} +1 -1
- package/dist/{font-editor-DRJmXq8Z.js → font-editor-D_B6876L.js} +4 -4
- package/dist/form-annotation-controller-1BVpK7G9.js +651 -0
- package/dist/{image-design-EChtZtaq.js → image-design-C1N0UFcU.js} +7 -3
- package/dist/{image-design-SgYselU_.js → image-design-J5H8brer.js} +2 -2
- package/dist/{image-props-B451Gpqm.js → image-props-DAVhvZ4D.js} +1 -1
- package/dist/{image-style-BUVdkbCo.js → image-style-BcZz2fRn.js} +1 -1
- package/dist/{index-BGx1e8c7.js → index-2YSPfDqf.js} +5 -1
- package/dist/{index-CmWECosU.js → index-8frlENRk.js} +5 -1
- package/dist/{index-7yBmRQKF.js → index-B6jaI9Cc.js} +5 -1
- package/dist/{index-DdNE7bdh.js → index-BDSBNtti.js} +6 -2
- package/dist/{index-DKSr3-x3.js → index-BEgV29u5.js} +6 -2
- package/dist/{index-XHxr4hJa.js → index-Bbk8XFW3.js} +10226 -14301
- package/dist/{index-BE-tOMeW.js → index-Bc5GzFtM.js} +5 -1
- package/dist/{index-Lqv2fLln.js → index-Bd6tvXIP.js} +5 -1
- package/dist/{index-Iqfr9fTa.js → index-BgWmNF7J.js} +5 -1
- package/dist/{index-CwBWpKxd.js → index-Bh94YBll.js} +6 -2
- package/dist/{index-DJw46W_F.js → index-BsEmE3P9.js} +5 -1
- package/dist/{index-BdZ61aX_.js → index-C5CD6R34.js} +5 -3
- package/dist/{index-OSOTLvUC.js → index-CAMonT9s.js} +5 -3
- package/dist/{index-CdU4ZUtc.js → index-CBGFlXbA.js} +5 -1
- package/dist/{index-w1jyFW86.js → index-CD2-0ytB.js} +5 -1
- package/dist/{index-Cw0Yk_J2.js → index-CV8w5uD3.js} +5 -1
- package/dist/{index-CiEHZ2UL.js → index-CXzZayON.js} +5 -1
- package/dist/{index-DMDavNNp.js → index-Cz4GMH6V.js} +5 -1
- package/dist/{index-BiSfT142.js → index-D4JPNxZ_.js} +5 -1
- package/dist/{index-D1rRrOu8.js → index-D9vGUjD-.js} +5 -1
- package/dist/{index-BDgjwIk3.js → index-DCBWk2YD.js} +5 -1
- package/dist/{index-Cf-WiRlN.js → index-DD8pUlGk.js} +5 -1
- package/dist/{index-C71U7k6u.js → index-DJ4W6D00.js} +5 -1
- package/dist/{index-ph_-8i8Z.js → index-DPWvW9RW.js} +5 -1
- package/dist/{index-BfYX5wcI.js → index-D_NYroJT.js} +5 -1
- package/dist/{index-Bn-1MkMp.js → index-Gp_BO_6x.js} +6 -2
- package/dist/{index-C7XhsNAR.js → index-QlhJ9cCU.js} +5 -1
- package/dist/{index-B8wQ0lKk.js → index-R31WURxN.js} +5 -1
- package/dist/{index-C1hQP7e9.js → index-RXv4PPqO.js} +5 -1
- package/dist/{index-4jx1amDZ.js → index-TO-xtQQ-.js} +5982 -5895
- package/dist/{index-JAEvidu-.js → index-djFDCrYr.js} +5 -1
- package/dist/{index-n1btN66R.js → index-lbT4zbIX.js} +5 -1
- package/dist/{index-D33d2yaI.js → index-x7LqeyTP.js} +6 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1 -1
- package/dist/{integer-design-BzfsWtYJ.js → integer-design-5HpbwSMC.js} +1 -1
- package/dist/{integer-props-HFGj00uq.js → integer-props-CjJ48n84.js} +11 -12
- package/dist/{integer-style-CXnNiXBf.js → integer-style-Df3Ir8uR.js} +1 -1
- package/dist/{number-input-ex-BBYCCtb0.js → number-input-ex-A9ofHi7P.js} +2 -2
- package/dist/{org-props-DIPAV6_G.js → org-props-B-U2NZK0.js} +6 -2
- package/dist/{org-style-CxmWh_lK.js → org-style-mSip6Z4A.js} +1 -1
- package/dist/{pagination-design-Dmm1vFcD.js → pagination-design-B5G88uJP.js} +6 -2
- package/dist/paper-widget-design-CRIH6-sl.js +4 -0
- package/dist/{qrcode-design-CYE3Zc1S.js → qrcode-design-BjneALzu.js} +1 -1
- package/dist/{ref-autofill-editor-BrhHeEgk.js → ref-autofill-editor-BtaYTq4J.js} +5 -7
- package/dist/{ref-props-BQGfsopp.js → ref-props-CQvjcfUS.js} +4 -5
- package/dist/{ref-style-BKqW27bd.js → ref-style-lOjyHS6G.js} +1 -1
- package/dist/{revo-grid.entry-w1ybyIqW.js → revo-grid.entry-b_K3XgLT.js} +1 -1
- package/dist/{revogr-attribution_7.entry-Bm1yMQEW.js → revogr-attribution_7.entry-nUfaMLUj.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-BTapNW_r.js → revogr-clipboard_3.entry-DVMLrYz4.js} +2 -2
- package/dist/{revogr-data_4.entry-C_JHDdpT.js → revogr-data_4.entry-z9cNZuX5.js} +2 -2
- package/dist/{revogr-filter-panel.entry-EZOB34a4.js → revogr-filter-panel.entry-Dxpd0jpR.js} +1 -1
- package/dist/{select-render-type-editor.vue_vue_type_script_setup_true_lang-DQ3opkvz.js → select-render-type-editor.vue_vue_type_script_setup_true_lang-Dph5IkLk.js} +6 -2
- package/dist/{serialnumber-design-Bf1-wuWo.js → serialnumber-design-RqaSxqVj.js} +2 -2
- package/dist/{signature-design-DJ-gHYV5.js → signature-design-CYPco1hW.js} +1 -1
- package/dist/{signature-props-DMvP8ZI_.js → signature-props-0khgkO7O.js} +7 -6
- package/dist/{signature-style-BA0EeVy4.js → signature-style-CmQ_YXd9.js} +1 -1
- package/dist/{single-field-drop-C72WkkXN.js → single-field-drop-BAWSxi-H.js} +3 -3
- package/dist/{size-editor-BV2kb5r0.js → size-editor-BAC_00ot.js} +1 -1
- package/dist/src/adapter/adapter.d.ts +1 -1
- package/dist/src/adapter/adapter.d.ts.map +1 -1
- package/dist/src/adapter/setup.d.ts.map +1 -1
- package/dist/src/nocode-base/src/types/common/base.d.ts.map +1 -1
- package/dist/src/nocode-web-render/src/render/parse-rule/add-rule-btn.vue.d.ts.map +1 -1
- package/dist/src/nocode-web-render/src/render/parse-rule/parse-rule-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/components/device/hook.d.ts +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/agg/agg.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/boolean/boolean.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-dependency.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-design.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-event.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-formula.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-props.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-style.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/common/comp-size-editor/comp-size-editor.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/date-time/date-time.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/decimal/decimal.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/double/double.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/enum/enum.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/expression/expression.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/file/file.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/image/image.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/integer/integer.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/org/org.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/ref/ref.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/signature/signature.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/text/text.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/trace/trace.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/user/user.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/barcode/barcode.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/base.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/container/container-item.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/container/container-render.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/diagonal/diagonal.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/image/image.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/line/line.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/pagination/pagination.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/paper-widget-design.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/paper-widget-props.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/power/power.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/qrcode/qrcode.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/rangelimit/rangelimit.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/serialnumber/serialnumber.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/text/text.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/timediff/timediff.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/apaas-collect.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/hooks/reverse-modeling/scan-field.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/hooks/useSpreadSheet.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/base/drag/cells-drop.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/base/drag/use-drop.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/base/field-config.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/modals/add-dependency-modal/add-dependency-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/modals/param-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/modals/table-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/comps/signature-config/config-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/comps/sub-table-list.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/add-ipaas/ipaas-param-config.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/data-source-field-map.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/data-source-model-link.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/data-source-title.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/param-field-link.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/object-init/hooks/useObjectInit.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/object-init/object-init-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/sheet/sheet-cell.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/sheet/sheet-data-group-2d.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/sheet/sheet-dynamic-tr.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/toolkit/toolkit-content-param.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/types/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/utils/dom-parser.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/utils/xlsx-parser.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_common_/rangelimit/use-rangelimit.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/datepicker/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/datetimepicker/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/department/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/enum-select/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/input/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/inputdouble/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/inputnumber/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/select/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/sign/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/switch/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/textarea/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/timepicker/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/trace/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/upload-file/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/upload-image/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/userpicker/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/barcode/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/combine-fields/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/diagonal/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/dyn-value/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/image/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/line/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/power/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/qrcode/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/ro/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/serialnumber/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/sub-table/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/timediff/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/paper/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/td/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/tr/index.d.ts.map +1 -1
- package/dist/{text-design-CMeRZOLz.js → text-design-C4UxhqJ6.js} +3 -3
- package/dist/{text-design-D8ytOdCE.js → text-design-DRjeVXe4.js} +6 -4
- package/dist/{text-props-Bwec10Bj.js → text-props-Dkba8iN0.js} +3 -4
- package/dist/{text-style-DUtxGMF_.js → text-style-DNLowaEr.js} +1 -1
- package/dist/{throttle-Cpk1LoGk-BE-DFShS.js → throttle-Cpk1LoGk-CSn6EgZj.js} +1 -1
- package/dist/{timediff-design-Bh2KjAqU.js → timediff-design-DfO1K8VM.js} +5 -1
- package/dist/{trace-design-BfkLkVEr.js → trace-design-sDW_1e1T.js} +3 -4
- package/dist/{trace-props-BGy27o42.js → trace-props-DUHH5u3j.js} +9 -6
- package/dist/{trace-style-DjlUSE3I.js → trace-style-fZihSUwd.js} +1 -1
- package/dist/{user-props-QOHxGObK.js → user-props-DIDwd7iH.js} +6 -2
- package/dist/{user-style-CvNqToP9.js → user-style-CCPt_J69.js} +1 -1
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-DWp1s_Sq.js → value-editor.vue_vue_type_style_index_0_lang-DCnAPQSg.js} +5 -3
- package/dist/web-render/index.d.ts +1 -0
- package/dist/web-render/index.es.js +50 -135
- package/dist/{widget-barcode-DYOkoyS1.js → widget-barcode-7gC77_4m.js} +8 -4
- package/dist/{widget-diagonal-C-YsPxKf.js → widget-diagonal-MA7a_BaK.js} +6 -6
- package/dist/{widget-image-DUXTJPFJ.js → widget-image-FF-o9t3r.js} +8 -6
- package/dist/{widget-line-D5_w-6zu.js → widget-line-4mmBTGDW.js} +6 -2
- package/dist/{widget-pagination-xLLmOYJ9.js → widget-pagination-D8P-Y1gU.js} +9 -5
- package/dist/{widget-power-BfTxwePG.js → widget-power-DBZrpD6s.js} +4 -5
- package/dist/{widget-qrcode-4rMzuAvE.js → widget-qrcode-BXM3oQoT.js} +7 -3
- package/dist/{widget-rangelimit-DedzcMn8.js → widget-rangelimit-CCiGmchP.js} +4 -5
- package/dist/{widget-serialnumber-BBI-_uRN.js → widget-serialnumber-CEbbsNR-.js} +1 -1
- package/dist/{widget-text-CeldfZiZ.js → widget-text-CZpXhRyM.js} +5 -5
- package/dist/{widget-timediff-DJ4WeBNm.js → widget-timediff-D71b_fcM.js} +6 -4
- package/package.json +8 -4
- package/dist/Scrollbar-Bl_rv9eK.js +0 -8827
- package/dist/paper-widget-design-DvqHvRJ4.js +0 -4
- package/dist/uuid-CvPXRkky.js +0 -534
package/dist/base/index.es.js
CHANGED
|
@@ -1,139 +1,4097 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aC as fetchHistoryConsume, aD as isBomGranted, F as FIELD_TYPE, au as getParseRuleInfo, av as getParseRuleValue, aE as calcFillData, aF as extractKeywordFromQueryData, q as FormTypeEnum, aG as transformUtils, i as SubTableType, ap as NCB_PROVIDE, aH as clearFormRules, aI as baseDataUtils, aw as RenderModeEnum, f as ComponentTypeEnum, aJ as validate, aK as calcUtils, a5 as CheckDsTypeEnum, al as renderUtils, G as PlatformEnum, aL as uuid2, aM as normalizeToArray, aN as safeParseArray, aO as BpmnNodeTypeEnum, aP as mergeByMultiKey, aB as useNocodeEmitter, as as EntityModelCategoryEnum, _ as _export_sfc, aQ as MobileFillTypeEnum, A as useModal, aR as getSubTableQuickFillInfo, j as CellType } from "../document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-CRHt8g_6.js";
|
|
2
|
+
import { a8, aS, aa, an, v, aT, aU, B, aV, I, aW, aX, aY, am, ao, a9, a6, a7, J, aZ, ay, Y, a_, a$, a3, aq, ad, t, K, L, b0, b1, b2, O, b, P, a4, a, l, ac, b3, ak, y, w, x, z, b4, T, V, W, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, ar, at, bf, ah, bg, ag, ae, u, ai, M, aj, ax, af } from "../document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-CRHt8g_6.js";
|
|
3
|
+
import { M as MaterialConsumptionPatternEnum, g as MaterialConsumeTableController, h as SubTableCore, i as SubTableActionMenuTypeEnum, j as getMenuByAction, k as SubTableActionEnum, l as getCopySubMenu, m as getInsertSubMenu, n as useMaterialBalance, o as commonUtils, p as DocumentLoading, q as _imports_0, S as Scrollbar, r as DocumentQuickFillModal } from "../Scrollbar-B03peMkg.js";
|
|
4
|
+
import { B as B2, s, D, _, e, f, F, t as t2, d, a as a2, b as b10, v as v2, u as u2, c } from "../Scrollbar-B03peMkg.js";
|
|
5
|
+
import { ref, provide, watch, computed, defineComponent, openBlock, createElementBlock, createVNode, renderSlot, createElementVNode, normalizeClass, createCommentVNode, withDirectives, vShow, toDisplayString, resolveComponent, withCtx, unref, createBlock, Fragment, renderList, withModifiers, createTextVNode, nextTick, normalizeStyle } from "vue";
|
|
6
|
+
import { defaults, pick, merge, has, isEmpty, cloneDeep } from "lodash-es";
|
|
7
|
+
import { api } from "@gct-paas/api";
|
|
8
|
+
import dayjs from "dayjs";
|
|
9
|
+
import { B as B3, C, F as F2, a as a5, M as M2 } from "../form-annotation-controller-1BVpK7G9.js";
|
|
10
|
+
import { Empty } from "ant-design-vue";
|
|
11
|
+
function useLatestRequest(execFn) {
|
|
12
|
+
let lastReqId = 0;
|
|
13
|
+
const loading = ref(false);
|
|
14
|
+
const error = ref(null);
|
|
15
|
+
async function run(payload) {
|
|
16
|
+
lastReqId += 1;
|
|
17
|
+
const myId = lastReqId;
|
|
18
|
+
loading.value = true;
|
|
19
|
+
error.value = null;
|
|
20
|
+
try {
|
|
21
|
+
const res = await execFn(payload);
|
|
22
|
+
if (myId !== lastReqId) return null;
|
|
23
|
+
return res;
|
|
24
|
+
} catch (err) {
|
|
25
|
+
error.value = err;
|
|
26
|
+
throw err;
|
|
27
|
+
} finally {
|
|
28
|
+
if (myId === lastReqId) loading.value = false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function invalidate() {
|
|
32
|
+
lastReqId += 1;
|
|
33
|
+
}
|
|
34
|
+
return { run, invalidate, loading, error };
|
|
35
|
+
}
|
|
36
|
+
class FormTmplBomController {
|
|
37
|
+
/** 实例bom配置信息 */
|
|
38
|
+
formInstBom = null;
|
|
39
|
+
/** 工序id */
|
|
40
|
+
operationId;
|
|
41
|
+
/** 批次/sn */
|
|
42
|
+
materialNo;
|
|
43
|
+
/** 历史填报数据 */
|
|
44
|
+
historyData = [];
|
|
45
|
+
/** 表单控制器(key是tableKey) */
|
|
46
|
+
tableControllers = {};
|
|
47
|
+
/** 字段key和tableKey的映射 */
|
|
48
|
+
field2TableMap = {};
|
|
49
|
+
/** 默认物料消耗模式 */
|
|
50
|
+
defaultMCPattern = MaterialConsumptionPatternEnum.RECORD;
|
|
51
|
+
constructor() {
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 判断使用场景,不符合的报错提示
|
|
55
|
+
* @param opts
|
|
56
|
+
*/
|
|
57
|
+
judgeScene(opts) {
|
|
58
|
+
if (!opts.selfInfo.businessType) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const hasMCTable = opts.cloneRuntimeJson?.paper?.props?.materialConsumeTableList?.length;
|
|
62
|
+
const isAllowBusinessType = ["DHR", "TXN"].includes(opts.selfInfo.businessType);
|
|
63
|
+
const hasBusinessId = !!opts.selfInfo.businessId;
|
|
64
|
+
if (hasMCTable && (!isAllowBusinessType || !hasBusinessId)) {
|
|
65
|
+
MaterialConsumeTableController.render.message({
|
|
66
|
+
type: "error",
|
|
67
|
+
content: $t("sys.onlineForm.mcTableCannotUseTip")
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const hasBalanceTable = opts.cloneRuntimeJson?.paper?.props?.materialBalanceTableList?.length;
|
|
71
|
+
if (hasBalanceTable && (!isAllowBusinessType || !hasBusinessId)) {
|
|
72
|
+
MaterialConsumeTableController.render.message({
|
|
73
|
+
type: "error",
|
|
74
|
+
content: $t("sys.onlineForm.balanceTableCannotUseTip")
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 批次数量
|
|
80
|
+
* @readonly
|
|
81
|
+
*/
|
|
82
|
+
get materialNoNum() {
|
|
83
|
+
return this.formInstBom?.qty ?? 1;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* bom模块配置关联过来的bom明细集合
|
|
87
|
+
* @readonly
|
|
88
|
+
*/
|
|
89
|
+
get bomEntries() {
|
|
90
|
+
return this.formInstBom?.bomEntries;
|
|
91
|
+
}
|
|
92
|
+
/** 表单模板bom信息配置列表 */
|
|
93
|
+
get tmplBomList() {
|
|
94
|
+
return this.formInstBom?.formTmplBomList;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* bom那边指定的当前工序的开关
|
|
98
|
+
* @readonly
|
|
99
|
+
*/
|
|
100
|
+
get enableSequenceLoading() {
|
|
101
|
+
return !!this.formInstBom?.sequenceEntries?.[0]?.enabled_;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 初始化模板的物料消耗的配置
|
|
105
|
+
*/
|
|
106
|
+
async init(data) {
|
|
107
|
+
if (!data.formInstBom) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
this.operationId = data.operationId;
|
|
111
|
+
this.materialNo = data.materialNo;
|
|
112
|
+
this.formInstBom = data.formInstBom;
|
|
113
|
+
this.historyData = await fetchHistoryConsume({
|
|
114
|
+
production_identification_id_: this.formInstBom.productionIdentificationId,
|
|
115
|
+
routing_operation_id_: this.operationId
|
|
116
|
+
});
|
|
117
|
+
const isGranted = await isBomGranted();
|
|
118
|
+
this.defaultMCPattern = isGranted ? MaterialConsumptionPatternEnum.BOM : MaterialConsumptionPatternEnum.RECORD;
|
|
119
|
+
this.tableControllers = {};
|
|
120
|
+
this.tmplBomList.forEach((cur) => {
|
|
121
|
+
const controller = new MaterialConsumeTableController(this, cur);
|
|
122
|
+
const [tableKey, fieldKey] = cur.table_key_.split(":");
|
|
123
|
+
this.tableControllers[tableKey] = controller;
|
|
124
|
+
this.field2TableMap[fieldKey] = tableKey;
|
|
125
|
+
}, {});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* 根据字段key获取子表控制器
|
|
129
|
+
* @param field
|
|
130
|
+
* @return {*}
|
|
131
|
+
*/
|
|
132
|
+
findTableControllerByField(field) {
|
|
133
|
+
return this.tableControllers[this.field2TableMap[field]];
|
|
134
|
+
}
|
|
135
|
+
/** 计算表单数据(需求废弃,不初始化了) */
|
|
136
|
+
calcFormState(paper) {
|
|
137
|
+
return void 0;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 处理字段组件
|
|
141
|
+
* - 补充物料字段的额外查询条件
|
|
142
|
+
* @param field
|
|
143
|
+
*/
|
|
144
|
+
handleField(field) {
|
|
145
|
+
const { subFieldKey, fieldType } = field;
|
|
146
|
+
const tableC = this.findTableControllerByField(subFieldKey);
|
|
147
|
+
if (!tableC) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
field.isMaterialConsumeField = true;
|
|
151
|
+
if (fieldType === FIELD_TYPE.PRODUCT && field.field === "product_id_") {
|
|
152
|
+
field.newSpecificConfig.newQueryData = tableC.getProductQuery();
|
|
153
|
+
field.newSpecificConfig.newComponentProps = {
|
|
154
|
+
hideSingleVersion: false,
|
|
155
|
+
parentToDefault: true
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* 处理默认值,
|
|
161
|
+
* - 补充行数据的工序默认值
|
|
162
|
+
* @param defaultMap
|
|
163
|
+
*/
|
|
164
|
+
handleDefaultMap(defaultMap) {
|
|
165
|
+
Object.keys(this.field2TableMap).forEach((key) => {
|
|
166
|
+
if (!defaultMap[key]) {
|
|
167
|
+
defaultMap[key] = {};
|
|
168
|
+
}
|
|
169
|
+
defaults(defaultMap[key], {
|
|
170
|
+
routing_operation_id_: this.operationId
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async submitValidate() {
|
|
175
|
+
const results = await Promise.allSettled(
|
|
176
|
+
Object.values(this.tableControllers).map((c2) => c2.submitValidate())
|
|
177
|
+
);
|
|
178
|
+
const successful = results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
179
|
+
const fieldArr = successful.filter(Boolean);
|
|
180
|
+
if (fieldArr.length) {
|
|
181
|
+
const fields = fieldArr.reduce((acc, cur) => {
|
|
182
|
+
acc[cur.field] = [cur];
|
|
183
|
+
return acc;
|
|
184
|
+
}, {});
|
|
185
|
+
return {
|
|
186
|
+
isValid: false,
|
|
187
|
+
fields
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
isValid: true
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function getAppInfo() {
|
|
196
|
+
return api.apaas.designerCommon.getGetApp();
|
|
197
|
+
}
|
|
198
|
+
async function getSuiteKey() {
|
|
199
|
+
const appInfo = await getAppInfo();
|
|
200
|
+
return appInfo?.suiteKey;
|
|
201
|
+
}
|
|
202
|
+
async function isEdhrSuite() {
|
|
203
|
+
const suiteKey = await getSuiteKey();
|
|
204
|
+
return suiteKey === "eDHR";
|
|
205
|
+
}
|
|
206
|
+
async function getModelQueries(opts) {
|
|
207
|
+
const isEdhr = await isEdhrSuite();
|
|
208
|
+
if (!isEdhr || !opts.mainMaterialNo) {
|
|
209
|
+
return {};
|
|
210
|
+
}
|
|
211
|
+
const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
212
|
+
{
|
|
213
|
+
bsKey: "biz_get_model_options",
|
|
214
|
+
modelKey: "gct_online_form_instance",
|
|
215
|
+
modelCategory: "entity"
|
|
216
|
+
},
|
|
217
|
+
{},
|
|
218
|
+
{
|
|
219
|
+
name_: opts.mainMaterialNo
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
console.log("getModelQueries", res);
|
|
223
|
+
return res;
|
|
224
|
+
}
|
|
225
|
+
var WarehouseInventoryRowSource = /* @__PURE__ */ ((WarehouseInventoryRowSource2) => {
|
|
226
|
+
WarehouseInventoryRowSource2["MANUAL"] = "manual";
|
|
227
|
+
WarehouseInventoryRowSource2["AUTO"] = "auto";
|
|
228
|
+
WarehouseInventoryRowSource2["SCAN"] = "scan";
|
|
229
|
+
return WarehouseInventoryRowSource2;
|
|
230
|
+
})(WarehouseInventoryRowSource || {});
|
|
231
|
+
const STOCKTAKE_STATUS = {
|
|
232
|
+
waiting: "sys.edhr.stocktakeStatusEnum.waiting",
|
|
233
|
+
surplus: "sys.edhr.stocktakeStatusEnum.surplus",
|
|
234
|
+
loss: "sys.edhr.stocktakeStatusEnum.loss",
|
|
235
|
+
equals: "sys.edhr.stocktakeStatusEnum.equals"
|
|
236
|
+
};
|
|
237
|
+
const F$2 = {
|
|
238
|
+
batch: "production_identification_id_",
|
|
239
|
+
batchLb: "production_identification_id__lb_",
|
|
240
|
+
product: "product_id_",
|
|
241
|
+
productLb: "product_id__lb_",
|
|
242
|
+
productName: "product_id_name_",
|
|
243
|
+
productCode: "product_id_code_",
|
|
244
|
+
productSpec: "product_id_spec_",
|
|
245
|
+
warehouse: "warehouse_id_",
|
|
246
|
+
location: "location_id_",
|
|
247
|
+
locationLb: "location_id__lb_",
|
|
248
|
+
stock: "stock_num_",
|
|
249
|
+
stocktake: "stocktake_num_",
|
|
250
|
+
diff: "diff_num_",
|
|
251
|
+
stocktakeStatus: "stocktake_status_",
|
|
252
|
+
stocktakeStatusLb: "stocktake_status__lb_",
|
|
253
|
+
matno: "material_no_",
|
|
254
|
+
matcode: "product_code_",
|
|
255
|
+
locationAutoResolved: "_location_auto_resolved_",
|
|
256
|
+
inventoryLocationIds: "_inventory_location_ids_",
|
|
257
|
+
rowSource: "row_source_"
|
|
258
|
+
};
|
|
259
|
+
const INVENTORY_INFO_APPLY_FIELDS = [
|
|
260
|
+
F$2.batch,
|
|
261
|
+
// F.product,
|
|
262
|
+
F$2.productName,
|
|
263
|
+
F$2.productCode,
|
|
264
|
+
F$2.productSpec,
|
|
265
|
+
F$2.warehouse,
|
|
266
|
+
F$2.location,
|
|
267
|
+
F$2.stock
|
|
268
|
+
];
|
|
269
|
+
const AUTO_LOAD_READONLY_SELECT_FIELDS = [F$2.product, F$2.batch, F$2.location];
|
|
270
|
+
const WAREHOUSE_IDENTITY_GROUP_KEYS = [F$2.batch, F$2.product, F$2.warehouse];
|
|
271
|
+
const SCAN_MERGE_GROUP_KEYS = [F$2.batch, F$2.product, F$2.warehouse, F$2.location];
|
|
272
|
+
const INVENTORY_BASE_FIELDS = [
|
|
273
|
+
F$2.batch,
|
|
274
|
+
F$2.product,
|
|
275
|
+
F$2.productName,
|
|
276
|
+
F$2.productCode,
|
|
277
|
+
F$2.productSpec,
|
|
278
|
+
F$2.warehouse
|
|
279
|
+
];
|
|
280
|
+
function buildRowGroupKey(row, fieldKeys, separator = "|") {
|
|
281
|
+
return fieldKeys.map((key) => String(row[key] ?? "")).join(separator);
|
|
282
|
+
}
|
|
283
|
+
function toNumber(value, fallback = 0) {
|
|
284
|
+
const num = Number(value);
|
|
285
|
+
return Number.isNaN(num) ? fallback : num;
|
|
286
|
+
}
|
|
287
|
+
function isBlank(value) {
|
|
288
|
+
return value == null || value === "";
|
|
289
|
+
}
|
|
290
|
+
function pickInventoryBase(record) {
|
|
291
|
+
return Object.fromEntries(
|
|
292
|
+
INVENTORY_BASE_FIELDS.map((key) => [key, record[key]])
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
function mapInventoryRecordToRow(record) {
|
|
296
|
+
return {
|
|
297
|
+
...pickInventoryBase(record),
|
|
298
|
+
[F$2.location]: record[F$2.location],
|
|
299
|
+
[F$2.stock]: toNumber(record[F$2.stock])
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function mergeInventoryByWarehouse(items) {
|
|
303
|
+
const [first] = items;
|
|
304
|
+
return {
|
|
305
|
+
...pickInventoryBase(first),
|
|
306
|
+
[F$2.stock]: items.reduce((sum, item) => sum + toNumber(item[F$2.stock]), 0)
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function buildWarehouseGroupKey(record) {
|
|
310
|
+
return buildRowGroupKey(record, WAREHOUSE_IDENTITY_GROUP_KEYS);
|
|
311
|
+
}
|
|
312
|
+
function buildScanMergeKey(record) {
|
|
313
|
+
return buildRowGroupKey(record, SCAN_MERGE_GROUP_KEYS);
|
|
314
|
+
}
|
|
315
|
+
function groupByWarehouseIdentity(records) {
|
|
316
|
+
const groups = /* @__PURE__ */ new Map();
|
|
317
|
+
for (const record of records) {
|
|
318
|
+
const key = buildWarehouseGroupKey(record);
|
|
319
|
+
let bucket = groups.get(key);
|
|
320
|
+
if (!bucket) {
|
|
321
|
+
bucket = [];
|
|
322
|
+
groups.set(key, bucket);
|
|
323
|
+
}
|
|
324
|
+
bucket.push(record);
|
|
325
|
+
}
|
|
326
|
+
return groups;
|
|
327
|
+
}
|
|
328
|
+
function getStocktakeDiff(stocktakeNum, stockNum) {
|
|
329
|
+
if (isBlank(stocktakeNum)) {
|
|
330
|
+
return void 0;
|
|
331
|
+
}
|
|
332
|
+
const stocktake = toNumber(stocktakeNum);
|
|
333
|
+
if (Number.isNaN(stocktake)) {
|
|
334
|
+
return void 0;
|
|
335
|
+
}
|
|
336
|
+
return stocktake - toNumber(stockNum);
|
|
337
|
+
}
|
|
338
|
+
function buildStocktakeDerived(stocktakeNum, stockNum) {
|
|
339
|
+
const diff = getStocktakeDiff(stocktakeNum, stockNum);
|
|
340
|
+
let status;
|
|
341
|
+
if (diff == null) {
|
|
342
|
+
status = "waiting";
|
|
343
|
+
} else if (diff > 0) {
|
|
344
|
+
status = "surplus";
|
|
345
|
+
} else if (diff < 0) {
|
|
346
|
+
status = "loss";
|
|
347
|
+
} else {
|
|
348
|
+
status = "equals";
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
diff,
|
|
352
|
+
status,
|
|
353
|
+
statusLabel: STOCKTAKE_STATUS[status]
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function groupRecordsByInventoryIdentity(records) {
|
|
357
|
+
return Array.from(groupByWarehouseIdentity(records).values());
|
|
358
|
+
}
|
|
359
|
+
function dispositionScanRecord(record, visibleRows, groupByWarehouse) {
|
|
360
|
+
if (groupByWarehouse) {
|
|
361
|
+
const key = buildWarehouseGroupKey(record);
|
|
362
|
+
const index = visibleRows.findIndex((row) => buildWarehouseGroupKey(row) === key);
|
|
363
|
+
return index >= 0 ? { kind: "accumulate", index } : { kind: "unprocessed" };
|
|
364
|
+
}
|
|
365
|
+
const scanKey = buildScanMergeKey(record);
|
|
366
|
+
const warehouseKey = buildWarehouseGroupKey(record);
|
|
367
|
+
let hasWaitingRow = false;
|
|
368
|
+
for (let i = 0; i < visibleRows.length; i++) {
|
|
369
|
+
const row = visibleRows[i];
|
|
370
|
+
if (buildScanMergeKey(row) === scanKey) {
|
|
371
|
+
if (isBlank(row[F$2.location])) {
|
|
372
|
+
return { kind: "skip-location-not-selected" };
|
|
373
|
+
}
|
|
374
|
+
return { kind: "accumulate", index: i };
|
|
375
|
+
}
|
|
376
|
+
if (!hasWaitingRow && buildWarehouseGroupKey(row) === warehouseKey && isBlank(row[F$2.location])) {
|
|
377
|
+
hasWaitingRow = true;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return hasWaitingRow ? { kind: "skip-location-not-selected" } : { kind: "unprocessed" };
|
|
381
|
+
}
|
|
382
|
+
function pickRecordsForNewScanRow(unprocessed, groupByWarehouse) {
|
|
383
|
+
if (!unprocessed.length) {
|
|
384
|
+
return {
|
|
385
|
+
records: [],
|
|
386
|
+
productGroupCount: 0
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
const productGroups = groupRecordsByInventoryIdentity(unprocessed);
|
|
390
|
+
const productRecords = productGroups[0] ?? [];
|
|
391
|
+
if (!productRecords.length) {
|
|
392
|
+
return {
|
|
393
|
+
records: [],
|
|
394
|
+
productGroupCount: productGroups.length
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
return {
|
|
398
|
+
records: groupByWarehouse || productRecords.length > 1 ? productRecords : [productRecords[0]],
|
|
399
|
+
productGroupCount: productGroups.length
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
function applyScanQtyToStocktake(current, scanQty, type) {
|
|
403
|
+
if (isBlank(scanQty)) {
|
|
404
|
+
return current;
|
|
405
|
+
}
|
|
406
|
+
const qtyNum = toNumber(scanQty);
|
|
407
|
+
if (Number.isNaN(qtyNum)) {
|
|
408
|
+
return current;
|
|
409
|
+
}
|
|
410
|
+
const base = isBlank(current) ? 0 : toNumber(current);
|
|
411
|
+
return base + (type === "minus" ? -qtyNum : qtyNum);
|
|
412
|
+
}
|
|
413
|
+
function accumulateScanQtyOnRow(visibleRows, rowIndex, scanQty, type) {
|
|
414
|
+
const nextRows = [...visibleRows];
|
|
415
|
+
const caculateNum = applyScanQtyToStocktake(nextRows[rowIndex][F$2.stocktake], scanQty, type);
|
|
416
|
+
if (toNumber(caculateNum) >= 0) {
|
|
417
|
+
nextRows[rowIndex] = {
|
|
418
|
+
...nextRows[rowIndex],
|
|
419
|
+
[F$2.stocktake]: caculateNum
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
return {
|
|
423
|
+
rows: nextRows,
|
|
424
|
+
mergedIndex: rowIndex,
|
|
425
|
+
shouldWarning: toNumber(caculateNum) < 0
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
function appendScanRowFromResolve(visibleRows, rowData) {
|
|
429
|
+
return {
|
|
430
|
+
rows: [
|
|
431
|
+
...visibleRows,
|
|
432
|
+
{
|
|
433
|
+
...rowData,
|
|
434
|
+
[F$2.rowSource]: "scan"
|
|
435
|
+
}
|
|
436
|
+
],
|
|
437
|
+
mergedIndex: visibleRows.length
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
function groupInventoryToStocktakeRows(records, groupByWarehouse) {
|
|
441
|
+
if (!groupByWarehouse) {
|
|
442
|
+
return records.map(mapInventoryRecordToRow);
|
|
443
|
+
}
|
|
444
|
+
return Array.from(groupByWarehouseIdentity(records).values()).map(mergeInventoryByWarehouse);
|
|
445
|
+
}
|
|
446
|
+
function shouldAssignScanQty(options) {
|
|
447
|
+
const { assignScanQty, scanQty, rowIndex, qtyAssignedRowIndexes } = options;
|
|
448
|
+
if (!assignScanQty || scanQty == null || scanQty === "") {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
return !qtyAssignedRowIndexes.has(rowIndex);
|
|
452
|
+
}
|
|
453
|
+
function resolveScanRecords(groupByWarehouse, records) {
|
|
454
|
+
const row = { ...records[0] };
|
|
455
|
+
if (!groupByWarehouse) {
|
|
456
|
+
const allLocationIds = records.map((e2) => e2[F$2.location]);
|
|
457
|
+
row[F$2.location] = allLocationIds.length > 1 ? void 0 : allLocationIds[0];
|
|
458
|
+
row[F$2.inventoryLocationIds] = allLocationIds;
|
|
459
|
+
} else {
|
|
460
|
+
row[F$2.stock] = records.reduce((acc, cur) => acc + toNumber(cur[F$2.stock]), 0);
|
|
461
|
+
}
|
|
462
|
+
return row;
|
|
463
|
+
}
|
|
464
|
+
async function getStockData({
|
|
465
|
+
warehouse_id_,
|
|
466
|
+
material_no_,
|
|
467
|
+
location_id_,
|
|
468
|
+
product_code_,
|
|
469
|
+
production_identification_id_
|
|
470
|
+
}) {
|
|
471
|
+
const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
472
|
+
{
|
|
473
|
+
modelCategory: "entity",
|
|
474
|
+
bsKey: "biz_get_inventory_info",
|
|
475
|
+
modelKey: "em_inventory"
|
|
476
|
+
},
|
|
477
|
+
{},
|
|
478
|
+
{
|
|
479
|
+
warehouse_id_,
|
|
480
|
+
material_no_,
|
|
481
|
+
location_id_,
|
|
482
|
+
product_code_,
|
|
483
|
+
production_identification_id_
|
|
484
|
+
}
|
|
485
|
+
);
|
|
486
|
+
return res || [];
|
|
487
|
+
}
|
|
488
|
+
class StocktakeTableCore extends SubTableCore {
|
|
489
|
+
initData = [];
|
|
490
|
+
get isGroupByWarehouse() {
|
|
491
|
+
return !!this.ctx.widget?.props?.isGroupByWarehouse;
|
|
492
|
+
}
|
|
493
|
+
get paramsWarehouseId() {
|
|
494
|
+
return (this.pageCtx?.paramsConfig || {}).warehouseId;
|
|
495
|
+
}
|
|
496
|
+
/** 绘制UI相关工具 */
|
|
497
|
+
get render() {
|
|
498
|
+
return window.NocodeAdapter.stocktakeRender;
|
|
499
|
+
}
|
|
500
|
+
async compUnmount() {
|
|
501
|
+
super.compUnmount();
|
|
502
|
+
this.render.destroyAllModals();
|
|
503
|
+
}
|
|
504
|
+
calcFieldStatus(params) {
|
|
505
|
+
const result = super.calcFieldStatus(params);
|
|
506
|
+
const { field, rowData } = params;
|
|
507
|
+
const { row_source_: source } = rowData;
|
|
508
|
+
if (field == F$2.stocktake) return result;
|
|
509
|
+
if (!Object.values(F$2).includes(field)) return result;
|
|
510
|
+
if (source === WarehouseInventoryRowSource.SCAN) {
|
|
511
|
+
result.disabled = F$2.location !== field;
|
|
512
|
+
} else if (source === WarehouseInventoryRowSource.AUTO) {
|
|
513
|
+
result.disabled = true;
|
|
514
|
+
} else if (!source || source === WarehouseInventoryRowSource.MANUAL) {
|
|
515
|
+
result.disabled = !AUTO_LOAD_READONLY_SELECT_FIELDS.includes(field);
|
|
516
|
+
} else result.disabled = true;
|
|
517
|
+
return result;
|
|
518
|
+
}
|
|
519
|
+
calcFieldQuery = (params) => {
|
|
520
|
+
const { field, rowData } = params;
|
|
521
|
+
if (field === F$2.location && rowData[F$2.inventoryLocationIds]) {
|
|
522
|
+
return {
|
|
523
|
+
"id_.in": rowData[F$2.inventoryLocationIds]
|
|
524
|
+
};
|
|
525
|
+
} else if (field === F$2.product) {
|
|
526
|
+
return {
|
|
527
|
+
warehouse_id_: this.paramsWarehouseId
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
handleFieldTd = (params) => {
|
|
532
|
+
const { field, tdHandler } = params;
|
|
533
|
+
if (field === "product_id_") {
|
|
534
|
+
tdHandler.mergeTd({
|
|
535
|
+
cellWidget: {
|
|
536
|
+
props: {
|
|
537
|
+
customRenderTag: "allocateProduct",
|
|
538
|
+
newSpecificConfig: {
|
|
539
|
+
newOptions: []
|
|
540
|
+
//禁用初始选项
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
super.handleFieldTd(params);
|
|
547
|
+
};
|
|
548
|
+
calcSubTableActionMenu = (params) => {
|
|
549
|
+
const menus = [
|
|
550
|
+
{
|
|
551
|
+
type: "subtitle",
|
|
552
|
+
label: $t("sys.edhr.bizOperation")
|
|
553
|
+
},
|
|
554
|
+
getMenuByAction(SubTableActionEnum.SCAN),
|
|
555
|
+
getMenuByAction(SubTableActionEnum.CHANGE_PARSE_RULE),
|
|
556
|
+
{
|
|
557
|
+
type: SubTableActionMenuTypeEnum.DIVIDER
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
type: "subtitle",
|
|
561
|
+
label: $t("sys.edhr.editRow")
|
|
562
|
+
},
|
|
563
|
+
getMenuByAction(SubTableActionEnum.Insert1RowAfter),
|
|
564
|
+
// getInsertSubMenu(),
|
|
565
|
+
...params.showDelBtn ? [
|
|
566
|
+
{
|
|
567
|
+
type: SubTableActionMenuTypeEnum.DIVIDER
|
|
568
|
+
},
|
|
569
|
+
getMenuByAction(SubTableActionEnum.DeleteRowCurrent)
|
|
570
|
+
] : []
|
|
571
|
+
];
|
|
572
|
+
return menus;
|
|
573
|
+
};
|
|
574
|
+
/**
|
|
575
|
+
* 初始化时,需要执行的异步方法
|
|
576
|
+
*/
|
|
577
|
+
async init() {
|
|
578
|
+
const { autoLoadStock, barcodeParsingRules } = this.bizTableConfig || {};
|
|
579
|
+
if (barcodeParsingRules) {
|
|
580
|
+
this.scanRuleProps = this.bizTableConfig.barcodeParsingRules;
|
|
581
|
+
this.scanRuleInfo = await getParseRuleInfo({ id: this.scanRuleProps.parsingRuleId });
|
|
582
|
+
}
|
|
583
|
+
if (this.isDataProcessed || !autoLoadStock || !this.paramsWarehouseId) return;
|
|
584
|
+
const res = await getStockData({ warehouse_id_: this.paramsWarehouseId });
|
|
585
|
+
this.initData = groupInventoryToStocktakeRows(res, this.isGroupByWarehouse).map((e2) => {
|
|
586
|
+
calcRowData(e2);
|
|
587
|
+
e2.row_source_ = "auto";
|
|
588
|
+
return e2;
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* @param params 初始化塞默认数据,不能用异步,只有未填报时才会执行
|
|
593
|
+
* @returns
|
|
594
|
+
*/
|
|
595
|
+
handleInitializeFormState(params) {
|
|
596
|
+
return this.initData;
|
|
597
|
+
}
|
|
598
|
+
handleChange = async (params) => {
|
|
599
|
+
const { field, rowData, value, option } = params;
|
|
600
|
+
console.log("params-----change", params, pick(option, INVENTORY_INFO_APPLY_FIELDS));
|
|
601
|
+
if (field === F$2.product) {
|
|
602
|
+
merge(rowData, pick(option, INVENTORY_INFO_APPLY_FIELDS));
|
|
603
|
+
}
|
|
604
|
+
calcRowData(rowData);
|
|
605
|
+
};
|
|
606
|
+
/**
|
|
607
|
+
* 解析扫码的数据
|
|
608
|
+
*/
|
|
609
|
+
async onScan({ barcode, type }) {
|
|
610
|
+
const { lot, materialCode, qty = 0 } = getParseRuleValue(barcode, this.scanRuleInfo.rules_);
|
|
611
|
+
if (!lot) {
|
|
612
|
+
this.warning({ content: "条码中未解析到批次号" });
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
const res = await getStockData({
|
|
616
|
+
material_no_: lot,
|
|
617
|
+
product_code_: materialCode,
|
|
618
|
+
warehouse_id_: this.paramsWarehouseId
|
|
619
|
+
});
|
|
620
|
+
if (res?.length) {
|
|
621
|
+
const materialGroups = groupRecordsByInventoryIdentity(res);
|
|
622
|
+
const assignScanQty = materialGroups.length === 1;
|
|
623
|
+
console.log("materialGroups========", materialGroups);
|
|
624
|
+
const mergedIndexes = [];
|
|
625
|
+
let totalSkippedForLocation = 0;
|
|
626
|
+
const visibleRows = this.tableData.filter((e2) => !e2.deleted_);
|
|
627
|
+
const deletedRows = this.tableData.filter((e2) => e2.deleted_);
|
|
628
|
+
const warningList = [];
|
|
629
|
+
for (let i = 0; i < materialGroups.length; i += 1) {
|
|
630
|
+
const groupRecords = materialGroups[i];
|
|
631
|
+
const result = processScanRecordGroup({
|
|
632
|
+
groupRecords,
|
|
633
|
+
visibleRows,
|
|
634
|
+
groupByWarehouse: this.isGroupByWarehouse,
|
|
635
|
+
scanQty: qty || 1,
|
|
636
|
+
scanAdjustType: type,
|
|
637
|
+
assignScanQty
|
|
638
|
+
});
|
|
639
|
+
console.log("result========", result);
|
|
640
|
+
this.tableData = [...result.rows, ...deletedRows];
|
|
641
|
+
mergedIndexes.push(...result.mergedIndexes);
|
|
642
|
+
totalSkippedForLocation += result.skippedForLocation;
|
|
643
|
+
warningList.push(...result.messageList);
|
|
644
|
+
}
|
|
645
|
+
if (totalSkippedForLocation > 0) {
|
|
646
|
+
this.warning({
|
|
647
|
+
content: totalSkippedForLocation === 1 ? "相同物料行尚未选择库位,已忽略 1 条扫码数据" : `相同物料行尚未选择库位,已忽略 ${totalSkippedForLocation} 条扫码数据`
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
if (warningList.length) {
|
|
651
|
+
warningList.forEach((e2) => {
|
|
652
|
+
this.warning({ content: e2 });
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
if (!mergedIndexes.length) {
|
|
656
|
+
if (totalSkippedForLocation === 0) {
|
|
657
|
+
this.error({ content: "扫描结果解析失败" });
|
|
658
|
+
}
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
function calcRowData(rowData, stocktakeNum) {
|
|
665
|
+
const { stock_num_, stocktake_num_ } = rowData;
|
|
666
|
+
const { diff, status, statusLabel } = buildStocktakeDerived(
|
|
667
|
+
stocktake_num_,
|
|
668
|
+
stock_num_
|
|
669
|
+
);
|
|
670
|
+
rowData.diff_num_ = diff;
|
|
671
|
+
rowData.stocktake_status_ = status;
|
|
672
|
+
rowData.stocktake_status__lb_ = $t(statusLabel);
|
|
673
|
+
}
|
|
674
|
+
function processScanRecordGroup(options) {
|
|
675
|
+
const { groupRecords, groupByWarehouse, scanQty, scanAdjustType, assignScanQty } = options;
|
|
676
|
+
let visibleRows = options.visibleRows;
|
|
677
|
+
const mergedIndexes = [];
|
|
678
|
+
const unprocessed = [];
|
|
679
|
+
let skippedForLocation = 0;
|
|
680
|
+
let accumulated = 0;
|
|
681
|
+
const qtyAssignedRowIndexes = /* @__PURE__ */ new Set();
|
|
682
|
+
const messageList = [];
|
|
683
|
+
for (const record of groupRecords) {
|
|
684
|
+
const disposition = dispositionScanRecord(record, visibleRows, groupByWarehouse);
|
|
685
|
+
if (disposition.kind === "accumulate") {
|
|
686
|
+
accumulated += 1;
|
|
687
|
+
const qtyCheck = {
|
|
688
|
+
assignScanQty,
|
|
689
|
+
scanQty,
|
|
690
|
+
rowIndex: disposition.index,
|
|
691
|
+
qtyAssignedRowIndexes
|
|
692
|
+
};
|
|
693
|
+
const shouldAddQty = shouldAssignScanQty(qtyCheck);
|
|
694
|
+
const result = accumulateScanQtyOnRow(
|
|
695
|
+
visibleRows,
|
|
696
|
+
disposition.index,
|
|
697
|
+
shouldAddQty ? scanQty : void 0,
|
|
698
|
+
scanAdjustType
|
|
699
|
+
);
|
|
700
|
+
if (result.shouldWarning) {
|
|
701
|
+
messageList.push($t("sys.edhr.stocktakeScanWarning"));
|
|
702
|
+
}
|
|
703
|
+
if (shouldAddQty) {
|
|
704
|
+
qtyAssignedRowIndexes.add(disposition.index);
|
|
705
|
+
}
|
|
706
|
+
calcRowData(result.rows[disposition.index]);
|
|
707
|
+
visibleRows = result.rows;
|
|
708
|
+
if (!mergedIndexes.includes(result.mergedIndex)) {
|
|
709
|
+
mergedIndexes.push(result.mergedIndex);
|
|
710
|
+
}
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
713
|
+
if (disposition.kind === "skip-location-not-selected") {
|
|
714
|
+
skippedForLocation += 1;
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
unprocessed.push(record);
|
|
718
|
+
}
|
|
719
|
+
const appended = appendUnresolvedScanRecords({
|
|
720
|
+
unprocessed,
|
|
721
|
+
visibleRows,
|
|
722
|
+
groupByWarehouse,
|
|
723
|
+
scanQty,
|
|
724
|
+
scanAdjustType,
|
|
725
|
+
assignScanQty: assignScanQty && mergedIndexes.length === 0
|
|
726
|
+
});
|
|
727
|
+
visibleRows = appended.rows;
|
|
728
|
+
const appendedCount = appended.mergedIndex != null ? 1 : 0;
|
|
729
|
+
if (appendedCount > 0 && appended.appendMeta) ;
|
|
730
|
+
if (appended.mergedIndex != null) {
|
|
731
|
+
mergedIndexes.push(appended.mergedIndex);
|
|
732
|
+
}
|
|
733
|
+
const stats = {
|
|
734
|
+
total: groupRecords.length,
|
|
735
|
+
accumulated,
|
|
736
|
+
skipped: skippedForLocation,
|
|
737
|
+
unprocessed: unprocessed.length,
|
|
738
|
+
appended: appendedCount
|
|
739
|
+
};
|
|
740
|
+
return { rows: visibleRows, mergedIndexes, skippedForLocation, stats, messageList };
|
|
741
|
+
}
|
|
742
|
+
function appendUnresolvedScanRecords(options) {
|
|
743
|
+
const { unprocessed, visibleRows, groupByWarehouse, scanQty, scanAdjustType, assignScanQty } = options;
|
|
744
|
+
if (!unprocessed.length) return { rows: visibleRows };
|
|
745
|
+
const { records: recordsForNewRow, productGroupCount } = pickRecordsForNewScanRow(
|
|
746
|
+
unprocessed,
|
|
747
|
+
groupByWarehouse
|
|
748
|
+
);
|
|
749
|
+
if (!recordsForNewRow.length) return { rows: visibleRows };
|
|
750
|
+
const rowData = buildRowFromResolve(
|
|
751
|
+
resolveScanRecords(groupByWarehouse, recordsForNewRow),
|
|
752
|
+
scanQty,
|
|
753
|
+
// 多库位候选时 records 多条,但条码 qty 仍应写入新建行
|
|
754
|
+
assignScanQty,
|
|
755
|
+
scanAdjustType
|
|
756
|
+
);
|
|
757
|
+
calcRowData(rowData);
|
|
758
|
+
const appended = appendScanRowFromResolve(visibleRows, rowData);
|
|
759
|
+
return {
|
|
760
|
+
rows: appended.rows,
|
|
761
|
+
mergedIndex: appended.mergedIndex,
|
|
762
|
+
appendMeta: {
|
|
763
|
+
unprocessedCount: unprocessed.length,
|
|
764
|
+
productGroupCount,
|
|
765
|
+
usedForNewRow: recordsForNewRow.length,
|
|
766
|
+
multiLocationPending: !groupByWarehouse && recordsForNewRow.length > 1
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
function buildRowFromResolve(row, scanQty, assignScanQty = false, scanAdjustType = "add") {
|
|
771
|
+
const rowData = {
|
|
772
|
+
...row,
|
|
773
|
+
[F$2.rowSource]: "scan"
|
|
774
|
+
};
|
|
775
|
+
if (assignScanQty && scanQty != null && scanQty !== "") {
|
|
776
|
+
rowData[F$2.stocktake] = applyScanQtyToStocktake(void 0, scanQty, scanAdjustType);
|
|
777
|
+
}
|
|
778
|
+
return rowData;
|
|
779
|
+
}
|
|
780
|
+
async function fetchInventoryInfo({
|
|
781
|
+
warehouse_id_,
|
|
782
|
+
material_no_,
|
|
783
|
+
location_id_,
|
|
784
|
+
product_code_,
|
|
785
|
+
production_identification_id_
|
|
786
|
+
}) {
|
|
787
|
+
const res = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
|
|
788
|
+
{
|
|
789
|
+
modelCategory: "entity",
|
|
790
|
+
bsKey: "biz_get_inventory_info",
|
|
791
|
+
modelKey: "em_inventory"
|
|
792
|
+
},
|
|
793
|
+
{},
|
|
794
|
+
{
|
|
795
|
+
warehouse_id_,
|
|
796
|
+
material_no_,
|
|
797
|
+
location_id_,
|
|
798
|
+
product_code_,
|
|
799
|
+
production_identification_id_
|
|
800
|
+
}
|
|
801
|
+
);
|
|
802
|
+
return res || [];
|
|
803
|
+
}
|
|
804
|
+
class AllocateTableCore extends SubTableCore {
|
|
805
|
+
/** 绘制UI相关工具 */
|
|
806
|
+
get render() {
|
|
807
|
+
return window.NocodeAdapter.allocateRender;
|
|
808
|
+
}
|
|
809
|
+
/** 指定的仓库id */
|
|
810
|
+
get warehouseId() {
|
|
811
|
+
return this.factory.ctx.paramsConfig?.warehouseId;
|
|
812
|
+
}
|
|
813
|
+
async compUnmount() {
|
|
814
|
+
super.compUnmount();
|
|
815
|
+
this.render.destroyAllModals();
|
|
816
|
+
}
|
|
817
|
+
calcDefaultMap = () => {
|
|
818
|
+
return {
|
|
819
|
+
origin_warehouse_id_: this.warehouseId
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
handleFieldTd = (params) => {
|
|
823
|
+
const { field, tdHandler } = params;
|
|
824
|
+
if (field === "product_id_") {
|
|
825
|
+
tdHandler.mergeTd({
|
|
826
|
+
cellWidget: {
|
|
827
|
+
props: {
|
|
828
|
+
customRenderTag: "allocateProduct",
|
|
829
|
+
newSpecificConfig: {
|
|
830
|
+
newOptions: []
|
|
831
|
+
//禁用初始选项
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
super.handleFieldTd(params);
|
|
838
|
+
};
|
|
839
|
+
calcFieldStatus = (params) => {
|
|
840
|
+
const result = super.calcFieldStatus(params);
|
|
841
|
+
const { field } = params;
|
|
842
|
+
if ([
|
|
843
|
+
"product_id_name_",
|
|
844
|
+
"product_id_code_",
|
|
845
|
+
"product_id_spec_",
|
|
846
|
+
"stock_num_",
|
|
847
|
+
"validity_",
|
|
848
|
+
"origin_warehouse_id_",
|
|
849
|
+
"origin_location_id_",
|
|
850
|
+
"production_identification_id_"
|
|
851
|
+
].includes(field)) {
|
|
852
|
+
result.disabled = true;
|
|
853
|
+
}
|
|
854
|
+
return result;
|
|
855
|
+
};
|
|
856
|
+
calcFieldQuery = (params) => {
|
|
857
|
+
const { field, rowData } = params;
|
|
858
|
+
if (field === "location_id_") {
|
|
859
|
+
return {
|
|
860
|
+
"warehouse_id_.eq": rowData.warehouse_id_
|
|
861
|
+
};
|
|
862
|
+
} else if (field === "origin_location_id_") {
|
|
863
|
+
return {
|
|
864
|
+
"warehouse_id_.eq": rowData.origin_warehouse_id_
|
|
865
|
+
};
|
|
866
|
+
} else if (field === "product_id_") {
|
|
867
|
+
return {
|
|
868
|
+
warehouse_id_: this.warehouseId
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
calcSubTableActionMenu = (params) => {
|
|
873
|
+
const { showDelBtn } = params;
|
|
874
|
+
const menus = [
|
|
875
|
+
// {
|
|
876
|
+
// type: SubTableActionMenuTypeEnum.SUBTITLE,
|
|
877
|
+
// label: '业务操作',
|
|
878
|
+
// },
|
|
879
|
+
// getMenuByAction(SubTableActionEnum.SCAN),
|
|
880
|
+
// getMenuByAction(SubTableActionEnum.CHANGE_PARSE_RULE),
|
|
881
|
+
// {
|
|
882
|
+
// type: SubTableActionMenuTypeEnum.DIVIDER,
|
|
883
|
+
// },
|
|
884
|
+
// {
|
|
885
|
+
// type: SubTableActionMenuTypeEnum.SUBTITLE,
|
|
886
|
+
// label: '行编辑',
|
|
887
|
+
// },
|
|
888
|
+
getMenuByAction(SubTableActionEnum.Insert1RowAfter),
|
|
889
|
+
getCopySubMenu(),
|
|
890
|
+
getInsertSubMenu(),
|
|
891
|
+
...showDelBtn ? [
|
|
892
|
+
{
|
|
893
|
+
type: SubTableActionMenuTypeEnum.DIVIDER
|
|
894
|
+
},
|
|
895
|
+
getMenuByAction(SubTableActionEnum.DeleteRowCurrent)
|
|
896
|
+
] : []
|
|
897
|
+
].filter(Boolean);
|
|
898
|
+
return menus;
|
|
899
|
+
};
|
|
900
|
+
handleChange = (params) => {
|
|
901
|
+
const { field, value, option, rowData } = params;
|
|
902
|
+
const _rowData = rowData;
|
|
903
|
+
if (field === "product_id_") {
|
|
904
|
+
console.log("物料变更", option);
|
|
905
|
+
_rowData.product_id_name_ = option?.product_id_name_;
|
|
906
|
+
_rowData.product_id_code_ = option?.product_id_code_;
|
|
907
|
+
_rowData.product_id_spec_ = option?.product_id_spec_;
|
|
908
|
+
_rowData.production_identification_id_ = option?.production_identification_id_;
|
|
909
|
+
_rowData.origin_warehouse_id_ = option?.warehouse_id_;
|
|
910
|
+
_rowData.origin_location_id_ = option?.location_id_;
|
|
911
|
+
_rowData.stock_num_ = option?.stock_num_;
|
|
912
|
+
_rowData.validity_ = option?.validate_;
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
async onScan({ str }) {
|
|
916
|
+
const data = getParseRuleValue(str, this.scanRuleInfo.rules_);
|
|
917
|
+
console.log("parseScanStr", data);
|
|
918
|
+
const arr = await fetchInventoryInfo({
|
|
919
|
+
warehouse_id_: this.warehouseId,
|
|
920
|
+
product_code_: data.materialCode
|
|
921
|
+
});
|
|
922
|
+
if (!arr?.length) {
|
|
923
|
+
this.error({ content: "扫描的物料不存在" });
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
const info = arr[0];
|
|
927
|
+
const row = {
|
|
928
|
+
product_id_: info.product_id_,
|
|
929
|
+
product_id_name_: info.product_id_name_,
|
|
930
|
+
product_id_code_: info.product_id_code_,
|
|
931
|
+
product_id_spec_: info.product_id_spec_,
|
|
932
|
+
production_identification_id_: info.production_identification_id_,
|
|
933
|
+
origin_location_id_: info.location_id_,
|
|
934
|
+
origin_warehouse_id_: info.warehouse_id_,
|
|
935
|
+
stock_num_: info.stock_num_
|
|
936
|
+
};
|
|
937
|
+
if (data.expiration) {
|
|
938
|
+
row.validity_ = dayjs(data.expiration).format("YYYY-MM-DD");
|
|
939
|
+
}
|
|
940
|
+
if (this.scanRuleProps?.fillMapArr?.length) {
|
|
941
|
+
const fillData = calcFillData(data, this.scanRuleProps.fillMapArr);
|
|
942
|
+
console.log("fillData", fillData);
|
|
943
|
+
Object.assign(row, fillData);
|
|
944
|
+
}
|
|
945
|
+
this.tableData = [...this.tableData, row];
|
|
946
|
+
}
|
|
947
|
+
beforeBtnClick = async (params) => {
|
|
948
|
+
const { btn } = params;
|
|
949
|
+
if (btn.type === "Submit" && btn.buttonType === "builtin") {
|
|
950
|
+
const calcUniqueKey = (key1, key2) => `${key1 ?? ""}:${key2 ?? ""}`;
|
|
951
|
+
const find = this.tableData.find(
|
|
952
|
+
(i) => calcUniqueKey(i.origin_warehouse_id_, i.origin_location_id_) === calcUniqueKey(i.warehouse_id_, i.location_id_)
|
|
953
|
+
);
|
|
954
|
+
if (find) {
|
|
955
|
+
const isPass = await this.openUtil.confirmModal({
|
|
956
|
+
content: "调拨的源仓库和目标仓库一致,是否确认执行?"
|
|
957
|
+
});
|
|
958
|
+
if (!isPass) {
|
|
959
|
+
throw new Error("用户取消提交");
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
const F$1 = {
|
|
966
|
+
/** 产品 */
|
|
967
|
+
product: "product_id_",
|
|
968
|
+
/** 产品标签 */
|
|
969
|
+
productLb: "product_id__lb_",
|
|
970
|
+
/** 产品名称 */
|
|
971
|
+
productName: "product_id_name_",
|
|
972
|
+
/** 产品编码 */
|
|
973
|
+
productCode: "product_id_code_",
|
|
974
|
+
/** 产品规格 */
|
|
975
|
+
productSpec: "product_id_spec_",
|
|
976
|
+
/** 生产批次号 */
|
|
977
|
+
productionContainer: "production_container_id_",
|
|
978
|
+
/** 数量 */
|
|
979
|
+
qty: "qty_",
|
|
980
|
+
/** 工单号 */
|
|
981
|
+
mfgOrderCode: "mfg_order_code_",
|
|
982
|
+
/** 工单 */
|
|
983
|
+
mfgOrder: "mfg_order_id_",
|
|
984
|
+
/** 工单标签 */
|
|
985
|
+
mfgOrderLb: "mfg_order_id__lb_",
|
|
986
|
+
/** 生产日期 */
|
|
987
|
+
productionDate: "production_date_"
|
|
988
|
+
};
|
|
989
|
+
const STERILIZE_ALWAYS_DISABLED_FIELDS = [
|
|
990
|
+
F$1.product,
|
|
991
|
+
F$1.productCode,
|
|
992
|
+
F$1.productSpec,
|
|
993
|
+
F$1.productName,
|
|
994
|
+
F$1.mfgOrderCode,
|
|
995
|
+
F$1.mfgOrder
|
|
996
|
+
];
|
|
997
|
+
const CLEAR_ON_PROD_CONTAINER_EMPTY$1 = [
|
|
998
|
+
F$1.product,
|
|
999
|
+
F$1.productLb,
|
|
1000
|
+
F$1.productName,
|
|
1001
|
+
F$1.productCode,
|
|
1002
|
+
F$1.productSpec,
|
|
1003
|
+
F$1.qty,
|
|
1004
|
+
F$1.mfgOrderCode,
|
|
1005
|
+
F$1.mfgOrder,
|
|
1006
|
+
F$1.mfgOrderLb,
|
|
1007
|
+
F$1.productionDate
|
|
1008
|
+
];
|
|
1009
|
+
const fillFromOption$1 = [
|
|
1010
|
+
{
|
|
1011
|
+
optionField: F$1.product,
|
|
1012
|
+
toField: F$1.product
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
optionField: F$1.productName,
|
|
1016
|
+
toField: F$1.productName
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
optionField: F$1.productCode,
|
|
1020
|
+
toField: F$1.productCode
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
optionField: F$1.productSpec,
|
|
1024
|
+
toField: F$1.productSpec
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
optionField: F$1.mfgOrder,
|
|
1028
|
+
toField: F$1.mfgOrder
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
optionField: F$1.mfgOrderCode,
|
|
1032
|
+
//工单号
|
|
1033
|
+
toField: F$1.mfgOrderCode
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
optionField: "real_start_date_",
|
|
1037
|
+
//生产日期
|
|
1038
|
+
toField: F$1.productionDate
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
optionField: F$1.qty,
|
|
1042
|
+
toField: F$1.qty
|
|
1043
|
+
}
|
|
1044
|
+
];
|
|
1045
|
+
function applyFillFromOption$1(A, B4) {
|
|
1046
|
+
const writableA = A;
|
|
1047
|
+
fillFromOption$1.forEach(({ optionField, toField }) => {
|
|
1048
|
+
if (has(B4, optionField)) {
|
|
1049
|
+
writableA[toField] = B4[optionField];
|
|
1050
|
+
}
|
|
1051
|
+
});
|
|
1052
|
+
return A;
|
|
1053
|
+
}
|
|
1054
|
+
function mapContainerRowsToOptions(data = []) {
|
|
1055
|
+
return data.map((item) => ({
|
|
1056
|
+
label: item.__LABEL__ ?? item.name_ ?? String(item.id_ ?? item.id ?? ""),
|
|
1057
|
+
value: item.id_ || item.id,
|
|
1058
|
+
disabled: !!item.deleted_,
|
|
1059
|
+
_item: item
|
|
1060
|
+
}));
|
|
1061
|
+
}
|
|
1062
|
+
async function fetchProductionContainerByName$1(name_) {
|
|
1063
|
+
const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
1064
|
+
{
|
|
1065
|
+
modelCategory: "entity",
|
|
1066
|
+
modelKey: "em_production_identification",
|
|
1067
|
+
bsKey: "biz_get_production_identification"
|
|
1068
|
+
},
|
|
1069
|
+
{},
|
|
1070
|
+
{
|
|
1071
|
+
query: { "production_identification_type_.in": ["LOT", "SN"], name_ },
|
|
1072
|
+
exp: "AND(production_identification_type_.in,name_)"
|
|
1073
|
+
}
|
|
1074
|
+
);
|
|
1075
|
+
return normalizeContainerResult$1(res);
|
|
1076
|
+
}
|
|
1077
|
+
function normalizeContainerResult$1(res) {
|
|
1078
|
+
if (!res) return void 0;
|
|
1079
|
+
const data = res?.data ?? res;
|
|
1080
|
+
if (Array.isArray(data)) return data[0];
|
|
1081
|
+
if (typeof data === "object") return data;
|
|
1082
|
+
return void 0;
|
|
1083
|
+
}
|
|
1084
|
+
class SterilizeBatchTableCore extends SubTableCore {
|
|
1085
|
+
/** 触发扫码时的目标行 */
|
|
1086
|
+
scanTargetRow;
|
|
1087
|
+
/** 绘制UI相关工具,一期复用调拨表扫码弹窗 */
|
|
1088
|
+
get render() {
|
|
1089
|
+
return window.NocodeAdapter.allocateRender;
|
|
1090
|
+
}
|
|
1091
|
+
async compUnmount() {
|
|
1092
|
+
super.compUnmount();
|
|
1093
|
+
this.render.destroyAllModals();
|
|
1094
|
+
}
|
|
1095
|
+
async init() {
|
|
1096
|
+
const { barcodeParsingRules } = this.bizTableConfig || {};
|
|
1097
|
+
if (barcodeParsingRules) {
|
|
1098
|
+
this.scanRuleProps = barcodeParsingRules;
|
|
1099
|
+
this.scanRuleInfo = await getParseRuleInfo({ id: this.scanRuleProps.parsingRuleId });
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
calcSubTableActionMenu = (params) => {
|
|
1103
|
+
const { showDelBtn } = params;
|
|
1104
|
+
return [
|
|
1105
|
+
// 一期暂不支持扫码
|
|
1106
|
+
// {
|
|
1107
|
+
// type: SubTableActionMenuTypeEnum.SUBTITLE,
|
|
1108
|
+
// label: $t('sys.edhr.bizOperation'),
|
|
1109
|
+
// },
|
|
1110
|
+
// getMenuByAction(SubTableActionEnum.SCAN),
|
|
1111
|
+
// getMenuByAction(SubTableActionEnum.CHANGE_PARSE_RULE),
|
|
1112
|
+
// {
|
|
1113
|
+
// type: SubTableActionMenuTypeEnum.DIVIDER,
|
|
1114
|
+
// },
|
|
1115
|
+
{
|
|
1116
|
+
type: SubTableActionMenuTypeEnum.SUBTITLE,
|
|
1117
|
+
label: $t("sys.edhr.editRow")
|
|
1118
|
+
},
|
|
1119
|
+
getMenuByAction(SubTableActionEnum.Insert1RowAfter),
|
|
1120
|
+
getInsertSubMenu(),
|
|
1121
|
+
...showDelBtn ? [
|
|
1122
|
+
{
|
|
1123
|
+
type: SubTableActionMenuTypeEnum.DIVIDER
|
|
1124
|
+
},
|
|
1125
|
+
getMenuByAction(SubTableActionEnum.DeleteRowCurrent)
|
|
1126
|
+
] : []
|
|
1127
|
+
].filter(Boolean);
|
|
1128
|
+
};
|
|
1129
|
+
handleMenuClick(params) {
|
|
1130
|
+
const { actionKey, rowData } = params;
|
|
1131
|
+
if (actionKey === SubTableActionEnum.SCAN) {
|
|
1132
|
+
this.scanTargetRow = rowData;
|
|
1133
|
+
this.openScanModal();
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
if (actionKey === SubTableActionEnum.CHANGE_PARSE_RULE) {
|
|
1137
|
+
this.changeScanRule();
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
handleFieldTd = (params) => {
|
|
1141
|
+
const { field, tdHandler } = params;
|
|
1142
|
+
if (field === F$1.productionContainer) {
|
|
1143
|
+
tdHandler.mergeTd({
|
|
1144
|
+
cellWidget: {
|
|
1145
|
+
props: {
|
|
1146
|
+
newSpecificConfig: {
|
|
1147
|
+
newOptions: []
|
|
1148
|
+
// 禁用初始选项,数据源完全由 customLoader 提供
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
super.handleFieldTd(params);
|
|
1155
|
+
};
|
|
1156
|
+
calcFieldStatus(params) {
|
|
1157
|
+
const result = super.calcFieldStatus(params);
|
|
1158
|
+
if (STERILIZE_ALWAYS_DISABLED_FIELDS.includes(params.field)) {
|
|
1159
|
+
result.disabled = true;
|
|
1160
|
+
}
|
|
1161
|
+
return result;
|
|
1162
|
+
}
|
|
1163
|
+
calcFieldDataSource = (params) => {
|
|
1164
|
+
const { field } = params;
|
|
1165
|
+
if (field !== F$1.productionContainer) return;
|
|
1166
|
+
const loader = async (loaderParams) => {
|
|
1167
|
+
const { mode, queryData = {}, pageNo = 1, pageSize = 100, ids = [] } = loaderParams;
|
|
1168
|
+
const query = {
|
|
1169
|
+
...queryData,
|
|
1170
|
+
is_rework_: 0,
|
|
1171
|
+
"production_identification_type_.in": ["LOT", "SN"]
|
|
1172
|
+
};
|
|
1173
|
+
if (mode === "byIds" && ids.length) {
|
|
1174
|
+
query["id_.in"] = ids;
|
|
1175
|
+
} else {
|
|
1176
|
+
const keyword = extractKeywordFromQueryData(queryData);
|
|
1177
|
+
if (keyword && !query["name_.like"] && !query["name_.iLike"]) {
|
|
1178
|
+
query["name_.like"] = keyword;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
1182
|
+
{
|
|
1183
|
+
modelCategory: "entity",
|
|
1184
|
+
modelKey: "em_production_identification",
|
|
1185
|
+
bsKey: "biz_get_production_identification"
|
|
1186
|
+
},
|
|
1187
|
+
{},
|
|
1188
|
+
{
|
|
1189
|
+
query,
|
|
1190
|
+
pageNo,
|
|
1191
|
+
pageSize,
|
|
1192
|
+
sorts: [{ sortField: "create_time_", sortType: "desc" }]
|
|
1193
|
+
}
|
|
1194
|
+
);
|
|
1195
|
+
const data = res?.data || [];
|
|
1196
|
+
const totalCount = Number(res?.totalCount ?? data.length);
|
|
1197
|
+
const totalPage = Number(res?.totalPage ?? Math.max(1, Math.ceil(totalCount / pageSize)));
|
|
1198
|
+
const options = mapContainerRowsToOptions(data);
|
|
1199
|
+
if (mode === "byIds") {
|
|
1200
|
+
return {
|
|
1201
|
+
options,
|
|
1202
|
+
finished: true,
|
|
1203
|
+
totalCount
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
return {
|
|
1207
|
+
data,
|
|
1208
|
+
options,
|
|
1209
|
+
finished: pageNo >= totalPage,
|
|
1210
|
+
totalCount,
|
|
1211
|
+
totalPage
|
|
1212
|
+
};
|
|
1213
|
+
};
|
|
1214
|
+
return loader;
|
|
1215
|
+
};
|
|
1216
|
+
handleChange = (params) => {
|
|
1217
|
+
const { field, option, value, rowData } = params;
|
|
1218
|
+
if (field !== F$1.productionContainer) return;
|
|
1219
|
+
if (option) {
|
|
1220
|
+
console.log(option);
|
|
1221
|
+
applyFillFromOption$1(rowData, option);
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
if (value == null || value === "") {
|
|
1225
|
+
CLEAR_ON_PROD_CONTAINER_EMPTY$1.forEach((key) => {
|
|
1226
|
+
rowData[key] = void 0;
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
async onScan({ str }) {
|
|
1231
|
+
if (!this.scanRuleInfo) {
|
|
1232
|
+
this.error({ content: $t("sys.edhr.mcTable.scanRuleNotFound") });
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
const data = getParseRuleValue(str, this.scanRuleInfo.rules_);
|
|
1236
|
+
const name = data.lot;
|
|
1237
|
+
if (!name) {
|
|
1238
|
+
this.warning({ content: "条码中未解析到批次号/SN" });
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1241
|
+
let containerInfo;
|
|
1242
|
+
try {
|
|
1243
|
+
containerInfo = await fetchProductionContainerByName$1(name);
|
|
1244
|
+
console.log(this.scanTargetRo);
|
|
1245
|
+
} catch {
|
|
1246
|
+
this.error({ content: "查询生产批次失败" });
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
if (!containerInfo) {
|
|
1250
|
+
this.error({ content: "未查询到匹配的生产批次" });
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
const merged = { ...data, ...containerInfo };
|
|
1254
|
+
this.tableData = [...this.showTableData, applyFillFromOption$1({}, merged)];
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
const F3 = {
|
|
1258
|
+
/** 物料 */
|
|
1259
|
+
product: "product_id_",
|
|
1260
|
+
/** 物料名称 */
|
|
1261
|
+
productName: "product_id_name_",
|
|
1262
|
+
/** 编码 */
|
|
1263
|
+
productCode: "product_id_code_",
|
|
1264
|
+
/** 规格 */
|
|
1265
|
+
productSpec: "product_id_spec_",
|
|
1266
|
+
/** 生产批次号 */
|
|
1267
|
+
productionContainer: "production_container_id_",
|
|
1268
|
+
/** 数量 */
|
|
1269
|
+
qty: "qty_",
|
|
1270
|
+
/** 工单号 */
|
|
1271
|
+
mfgOrderCode: "mfg_order_code_",
|
|
1272
|
+
/** 工单 */
|
|
1273
|
+
mfgOrder: "mfg_order_id_",
|
|
1274
|
+
/** 生产日期 */
|
|
1275
|
+
productionDate: "production_date_",
|
|
1276
|
+
/** 物料批号 */
|
|
1277
|
+
materialContainerNo: "material_container_no_",
|
|
1278
|
+
/** 物料批号 ID */
|
|
1279
|
+
materialContainerNoId: "material_container_no__id_"
|
|
1280
|
+
};
|
|
1281
|
+
const PRETREATMENT_ALWAYS_DISABLED_FIELDS = [
|
|
1282
|
+
F3.productCode,
|
|
1283
|
+
F3.productSpec,
|
|
1284
|
+
F3.productName
|
|
1285
|
+
];
|
|
1286
|
+
const CLEAR_ON_MFG_ORDER_EMPTY = [
|
|
1287
|
+
F3.mfgOrderCode,
|
|
1288
|
+
F3.product,
|
|
1289
|
+
F3.productName,
|
|
1290
|
+
F3.productCode,
|
|
1291
|
+
F3.productSpec,
|
|
1292
|
+
F3.qty,
|
|
1293
|
+
F3.productionDate
|
|
1294
|
+
];
|
|
1295
|
+
const CLEAR_ON_PROD_CONTAINER_EMPTY = [
|
|
1296
|
+
F3.product,
|
|
1297
|
+
F3.productName,
|
|
1298
|
+
F3.productCode,
|
|
1299
|
+
F3.productSpec,
|
|
1300
|
+
F3.qty,
|
|
1301
|
+
F3.mfgOrderCode,
|
|
1302
|
+
F3.mfgOrder,
|
|
1303
|
+
F3.productionDate
|
|
1304
|
+
];
|
|
1305
|
+
const CLEAR_ON_MATERIAL_CONTAINER_EMPTY = [
|
|
1306
|
+
F3.product,
|
|
1307
|
+
F3.productName,
|
|
1308
|
+
F3.productCode,
|
|
1309
|
+
F3.productSpec,
|
|
1310
|
+
F3.qty,
|
|
1311
|
+
F3.mfgOrderCode,
|
|
1312
|
+
F3.mfgOrder,
|
|
1313
|
+
F3.productionDate,
|
|
1314
|
+
F3.materialContainerNoId,
|
|
1315
|
+
F3.productionContainer
|
|
1316
|
+
];
|
|
1317
|
+
const CLEAR_ON_MFG_ORDER_SELECT = [
|
|
1318
|
+
F3.productionContainer,
|
|
1319
|
+
F3.materialContainerNo,
|
|
1320
|
+
F3.materialContainerNoId
|
|
1321
|
+
];
|
|
1322
|
+
const CLEAR_ON_PROD_CONTAINER_SELECT = [
|
|
1323
|
+
F3.mfgOrder,
|
|
1324
|
+
F3.mfgOrderCode,
|
|
1325
|
+
F3.materialContainerNo,
|
|
1326
|
+
F3.materialContainerNoId
|
|
1327
|
+
];
|
|
1328
|
+
const CLEAR_ON_MATERIAL_CONTAINER_SELECT = [
|
|
1329
|
+
F3.productionContainer,
|
|
1330
|
+
F3.mfgOrder,
|
|
1331
|
+
F3.mfgOrderCode
|
|
1332
|
+
];
|
|
1333
|
+
const fillFromOption = [
|
|
1334
|
+
{
|
|
1335
|
+
optionField: F3.product,
|
|
1336
|
+
toField: F3.product
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
optionField: F3.productName,
|
|
1340
|
+
toField: F3.productName
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
optionField: F3.productCode,
|
|
1344
|
+
toField: F3.productCode
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
optionField: F3.productSpec,
|
|
1348
|
+
toField: F3.productSpec
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
optionField: F3.mfgOrder,
|
|
1352
|
+
toField: F3.mfgOrder
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
optionField: F3.mfgOrderCode,
|
|
1356
|
+
toField: F3.mfgOrderCode
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
optionField: "real_start_date_",
|
|
1360
|
+
toField: F3.productionDate
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
optionField: F3.qty,
|
|
1364
|
+
toField: F3.qty
|
|
1365
|
+
}
|
|
1366
|
+
];
|
|
1367
|
+
const fillFromMfgOrderOption = [
|
|
1368
|
+
{
|
|
1369
|
+
optionField: "id_",
|
|
1370
|
+
toField: F3.mfgOrder
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
optionField: "code_",
|
|
1374
|
+
toField: F3.mfgOrderCode
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
optionField: F3.product,
|
|
1378
|
+
toField: F3.product
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
optionField: F3.productName,
|
|
1382
|
+
toField: F3.productName
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
optionField: F3.productCode,
|
|
1386
|
+
toField: F3.productCode
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
optionField: F3.productSpec,
|
|
1390
|
+
toField: F3.productSpec
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
optionField: "real_start_date_",
|
|
1394
|
+
toField: F3.productionDate
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
optionField: F3.qty,
|
|
1398
|
+
toField: F3.qty
|
|
1399
|
+
}
|
|
1400
|
+
];
|
|
1401
|
+
const fillFromProductOption = [
|
|
1402
|
+
{
|
|
1403
|
+
optionField: "name_",
|
|
1404
|
+
toField: F3.productName
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
optionField: "code_",
|
|
1408
|
+
toField: F3.productCode
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
optionField: "spec_",
|
|
1412
|
+
toField: F3.productSpec
|
|
1413
|
+
}
|
|
1414
|
+
];
|
|
1415
|
+
const CLEAR_ON_PRODUCT_EMPTY = [F3.productName, F3.productCode, F3.productSpec];
|
|
1416
|
+
function applyFillFromMapping(A, B4, mapping) {
|
|
1417
|
+
const writableA = A;
|
|
1418
|
+
mapping.forEach(({ optionField, toField }) => {
|
|
1419
|
+
if (has(B4, optionField)) {
|
|
1420
|
+
writableA[toField] = B4[optionField];
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
return A;
|
|
1424
|
+
}
|
|
1425
|
+
function applyFillFromOption(A, B4) {
|
|
1426
|
+
return applyFillFromMapping(A, B4, fillFromOption);
|
|
1427
|
+
}
|
|
1428
|
+
function applyFillFromProductOption(A, B4) {
|
|
1429
|
+
return applyFillFromMapping(A, B4, fillFromProductOption);
|
|
1430
|
+
}
|
|
1431
|
+
function applyFillFromMfgOrderOption(A, B4) {
|
|
1432
|
+
applyFillFromMapping(A, B4, fillFromMfgOrderOption);
|
|
1433
|
+
const writableA = A;
|
|
1434
|
+
if (!has(B4, "code_") && (B4.label != null || B4.__LABEL__ != null)) {
|
|
1435
|
+
writableA[F3.mfgOrderCode] = B4.label ?? B4.__LABEL__;
|
|
1436
|
+
}
|
|
1437
|
+
return A;
|
|
1438
|
+
}
|
|
1439
|
+
function mapRefRowsToOptions(data = [], labelKey = "name_") {
|
|
1440
|
+
return data.map((item) => ({
|
|
1441
|
+
label: item.__LABEL__ ?? item[labelKey] ?? String(item.id_ ?? item.id ?? ""),
|
|
1442
|
+
value: item.id_ || item.id,
|
|
1443
|
+
disabled: !!item.deleted_,
|
|
1444
|
+
_item: item
|
|
1445
|
+
}));
|
|
1446
|
+
}
|
|
1447
|
+
function createProductionContainerLoader() {
|
|
1448
|
+
return async (loaderParams) => {
|
|
1449
|
+
const { mode, queryData = {}, pageNo = 1, pageSize = 100, ids = [] } = loaderParams;
|
|
1450
|
+
const query = {
|
|
1451
|
+
...queryData,
|
|
1452
|
+
is_rework_: 0,
|
|
1453
|
+
"production_identification_type_.in": ["LOT", "SN"]
|
|
1454
|
+
};
|
|
1455
|
+
if (mode === "byIds" && ids.length) {
|
|
1456
|
+
query["id_.in"] = ids;
|
|
1457
|
+
} else {
|
|
1458
|
+
const keyword = extractKeywordFromQueryData(queryData);
|
|
1459
|
+
if (keyword && !query["name_.like"] && !query["name_.iLike"]) {
|
|
1460
|
+
query["name_.like"] = keyword;
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
1464
|
+
{
|
|
1465
|
+
modelCategory: "entity",
|
|
1466
|
+
modelKey: "em_production_identification",
|
|
1467
|
+
bsKey: "biz_get_production_identification"
|
|
1468
|
+
},
|
|
1469
|
+
{},
|
|
1470
|
+
{
|
|
1471
|
+
query,
|
|
1472
|
+
pageNo,
|
|
1473
|
+
pageSize,
|
|
1474
|
+
sorts: [{ sortField: "create_time_", sortType: "desc" }]
|
|
1475
|
+
}
|
|
1476
|
+
);
|
|
1477
|
+
const data = res?.data || [];
|
|
1478
|
+
const totalCount = Number(res?.totalCount ?? data.length);
|
|
1479
|
+
const totalPage = Number(res?.totalPage ?? Math.max(1, Math.ceil(totalCount / pageSize)));
|
|
1480
|
+
const options = mapRefRowsToOptions(data);
|
|
1481
|
+
if (mode === "byIds") {
|
|
1482
|
+
return {
|
|
1483
|
+
options,
|
|
1484
|
+
finished: true,
|
|
1485
|
+
totalCount
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
return {
|
|
1489
|
+
data,
|
|
1490
|
+
options,
|
|
1491
|
+
finished: pageNo >= totalPage,
|
|
1492
|
+
totalCount,
|
|
1493
|
+
totalPage
|
|
1494
|
+
};
|
|
1495
|
+
};
|
|
1496
|
+
}
|
|
1497
|
+
function createMfgOrderLoader() {
|
|
1498
|
+
return async (loaderParams) => {
|
|
1499
|
+
const pageSize = 99;
|
|
1500
|
+
const { mode, queryData = {}, pageNo = 1, ids = [] } = loaderParams;
|
|
1501
|
+
const query = { ...queryData };
|
|
1502
|
+
if (mode === "byIds" && ids.length) {
|
|
1503
|
+
query["id_.in"] = ids;
|
|
1504
|
+
} else {
|
|
1505
|
+
const keyword = extractKeywordFromQueryData(queryData);
|
|
1506
|
+
if (keyword && !query["code_.like"] && !query["code_.iLike"]) {
|
|
1507
|
+
query["code_.like"] = keyword;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
const res = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
1511
|
+
{
|
|
1512
|
+
modelCategory: "entity",
|
|
1513
|
+
modelKey: "em_mfg_order",
|
|
1514
|
+
bsKey: "biz_formListByPage"
|
|
1515
|
+
},
|
|
1516
|
+
{},
|
|
1517
|
+
{
|
|
1518
|
+
query,
|
|
1519
|
+
pageNo,
|
|
1520
|
+
pageSize,
|
|
1521
|
+
sorts: [{ sortField: "create_time_", sortType: "desc" }]
|
|
1522
|
+
}
|
|
1523
|
+
);
|
|
1524
|
+
const data = res?.data || [];
|
|
1525
|
+
const totalCount = Number(res?.totalCount ?? data.length);
|
|
1526
|
+
const totalPage = Number(res?.totalPage ?? Math.max(1, Math.ceil(totalCount / pageSize)));
|
|
1527
|
+
const options = mapRefRowsToOptions(data, "code_");
|
|
1528
|
+
if (mode === "byIds") {
|
|
1529
|
+
return {
|
|
1530
|
+
options,
|
|
1531
|
+
finished: true,
|
|
1532
|
+
totalCount
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
return {
|
|
1536
|
+
data,
|
|
1537
|
+
options,
|
|
1538
|
+
finished: pageNo >= totalPage,
|
|
1539
|
+
totalCount,
|
|
1540
|
+
totalPage
|
|
1541
|
+
};
|
|
1542
|
+
};
|
|
1543
|
+
}
|
|
1544
|
+
function createMaterialContainerLoader() {
|
|
1545
|
+
return async (loaderParams) => {
|
|
1546
|
+
const { mode, queryData = {}, pageNo = 1, pageSize = 100, ids = [] } = loaderParams;
|
|
1547
|
+
const query = {
|
|
1548
|
+
...queryData,
|
|
1549
|
+
"production_identification_type_.eq": "MATERIAL",
|
|
1550
|
+
"production_identification_type_.isNull": null
|
|
1551
|
+
};
|
|
1552
|
+
const keyword = query["material_no_.like"] ?? query["name_.like"];
|
|
1553
|
+
if (keyword) {
|
|
1554
|
+
delete query["material_no_.like"];
|
|
1555
|
+
query["name_.like"] = keyword;
|
|
1556
|
+
}
|
|
1557
|
+
if (mode === "byIds" && ids.length) {
|
|
1558
|
+
query["id_.in"] = ids;
|
|
1559
|
+
}
|
|
1560
|
+
const res = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
|
|
1561
|
+
{
|
|
1562
|
+
modelCategory: "entity",
|
|
1563
|
+
modelKey: "em_production_identification",
|
|
1564
|
+
bsKey: "biz_get_production_identification"
|
|
1565
|
+
},
|
|
1566
|
+
{},
|
|
1567
|
+
{
|
|
1568
|
+
exp: "OR(production_identification_type_.eq,production_identification_type_.isNull)",
|
|
1569
|
+
query,
|
|
1570
|
+
pageNo,
|
|
1571
|
+
pageSize
|
|
1572
|
+
}
|
|
1573
|
+
);
|
|
1574
|
+
const data = res?.data || [];
|
|
1575
|
+
const dict = res?.dict;
|
|
1576
|
+
const totalCount = Number(res?.totalCount ?? data.length);
|
|
1577
|
+
const totalPage = Number(res?.totalPage ?? Math.max(1, Math.ceil(totalCount / pageSize)));
|
|
1578
|
+
if (mode === "byIds") {
|
|
1579
|
+
return {
|
|
1580
|
+
data,
|
|
1581
|
+
dict,
|
|
1582
|
+
options: [],
|
|
1583
|
+
finished: true,
|
|
1584
|
+
totalCount
|
|
1585
|
+
};
|
|
1586
|
+
}
|
|
1587
|
+
return {
|
|
1588
|
+
data,
|
|
1589
|
+
dict,
|
|
1590
|
+
finished: pageNo >= totalPage,
|
|
1591
|
+
totalCount,
|
|
1592
|
+
totalPage
|
|
1593
|
+
};
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1596
|
+
async function fetchProductionContainerByName(name_) {
|
|
1597
|
+
const res = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
|
|
1598
|
+
{
|
|
1599
|
+
modelCategory: "entity",
|
|
1600
|
+
modelKey: "em_production_identification",
|
|
1601
|
+
bsKey: "biz_get_production_identification"
|
|
1602
|
+
},
|
|
1603
|
+
{},
|
|
1604
|
+
{
|
|
1605
|
+
query: { "production_identification_type_.in": ["LOT", "SN"], name_ },
|
|
1606
|
+
exp: "AND(production_identification_type_.in,name_)"
|
|
1607
|
+
}
|
|
1608
|
+
);
|
|
1609
|
+
return normalizeContainerResult(res);
|
|
1610
|
+
}
|
|
1611
|
+
function normalizeContainerResult(res) {
|
|
1612
|
+
if (!res) return void 0;
|
|
1613
|
+
const data = res?.data ?? res;
|
|
1614
|
+
if (Array.isArray(data)) return data[0];
|
|
1615
|
+
if (typeof data === "object") return data;
|
|
1616
|
+
return void 0;
|
|
1617
|
+
}
|
|
1618
|
+
class PretreatmentListTableCore extends SubTableCore {
|
|
1619
|
+
/** 触发扫码时的目标行 */
|
|
1620
|
+
scanTargetRow;
|
|
1621
|
+
/** 绘制UI相关工具,一期复用调拨表扫码弹窗 */
|
|
1622
|
+
get render() {
|
|
1623
|
+
return window.NocodeAdapter.allocateRender;
|
|
1624
|
+
}
|
|
1625
|
+
async compUnmount() {
|
|
1626
|
+
super.compUnmount();
|
|
1627
|
+
this.render.destroyAllModals();
|
|
1628
|
+
}
|
|
1629
|
+
async init() {
|
|
1630
|
+
const { barcodeParsingRules } = this.bizTableConfig || {};
|
|
1631
|
+
if (barcodeParsingRules) {
|
|
1632
|
+
this.scanRuleProps = barcodeParsingRules;
|
|
1633
|
+
this.scanRuleInfo = await getParseRuleInfo({ id: this.scanRuleProps.parsingRuleId });
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
calcSubTableActionMenu = (params) => {
|
|
1637
|
+
const { showDelBtn } = params;
|
|
1638
|
+
return [
|
|
1639
|
+
// 一期暂不支持扫码
|
|
1640
|
+
// {
|
|
1641
|
+
// type: SubTableActionMenuTypeEnum.SUBTITLE,
|
|
1642
|
+
// label: $t('sys.edhr.bizOperation'),
|
|
1643
|
+
// },
|
|
1644
|
+
// getMenuByAction(SubTableActionEnum.SCAN),
|
|
1645
|
+
// getMenuByAction(SubTableActionEnum.CHANGE_PARSE_RULE),
|
|
1646
|
+
// {
|
|
1647
|
+
// type: SubTableActionMenuTypeEnum.DIVIDER,
|
|
1648
|
+
// },
|
|
1649
|
+
{
|
|
1650
|
+
type: SubTableActionMenuTypeEnum.SUBTITLE,
|
|
1651
|
+
label: $t("sys.edhr.editRow")
|
|
1652
|
+
},
|
|
1653
|
+
getMenuByAction(SubTableActionEnum.Insert1RowAfter),
|
|
1654
|
+
getInsertSubMenu(),
|
|
1655
|
+
...showDelBtn ? [
|
|
1656
|
+
{
|
|
1657
|
+
type: SubTableActionMenuTypeEnum.DIVIDER
|
|
1658
|
+
},
|
|
1659
|
+
getMenuByAction(SubTableActionEnum.DeleteRowCurrent)
|
|
1660
|
+
] : []
|
|
1661
|
+
].filter(Boolean);
|
|
1662
|
+
};
|
|
1663
|
+
handleMenuClick(params) {
|
|
1664
|
+
const { actionKey, rowData } = params;
|
|
1665
|
+
if (actionKey === SubTableActionEnum.SCAN) {
|
|
1666
|
+
this.scanTargetRow = rowData;
|
|
1667
|
+
this.openScanModal();
|
|
1668
|
+
return;
|
|
1669
|
+
}
|
|
1670
|
+
if (actionKey === SubTableActionEnum.CHANGE_PARSE_RULE) {
|
|
1671
|
+
this.changeScanRule();
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
calcFieldStatus(params) {
|
|
1675
|
+
const result = super.calcFieldStatus(params);
|
|
1676
|
+
const { field, rowData } = params;
|
|
1677
|
+
if (PRETREATMENT_ALWAYS_DISABLED_FIELDS.includes(field)) {
|
|
1678
|
+
result.disabled = true;
|
|
1679
|
+
}
|
|
1680
|
+
if (field === F3.product) {
|
|
1681
|
+
const hasNo = rowData[F3.materialContainerNo] != null && rowData[F3.materialContainerNo] !== "";
|
|
1682
|
+
const idEmpty = rowData[F3.materialContainerNoId] == null || rowData[F3.materialContainerNoId] === "";
|
|
1683
|
+
result.disabled = !(hasNo && idEmpty);
|
|
1684
|
+
}
|
|
1685
|
+
return result;
|
|
1686
|
+
}
|
|
1687
|
+
calcFieldDataSource = (params) => {
|
|
1688
|
+
const { field } = params;
|
|
1689
|
+
if (field === F3.productionContainer) return createProductionContainerLoader();
|
|
1690
|
+
if (field === F3.mfgOrder) return createMfgOrderLoader();
|
|
1691
|
+
if (field === F3.materialContainerNo) return createMaterialContainerLoader();
|
|
1692
|
+
};
|
|
1693
|
+
handleChange = (params) => {
|
|
1694
|
+
const { field, option, value, rowData } = params;
|
|
1695
|
+
const writable = rowData;
|
|
1696
|
+
const hasValue = value != null && value !== "";
|
|
1697
|
+
if (field === F3.mfgOrder) {
|
|
1698
|
+
if (option) {
|
|
1699
|
+
applyFillFromMfgOrderOption(rowData, option._item ?? option);
|
|
1700
|
+
}
|
|
1701
|
+
if (hasValue) {
|
|
1702
|
+
CLEAR_ON_MFG_ORDER_SELECT.forEach((key) => {
|
|
1703
|
+
writable[key] = void 0;
|
|
1704
|
+
});
|
|
1705
|
+
} else {
|
|
1706
|
+
CLEAR_ON_MFG_ORDER_EMPTY.forEach((key) => {
|
|
1707
|
+
writable[key] = void 0;
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
if (field === F3.productionContainer) {
|
|
1713
|
+
if (option) {
|
|
1714
|
+
applyFillFromOption(rowData, option._item ?? option);
|
|
1715
|
+
}
|
|
1716
|
+
if (hasValue) {
|
|
1717
|
+
CLEAR_ON_PROD_CONTAINER_SELECT.forEach((key) => {
|
|
1718
|
+
writable[key] = void 0;
|
|
1719
|
+
});
|
|
1720
|
+
} else {
|
|
1721
|
+
CLEAR_ON_PROD_CONTAINER_EMPTY.forEach((key) => {
|
|
1722
|
+
writable[key] = void 0;
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
return;
|
|
1726
|
+
}
|
|
1727
|
+
if (field === F3.materialContainerNo) {
|
|
1728
|
+
if (option) {
|
|
1729
|
+
applyFillFromOption(rowData, option._item ?? option);
|
|
1730
|
+
}
|
|
1731
|
+
if (hasValue) {
|
|
1732
|
+
CLEAR_ON_MATERIAL_CONTAINER_SELECT.forEach((key) => {
|
|
1733
|
+
writable[key] = void 0;
|
|
1734
|
+
});
|
|
1735
|
+
} else {
|
|
1736
|
+
CLEAR_ON_MATERIAL_CONTAINER_EMPTY.forEach((key) => {
|
|
1737
|
+
writable[key] = void 0;
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
return;
|
|
1741
|
+
}
|
|
1742
|
+
if (field === F3.product) {
|
|
1743
|
+
if (option) {
|
|
1744
|
+
applyFillFromProductOption(rowData, option._item ?? option);
|
|
1745
|
+
} else if (!hasValue) {
|
|
1746
|
+
CLEAR_ON_PRODUCT_EMPTY.forEach((key) => {
|
|
1747
|
+
writable[key] = void 0;
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
};
|
|
1752
|
+
async onScan({ str }) {
|
|
1753
|
+
if (!this.scanRuleInfo) {
|
|
1754
|
+
this.error({ content: $t("sys.edhr.mcTable.scanRuleNotFound") });
|
|
1755
|
+
return;
|
|
1756
|
+
}
|
|
1757
|
+
const data = getParseRuleValue(str, this.scanRuleInfo.rules_);
|
|
1758
|
+
const name = data.lot;
|
|
1759
|
+
if (!name) {
|
|
1760
|
+
this.warning({ content: "条码中未解析到批次号/SN" });
|
|
1761
|
+
return;
|
|
1762
|
+
}
|
|
1763
|
+
let containerInfo;
|
|
1764
|
+
try {
|
|
1765
|
+
containerInfo = await fetchProductionContainerByName(name);
|
|
1766
|
+
} catch {
|
|
1767
|
+
this.error({ content: "查询生产批次失败" });
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
if (!containerInfo) {
|
|
1771
|
+
this.error({ content: "未查询到匹配的生产批次" });
|
|
1772
|
+
return;
|
|
1773
|
+
}
|
|
1774
|
+
const merged = { ...data, ...containerInfo };
|
|
1775
|
+
const applyScanFill = (row) => {
|
|
1776
|
+
applyFillFromOption(row, merged);
|
|
1777
|
+
CLEAR_ON_MATERIAL_CONTAINER_SELECT.forEach((key) => {
|
|
1778
|
+
row[key] = void 0;
|
|
1779
|
+
});
|
|
1780
|
+
return row;
|
|
1781
|
+
};
|
|
1782
|
+
this.tableData = [...this.showTableData, applyScanFill({})];
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
function getClassByType(type) {
|
|
1786
|
+
switch (type) {
|
|
1787
|
+
case SubTableType.STOCKTAKE:
|
|
1788
|
+
return StocktakeTableCore;
|
|
1789
|
+
case SubTableType.ALLOCATE:
|
|
1790
|
+
return AllocateTableCore;
|
|
1791
|
+
case SubTableType.STERILIZE_BATCH:
|
|
1792
|
+
return SterilizeBatchTableCore;
|
|
1793
|
+
case SubTableType.PRETREATMENT_LIST:
|
|
1794
|
+
return PretreatmentListTableCore;
|
|
1795
|
+
case SubTableType.WAREHOUSE_IN_OUT:
|
|
1796
|
+
return SubTableCore;
|
|
1797
|
+
default:
|
|
1798
|
+
return SubTableCore;
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
class SubTableCoreFactory {
|
|
1802
|
+
/**上下文参数 */
|
|
1803
|
+
ctx;
|
|
1804
|
+
/** 子表核心映射,key为子表的组件id */
|
|
1805
|
+
coreMap = {};
|
|
1806
|
+
/** 主批次号 */
|
|
1807
|
+
get materialNo() {
|
|
1808
|
+
return this.ctx.paramsConfig?.materialNo || this.ctx.docInfo.materialNo;
|
|
1809
|
+
}
|
|
1810
|
+
constructor(params) {
|
|
1811
|
+
this.ctx = params;
|
|
1812
|
+
this.initSubTableCore();
|
|
1813
|
+
}
|
|
1814
|
+
/** 异步初始化 */
|
|
1815
|
+
async init() {
|
|
1816
|
+
await Promise.all(Object.values(this.coreMap).map(async (core) => core.init()));
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* 获取表单里所有的子表对象集合
|
|
1820
|
+
* @return {*}
|
|
1821
|
+
*/
|
|
1822
|
+
getSubTableWidgets() {
|
|
1823
|
+
const paper = this.ctx.runtimeJson?.paper;
|
|
1824
|
+
if (!paper?.props) {
|
|
1825
|
+
return [];
|
|
1826
|
+
}
|
|
1827
|
+
if (paper.props.subTableWidgetIds) {
|
|
1828
|
+
return paper.props.subTableWidgetIds.map((id) => this.ctx.runtimeJson[id]);
|
|
1829
|
+
}
|
|
1830
|
+
return Object.values(this.ctx.runtimeJson).filter((item) => {
|
|
1831
|
+
return item.component === "sub-table";
|
|
1832
|
+
});
|
|
1833
|
+
}
|
|
1834
|
+
/** 初始化子表核心 */
|
|
1835
|
+
initSubTableCore() {
|
|
1836
|
+
const { runtimeJson, docInfo } = this.ctx;
|
|
1837
|
+
if (docInfo?.formType === FormTypeEnum.FILE) {
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
if (!runtimeJson?.paper?.props) {
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
console.log("%cRuntimeJson", "color:blue", runtimeJson);
|
|
1844
|
+
this.getSubTableWidgets()?.forEach((subTable) => {
|
|
1845
|
+
const coreClass = getClassByType(subTable.props.tableType);
|
|
1846
|
+
const SubTableCore2 = new coreClass(
|
|
1847
|
+
{
|
|
1848
|
+
widget: subTable
|
|
1849
|
+
},
|
|
1850
|
+
this
|
|
1851
|
+
);
|
|
1852
|
+
this.coreMap[subTable.id] = SubTableCore2;
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
/** 通过tid获取子表核心 */
|
|
1856
|
+
getSubCoreByTid(tid) {
|
|
1857
|
+
return this.coreMap[tid];
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* 初始化表单数据
|
|
1861
|
+
* @param params
|
|
1862
|
+
*/
|
|
1863
|
+
handleInitializeFormState(params) {
|
|
1864
|
+
Object.values(this.coreMap).map((core) => {
|
|
1865
|
+
const arr = core.handleInitializeFormState(params);
|
|
1866
|
+
if (arr) {
|
|
1867
|
+
const key = core.subFieldKey;
|
|
1868
|
+
const defaultData = params.defaultMap[key];
|
|
1869
|
+
params.formState[key] = transformUtils.transformSourceData2SubTable(
|
|
1870
|
+
arr,
|
|
1871
|
+
void 0,
|
|
1872
|
+
defaultData
|
|
1873
|
+
);
|
|
1874
|
+
}
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* 处理子表字段的默认值映射
|
|
1879
|
+
* 往已有的默认值映射里补充额外的默认值
|
|
1880
|
+
*
|
|
1881
|
+
*/
|
|
1882
|
+
handleDefaultMap(params) {
|
|
1883
|
+
const { pageDefaultMap } = params;
|
|
1884
|
+
Object.values(this.coreMap).map((core) => {
|
|
1885
|
+
const defaultMap = core.calcDefaultMap();
|
|
1886
|
+
merge(pageDefaultMap, {
|
|
1887
|
+
[core.subFieldKey]: defaultMap
|
|
1888
|
+
});
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* 按钮点击逻辑前处理
|
|
1893
|
+
* 可以报错拦截后续逻辑
|
|
1894
|
+
* @param params
|
|
1895
|
+
*/
|
|
1896
|
+
async beforeBtnClick(params) {
|
|
1897
|
+
await Promise.all(Object.values(this.coreMap).map(async (core) => core.beforeBtnClick(params)));
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
function useRenderPageFactory(props, payload) {
|
|
1901
|
+
const counter = ref(0);
|
|
1902
|
+
const finisher = ref(0);
|
|
1903
|
+
const dataCenterMap = ref({});
|
|
1904
|
+
const pageDataMap = ref({});
|
|
1905
|
+
const formStateMap = ref({});
|
|
1906
|
+
const defaultDataMap = ref({});
|
|
1907
|
+
const basicInfoList = ref([]);
|
|
1908
|
+
const selfInfoList = ref([]);
|
|
1909
|
+
const tmplBomCMap = ref({});
|
|
1910
|
+
provide(NCB_PROVIDE.TMPL_BOM_CONTROLLER_MAP, tmplBomCMap);
|
|
1911
|
+
const subTableCoreFactoryMap = ref({});
|
|
1912
|
+
provide(NCB_PROVIDE.SUB_TABLE_CORE_FACTORY_MAP, subTableCoreFactoryMap);
|
|
1913
|
+
const { getConsumeData } = useMaterialBalance();
|
|
1914
|
+
const callbackName = {
|
|
1915
|
+
template: requestTemplateInfo,
|
|
1916
|
+
instance: requestSelfInfo,
|
|
1917
|
+
batchInstance: requestBatchSelfInfo,
|
|
1918
|
+
batchTemplate: requestBatchTemplateInfo
|
|
1919
|
+
};
|
|
1920
|
+
const {
|
|
1921
|
+
run: runFetchInstances,
|
|
1922
|
+
invalidate: invalidateFetch,
|
|
1923
|
+
loading: fetchLoading
|
|
1924
|
+
} = useLatestRequest(async (ids) => {
|
|
1925
|
+
return await processInstances(ids);
|
|
1926
|
+
});
|
|
1927
|
+
watch(
|
|
1928
|
+
[() => props.selfId, () => counter.value],
|
|
1929
|
+
async ([newRequestId, _2]) => {
|
|
1930
|
+
console.log("aaaaaaaaaa", newRequestId);
|
|
1931
|
+
if (isEmpty(newRequestId)) {
|
|
1932
|
+
invalidateFetch();
|
|
1933
|
+
clear();
|
|
1934
|
+
return;
|
|
1935
|
+
}
|
|
1936
|
+
const ids = Array.isArray(newRequestId) ? newRequestId : [newRequestId];
|
|
1937
|
+
const response = await runFetchInstances(ids);
|
|
1938
|
+
if (!response) {
|
|
1939
|
+
console.log("旧请求的返回,忽略", newRequestId);
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1942
|
+
clear();
|
|
1943
|
+
response?.forEach((res) => {
|
|
1944
|
+
if (res) {
|
|
1945
|
+
Object.assign(dataCenterMap.value, res.dataCenter);
|
|
1946
|
+
Object.assign(defaultDataMap.value, res.defaultData);
|
|
1947
|
+
Object.assign(pageDataMap.value, res.pageData);
|
|
1948
|
+
Object.assign(formStateMap.value, res.formState);
|
|
1949
|
+
Object.assign(tmplBomCMap.value, res.tmplBomC);
|
|
1950
|
+
Object.assign(subTableCoreFactoryMap.value, res.subTableCoreFactory);
|
|
1951
|
+
basicInfoList.value.push(res.basicInfo);
|
|
1952
|
+
selfInfoList.value.push(res.selfInfo);
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
1955
|
+
console.log(
|
|
1956
|
+
"tangjian dataCenterMap:",
|
|
1957
|
+
dataCenterMap.value,
|
|
1958
|
+
"defaultDataMap:",
|
|
1959
|
+
defaultDataMap.value,
|
|
1960
|
+
"pageDataMap:",
|
|
1961
|
+
pageDataMap.value,
|
|
1962
|
+
"formStateMap:",
|
|
1963
|
+
formStateMap.value,
|
|
1964
|
+
"basicInfoList:",
|
|
1965
|
+
basicInfoList.value,
|
|
1966
|
+
"selfInfoList:",
|
|
1967
|
+
selfInfoList.value,
|
|
1968
|
+
"tmplBomCMap:",
|
|
1969
|
+
tmplBomCMap.value
|
|
1970
|
+
);
|
|
1971
|
+
finisher.value++;
|
|
1972
|
+
},
|
|
1973
|
+
{ immediate: true }
|
|
1974
|
+
);
|
|
1975
|
+
watch(
|
|
1976
|
+
() => finisher.value,
|
|
1977
|
+
() => {
|
|
1978
|
+
console.log("请求成功");
|
|
1979
|
+
const selfId = props.selfId;
|
|
1980
|
+
if (payload.onFinisher) {
|
|
1981
|
+
const info = findBasicInsInfo(selfId);
|
|
1982
|
+
payload.onFinisher && payload.onFinisher(props.selfId, info?.renderModeType);
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
);
|
|
1986
|
+
const hasData = computed(() => {
|
|
1987
|
+
return basicInfoList.value.length !== 0;
|
|
1988
|
+
});
|
|
1989
|
+
function getInfo2Self(selfInfo) {
|
|
1990
|
+
let bpmnType;
|
|
1991
|
+
let fillModeType = RenderModeEnum.ViewMode;
|
|
1992
|
+
let btnModelType = RenderModeEnum.ViewMode;
|
|
1993
|
+
let bpmnFieldAuthMap = {};
|
|
1994
|
+
if (selfInfo.formType === FormTypeEnum.BASE || selfInfo.formType === FormTypeEnum.FILE) {
|
|
1995
|
+
if (selfInfo.instanceStatus) {
|
|
1996
|
+
fillModeType = selfInfo.instanceStatus === "UNFILLED" || selfInfo.instanceStatus === "STASH" || selfInfo.instanceStatus === "PARTIAL_SUBMIT" ? RenderModeEnum.FormMode : RenderModeEnum.ViewMode;
|
|
1997
|
+
btnModelType = fillModeType;
|
|
1998
|
+
} else {
|
|
1999
|
+
fillModeType = selfInfo.dataStatus === "SUBMIT" ? RenderModeEnum.ViewMode : RenderModeEnum.FormMode;
|
|
2000
|
+
btnModelType = fillModeType;
|
|
2001
|
+
}
|
|
2002
|
+
bpmnFieldAuthMap = renderUtils.getBpmnFieldAuthMap(
|
|
2003
|
+
renderUtils.deduplicateFields(safeParseArray(selfInfo.processFieldPermission))
|
|
2004
|
+
);
|
|
2005
|
+
} else if (selfInfo.formType === FormTypeEnum.PROCESS) {
|
|
2006
|
+
const { nodeDef = {} } = selfInfo.ofProcessOperations ?? {};
|
|
2007
|
+
bpmnType = selfInfo.instanceStatus === "ABANDON" || selfInfo.instanceStatus === "IN_AUDIT" ? BpmnNodeTypeEnum.BpmnEnd : nodeDef.type ?? BpmnNodeTypeEnum.BpmnEnd;
|
|
2008
|
+
fillModeType = bpmnType === BpmnNodeTypeEnum.BpmnEnd ? RenderModeEnum.ViewMode : RenderModeEnum.FormMode;
|
|
2009
|
+
btnModelType = fillModeType;
|
|
2010
|
+
bpmnFieldAuthMap = renderUtils.getBpmnFieldAuthMap(
|
|
2011
|
+
mergeByMultiKey(
|
|
2012
|
+
renderUtils.deduplicateFields(safeParseArray(nodeDef.fieldConfig)),
|
|
2013
|
+
renderUtils.deduplicateFields(safeParseArray(selfInfo.processFieldPermission)),
|
|
2014
|
+
{
|
|
2015
|
+
keyFields: ["modelKey", "field"],
|
|
2016
|
+
fieldsToMerge: ["readonly", "edit"],
|
|
2017
|
+
isAllowMerge: bpmnType === BpmnNodeTypeEnum.BpmnSubmit,
|
|
2018
|
+
// 只有开始节点可以合并字段权限配置
|
|
2019
|
+
isConcat: true
|
|
2020
|
+
}
|
|
2021
|
+
)
|
|
2022
|
+
);
|
|
2023
|
+
}
|
|
2024
|
+
const _isDetailPage_ = typeof payload.isDetailPage === "function" ? payload.isDetailPage() : payload.isDetailPage;
|
|
2025
|
+
if (_isDetailPage_) {
|
|
2026
|
+
fillModeType = RenderModeEnum.ViewMode;
|
|
2027
|
+
const isForceShowBtn = typeof payload.getBtnDisplayRules === "function" ? payload.getBtnDisplayRules() : false;
|
|
2028
|
+
if (!isForceShowBtn) {
|
|
2029
|
+
btnModelType = fillModeType;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
const paramsConfig = {
|
|
2033
|
+
...JSON.parse(selfInfo.params || "{}"),
|
|
2034
|
+
...payload.paramExtraProps || {}
|
|
2035
|
+
};
|
|
2036
|
+
if (paramsConfig?._gct_useDynRowHeight_) {
|
|
2037
|
+
fillModeType = RenderModeEnum.ViewMode;
|
|
2038
|
+
btnModelType = fillModeType;
|
|
2039
|
+
}
|
|
2040
|
+
const query = selfInfo.dataId ? {
|
|
2041
|
+
id_: selfInfo.dataId,
|
|
2042
|
+
_gct_dataStatus_: selfInfo.dataStatus,
|
|
2043
|
+
_gct_formChangeApprovalInfo_: {
|
|
2044
|
+
isSupport: selfInfo.instanceStatus === "IN_AUDIT" && paramsConfig?._gct_is_form_change_approval_page_,
|
|
2045
|
+
// 表单是审核状态并且是表单审核页面
|
|
2046
|
+
id_: paramsConfig?._gct_change_business_id,
|
|
2047
|
+
change_no_: paramsConfig?._gct_change_business_code_
|
|
2048
|
+
}
|
|
2049
|
+
} : {};
|
|
2050
|
+
return {
|
|
2051
|
+
bpmnType,
|
|
2052
|
+
fillModeType,
|
|
2053
|
+
btnModelType,
|
|
2054
|
+
bpmnFieldAuthMap,
|
|
2055
|
+
paramsConfig,
|
|
2056
|
+
query
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
2059
|
+
async function requestSelfInfo(id) {
|
|
2060
|
+
const selfInfo = await payload.requestCallback({
|
|
2061
|
+
id,
|
|
2062
|
+
...payload.paramExtraProps?._gct_nocode_inst_query_params_
|
|
2063
|
+
});
|
|
2064
|
+
if (isEmpty(selfInfo)) return;
|
|
2065
|
+
const { bpmnType, fillModeType, btnModelType, bpmnFieldAuthMap, paramsConfig, query } = getInfo2Self(selfInfo);
|
|
2066
|
+
return {
|
|
2067
|
+
id,
|
|
2068
|
+
tid: selfInfo.tmplId,
|
|
2069
|
+
selfInfo,
|
|
2070
|
+
bpmnType,
|
|
2071
|
+
fillModeType,
|
|
2072
|
+
btnModelType,
|
|
2073
|
+
bpmnFieldAuthMap,
|
|
2074
|
+
paramsConfig,
|
|
2075
|
+
query
|
|
2076
|
+
};
|
|
2077
|
+
}
|
|
2078
|
+
async function requestTemplateInfo(id) {
|
|
2079
|
+
const selfInfo = await payload.requestCallback({ id });
|
|
2080
|
+
if (isEmpty(selfInfo)) return;
|
|
2081
|
+
const { baseId, id: tmpId } = selfInfo;
|
|
2082
|
+
return {
|
|
2083
|
+
id,
|
|
2084
|
+
tid: baseId ? `${baseId}:${id}` : tmpId,
|
|
2085
|
+
selfInfo,
|
|
2086
|
+
fillModeType: payload.renderModeType,
|
|
2087
|
+
btnModelType: payload.renderModeType,
|
|
2088
|
+
query: props.query ?? {}
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
async function requestBatchSelfInfo(ids) {
|
|
2092
|
+
try {
|
|
2093
|
+
const selfInfos = await payload.requestCallback(ids);
|
|
2094
|
+
if (selfInfos && selfInfos.length) {
|
|
2095
|
+
return selfInfos.map((selfInfo) => {
|
|
2096
|
+
const { bpmnType, fillModeType, btnModelType, bpmnFieldAuthMap, paramsConfig, query } = getInfo2Self(selfInfo);
|
|
2097
|
+
return {
|
|
2098
|
+
tid: selfInfo.tmplId,
|
|
2099
|
+
selfInfo,
|
|
2100
|
+
bpmnType,
|
|
2101
|
+
fillModeType,
|
|
2102
|
+
btnModelType,
|
|
2103
|
+
bpmnFieldAuthMap,
|
|
2104
|
+
paramsConfig,
|
|
2105
|
+
query
|
|
2106
|
+
};
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
return [];
|
|
2110
|
+
} catch (error) {
|
|
2111
|
+
console.error("Error in requestBatchSelfInfo:", error);
|
|
2112
|
+
return [];
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
async function requestBatchTemplateInfo(id) {
|
|
2116
|
+
try {
|
|
2117
|
+
const res = await payload.requestCallback({
|
|
2118
|
+
materialNo: props.materialNo,
|
|
2119
|
+
ofTmplId: id?.[0]
|
|
2120
|
+
// 在线表单模板id
|
|
2121
|
+
});
|
|
2122
|
+
if (res && res.ofInstances && res.ofInstances.length !== 0) {
|
|
2123
|
+
return res.ofInstances.map((selfInfo) => {
|
|
2124
|
+
const { query } = getInfo2Self(selfInfo);
|
|
2125
|
+
const { baseId, id: tmpId } = selfInfo;
|
|
2126
|
+
return {
|
|
2127
|
+
id,
|
|
2128
|
+
tid: selfInfo.tmplId || (baseId ? `${baseId}:${id}` : tmpId),
|
|
2129
|
+
selfInfo: {
|
|
2130
|
+
...selfInfo,
|
|
2131
|
+
runtimeJson: res.ofTmpl.runtimeJson
|
|
2132
|
+
},
|
|
2133
|
+
fillModeType: payload.renderModeType,
|
|
2134
|
+
btnModelType: payload.renderModeType,
|
|
2135
|
+
query
|
|
2136
|
+
};
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
return [];
|
|
2140
|
+
} catch (error) {
|
|
2141
|
+
console.error("Error in requestBatchTemplateInfo:", error);
|
|
2142
|
+
return [];
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
async function getInstanceData(ids) {
|
|
2146
|
+
const requestName = callbackName[payload.factoryType];
|
|
2147
|
+
if (payload.factoryType === "batchInstance" || payload.factoryType === "batchTemplate") {
|
|
2148
|
+
const batchResults = await requestName(ids);
|
|
2149
|
+
return batchResults;
|
|
2150
|
+
} else {
|
|
2151
|
+
return await Promise.all(
|
|
2152
|
+
ids.map(async (id) => {
|
|
2153
|
+
const result = await requestName(id);
|
|
2154
|
+
return { id, ...result };
|
|
2155
|
+
})
|
|
2156
|
+
);
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
async function processInstances(ids) {
|
|
2160
|
+
try {
|
|
2161
|
+
const instanceDataList = await getInstanceData(ids);
|
|
2162
|
+
return await Promise.all(
|
|
2163
|
+
instanceDataList.map(async (data) => {
|
|
2164
|
+
const id = data.selfInfo ? data.selfInfo.id : data.id;
|
|
2165
|
+
console.log("Processing instance with id:", id);
|
|
2166
|
+
return await processData(id, data);
|
|
2167
|
+
})
|
|
2168
|
+
);
|
|
2169
|
+
} catch (error) {
|
|
2170
|
+
console.error("Error processing instances:", error);
|
|
2171
|
+
return [];
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
async function processData(id, result) {
|
|
2175
|
+
if (isEmpty(result)) return;
|
|
2176
|
+
console.log("Processing data for id:", result);
|
|
2177
|
+
const { selfInfo, paramsConfig, fillModeType } = result || {};
|
|
2178
|
+
const cloneRuntimeJson = cloneDeep(JSON.parse(selfInfo?.runtimeJson || "{}"));
|
|
2179
|
+
const paper = cloneRuntimeJson[ComponentTypeEnum.PAPER];
|
|
2180
|
+
const isFormInstance = payload.factoryType === "instance" || payload.factoryType === "batchInstance" || !!selfInfo?.tmplId;
|
|
2181
|
+
const hasCustomCheckTableDataSource = !!paper?.props?.checkTable2DList?.some((checkInfo) => {
|
|
2182
|
+
return checkInfo?.checkTable2d && (checkInfo?.checkDsType ?? CheckDsTypeEnum.DEFAULT) === CheckDsTypeEnum.CUSTOM;
|
|
2183
|
+
});
|
|
2184
|
+
if (paper && (isFormInstance || hasCustomCheckTableDataSource)) {
|
|
2185
|
+
await transformUtils.requestCheckDsData({
|
|
2186
|
+
paper,
|
|
2187
|
+
instanceId: id || "",
|
|
2188
|
+
cloneRuntimeJson,
|
|
2189
|
+
hasFormInstance: isFormInstance
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
const subTableCoreFactory = new SubTableCoreFactory({
|
|
2193
|
+
docInfo: selfInfo,
|
|
2194
|
+
runtimeJson: cloneRuntimeJson,
|
|
2195
|
+
fillModeType,
|
|
2196
|
+
paramsConfig
|
|
2197
|
+
});
|
|
2198
|
+
await subTableCoreFactory.init();
|
|
2199
|
+
const subTableInfo = transformUtils.getSubTableInfo(paper);
|
|
2200
|
+
const fieldInfoMap = await renderUtils.getFieldsByDataCenter(
|
|
2201
|
+
cloneRuntimeJson,
|
|
2202
|
+
paramsConfig?._gct_useDynRowHeight_
|
|
2203
|
+
);
|
|
2204
|
+
let balanceTableDataMaps = {};
|
|
2205
|
+
const materialNo = paramsConfig?.materialNo || selfInfo.materialNo;
|
|
2206
|
+
const tmplBomC = new FormTmplBomController();
|
|
2207
|
+
if (fillModeType === RenderModeEnum.FormMode) {
|
|
2208
|
+
tmplBomC.judgeScene({ cloneRuntimeJson, selfInfo });
|
|
2209
|
+
balanceTableDataMaps = await getConsumeData({
|
|
2210
|
+
cloneRuntimeJson,
|
|
2211
|
+
operationId: paramsConfig?.routingOperationId,
|
|
2212
|
+
materialNo
|
|
2213
|
+
// relatedLotNo: paramsConfig?.relatedLotNo,
|
|
2214
|
+
});
|
|
2215
|
+
}
|
|
2216
|
+
await tmplBomC.init({
|
|
2217
|
+
formInstBom: selfInfo.formInstBom,
|
|
2218
|
+
operationId: paramsConfig?.routingOperationId,
|
|
2219
|
+
materialNo
|
|
2220
|
+
// relatedLotNo: paramsConfig?.relatedLotNo,
|
|
2221
|
+
});
|
|
2222
|
+
const materialConsumeData = tmplBomC.calcFormState(paper);
|
|
2223
|
+
const modelQueries = await getModelQueries({ mainMaterialNo: materialNo });
|
|
2224
|
+
await renderUtils.setRequestInfo2DataCenter(
|
|
2225
|
+
cloneRuntimeJson,
|
|
2226
|
+
fieldInfoMap.modelKeyList,
|
|
2227
|
+
payload.platformType,
|
|
2228
|
+
payload.isMockReport,
|
|
2229
|
+
selfInfo.formType,
|
|
2230
|
+
paramsConfig,
|
|
2231
|
+
fieldInfoMap.useSignFields,
|
|
2232
|
+
fieldInfoMap.useClsReasonDataLink,
|
|
2233
|
+
fieldInfoMap.useClsGroupDataLink,
|
|
2234
|
+
tmplBomC,
|
|
2235
|
+
modelQueries
|
|
2236
|
+
);
|
|
2237
|
+
const [
|
|
2238
|
+
operationData,
|
|
2239
|
+
productData,
|
|
2240
|
+
mfgOrderData,
|
|
2241
|
+
ESOPData,
|
|
2242
|
+
materialNoData,
|
|
2243
|
+
relatedLotNoData,
|
|
2244
|
+
sterilizeLotData,
|
|
2245
|
+
warehouseData
|
|
2246
|
+
] = await renderUtils.fetchMultipleModelData([
|
|
2247
|
+
{
|
|
2248
|
+
modelKey: "em_routing_operation",
|
|
2249
|
+
bsKey: "getById",
|
|
2250
|
+
params: { id: paramsConfig?.routingOperationId }
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
modelKey: "em_product",
|
|
2254
|
+
bsKey: "rdoGetVersionById",
|
|
2255
|
+
params: { id: paramsConfig?.productId }
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
modelKey: "em_mfg_order",
|
|
2259
|
+
bsKey: "getById",
|
|
2260
|
+
params: { id: paramsConfig?.mfgOrderId }
|
|
2261
|
+
},
|
|
2262
|
+
{
|
|
2263
|
+
modelKey: "em_document",
|
|
2264
|
+
bsKey: "rdoGetVersionById",
|
|
2265
|
+
params: { id: paramsConfig?.sopList?.[0]?.id }
|
|
2266
|
+
},
|
|
2267
|
+
{
|
|
2268
|
+
modelKey: "em_production_identification",
|
|
2269
|
+
bsKey: "getById",
|
|
2270
|
+
params: { id: paramsConfig?.materialNoId }
|
|
2271
|
+
},
|
|
2272
|
+
{
|
|
2273
|
+
modelKey: "em_production_identification",
|
|
2274
|
+
bsKey: "getById",
|
|
2275
|
+
params: { id: paramsConfig?.relatedLotNoId }
|
|
2276
|
+
},
|
|
2277
|
+
{
|
|
2278
|
+
modelKey: "em_production_identification",
|
|
2279
|
+
bsKey: "getById",
|
|
2280
|
+
params: { id: paramsConfig?.sterilizationLotId }
|
|
2281
|
+
},
|
|
2282
|
+
{
|
|
2283
|
+
modelKey: "em_warehouse",
|
|
2284
|
+
bsKey: "getById",
|
|
2285
|
+
params: { id: paramsConfig?.warehouseId }
|
|
2286
|
+
}
|
|
2287
|
+
]);
|
|
2288
|
+
const defaultDataMap2 = renderUtils.getDefaultValueMapByField({
|
|
2289
|
+
defaultValueFields: fieldInfoMap.useDefaultValueFields,
|
|
2290
|
+
mainMaterialNo: paramsConfig?.materialNo || selfInfo.materialNo,
|
|
2291
|
+
mainRelatedLotNo: paramsConfig?.relatedLotNo,
|
|
2292
|
+
mainProductName: paramsConfig?.productId,
|
|
2293
|
+
mainRoutingOperation: paramsConfig?.routingOperationId,
|
|
2294
|
+
// 原mfgOrderCode后端给的不是 Id,但工单号字段绑的是id,所以导致数据回显会有问题,新加了mfgOrderId字段,这里做兼容处理
|
|
2295
|
+
mainMfgOrderId: paramsConfig?._gct_nocode_mfg_order_id_ || paramsConfig?.mfgOrderId || paramsConfig?.mfgOrderCode,
|
|
2296
|
+
mainWarehouseId: paramsConfig?.warehouseId,
|
|
2297
|
+
mainSterilizationLot: paramsConfig?.sterilizationLot,
|
|
2298
|
+
mainSterilizationLotId: paramsConfig?.sterilizationLotId,
|
|
2299
|
+
defaultUserId: payload?.deviceConfig?.defaultUserId,
|
|
2300
|
+
defaultOrgId: payload?.deviceConfig?.defaultOrgId,
|
|
2301
|
+
operationData,
|
|
2302
|
+
productData,
|
|
2303
|
+
mfgOrderData,
|
|
2304
|
+
materialNoData,
|
|
2305
|
+
relatedLotNoData,
|
|
2306
|
+
sterilizeLotData,
|
|
2307
|
+
warehouseData,
|
|
2308
|
+
sopList: paramsConfig?.sopList,
|
|
2309
|
+
ESOPData
|
|
2310
|
+
});
|
|
2311
|
+
subTableCoreFactory.handleDefaultMap({ pageDefaultMap: defaultDataMap2 });
|
|
2312
|
+
console.log("defaultDataMap", defaultDataMap2);
|
|
2313
|
+
tmplBomC.handleDefaultMap(defaultDataMap2);
|
|
2314
|
+
const defaultData = transformUtils.getDefaultData({
|
|
2315
|
+
defaultDataMap: defaultDataMap2,
|
|
2316
|
+
subTableInfo,
|
|
2317
|
+
viewMode: result.fillModeType,
|
|
2318
|
+
paper,
|
|
2319
|
+
dataCenter: cloneRuntimeJson
|
|
2320
|
+
});
|
|
2321
|
+
console.log("defaultData", defaultData);
|
|
2322
|
+
let paramData, customData, initEventData;
|
|
2323
|
+
try {
|
|
2324
|
+
if (payload.platformType === PlatformEnum.INTEGRATION_PAAS_SI && !payload.isMockReport) {
|
|
2325
|
+
[paramData, customData, initEventData] = await Promise.all([
|
|
2326
|
+
transformUtils.getParamData({
|
|
2327
|
+
paper,
|
|
2328
|
+
paramsConfig,
|
|
2329
|
+
subTableInfo,
|
|
2330
|
+
fieldPermission: JSON.parse(selfInfo.processFieldPermission || "[]") || []
|
|
2331
|
+
}),
|
|
2332
|
+
transformUtils.requestCustomSourceData({
|
|
2333
|
+
paper,
|
|
2334
|
+
paramsConfig,
|
|
2335
|
+
instanceId: id,
|
|
2336
|
+
subTableInfo
|
|
2337
|
+
}).catch((e2) => {
|
|
2338
|
+
console.error("Error in requestCustomSourceData:", e2);
|
|
2339
|
+
return null;
|
|
2340
|
+
}),
|
|
2341
|
+
transformUtils.getEventInitDataLoad({
|
|
2342
|
+
paper,
|
|
2343
|
+
paramsConfig,
|
|
2344
|
+
viewMode: result.fillModeType,
|
|
2345
|
+
ofCtx: {
|
|
2346
|
+
formPrint: payload.formPrint,
|
|
2347
|
+
id: result.id,
|
|
2348
|
+
tid: result.tid,
|
|
2349
|
+
updatePageData,
|
|
2350
|
+
findBasicInsInfo,
|
|
2351
|
+
findFormInsInfo
|
|
2352
|
+
}
|
|
2353
|
+
}).catch((e2) => {
|
|
2354
|
+
console.error("Error in getEventInitDataLoad:", e2);
|
|
2355
|
+
return null;
|
|
2356
|
+
})
|
|
2357
|
+
]);
|
|
2358
|
+
}
|
|
2359
|
+
} catch (error) {
|
|
2360
|
+
console.error("Unexpected error:", error);
|
|
2361
|
+
}
|
|
2362
|
+
const interfaceData = await baseDataUtils.requestRenderData({
|
|
2363
|
+
info: selfInfo,
|
|
2364
|
+
fetchConfig: { _gct_materialNo_: props.materialNo || selfInfo.materialNo },
|
|
2365
|
+
queryConfig: result.query,
|
|
2366
|
+
foreignFields: fieldInfoMap.foreignFields,
|
|
2367
|
+
subModelFields: fieldInfoMap.subModelFields,
|
|
2368
|
+
isMockReport: payload.isMockReport
|
|
2369
|
+
});
|
|
2370
|
+
const formState = transformUtils.conversionFormState({
|
|
2371
|
+
defaultData,
|
|
2372
|
+
paramData,
|
|
2373
|
+
customData,
|
|
2374
|
+
initEventData,
|
|
2375
|
+
interfaceData,
|
|
2376
|
+
subTableInfo,
|
|
2377
|
+
viewMode: result.fillModeType,
|
|
2378
|
+
dataStatus: selfInfo.dataStatus,
|
|
2379
|
+
materialConsumeData,
|
|
2380
|
+
balanceTableDataMaps,
|
|
2381
|
+
subTableCoreFactory,
|
|
2382
|
+
paper
|
|
2383
|
+
});
|
|
2384
|
+
if (payload.afterProcessData && typeof payload.afterProcessData === "function") {
|
|
2385
|
+
payload.afterProcessData(formState);
|
|
2386
|
+
}
|
|
2387
|
+
const eventInstance = transformUtils.setEventInstance({
|
|
2388
|
+
paper,
|
|
2389
|
+
formState,
|
|
2390
|
+
viewMode: result.fillModeType,
|
|
2391
|
+
ofCtx: {
|
|
2392
|
+
formPrint: payload.formPrint,
|
|
2393
|
+
id: result.id,
|
|
2394
|
+
tid: result.tid,
|
|
2395
|
+
updatePageData,
|
|
2396
|
+
findBasicInsInfo,
|
|
2397
|
+
findFormInsInfo
|
|
2398
|
+
}
|
|
2399
|
+
});
|
|
2400
|
+
const pageData = selfInfo.formType === FormTypeEnum.FILE ? [] : calcUtils.initCalc(cloneRuntimeJson, formState);
|
|
2401
|
+
console.log("LXM::运行时处理的数据", pageData);
|
|
2402
|
+
const tid = result.tid;
|
|
2403
|
+
const uniqueId = `${tid}_${uuid2(8)}`;
|
|
2404
|
+
const updates = {
|
|
2405
|
+
dataCenter: { [uniqueId]: cloneRuntimeJson },
|
|
2406
|
+
defaultData: { [uniqueId]: defaultDataMap2 },
|
|
2407
|
+
pageData: { [uniqueId]: pageData },
|
|
2408
|
+
formState: { [uniqueId]: formState },
|
|
2409
|
+
tmplBomC: { [uniqueId]: tmplBomC },
|
|
2410
|
+
subTableCoreFactory: { [uniqueId]: subTableCoreFactory },
|
|
2411
|
+
basicInfo: {
|
|
2412
|
+
key: id,
|
|
2413
|
+
tid,
|
|
2414
|
+
uniqueId,
|
|
2415
|
+
modelKey: selfInfo.modelKey,
|
|
2416
|
+
formType: selfInfo.formType ?? FormTypeEnum.BASE,
|
|
2417
|
+
platformType: payload.platformType,
|
|
2418
|
+
isMockReport: payload.isMockReport,
|
|
2419
|
+
renderModeType: result.fillModeType,
|
|
2420
|
+
btnRenderModeType: result.btnModelType,
|
|
2421
|
+
bpmnType: result.bpmnType,
|
|
2422
|
+
bpmnFieldAuthMap: result.bpmnFieldAuthMap,
|
|
2423
|
+
gct_stashData: result.query?._gct_dataStatus_ === "STASH",
|
|
2424
|
+
eventInstance,
|
|
2425
|
+
formChangeStatus: false,
|
|
2426
|
+
formChangeOriginData: {},
|
|
2427
|
+
formChangeNewData: {},
|
|
2428
|
+
annSwitchStatus: false,
|
|
2429
|
+
annCellLocationList: [],
|
|
2430
|
+
annSelectId: void 0,
|
|
2431
|
+
validatorLocationList: [],
|
|
2432
|
+
validatorMessageMap: {},
|
|
2433
|
+
mobileTdIdGroups: fieldInfoMap.tdIdGroups,
|
|
2434
|
+
mobileSelectTdId: void 0,
|
|
2435
|
+
contentHighlight: paramsConfig?._gct_nocode_of_instance_id_ === props.selfId ? {
|
|
2436
|
+
[ComponentTypeEnum.Trace]: normalizeToArray(
|
|
2437
|
+
paramsConfig?._gct_nocode_trace_values_
|
|
2438
|
+
)
|
|
2439
|
+
} : {},
|
|
2440
|
+
productSearchFields: payload?.deviceConfig?.defaultProductSearchFields
|
|
2441
|
+
},
|
|
2442
|
+
selfInfo: {
|
|
2443
|
+
...selfInfo,
|
|
2444
|
+
newBackupInfo: {
|
|
2445
|
+
foreignFields: fieldInfoMap.foreignFields,
|
|
2446
|
+
subModelFields: fieldInfoMap.subModelFields,
|
|
2447
|
+
appendixFields: fieldInfoMap.useAppendixFields,
|
|
2448
|
+
subTableInfo
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
};
|
|
2452
|
+
return updates;
|
|
2453
|
+
}
|
|
2454
|
+
function clear() {
|
|
2455
|
+
clearFormRules();
|
|
2456
|
+
dataCenterMap.value = {};
|
|
2457
|
+
pageDataMap.value = {};
|
|
2458
|
+
Object.keys(formStateMap.value).forEach((key) => {
|
|
2459
|
+
delete formStateMap.value[key];
|
|
2460
|
+
});
|
|
2461
|
+
Object.keys(defaultDataMap.value).forEach((key) => {
|
|
2462
|
+
delete defaultDataMap.value[key];
|
|
2463
|
+
});
|
|
2464
|
+
basicInfoList.value = [];
|
|
2465
|
+
selfInfoList.value = [];
|
|
2466
|
+
}
|
|
2467
|
+
const findFormInsInfo = (id) => {
|
|
2468
|
+
return selfInfoList.value.find((item) => item.id === id);
|
|
2469
|
+
};
|
|
2470
|
+
const findBasicInsInfo = (id) => {
|
|
2471
|
+
return basicInfoList.value.find((item) => item.key === id || item.tid === id);
|
|
2472
|
+
};
|
|
2473
|
+
const updatePageData = (uniqueId) => {
|
|
2474
|
+
console.log("tangjianaaaa", cloneDeep(formStateMap.value[uniqueId]));
|
|
2475
|
+
pageDataMap.value[uniqueId] = calcUtils.initCalc(
|
|
2476
|
+
dataCenterMap.value[uniqueId],
|
|
2477
|
+
formStateMap.value[uniqueId]
|
|
2478
|
+
);
|
|
2479
|
+
};
|
|
2480
|
+
const updateRenderModeType = (uniqueId, newRenderModeType, updateButton = false) => {
|
|
2481
|
+
basicInfoList.value.forEach((info) => {
|
|
2482
|
+
if (info.uniqueId === uniqueId) {
|
|
2483
|
+
info.renderModeType = newRenderModeType;
|
|
2484
|
+
if (updateButton) {
|
|
2485
|
+
info.btnRenderModeType = newRenderModeType;
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
});
|
|
2489
|
+
};
|
|
2490
|
+
async function validate$1(uniqueId) {
|
|
2491
|
+
const formState = formStateMap.value?.[uniqueId];
|
|
2492
|
+
const dataCenter = dataCenterMap.value?.[uniqueId];
|
|
2493
|
+
const bomC = tmplBomCMap.value?.[uniqueId];
|
|
2494
|
+
const res = await validate(formState, dataCenter[ComponentTypeEnum.PAPER]);
|
|
2495
|
+
if (bomC) {
|
|
2496
|
+
const bomRes = await bomC.submitValidate();
|
|
2497
|
+
if (!bomRes.isValid) {
|
|
2498
|
+
merge(res, bomRes);
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
setValidatorViewStatus(uniqueId, res?.fields ?? {});
|
|
2502
|
+
return res;
|
|
2503
|
+
}
|
|
2504
|
+
const getFormState = (uniqueId) => {
|
|
2505
|
+
const formState = formStateMap.value?.[uniqueId];
|
|
2506
|
+
const dataCenter = dataCenterMap.value?.[uniqueId];
|
|
2507
|
+
return transformUtils.getSubmitFormData(
|
|
2508
|
+
cloneDeep(formState),
|
|
2509
|
+
dataCenter[ComponentTypeEnum.PAPER]
|
|
2510
|
+
);
|
|
2511
|
+
};
|
|
2512
|
+
const setFromEditStatus = async (uniqueId) => {
|
|
2513
|
+
payload.onFinisher && payload.onFinisher(props.selfId, RenderModeEnum.FormMode);
|
|
2514
|
+
basicInfoList.value.forEach((info) => {
|
|
2515
|
+
if (info.uniqueId === uniqueId) {
|
|
2516
|
+
info.renderModeType = RenderModeEnum.FormMode;
|
|
2517
|
+
info.formChangeStatus = true;
|
|
2518
|
+
info.formChangeOriginData = cloneDeep(formStateMap.value?.[uniqueId]);
|
|
2519
|
+
info.formChangeNewData = {};
|
|
2520
|
+
}
|
|
2521
|
+
});
|
|
2522
|
+
return true;
|
|
2523
|
+
};
|
|
2524
|
+
const setAnnotationViewStatus = (uniqueId, status, config) => {
|
|
2525
|
+
basicInfoList.value.forEach((info) => {
|
|
2526
|
+
if (info.uniqueId === uniqueId) {
|
|
2527
|
+
info.annSwitchStatus = status;
|
|
2528
|
+
info.annCellLocationList = status ? cloneDeep(config) : [];
|
|
2529
|
+
info.annSelectId = void 0;
|
|
2530
|
+
}
|
|
2531
|
+
});
|
|
2532
|
+
return true;
|
|
2533
|
+
};
|
|
2534
|
+
const setValidatorViewStatus = (uniqueId, config) => {
|
|
2535
|
+
basicInfoList.value.forEach((info) => {
|
|
2536
|
+
if (info.uniqueId === uniqueId) {
|
|
2537
|
+
info.validatorLocationList = Object.keys(config);
|
|
2538
|
+
info.validatorMessageMap = config;
|
|
2539
|
+
}
|
|
2540
|
+
});
|
|
2541
|
+
return true;
|
|
2542
|
+
};
|
|
2543
|
+
const getAnnotationContentList = (uniqueId, options = {}) => {
|
|
2544
|
+
const info = basicInfoList.value.find((item) => item.uniqueId === uniqueId);
|
|
2545
|
+
const data = info ? cloneDeep(info.formChangeNewData) : {};
|
|
2546
|
+
basicInfoList.value.forEach((info2) => {
|
|
2547
|
+
if (info2.uniqueId === uniqueId) {
|
|
2548
|
+
info2.renderModeType = RenderModeEnum.ViewMode;
|
|
2549
|
+
info2.formChangeStatus = false;
|
|
2550
|
+
info2.formChangeOriginData = {};
|
|
2551
|
+
info2.formChangeNewData = {};
|
|
2552
|
+
}
|
|
2553
|
+
});
|
|
2554
|
+
return Object.values(data).map((item) => {
|
|
2555
|
+
return {
|
|
2556
|
+
...item,
|
|
2557
|
+
...options
|
|
2558
|
+
};
|
|
2559
|
+
});
|
|
2560
|
+
};
|
|
2561
|
+
const quickSearchRenderData = async (uniqueId, currentSelfInfo) => {
|
|
2562
|
+
const selfInfo = await payload.requestCallback({ id: currentSelfInfo.id });
|
|
2563
|
+
const interfaceData = await baseDataUtils.requestRenderData({
|
|
2564
|
+
info: currentSelfInfo,
|
|
2565
|
+
fetchConfig: { _gct_materialNo_: props.materialNo || selfInfo.materialNo },
|
|
2566
|
+
queryConfig: selfInfo.dataId ? { id_: selfInfo.dataId } : {},
|
|
2567
|
+
foreignFields: currentSelfInfo.newBackupInfo.foreignFields,
|
|
2568
|
+
subModelFields: currentSelfInfo.newBackupInfo.subModelFields,
|
|
2569
|
+
isMockReport: false
|
|
2570
|
+
});
|
|
2571
|
+
const newFormState = transformUtils.conversionFormState({
|
|
2572
|
+
defaultData: {},
|
|
2573
|
+
interfaceData,
|
|
2574
|
+
subTableInfo: currentSelfInfo.newBackupInfo.subTableInfo,
|
|
2575
|
+
viewMode: RenderModeEnum.ViewMode,
|
|
2576
|
+
dataStatus: selfInfo.dataStatus
|
|
2577
|
+
});
|
|
2578
|
+
const idsFormState = transformUtils.getFormDataIdsMap(newFormState);
|
|
2579
|
+
merge(formStateMap.value?.[uniqueId], idsFormState);
|
|
2580
|
+
if (payload.afterProcessData && typeof payload.afterProcessData === "function") {
|
|
2581
|
+
payload.afterProcessData(formStateMap.value?.[uniqueId]);
|
|
2582
|
+
}
|
|
2583
|
+
};
|
|
2584
|
+
const getAppendixInfos = (uniqueId, currentSelfInfo, types = []) => {
|
|
2585
|
+
const formState = formStateMap.value?.[uniqueId];
|
|
2586
|
+
const list = (currentSelfInfo.newBackupInfo.appendixFields || []).filter((item) => !types.length || types.includes(item.fieldType)).flatMap((item) => {
|
|
2587
|
+
if (item.subModelKey && item.subFieldKey) {
|
|
2588
|
+
const subList = formState?.[item.subFieldKey];
|
|
2589
|
+
if (Array.isArray(subList)) {
|
|
2590
|
+
return subList.flatMap(
|
|
2591
|
+
(subItem) => (subItem?.[item.fieldId] || "").split(",").filter(Boolean)
|
|
2592
|
+
);
|
|
2593
|
+
}
|
|
2594
|
+
return [];
|
|
2595
|
+
} else {
|
|
2596
|
+
const value = formState?.[item.fieldId];
|
|
2597
|
+
return (value || "").split(",").filter(Boolean);
|
|
2598
|
+
}
|
|
2599
|
+
});
|
|
2600
|
+
return list;
|
|
2601
|
+
};
|
|
2602
|
+
const getPdfInfos = (uniqueId) => {
|
|
2603
|
+
const formState = formStateMap.value?.[uniqueId];
|
|
2604
|
+
const fieldId = "file_";
|
|
2605
|
+
const modelValue = formState?.[fieldId];
|
|
2606
|
+
return modelValue ? modelValue.split(",") : [];
|
|
2607
|
+
};
|
|
2608
|
+
return {
|
|
2609
|
+
counter,
|
|
2610
|
+
finisher,
|
|
2611
|
+
loading: fetchLoading,
|
|
2612
|
+
dataCenterMap,
|
|
2613
|
+
pageDataMap,
|
|
2614
|
+
formStateMap,
|
|
2615
|
+
defaultDataMap,
|
|
2616
|
+
basicInfoList,
|
|
2617
|
+
selfInfoList,
|
|
2618
|
+
tmplBomCMap,
|
|
2619
|
+
subTableCoreFactoryMap,
|
|
2620
|
+
hasData,
|
|
2621
|
+
findFormInsInfo,
|
|
2622
|
+
findBasicInsInfo,
|
|
2623
|
+
updatePageData,
|
|
2624
|
+
updateRenderModeType,
|
|
2625
|
+
validate: validate$1,
|
|
2626
|
+
getFormState,
|
|
2627
|
+
setFromEditStatus,
|
|
2628
|
+
setAnnotationViewStatus,
|
|
2629
|
+
getAnnotationContentList,
|
|
2630
|
+
setValidatorViewStatus,
|
|
2631
|
+
quickSearchRenderData,
|
|
2632
|
+
getAppendixInfos,
|
|
2633
|
+
getPdfInfos
|
|
2634
|
+
};
|
|
2635
|
+
}
|
|
2636
|
+
function useEbrWikiFactoryV2(props, payload) {
|
|
2637
|
+
const { emitter, EmitterEnum } = useNocodeEmitter();
|
|
2638
|
+
const loading = ref(false);
|
|
2639
|
+
const treeData = ref([]);
|
|
2640
|
+
const edhrInstance = ref();
|
|
2641
|
+
const docInstanceList = ref([]);
|
|
2642
|
+
const treeSelectDocData = ref();
|
|
2643
|
+
const selectSelfInfo = ref();
|
|
2644
|
+
const releaseList = ref([]);
|
|
2645
|
+
const appendixList = ref([]);
|
|
2646
|
+
const transactionList = ref([]);
|
|
2647
|
+
const reworkList = ref([]);
|
|
2648
|
+
const linkList = ref([]);
|
|
2649
|
+
const selectReleaseInfo = ref();
|
|
2650
|
+
const selectAppendixInfo = ref();
|
|
2651
|
+
const selectTransactionInfo = ref();
|
|
2652
|
+
const selectReworkInfo = ref();
|
|
2653
|
+
const selectLinkInfo = ref();
|
|
2654
|
+
const searchVal = ref();
|
|
2655
|
+
const tabActiveKey = ref();
|
|
2656
|
+
const edhrCounter = ref(0);
|
|
2657
|
+
const edhrFinisher = ref(0);
|
|
2658
|
+
const instanceCounter = ref(0);
|
|
2659
|
+
const edhrIconStatusCounter = ref(0);
|
|
2660
|
+
const appendixCounter = ref(0);
|
|
2661
|
+
async function requestInstanceByMaterialNo(materialNo) {
|
|
2662
|
+
const detail = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
|
|
2663
|
+
{
|
|
2664
|
+
modelCategory: EntityModelCategoryEnum.ENTITY,
|
|
2665
|
+
modelKey: "em_product_process",
|
|
2666
|
+
bsKey: "getInstanceByMaterialNo"
|
|
2667
|
+
},
|
|
2668
|
+
{ materialNo, mfgOrderId: props?.paramExtraProps?._gct_nocode_mfg_order_id_ },
|
|
2669
|
+
{},
|
|
2670
|
+
{ ignoreParamsToData: true }
|
|
2671
|
+
);
|
|
2672
|
+
console.log("wiki大纲和edhr实例", detail);
|
|
2673
|
+
return detail;
|
|
2674
|
+
}
|
|
2675
|
+
async function requestReleaseByMaterialNo(id) {
|
|
2676
|
+
const res = await api.apaas.productRelease.getGetProductReleaseForm({
|
|
2677
|
+
edhrInstanceId: id
|
|
2678
|
+
});
|
|
2679
|
+
console.log("查询放行单列表", res);
|
|
2680
|
+
if (!res) return [];
|
|
2681
|
+
if (res.instance) {
|
|
2682
|
+
return [{ ...res.instance, showType: "INST" }];
|
|
2683
|
+
}
|
|
2684
|
+
if (res.tmpl) {
|
|
2685
|
+
const { baseId, id: id2, name, formType } = res.tmpl;
|
|
2686
|
+
return [
|
|
2687
|
+
{
|
|
2688
|
+
id: `${baseId}:${id2}`,
|
|
2689
|
+
tmplName: name,
|
|
2690
|
+
formType,
|
|
2691
|
+
dataStatus: null,
|
|
2692
|
+
instanceStatus: null,
|
|
2693
|
+
showType: "TMPL"
|
|
2694
|
+
}
|
|
2695
|
+
];
|
|
2696
|
+
}
|
|
2697
|
+
return [];
|
|
2698
|
+
}
|
|
2699
|
+
async function requestAppendixByMaterialNo(id) {
|
|
2700
|
+
const list = await api.apaas.onlineFormInstance.getAppendixFormList({
|
|
2701
|
+
materialNo: id,
|
|
2702
|
+
mfgOrderId: props?.paramExtraProps?._gct_nocode_mfg_order_id_
|
|
2703
|
+
});
|
|
2704
|
+
console.log("查询附录列表", list);
|
|
2705
|
+
return (list ?? [])?.filter((item) => item.ext1 !== "rework");
|
|
2706
|
+
}
|
|
2707
|
+
async function requestTxn2ReworkList(instId, lotSnNo, materialStatus, mfgOrderId) {
|
|
2708
|
+
const res = await api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey(
|
|
2709
|
+
{
|
|
2710
|
+
modelCategory: EntityModelCategoryEnum.ENTITY,
|
|
2711
|
+
modelKey: "em_edhr_summary_form_inst",
|
|
2712
|
+
bsKey: "biz_search_all_form_inst"
|
|
2713
|
+
},
|
|
2714
|
+
{
|
|
2715
|
+
edhrInstId: instId,
|
|
2716
|
+
materialNo: lotSnNo,
|
|
2717
|
+
materialStatus,
|
|
2718
|
+
mfgOrderId,
|
|
2719
|
+
isAll: true
|
|
2720
|
+
}
|
|
2721
|
+
);
|
|
2722
|
+
console.log("查询事务、返工、关联表单列表", res);
|
|
2723
|
+
return {
|
|
2724
|
+
reworkList: res?.reworkList || [],
|
|
2725
|
+
txnList: res?.txnList || [],
|
|
2726
|
+
relationFormList: res?.relationFormList || []
|
|
2727
|
+
};
|
|
2728
|
+
}
|
|
2729
|
+
watch(
|
|
2730
|
+
[() => props.materialNo, () => edhrCounter.value],
|
|
2731
|
+
async ([newMaterialNo, _2]) => {
|
|
2732
|
+
if (isEmpty(newMaterialNo)) return;
|
|
2733
|
+
loading.value = true;
|
|
2734
|
+
clear();
|
|
2735
|
+
try {
|
|
2736
|
+
const instancePromise = requestInstanceByMaterialNo(newMaterialNo);
|
|
2737
|
+
const appendixPromise = requestAppendixByMaterialNo(newMaterialNo);
|
|
2738
|
+
const edhrRes = await instancePromise;
|
|
2739
|
+
let releasePromise = Promise.resolve(null);
|
|
2740
|
+
let txn2ReworkPromise = Promise.resolve(null);
|
|
2741
|
+
if (edhrRes) {
|
|
2742
|
+
releasePromise = requestReleaseByMaterialNo(edhrRes.edhrInstance.id);
|
|
2743
|
+
txn2ReworkPromise = requestTxn2ReworkList(
|
|
2744
|
+
edhrRes.edhrInstance.id,
|
|
2745
|
+
edhrRes.edhrInstance.materialNo,
|
|
2746
|
+
edhrRes.edhrInstance.materialStatus,
|
|
2747
|
+
edhrRes.edhrInstance.mfgOrderId
|
|
2748
|
+
);
|
|
2749
|
+
} else {
|
|
2750
|
+
console.warn("edhrRes 不存在,跳过 release 请求");
|
|
2751
|
+
}
|
|
2752
|
+
const [releaseRes, appendixRes, txn2ReworkRes] = await Promise.all([
|
|
2753
|
+
releasePromise,
|
|
2754
|
+
appendixPromise,
|
|
2755
|
+
txn2ReworkPromise
|
|
2756
|
+
]);
|
|
2757
|
+
if (edhrRes) {
|
|
2758
|
+
treeData.value = commonUtils.listTransformTree(edhrRes.docOutlines);
|
|
2759
|
+
edhrInstance.value = edhrRes.edhrInstance;
|
|
2760
|
+
}
|
|
2761
|
+
releaseList.value = releaseRes ?? [];
|
|
2762
|
+
appendixList.value = appendixRes ?? [];
|
|
2763
|
+
transactionList.value = txn2ReworkRes.txnList ?? [];
|
|
2764
|
+
reworkList.value = txn2ReworkRes.reworkList ?? [];
|
|
2765
|
+
linkList.value = txn2ReworkRes.relationFormList ?? [];
|
|
2766
|
+
if (!selectReleaseInfo.value) {
|
|
2767
|
+
selectReleaseInfo.value = releaseRes?.[0];
|
|
2768
|
+
}
|
|
2769
|
+
if (!selectAppendixInfo.value) {
|
|
2770
|
+
selectAppendixInfo.value = appendixRes?.[0];
|
|
2771
|
+
}
|
|
2772
|
+
if (!selectTransactionInfo.value) {
|
|
2773
|
+
selectTransactionInfo.value = txn2ReworkRes.txnList?.[0];
|
|
2774
|
+
}
|
|
2775
|
+
if (!selectReworkInfo.value) {
|
|
2776
|
+
selectReworkInfo.value = txn2ReworkRes.reworkList?.[0];
|
|
2777
|
+
}
|
|
2778
|
+
if (!selectLinkInfo.value) {
|
|
2779
|
+
selectLinkInfo.value = txn2ReworkRes.relationFormList?.[0];
|
|
2780
|
+
}
|
|
2781
|
+
tabActiveKey.value = "2";
|
|
2782
|
+
} catch (error) {
|
|
2783
|
+
console.error("请求失败:", error);
|
|
2784
|
+
} finally {
|
|
2785
|
+
loading.value = false;
|
|
2786
|
+
edhrFinisher.value++;
|
|
2787
|
+
}
|
|
2788
|
+
},
|
|
2789
|
+
{ immediate: true, deep: true }
|
|
2790
|
+
);
|
|
2791
|
+
watch(
|
|
2792
|
+
() => edhrIconStatusCounter.value,
|
|
2793
|
+
async (newEdhrIconStatusCounter) => {
|
|
2794
|
+
if (newEdhrIconStatusCounter) {
|
|
2795
|
+
const detail = await requestInstanceByMaterialNo(props.materialNo);
|
|
2796
|
+
if (detail) {
|
|
2797
|
+
treeData.value = commonUtils.listTransformTree(detail.docOutlines);
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
);
|
|
2802
|
+
watch(
|
|
2803
|
+
() => appendixCounter.value,
|
|
2804
|
+
async (newAppendixCounter) => {
|
|
2805
|
+
if (newAppendixCounter) {
|
|
2806
|
+
const detail = await requestAppendixByMaterialNo(props.materialNo);
|
|
2807
|
+
if (detail) {
|
|
2808
|
+
appendixList.value = detail ?? [];
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
);
|
|
2813
|
+
watch(
|
|
2814
|
+
[() => treeData.value, () => props.ofTmplId],
|
|
2815
|
+
([newTreeData, newOfTmplId]) => {
|
|
2816
|
+
if (newTreeData && newTreeData.length !== 0) {
|
|
2817
|
+
if (!treeSelectDocData.value) {
|
|
2818
|
+
treeSelectDocData.value = commonUtils.findFirstDoc(newTreeData, newOfTmplId);
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
},
|
|
2822
|
+
{
|
|
2823
|
+
immediate: true,
|
|
2824
|
+
deep: true
|
|
2825
|
+
}
|
|
2826
|
+
);
|
|
2827
|
+
async function loadInstances(tid, description) {
|
|
2828
|
+
const isAbandon = edhrInstance.value?.instanceStatus === "ABANDON";
|
|
2829
|
+
const isRecordChangePage = payload.pageType === "record-change";
|
|
2830
|
+
const res = await api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey(
|
|
2831
|
+
{
|
|
2832
|
+
modelCategory: EntityModelCategoryEnum.ENTITY,
|
|
2833
|
+
modelKey: "em_edhr_summary_form_inst",
|
|
2834
|
+
bsKey: "biz_search_in_select"
|
|
2835
|
+
},
|
|
2836
|
+
{},
|
|
2837
|
+
{
|
|
2838
|
+
docOutlineId: treeSelectDocData.value?.id,
|
|
2839
|
+
ofTmplId: tid,
|
|
2840
|
+
// 在线表单模板id
|
|
2841
|
+
edhrInstanceId: edhrInstance.value.id,
|
|
2842
|
+
// edhr实例id
|
|
2843
|
+
ignoreAbandon: !(isAbandon || isRecordChangePage),
|
|
2844
|
+
// 是否忽略作废表单
|
|
2845
|
+
pageNo: 1,
|
|
2846
|
+
pageSize: 9999999,
|
|
2847
|
+
description
|
|
2848
|
+
}
|
|
2849
|
+
);
|
|
2850
|
+
if (res?.data) {
|
|
2851
|
+
docInstanceList.value = res.data ?? [];
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
watch(
|
|
2855
|
+
() => treeSelectDocData.value,
|
|
2856
|
+
async (newNode) => {
|
|
2857
|
+
if (!newNode) return;
|
|
2858
|
+
const tid = newNode.refId || newNode.id;
|
|
2859
|
+
const res = await payload.needCreateNewInstance?.({
|
|
2860
|
+
ofTmplId: tid,
|
|
2861
|
+
edhrInstanceId: edhrInstance.value.id,
|
|
2862
|
+
ignoreAbandon: true,
|
|
2863
|
+
pageNo: 1,
|
|
2864
|
+
pageSize: 20
|
|
2865
|
+
});
|
|
2866
|
+
if (res) {
|
|
2867
|
+
await payload.createOnlineFormInstance?.({
|
|
2868
|
+
docOutlineId: newNode.id,
|
|
2869
|
+
edhrInstanceId: edhrInstance.value.id,
|
|
2870
|
+
tmplId: tid,
|
|
2871
|
+
description: $t("sys.onlineForm.initializeInstance")
|
|
2872
|
+
});
|
|
2873
|
+
}
|
|
2874
|
+
await loadInstances(tid, searchVal.value);
|
|
2875
|
+
},
|
|
2876
|
+
{ immediate: true }
|
|
2877
|
+
);
|
|
2878
|
+
watch(
|
|
2879
|
+
[() => searchVal.value, () => instanceCounter.value],
|
|
2880
|
+
async ([newSearchValue]) => {
|
|
2881
|
+
const node = treeSelectDocData.value;
|
|
2882
|
+
if (!node) return;
|
|
2883
|
+
const tid = node.refId || node.id;
|
|
2884
|
+
await loadInstances(tid, newSearchValue);
|
|
2885
|
+
},
|
|
2886
|
+
{ immediate: false }
|
|
2887
|
+
);
|
|
2888
|
+
watch(
|
|
2889
|
+
() => docInstanceList.value,
|
|
2890
|
+
(newDocInstanceList) => {
|
|
2891
|
+
if (!newDocInstanceList?.length) {
|
|
2892
|
+
if (selectSelfInfo.value) {
|
|
2893
|
+
selectSelfInfo.value = null;
|
|
2894
|
+
}
|
|
2895
|
+
return;
|
|
2896
|
+
}
|
|
2897
|
+
const hasSpecialInstance = props.ofInstanceId && props.ofTmplId === treeSelectDocData.value.id;
|
|
2898
|
+
const currentValueValid = selectSelfInfo.value && newDocInstanceList.some((item) => item.id === selectSelfInfo.value?.id);
|
|
2899
|
+
if (!selectSelfInfo.value || !currentValueValid) {
|
|
2900
|
+
selectSelfInfo.value = hasSpecialInstance ? newDocInstanceList.find((item) => item.id === props.ofInstanceId) || newDocInstanceList[0] : newDocInstanceList[0];
|
|
2901
|
+
}
|
|
2902
|
+
},
|
|
2903
|
+
{
|
|
2904
|
+
immediate: true,
|
|
2905
|
+
deep: true
|
|
2906
|
+
}
|
|
2907
|
+
);
|
|
2908
|
+
watch(
|
|
2909
|
+
[() => selectSelfInfo.value, () => instanceCounter.value],
|
|
2910
|
+
([newSelectSelfInfo, _2]) => {
|
|
2911
|
+
if (newSelectSelfInfo && payload.pageType === "record-change") {
|
|
2912
|
+
emitter.emit(EmitterEnum.__on_select_ebr_doc_instance_id, {
|
|
2913
|
+
instanceId: newSelectSelfInfo.id
|
|
2914
|
+
});
|
|
2915
|
+
}
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
immediate: true,
|
|
2919
|
+
deep: true
|
|
2920
|
+
}
|
|
2921
|
+
);
|
|
2922
|
+
const hasData = computed(() => {
|
|
2923
|
+
return treeData.value.length !== 0;
|
|
2924
|
+
});
|
|
2925
|
+
const selectInstanceInfo = computed(() => {
|
|
2926
|
+
const key = tabActiveKey.value;
|
|
2927
|
+
let id;
|
|
2928
|
+
let showType;
|
|
2929
|
+
let officeType, modelKey;
|
|
2930
|
+
switch (key) {
|
|
2931
|
+
case "1":
|
|
2932
|
+
id = selectReleaseInfo.value?.id;
|
|
2933
|
+
showType = selectReleaseInfo.value?.showType;
|
|
2934
|
+
officeType = selectReleaseInfo.value?.officeType;
|
|
2935
|
+
modelKey = selectReleaseInfo.value?.modelKey;
|
|
2936
|
+
break;
|
|
2937
|
+
case "2":
|
|
2938
|
+
case "7":
|
|
2939
|
+
if (docInstanceList.value.length) {
|
|
2940
|
+
if (selectSelfInfo.value?.id) {
|
|
2941
|
+
id = selectSelfInfo.value?.id;
|
|
2942
|
+
showType = "INST";
|
|
2943
|
+
officeType = selectSelfInfo.value?.officeType;
|
|
2944
|
+
modelKey = selectSelfInfo.value?.modelKey;
|
|
2945
|
+
}
|
|
2946
|
+
} else if (treeSelectDocData.value?.id) {
|
|
2947
|
+
if (!searchVal.value) {
|
|
2948
|
+
id = treeSelectDocData.value?.refId;
|
|
2949
|
+
showType = "TMPL";
|
|
2950
|
+
officeType = treeSelectDocData.value?.officeType;
|
|
2951
|
+
modelKey = treeSelectDocData.value?.modelKey;
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
break;
|
|
2955
|
+
case "3":
|
|
2956
|
+
id = selectAppendixInfo.value?.id;
|
|
2957
|
+
showType = "INST";
|
|
2958
|
+
officeType = selectAppendixInfo.value?.officeType;
|
|
2959
|
+
modelKey = selectAppendixInfo.value?.modelKey;
|
|
2960
|
+
break;
|
|
2961
|
+
case "4":
|
|
2962
|
+
id = selectTransactionInfo.value?.id;
|
|
2963
|
+
showType = "INST";
|
|
2964
|
+
officeType = selectTransactionInfo.value?.officeType;
|
|
2965
|
+
modelKey = selectTransactionInfo.value?.modelKey;
|
|
2966
|
+
break;
|
|
2967
|
+
case "5":
|
|
2968
|
+
id = selectReworkInfo.value?.id;
|
|
2969
|
+
showType = "INST";
|
|
2970
|
+
officeType = selectReworkInfo.value?.officeType;
|
|
2971
|
+
modelKey = selectReworkInfo.value?.modelKey;
|
|
2972
|
+
break;
|
|
2973
|
+
case "6":
|
|
2974
|
+
id = selectLinkInfo.value?.id;
|
|
2975
|
+
showType = "INST";
|
|
2976
|
+
officeType = selectLinkInfo.value?.officeType;
|
|
2977
|
+
modelKey = selectLinkInfo.value?.modelKey;
|
|
2978
|
+
break;
|
|
2979
|
+
default:
|
|
2980
|
+
return void 0;
|
|
2981
|
+
}
|
|
2982
|
+
if (!id) return void 0;
|
|
2983
|
+
return { id, showType, officeType, modelKey };
|
|
2984
|
+
});
|
|
2985
|
+
const isPreviewType = computed(() => {
|
|
2986
|
+
return ["SUMMARIZED", "IN_AUDIT", "ARCHIVED"].includes(
|
|
2987
|
+
edhrInstance.value?.instanceStatus
|
|
2988
|
+
);
|
|
2989
|
+
});
|
|
2990
|
+
const isInAudit = computed(() => "IN_AUDIT" === edhrInstance.value?.instanceStatus);
|
|
2991
|
+
const useIsViewPage = computed(() => {
|
|
2992
|
+
if (tabActiveKey.value === "1" || tabActiveKey.value === "4" || tabActiveKey.value === "5" || tabActiveKey.value === "6") {
|
|
2993
|
+
return true;
|
|
2994
|
+
}
|
|
2995
|
+
if (tabActiveKey.value === "3") {
|
|
2996
|
+
return payload.isViewPage;
|
|
2997
|
+
}
|
|
2998
|
+
if (isPreviewType.value) {
|
|
2999
|
+
return true;
|
|
3000
|
+
}
|
|
3001
|
+
if (payload.viewPageLimit) {
|
|
3002
|
+
return treeSelectDocData.value.id !== props.ofTmplId;
|
|
3003
|
+
}
|
|
3004
|
+
return payload.isViewPage;
|
|
3005
|
+
});
|
|
3006
|
+
const usePermissionActions = computed(() => {
|
|
3007
|
+
const archived2EdhrInstance = isPreviewType.value;
|
|
3008
|
+
const baseActions = {
|
|
3009
|
+
archived2EdhrInstance,
|
|
3010
|
+
//edhr实例是否已经归档
|
|
3011
|
+
EDHRRelate: false,
|
|
3012
|
+
// 关联EDHR按钮权限控制
|
|
3013
|
+
DocumentRelate: false,
|
|
3014
|
+
// 关联表单按钮权限控制
|
|
3015
|
+
Annotate: false,
|
|
3016
|
+
// 变更记录按钮权限控制
|
|
3017
|
+
Cancel: false,
|
|
3018
|
+
// 表单作废 重新提交按钮权限控制
|
|
3019
|
+
Update: false,
|
|
3020
|
+
// 表单变更按钮权限控制
|
|
3021
|
+
defaultShowCatalogue: payload.pageType !== "production-execution",
|
|
3022
|
+
// 生产执行模式(待填报的表单)需要默认隐藏目录, 其他场景需要默认显示
|
|
3023
|
+
showOtherMenu: !isInAudit.value
|
|
3024
|
+
// DHR 是审核中的状态,那么只需要目录和放行单 其他情况需要展示 目录、放行单、附录、事务、返工
|
|
3025
|
+
};
|
|
3026
|
+
if (archived2EdhrInstance) {
|
|
3027
|
+
return baseActions;
|
|
3028
|
+
}
|
|
3029
|
+
switch (payload.pageType) {
|
|
3030
|
+
case "edhr-filling":
|
|
3031
|
+
return {
|
|
3032
|
+
...baseActions,
|
|
3033
|
+
EDHRRelate: false,
|
|
3034
|
+
DocumentRelate: false
|
|
3035
|
+
};
|
|
3036
|
+
case "record-change":
|
|
3037
|
+
return {
|
|
3038
|
+
...baseActions,
|
|
3039
|
+
Annotate: true,
|
|
3040
|
+
Cancel: true,
|
|
3041
|
+
Update: true
|
|
3042
|
+
};
|
|
3043
|
+
case "hide-create-instances":
|
|
3044
|
+
return {
|
|
3045
|
+
...baseActions,
|
|
3046
|
+
archived2EdhrInstance: true
|
|
3047
|
+
// 通过控制edhr实例归档来隐藏新建实例按钮及隐藏编辑实例备注按钮
|
|
3048
|
+
};
|
|
3049
|
+
default:
|
|
3050
|
+
return {
|
|
3051
|
+
...baseActions,
|
|
3052
|
+
archived2EdhrInstance: useIsViewPage.value
|
|
3053
|
+
// 如果是查看模式,通过控制edhr实例归档来隐藏新建实例按钮及隐藏编辑实例备注按钮
|
|
3054
|
+
};
|
|
3055
|
+
}
|
|
3056
|
+
});
|
|
3057
|
+
function clear() {
|
|
3058
|
+
searchVal.value = void 0;
|
|
3059
|
+
treeData.value = [];
|
|
3060
|
+
edhrInstance.value = {};
|
|
3061
|
+
docInstanceList.value = [];
|
|
3062
|
+
treeSelectDocData.value = void 0;
|
|
3063
|
+
selectSelfInfo.value = void 0;
|
|
3064
|
+
releaseList.value = [];
|
|
3065
|
+
appendixList.value = [];
|
|
3066
|
+
transactionList.value = [];
|
|
3067
|
+
reworkList.value = [];
|
|
3068
|
+
linkList.value = [];
|
|
3069
|
+
selectReleaseInfo.value = void 0;
|
|
3070
|
+
selectAppendixInfo.value = void 0;
|
|
3071
|
+
selectTransactionInfo.value = void 0;
|
|
3072
|
+
selectReworkInfo.value = void 0;
|
|
3073
|
+
selectLinkInfo.value = void 0;
|
|
3074
|
+
tabActiveKey.value = void 0;
|
|
3075
|
+
}
|
|
3076
|
+
function updateEdhrCounter() {
|
|
3077
|
+
edhrCounter.value++;
|
|
3078
|
+
}
|
|
3079
|
+
function updateInstanceCounter() {
|
|
3080
|
+
instanceCounter.value++;
|
|
3081
|
+
}
|
|
3082
|
+
function updateEdhrIconStatusCounter() {
|
|
3083
|
+
edhrIconStatusCounter.value++;
|
|
3084
|
+
}
|
|
3085
|
+
function updateAppendixCounter() {
|
|
3086
|
+
appendixCounter.value++;
|
|
3087
|
+
}
|
|
3088
|
+
return {
|
|
3089
|
+
loading,
|
|
3090
|
+
hasData,
|
|
3091
|
+
treeData,
|
|
3092
|
+
edhrInstance,
|
|
3093
|
+
docInstanceList,
|
|
3094
|
+
treeSelectDocData,
|
|
3095
|
+
selectSelfInfo,
|
|
3096
|
+
searchVal,
|
|
3097
|
+
releaseList,
|
|
3098
|
+
appendixList,
|
|
3099
|
+
transactionList,
|
|
3100
|
+
reworkList,
|
|
3101
|
+
linkList,
|
|
3102
|
+
selectReleaseInfo,
|
|
3103
|
+
selectAppendixInfo,
|
|
3104
|
+
selectTransactionInfo,
|
|
3105
|
+
selectReworkInfo,
|
|
3106
|
+
selectLinkInfo,
|
|
3107
|
+
tabActiveKey,
|
|
3108
|
+
selectInstanceInfo,
|
|
3109
|
+
useIsViewPage,
|
|
3110
|
+
usePermissionActions,
|
|
3111
|
+
updateEdhrCounter,
|
|
3112
|
+
/** 刷新实例列表信息 */
|
|
3113
|
+
updateInstanceCounter,
|
|
3114
|
+
updateEdhrIconStatusCounter,
|
|
3115
|
+
updateAppendixCounter
|
|
3116
|
+
};
|
|
3117
|
+
}
|
|
3118
|
+
function useMaterialStocktake() {
|
|
3119
|
+
async function getStockDataByWarehouse({ cloneRuntimeJson, warehouseId, locationId }) {
|
|
3120
|
+
const stocktakeTables = cloneRuntimeJson?.paper?.props?.materialStocktakeList;
|
|
3121
|
+
if (!stocktakeTables?.length || !warehouseId) return {};
|
|
3122
|
+
const res = await api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey(
|
|
3123
|
+
{
|
|
3124
|
+
modelCategory: "entity",
|
|
3125
|
+
bsKey: "listAll",
|
|
3126
|
+
modelKey: "em_inventory"
|
|
3127
|
+
},
|
|
3128
|
+
{
|
|
3129
|
+
query: {
|
|
3130
|
+
"warehouse_id_.eq": warehouseId,
|
|
3131
|
+
"location_id_.eq": locationId
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
);
|
|
3135
|
+
return stocktakeTables.reduce((obj, e2) => {
|
|
3136
|
+
obj[e2.masterSubField] = res?.data;
|
|
3137
|
+
return obj;
|
|
3138
|
+
}, {});
|
|
3139
|
+
}
|
|
3140
|
+
async function openScanModal() {
|
|
3141
|
+
console.log("materialStocktake openScanModal");
|
|
3142
|
+
}
|
|
3143
|
+
return {
|
|
3144
|
+
getStockDataByWarehouse,
|
|
3145
|
+
openScanModal
|
|
3146
|
+
};
|
|
3147
|
+
}
|
|
3148
|
+
const _hoisted_1$2 = { class: "ebr-wiki-edhr-builder-wrapper" };
|
|
3149
|
+
const _hoisted_2$2 = {
|
|
3150
|
+
key: 0,
|
|
3151
|
+
class: "nocode-common-loading-warp"
|
|
3152
|
+
};
|
|
3153
|
+
const _hoisted_3$2 = {
|
|
3154
|
+
key: 1,
|
|
3155
|
+
class: "ebr-wiki-edhr-builder-container"
|
|
3156
|
+
};
|
|
3157
|
+
const _hoisted_4$2 = { class: "ebr-wiki-edhr-builder-right" };
|
|
3158
|
+
const _hoisted_5$2 = { class: "ebr-wiki-edhr-builder-right__content" };
|
|
3159
|
+
const _hoisted_6$2 = {
|
|
3160
|
+
key: 0,
|
|
3161
|
+
class: "nocode-common-loading-warp ebr-wiki-right-loading"
|
|
3162
|
+
};
|
|
3163
|
+
const _hoisted_7$2 = {
|
|
3164
|
+
key: 2,
|
|
3165
|
+
class: "nocode-common-loading-warp"
|
|
3166
|
+
};
|
|
3167
|
+
const _hoisted_8$2 = { class: "w200px text-center color-[#666]" };
|
|
3168
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3169
|
+
__name: "ebr-wiki-layout",
|
|
3170
|
+
props: {
|
|
3171
|
+
loading: { type: Boolean },
|
|
3172
|
+
hasData: { type: Boolean },
|
|
3173
|
+
rightLoading: { type: Boolean, default: false },
|
|
3174
|
+
leftLoading: { type: Boolean, default: false },
|
|
3175
|
+
showFullScreen: { type: Boolean }
|
|
3176
|
+
},
|
|
3177
|
+
setup(__props) {
|
|
3178
|
+
const isFullScreen = ref(false);
|
|
3179
|
+
function changeIsFullScreen() {
|
|
3180
|
+
isFullScreen.value = !isFullScreen.value;
|
|
3181
|
+
}
|
|
3182
|
+
return (_ctx, _cache) => {
|
|
3183
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
3184
|
+
__props.loading ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
3185
|
+
createVNode(DocumentLoading)
|
|
3186
|
+
])) : __props.hasData || __props.rightLoading || __props.leftLoading ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
|
|
3187
|
+
renderSlot(_ctx.$slots, "ebr-left", {}, void 0, true),
|
|
3188
|
+
createElementVNode("div", {
|
|
3189
|
+
class: normalizeClass(["ebr-wiki-edhr-builder-content", { isFullScreen: isFullScreen.value }])
|
|
3190
|
+
}, [
|
|
3191
|
+
__props.showFullScreen ? (openBlock(), createElementBlock("div", {
|
|
3192
|
+
key: 0,
|
|
3193
|
+
class: "ebr-container-full-screen",
|
|
3194
|
+
onClick: changeIsFullScreen
|
|
3195
|
+
}, [
|
|
3196
|
+
createElementVNode("i", {
|
|
3197
|
+
class: normalizeClass(["iconfont", isFullScreen.value ? "icon-tuichuquanping" : "icon-quanping"])
|
|
3198
|
+
}, null, 2)
|
|
3199
|
+
])) : createCommentVNode("", true),
|
|
3200
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
3201
|
+
withDirectives(createElementVNode("div", _hoisted_5$2, [
|
|
3202
|
+
renderSlot(_ctx.$slots, "ebr-right", {}, void 0, true)
|
|
3203
|
+
], 512), [
|
|
3204
|
+
[vShow, !__props.rightLoading]
|
|
3205
|
+
]),
|
|
3206
|
+
__props.rightLoading ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
|
|
3207
|
+
createVNode(DocumentLoading)
|
|
3208
|
+
])) : createCommentVNode("", true)
|
|
3209
|
+
])
|
|
3210
|
+
], 2),
|
|
3211
|
+
renderSlot(_ctx.$slots, "ebr-action", {}, void 0, true)
|
|
3212
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
|
|
3213
|
+
createElementVNode("div", _hoisted_8$2, [
|
|
3214
|
+
_cache[0] || (_cache[0] = createElementVNode("img", {
|
|
3215
|
+
class: "w100% h100%",
|
|
3216
|
+
src: _imports_0,
|
|
3217
|
+
alt: ""
|
|
3218
|
+
}, null, -1)),
|
|
3219
|
+
createElementVNode("span", null, toDisplayString(_ctx.$t("sys.noData")), 1)
|
|
3220
|
+
])
|
|
3221
|
+
]))
|
|
3222
|
+
]);
|
|
3223
|
+
};
|
|
3224
|
+
}
|
|
3225
|
+
});
|
|
3226
|
+
const ebrWikiLayout = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-df9f2da6"]]);
|
|
3227
|
+
const _hoisted_1$1 = { class: "edhr-new-wiki-tree-wrapper" };
|
|
3228
|
+
const _hoisted_2$1 = { class: "edhr-new-wiki-tree-menu" };
|
|
3229
|
+
const _hoisted_3$1 = ["title"];
|
|
3230
|
+
const _hoisted_4$1 = {
|
|
3231
|
+
key: 0,
|
|
3232
|
+
class: "doc-icon"
|
|
3233
|
+
};
|
|
3234
|
+
const _hoisted_5$1 = { class: "appendix-list" };
|
|
3235
|
+
const _hoisted_6$1 = ["onClick"];
|
|
3236
|
+
const _hoisted_7$1 = { class: "appendix-item__title" };
|
|
3237
|
+
const _hoisted_8$1 = { class: "appendix-list" };
|
|
3238
|
+
const _hoisted_9$1 = ["onClick"];
|
|
3239
|
+
const _hoisted_10$1 = { class: "appendix-item__title" };
|
|
3240
|
+
const _hoisted_11$1 = { class: "ebr-new-wiki-print-btn" };
|
|
3241
|
+
const _hoisted_12$1 = { class: "header-title" };
|
|
3242
|
+
const _hoisted_13 = { class: "instance-content" };
|
|
3243
|
+
const _hoisted_14 = ["onClick"];
|
|
3244
|
+
const _hoisted_15 = { class: "title" };
|
|
3245
|
+
const _hoisted_16 = { class: "status" };
|
|
3246
|
+
const _hoisted_17 = ["onClick"];
|
|
3247
|
+
const f_key = "id";
|
|
3248
|
+
const f_title = "name";
|
|
3249
|
+
const f_children = "children";
|
|
3250
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3251
|
+
__name: "edhr-new-wiki-tree",
|
|
3252
|
+
props: {
|
|
3253
|
+
wikiTreeData: {},
|
|
3254
|
+
appendixList: {},
|
|
3255
|
+
docList: {},
|
|
3256
|
+
docInstanceList: {},
|
|
3257
|
+
treeSelectDocData: {},
|
|
3258
|
+
selectSelfInfo: {},
|
|
3259
|
+
hideInstanceArea: { type: Boolean }
|
|
3260
|
+
},
|
|
3261
|
+
emits: ["update:treeSelectDocData", "update:selectSelfInfo", "selectDoc"],
|
|
3262
|
+
setup(__props, { emit: __emit }) {
|
|
3263
|
+
const treeSettings = {
|
|
3264
|
+
children: f_children,
|
|
3265
|
+
title: f_title,
|
|
3266
|
+
key: f_key
|
|
3267
|
+
};
|
|
3268
|
+
const props = __props;
|
|
3269
|
+
const emit = __emit;
|
|
3270
|
+
const treeVisible = ref(true);
|
|
3271
|
+
const collapseActiveKey = ref(["1"]);
|
|
3272
|
+
const activeKey = ref("1");
|
|
3273
|
+
const isShowInstanceArea = computed(() => {
|
|
3274
|
+
return !props?.hideInstanceArea && [FormTypeEnum.BASE, FormTypeEnum.PROCESS, FormTypeEnum.FILE].includes(
|
|
3275
|
+
props.selectSelfInfo?.formType
|
|
3276
|
+
);
|
|
3277
|
+
});
|
|
3278
|
+
const computedDocInstancesList = computed(() => {
|
|
3279
|
+
return props.docInstanceList?.filter((item) => item.formType) ?? [];
|
|
3280
|
+
});
|
|
3281
|
+
const computedAppendixList = computed(() => {
|
|
3282
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3283
|
+
return props.appendixList?.filter((item) => item.formType)?.filter((item) => {
|
|
3284
|
+
const key = item.tmplId;
|
|
3285
|
+
if (seen.has(key)) return false;
|
|
3286
|
+
seen.add(key);
|
|
3287
|
+
return true;
|
|
3288
|
+
}) ?? [];
|
|
3289
|
+
});
|
|
3290
|
+
const handleTreeToggle = async () => {
|
|
3291
|
+
await nextTick();
|
|
3292
|
+
setTimeout(() => {
|
|
3293
|
+
treeVisible.value = !treeVisible.value;
|
|
3294
|
+
}, 1);
|
|
3295
|
+
};
|
|
3296
|
+
function onSelect(_2, e2) {
|
|
3297
|
+
const { dataRef } = e2.node || {};
|
|
3298
|
+
if (props.treeSelectDocData && props.treeSelectDocData.id === dataRef.id) {
|
|
3299
|
+
return;
|
|
3300
|
+
}
|
|
3301
|
+
emit("update:treeSelectDocData", dataRef);
|
|
3302
|
+
emit("update:selectSelfInfo", null);
|
|
3303
|
+
}
|
|
3304
|
+
function onSelectAppendix(dataRef) {
|
|
3305
|
+
if (props.treeSelectDocData && props.treeSelectDocData.id === dataRef.id) {
|
|
3306
|
+
return;
|
|
3307
|
+
}
|
|
3308
|
+
emit("update:treeSelectDocData", dataRef);
|
|
3309
|
+
emit("update:selectSelfInfo", null);
|
|
3310
|
+
}
|
|
3311
|
+
function onSelectDoc(data) {
|
|
3312
|
+
emit("selectDoc", data);
|
|
3313
|
+
}
|
|
3314
|
+
function onSelectInstanceItem(data) {
|
|
3315
|
+
if (props.selectSelfInfo?.id === data.id) {
|
|
3316
|
+
return;
|
|
3317
|
+
}
|
|
3318
|
+
emit("update:selectSelfInfo", data);
|
|
3319
|
+
}
|
|
3320
|
+
return (_ctx, _cache) => {
|
|
3321
|
+
const _component_a_tree = resolveComponent("a-tree");
|
|
3322
|
+
const _component_a_tab_pane = resolveComponent("a-tab-pane");
|
|
3323
|
+
const _component_a_empty = resolveComponent("a-empty");
|
|
3324
|
+
const _component_a_tabs = resolveComponent("a-tabs");
|
|
3325
|
+
const _component_UpOutlined = resolveComponent("UpOutlined");
|
|
3326
|
+
const _component_CaretRightOutlined = resolveComponent("CaretRightOutlined");
|
|
3327
|
+
const _component_a_descriptions_item = resolveComponent("a-descriptions-item");
|
|
3328
|
+
const _component_a_descriptions = resolveComponent("a-descriptions");
|
|
3329
|
+
const _component_a_collapse_panel = resolveComponent("a-collapse-panel");
|
|
3330
|
+
const _component_a_collapse = resolveComponent("a-collapse");
|
|
3331
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
3332
|
+
createElementVNode("div", {
|
|
3333
|
+
class: normalizeClass(["edhr-new-wiki-tree-container", {
|
|
3334
|
+
"edhr-new-wiki-tree--hidden": !treeVisible.value
|
|
3335
|
+
}])
|
|
3336
|
+
}, [
|
|
3337
|
+
createElementVNode("div", {
|
|
3338
|
+
class: "edhr-new-wiki-tree-toggle",
|
|
3339
|
+
onClick: handleTreeToggle
|
|
3340
|
+
}, [..._cache[2] || (_cache[2] = [
|
|
3341
|
+
createElementVNode("i", { class: "iconfont icon-a-Leftarrow" }, null, -1)
|
|
3342
|
+
])]),
|
|
3343
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
3344
|
+
createVNode(_component_a_tabs, {
|
|
3345
|
+
activeKey: activeKey.value,
|
|
3346
|
+
"onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event),
|
|
3347
|
+
centered: ""
|
|
3348
|
+
}, {
|
|
3349
|
+
default: withCtx(() => [
|
|
3350
|
+
createVNode(_component_a_tab_pane, {
|
|
3351
|
+
key: "1",
|
|
3352
|
+
tab: _ctx.$t("sys.edhr.ebr.category.catalogue")
|
|
3353
|
+
}, {
|
|
3354
|
+
default: withCtx(() => [
|
|
3355
|
+
createVNode(unref(Scrollbar), { class: "px-4px pb-8px" }, {
|
|
3356
|
+
default: withCtx(() => [
|
|
3357
|
+
createVNode(_component_a_tree, {
|
|
3358
|
+
class: "tree-instance",
|
|
3359
|
+
"auto-expand-parent": "",
|
|
3360
|
+
"default-expand-all": "",
|
|
3361
|
+
"block-node": "",
|
|
3362
|
+
showIcon: "",
|
|
3363
|
+
fieldNames: treeSettings,
|
|
3364
|
+
"tree-data": __props.wikiTreeData,
|
|
3365
|
+
selectedKeys: [__props.treeSelectDocData.id],
|
|
3366
|
+
onSelect
|
|
3367
|
+
}, {
|
|
3368
|
+
title: withCtx(({ data }) => [
|
|
3369
|
+
createElementVNode("div", {
|
|
3370
|
+
class: normalizeClass(["tree-node", data.type === "DOC" && "type-doc"])
|
|
3371
|
+
}, [
|
|
3372
|
+
createElementVNode("span", {
|
|
3373
|
+
class: "tree-node__title",
|
|
3374
|
+
title: data[f_title]
|
|
3375
|
+
}, toDisplayString(data[f_title]), 9, _hoisted_3$1)
|
|
3376
|
+
], 2)
|
|
3377
|
+
]),
|
|
3378
|
+
icon: withCtx(({ data }) => [
|
|
3379
|
+
data.type === "DOC" ? (openBlock(), createElementBlock("i", _hoisted_4$1)) : createCommentVNode("", true)
|
|
3380
|
+
]),
|
|
3381
|
+
_: 1
|
|
3382
|
+
}, 8, ["tree-data", "selectedKeys"])
|
|
3383
|
+
]),
|
|
3384
|
+
_: 1
|
|
3385
|
+
})
|
|
3386
|
+
]),
|
|
3387
|
+
_: 1
|
|
3388
|
+
}, 8, ["tab"]),
|
|
3389
|
+
createVNode(_component_a_tab_pane, {
|
|
3390
|
+
key: "2",
|
|
3391
|
+
tab: _ctx.$t("sys.edhr.ebr.subModule.appendix")
|
|
3392
|
+
}, {
|
|
3393
|
+
default: withCtx(() => [
|
|
3394
|
+
computedAppendixList.value?.length ? (openBlock(), createBlock(unref(Scrollbar), {
|
|
3395
|
+
key: 0,
|
|
3396
|
+
class: "px-4px pb-8px"
|
|
3397
|
+
}, {
|
|
3398
|
+
default: withCtx(() => [
|
|
3399
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
3400
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(computedAppendixList.value, (item) => {
|
|
3401
|
+
return openBlock(), createElementBlock("div", {
|
|
3402
|
+
class: normalizeClass(["appendix-item", __props.treeSelectDocData.id === item.id && "appendix-item--selected"]),
|
|
3403
|
+
key: item.id,
|
|
3404
|
+
onClick: ($event) => onSelectAppendix(item)
|
|
3405
|
+
}, [
|
|
3406
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(item.tmplName), 1)
|
|
3407
|
+
], 10, _hoisted_6$1);
|
|
3408
|
+
}), 128))
|
|
3409
|
+
])
|
|
3410
|
+
]),
|
|
3411
|
+
_: 1
|
|
3412
|
+
})) : (openBlock(), createBlock(_component_a_empty, {
|
|
3413
|
+
key: 1,
|
|
3414
|
+
image: unref(Empty).PRESENTED_IMAGE_SIMPLE
|
|
3415
|
+
}, null, 8, ["image"]))
|
|
3416
|
+
]),
|
|
3417
|
+
_: 1
|
|
3418
|
+
}, 8, ["tab"]),
|
|
3419
|
+
createVNode(_component_a_tab_pane, {
|
|
3420
|
+
key: "3",
|
|
3421
|
+
tab: _ctx.$t("sys.file")
|
|
3422
|
+
}, {
|
|
3423
|
+
default: withCtx(() => [
|
|
3424
|
+
__props.docList?.length ? (openBlock(), createBlock(unref(Scrollbar), {
|
|
3425
|
+
key: 0,
|
|
3426
|
+
class: "px-4px pb-8px"
|
|
3427
|
+
}, {
|
|
3428
|
+
default: withCtx(() => [
|
|
3429
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
3430
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.docList, (item) => {
|
|
3431
|
+
return openBlock(), createElementBlock("div", {
|
|
3432
|
+
class: "appendix-item",
|
|
3433
|
+
key: item.id_,
|
|
3434
|
+
onClick: ($event) => onSelectDoc(item)
|
|
3435
|
+
}, [
|
|
3436
|
+
createElementVNode("div", _hoisted_10$1, toDisplayString(item.name_), 1)
|
|
3437
|
+
], 8, _hoisted_9$1);
|
|
3438
|
+
}), 128))
|
|
3439
|
+
])
|
|
3440
|
+
]),
|
|
3441
|
+
_: 1
|
|
3442
|
+
})) : (openBlock(), createBlock(_component_a_empty, {
|
|
3443
|
+
key: 1,
|
|
3444
|
+
image: unref(Empty).PRESENTED_IMAGE_SIMPLE
|
|
3445
|
+
}, null, 8, ["image"]))
|
|
3446
|
+
]),
|
|
3447
|
+
_: 1
|
|
3448
|
+
}, 8, ["tab"])
|
|
3449
|
+
]),
|
|
3450
|
+
_: 1
|
|
3451
|
+
}, 8, ["activeKey"])
|
|
3452
|
+
]),
|
|
3453
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
3454
|
+
renderSlot(_ctx.$slots, "print", {}, void 0, true)
|
|
3455
|
+
]),
|
|
3456
|
+
isShowInstanceArea.value && computedDocInstancesList.value?.length ? (openBlock(), createBlock(_component_a_collapse, {
|
|
3457
|
+
key: 0,
|
|
3458
|
+
class: "edhr-new-wiki-instance-collapse",
|
|
3459
|
+
activeKey: collapseActiveKey.value,
|
|
3460
|
+
"onUpdate:activeKey": _cache[1] || (_cache[1] = ($event) => collapseActiveKey.value = $event),
|
|
3461
|
+
bordered: false,
|
|
3462
|
+
expandIconPosition: "right",
|
|
3463
|
+
ghost: ""
|
|
3464
|
+
}, {
|
|
3465
|
+
expandIcon: withCtx(({ isActive }) => [
|
|
3466
|
+
createVNode(_component_UpOutlined, {
|
|
3467
|
+
rotate: isActive ? 180 : 0
|
|
3468
|
+
}, null, 8, ["rotate"])
|
|
3469
|
+
]),
|
|
3470
|
+
default: withCtx(() => [
|
|
3471
|
+
createVNode(_component_a_collapse_panel, { key: "1" }, {
|
|
3472
|
+
header: withCtx(() => [
|
|
3473
|
+
createElementVNode("div", _hoisted_12$1, toDisplayString(_ctx.$t("sys.edhr.formInstRecords")), 1)
|
|
3474
|
+
]),
|
|
3475
|
+
default: withCtx(() => [
|
|
3476
|
+
createElementVNode("div", _hoisted_13, [
|
|
3477
|
+
createVNode(unref(Scrollbar), { class: "px-4px py-4px" }, {
|
|
3478
|
+
default: withCtx(() => [
|
|
3479
|
+
createVNode(_component_a_collapse, {
|
|
3480
|
+
bordered: false,
|
|
3481
|
+
ghost: "",
|
|
3482
|
+
class: "edhr-new-wiki-instance-collapse-inner"
|
|
3483
|
+
}, {
|
|
3484
|
+
expandIcon: withCtx(({ isActive }) => [
|
|
3485
|
+
createVNode(_component_CaretRightOutlined, {
|
|
3486
|
+
rotate: isActive ? 90 : 0
|
|
3487
|
+
}, null, 8, ["rotate"])
|
|
3488
|
+
]),
|
|
3489
|
+
default: withCtx(() => [
|
|
3490
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(computedDocInstancesList.value, (item, index) => {
|
|
3491
|
+
return openBlock(), createBlock(_component_a_collapse_panel, {
|
|
3492
|
+
key: item.id,
|
|
3493
|
+
class: normalizeClass({
|
|
3494
|
+
"edhr-new-wiki-instance-item--selected": __props.selectSelfInfo?.id === item.id
|
|
3495
|
+
})
|
|
3496
|
+
}, {
|
|
3497
|
+
header: withCtx(() => [
|
|
3498
|
+
createElementVNode("div", {
|
|
3499
|
+
class: "header-title-content",
|
|
3500
|
+
onClick: withModifiers(($event) => onSelectInstanceItem(item), ["stop"])
|
|
3501
|
+
}, [
|
|
3502
|
+
createElementVNode("span", _hoisted_15, toDisplayString(`#${(computedDocInstancesList.value.length ?? 0) - index}
|
|
3503
|
+
【${item.ext2 ?? item.tmplName}】
|
|
3504
|
+
${index === 0 ? "(" + _ctx.$t("sys.edhr.latest") + ")" : ""}`), 1),
|
|
3505
|
+
createElementVNode("div", _hoisted_16, [
|
|
3506
|
+
renderSlot(_ctx.$slots, "status", { item }, void 0, true)
|
|
3507
|
+
])
|
|
3508
|
+
], 8, _hoisted_14)
|
|
3509
|
+
]),
|
|
3510
|
+
default: withCtx(() => [
|
|
3511
|
+
createElementVNode("div", {
|
|
3512
|
+
class: "content",
|
|
3513
|
+
onClick: withModifiers(($event) => onSelectInstanceItem(item), ["stop"])
|
|
3514
|
+
}, [
|
|
3515
|
+
createVNode(_component_a_descriptions, {
|
|
3516
|
+
column: 1,
|
|
3517
|
+
colon: true,
|
|
3518
|
+
labelStyle: { color: "#666", fontSize: "12px" },
|
|
3519
|
+
contentStyle: { color: "#252525", fontSize: "12px" }
|
|
3520
|
+
}, {
|
|
3521
|
+
default: withCtx(() => [
|
|
3522
|
+
createVNode(_component_a_descriptions_item, {
|
|
3523
|
+
label: _ctx.$t("sys.createTime")
|
|
3524
|
+
}, {
|
|
3525
|
+
default: withCtx(() => [
|
|
3526
|
+
createTextVNode(toDisplayString(item.createTime), 1)
|
|
3527
|
+
]),
|
|
3528
|
+
_: 2
|
|
3529
|
+
}, 1032, ["label"]),
|
|
3530
|
+
createVNode(_component_a_descriptions_item, {
|
|
3531
|
+
label: _ctx.$t("sys.updateTime")
|
|
3532
|
+
}, {
|
|
3533
|
+
default: withCtx(() => [
|
|
3534
|
+
createTextVNode(toDisplayString(item.modifyTime), 1)
|
|
3535
|
+
]),
|
|
3536
|
+
_: 2
|
|
3537
|
+
}, 1032, ["label"]),
|
|
3538
|
+
createVNode(_component_a_descriptions_item, {
|
|
3539
|
+
label: _ctx.$t("sys.updatePerson")
|
|
3540
|
+
}, {
|
|
3541
|
+
default: withCtx(() => [
|
|
3542
|
+
createTextVNode(toDisplayString(item.modifyUserName), 1)
|
|
3543
|
+
]),
|
|
3544
|
+
_: 2
|
|
3545
|
+
}, 1032, ["label"])
|
|
3546
|
+
]),
|
|
3547
|
+
_: 2
|
|
3548
|
+
}, 1024)
|
|
3549
|
+
], 8, _hoisted_17)
|
|
3550
|
+
]),
|
|
3551
|
+
_: 2
|
|
3552
|
+
}, 1032, ["class"]);
|
|
3553
|
+
}), 128))
|
|
3554
|
+
]),
|
|
3555
|
+
_: 3
|
|
3556
|
+
})
|
|
3557
|
+
]),
|
|
3558
|
+
_: 3
|
|
3559
|
+
})
|
|
3560
|
+
])
|
|
3561
|
+
]),
|
|
3562
|
+
_: 3
|
|
3563
|
+
})
|
|
3564
|
+
]),
|
|
3565
|
+
_: 3
|
|
3566
|
+
}, 8, ["activeKey"])) : createCommentVNode("", true)
|
|
3567
|
+
], 2)
|
|
3568
|
+
]);
|
|
3569
|
+
};
|
|
3570
|
+
}
|
|
3571
|
+
});
|
|
3572
|
+
const edhrNewWikiTree = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-3754577e"]]);
|
|
3573
|
+
const _hoisted_1 = { class: "error-group-panel-wrapper" };
|
|
3574
|
+
const _hoisted_2 = { class: "header-title-content" };
|
|
3575
|
+
const _hoisted_3 = { class: "title-area" };
|
|
3576
|
+
const _hoisted_4 = { class: "title" };
|
|
3577
|
+
const _hoisted_5 = { class: "tooltip-content" };
|
|
3578
|
+
const _hoisted_6 = { class: "content" };
|
|
3579
|
+
const _hoisted_7 = { class: "title" };
|
|
3580
|
+
const _hoisted_8 = { class: "tooltip-content" };
|
|
3581
|
+
const _hoisted_9 = { class: "message-title" };
|
|
3582
|
+
const _hoisted_10 = { class: "title" };
|
|
3583
|
+
const _hoisted_11 = { class: "tooltip-content" };
|
|
3584
|
+
const _hoisted_12 = { class: "message-title" };
|
|
3585
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3586
|
+
__name: "error-group-panel",
|
|
3587
|
+
props: {
|
|
3588
|
+
errorMap: {},
|
|
3589
|
+
subTableInfo: {}
|
|
3590
|
+
},
|
|
3591
|
+
setup(__props) {
|
|
3592
|
+
const statusMap = {
|
|
3593
|
+
[MobileFillTypeEnum.MAIN_FIELD]: {
|
|
3594
|
+
textColor: "#309C41",
|
|
3595
|
+
background: "rgba(48,156,65,0.2)",
|
|
3596
|
+
placeholder: $t("sys.component.fieldTransfer.subMainModel")
|
|
3597
|
+
},
|
|
3598
|
+
[MobileFillTypeEnum.SUB_TABLE]: {
|
|
3599
|
+
textColor: "#742fb2",
|
|
3600
|
+
background: "rgba(116, 47, 178, 0.2)",
|
|
3601
|
+
placeholder: $t("sys.onlineForm.subTableType.DEFAULT")
|
|
3602
|
+
},
|
|
3603
|
+
[MobileFillTypeEnum.FIXED_TABLE]: {
|
|
3604
|
+
textColor: "#845832",
|
|
3605
|
+
background: "rgba(132,88,50, 0.2)",
|
|
3606
|
+
placeholder: $t("sys.onlineForm.subTableType.FIXED")
|
|
3607
|
+
},
|
|
3608
|
+
[MobileFillTypeEnum.SUB_TABLE_2D]: {
|
|
3609
|
+
textColor: "#6D82B0",
|
|
3610
|
+
background: "#E6EEFF",
|
|
3611
|
+
placeholder: $t("sys.onlineForm.subTableType.2D")
|
|
3612
|
+
},
|
|
3613
|
+
[MobileFillTypeEnum.SUB_TABLE_2D_LINK]: {
|
|
3614
|
+
textColor: "#F77E4A",
|
|
3615
|
+
background: "rgba(247,126,74,0.2)",
|
|
3616
|
+
placeholder: $t("sys.onlineForm.subTable2DLink")
|
|
3617
|
+
},
|
|
3618
|
+
[MobileFillTypeEnum.CHECK_TABLE_2D]: {
|
|
3619
|
+
textColor: "#13C2C2",
|
|
3620
|
+
background: "rgba(19,194,194,0.2)",
|
|
3621
|
+
placeholder: $t("sys.onlineForm.subTableType.CHECK")
|
|
3622
|
+
},
|
|
3623
|
+
[MobileFillTypeEnum.CHECK_TABLE_2D_LINK]: {
|
|
3624
|
+
textColor: "#F77E4A",
|
|
3625
|
+
background: "rgba(247,126,74,0.2)",
|
|
3626
|
+
placeholder: $t("sys.onlineForm.checkTable2DLink")
|
|
3627
|
+
},
|
|
3628
|
+
[MobileFillTypeEnum.MATERIAL_CONSUME_TABLE]: {
|
|
3629
|
+
textColor: "#4C8CAA",
|
|
3630
|
+
background: "rgba(76,140,170,0.12)",
|
|
3631
|
+
placeholder: $t("sys.onlineForm.subTableType.MATERIAL_CONSUMPTION")
|
|
3632
|
+
}
|
|
3633
|
+
};
|
|
3634
|
+
const props = __props;
|
|
3635
|
+
const groupedByModelKey = computed(() => {
|
|
3636
|
+
const result = {};
|
|
3637
|
+
const addToSet = (map, key, val) => {
|
|
3638
|
+
if (!map[key]) map[key] = /* @__PURE__ */ new Set();
|
|
3639
|
+
map[key].add(val);
|
|
3640
|
+
};
|
|
3641
|
+
for (const errorList of Object.values(props.errorMap)) {
|
|
3642
|
+
for (const { field, message: messageJson } of errorList) {
|
|
3643
|
+
const { showModelName, showModelKey, showFieldName, subFieldKey, targetFieldId, message } = JSON.parse(messageJson);
|
|
3644
|
+
if (!result[showModelKey]) {
|
|
3645
|
+
const info = props.subTableInfo.find((item) => item.field === subFieldKey);
|
|
3646
|
+
const themeConfig = statusMap[info?.subType ?? MobileFillTypeEnum.MAIN_FIELD];
|
|
3647
|
+
result[showModelKey] = {
|
|
3648
|
+
showModelName,
|
|
3649
|
+
showModelKey,
|
|
3650
|
+
subFieldKey,
|
|
3651
|
+
themeConfig,
|
|
3652
|
+
fields: {}
|
|
3653
|
+
};
|
|
3654
|
+
}
|
|
3655
|
+
const modelGroup = result[showModelKey];
|
|
3656
|
+
if (!modelGroup.fields[targetFieldId]) {
|
|
3657
|
+
modelGroup.fields[targetFieldId] = {
|
|
3658
|
+
showFieldName,
|
|
3659
|
+
targetFieldId,
|
|
3660
|
+
linkFields: targetFieldId === "value_" ? {} : /* @__PURE__ */ new Set(),
|
|
3661
|
+
messages: targetFieldId === "value_" ? {} : /* @__PURE__ */ new Set()
|
|
3662
|
+
};
|
|
3663
|
+
}
|
|
3664
|
+
const fieldGroup = modelGroup.fields[targetFieldId];
|
|
3665
|
+
if (targetFieldId === "value_") {
|
|
3666
|
+
const m = field.match(/^(.*_value_)_(\d+)$/);
|
|
3667
|
+
const groupKey = m ? m[1] : /^.+_\d+_value_$/.test(field) ? field : null;
|
|
3668
|
+
if (!groupKey) continue;
|
|
3669
|
+
addToSet(fieldGroup.linkFields, groupKey, field);
|
|
3670
|
+
addToSet(fieldGroup.messages, groupKey, message);
|
|
3671
|
+
} else {
|
|
3672
|
+
fieldGroup.linkFields.add(field);
|
|
3673
|
+
fieldGroup.messages.add(message);
|
|
3674
|
+
}
|
|
3675
|
+
}
|
|
3676
|
+
}
|
|
3677
|
+
for (const model of Object.values(result)) {
|
|
3678
|
+
for (const field of Object.values(model.fields)) {
|
|
3679
|
+
if (field.targetFieldId === "value_") {
|
|
3680
|
+
for (const key in field.linkFields) {
|
|
3681
|
+
field.linkFields[key] = [...field.linkFields[key]];
|
|
3682
|
+
field.messages[key] = [...field.messages[key]];
|
|
3683
|
+
}
|
|
3684
|
+
} else {
|
|
3685
|
+
field.linkFields = [...field.linkFields];
|
|
3686
|
+
field.messages = [...field.messages];
|
|
3687
|
+
}
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
return result;
|
|
3691
|
+
});
|
|
3692
|
+
const activeKeys = ref(Object.keys(groupedByModelKey.value));
|
|
3693
|
+
useModal(async () => {
|
|
3694
|
+
return {
|
|
3695
|
+
// 修改过后返回ok,外面刷新数据
|
|
3696
|
+
ok: true
|
|
3697
|
+
};
|
|
3698
|
+
});
|
|
3699
|
+
return (_ctx, _cache) => {
|
|
3700
|
+
const _component_CaretRightOutlined = resolveComponent("CaretRightOutlined");
|
|
3701
|
+
const _component_a_descriptions_item = resolveComponent("a-descriptions-item");
|
|
3702
|
+
const _component_a_descriptions = resolveComponent("a-descriptions");
|
|
3703
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
3704
|
+
const _component_a_collapse_panel = resolveComponent("a-collapse-panel");
|
|
3705
|
+
const _component_a_collapse = resolveComponent("a-collapse");
|
|
3706
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
3707
|
+
createVNode(_component_a_collapse, {
|
|
3708
|
+
class: "error-group-panel--collapse",
|
|
3709
|
+
activeKey: activeKeys.value,
|
|
3710
|
+
"onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKeys.value = $event),
|
|
3711
|
+
bordered: false
|
|
3712
|
+
}, {
|
|
3713
|
+
expandIcon: withCtx(({ isActive }) => [
|
|
3714
|
+
createVNode(_component_CaretRightOutlined, {
|
|
3715
|
+
rotate: isActive ? 90 : 0
|
|
3716
|
+
}, null, 8, ["rotate"])
|
|
3717
|
+
]),
|
|
3718
|
+
default: withCtx(() => [
|
|
3719
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(groupedByModelKey.value, (group) => {
|
|
3720
|
+
return openBlock(), createBlock(_component_a_collapse_panel, {
|
|
3721
|
+
key: group.showModelKey
|
|
3722
|
+
}, {
|
|
3723
|
+
header: withCtx(() => [
|
|
3724
|
+
createElementVNode("div", _hoisted_2, [
|
|
3725
|
+
createElementVNode("div", _hoisted_3, [
|
|
3726
|
+
createElementVNode("span", _hoisted_4, toDisplayString(group.showModelName), 1),
|
|
3727
|
+
createVNode(_component_a_tooltip, null, {
|
|
3728
|
+
title: withCtx(() => [
|
|
3729
|
+
createElementVNode("div", _hoisted_5, [
|
|
3730
|
+
createVNode(_component_a_descriptions, {
|
|
3731
|
+
column: 1,
|
|
3732
|
+
colon: true,
|
|
3733
|
+
labelStyle: { color: "#fff", fontSize: "12px" },
|
|
3734
|
+
contentStyle: { color: "#fff", fontSize: "12px" }
|
|
3735
|
+
}, {
|
|
3736
|
+
default: withCtx(() => [
|
|
3737
|
+
createVNode(_component_a_descriptions_item, {
|
|
3738
|
+
label: group.subFieldKey ? _ctx.$t("sys.model.childModelKey") : _ctx.$t("sys.model.modelKey")
|
|
3739
|
+
}, {
|
|
3740
|
+
default: withCtx(() => [
|
|
3741
|
+
createTextVNode(toDisplayString(group.showModelKey), 1)
|
|
3742
|
+
]),
|
|
3743
|
+
_: 2
|
|
3744
|
+
}, 1032, ["label"]),
|
|
3745
|
+
group.subFieldKey ? (openBlock(), createBlock(_component_a_descriptions_item, {
|
|
3746
|
+
key: 0,
|
|
3747
|
+
label: _ctx.$t("sys.model.viewFieldKey")
|
|
3748
|
+
}, {
|
|
3749
|
+
default: withCtx(() => [
|
|
3750
|
+
createTextVNode(toDisplayString(group.subFieldKey), 1)
|
|
3751
|
+
]),
|
|
3752
|
+
_: 2
|
|
3753
|
+
}, 1032, ["label"])) : createCommentVNode("", true)
|
|
3754
|
+
]),
|
|
3755
|
+
_: 2
|
|
3756
|
+
}, 1024)
|
|
3757
|
+
])
|
|
3758
|
+
]),
|
|
3759
|
+
default: withCtx(() => [
|
|
3760
|
+
_cache[1] || (_cache[1] = createElementVNode("i", { class: "iconfont icon-assist" }, null, -1))
|
|
3761
|
+
]),
|
|
3762
|
+
_: 2
|
|
3763
|
+
}, 1024)
|
|
3764
|
+
]),
|
|
3765
|
+
createElementVNode("span", {
|
|
3766
|
+
class: "sub-type-status",
|
|
3767
|
+
style: normalizeStyle({
|
|
3768
|
+
"--nocode-textColor": group.themeConfig?.textColor,
|
|
3769
|
+
"--nocode-bgColor": group.themeConfig?.background
|
|
3770
|
+
})
|
|
3771
|
+
}, toDisplayString(group.themeConfig?.placeholder), 5)
|
|
3772
|
+
])
|
|
3773
|
+
]),
|
|
3774
|
+
default: withCtx(() => [
|
|
3775
|
+
createElementVNode("div", _hoisted_6, [
|
|
3776
|
+
createVNode(_component_a_descriptions, {
|
|
3777
|
+
bordered: "",
|
|
3778
|
+
column: 1,
|
|
3779
|
+
size: "small",
|
|
3780
|
+
labelStyle: { color: "#252525", fontSize: "12px", width: "200px" },
|
|
3781
|
+
contentStyle: { color: "#ff4d4f", fontSize: "12px" }
|
|
3782
|
+
}, {
|
|
3783
|
+
default: withCtx(() => [
|
|
3784
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(group.fields, (field) => {
|
|
3785
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
3786
|
+
key: field.targetFieldId
|
|
3787
|
+
}, [
|
|
3788
|
+
Array.isArray(field.messages) ? (openBlock(), createBlock(_component_a_descriptions_item, { key: 0 }, {
|
|
3789
|
+
label: withCtx(() => [
|
|
3790
|
+
createElementVNode("span", _hoisted_7, toDisplayString(field.showFieldName), 1),
|
|
3791
|
+
createVNode(_component_a_tooltip, null, {
|
|
3792
|
+
title: withCtx(() => [
|
|
3793
|
+
createElementVNode("div", _hoisted_8, [
|
|
3794
|
+
createVNode(_component_a_descriptions, {
|
|
3795
|
+
colon: true,
|
|
3796
|
+
labelStyle: { color: "#fff", fontSize: "12px" },
|
|
3797
|
+
contentStyle: { color: "#fff", fontSize: "12px" }
|
|
3798
|
+
}, {
|
|
3799
|
+
default: withCtx(() => [
|
|
3800
|
+
createVNode(_component_a_descriptions_item, {
|
|
3801
|
+
label: _ctx.$t("sys.model.viewFieldKey")
|
|
3802
|
+
}, {
|
|
3803
|
+
default: withCtx(() => [
|
|
3804
|
+
createTextVNode(toDisplayString(field.targetFieldId), 1)
|
|
3805
|
+
]),
|
|
3806
|
+
_: 2
|
|
3807
|
+
}, 1032, ["label"])
|
|
3808
|
+
]),
|
|
3809
|
+
_: 2
|
|
3810
|
+
}, 1024)
|
|
3811
|
+
])
|
|
3812
|
+
]),
|
|
3813
|
+
default: withCtx(() => [
|
|
3814
|
+
_cache[2] || (_cache[2] = createElementVNode("i", { class: "iconfont icon-assist text-14px! ml-4px" }, null, -1))
|
|
3815
|
+
]),
|
|
3816
|
+
_: 2
|
|
3817
|
+
}, 1024)
|
|
3818
|
+
]),
|
|
3819
|
+
default: withCtx(() => [
|
|
3820
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(field.messages, (message) => {
|
|
3821
|
+
return openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(message), 1);
|
|
3822
|
+
}), 256))
|
|
3823
|
+
]),
|
|
3824
|
+
_: 2
|
|
3825
|
+
}, 1024)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(field.messages, (messages, index) => {
|
|
3826
|
+
return openBlock(), createBlock(_component_a_descriptions_item, null, {
|
|
3827
|
+
label: withCtx(() => [
|
|
3828
|
+
createElementVNode("span", _hoisted_10, toDisplayString(field.showFieldName), 1),
|
|
3829
|
+
createVNode(_component_a_tooltip, null, {
|
|
3830
|
+
title: withCtx(() => [
|
|
3831
|
+
createElementVNode("div", _hoisted_11, [
|
|
3832
|
+
createVNode(_component_a_descriptions, {
|
|
3833
|
+
colon: true,
|
|
3834
|
+
labelStyle: { color: "#fff", fontSize: "12px" },
|
|
3835
|
+
contentStyle: { color: "#fff", fontSize: "12px" }
|
|
3836
|
+
}, {
|
|
3837
|
+
default: withCtx(() => [
|
|
3838
|
+
createVNode(_component_a_descriptions_item, {
|
|
3839
|
+
label: _ctx.$t("sys.model.viewFieldKey")
|
|
3840
|
+
}, {
|
|
3841
|
+
default: withCtx(() => [
|
|
3842
|
+
createTextVNode(toDisplayString(field.targetFieldId), 1)
|
|
3843
|
+
]),
|
|
3844
|
+
_: 2
|
|
3845
|
+
}, 1032, ["label"])
|
|
3846
|
+
]),
|
|
3847
|
+
_: 2
|
|
3848
|
+
}, 1024)
|
|
3849
|
+
])
|
|
3850
|
+
]),
|
|
3851
|
+
default: withCtx(() => [
|
|
3852
|
+
_cache[3] || (_cache[3] = createElementVNode("i", { class: "iconfont icon-assist text-14px! ml-4px" }, null, -1))
|
|
3853
|
+
]),
|
|
3854
|
+
_: 2
|
|
3855
|
+
}, 1024)
|
|
3856
|
+
]),
|
|
3857
|
+
default: withCtx(() => [
|
|
3858
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(messages, (message) => {
|
|
3859
|
+
return openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(message), 1);
|
|
3860
|
+
}), 256))
|
|
3861
|
+
]),
|
|
3862
|
+
_: 2
|
|
3863
|
+
}, 1024);
|
|
3864
|
+
}), 256))
|
|
3865
|
+
], 64);
|
|
3866
|
+
}), 128))
|
|
3867
|
+
]),
|
|
3868
|
+
_: 2
|
|
3869
|
+
}, 1024)
|
|
3870
|
+
])
|
|
3871
|
+
]),
|
|
3872
|
+
_: 2
|
|
3873
|
+
}, 1024);
|
|
3874
|
+
}), 128))
|
|
3875
|
+
]),
|
|
3876
|
+
_: 1
|
|
3877
|
+
}, 8, ["activeKey"])
|
|
3878
|
+
]);
|
|
3879
|
+
};
|
|
3880
|
+
}
|
|
3881
|
+
});
|
|
3882
|
+
const errorGroupPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-570406b0"]]);
|
|
3883
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3884
|
+
__name: "document-quick-fillin",
|
|
3885
|
+
props: {
|
|
3886
|
+
subTableFieldId: {},
|
|
3887
|
+
mobileTdIdGroups: {},
|
|
3888
|
+
widgetCenter: {},
|
|
3889
|
+
handleMenuClick: { type: Function }
|
|
3890
|
+
},
|
|
3891
|
+
setup(__props) {
|
|
3892
|
+
const props = __props;
|
|
3893
|
+
const fieldColumn = computed(() => {
|
|
3894
|
+
const info = getSubTableQuickFillInfo(props.subTableFieldId, props.mobileTdIdGroups);
|
|
3895
|
+
if (!info?.mainWidgetIds?.length) return [];
|
|
3896
|
+
const allowed = /* @__PURE__ */ new Set([
|
|
3897
|
+
FIELD_TYPE.TEXT,
|
|
3898
|
+
FIELD_TYPE.LONG_TEXT,
|
|
3899
|
+
FIELD_TYPE.INTEGER,
|
|
3900
|
+
FIELD_TYPE.LONG,
|
|
3901
|
+
FIELD_TYPE.DOUBLE,
|
|
3902
|
+
FIELD_TYPE.DECIMAL,
|
|
3903
|
+
FIELD_TYPE.DATE,
|
|
3904
|
+
FIELD_TYPE.TIME,
|
|
3905
|
+
FIELD_TYPE.DATE_TIME,
|
|
3906
|
+
FIELD_TYPE.OPTION,
|
|
3907
|
+
FIELD_TYPE.OPTION_MULTI,
|
|
3908
|
+
FIELD_TYPE.MATERIAL_NO,
|
|
3909
|
+
FIELD_TYPE.STERILIZE_LOT,
|
|
3910
|
+
FIELD_TYPE.MATERIAL_LOT,
|
|
3911
|
+
FIELD_TYPE.RELATED_LOT_NO,
|
|
3912
|
+
FIELD_TYPE.SCRAP_MATERIAL_NO
|
|
3913
|
+
]);
|
|
3914
|
+
return info.mainWidgetIds.flatMap((tdId) => {
|
|
3915
|
+
const widget = props.widgetCenter?.[tdId];
|
|
3916
|
+
if (!widget) return [];
|
|
3917
|
+
const { cellWidget, cellValueType } = widget;
|
|
3918
|
+
if (cellValueType !== CellType.Field) return [];
|
|
3919
|
+
if (!cellWidget || cellWidget.component === ComponentTypeEnum.CombineFields) return [];
|
|
3920
|
+
const wProps = cellWidget.props || {};
|
|
3921
|
+
const { isFieldModel, field, fieldType, newSpecificConfig } = wProps;
|
|
3922
|
+
if (isFieldModel) return [];
|
|
3923
|
+
if (!allowed.has(fieldType)) return [];
|
|
3924
|
+
return {
|
|
3925
|
+
fieldType,
|
|
3926
|
+
field,
|
|
3927
|
+
name: newSpecificConfig?.newFieldName,
|
|
3928
|
+
prop: field,
|
|
3929
|
+
newOptions: newSpecificConfig?.newOptions
|
|
3930
|
+
};
|
|
3931
|
+
});
|
|
3932
|
+
});
|
|
3933
|
+
const openQuickFillModal = async () => {
|
|
3934
|
+
const res = await window.NocodeAdapter.utils.overlay.modal(
|
|
3935
|
+
DocumentQuickFillModal,
|
|
3936
|
+
{ columns: fieldColumn.value },
|
|
3937
|
+
{ title: "快速填报", width: "1060px" }
|
|
3938
|
+
);
|
|
3939
|
+
console.log("res", res);
|
|
3940
|
+
if (res.ok && res.params && res.params.data.length) {
|
|
3941
|
+
props.handleMenuClick?.({
|
|
3942
|
+
key: "insertRowAfter",
|
|
3943
|
+
actionValue: {
|
|
3944
|
+
upRowNum: 1,
|
|
3945
|
+
downRowNum: res.params.data.length,
|
|
3946
|
+
data: res.params.data
|
|
3947
|
+
}
|
|
3948
|
+
});
|
|
3949
|
+
}
|
|
3950
|
+
};
|
|
3951
|
+
return (_ctx, _cache) => {
|
|
3952
|
+
return openBlock(), createElementBlock("div", {
|
|
3953
|
+
class: "sub-table-quick-fill-btn",
|
|
3954
|
+
onClick: withModifiers(openQuickFillModal, ["stop"])
|
|
3955
|
+
}, " 快速填报 ");
|
|
3956
|
+
};
|
|
3957
|
+
}
|
|
3958
|
+
});
|
|
3959
|
+
const documentQuickFillin = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a18386ab"]]);
|
|
2
3960
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
3961
|
+
a8 as AITooltips,
|
|
3962
|
+
AllocateTableCore,
|
|
3963
|
+
aS as BaseFormModelFetcher,
|
|
3964
|
+
aa as BinarizeMethodOptions,
|
|
3965
|
+
an as BindCmpStyleEnum,
|
|
3966
|
+
v as BooleanShowMode,
|
|
3967
|
+
B2 as BorderTD,
|
|
3968
|
+
BpmnNodeTypeEnum,
|
|
3969
|
+
aT as BpmnSignatureTypeEnum,
|
|
3970
|
+
B3 as BuiltinAction,
|
|
3971
|
+
aU as ButtonTypeEnum,
|
|
3972
|
+
B as BwipCodeType,
|
|
3973
|
+
aV as CHECK_TABLE_MEDPRO_PROTOCOL_KEY,
|
|
3974
|
+
CellType,
|
|
3975
|
+
I as CellWidgetViewState,
|
|
3976
|
+
C as ChangeType,
|
|
3977
|
+
CheckDsTypeEnum,
|
|
3978
|
+
aW as CodeRunner,
|
|
3979
|
+
ComponentTypeEnum,
|
|
3980
|
+
aX as Config_Fields,
|
|
3981
|
+
aY as ControlStatusEnum,
|
|
3982
|
+
am as DateFormat,
|
|
3983
|
+
ao as DecimalDisplayMode,
|
|
3984
|
+
a9 as DenoiseMethodOptions,
|
|
3985
|
+
s as DeviceConnector,
|
|
3986
|
+
a6 as DeviceLink,
|
|
3987
|
+
D as DeviceLinkTmplUtil,
|
|
3988
|
+
a7 as DeviceParamsTypeTitle,
|
|
3989
|
+
J as DiagonalDirection,
|
|
3990
|
+
_ as DocumentLayout,
|
|
3991
|
+
DocumentLoading,
|
|
3992
|
+
e as DocumentPaper,
|
|
3993
|
+
documentQuickFillin as DocumentQuickFillin,
|
|
3994
|
+
f as DocumentSubTableAction,
|
|
3995
|
+
aZ as EBR_PROVIDE_ENUM,
|
|
3996
|
+
ay as EFieldBizTypeEnum,
|
|
3997
|
+
ebrWikiLayout as EbrWikiLayout,
|
|
3998
|
+
edhrNewWikiTree as EdhrNewWikiTree,
|
|
3999
|
+
Y as EmptySymbol,
|
|
4000
|
+
errorGroupPanel as ErrorGroupPanel,
|
|
4001
|
+
a_ as FieldSysVarDefaultValueEnum,
|
|
4002
|
+
F2 as FillingTypeEnum,
|
|
4003
|
+
a5 as FormAnnotationController,
|
|
4004
|
+
a$ as FormModelController,
|
|
4005
|
+
FormTmplBomController,
|
|
4006
|
+
F as FormTmplConfigController,
|
|
4007
|
+
FormTypeEnum,
|
|
4008
|
+
a3 as ImageDisplayModeEnum,
|
|
4009
|
+
aq as InstanceStatusValues,
|
|
4010
|
+
ad as JoinModelTypeEum,
|
|
4011
|
+
t as LabelPosition,
|
|
4012
|
+
K as LineDirection,
|
|
4013
|
+
L as LineType,
|
|
4014
|
+
b0 as MBRender,
|
|
4015
|
+
t2 as MCDataUtil,
|
|
4016
|
+
b1 as MCRender,
|
|
4017
|
+
MaterialConsumeTableController,
|
|
4018
|
+
MaterialConsumptionPatternEnum,
|
|
4019
|
+
M2 as MaterialStatusEnum,
|
|
4020
|
+
MobileFillTypeEnum,
|
|
4021
|
+
NCB_PROVIDE,
|
|
4022
|
+
b2 as OfficeTypeEnum,
|
|
4023
|
+
O as Orientation,
|
|
4024
|
+
b as PageSizeEnum,
|
|
4025
|
+
P as PaginationFormat,
|
|
4026
|
+
a4 as PaperSizeMap,
|
|
4027
|
+
a as PaperWidgeType,
|
|
4028
|
+
l as PaperWidgeValueType,
|
|
4029
|
+
ac as ParamModelTypeEnum,
|
|
4030
|
+
PlatformEnum,
|
|
4031
|
+
b3 as PosEnum,
|
|
4032
|
+
PretreatmentListTableCore,
|
|
4033
|
+
ak as RangeValidateMode,
|
|
4034
|
+
RenderModeEnum,
|
|
4035
|
+
y as SignShowTypeEnum,
|
|
4036
|
+
w as SignatureNumberTypeEnum,
|
|
4037
|
+
x as SignatureTimeTypeEnum,
|
|
4038
|
+
z as SignatureTypeEnum,
|
|
4039
|
+
SterilizeBatchTableCore,
|
|
4040
|
+
StocktakeTableCore,
|
|
4041
|
+
SubTableCore,
|
|
4042
|
+
SubTableCoreFactory,
|
|
4043
|
+
SubTableType,
|
|
4044
|
+
b4 as SummaryApproveHisTypeEnum,
|
|
4045
|
+
T as TimeDiffFormat,
|
|
4046
|
+
V as ViewTypeEnum,
|
|
4047
|
+
W as WidgetImageSizeMode,
|
|
4048
|
+
b5 as applyCheckDsDataToRuntime,
|
|
4049
|
+
b6 as applyMedProCheckDsDataToRuntime,
|
|
4050
|
+
baseDataUtils,
|
|
4051
|
+
calcFillData,
|
|
4052
|
+
calcUtils,
|
|
4053
|
+
clearFormRules,
|
|
4054
|
+
commonUtils,
|
|
4055
|
+
b7 as deleteSubtableRow,
|
|
4056
|
+
extractKeywordFromQueryData,
|
|
4057
|
+
b8 as fetchCheckDsDataForTable,
|
|
4058
|
+
b9 as fetchCustomCheckDsData,
|
|
4059
|
+
ba as fetchMedProCheckDsData,
|
|
4060
|
+
getAppInfo,
|
|
4061
|
+
bb as getParseRuleConfig,
|
|
4062
|
+
getParseRuleInfo,
|
|
4063
|
+
getParseRuleValue,
|
|
4064
|
+
getSubTableQuickFillInfo,
|
|
4065
|
+
getSuiteKey,
|
|
4066
|
+
bc as handleOldConfig,
|
|
4067
|
+
isEdhrSuite,
|
|
4068
|
+
bd as isMedProSuite,
|
|
4069
|
+
be as jsonSchemaUtils,
|
|
4070
|
+
ar as normalizeRefLoaderResult,
|
|
4071
|
+
at as refUtils,
|
|
4072
|
+
renderUtils,
|
|
4073
|
+
bf as requestNonMedProCheckDsData,
|
|
4074
|
+
ah as setSelectAnnotationId,
|
|
4075
|
+
bg as setSelectMobileTdId,
|
|
4076
|
+
ag as setSelectValidatorId,
|
|
4077
|
+
ae as sqlUtils,
|
|
4078
|
+
transformUtils,
|
|
4079
|
+
u as useCalculateFormula,
|
|
4080
|
+
ai as useCurrentPageFormState,
|
|
4081
|
+
d as useDependency,
|
|
4082
|
+
useEbrWikiFactoryV2,
|
|
4083
|
+
M as useFormModel,
|
|
4084
|
+
a2 as useFormTmplConfig,
|
|
4085
|
+
b10 as useFormulaExpWatcher,
|
|
4086
|
+
useMaterialBalance,
|
|
4087
|
+
useMaterialStocktake,
|
|
4088
|
+
useNocodeEmitter,
|
|
4089
|
+
aj as useNocodeFormWidget,
|
|
4090
|
+
v2 as useOnlineFormActionButton,
|
|
4091
|
+
u2 as useOnlineFormTransformField2Component,
|
|
4092
|
+
useRenderPageFactory,
|
|
4093
|
+
c as useStyles,
|
|
4094
|
+
ax as useValidator,
|
|
4095
|
+
af as useWidgetStaticAttrs,
|
|
4096
|
+
validate
|
|
139
4097
|
};
|