@feedmepos/mf-inventory-portal 1.7.2 → 1.7.3-dev.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.
Files changed (107) hide show
  1. package/dist/{App-DohhNCXa.js → App-DK0-LWWu.js} +4 -4
  2. package/dist/{ApprovalView-To3lr_er.js → ApprovalView-BxV4_keX.js} +8 -8
  3. package/dist/{BindingsDialog-DUMIiVoC.js → BindingsDialog-DYVL00NY.js} +2 -2
  4. package/dist/{BindingsPicker-DQNUl07K.js → BindingsPicker-Bi1EcW62.js} +2 -2
  5. package/dist/{BindingsTable-DR6tP4Vq.js → BindingsTable-CvtOCAkc.js} +3 -3
  6. package/dist/BulkReceiveRequestView-Dgp3EWOn.js +2208 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-B8d6WuAD.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DX3Ug_dN.js} +1 -1
  8. package/dist/{ClosingDraftView-0cVbpL_Y.js → ClosingDraftView-D2uvIKY5.js} +20 -20
  9. package/dist/{ClosingHistoryView-CgeySFOV.js → ClosingHistoryView-CIb7Ch4L.js} +6 -6
  10. package/dist/{ClosingTemplateView-0DND6wXY.js → ClosingTemplateView-XVSVYB2y.js} +17 -17
  11. package/dist/CursorPaginatedTable.vue_vue_type_script_setup_true_lang-BCUhtL_B.js +136 -0
  12. package/dist/{DefaultView-CJJPVYaP.js → DefaultView-BJets42n.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-BYGrbUM7.js → DeliveryOrderPrintPreview-DaQHEkqA.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-y-pJP1Jp.js → EmailDialog.vue_vue_type_script_setup_true_lang-CBL0xqFW.js} +1636 -1636
  15. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DuCO2ruW.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DbQxJtrd.js} +1 -1
  16. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-MttAbvza.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BgCS24jN.js} +2 -2
  17. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-yAqRbXI7.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Dc6xTcD8.js} +2 -2
  18. package/dist/{FmMultiselectDialog-DFa8dpii.js → FmMultiselectDialog-Bq_Na17d.js} +2 -2
  19. package/dist/{FmMultiselectDialog-DYzEHEev.js → FmMultiselectDialog-CxsksooH.js} +1 -1
  20. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-5xj-8OQS.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DkftHtJN.js} +5 -5
  21. package/dist/{ImportView-gcy9rku3.js → ImportView-BzNfHFEx.js} +6 -6
  22. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-sx6-tRnK.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Hat27Ar4.js} +1 -1
  23. package/dist/{IngredientGroupView-BAC3mW8X.js → IngredientGroupView-ClG1OM4D.js} +5 -5
  24. package/dist/{IngredientsView-DUwPOngs.js → IngredientsView-BYE1xoOE.js} +15 -15
  25. package/dist/{IntegrationExplorerView-A-el5q_l.js → IntegrationExplorerView-DwvsbHfd.js} +4 -4
  26. package/dist/{IntegrationView-CZNWvTcS.js → IntegrationView-ikLaCdnl.js} +797 -750
  27. package/dist/{InventoryBindingForm-D2QosIsu.js → InventoryBindingForm-C6P0ZuXJ.js} +1 -1
  28. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BITnywUj.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DzLxq3uM.js} +5 -5
  29. package/dist/{InventoryBindingSummary-D6HNweqs.js → InventoryBindingSummary-CMSSSTdo.js} +1 -1
  30. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B6h1Gd2a.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-COXmn2a8.js} +1 -1
  31. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DcypxqiE.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BvrpIpql.js} +1 -1
  32. package/dist/{ProductionView-lhMrHKJn.js → ProductionView-DI3JxiFg.js} +7 -7
  33. package/dist/{PublishView-CQsNNeNS.js → PublishView-BoyEuUAu.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-Cos7s-NS.js → PurchaseOrderPrintPreview-D60kdiQU.js} +2 -2
  35. package/dist/{ReceiveRequestView-kkBYw4JQ.js → ReceiveRequestView-DhpS9JLx.js} +13 -13
  36. package/dist/{RecipeView-CjaZPxYm.js → RecipeView-Cz-Q0aio.js} +17 -17
  37. package/dist/{SettingsView-BmQpMvRD.js → SettingsView-BNDr4ez-.js} +4 -4
  38. package/dist/{StockView-3LQX-iUo.js → StockView-bpRLYtw0.js} +21 -21
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BWc-rqnP.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B0wulwNM.js} +1 -1
  40. package/dist/{SupplierView-JIgEU67D.js → SupplierView-CDHpZdob.js} +13 -13
  41. package/dist/{SurchargeView-CLxruSjz.js → SurchargeView-BQ1O-fAr.js} +6 -6
  42. package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-DicFDlas.js +209 -0
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DGnnOvqu.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D0NGjAyr.js} +1 -1
  44. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-SHMiHC5F.js +4709 -0
  45. package/dist/{TransferTemplateView-BopBFYQK.js → TransferTemplateView-BRYAJdlG.js} +20 -20
  46. package/dist/{UnitCostHistoryView-Dn_riEm2.js → UnitCostHistoryView-DLLPBU9n.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BY6MtjNI.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DTJBsfEj.js} +4 -4
  48. package/dist/{UnitView-C14LJdh1.js → UnitView-DwZMbt4A.js} +7 -7
  49. package/dist/{WarehouseView-DSofhuRJ.js → WarehouseView-DyKR9b4c.js} +5 -5
  50. package/dist/{WastageTemplateView-CVNs59Q3.js → WastageTemplateView-CZhQ7MKe.js} +14 -14
  51. package/dist/api/codemax.d.ts +1 -1
  52. package/dist/api/purchase-order.d.ts +39 -1
  53. package/dist/{app-D3Pk5TsF.js → app-CPHh8dJ8.js} +2540 -2506
  54. package/dist/app.js +1 -1
  55. package/dist/{closing-template-ChgHEg6X.js → closing-template-DV8hM9mR.js} +1 -1
  56. package/dist/components/{CursorPaginatedTable.vue.d.ts → cursor-paginated-table/CursorPaginatedTable.vue.d.ts} +1 -7
  57. package/dist/components/cursor-paginated-table/use-row-action.d.ts +17 -0
  58. package/dist/{date2-S8CzVzLb.js → date2-CMYcYkVI.js} +1 -1
  59. package/dist/{dayjs.min-BTkKTXC_.js → dayjs.min-Crreg1xX.js} +1 -1
  60. package/dist/{decimal-DbIrw0-W.js → decimal-DhFDmEjW.js} +2 -2
  61. package/dist/{defineDeepModel-VV8-dLQB.js → defineDeepModel-DSzyuBIx.js} +1 -1
  62. package/dist/dinero-DMLEtkS9.js +1260 -0
  63. package/dist/{duplicate-template-CU7i2OYd.js → duplicate-template-qbIou3kX.js} +1 -1
  64. package/dist/{feature-PxsJCXfx.js → feature-Do5dZj8x.js} +2 -2
  65. package/dist/{format-time-from-id-DzyQO052.js → format-time-from-id-BbguyEMG.js} +1 -1
  66. package/dist/{format-unit-display-Ce_ihiZh.js → format-unit-display-C-RAKWPU.js} +12 -12
  67. package/dist/{import-export.helper-BMjR_wjj.js → import-export.helper-Duq-vfeY.js} +6 -6
  68. package/dist/{index-DVld56cO.js → index-75GfRz2O.js} +1 -1
  69. package/dist/{index-CVnjxAU0.js → index-Ctrxj7cE.js} +3 -3
  70. package/dist/{index-ntOX0GTR.js → index-D73SJ6zk.js} +3807 -5062
  71. package/dist/{inventory-core-dart.default-Crk5o9NC.js → inventory-core-dart.default-toC4Oswn.js} +1 -1
  72. package/dist/{jszip.min-n1XNOZh7.js → jszip.min-DCDx15Lo.js} +523 -523
  73. package/dist/{lz-string-BOPYfMhM.js → lz-string-DIrw_osP.js} +1 -1
  74. package/dist/{netsuite-XygzV566.js → netsuite-BCPPfv5q.js} +2 -2
  75. package/dist/{number-C2ht-mjX.js → number-Dj-zUn93.js} +3 -3
  76. package/dist/{predefined-templates-BwKtONp8.js → predefined-templates-CkZwybVN.js} +1 -1
  77. package/dist/{purchase-order-template-B43-m0J3.js → purchase-order-template-B96No_lH.js} +1 -1
  78. package/dist/{recalculationUtils-DIVwhfP2.js → recalculationUtils-lkExVizR.js} +1 -1
  79. package/dist/{rules-D_NC8Wh3.js → rules-DjI-FPha.js} +2 -2
  80. package/dist/{stock-CnspYkq6.js → stock-BLL3aLEQ.js} +3 -3
  81. package/dist/{stock-yL5X9man.js → stock-KNrrUQF1.js} +1 -1
  82. package/dist/{supplier-W7lS_7Ga.js → supplier-CosSdx6_.js} +2 -2
  83. package/dist/{surcharge-BNENHWoz.js → surcharge-DFnSG3ka.js} +1 -1
  84. package/dist/tsconfig.app.tsbuildinfo +1 -1
  85. package/dist/{uom-rules-C4weCQ1J.js → uom-rules-MbRvuo5s.js} +1 -1
  86. package/dist/{use-ingredient-select-dialog-CoMShpCA.js → use-ingredient-select-dialog-HqatzFkQ.js} +2 -2
  87. package/dist/{use-inventory-binding-dialog-DAiB6uuX.js → use-inventory-binding-dialog-CHIrX4O3.js} +2 -2
  88. package/dist/use-row-action-Cvq6VO38.js +31 -0
  89. package/dist/{use-template-enabled-locations-DAnSVWry.js → use-template-enabled-locations-CZDQcsEJ.js} +2 -2
  90. package/dist/{use-transfer-locations-Bunxkf8T.js → use-transfer-locations-BRCrX_-r.js} +2 -2
  91. package/dist/{useHrmPermission-8T4AE1Is.js → useHrmPermission-B9vfKTf-.js} +1 -1
  92. package/dist/{useNavigationMenu-BpMry1lp.js → useNavigationMenu-DPD_pWDz.js} +2 -2
  93. package/dist/{useSseClient-eneZ6wE5.js → useSseClient-CuljyleL.js} +1 -1
  94. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +7 -7
  95. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +1 -1
  96. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +46 -8
  97. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +504 -529
  98. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +33 -2
  99. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.spec.d.ts +1 -0
  100. package/dist/views/receive-request-bulk/helpers/resolve-po-print-context.d.ts +21 -0
  101. package/dist/{vue-i18n-L-ghmVMg.js → vue-i18n-CyoeLXfI.js} +396 -396
  102. package/dist/{xlsx.util-DjAJxws5.js → xlsx.util-C6g7kacG.js} +2 -2
  103. package/package.json +4 -4
  104. package/dist/BulkReceiveRequestView-Dz1lQS-u.js +0 -2011
  105. package/dist/CursorPaginatedTable.vue_vue_type_script_setup_true_lang-4KT9rH9e.js +0 -152
  106. package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-IXZTVQ42.js +0 -178
  107. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-UStf5-hI.js +0 -4682
@@ -1,152 +0,0 @@
1
- import { defineComponent as H, ref as l, watch as A, nextTick as L, resolveComponent as _, createElementBlock as T, openBlock as R, createBlock as O, createCommentVNode as G, mergeProps as I, createSlots as J, renderList as Q, withCtx as U, renderSlot as X, normalizeProps as Y, guardReactiveProps as Z, normalizeStyle as ee, createElementVNode as B, createVNode as F, toDisplayString as te, unref as $ } from "vue";
2
- import { useSnackbar as oe } from "@feedmepos/ui-library";
3
- import { useI18n as ne } from "@feedmepos/mf-common";
4
- const ae = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, re = { class: "fm-typo-en-body-md-400" }, le = /* @__PURE__ */ H({
5
- inheritAttrs: !1,
6
- __name: "CursorPaginatedTable",
7
- props: {
8
- fetchPage: {},
9
- rows: {},
10
- transform: { type: Function, default: void 0 },
11
- pageSize: { default: 10 },
12
- refreshKey: { default: 0 },
13
- loading: { type: Boolean, default: !1 },
14
- rowAction: {},
15
- fetchDetail: {},
16
- detailToRow: {}
17
- },
18
- emits: ["update:rows", "detail"],
19
- setup(z, { expose: E, emit: K }) {
20
- const s = z, d = K, f = l(1), x = l(0), m = l(!1);
21
- let v = {}, g, p = 0, h;
22
- async function M({ pageSize: e, pageIndex: t }) {
23
- const o = p, r = `${o}:${t}:${e}`;
24
- if (m.value && r === h) return;
25
- h = r, g !== e && (v = {}, g = e, f.value = 1);
26
- const c = v;
27
- m.value = !0;
28
- try {
29
- let n = t;
30
- for (; n > 0 && c[n] === void 0; ) n--;
31
- let a = await s.fetchPage({ limit: e, startkey: c[n] });
32
- for (a.nextStartkey && (c[n + 1] = a.nextStartkey); n < t && a.hasMore; ) {
33
- if (c[n + 1] === void 0) {
34
- console.log("Cursor pagination: hasMore without nextStartkey; stopping at page", n);
35
- break;
36
- }
37
- n++, a = await s.fetchPage({ limit: e, startkey: c[n] }), a.nextStartkey && (c[n + 1] = a.nextStartkey);
38
- }
39
- const b = s.transform ? await s.transform(a.docs) : a.docs;
40
- if (o !== p || r !== h) return;
41
- const q = !!(a.hasMore && a.nextStartkey);
42
- f.value = Math.max(f.value, n + 1 + (q ? 1 : 0)), d("update:rows", b);
43
- } catch (n) {
44
- console.log("Something went wrong when fetching page:", n);
45
- } finally {
46
- o === p && r === h && (m.value = !1);
47
- }
48
- }
49
- function C() {
50
- p++, v = {}, g = void 0, f.value = 1, d("update:rows", []), x.value++;
51
- }
52
- A(
53
- () => s.refreshKey,
54
- () => C()
55
- );
56
- const N = oe(), { t: y } = ne(), u = l(!1);
57
- let i;
58
- async function w(e) {
59
- i == null || i.abort();
60
- const t = new AbortController();
61
- i = t, u.value = !0;
62
- try {
63
- await e(t.signal);
64
- } catch (o) {
65
- t.signal.aborted || (console.error("Row action failed:", o), N.open({
66
- title: y("inventory.common.somethingWentWrong"),
67
- message: (o == null ? void 0 : o.message) || y("inventory.common.tryAgain"),
68
- type: "error"
69
- }));
70
- } finally {
71
- i === t && (i = void 0, u.value = !1);
72
- }
73
- }
74
- function D() {
75
- i == null || i.abort(), i = void 0, u.value = !1;
76
- }
77
- const P = l(), k = l();
78
- A(u, async (e) => {
79
- var r;
80
- if (!e) return;
81
- k.value = void 0, await L();
82
- const t = (r = P.value) == null ? void 0 : r.firstElementChild, o = t == null ? void 0 : t.lastElementChild;
83
- o && (k.value = `${o.offsetTop + o.offsetHeight}px`);
84
- });
85
- async function V(e, t) {
86
- if (!(t != null && t._rev) || !(e != null && e._rev) || e._rev === t._rev) return;
87
- const o = s.rows.findIndex((a) => (a == null ? void 0 : a._id) === t._id);
88
- if (o < 0) return;
89
- const r = s.rows[o], c = s.detailToRow ? await s.detailToRow(t, r) : W(t, r), n = [...s.rows];
90
- n[o] = c, d("update:rows", n);
91
- }
92
- function W(e, t) {
93
- const o = { ...t };
94
- for (const r of Object.keys(o))
95
- r in e && (o[r] = e[r]);
96
- return o;
97
- }
98
- async function S(e) {
99
- s.fetchDetail && await w(async (t) => {
100
- const o = await s.fetchDetail(e, t);
101
- d("detail", o), await V(e, o);
102
- });
103
- }
104
- function j(e) {
105
- if (s.fetchDetail) return void S((e == null ? void 0 : e.original) ?? e);
106
- s.rowAction && w((t) => s.rowAction(e, t));
107
- }
108
- return E({ refresh: C, runRowAction: w, openRowDetail: S }), (e, t) => {
109
- const o = _("FmTable"), r = _("FmCircularProgress"), c = _("FmButton");
110
- return R(), T("div", {
111
- ref_key: "wrapperRef",
112
- ref: P,
113
- class: "relative"
114
- }, [
115
- (R(), O(o, I(e.$attrs, {
116
- key: x.value,
117
- "row-data": e.rows,
118
- "page-size": e.pageSize,
119
- "page-count": f.value,
120
- "fetch-fn": M,
121
- loading: e.loading || m.value,
122
- "on-row-click": e.fetchDetail || e.rowAction ? j : void 0
123
- }), J({ _: 2 }, [
124
- Q(e.$slots, (n, a) => ({
125
- name: a,
126
- fn: U((b) => [
127
- X(e.$slots, a, Y(Z(b ?? {})))
128
- ])
129
- }))
130
- ]), 1040, ["row-data", "page-size", "page-count", "loading", "on-row-click"])),
131
- u.value ? (R(), T("div", {
132
- key: 0,
133
- class: "absolute left-0 right-0 top-0 z-10 flex items-center justify-center bg-fm-color-opacity-sm",
134
- style: ee({ height: k.value ?? "100%" })
135
- }, [
136
- B("div", ae, [
137
- F(r, { size: "md" }),
138
- B("span", re, te($(y)("inventory.common.loading")), 1),
139
- F(c, {
140
- variant: "secondary",
141
- label: $(y)("inventory.common.cancel"),
142
- onClick: D
143
- }, null, 8, ["label"])
144
- ])
145
- ], 4)) : G("", !0)
146
- ], 512);
147
- };
148
- }
149
- });
150
- export {
151
- le as _
152
- };
@@ -1,178 +0,0 @@
1
- import { defineComponent as I, ref as m, resolveComponent as p, createBlock as O, openBlock as i, withCtx as u, createElementVNode as T, createVNode as y, h as B, createElementBlock as v, toDisplayString as g } from "vue";
2
- import { F as L } from "./FmAdminBadge-DlplQOHb.js";
3
- import { m as U, u as _ } from "./app-D3Pk5TsF.js";
4
- import { useCoreStore as A } from "@feedmepos/mf-common";
5
- import { useDialog as C, components as V } from "@feedmepos/ui-library";
6
- import { u as F, a as j } from "./closing-template-ChgHEg6X.js";
7
- const q = U((o, t) => {
8
- const c = _(), l = A();
9
- return {
10
- async readRequests(a, e, r) {
11
- const n = a ?? c.currentLocationDBName, d = `${o.inventoryBackendUrl}/${n}/purchase-request`;
12
- return e && r ? await t.get(`${d}?startDate=${e}&endDate=${r}`) : await t.get(d);
13
- },
14
- async readRequestById(a, e) {
15
- const r = e ?? c.currentLocationDBName, n = `${o.inventoryBackendUrl}/${r}/purchase-request/${a}`;
16
- return await t.get(n);
17
- },
18
- async readRequestByIds(a, e) {
19
- const r = e ?? c.currentLocationDBName, n = `${o.inventoryBackendUrl}/${r}/purchase-request/find`;
20
- return await t.post(n, { requestIds: a });
21
- },
22
- async getPurchaseOrders({
23
- start: a,
24
- end: e,
25
- dbName: r
26
- }) {
27
- const n = r ?? c.currentLocationDBName, d = `${o.inventoryBackendUrl}/${n}/purchase-order`;
28
- return await t.get(`${d}?start=${a}&end=${e}`);
29
- },
30
- async getLatestPurchaseOrderRequest(a) {
31
- const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-request/find-by-purchase-order-id`;
32
- return await t.get(`${r}/${a}`);
33
- },
34
- async getPurchaseOrderById(a) {
35
- const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-order`;
36
- return await t.get(`${r}/${a}`);
37
- },
38
- /**
39
- * @deprecated Use `processPurchaseOrderV2` instead.
40
- */
41
- async processPurchaseOrder(a, e) {
42
- const r = c.currentLocationDBName, n = e || r, d = `${o.inventoryBackendUrl}/${n}/purchase-order/run-operation`;
43
- return await t.put(d, a);
44
- },
45
- async createPurchaseOrder(a) {
46
- const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-order`;
47
- return await t.post(r, a);
48
- },
49
- async updatePurchaseOrder(a) {
50
- const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-order`;
51
- return await t.put(r, a);
52
- },
53
- async importFromXilnex(a) {
54
- const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/purchase-order/import-from-xilnex`;
55
- return await t.post(r, a);
56
- },
57
- async processPurchaseOrderV2(a, e) {
58
- const r = c.currentLocationDBName, n = e || r, d = `${o.inventoryBackendUrl}/${n}/v2/purchase-order/run-operation`;
59
- return await t.put(d, a);
60
- },
61
- async getWorkflowConfig() {
62
- var n;
63
- const e = `business_${(n = l.currentBusiness.value) == null ? void 0 : n._id}`, r = `${o.inventoryBackendUrl}/${e}/v2/purchase-order/workflow-config`;
64
- return await t.get(r);
65
- },
66
- async updateDeliveryOrder(a) {
67
- const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/delivery-order`;
68
- return await t.put(r, a);
69
- },
70
- async createDeliveryOrder(a) {
71
- const e = c.currentLocationDBName, r = `${o.inventoryBackendUrl}/${e}/delivery-order`;
72
- return await t.post(r, a);
73
- },
74
- async getDeliveryOrderTrails(a, e) {
75
- const r = c.currentLocationDBName, n = `${o.inventoryBackendUrl}/${r}/delivery-order/audit-trails`;
76
- return await t.post(n, { purchaseOrderId: a, deliveryOrderId: e });
77
- }
78
- };
79
- }), P = { key: 0 }, S = { key: 1 }, K = { key: 2 }, W = /* @__PURE__ */ I({
80
- __name: "SystemTrailDialog",
81
- props: {
82
- purchaseOrderId: {},
83
- deliveryOrderId: {},
84
- adjustmentId: {},
85
- closingId: {}
86
- },
87
- setup(o) {
88
- const t = o, c = q(), l = F(), a = j(), e = m(!1), r = C(), n = m([]), d = m("");
89
- async function $() {
90
- t.adjustmentId ? await l.getAuditTrails(t.adjustmentId).then((s) => {
91
- n.value = s;
92
- }) : t.closingId ? await a.getAuditTrails(t.closingId).then((s) => {
93
- n.value = s;
94
- }) : t.purchaseOrderId && t.deliveryOrderId && await c.getDeliveryOrderTrails(t.purchaseOrderId, t.deliveryOrderId).then((s) => {
95
- n.value = s;
96
- });
97
- }
98
- function w(s) {
99
- r.open({
100
- title: "Metadata",
101
- contentComponent: B(
102
- "pre",
103
- { class: "bg-gray-100 p-4 rounded whitespace-pre-wrap" },
104
- JSON.stringify(s, null, 2)
105
- )
106
- });
107
- }
108
- const f = [
109
- {
110
- accessorKey: "createdAt",
111
- header: () => "Created At"
112
- },
113
- {
114
- accessorKey: "createdBy",
115
- header: () => "Created By",
116
- cell: (s) => s.getValue().name
117
- },
118
- {
119
- accessorKey: "message",
120
- header: () => "Message"
121
- },
122
- {
123
- accessorKey: "metadata",
124
- header: () => "Metadata",
125
- cell: (s) => B(V.FmButton, {
126
- label: "View",
127
- onClick: () => w(s.getValue())
128
- }),
129
- meta: {
130
- cellSpanClass: ""
131
- }
132
- }
133
- ];
134
- return (s, h) => {
135
- const N = p("FmButton"), D = p("FmTable"), b = p("FmDialog");
136
- return i(), O(b, {
137
- modelValue: e.value,
138
- "onUpdate:modelValue": h[0] || (h[0] = (k) => e.value = k),
139
- overlay: !0,
140
- dismissAway: "",
141
- "max-width": "800px"
142
- }, {
143
- "dialog-button": u(() => [
144
- y(L, null, {
145
- default: u(() => [
146
- y(N, {
147
- variant: "plain",
148
- label: "Trails",
149
- size: "md",
150
- "prepend-icon": "overview",
151
- onClick: $
152
- })
153
- ]),
154
- _: 1
155
- })
156
- ]),
157
- "dialog-header": u(() => [
158
- s.adjustmentId ? (i(), v("div", P, 'Adjustment Template "' + g(s.adjustmentId) + '" Trails', 1)) : s.closingId ? (i(), v("div", S, 'Closing Template "' + g(s.closingId) + '" Trails', 1)) : (i(), v("div", K, 'Delivery Order "' + g(s.deliveryOrderId) + '" Trails', 1))
159
- ]),
160
- default: u(() => [
161
- T("div", null, [
162
- y(D, {
163
- "row-data": n.value,
164
- "column-defs": f,
165
- "search-value": d.value,
166
- "shrink-at": !1
167
- }, null, 8, ["row-data", "search-value"])
168
- ])
169
- ]),
170
- _: 1
171
- }, 8, ["modelValue"]);
172
- };
173
- }
174
- });
175
- export {
176
- W as _,
177
- q as u
178
- };