diff --git a/src/components/EditPickerModal.vue b/src/components/EditPickerModal.vue new file mode 100644 index 000000000..2fae065f8 --- /dev/null +++ b/src/components/EditPickerModal.vue @@ -0,0 +1,217 @@ + + + \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 6eac216d9..b004b027e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -31,6 +31,7 @@ "Delivery method": "Delivery method", "Dismiss": "Dismiss", "eCom Store": "eCom Store", + "Edit pickers": "Edit pickers", "Email sent successfully": "Email sent successfully", "Enable tracking": "Enable tracking", "Facility": "Facility", @@ -111,6 +112,7 @@ "pending approval": "pending approval", "Picked by": "Picked by { pickers }", "Pick up location": "Pick up location", + "Pickers successfully replaced in the picklist with the new selections.": "Pickers successfully replaced in the picklist with the new selections.", "pieces in stock": "pieces in stock", "Product details": "Product details", "Product not found": "Product not found", @@ -123,6 +125,9 @@ "Reject Order": "Reject Order", "Reject Order Item": "Reject Order Item", "Reason": "Reason", + "Replace": "Replace", + "Replace current pickers with new selection?": "Replace current pickers with new selection?", + "Replace pickers": "Replace pickers", "Report an issue": "Report an issue", "Resend customer email": "Resend customer email", "Resend ready for pickup email": "Resend ready for pickup email", @@ -149,6 +154,7 @@ "Size": "Size", "Sizes": "Sizes", "Something went wrong": "Something went wrong", + "Something went wrong, could not edit picker.": "Something went wrong, could not edit picker.", "Something went wrong. Picklist can not be created.": "Something went wrong. Picklist can not be created.", "Something went wrong while sending the email.": "Something went wrong while sending the email.", "Something went wrong while login. Please contact administrator": "Something went wrong while login. Please contact administrator.", diff --git a/src/locales/es.json b/src/locales/es.json index f9686cbe6..59e92b621 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -31,6 +31,7 @@ "Delivery method": "Método de entrega", "Dismiss": "Descartar", "eCom Store": "Tienda electrónica", + "Edit pickers": "Edit pickers", "Email sent successfully": "Correo enviado satisfactoriamente", "Enable tracking": "Habilitar seguimiento", "Facility": "Instalación", @@ -110,6 +111,7 @@ "pending approval": "pendiente de aprobación", "Picked by": "Picked by { pickers }", "Pick up location": "Ubicación de recogida", + "Pickers successfully replaced in the picklist with the new selections.": "Pickers successfully replaced in the picklist with the new selections.", "pieces in stock": "pieces in stock", "Product details": "Detalles del producto", "Product not found": "Producto no encontrado", @@ -122,6 +124,9 @@ "Reject Order": "Rechazar pedido", "Reject Order Item": "Reject Order Item", "Reason": "Razón", + "Replace": "Replace", + "Replace current pickers with new selection?": "Replace current pickers with new selection?", + "Replace pickers": "Replace pickers", "Report an issue": "Report an issue", "Resend customer email": "Resend customer email", "Resend ready for pickup email": "Reenviar correo electrónico de listo para recoger", @@ -148,6 +153,7 @@ "Size": "Tamaño", "Sizes": "Tamaños", "Something went wrong": "Algo salió mal", + "Something went wrong, could not edit picker.": "Something went wrong, could not edit picker.", "Something went wrong. Picklist can not be created.": "Algo salió mal. No se puede crear la lista de recolección.", "Something went wrong while sending the email.": "Algo salió mal al enviar el correo electrónico.", "Something went wrong while login. Please contact administrator": "Algo salió mal al iniciar sesión. Por favor, contacta al administrador.", diff --git a/src/locales/ja.json b/src/locales/ja.json index 071b476a8..7e6bea16b 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -31,6 +31,7 @@ "Delivery method": "配送方法", "Dismiss": "却下", "eCom Store": "ECストア", + "Edit pickers": "Edit pickers", "Email sent successfully": "メールの送信が完了しました。", "Enable tracking": "追跡を有効", "Facility": "拠点", @@ -110,6 +111,7 @@ "pending approval": "承認待ち", "Picked by": "Picked by { pickers }", "Pick up location": "受取場所", + "Pickers successfully replaced in the picklist with the new selections.": "Pickers successfully replaced in the picklist with the new selections.", "pieces in stock": "pieces in stock", "Product details": "商品詳細", "Product not found": "商品が見つかりません", @@ -122,6 +124,9 @@ "Reject Order": "注文を拒否", "Reject Order Item": "Reject Order Item", "Reason": "理由", + "Replace": "Replace", + "Replace current pickers with new selection?": "Replace current pickers with new selection?", + "Replace pickers": "Replace pickers", "Report an issue": "Report an issue", "Resend customer email": "Resend customer email", "Resend ready for pickup email": "受取準備完了メールの再送", @@ -148,6 +153,7 @@ "Size": "サイズ", "Sizes": "サイズ", "Something went wrong": "エラーが発生しました", + "Something went wrong, could not edit picker.": "Something went wrong, could not edit picker.", "Something went wrong. Picklist can not be created.": "何か問題が発生しました", "Something went wrong while sending the email.": "メールの送信中に何か問題が発生しました", "Something went wrong while login. Please contact administrator": "ログイン中に何らかの問題が発生しました。管理者に確認してください。", diff --git a/src/services/UtilService.ts b/src/services/UtilService.ts index d19a8aa70..079f86547 100644 --- a/src/services/UtilService.ts +++ b/src/services/UtilService.ts @@ -25,8 +25,17 @@ const fetchStatusDesc = async (query: any): Promise => { }); } +const resetPicker = async (payload: any): Promise => { + return api({ + url: "/service/resetPicker", + method: "post", + data: payload + }) +} + export const UtilService = { fetchPaymentMethodTypeDesc, fetchRejectReasons, - fetchStatusDesc + fetchStatusDesc, + resetPicker } \ No newline at end of file diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 0d271bb87..65b559c80 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -181,7 +181,12 @@ const actions: ActionTree ={ pickers: orderItem.pickers ? (orderItem.pickers.reduce((names: any, picker: string) => { names.push(picker.split('/')[1]); return names; - }, [])).join(', ') : "" + }, [])).join(', ') : "", + pickerIds: orderItem.pickers ? (orderItem.pickers.reduce((ids: any, picker: string) => { + ids.push(picker.split('/')[0]); + return ids; + }, [])) : "", + picklistId: orderItem.picklistId } }) @@ -261,7 +266,12 @@ const actions: ActionTree ={ pickers: orderItem.pickers ? (orderItem.pickers.reduce((names: any, picker: string) => { names.push(picker.split('/')[1]); return names; - }, [])).join(', ') : "" + }, [])).join(', ') : "", + pickerIds: orderItem.pickers ? (orderItem.pickers.reduce((ids: any, picker: string) => { + ids.push(picker.split('/')[0]); + return ids; + }, [])) : "", + picklistId: orderItem.picklistId } }) this.dispatch('product/getProductInformation', { orders }); diff --git a/src/views/OrderDetail.vue b/src/views/OrderDetail.vue index efe293435..8529622ad 100644 --- a/src/views/OrderDetail.vue +++ b/src/views/OrderDetail.vue @@ -66,10 +66,13 @@

{{ order.shippingInstructions }}

- - + + {{ order.pickers ? translate("Picked by", { pickers: order.pickers }) : translate("No picker assigned.") }} + + {{ translate("Change") }} +
@@ -170,6 +173,8 @@ import ShipToCustomerModal from "@/components/ShipToCustomerModal.vue"; import { OrderService } from "@/services/OrderService"; import RejectOrderModal from "@/components/RejectOrderModal.vue"; import { translate } from "@hotwax/dxp-components"; +import EditPickerModal from "@/components/EditPickerModal.vue"; +import emitter from '@/event-bus' export default defineComponent({ name: "OrderDetail", @@ -218,6 +223,23 @@ export default defineComponent({ }); return assignPickerModal.present(); }, + async editPicker(order: any) { + const editPickerModal = await modalController.create({ + component: EditPickerModal, + componentProps: { order } + }); + + editPickerModal.onDidDismiss().then((result) => { + if(result.data?.selectedPicker){ + const selectedPicker = result.data.selectedPicker + this.order.pickers = selectedPicker.name + this.order.pickerIds = [selectedPicker.id] + this.store.dispatch('order/updateCurrent', { order: this.order }) + } + }) + + return editPickerModal.present(); + }, async deliverShipment(order: any) { await this.store.dispatch('order/deliverShipment', order) }, @@ -361,6 +383,7 @@ export default defineComponent({ } }, async mounted() { + emitter.emit("presentLoader") await this.getOrderDetail(this.orderId, this.orderPartSeqId, this.orderType); // fetch customer details and rejection reasons only when we get the orders information @@ -368,6 +391,7 @@ export default defineComponent({ await this.getCustomerContactDetails() await this.fetchRejectReasons(); } + emitter.emit("dismissLoader") }, setup() { const store = useStore();