@feedmepos/mf-inventory-portal 0.0.19-dev.13 → 0.0.19-dev.14
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/dist/App.vue.d.ts +1 -1
- package/dist/{ApprovalView-9MdmwrUz.js → ApprovalView-BY13XuOu.js} +5 -5
- package/dist/{BindingsDialog-C-q6Y04n.js → BindingsDialog-B3PP-XkE.js} +22 -22
- package/dist/{BindingsPicker-syyx9h8v.js → BindingsPicker-DL17pRty.js} +17 -17
- package/dist/{BindingsTable-CQ0WyX2i.js → BindingsTable-CjKOv7Yw.js} +29 -29
- package/dist/Entry.vue.d.ts +1 -1
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DoF7wwNT.js +306 -0
- package/dist/{IngredientsView-Ofs2UG-9.js → IngredientsView-C-rsKAsF.js} +294 -294
- package/dist/{IntegrationView-BCruLSTA.js → IntegrationView-BkhfPSjM.js} +278 -278
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bvw_BkWY.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Buc21sEN.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BLVAIHDv.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BRijSilS.js} +1 -1
- package/dist/PurchaseOrderPrintPreview-CGMMozPA.js +152 -0
- package/dist/{ReceiveRequestView-Dw-AC1Mw.js → ReceiveRequestView-Bk0pUeEm.js} +7 -7
- package/dist/{RecipeView-B5WkUzLO.js → RecipeView-kzA9kIg8.js} +181 -181
- package/dist/Standalone.vue.d.ts +1 -1
- package/dist/{StockView-CMTxj8Ly.js → StockView-DF-ucES_.js} +23 -23
- package/dist/SupplierView-XlzsU00G.js +813 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B8IGZmDZ.js → TransferDetails.vue_vue_type_script_setup_true_lang-Bp7AJiJ-.js} +106 -106
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-D1NAkXMT.js +1690 -0
- package/dist/TransferTemplateView-CsA2SzQY.js +1279 -0
- package/dist/{UnitView-CExCsCFg.js → UnitView-9VMIlEZ_.js} +242 -242
- package/dist/{WarehouseView-DuPizg7w.js → WarehouseView-JTYLFBsu.js} +360 -362
- package/dist/api/bill.d.ts +238 -84
- package/dist/api/supplier.d.ts +4 -4
- package/dist/app-kYGuBDV8.js +68549 -0
- package/dist/app.d.ts +14 -0
- package/dist/app.js +3 -3
- package/dist/components/ChangeLocationComponent.vue.d.ts +11 -1
- package/dist/components/DeferableLoading.vue.d.ts +1 -1
- package/dist/components/DeleteDialog.vue.d.ts +1 -1
- package/dist/components/FmCoordinateInput.vue.d.ts +3 -3
- package/dist/components/FmDroppableField.vue.d.ts +6 -6
- package/dist/components/FmFilterableSelect.vue.d.ts +3 -3
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +21 -10
- package/dist/components/FmMinMaxInput.vue.d.ts +20 -0
- package/dist/components/FmMinMaxInputProps.d.ts +16 -0
- package/dist/components/FmMinMaxInputRules.d.ts +4 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +5 -5
- package/dist/components/FmMultiselectDialogProps.d.ts +3 -0
- package/dist/components/FmUnitInputRules.d.ts +1 -0
- package/dist/components/MultiSelectDialog.vue.d.ts +1 -1
- package/dist/components/NavigationTab.vue.d.ts +1 -1
- package/dist/components/NumberPrecisionInput.vue.d.ts +3 -3
- package/dist/components/PremiumBadge.vue.d.ts +3 -3
- package/dist/components/PreviewBadge.vue.d.ts +3 -3
- package/dist/components/StockForecast.vue.d.ts +1 -1
- package/dist/components/TableActionableRow.vue.d.ts +4 -4
- package/dist/components/UnitDisplayControl.vue.d.ts +1 -1
- package/dist/components/icons/IconCommunity.vue.d.ts +1 -1
- package/dist/components/icons/IconDocumentation.vue.d.ts +1 -1
- package/dist/components/icons/IconEcosystem.vue.d.ts +1 -1
- package/dist/components/icons/IconSupport.vue.d.ts +1 -1
- package/dist/components/icons/IconTooling.vue.d.ts +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +5 -5
- package/dist/components/map/CoordinateDialog.vue.d.ts +4 -4
- package/dist/components/map/GoogleMap.vue.d.ts +6 -6
- package/dist/components/nested-multiselect/FmNestedMultiselectDialog.vue.d.ts +3 -3
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +3 -3
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +5 -5
- package/dist/components/ui-library/FmDateRangePickerChip.vue.d.ts +5 -5
- package/dist/composable/useIframe.d.ts +1 -1
- package/dist/composable/useSearch.d.ts +1 -1
- package/dist/{decimal-GwZ2MmM_.js → decimal-E3w4eGHF.js} +1 -1
- package/dist/helper/number.d.ts +2 -0
- package/dist/{id-to-date-CMUZ2glF.js → id-to-date-gyR82hWy.js} +1 -1
- package/dist/is-linked-ingredient-error-fJ2TJb3z.js +37 -0
- package/dist/layout/InventoryLayout.vue.d.ts +1 -1
- package/dist/layout/SingleColumnLayout.vue.d.ts +5 -5
- package/dist/layout/components/NavigationButton.vue.d.ts +4 -4
- package/dist/{layout-C3IEOm7C.js → layout-BTYR4n3X.js} +1 -1
- package/dist/{purchase-order-transaction-type-DpZQe_jA.js → purchase-order-transaction-type-CUtdDhYo.js} +2 -2
- package/dist/stores/feature.d.ts +2 -1
- package/dist/stores/location.d.ts +108 -148
- package/dist/stores/supplier.d.ts +672 -18
- package/dist/stores/warehouse.d.ts +9 -5
- package/dist/supplier-Ed-Bva_-.js +60 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/InventoryView.vue.d.ts +1 -1
- package/dist/views/SelectBussinessDialog.vue.d.ts +1 -1
- package/dist/views/approval/ApprovalView.vue.d.ts +1 -1
- package/dist/views/dev/ComponentPreview.vue.d.ts +1 -1
- package/dist/views/dev/components/CoordinateTest.vue.d.ts +1 -1
- package/dist/views/dev/components/DateRange.vue.d.ts +1 -1
- package/dist/views/dev/components/FmDecimalInputTest.vue.d.ts +1 -1
- package/dist/views/dev/components/FmMultiselectDialogGrouped.vue.d.ts +1 -1
- package/dist/views/dev/components/FmSelectTest.vue.d.ts +1 -1
- package/dist/views/dev/components/InventoryIframe.vue.d.ts +1 -1
- package/dist/views/dev/components/LayoutDev.vue.d.ts +1 -1
- package/dist/views/dev/components/MfCommontTest.vue.d.ts +1 -1
- package/dist/views/dev/components/NestedSelection.vue.d.ts +1 -1
- package/dist/views/dev/components/NumberStepper.vue.d.ts +1 -1
- package/dist/views/dev/components/TabStorageTest.vue.d.ts +1 -1
- package/dist/views/dev/components/UnitInput.vue.d.ts +1 -1
- package/dist/views/dev/helpers/pinia-test.d.ts +1 -1
- package/dist/views/home/HomeView.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-dialog/BindingsDialog.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-picker/BindingsPicker.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-table/BindingsTable.vue.d.ts +1 -1
- package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -1
- package/dist/views/ingredients/components/cannot-delete/CannotDelete.vue.d.ts +4 -4
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +3 -3
- package/dist/views/ingredients/components/import-ingredients/ImportIngredientItem.vue.d.ts +1 -1
- package/dist/views/ingredients/components/import-ingredients/ImportIngredients.vue.d.ts +1 -1
- package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItem.vue.d.ts +1 -1
- package/dist/views/ingredients/components/ingredient-dialog/IngredientDialog.vue.d.ts +5 -5
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +4 -4
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +5 -5
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingSummary.vue.d.ts +3 -3
- package/dist/views/ingredients/composables/use-ingredient-form.d.ts +8 -8
- package/dist/views/integration/IntegrationView.vue.d.ts +1 -1
- package/dist/views/integration/components/ApplyAddon.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProduct.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +5 -5
- package/dist/views/receive-request/ReceiveRequestView.vue.d.ts +1 -1
- package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistory.vue.d.ts +1 -1
- package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-dialog/TransferDialog.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +27 -27
- package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/components/TransferItem.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/composables/use-backdate-po.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/composables/use-compare-price.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +0 -8
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1012 -66
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +24 -24
- package/dist/views/receive-request/print-preview/PurchaseOrderPrintPreview.vue.d.ts +1 -1
- package/dist/views/recipe/RecipeView.vue.d.ts +1 -1
- package/dist/views/recipe/components/recipe-dialog/RecipeDialog.vue.d.ts +5 -5
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +4 -4
- package/dist/views/recipe/composables/use-recipe-form.d.ts +8 -8
- package/dist/views/stock/StockView.vue.d.ts +1 -1
- package/dist/views/stock/components/StockHeaderPreview.vue.d.ts +1 -1
- package/dist/views/stock/components/StockHistory.vue.d.ts +3 -3
- package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +2 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +123 -46
- package/dist/views/stock/components/dialog/AdjustSkuDialog.vue.d.ts +4 -4
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +3 -3
- package/dist/views/stock/components/dialog/ConvertSkuDialog.vue.d.ts +4 -4
- package/dist/views/stock/composables/use-stock-action.d.ts +11 -11
- package/dist/views/supplier/SupplierView.vue.d.ts +1 -1
- package/dist/views/supplier/components/SupplierDialog.vue.d.ts +4 -4
- package/dist/views/supplier/components/SupplierDialogProps.d.ts +1 -0
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +10 -10
- package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +3 -3
- package/dist/views/supplier/composables/use-supplier-table.d.ts +3 -3
- package/dist/views/transfer-template/TransferTemplateView.vue.d.ts +1 -1
- package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +3 -3
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +4 -4
- package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateForm.vue.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +3 -3
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +7 -7
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +13 -8
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1020 -79
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +309 -11
- package/dist/views/unit/UnitView.vue.d.ts +1 -1
- package/dist/views/unit/components/unit-dialog/UnitDialog.vue.d.ts +5 -5
- package/dist/views/unit/components/unit-form/UnitForm.vue.d.ts +4 -4
- package/dist/views/unit/components/unit-summary/UnitSummary.vue.d.ts +3 -3
- package/dist/views/unit/components/unit-used-by/UnitUsedBy.vue.d.ts +1 -1
- package/dist/views/unit/composables/use-unit-form.d.ts +8 -8
- package/dist/views/warehouse/WarehouseView.vue.d.ts +1 -1
- package/dist/views/warehouse/components/WarehouseDialog.vue.d.ts +4 -4
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +22 -14
- package/dist/{xlsx-CjErNF-B.js → xlsx-q6Ctgevr.js} +2759 -2759
- package/dist/{xlsx.util-CMXCCmUA.js → xlsx.util-Cvqg56mI.js} +2 -2
- package/package.json +2 -1
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DlIq3AyC.js +0 -272
- package/dist/PurchaseOrderPrintPreview-Do2KxBzF.js +0 -152
- package/dist/SupplierView-OmZ0X1E1.js +0 -801
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-BJMBsA9j.js +0 -1672
- package/dist/TransferTemplateView-Da6ehaJF.js +0 -1101
- package/dist/app-Chj8x632.js +0 -67206
- package/dist/is-linked-ingredient-error-C6AghEwR.js +0 -37
- package/dist/supplier-dG_APcwB.js +0 -54
|
@@ -0,0 +1,1279 @@
|
|
|
1
|
+
import { defineComponent as W, onMounted as Ve, computed as M, ref as U, watch as ye, inject as Ge, resolveComponent as I, openBlock as R, createElementBlock as N, createElementVNode as a, createVNode as c, withCtx as B, renderSlot as we, withDirectives as Te, normalizeClass as ce, vModelText as Fe, reactive as Ye, h as D, toDisplayString as F, unref as e, createBlock as Q, isRef as Oe, createCommentVNode as ae, Fragment as Pe, renderList as We, normalizeStyle as Ke, Teleport as Ze, mergeProps as $e, normalizeProps as Je, guardReactiveProps as Xe } from "vue";
|
|
2
|
+
import { _ as et, a as tt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DoF7wwNT.js";
|
|
3
|
+
import { useI18n as Y } from "@feedmepos/mf-common";
|
|
4
|
+
import { d as Be, c as re, u as ot, a as st, b as Se, e as nt, _ as at } from "./TransferDialog.vue_vue_type_script_setup_true_lang-D1NAkXMT.js";
|
|
5
|
+
import { F as le, R as Re } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { $ as me, t as Ie, I as lt, a0 as rt, a1 as it, a as E, D as Me, R as pe, a2 as ut, a3 as dt, r as de, a4 as mt, l as De, A as fe, M as Ae, G as Le, a5 as ct, a6 as Ue, b as qe, u as pt, j as Ee, y as ft, a7 as yt, a8 as vt } from "./app-kYGuBDV8.js";
|
|
7
|
+
import { F as q, _ as Ne, u as bt } from "./layout-BTYR4n3X.js";
|
|
8
|
+
import { useBreakpoints as ze, components as G, FmButtonVariant as _t, useDialog as xt, useSnackbar as ht, useProxiedModel as He } from "@feedmepos/ui-library";
|
|
9
|
+
import { storeToRefs as gt } from "pinia";
|
|
10
|
+
import { P, f as kt, a as Ct } from "./purchase-order-transaction-type-CUtdDhYo.js";
|
|
11
|
+
import { _ as je } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BRijSilS.js";
|
|
12
|
+
import { useRouter as wt } from "vue-router";
|
|
13
|
+
import { u as Tt } from "./supplier-Ed-Bva_-.js";
|
|
14
|
+
const Ft = { class: "flex flex-col" }, $t = { class: "flex flex-col" }, St = { class: "flex-1" }, Rt = { class: "flex items-center" }, It = { class: "flex-1" }, Mt = { class: "flex-1" }, Dt = /* @__PURE__ */ W({
|
|
15
|
+
__name: "FmMinMaxInput",
|
|
16
|
+
props: {
|
|
17
|
+
rules: {},
|
|
18
|
+
label: {},
|
|
19
|
+
minPlaceholder: {},
|
|
20
|
+
maxPlaceholder: {},
|
|
21
|
+
modelValue: {},
|
|
22
|
+
precision: {},
|
|
23
|
+
minLength: {},
|
|
24
|
+
maxLength: {},
|
|
25
|
+
inputmode: {},
|
|
26
|
+
type: {},
|
|
27
|
+
readonly: { type: Boolean },
|
|
28
|
+
labelMark: {},
|
|
29
|
+
prependIcon: {},
|
|
30
|
+
appendIcon: {},
|
|
31
|
+
showValidBorder: { type: Boolean },
|
|
32
|
+
labelInfo: {},
|
|
33
|
+
showWordCount: { type: Boolean },
|
|
34
|
+
invalid: { type: Boolean },
|
|
35
|
+
autofocus: { type: Boolean },
|
|
36
|
+
formatter: { type: Function },
|
|
37
|
+
decimal: {},
|
|
38
|
+
datalist: {},
|
|
39
|
+
shiftDatalist: { type: Boolean },
|
|
40
|
+
datalistMaxHeight: {},
|
|
41
|
+
datalistMinHeight: {},
|
|
42
|
+
offsetDatalist: {},
|
|
43
|
+
datalistPlacement: {},
|
|
44
|
+
datalistZIndex: {},
|
|
45
|
+
datalistWidth: {},
|
|
46
|
+
disabled: { type: Boolean },
|
|
47
|
+
focused: { type: Boolean },
|
|
48
|
+
helperText: {},
|
|
49
|
+
helperState: {}
|
|
50
|
+
},
|
|
51
|
+
setup(u) {
|
|
52
|
+
const b = u, m = Be("modelValue"), l = lt();
|
|
53
|
+
Ve(() => {
|
|
54
|
+
const { min: n, max: t } = m ?? {};
|
|
55
|
+
if (!(!n || !t) && n.precision !== t.precision) {
|
|
56
|
+
const o = Math.max(n.precision, t.precision), r = me(n, o), h = me(t, o);
|
|
57
|
+
m.min = r, m.max = h;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const f = M(() => {
|
|
61
|
+
const { min: n, max: t } = m ?? {};
|
|
62
|
+
return Math.max((n == null ? void 0 : n.precision) ?? 0, (t == null ? void 0 : t.precision) ?? 0, b.precision ?? 0);
|
|
63
|
+
}), g = M(() => ({
|
|
64
|
+
...m
|
|
65
|
+
})), k = (n) => {
|
|
66
|
+
if (!n) return "";
|
|
67
|
+
const t = rt(n), o = f.value, r = me(t, o);
|
|
68
|
+
return it(
|
|
69
|
+
+E(r),
|
|
70
|
+
r.precision
|
|
71
|
+
);
|
|
72
|
+
}, i = U(k(m.min)), s = U(k(m.max));
|
|
73
|
+
ye([i, s], ([n, t]) => {
|
|
74
|
+
const o = m ?? {}, r = l(n), h = l(t), y = f.value;
|
|
75
|
+
if (n !== "" && r === !0) {
|
|
76
|
+
const v = Ie(+n, y);
|
|
77
|
+
o.min = v;
|
|
78
|
+
} else
|
|
79
|
+
o.min = null;
|
|
80
|
+
if (t !== "" && h === !0) {
|
|
81
|
+
const v = Ie(+t, y);
|
|
82
|
+
o.max = v;
|
|
83
|
+
} else
|
|
84
|
+
o.max = null;
|
|
85
|
+
m.min = o.min, m.max = o.max;
|
|
86
|
+
});
|
|
87
|
+
const d = Symbol.for("fm:form-state"), p = Ge(d, null), _ = M(() => b.disabled ?? (p == null ? void 0 : p.getDisabled()) ?? !1), C = U(), T = U(), w = U(!1), S = U(!1), A = M(() => w.value || S.value), L = M(() => [...[
|
|
88
|
+
function() {
|
|
89
|
+
return typeof l(i.value) == "string" || typeof l(s.value) == "string" ? "Must be a number" : !0;
|
|
90
|
+
},
|
|
91
|
+
function(o) {
|
|
92
|
+
return !o || !o.min || !o.max ? !0 : +E(o.min) > +E(o.max) ? "Min must be less than or equal to max" : !0;
|
|
93
|
+
}
|
|
94
|
+
], ...b.rules ?? []]);
|
|
95
|
+
return (n, t) => {
|
|
96
|
+
const o = I("FmLabel"), r = I("FmField"), h = I("FmFormGroup");
|
|
97
|
+
return R(), N("div", Ft, [
|
|
98
|
+
a("div", $t, [
|
|
99
|
+
a("div", St, [
|
|
100
|
+
c(o, {
|
|
101
|
+
label: n.label,
|
|
102
|
+
disabled: n.disabled,
|
|
103
|
+
required: n.labelMark === "required",
|
|
104
|
+
optional: n.labelMark === "optional"
|
|
105
|
+
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
106
|
+
]),
|
|
107
|
+
c(r, { focused: A.value }, {
|
|
108
|
+
default: B(() => [
|
|
109
|
+
a("div", Rt, [
|
|
110
|
+
we(n.$slots, "prepend"),
|
|
111
|
+
t[6] || (t[6] = a("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
112
|
+
a("div", It, [
|
|
113
|
+
Te(a("input", {
|
|
114
|
+
type: "text",
|
|
115
|
+
ref_key: "minInputRef",
|
|
116
|
+
ref: C,
|
|
117
|
+
onFocus: t[0] || (t[0] = () => w.value = !0),
|
|
118
|
+
onBlur: t[1] || (t[1] = () => w.value = !1),
|
|
119
|
+
"onUpdate:modelValue": t[2] || (t[2] = (y) => i.value = y),
|
|
120
|
+
class: ce({
|
|
121
|
+
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
122
|
+
"text-fm-color-typo-primary": !_.value,
|
|
123
|
+
"text-fm-color-typo-disabled": _.value
|
|
124
|
+
})
|
|
125
|
+
}, null, 34), [
|
|
126
|
+
[Fe, i.value]
|
|
127
|
+
])
|
|
128
|
+
]),
|
|
129
|
+
t[7] || (t[7] = a("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
130
|
+
t[8] || (t[8] = a("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
|
|
131
|
+
a("div", Mt, [
|
|
132
|
+
Te(a("input", {
|
|
133
|
+
type: "text",
|
|
134
|
+
ref_key: "maxInputRef",
|
|
135
|
+
ref: T,
|
|
136
|
+
onFocus: t[3] || (t[3] = () => S.value = !0),
|
|
137
|
+
onBlur: t[4] || (t[4] = () => S.value = !1),
|
|
138
|
+
"onUpdate:modelValue": t[5] || (t[5] = (y) => s.value = y),
|
|
139
|
+
class: ce({
|
|
140
|
+
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
141
|
+
"text-fm-color-typo-primary": !_.value,
|
|
142
|
+
"text-fm-color-typo-disabled": _.value
|
|
143
|
+
})
|
|
144
|
+
}, null, 34), [
|
|
145
|
+
[Fe, s.value]
|
|
146
|
+
])
|
|
147
|
+
]),
|
|
148
|
+
we(n.$slots, "append")
|
|
149
|
+
])
|
|
150
|
+
]),
|
|
151
|
+
_: 3
|
|
152
|
+
}, 8, ["focused"])
|
|
153
|
+
]),
|
|
154
|
+
c(h, {
|
|
155
|
+
class: "flex-1",
|
|
156
|
+
"model-value": g.value,
|
|
157
|
+
info: n.labelInfo,
|
|
158
|
+
rules: L.value,
|
|
159
|
+
"helper-text": n.helperText,
|
|
160
|
+
"helper-state": n.helperState
|
|
161
|
+
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
162
|
+
]);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
function At() {
|
|
167
|
+
return function(b) {
|
|
168
|
+
return !b || !b.min || !b.max ? "Required" : !0;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function Vt(u, b) {
|
|
172
|
+
return function(l) {
|
|
173
|
+
return !l || !l.min || !l.max ? !0 : +E(l.min) < u ? `Must be between ${u} and ${b}` : +E(l.max) > b ? `Must be between ${u} and ${b}` : !0;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
var $ = /* @__PURE__ */ ((u) => (u.Code = "Code", u.Name = "Name", u.DefaultAmount = "DefaultAmount", u.Limit = "Limit", u.MinimumAmount = "MinimumAmount", u.Step = "Step", u.Cost = "Cost", u.Delete = "Delete", u))($ || {});
|
|
177
|
+
const Ot = () => {
|
|
178
|
+
const { t: u } = Y();
|
|
179
|
+
return D(
|
|
180
|
+
je,
|
|
181
|
+
{
|
|
182
|
+
zIndex: 50,
|
|
183
|
+
class: "whitespace-nowrap"
|
|
184
|
+
},
|
|
185
|
+
u("inventory.transfer.form.items.table.Cost", [Ue()])
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
function Pt(u) {
|
|
189
|
+
const { t: b } = Y(), m = Ye({}), { breakpoints: l } = ze();
|
|
190
|
+
Ve(() => {
|
|
191
|
+
for (const i of u.items) {
|
|
192
|
+
if (!i.totalCost)
|
|
193
|
+
continue;
|
|
194
|
+
const s = re(i.sku, i.quantity, i.measurement, {
|
|
195
|
+
supplier: u.supplier
|
|
196
|
+
}), d = i.totalCost ?? Me.reset();
|
|
197
|
+
s ? m[i.sku._id] = s.amount !== d.amount || s.precision !== d.precision : m[i.sku._id] = !0;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
function f(i) {
|
|
201
|
+
var d, p, _, C, T, w, S;
|
|
202
|
+
return !!(((p = (d = i.defaultCost) == null ? void 0 : d.costPerUnit) == null ? void 0 : p.amount) ?? ((S = (w = (T = (C = (_ = u.supplier) == null ? void 0 : _.supplyItems) == null ? void 0 : C.find((A) => A.skuId === i._id)) == null ? void 0 : T.defaultCost) == null ? void 0 : w.costPerUnit) == null ? void 0 : S.amount));
|
|
203
|
+
}
|
|
204
|
+
const g = [
|
|
205
|
+
{
|
|
206
|
+
id: "Code",
|
|
207
|
+
header: () => b("inventory.transfer.form.items.table.Code"),
|
|
208
|
+
accessorKey: "code",
|
|
209
|
+
size: 96,
|
|
210
|
+
cell(i) {
|
|
211
|
+
const s = i.row.original;
|
|
212
|
+
return D(G.FmTextField, {
|
|
213
|
+
modelValue: s.code,
|
|
214
|
+
"onUpdate:modelValue": (d) => {
|
|
215
|
+
u.updateItem({
|
|
216
|
+
...s,
|
|
217
|
+
code: d
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
key: s.sku._id,
|
|
221
|
+
rules: [pe()],
|
|
222
|
+
labelMark: "required"
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
enableSorting: !1
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: "Name",
|
|
229
|
+
header: () => b("inventory.transfer.form.items.table.Name"),
|
|
230
|
+
minSize: 300,
|
|
231
|
+
cell(i) {
|
|
232
|
+
const s = i.row.original;
|
|
233
|
+
return D(G.FmTextField, {
|
|
234
|
+
modelValue: s.name,
|
|
235
|
+
"onUpdate:modelValue": (d) => {
|
|
236
|
+
u.updateItem({
|
|
237
|
+
...s,
|
|
238
|
+
name: d
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
key: s.sku._id,
|
|
242
|
+
rules: [pe()],
|
|
243
|
+
labelMark: "required"
|
|
244
|
+
});
|
|
245
|
+
},
|
|
246
|
+
enableSorting: !1
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "DefaultAmount",
|
|
250
|
+
header: () => b("inventory.transfer.form.items.table.DefaultAmount2"),
|
|
251
|
+
minSize: 150,
|
|
252
|
+
cell(i) {
|
|
253
|
+
const s = i.row.original;
|
|
254
|
+
return D(ut, {
|
|
255
|
+
style: {
|
|
256
|
+
flex: "1 1 0%"
|
|
257
|
+
},
|
|
258
|
+
modelValue: {
|
|
259
|
+
amount: s.quantity ?? { amount: 1, precision: 0 },
|
|
260
|
+
measurement: s.measurement ?? null
|
|
261
|
+
},
|
|
262
|
+
disabled: u.disabled,
|
|
263
|
+
key: s.sku._id,
|
|
264
|
+
unit: s.sku.unit,
|
|
265
|
+
"onUpdate:modelValue": (d) => {
|
|
266
|
+
u.updateItem({
|
|
267
|
+
...s,
|
|
268
|
+
quantity: d.amount,
|
|
269
|
+
measurement: d.measurement
|
|
270
|
+
});
|
|
271
|
+
},
|
|
272
|
+
rules: [
|
|
273
|
+
dt(
|
|
274
|
+
+E(
|
|
275
|
+
s.minimumQuantity ?? {
|
|
276
|
+
amount: 1,
|
|
277
|
+
precision: de(s.sku.unit, s.measurement)
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
),
|
|
281
|
+
mt(
|
|
282
|
+
s.maximumQuantity ? +E(s.maximumQuantity) : 1 / 0
|
|
283
|
+
)
|
|
284
|
+
],
|
|
285
|
+
applyDefaultRules: !0
|
|
286
|
+
});
|
|
287
|
+
},
|
|
288
|
+
enableSorting: !1
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: "Limit",
|
|
292
|
+
header: () => "Limit",
|
|
293
|
+
// TODO: i18n,
|
|
294
|
+
minSize: 250,
|
|
295
|
+
cell(i) {
|
|
296
|
+
const s = i.row.original;
|
|
297
|
+
return D(Dt, {
|
|
298
|
+
style: {
|
|
299
|
+
flex: "1 1 0%"
|
|
300
|
+
},
|
|
301
|
+
modelValue: {
|
|
302
|
+
min: s.minimumQuantity,
|
|
303
|
+
max: s.maximumQuantity
|
|
304
|
+
},
|
|
305
|
+
disabled: u.disabled,
|
|
306
|
+
key: s.sku._id,
|
|
307
|
+
unit: s.sku.unit,
|
|
308
|
+
"onUpdate:modelValue": (d) => {
|
|
309
|
+
const p = { ...s };
|
|
310
|
+
d != null && d.min && (p.minimumQuantity = d.min), d != null && d.max && (p.maximumQuantity = d.max), u.updateItem(p);
|
|
311
|
+
},
|
|
312
|
+
rules: [
|
|
313
|
+
At(),
|
|
314
|
+
Vt(
|
|
315
|
+
+E({
|
|
316
|
+
amount: 1,
|
|
317
|
+
precision: de(s.sku.unit, s.measurement)
|
|
318
|
+
}),
|
|
319
|
+
1 / 0
|
|
320
|
+
)
|
|
321
|
+
],
|
|
322
|
+
disableUnit: !0,
|
|
323
|
+
applyDefaultRules: !0
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
id: "Step",
|
|
329
|
+
header: () => b("inventory.transfer.form.items.table.Step"),
|
|
330
|
+
minSize: 100,
|
|
331
|
+
cell(i) {
|
|
332
|
+
const s = i.row.original;
|
|
333
|
+
return D(G.FmTextField, {
|
|
334
|
+
modelValue: E(s.quantityStep ?? Me.reset(), !1),
|
|
335
|
+
key: s.sku._id,
|
|
336
|
+
"onUpdate:modelValue": (d) => {
|
|
337
|
+
u.updateItem({
|
|
338
|
+
...s,
|
|
339
|
+
quantityStep: De(+d)
|
|
340
|
+
});
|
|
341
|
+
},
|
|
342
|
+
rules: [
|
|
343
|
+
fe({
|
|
344
|
+
amount: 1,
|
|
345
|
+
precision: de(s.sku.unit, s.measurement)
|
|
346
|
+
}),
|
|
347
|
+
Ae(s.sku.unit, s.measurement)
|
|
348
|
+
]
|
|
349
|
+
});
|
|
350
|
+
},
|
|
351
|
+
enableSorting: !1
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: "Cost",
|
|
355
|
+
header: Ot,
|
|
356
|
+
size: 180,
|
|
357
|
+
cell(i) {
|
|
358
|
+
const s = i.row.original, d = f(s.sku), p = l.value.xs || l.value.sm;
|
|
359
|
+
return !m[s.sku._id] && d ? D(
|
|
360
|
+
"div",
|
|
361
|
+
{
|
|
362
|
+
class: "flex gap-4 fm-typo-en-body-md-400 items-center",
|
|
363
|
+
key: s.sku._id
|
|
364
|
+
},
|
|
365
|
+
[
|
|
366
|
+
D(G.FmButton, {
|
|
367
|
+
prependIcon: "edit",
|
|
368
|
+
variant: _t.Tertiary,
|
|
369
|
+
onClick() {
|
|
370
|
+
u.updateItem({
|
|
371
|
+
...s,
|
|
372
|
+
totalCost: re(s.sku, s.quantity, s.measurement, {
|
|
373
|
+
supplier: u.supplier
|
|
374
|
+
})
|
|
375
|
+
}), m[s.sku._id] = !0;
|
|
376
|
+
},
|
|
377
|
+
disabled: u.disabled
|
|
378
|
+
}),
|
|
379
|
+
D(
|
|
380
|
+
"div",
|
|
381
|
+
{
|
|
382
|
+
class: "flex flex-col"
|
|
383
|
+
},
|
|
384
|
+
[
|
|
385
|
+
D(
|
|
386
|
+
"span",
|
|
387
|
+
{
|
|
388
|
+
class: [u.disabled ? "text-fm-color-typo-disabled" : ""]
|
|
389
|
+
},
|
|
390
|
+
p ? Le(
|
|
391
|
+
re(s.sku, s.quantity, s.measurement, {
|
|
392
|
+
supplier: u.supplier
|
|
393
|
+
})
|
|
394
|
+
) : E(
|
|
395
|
+
re(s.sku, s.quantity, s.measurement, {
|
|
396
|
+
supplier: u.supplier
|
|
397
|
+
})
|
|
398
|
+
)
|
|
399
|
+
),
|
|
400
|
+
D(
|
|
401
|
+
"span",
|
|
402
|
+
{
|
|
403
|
+
class: [
|
|
404
|
+
"fm-typo-en-body-sm-400",
|
|
405
|
+
u.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
406
|
+
]
|
|
407
|
+
},
|
|
408
|
+
b("inventory.transfer.form.items.autoCalculated")
|
|
409
|
+
)
|
|
410
|
+
]
|
|
411
|
+
)
|
|
412
|
+
]
|
|
413
|
+
) : D(
|
|
414
|
+
G.FmTextField,
|
|
415
|
+
{
|
|
416
|
+
modelValue: E(s.totalCost ?? { amount: 0, precision: 0 }),
|
|
417
|
+
key: s.sku._id,
|
|
418
|
+
"onUpdate:modelValue": (_) => {
|
|
419
|
+
u.updateItem({
|
|
420
|
+
...s,
|
|
421
|
+
totalCost: {
|
|
422
|
+
...De(+_),
|
|
423
|
+
currency: ct()
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
},
|
|
427
|
+
rules: [fe(0), Ae(2)]
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
prepend() {
|
|
431
|
+
return p ? D(
|
|
432
|
+
"div",
|
|
433
|
+
{
|
|
434
|
+
class: [
|
|
435
|
+
"text-fm-typo-en-body-lg-400",
|
|
436
|
+
u.disabled ? "text-fm-color-typo-disabled" : ""
|
|
437
|
+
]
|
|
438
|
+
},
|
|
439
|
+
Ue()
|
|
440
|
+
) : null;
|
|
441
|
+
},
|
|
442
|
+
append() {
|
|
443
|
+
return d ? D(G.FmButton, {
|
|
444
|
+
prependIcon: "close",
|
|
445
|
+
variant: "tertiary",
|
|
446
|
+
onClick() {
|
|
447
|
+
u.updateItem({
|
|
448
|
+
...s,
|
|
449
|
+
totalCost: null
|
|
450
|
+
}), m[s.sku._id] = !1;
|
|
451
|
+
},
|
|
452
|
+
disabled: u.disabled
|
|
453
|
+
}) : null;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
);
|
|
457
|
+
},
|
|
458
|
+
enableSorting: !1
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
id: "Delete",
|
|
462
|
+
header: "",
|
|
463
|
+
cell(i) {
|
|
464
|
+
const s = i.row.original;
|
|
465
|
+
return D(G.FmButton, {
|
|
466
|
+
class: "delete-button",
|
|
467
|
+
key: s.sku._id,
|
|
468
|
+
type: "button",
|
|
469
|
+
icon: "delete",
|
|
470
|
+
variant: "tertiary",
|
|
471
|
+
size: "md",
|
|
472
|
+
disabled: u.disabled,
|
|
473
|
+
onClick: () => {
|
|
474
|
+
u.deleteItem(s);
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
},
|
|
478
|
+
enableSorting: !1,
|
|
479
|
+
size: 40,
|
|
480
|
+
meta: {
|
|
481
|
+
cellClass: "",
|
|
482
|
+
headerClass: ""
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
];
|
|
486
|
+
return {
|
|
487
|
+
columnDefs: M(() => qe().enableTotalCost && u.transferType === P.PURCHASE ? g : g.filter((s) => s.id !== "Cost"))
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
const Bt = { class: "flex flex-col gap-8 py-16" }, Lt = { class: "flex items-center" }, Ut = { class: "flex-1 flex gap-1 items-center" }, qt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Nt = { class: "flex gap-8 w-full" }, zt = { class: "flex-1 flex flex-col gap-4" }, Ht = { class: "flex-1 flex flex-col gap-4" }, jt = { class: "flex gap-8 w-full" }, Qt = { class: "flex-1 flex flex-col gap-4" }, Gt = { class: "flex-1 flex flex-col gap-4" }, Yt = { class: "flex gap-8 w-full" }, Wt = { class: "flex-1 flex flex-col gap-4" }, Kt = { class: "flex-1 flex flex-col gap-4" }, Zt = /* @__PURE__ */ W({
|
|
491
|
+
__name: "TransferTemplateItem",
|
|
492
|
+
props: {
|
|
493
|
+
cellByColId: {},
|
|
494
|
+
row: {}
|
|
495
|
+
},
|
|
496
|
+
setup(u) {
|
|
497
|
+
const { t: b } = Y();
|
|
498
|
+
return (m, l) => {
|
|
499
|
+
var g, k, i, s, d, p, _, C, T, w, S, A, L, n, t, o, r, h, y, v, V, x, O, z, K, Z, J, X, H, ee, te, oe, se, j, ne;
|
|
500
|
+
const f = I("FmLabel");
|
|
501
|
+
return R(), N("div", Bt, [
|
|
502
|
+
a("div", Lt, [
|
|
503
|
+
a("div", Ut, [
|
|
504
|
+
a("span", qt, " (" + F(m.row.original.sku.code) + ") ", 1),
|
|
505
|
+
a("span", Et, F(m.row.original.sku.name), 1)
|
|
506
|
+
]),
|
|
507
|
+
a("div", null, [
|
|
508
|
+
c(e(q), {
|
|
509
|
+
render: (i = (k = (g = m.cellByColId.Delete) == null ? void 0 : g.column) == null ? void 0 : k.columnDef) == null ? void 0 : i.cell,
|
|
510
|
+
props: (d = (s = m.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : d.call(s)
|
|
511
|
+
}, null, 8, ["render", "props"])
|
|
512
|
+
])
|
|
513
|
+
]),
|
|
514
|
+
a("div", Nt, [
|
|
515
|
+
a("div", zt, [
|
|
516
|
+
c(f, {
|
|
517
|
+
label: e(b)(`inventory.transfer.form.items.table.${e($).Code}`)
|
|
518
|
+
}, null, 8, ["label"]),
|
|
519
|
+
c(e(q), {
|
|
520
|
+
render: (C = (_ = (p = m.cellByColId[e($).Code]) == null ? void 0 : p.column) == null ? void 0 : _.columnDef) == null ? void 0 : C.cell,
|
|
521
|
+
props: (w = (T = m.cellByColId[e($).Code]) == null ? void 0 : T.getContext) == null ? void 0 : w.call(T)
|
|
522
|
+
}, null, 8, ["render", "props"]),
|
|
523
|
+
l[0] || (l[0] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
524
|
+
]),
|
|
525
|
+
a("div", Ht, [
|
|
526
|
+
c(f, {
|
|
527
|
+
label: e(b)(`inventory.transfer.form.items.table.${e($).Name}`)
|
|
528
|
+
}, null, 8, ["label"]),
|
|
529
|
+
c(e(q), {
|
|
530
|
+
render: (L = (A = (S = m.cellByColId[e($).Name]) == null ? void 0 : S.column) == null ? void 0 : A.columnDef) == null ? void 0 : L.cell,
|
|
531
|
+
props: (t = (n = m.cellByColId[e($).Name]) == null ? void 0 : n.getContext) == null ? void 0 : t.call(n)
|
|
532
|
+
}, null, 8, ["render", "props"]),
|
|
533
|
+
l[1] || (l[1] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
534
|
+
])
|
|
535
|
+
]),
|
|
536
|
+
a("div", jt, [
|
|
537
|
+
a("div", Qt, [
|
|
538
|
+
c(f, {
|
|
539
|
+
label: e(b)(`inventory.transfer.form.items.table.${e($).Limit}`)
|
|
540
|
+
}, null, 8, ["label"]),
|
|
541
|
+
c(e(q), {
|
|
542
|
+
render: (h = (r = (o = m.cellByColId[e($).Limit]) == null ? void 0 : o.column) == null ? void 0 : r.columnDef) == null ? void 0 : h.cell,
|
|
543
|
+
props: (v = (y = m.cellByColId[e($).Limit]) == null ? void 0 : y.getContext) == null ? void 0 : v.call(y)
|
|
544
|
+
}, null, 8, ["render", "props"]),
|
|
545
|
+
l[2] || (l[2] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
546
|
+
]),
|
|
547
|
+
a("div", Gt, [
|
|
548
|
+
c(f, {
|
|
549
|
+
label: e(b)(`inventory.transfer.form.items.table.${e($).Step}`)
|
|
550
|
+
}, null, 8, ["label"]),
|
|
551
|
+
c(e(q), {
|
|
552
|
+
render: (O = (x = (V = m.cellByColId[e($).Step]) == null ? void 0 : V.column) == null ? void 0 : x.columnDef) == null ? void 0 : O.cell,
|
|
553
|
+
props: (K = (z = m.cellByColId[e($).Step]) == null ? void 0 : z.getContext) == null ? void 0 : K.call(z)
|
|
554
|
+
}, null, 8, ["render", "props"]),
|
|
555
|
+
l[3] || (l[3] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
556
|
+
])
|
|
557
|
+
]),
|
|
558
|
+
a("div", Yt, [
|
|
559
|
+
a("div", Wt, [
|
|
560
|
+
c(f, {
|
|
561
|
+
label: e(b)(`inventory.transfer.form.items.table.${e($).DefaultAmount}`)
|
|
562
|
+
}, null, 8, ["label"]),
|
|
563
|
+
c(e(q), {
|
|
564
|
+
render: (X = (J = (Z = m.cellByColId[e($).DefaultAmount]) == null ? void 0 : Z.column) == null ? void 0 : J.columnDef) == null ? void 0 : X.cell,
|
|
565
|
+
props: (ee = (H = m.cellByColId[e($).DefaultAmount]) == null ? void 0 : H.getContext) == null ? void 0 : ee.call(H)
|
|
566
|
+
}, null, 8, ["render", "props"]),
|
|
567
|
+
l[4] || (l[4] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
568
|
+
]),
|
|
569
|
+
a("div", Kt, [
|
|
570
|
+
c(je, { "z-index": 50 }, {
|
|
571
|
+
default: B(() => [
|
|
572
|
+
c(f, {
|
|
573
|
+
label: e(b)(`inventory.transfer.form.items.table.${e($).Cost}2`)
|
|
574
|
+
}, null, 8, ["label"])
|
|
575
|
+
]),
|
|
576
|
+
_: 1
|
|
577
|
+
}),
|
|
578
|
+
c(e(q), {
|
|
579
|
+
render: (se = (oe = (te = m.cellByColId[e($).Cost]) == null ? void 0 : te.column) == null ? void 0 : oe.columnDef) == null ? void 0 : se.cell,
|
|
580
|
+
props: (ne = (j = m.cellByColId[e($).Cost]) == null ? void 0 : j.getContext) == null ? void 0 : ne.call(j)
|
|
581
|
+
}, null, 8, ["render", "props"]),
|
|
582
|
+
l[5] || (l[5] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
583
|
+
])
|
|
584
|
+
])
|
|
585
|
+
]);
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
}), Jt = { class: "flex flex-col gap-16" }, Xt = { class: "flex flex-col gap-24" }, eo = { class: "flex flex-col gap-16" }, to = { class: "flex" }, oo = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, so = /* @__PURE__ */ W({
|
|
589
|
+
__name: "TransferTemplateForm",
|
|
590
|
+
props: {
|
|
591
|
+
modelValue: {},
|
|
592
|
+
disabled: { type: Boolean }
|
|
593
|
+
},
|
|
594
|
+
setup(u, { expose: b }) {
|
|
595
|
+
const m = u, l = Be(), { t: f } = Y(), g = Ee(), k = pt(), i = Tt();
|
|
596
|
+
ye(
|
|
597
|
+
() => m.modelValue,
|
|
598
|
+
(n) => {
|
|
599
|
+
console.log("TransferTemplateForm.model", n);
|
|
600
|
+
}
|
|
601
|
+
), g.watchLocation(async () => {
|
|
602
|
+
location && (l.purchaseOrder.supplier || (l.purchaseOrder.supplier = i.suppliers.find((n) => n) ?? l.purchaseOrder.supplier));
|
|
603
|
+
});
|
|
604
|
+
const s = xt(), d = ot(
|
|
605
|
+
() => l.purchaseOrder,
|
|
606
|
+
(n) => {
|
|
607
|
+
l.purchaseOrder = {
|
|
608
|
+
...l.purchaseOrder,
|
|
609
|
+
...n
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
), p = M({
|
|
613
|
+
get() {
|
|
614
|
+
var n, t;
|
|
615
|
+
return typeof ((t = (n = l.purchaseOrder) == null ? void 0 : n.supplier) == null ? void 0 : t.internal) == "string" ? P.TRANSFER : P.PURCHASE;
|
|
616
|
+
},
|
|
617
|
+
set(n) {
|
|
618
|
+
var o, r;
|
|
619
|
+
const t = typeof ((r = (o = l.purchaseOrder) == null ? void 0 : o.supplier) == null ? void 0 : r.internal) == "string" ? P.TRANSFER : P.PURCHASE;
|
|
620
|
+
n !== t && (l.purchaseOrder.supplier = n === P.PURCHASE ? d.locationOptionsTypePurchase.value[0] : d.locationOptionsTypeTransfer.value[0]);
|
|
621
|
+
}
|
|
622
|
+
}), _ = M(() => d.transferLocationOptions.value), C = M({
|
|
623
|
+
get() {
|
|
624
|
+
return l.purchaseOrder.supplier._id;
|
|
625
|
+
},
|
|
626
|
+
set(n) {
|
|
627
|
+
d.transferLocationModel.value = n;
|
|
628
|
+
}
|
|
629
|
+
}), T = M({
|
|
630
|
+
get() {
|
|
631
|
+
return l.purchaseOrder.remark ?? void 0;
|
|
632
|
+
},
|
|
633
|
+
set(n) {
|
|
634
|
+
l.purchaseOrder.remark = n;
|
|
635
|
+
}
|
|
636
|
+
}), w = U();
|
|
637
|
+
b({
|
|
638
|
+
validateInputs: () => {
|
|
639
|
+
var n, t;
|
|
640
|
+
(t = (n = w.value) == null ? void 0 : n.validateInputs) == null || t.call(n);
|
|
641
|
+
},
|
|
642
|
+
resetInputsValidation: () => {
|
|
643
|
+
var n, t;
|
|
644
|
+
(t = (n = w.value) == null ? void 0 : n.resetInputsValidation) == null || t.call(n);
|
|
645
|
+
},
|
|
646
|
+
resetInputs: () => {
|
|
647
|
+
var n, t;
|
|
648
|
+
(t = (n = w.value) == null ? void 0 : n.resetInputs) == null || t.call(n);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
const S = Pt({
|
|
652
|
+
updateItem: (n) => {
|
|
653
|
+
l.purchaseOrder.items = l.purchaseOrder.items.map((t) => t.sku._id !== n.sku._id ? t : n);
|
|
654
|
+
},
|
|
655
|
+
deleteItem: (n) => {
|
|
656
|
+
l.purchaseOrder.items = l.purchaseOrder.items.filter(
|
|
657
|
+
(t) => t.sku._id !== n.sku._id
|
|
658
|
+
);
|
|
659
|
+
},
|
|
660
|
+
get supplier() {
|
|
661
|
+
return l.purchaseOrder.supplier;
|
|
662
|
+
},
|
|
663
|
+
get items() {
|
|
664
|
+
return l.purchaseOrder.items;
|
|
665
|
+
},
|
|
666
|
+
get transferType() {
|
|
667
|
+
return p.value;
|
|
668
|
+
},
|
|
669
|
+
get disabled() {
|
|
670
|
+
return m.disabled;
|
|
671
|
+
}
|
|
672
|
+
}), A = M(() => S.columnDefs.value);
|
|
673
|
+
function L() {
|
|
674
|
+
const n = k.skus.map((o) => ({
|
|
675
|
+
label: o.name,
|
|
676
|
+
sublabel: o.code,
|
|
677
|
+
value: o
|
|
678
|
+
})), t = n.filter((o) => {
|
|
679
|
+
var r;
|
|
680
|
+
return (r = l.purchaseOrder.items) == null ? void 0 : r.find((h) => h.sku._id === o.value._id);
|
|
681
|
+
}).map((o) => o.value);
|
|
682
|
+
s.open({
|
|
683
|
+
title: f("inventory.transfer.form.items.selectItem"),
|
|
684
|
+
closeButton: !0,
|
|
685
|
+
contentComponent: ft,
|
|
686
|
+
contentComponentProps: {
|
|
687
|
+
modelValue: t,
|
|
688
|
+
items: n
|
|
689
|
+
},
|
|
690
|
+
primaryActions: {
|
|
691
|
+
text: f("common.confirm"),
|
|
692
|
+
close: !0
|
|
693
|
+
},
|
|
694
|
+
secondaryActions: {
|
|
695
|
+
text: f("common.close"),
|
|
696
|
+
close: !0,
|
|
697
|
+
variant: "tertiary"
|
|
698
|
+
}
|
|
699
|
+
}).onPrimary((o) => {
|
|
700
|
+
const r = l.purchaseOrder.items ?? [], h = o.map((y) => {
|
|
701
|
+
const v = r.find((O) => O.sku._id === y._id);
|
|
702
|
+
if (v)
|
|
703
|
+
return v;
|
|
704
|
+
const V = { amount: 1, precision: de(y.unit) }, x = {
|
|
705
|
+
sku: y,
|
|
706
|
+
code: y.code,
|
|
707
|
+
name: y.name,
|
|
708
|
+
quantity: {
|
|
709
|
+
amount: 1,
|
|
710
|
+
precision: 0
|
|
711
|
+
},
|
|
712
|
+
minimumQuantity: V,
|
|
713
|
+
maximumQuantity: V,
|
|
714
|
+
quantityStep: V
|
|
715
|
+
};
|
|
716
|
+
return p.value == P.PURCHASE && (x.totalCost = re(
|
|
717
|
+
x.sku,
|
|
718
|
+
x.quantity,
|
|
719
|
+
x.measurement,
|
|
720
|
+
{
|
|
721
|
+
supplier: l.purchaseOrder.supplier
|
|
722
|
+
}
|
|
723
|
+
)), x;
|
|
724
|
+
});
|
|
725
|
+
h.sort((y, v) => y.sku.code.localeCompare(v.sku.code)), l.purchaseOrder.items = h;
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
return (n, t) => {
|
|
729
|
+
const o = I("FmTextField"), r = I("FmSelect"), h = I("FmTextarea"), y = I("FmButton"), v = I("FmTable"), V = I("FmForm");
|
|
730
|
+
return R(), Q(V, {
|
|
731
|
+
ref_key: "formRef",
|
|
732
|
+
ref: w,
|
|
733
|
+
class: "flex flex-col gap-32",
|
|
734
|
+
disabled: n.disabled
|
|
735
|
+
}, {
|
|
736
|
+
default: B(() => [
|
|
737
|
+
a("div", Jt, [
|
|
738
|
+
a("div", Xt, [
|
|
739
|
+
c(o, {
|
|
740
|
+
label: e(f)("inventory.transfer.form.name"),
|
|
741
|
+
"label-mark": "required",
|
|
742
|
+
modelValue: e(l).name,
|
|
743
|
+
"onUpdate:modelValue": t[0] || (t[0] = (x) => e(l).name = x),
|
|
744
|
+
rules: [e(pe)()]
|
|
745
|
+
}, null, 8, ["label", "modelValue", "rules"]),
|
|
746
|
+
c(r, {
|
|
747
|
+
label: e(f)("inventory.transfer.form.type.title"),
|
|
748
|
+
"model-value": p.value,
|
|
749
|
+
"onUpdate:modelValue": t[1] || (t[1] = (x) => p.value = x),
|
|
750
|
+
items: [
|
|
751
|
+
{
|
|
752
|
+
label: e(f)(
|
|
753
|
+
`inventory.transfer.form.type.${e(P).PURCHASE.toLocaleLowerCase()}`
|
|
754
|
+
),
|
|
755
|
+
value: e(P).PURCHASE,
|
|
756
|
+
disabled: !e(d).locationOptionsTypePurchase.value.length,
|
|
757
|
+
sublabel: e(d).locationOptionsTypePurchase.value.length ? void 0 : e(f)("inventory.transfer.form.noSupplierAvailable")
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
label: e(f)(
|
|
761
|
+
`inventory.transfer.form.type.${e(P).TRANSFER.toLocaleLowerCase()}`
|
|
762
|
+
),
|
|
763
|
+
value: e(P).TRANSFER,
|
|
764
|
+
disabled: !e(d).locationOptionsTypeTransfer.value.length,
|
|
765
|
+
sublabel: e(d).locationOptionsTypeTransfer.value.length ? void 0 : e(f)("inventory.transfer.form.noLocationAvailable")
|
|
766
|
+
}
|
|
767
|
+
],
|
|
768
|
+
rules: [e(fe)(1)(_.value)]
|
|
769
|
+
}, null, 8, ["label", "model-value", "items", "rules"]),
|
|
770
|
+
c(r, {
|
|
771
|
+
label: p.value === e(P).PURCHASE ? e(f)("inventory.transfer.form.purchaseFrom") : e(f)("inventory.transfer.form.transferFrom"),
|
|
772
|
+
modelValue: C.value,
|
|
773
|
+
"onUpdate:modelValue": t[2] || (t[2] = (x) => C.value = x),
|
|
774
|
+
items: _.value
|
|
775
|
+
}, null, 8, ["label", "modelValue", "items"]),
|
|
776
|
+
c(o, {
|
|
777
|
+
label: e(f)("inventory.transfer.form.reference"),
|
|
778
|
+
"label-mark": "optional",
|
|
779
|
+
modelValue: e(l).purchaseOrder.ref,
|
|
780
|
+
"onUpdate:modelValue": t[3] || (t[3] = (x) => e(l).purchaseOrder.ref = x)
|
|
781
|
+
}, null, 8, ["label", "modelValue"]),
|
|
782
|
+
c(h, {
|
|
783
|
+
label: e(f)("inventory.transfer.form.remark"),
|
|
784
|
+
"label-mark": "optional",
|
|
785
|
+
"max-length": 240,
|
|
786
|
+
modelValue: T.value,
|
|
787
|
+
"onUpdate:modelValue": t[4] || (t[4] = (x) => T.value = x),
|
|
788
|
+
class: ce({ "text-fm-color-typo-disabled": n.disabled })
|
|
789
|
+
}, null, 8, ["label", "modelValue", "class"])
|
|
790
|
+
])
|
|
791
|
+
]),
|
|
792
|
+
a("div", eo, [
|
|
793
|
+
a("div", to, [
|
|
794
|
+
a("div", oo, F(e(f)("inventory.transfer.form.items.title")), 1),
|
|
795
|
+
c(y, {
|
|
796
|
+
disabled: n.disabled,
|
|
797
|
+
label: e(f)("inventory.transfer.form.items.addItem"),
|
|
798
|
+
"prepend-icon": "add",
|
|
799
|
+
variant: "plain",
|
|
800
|
+
class: "border-2 rounded-lg border-fm-color-primary",
|
|
801
|
+
onClick: t[5] || (t[5] = (x) => L()),
|
|
802
|
+
size: "md"
|
|
803
|
+
}, null, 8, ["disabled", "label"])
|
|
804
|
+
]),
|
|
805
|
+
(R(), Q(v, {
|
|
806
|
+
"column-defs": A.value,
|
|
807
|
+
"row-data": e(l).purchaseOrder.items,
|
|
808
|
+
key: e(l).purchaseOrder.items.map((x) => x.sku._id).join("."),
|
|
809
|
+
"hide-footer": ""
|
|
810
|
+
}, {
|
|
811
|
+
"list-row": B((x) => [
|
|
812
|
+
(R(), Q(Ne, {
|
|
813
|
+
row: x,
|
|
814
|
+
key: e(l).purchaseOrder.items.map((O) => O.sku._id).join(".")
|
|
815
|
+
}, {
|
|
816
|
+
default: B((O) => [
|
|
817
|
+
c(Zt, {
|
|
818
|
+
row: x,
|
|
819
|
+
"cell-by-col-id": O
|
|
820
|
+
}, null, 8, ["row", "cell-by-col-id"])
|
|
821
|
+
]),
|
|
822
|
+
_: 2
|
|
823
|
+
}, 1032, ["row"]))
|
|
824
|
+
]),
|
|
825
|
+
_: 1
|
|
826
|
+
}, 8, ["column-defs", "row-data"]))
|
|
827
|
+
])
|
|
828
|
+
]),
|
|
829
|
+
_: 1
|
|
830
|
+
}, 8, ["disabled"]);
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
}), no = { class: "flex items-center" }, ao = { class: "fm-typo-en-title-md-800" }, lo = { class: "flex gap-4" }, ro = /* @__PURE__ */ W({
|
|
834
|
+
__name: "TransferTemplateDialog",
|
|
835
|
+
props: {
|
|
836
|
+
mode: {},
|
|
837
|
+
modelValue: {},
|
|
838
|
+
show: { type: Boolean }
|
|
839
|
+
},
|
|
840
|
+
emits: ["update:show", "submitted"],
|
|
841
|
+
setup(u, { expose: b, emit: m }) {
|
|
842
|
+
var t;
|
|
843
|
+
const l = u, f = m, g = st(), k = ht(), { t: i } = Y(), s = He(l, "show");
|
|
844
|
+
function d() {
|
|
845
|
+
return {
|
|
846
|
+
_id: "",
|
|
847
|
+
name: "",
|
|
848
|
+
purchaseOrder: {
|
|
849
|
+
remark: void 0,
|
|
850
|
+
ref: void 0,
|
|
851
|
+
stockSnapshotId: void 0,
|
|
852
|
+
effectiveAt: void 0,
|
|
853
|
+
items: [],
|
|
854
|
+
supplier: {
|
|
855
|
+
_rev: void 0,
|
|
856
|
+
email: void 0,
|
|
857
|
+
internal: void 0,
|
|
858
|
+
contactName: void 0,
|
|
859
|
+
phoneNumber: void 0,
|
|
860
|
+
registrationNumber: void 0,
|
|
861
|
+
supplyItems: void 0,
|
|
862
|
+
_id: "",
|
|
863
|
+
name: "",
|
|
864
|
+
address: {
|
|
865
|
+
line2: void 0,
|
|
866
|
+
line1: "",
|
|
867
|
+
state: "",
|
|
868
|
+
city: "",
|
|
869
|
+
postcode: "",
|
|
870
|
+
country: ""
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
const p = U(l.modelValue ?? d()), _ = U(((t = l.modelValue) == null ? void 0 : t._id) ?? `${Math.random()}`);
|
|
877
|
+
ye(
|
|
878
|
+
() => l.show,
|
|
879
|
+
(o) => {
|
|
880
|
+
var r;
|
|
881
|
+
o && (p.value = l.modelValue ?? d(), _.value = ((r = l.modelValue) == null ? void 0 : r._id) ?? `${Math.random()}`);
|
|
882
|
+
}
|
|
883
|
+
);
|
|
884
|
+
const C = U(!1), T = M(() => {
|
|
885
|
+
switch (l.mode) {
|
|
886
|
+
case le.READ:
|
|
887
|
+
return "";
|
|
888
|
+
case le.CREATE:
|
|
889
|
+
return i("inventory.transfer.template.create.title");
|
|
890
|
+
case le.UPDATE:
|
|
891
|
+
return i("inventory.transfer.template.update.title");
|
|
892
|
+
}
|
|
893
|
+
return "";
|
|
894
|
+
}), w = U();
|
|
895
|
+
b({
|
|
896
|
+
validateInputs: () => {
|
|
897
|
+
var o, r;
|
|
898
|
+
(r = (o = w.value) == null ? void 0 : o.validateInputs) == null || r.call(o);
|
|
899
|
+
},
|
|
900
|
+
resetInputsValidation: () => {
|
|
901
|
+
var o, r;
|
|
902
|
+
(r = (o = w.value) == null ? void 0 : o.resetInputsValidation) == null || r.call(o);
|
|
903
|
+
},
|
|
904
|
+
resetInputs: () => {
|
|
905
|
+
var o, r;
|
|
906
|
+
(r = (o = w.value) == null ? void 0 : o.resetInputs) == null || r.call(o);
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
async function S() {
|
|
910
|
+
const o = p.value;
|
|
911
|
+
if (o) {
|
|
912
|
+
C.value = !0, (o.purchaseOrder.supplier.internal === "warehouse" || o.purchaseOrder.supplier.internal === "restaurant") && (o.purchaseOrder.items = o.purchaseOrder.items.map(
|
|
913
|
+
({ totalCost: r, ...h }) => h
|
|
914
|
+
));
|
|
915
|
+
try {
|
|
916
|
+
await g.createTemplate(o), await new Promise((r) => setTimeout(r, 1e3)), k.open({
|
|
917
|
+
title: i("inventory.transfer.template.create.success"),
|
|
918
|
+
message: i("inventory.transfer.template.create.successMessage"),
|
|
919
|
+
type: "success"
|
|
920
|
+
}), f("update:show", !1), f("submitted");
|
|
921
|
+
} catch (r) {
|
|
922
|
+
k.open({
|
|
923
|
+
title: i("inventory.transfer.template.create.error"),
|
|
924
|
+
message: i("inventory.transfer.template.create.errorMessage"),
|
|
925
|
+
type: "error"
|
|
926
|
+
}), console.error("Error in creating transfer template", r);
|
|
927
|
+
} finally {
|
|
928
|
+
C.value = !1;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
async function A() {
|
|
933
|
+
const o = p.value;
|
|
934
|
+
if (o) {
|
|
935
|
+
C.value = !0, (o.purchaseOrder.supplier.internal === "warehouse" || o.purchaseOrder.supplier.internal === "restaurant") && (o.purchaseOrder.items = o.purchaseOrder.items.map(
|
|
936
|
+
({ totalCost: r, ...h }) => h
|
|
937
|
+
));
|
|
938
|
+
try {
|
|
939
|
+
await g.updateTemplate(o), await new Promise((r) => setTimeout(r, 1e3)), k.open({
|
|
940
|
+
title: i("inventory.transfer.template.update.success"),
|
|
941
|
+
message: i("inventory.transfer.template.update.successMessage"),
|
|
942
|
+
type: "success"
|
|
943
|
+
}), f("update:show", !1), f("submitted");
|
|
944
|
+
} catch (r) {
|
|
945
|
+
k.open({
|
|
946
|
+
title: i("inventory.transfer.template.update.error"),
|
|
947
|
+
message: i("inventory.transfer.template.update.errorMessage"),
|
|
948
|
+
type: "error"
|
|
949
|
+
}), console.error("Error in updating transfer template", r);
|
|
950
|
+
} finally {
|
|
951
|
+
C.value = !1;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
function L() {
|
|
956
|
+
switch (l.mode) {
|
|
957
|
+
case le.CREATE:
|
|
958
|
+
return S();
|
|
959
|
+
case le.UPDATE:
|
|
960
|
+
return A();
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
function n() {
|
|
964
|
+
var o, r;
|
|
965
|
+
(r = (o = w.value) == null ? void 0 : o.validateInputs) == null || r.call(o);
|
|
966
|
+
}
|
|
967
|
+
return (o, r) => {
|
|
968
|
+
const h = I("FmButton"), y = I("FmSideSheet");
|
|
969
|
+
return R(), Q(y, {
|
|
970
|
+
modelValue: e(s),
|
|
971
|
+
"onUpdate:modelValue": r[2] || (r[2] = (v) => Oe(s) ? s.value = v : null),
|
|
972
|
+
"dismiss-away": "",
|
|
973
|
+
"close-button": "",
|
|
974
|
+
"max-width": 900
|
|
975
|
+
}, {
|
|
976
|
+
"side-sheet-header": B(() => [
|
|
977
|
+
a("div", no, [
|
|
978
|
+
a("div", ao, F(T.value), 1)
|
|
979
|
+
])
|
|
980
|
+
]),
|
|
981
|
+
default: B(() => [
|
|
982
|
+
(R(), Q(so, {
|
|
983
|
+
class: "w-full",
|
|
984
|
+
ref_key: "formRef",
|
|
985
|
+
ref: w,
|
|
986
|
+
onValidationSuccess: L,
|
|
987
|
+
"model-value": p.value,
|
|
988
|
+
"onUpdate:modelValue": r[0] || (r[0] = (v) => p.value = v),
|
|
989
|
+
disabled: C.value,
|
|
990
|
+
key: _.value
|
|
991
|
+
}, null, 8, ["model-value", "disabled"]))
|
|
992
|
+
]),
|
|
993
|
+
"side-sheet-footer": B(() => [
|
|
994
|
+
a("div", lo, [
|
|
995
|
+
c(h, {
|
|
996
|
+
loading: C.value,
|
|
997
|
+
label: e(i)("common.save"),
|
|
998
|
+
onClick: n
|
|
999
|
+
}, null, 8, ["loading", "label"]),
|
|
1000
|
+
c(h, {
|
|
1001
|
+
disabled: C.value,
|
|
1002
|
+
variant: "tertiary",
|
|
1003
|
+
label: e(i)("common.close"),
|
|
1004
|
+
onClick: r[1] || (r[1] = (v) => f("update:show", !1))
|
|
1005
|
+
}, null, 8, ["disabled", "label"])
|
|
1006
|
+
])
|
|
1007
|
+
]),
|
|
1008
|
+
_: 1
|
|
1009
|
+
}, 8, ["modelValue"]);
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
}), io = { class: "flex flex-col gap-16 w-full h-full" }, uo = { class: "flex justify-between" }, mo = { class: "fm-typo-en-body-lg-600" }, co = { class: "flex flex-col gap-8" }, po = { class: "flex flex-col gap-4" }, fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yo = { class: "flex gap-1" }, vo = { class: "fm-typo-en-body-lg-600" }, bo = {
|
|
1013
|
+
key: 0,
|
|
1014
|
+
class: "flex flex-col gap-4"
|
|
1015
|
+
}, _o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xo = { class: "fm-typo-en-body-lg-600" }, ho = { class: "flex flex-col gap-4" }, go = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ko = { class: "fm-typo-en-body-lg-600" }, Co = {
|
|
1016
|
+
key: 1,
|
|
1017
|
+
class: "flex flex-col gap-4"
|
|
1018
|
+
}, wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, To = { class: "fm-typo-en-body-lg-600" }, Fo = {
|
|
1019
|
+
key: 2,
|
|
1020
|
+
class: "flex flex-col gap-4"
|
|
1021
|
+
}, $o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, So = { class: "fm-typo-en-body-lg-600" }, Ro = {
|
|
1022
|
+
key: 3,
|
|
1023
|
+
class: "flex flex-col gap-4"
|
|
1024
|
+
}, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mo = { class: "fm-typo-en-body-lg-600" }, Do = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Ao = { class: "flex flex-col gap-8" }, Vo = { class: "fm-typo-en-body-lg-600" }, Oo = { class: "flex w-full gap-4" }, Po = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Bo = { class: "fm-typo-en-body-lg-600 shrink-0" }, Lo = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Uo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, qo = {
|
|
1025
|
+
key: 0,
|
|
1026
|
+
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1027
|
+
}, Eo = { class: "flex gap-8 xs:flex-col" }, No = /* @__PURE__ */ W({
|
|
1028
|
+
__name: "TransferTemplateDetails",
|
|
1029
|
+
props: {
|
|
1030
|
+
template: {},
|
|
1031
|
+
show: { type: Boolean }
|
|
1032
|
+
},
|
|
1033
|
+
emits: ["update:show", "action:use", "action:edit"],
|
|
1034
|
+
setup(u, { emit: b }) {
|
|
1035
|
+
const m = u, l = b, f = qe(), { t: g } = Y(), k = M(() => {
|
|
1036
|
+
var p;
|
|
1037
|
+
return (p = m.template) == null ? void 0 : p.purchaseOrder;
|
|
1038
|
+
}), i = M(
|
|
1039
|
+
() => {
|
|
1040
|
+
var p, _, C, T;
|
|
1041
|
+
return ((_ = (p = k.value) == null ? void 0 : p.supplier) == null ? void 0 : _.internal) === "restaurant" || ((T = (C = k.value) == null ? void 0 : C.supplier) == null ? void 0 : T.internal) === "warehouse" ? P.TRANSFER : P.PURCHASE;
|
|
1042
|
+
}
|
|
1043
|
+
), s = U(!0), d = He(m, "show");
|
|
1044
|
+
return (p, _) => {
|
|
1045
|
+
var L;
|
|
1046
|
+
const C = I("FmChip"), T = I("FmMenuDivider"), w = I("FmCard"), S = I("FmButton"), A = I("FmSideSheet");
|
|
1047
|
+
return R(), Q(A, {
|
|
1048
|
+
header: e(g)("inventory.transfer.template.details.view", { template: (L = p.template) == null ? void 0 : L.name }),
|
|
1049
|
+
modelValue: e(d),
|
|
1050
|
+
"onUpdate:modelValue": _[2] || (_[2] = (n) => Oe(d) ? d.value = n : null),
|
|
1051
|
+
"dismiss-away": s.value,
|
|
1052
|
+
"close-button": "",
|
|
1053
|
+
"max-width": 500
|
|
1054
|
+
}, {
|
|
1055
|
+
default: B(() => {
|
|
1056
|
+
var n;
|
|
1057
|
+
return [
|
|
1058
|
+
a("div", io, [
|
|
1059
|
+
c(w, {
|
|
1060
|
+
variant: "outlined",
|
|
1061
|
+
class: "flex flex-col gap-8 px-12 py-16"
|
|
1062
|
+
}, {
|
|
1063
|
+
default: B(() => {
|
|
1064
|
+
var t, o, r, h, y, v, V, x, O;
|
|
1065
|
+
return [
|
|
1066
|
+
a("div", uo, [
|
|
1067
|
+
a("div", mo, F(e(g)("inventory.transfer.template.details.templateSummary")), 1),
|
|
1068
|
+
a("div", null, [
|
|
1069
|
+
c(C, {
|
|
1070
|
+
label: e(g)(
|
|
1071
|
+
`inventory.transfer.receiveRequest.details.type.${i.value.toLocaleLowerCase()}`
|
|
1072
|
+
),
|
|
1073
|
+
class: "fm-chip-transfer-info",
|
|
1074
|
+
compact: ""
|
|
1075
|
+
}, null, 8, ["label"])
|
|
1076
|
+
])
|
|
1077
|
+
]),
|
|
1078
|
+
c(T),
|
|
1079
|
+
a("div", co, [
|
|
1080
|
+
a("div", po, [
|
|
1081
|
+
a("div", fo, [
|
|
1082
|
+
a("div", yo, F(e(g)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1083
|
+
]),
|
|
1084
|
+
a("div", vo, F(e(kt)(((t = p.template) == null ? void 0 : t._id) ?? "")), 1)
|
|
1085
|
+
]),
|
|
1086
|
+
(o = k.value) != null && o.effectiveAt ? (R(), N("div", bo, [
|
|
1087
|
+
a("div", _o, F(e(g)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
1088
|
+
a("div", xo, F(e(yt)(new Date((r = k.value) == null ? void 0 : r.effectiveAt))), 1)
|
|
1089
|
+
])) : ae("", !0),
|
|
1090
|
+
a("div", ho, [
|
|
1091
|
+
a("div", go, F(e(g)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
1092
|
+
a("div", ko, F(e(g)(
|
|
1093
|
+
`inventory.transfer.receiveRequest.details.type.${i.value.toLocaleLowerCase("en-US")}`
|
|
1094
|
+
)), 1)
|
|
1095
|
+
]),
|
|
1096
|
+
(y = (h = k.value) == null ? void 0 : h.supplier) != null && y.name ? (R(), N("div", Co, [
|
|
1097
|
+
a("div", wo, F(e(g)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1098
|
+
a("div", To, F((V = (v = k.value) == null ? void 0 : v.supplier) == null ? void 0 : V.name), 1)
|
|
1099
|
+
])) : ae("", !0),
|
|
1100
|
+
(x = k.value) != null && x.ref ? (R(), N("div", Fo, [
|
|
1101
|
+
a("div", $o, F(e(g)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1102
|
+
a("div", So, F(k.value.ref), 1)
|
|
1103
|
+
])) : ae("", !0),
|
|
1104
|
+
(O = k.value) != null && O.remark ? (R(), N("div", Ro, [
|
|
1105
|
+
a("div", Io, F(e(g)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1106
|
+
a("div", Mo, F(k.value.remark), 1)
|
|
1107
|
+
])) : ae("", !0)
|
|
1108
|
+
])
|
|
1109
|
+
];
|
|
1110
|
+
}),
|
|
1111
|
+
_: 1
|
|
1112
|
+
}),
|
|
1113
|
+
a("div", Do, [
|
|
1114
|
+
a("div", Ao, [
|
|
1115
|
+
a("div", Vo, F(e(g)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1116
|
+
(R(!0), N(Pe, null, We(((n = k.value) == null ? void 0 : n.items) ?? [], (t) => (R(), N("div", {
|
|
1117
|
+
key: t.code,
|
|
1118
|
+
class: "flex flex-col"
|
|
1119
|
+
}, [
|
|
1120
|
+
a("div", Oo, [
|
|
1121
|
+
a("div", Po, F(t.name), 1),
|
|
1122
|
+
_[3] || (_[3] = a("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1123
|
+
a("div", Bo, F(e(Ct)(t.quantity, t.sku.unit, t.measurement)), 1)
|
|
1124
|
+
]),
|
|
1125
|
+
a("div", Lo, [
|
|
1126
|
+
a("div", Uo, F(t.code), 1),
|
|
1127
|
+
t.totalCost && e(f).enableTotalCost ? (R(), N("div", qo, " (" + F(e(Le)(t.totalCost)) + ") ", 1)) : ae("", !0)
|
|
1128
|
+
])
|
|
1129
|
+
]))), 128))
|
|
1130
|
+
])
|
|
1131
|
+
])
|
|
1132
|
+
])
|
|
1133
|
+
];
|
|
1134
|
+
}),
|
|
1135
|
+
"side-sheet-footer": B(() => [
|
|
1136
|
+
a("div", Eo, [
|
|
1137
|
+
c(S, {
|
|
1138
|
+
label: e(g)("inventory.transfer.template.use"),
|
|
1139
|
+
onClick: _[0] || (_[0] = (n) => l("action:use"))
|
|
1140
|
+
}, null, 8, ["label"]),
|
|
1141
|
+
c(S, {
|
|
1142
|
+
label: e(g)("common.edit"),
|
|
1143
|
+
onClick: _[1] || (_[1] = (n) => l("action:edit")),
|
|
1144
|
+
variant: "tertiary"
|
|
1145
|
+
}, null, 8, ["label"])
|
|
1146
|
+
])
|
|
1147
|
+
]),
|
|
1148
|
+
_: 1
|
|
1149
|
+
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
}), zo = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 h-full" }, Ho = { class: "flex-1 flex flex-col gap-8" }, jo = { class: "flex flex-col" }, Qo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Go = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Yo = { class: "fm-typo-en-body-lg-400" }, Wo = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, Ko = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ds = /* @__PURE__ */ W({
|
|
1153
|
+
__name: "TransferTemplateView",
|
|
1154
|
+
setup(u) {
|
|
1155
|
+
const { t: b } = Y(), { createTemplate: m, viewTemplate: l } = Se(), { templateDialogProps: f, transferFormDialogProps: g, templateDetailsProps: k } = gt(
|
|
1156
|
+
Se()
|
|
1157
|
+
), i = nt(), s = bt(), d = Ee(), { breakpoints: p } = ze();
|
|
1158
|
+
d.watchLocation(i.fetchTemplates);
|
|
1159
|
+
const _ = M(
|
|
1160
|
+
() => i.loading.value || !d._currentLocation
|
|
1161
|
+
), C = M(() => i.templates.value), T = U(""), w = M(() => p.value.xs || p.value.sm ? 10 : 20);
|
|
1162
|
+
function S(t) {
|
|
1163
|
+
switch (t) {
|
|
1164
|
+
case Re.Add:
|
|
1165
|
+
return m();
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
const A = wt();
|
|
1169
|
+
function L() {
|
|
1170
|
+
A.push({ name: vt.RECEIVE_REQUEST });
|
|
1171
|
+
}
|
|
1172
|
+
function n(t) {
|
|
1173
|
+
return t;
|
|
1174
|
+
}
|
|
1175
|
+
return (t, o) => {
|
|
1176
|
+
const r = I("FmTable");
|
|
1177
|
+
return R(), N(Pe, null, [
|
|
1178
|
+
c(et, {
|
|
1179
|
+
title: e(b)("inventory.transfer.template.title2"),
|
|
1180
|
+
actions: [
|
|
1181
|
+
{
|
|
1182
|
+
label: e(b)("inventory.transfer.template.create.title"),
|
|
1183
|
+
value: e(Re).Add,
|
|
1184
|
+
isPrimary: !0,
|
|
1185
|
+
prependIcon: "add"
|
|
1186
|
+
}
|
|
1187
|
+
],
|
|
1188
|
+
"onClick:action": S
|
|
1189
|
+
}, {
|
|
1190
|
+
default: B(() => {
|
|
1191
|
+
var h;
|
|
1192
|
+
return [
|
|
1193
|
+
a("div", zo, [
|
|
1194
|
+
c(tt, {
|
|
1195
|
+
searchable: "",
|
|
1196
|
+
"change-location": "",
|
|
1197
|
+
search: T.value,
|
|
1198
|
+
"onUpdate:search": o[0] || (o[0] = (y) => T.value = y),
|
|
1199
|
+
actions: [{ icon: "refresh", onClick: e(i).fetchTemplates }]
|
|
1200
|
+
}, null, 8, ["search", "actions"]),
|
|
1201
|
+
(R(), Q(r, {
|
|
1202
|
+
style: Ke(e(s).tableHeight),
|
|
1203
|
+
"column-defs": e(i).columnDefs,
|
|
1204
|
+
"row-data": C.value,
|
|
1205
|
+
"search-value": T.value,
|
|
1206
|
+
loading: _.value,
|
|
1207
|
+
key: (h = e(d)._currentLocation) == null ? void 0 : h.dbName,
|
|
1208
|
+
onRowClick: o[1] || (o[1] = (y) => e(l)(y.original)),
|
|
1209
|
+
"page-size": w.value
|
|
1210
|
+
}, {
|
|
1211
|
+
"list-row": B((y) => [
|
|
1212
|
+
c(Ne, {
|
|
1213
|
+
row: y,
|
|
1214
|
+
onRowClick: (v) => e(l)(v)
|
|
1215
|
+
}, {
|
|
1216
|
+
default: B((v) => {
|
|
1217
|
+
var V, x, O, z, K, Z, J, X, H, ee, te, oe, se, j, ne, ve, be, _e, ie, xe, he, ge, ke, ue, Ce;
|
|
1218
|
+
return [
|
|
1219
|
+
a("div", Ho, [
|
|
1220
|
+
a("div", jo, [
|
|
1221
|
+
a("div", Qo, [
|
|
1222
|
+
c(e(q), {
|
|
1223
|
+
render: (O = (x = (V = v._id) == null ? void 0 : V.column) == null ? void 0 : x.columnDef) == null ? void 0 : O.cell,
|
|
1224
|
+
props: (K = (z = v._id) == null ? void 0 : z.getContext) == null ? void 0 : K.call(z)
|
|
1225
|
+
}, null, 8, ["render", "props"])
|
|
1226
|
+
]),
|
|
1227
|
+
a("div", Go, [
|
|
1228
|
+
c(e(q), {
|
|
1229
|
+
render: (X = (J = (Z = v.name) == null ? void 0 : Z.column) == null ? void 0 : J.columnDef) == null ? void 0 : X.cell,
|
|
1230
|
+
props: (ee = (H = v.name) == null ? void 0 : H.getContext) == null ? void 0 : ee.call(H)
|
|
1231
|
+
}, null, 8, ["render", "props"])
|
|
1232
|
+
]),
|
|
1233
|
+
a("div", Yo, [
|
|
1234
|
+
c(e(q), {
|
|
1235
|
+
render: (se = (oe = (te = v.supplier) == null ? void 0 : te.column) == null ? void 0 : oe.columnDef) == null ? void 0 : se.cell,
|
|
1236
|
+
props: (ne = (j = v.supplier) == null ? void 0 : j.getContext) == null ? void 0 : ne.call(j)
|
|
1237
|
+
}, null, 8, ["render", "props"])
|
|
1238
|
+
]),
|
|
1239
|
+
a("div", Wo, F(y.original.purchaseOrder.items.length ? y.original.purchaseOrder.items.map((Qe) => Qe.name).join(", ") : "No items"), 1),
|
|
1240
|
+
a("div", Ko, [
|
|
1241
|
+
c(e(q), {
|
|
1242
|
+
render: (_e = (be = (ve = v.ref) == null ? void 0 : ve.column) == null ? void 0 : be.columnDef) == null ? void 0 : _e.cell,
|
|
1243
|
+
props: (xe = (ie = v.ref) == null ? void 0 : ie.getContext) == null ? void 0 : xe.call(ie)
|
|
1244
|
+
}, null, 8, ["render", "props"])
|
|
1245
|
+
])
|
|
1246
|
+
]),
|
|
1247
|
+
a("div", null, [
|
|
1248
|
+
c(e(q), {
|
|
1249
|
+
render: (ke = (ge = (he = v.type) == null ? void 0 : he.column) == null ? void 0 : ge.columnDef) == null ? void 0 : ke.cell,
|
|
1250
|
+
props: (Ce = (ue = v.type) == null ? void 0 : ue.getContext) == null ? void 0 : Ce.call(ue)
|
|
1251
|
+
}, null, 8, ["render", "props"])
|
|
1252
|
+
])
|
|
1253
|
+
])
|
|
1254
|
+
];
|
|
1255
|
+
}),
|
|
1256
|
+
_: 2
|
|
1257
|
+
}, 1032, ["row", "onRowClick"])
|
|
1258
|
+
]),
|
|
1259
|
+
_: 1
|
|
1260
|
+
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1261
|
+
])
|
|
1262
|
+
];
|
|
1263
|
+
}),
|
|
1264
|
+
_: 1
|
|
1265
|
+
}, 8, ["title", "actions"]),
|
|
1266
|
+
(R(), Q(Ze, { to: "body" }, [
|
|
1267
|
+
c(at, $e(e(g), { onSubmitted: L }), null, 16),
|
|
1268
|
+
c(No, Je(Xe(e(k))), null, 16),
|
|
1269
|
+
c(ro, $e(e(f), {
|
|
1270
|
+
onSubmitted: o[2] || (o[2] = (h) => e(i).fetchTemplates())
|
|
1271
|
+
}), null, 16)
|
|
1272
|
+
]))
|
|
1273
|
+
], 64);
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1277
|
+
export {
|
|
1278
|
+
ds as default
|
|
1279
|
+
};
|