-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented: Added the support for using facility selector from dxp-component(#dxp/228) #384
Changes from 6 commits
c9ef649
72eb48f
4acc2c4
3d1599f
ae76142
e5f615b
7a2be33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ | |
import RootState from '@/store/RootState' | ||
import OrderState from './OrderState' | ||
import * as types from './mutation-types' | ||
import { hasError, showToast } from '@/utils' | ||
import { getProductIdentificationValue, translate } from '@hotwax/dxp-components' | ||
import { hasError, showToast, getCurrentFacilityId } from '@/utils' | ||
import { getProductIdentificationValue, translate, useUserStore } from '@hotwax/dxp-components' | ||
Check warning on line 7 in src/store/modules/order/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
|
||
import emitter from "@/event-bus"; | ||
import store from "@/store"; | ||
|
||
|
@@ -68,8 +68,9 @@ | |
} | ||
commit(types.ORDER_CURRENT_PRODUCT_ADDED, product) | ||
}, | ||
async getOrderDetail({ commit, state }, { orderId }) { | ||
Check warning on line 71 in src/store/modules/order/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
|
||
let resp; | ||
const currentFacilityId = getCurrentFacilityId(); | ||
|
||
try { | ||
const payload = { | ||
|
@@ -82,7 +83,7 @@ | |
}, | ||
"query": "docType:ORDER", | ||
"filter": [ | ||
`orderTypeId: PURCHASE_ORDER AND orderId: ${orderId} AND orderStatusId: (ORDER_APPROVED OR ORDER_CREATED OR ORDER_COMPLETED) AND facilityId: ${this.state.user.currentFacility.facilityId}` | ||
`orderTypeId: PURCHASE_ORDER AND orderId: ${orderId} AND orderStatusId: (ORDER_APPROVED OR ORDER_CREATED OR ORDER_COMPLETED) AND facilityId: ${currentFacilityId}` | ||
] | ||
} | ||
} | ||
|
@@ -106,12 +107,12 @@ | |
} | ||
return resp; | ||
}, | ||
async createPurchaseShipment({ commit }, payload) { | ||
Check warning on line 110 in src/store/modules/order/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
|
||
let resp; | ||
try { | ||
const params = { | ||
orderId: payload.orderId, | ||
facilityId: this.state.user.currentFacility.facilityId | ||
facilityId: getCurrentFacilityId() | ||
} | ||
|
||
resp = await OrderService.createPurchaseShipment(params) | ||
|
@@ -150,7 +151,7 @@ | |
return resp; | ||
}, | ||
|
||
async createAndReceiveIncomingShipment({ commit }, payload) { | ||
Check warning on line 154 in src/store/modules/order/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
|
||
let resp; | ||
try { | ||
payload.items.map((item: any, index: number) => { | ||
|
@@ -208,7 +209,8 @@ | |
"orderBy": 'datetimeReceived DESC', | ||
"viewSize": "250" | ||
} | ||
const facilityLocations = await this.dispatch('user/getFacilityLocations', this.state.user.currentFacility.facilityId); | ||
const currentFacilityId = getCurrentFacilityId() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the getCurrentFacilityId() directly if currentFacilityId is not reused. |
||
const facilityLocations = await this.dispatch('user/getFacilityLocations', currentFacilityId); | ||
const locationSeqId = facilityLocations.length > 0 ? facilityLocations[0].locationSeqId : ""; | ||
resp = await OrderService.fetchPOHistory(params) | ||
if (resp.status === 200 && !hasError(resp) && resp.data?.count > 0) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,13 @@ | |
import RootState from '@/store/RootState' | ||
import ShipmentState from './ShipmentState' | ||
import * as types from './mutation-types' | ||
import { hasError, showToast } from '@/utils' | ||
import { getProductIdentificationValue, translate } from '@hotwax/dxp-components' | ||
import { hasError, showToast, getCurrentFacilityId } from '@/utils' | ||
import { getProductIdentificationValue, translate, useUserStore } from '@hotwax/dxp-components' | ||
Check warning on line 7 in src/store/modules/shipment/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
|
||
import emitter from '@/event-bus' | ||
import store from "@/store"; | ||
import { DateTime } from 'luxon'; | ||
import { UploadService } from "@/services/UploadService"; | ||
import { toHandlerKey } from "vue"; | ||
Check warning on line 12 in src/store/modules/shipment/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
|
||
|
||
const actions: ActionTree<ShipmentState, RootState> = { | ||
async findShipment ({ commit, state }, payload) { | ||
|
@@ -72,8 +72,8 @@ | |
const shipmentAttributes = await ShipmentService.fetchShipmentAttributes([shipmentDetail.shipmentId]) | ||
shipmentDetail.externalOrderId = shipmentAttributes?.[shipmentDetail.shipmentId]?.['EXTERNAL_ORDER_ID'] | ||
shipmentDetail.externalOrderName = shipmentAttributes?.[shipmentDetail.shipmentId]?.['EXTERNAL_ORDER_NAME'] | ||
|
||
const facilityLocations = await this.dispatch('user/getFacilityLocations', this.state.user.currentFacility.facilityId); | ||
const currentFacilityId = getCurrentFacilityId(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
const facilityLocations = await this.dispatch('user/getFacilityLocations', currentFacilityId); | ||
if(facilityLocations.length){ | ||
const locationSeqId = facilityLocations[0].locationSeqId | ||
resp.data.items.map((item: any) => { | ||
|
@@ -105,7 +105,8 @@ | |
return Promise.reject(new Error(err)) | ||
} | ||
}, | ||
async receiveShipmentItem ({ commit }, payload) { | ||
Check warning on line 108 in src/store/modules/shipment/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
|
||
const currentFacilityId = getCurrentFacilityId(); | ||
let areAllSuccess = true; | ||
|
||
for (const item of payload.items) { | ||
|
@@ -118,7 +119,7 @@ | |
|
||
const params = { | ||
shipmentId: payload.shipmentId, | ||
facilityId: this.state.user.currentFacility.facilityId, | ||
facilityId: currentFacilityId, | ||
shipmentItemSeqId: item.itemSeqId, | ||
productId: item.productId, | ||
quantityAccepted: item.quantityAccepted, | ||
|
@@ -141,7 +142,7 @@ | |
|
||
return areAllSuccess; | ||
}, | ||
async receiveShipmentJson ({ dispatch }, payload) { | ||
Check warning on line 145 in src/store/modules/shipment/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
|
||
emitter.emit("presentLoader"); | ||
const fileName = `ReceiveShipment_${payload.shipmentId}_${DateTime.now().toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS)}.json`; | ||
const params = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the getCurrentFacilityId() directly if currentFacilityId is not reused.