diff --git a/src/locales/en.json b/src/locales/en.json index d70406faf..30a638975 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -36,6 +36,7 @@ "Choose language": "Choose language", "City": "City", "Click the backdrop to dismiss.": "Click the backdrop to dismiss.", + "Closed": "Closed", "Color:": "Color: {color}", "Colors": "Colors", "Confirm Cancelation": "Confirm Cancelation", @@ -66,12 +67,14 @@ "Fetching pickers": "Fetching pickers", "Fetching facilities": "Fetching facilities", "First name": "First name", + "friday": "Friday", "Generate packing slips": "Generate packing slips", "Generate shipping documents": "Generate shipping documents", "Go to OMS": "Go to OMS", "Go to Launchpad": "Go to Launchpad", "Handover": "Handover", "Handling Instructions": "Handling Instructions", + "Hide facilities without stock": "Hide facilities without stock", "If you cannot fulfill this order, will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.": "If you cannot fulfill this order, {customerName} will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.", "Imported from Shopify": "Imported from Shopify", "Inactive store": "Inactive store", @@ -94,8 +97,10 @@ "Logging out": "Logging out", "Logout": "Logout", "Method": "Method", + "miles": "miles", "Mismatch": "Mismatch", "Mis-Ordered Item": "Mis-Ordered Item", + "monday": "Monday", "More": "More", "New notification received.": "New notification received.", "No facilities found": "No facilities found", @@ -190,8 +195,10 @@ "Resend email": "Resend email", "Reserved": "Reserved", "Safety stock": "Safety stock", + "saturday": "Saturday", "Search": "Search", "Search Orders": "Search Orders", + "Search store name": "Search store name", "Search time zones": "Search time zones", "Secondary": "Secondary", "Select facility": "Select facility", @@ -235,6 +242,7 @@ "Street": "Street", "Store": "Store", "Summary": "Summary", + "sunday": "Sunday", "Timezone": "Timezone", "Timeline": "Timeline", "Time zone updated successfully": "Time zone updated successfully", @@ -243,14 +251,17 @@ "Selected variant not available": "Selected variant not available", "This order cannot be split. If you cannot fulfill any item, will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.": "This order cannot be split. If you cannot fulfill any item, { customerName } will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.", "This order will be rejected from this store with the selected reason and shipped to the address that has been inputed.Please make sure the address you have entered is correct.": "This order will be rejected from this store with the selected reason and shipped to the address that has been inputed. { space } Please make sure the address you have entered is correct.", + "thursday": "Thursday", "Total": "Total", "Track Pickers": "Track Pickers", "Track who picked orders by entering picker IDs when packing an order.": "Track who picked orders by entering picker IDs when packing an order.", + "tuesday": "Tuesday", "Unable to open as browser is blocking pop-ups.": "Unable to open { documentName } as browser is blocking pop-ups.", "Unfillable Items": "Unfillable Items", "Update time zone": "Update time zone", "Username": "Username", "Warehouse": "Warehouse", + "wednesday": "Wednesday", "will be removed from your dashboard. This action cannot be undone.": "{ productName } will be removed from your dashboard.{ space } This action cannot be undone.", "Worn Display": "Worn Display", "This order will be removed from your dashboard. This action cannot be undone.": "This order will be removed from your dashboard.{ space } This action cannot be undone.", diff --git a/src/locales/es.json b/src/locales/es.json index f0dac653c..aa3390d4d 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -36,6 +36,7 @@ "Choose language": "Elegir idioma", "City": "Ciudad", "Click the backdrop to dismiss.": "Haz clic en el fondo para cerrar.", + "Closed": "Closed", "Colors": "Colores", "Confirm Cancelation": "Confirm Cancelation", "Complete": "Completar", @@ -65,12 +66,14 @@ "Fetching pickers": "Fetching pickers", "Fetching facilities": "Fetching facilities", "First name": "Nombre", + "friday": "Friday", "Generate packing slips": "Generar documentos de embalaje", "Generate shipping documents": "Generar documentos de envío", "Go to OMS": "Ir a OMS", "Go to Launchpad": "Ir a la plataforma de lanzamiento", "Handover": "Entregar", "Handling Instructions": "Instrucciones de manejo", + "Hide facilities without stock": "Hide facilities without stock", "Imported from Shopify": "Imported from Shopify", "Inactive store": "Tienda inactiva", "in stock": "en stock", @@ -92,8 +95,10 @@ "Logging out": "Cerrando sesión", "Logout": "Cerrar sesión", "Method": "Method", + "miles": "miles", "Mismatch": "Desajuste", "Mis-Ordered Item": "Mis-Ordered Item", + "monday": "Monday", "More": "Más", "New notification received.": "Nueva notificación recibida.", "No facilities found": "No facilities found", @@ -187,8 +192,10 @@ "Resend email": "Reenviar correo electrónico", "Reserved": "Reserved", "Safety stock": "Safety stock", + "saturday": "Saturday", "Search": "Buscar", "Search Orders": "Buscar pedidos", + "Search store name": "Search store name", "Search time zones": "Buscar zonas horarias", "Secondary": "Secondary", "Select facility": "Seleccionar instalación", @@ -232,6 +239,7 @@ "Street": "Calle", "Store": "Tienda", "Summary": "Summary", + "sunday": "Sunday", "Timeline": "Timeline", "Timezone": "Zona horaria", "Time zone updated successfully": "Zona horaria actualizada exitosamente", @@ -240,14 +248,17 @@ "Selected variant not available": "Variante seleccionada no disponible", "This order cannot be split. If you cannot fulfill any item, an email will be sent with alternate fulfillment options, and this order will be removed from your dashboard.": "Este pedido no se puede dividir. Si no puedes cumplir con algún artículo, { customerName } se enviará un correo electrónico con opciones de cumplimiento alternativas y este pedido se eliminará de tu panel de control.", "This order will be rejected from this store with the selected reason and shipped to the address that has been inputted. Please make sure the address you have entered is correct.": "Este pedido será rechazado en esta tienda con la razón seleccionada y se enviará a la dirección que se ha ingresado.{ space } Por favor, asegúrate de que la dirección que has ingresado sea correcta.", + "thursday": "Thursday", "Total": "Total", "Track Pickers": "Seguimiento de recolectores", "Track who picked orders by entering picker IDs when packing an order.": "Realiza un seguimiento de quién recogió los pedidos ingresando los ID de los recolectores al empacar un pedido.", + "tuesday": "Tuesday", "Unable to open as browser is blocking pop-ups.": "No se puede abrir {documentName} porque el navegador bloquea las ventanas emergentes.", "Unfillable Items": "Artículos no disponibles", "Update time zone": "Actualizar zona horaria", "Username": "Nombre de usuario", "Warehouse": "Almacén", + "wednesday": "Wednesday", "will be removed from your dashboard. This action cannot be undone.": "{ productName } se eliminará de su panel de control.{ space } Esta acción no se puede deshacer.", "Worn Display": "Pantalla desgastada", "This order will be removed from your dashboard. This action cannot be undone.": "Este pedido será eliminado de tu panel de control.{ space } Esta acción no se puede deshacer.", diff --git a/src/locales/ja.json b/src/locales/ja.json index c6a607a9c..f07f2df66 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -35,6 +35,7 @@ "Choose language": "言語を選択", "City": "街", "Click the backdrop to dismiss.": "背景をクリックして閉じます。", + "Closed": "Closed", "Colors": "色", "Confirm Cancelation": "Confirm Cancelation", "Complete": "完了", @@ -63,12 +64,14 @@ "Fetching pickers": "Fetching pickers", "Fetching facilities": "Fetching facilities", "First name": "名", + "friday": "Friday", "Generate packing slips": "内容明細票の作成", "Generate shipping documents": "出荷書類を生成する", "Go to OMS": "OMSへ", "Go to Launchpad": "Launchpadへ移動", "Handover": "引き継ぐ", "Handling Instructions": "取扱説明", + "Hide facilities without stock": "Hide facilities without stock", "Imported from Shopify": "Imported from Shopify", "Inactive store": "休止店舗", "in stock": "在庫あり", @@ -89,8 +92,10 @@ "Logging in": "ログイン中", "Logging out": "ログアウト中", "Logout": "ログアウト", + "miles": "miles", "Mismatch": "不一致", "Mis-Ordered Item": "Mis-Ordered Item", + "monday": "Monday", "More": "もっと見る", "New notification received.": "新しい通知を受信しました。", "No facilities found": "No facilities found", @@ -183,8 +188,10 @@ "Resend email": "メールを再送する", "Reserved": "Reserved", "Safety stock": "安全在庫", + "saturday": "Saturday", "Search": "検索", "Search Orders": "注文の検索", + "Search store name": "Search store name", "Search time zones": "タイムゾーンの検索", "Secondary": "Secondary", "Select Facility": "Select Facility", @@ -225,6 +232,7 @@ "Street": "市区町村", "Store": "ストア", "Summary": "Summary", + "sunday": "Sunday", "Timeline": "Timeline", "Timezone": "タイムゾーン", "Time zone updated successfully": "タイムゾーンの更新成功", @@ -233,15 +241,18 @@ "Selected variant not available": "選択したバリアントは利用できません", "This order cannot be split. If you cannot fulfill any item, will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.": "この注文は分割できません。どのアイテムもフィフィルできない場合、{ customerName } に別の発送オプションを記載したメールが送信され、ダッシュボードから注文が削除されます。", "This order will be rejected from this store with the selected reason and shipped to the address that has been inputed.Please make sure the address you have entered is correct.": "この注文は、選択された理由によりこのストアから拒否され、入力された住所に発送されます。{ space } 入力したアドレスが正しいことを確認してください。", + "thursday": "Thursday", "Total": "Total", "Track Pickers": "受取人の追跡", "Track who picked orders by entering picker IDs when packing an order.": "注文を梱包する際に受取人IDを入力することで、誰が注文を受け取ったかを追跡できます。", + "tuesday": "Tuesday", "Unable to login. User is not associated with any facility": "Unable to login. User is not associated with any facility", "Unable to open as browser is blocking pop-ups.": "ブラウザーがポップアップをブロックしているため、{documentName} を開くことができません。", "Unfillable Items": "記入不可の項目", "Update time zone": "タイムゾーンを更新する", "Username": "ユーザーネーム", "Warehouse": "倉庫", + "wednesday": "Wednesday", "will be removed from your dashboard. This action cannot be undone.": "{productName} はダッシュボードから削除されます。{space} この操作は元に戻せません。", "Worn Display": "すり切れたディスプレイ", "This order will be removed from your dashboard. This action cannot be undone.": "この注文はダッシュボードから削除されます。{ space } この操作は元に戻せません。", diff --git a/src/services/UtilService.ts b/src/services/UtilService.ts index 7cbff83d9..0b6418301 100644 --- a/src/services/UtilService.ts +++ b/src/services/UtilService.ts @@ -147,6 +147,22 @@ const fetchEnumerations = async (payload: any): Promise => { }); } +const fetchCurrentFacilityLatLon = async (payload: any): Promise => { + return api({ + url: "performFind", + method: "post", + data: payload + }); +} + +const fetchStoresInformation = async (payload: any): Promise => { + return api({ + url: "storeLookup", + method: "post", + data: payload + }); +} + export const UtilService = { createEnumeration, createProductStoreSetting, @@ -163,5 +179,7 @@ export const UtilService = { isEnumExists, resetPicker, updateProductStoreSetting, - fetchReservedQuantity + fetchReservedQuantity, + fetchCurrentFacilityLatLon, + fetchStoresInformation } \ No newline at end of file diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index c4a88e27f..230f66a97 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -156,7 +156,8 @@ const actions: ActionTree = { this.dispatch('util/updateCancelReasons', []) this.dispatch("util/clearFacilities", {}) this.dispatch("util/clearEnumerations", {}) - this.dispatch('order/clearOrders') + this.dispatch("util/clearCurrentFacilityLatLon", {}) + this.dispatch("util/clearStoresInformation", {}) commit(types.USER_END_SESSION) resetPermissions(); resetConfig(); diff --git a/src/store/modules/util/UtilState.ts b/src/store/modules/util/UtilState.ts index ed52feb8e..396f75611 100644 --- a/src/store/modules/util/UtilState.ts +++ b/src/store/modules/util/UtilState.ts @@ -7,4 +7,8 @@ export default interface UtilState { cancelReasons: Array; facilities: any; enumerations: any; + facilitiesLatLng: { + [facilityId :string]: { latitude: any , longitude: any } + }, + storesInformation: any; } \ No newline at end of file diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index e4123c751..6743f6e11 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -378,6 +378,66 @@ const actions: ActionTree = { async clearEnumerations({ commit }) { commit(types.UTIL_ENUMERATIONS_UPDATED, {}) + }, + + async fetchCurrentFacilityLatLon({ commit }, facilityId) { + const payload = { + inputFields: { + facilityId + }, + entityName: "FacilityContactDetailByPurpose", + orderBy: "fromDate DESC", + filterByDate: "Y", + fieldList: ["latitude", "longitude"], + viewSize: 5 + } + + try { + const resp = await UtilService.fetchCurrentFacilityLatLon(payload) + + if (!hasError(resp) && resp.data?.docs.length > 0) { + // Find first doc with non-null coordinates + const validCoords = resp.data.docs.find((doc: any) => + doc.latitude !== null && doc.longitude !== null + ) + + if (validCoords) { + commit(types.UTIL_FACILITY_LAT_LON_UPDATED, { facilityId, validCoords }) + } + } else { + throw resp.data + } + } catch (err) { + logger.error("Failed to fetch facility lat/long information", err) + } + }, + + async clearCurrentFacilityLatLon({ commit }) { + commit(types.UTIL_FACILITY_LAT_LON_UPDATED, {}) + }, + + async fetchStoresInformation({ commit }, point) { + const payload = { + viewSize: 250, + filters: ["storeType: RETAIL_STORE"], + point: `${point.latitude},${point.longitude}` + } + + try { + const resp = await UtilService.fetchStoresInformation(payload) + + if (!hasError(resp) && resp.data?.response?.docs?.length > 0) { + commit(types.UTIL_STORES_INFORMATION_UPDATED, resp.data.response.docs) + } else { + throw resp.data + } + } catch (err) { + logger.error("Failed to fetch stores information by lat/lon", err) + } + }, + + async clearStoresInformation({ commit }) { + commit(types.UTIL_STORES_INFORMATION_UPDATED, []) } } diff --git a/src/store/modules/util/getters.ts b/src/store/modules/util/getters.ts index db6a9e91a..d8dd5feca 100644 --- a/src/store/modules/util/getters.ts +++ b/src/store/modules/util/getters.ts @@ -27,5 +27,11 @@ const getters: GetterTree = { getEnumDescription: (state) => (enumId: string) => { return state.enumerations[enumId] ? state.enumerations[enumId] : enumId }, + getFacilityLatLon: (state) => (facilityId: string) => { + return state.facilitiesLatLng[facilityId] ? state.facilitiesLatLng[facilityId] : {} + }, + getStoresInformation: (state) => { + return state.storesInformation ? state.storesInformation : [] + } } export default getters; \ No newline at end of file diff --git a/src/store/modules/util/index.ts b/src/store/modules/util/index.ts index 3d91b0aeb..002329a65 100644 --- a/src/store/modules/util/index.ts +++ b/src/store/modules/util/index.ts @@ -15,7 +15,9 @@ const utilModule: Module = { partyNames: {}, cancelReasons: [], facilities: {}, - enumerations: {} + enumerations: {}, + facilitiesLatLng: {}, + storesInformation: [] }, getters, actions, diff --git a/src/store/modules/util/mutation-types.ts b/src/store/modules/util/mutation-types.ts index 4ec560a08..f53b0decd 100644 --- a/src/store/modules/util/mutation-types.ts +++ b/src/store/modules/util/mutation-types.ts @@ -7,3 +7,5 @@ export const UTIL_PARTY_NAMES_UPDATED = SN_UTIL + '/PARTY_NAMES_UPDATED' export const UTIL_CANCEL_REASONS_UPDATED = SN_UTIL + '/CANCEL_REASONS_UPDATED' export const UTIL_FACILITIES_UPDATED = SN_UTIL + '/FACILITIES_UPDATED' export const UTIL_ENUMERATIONS_UPDATED = SN_UTIL + '/ENUMERATIONS_UPDATED' +export const UTIL_FACILITY_LAT_LON_UPDATED = SN_UTIL + '/FACILITY_LAT_LON_UPDATED' +export const UTIL_STORES_INFORMATION_UPDATED = SN_UTIL + '/STORES_INFORMATION_UPDATED' \ No newline at end of file diff --git a/src/store/modules/util/mutations.ts b/src/store/modules/util/mutations.ts index 31f36a0b3..7bdad3f69 100644 --- a/src/store/modules/util/mutations.ts +++ b/src/store/modules/util/mutations.ts @@ -27,5 +27,11 @@ const mutations: MutationTree = { [types.UTIL_ENUMERATIONS_UPDATED] (state, payload) { state.enumerations = payload }, + [types.UTIL_FACILITY_LAT_LON_UPDATED] (state, payload) { + state.facilitiesLatLng[payload.facilityId] = payload.validCoords + }, + [types.UTIL_STORES_INFORMATION_UPDATED] (state, payload) { + state.storesInformation = payload + } } export default mutations; \ No newline at end of file diff --git a/src/views/OtherStoresInventoryModal.vue b/src/views/OtherStoresInventoryModal.vue index 3cc393db3..9217b0132 100644 --- a/src/views/OtherStoresInventoryModal.vue +++ b/src/views/OtherStoresInventoryModal.vue @@ -6,25 +6,83 @@ - {{ translate("Other stores inventory") }} + {{ translate("Other stores") }} + + + + + + + + + - - - - - {{ storeInventory.facilityName }} - {{ translate('ATP', { count: storeInventory.stock}) }} + + + + {{ translate("Hide facilities without stock")}} + + +
-

{{ translate("No inventory details found")}}

+ +

{{ translate("No inventory details found") }}