added ponumber in order page table

This commit is contained in:
anjujangid 2022-02-11 12:55:46 +05:30
parent 74d3d0c4fa
commit 1a7f74b26a
4 changed files with 23 additions and 11 deletions

View File

@ -1 +1 @@
{"branch_name":"dev","last_commit_date":"2022-02-03T07:51:08.000Z","last_commit_author":"rakesh","last_commit_hash":"d5f0c96eb734aa04ebb26447e10f4b25a34a6f05"} {"branch_name":"dev","last_commit_date":"2022-02-05T10:19:06.000Z","last_commit_author":"anjujangid","last_commit_hash":"74d3d0c4faa541b6dfdfa28e187885658ae11448"}

View File

@ -145,6 +145,9 @@
</template> </template>
<template v-slot:item.status="{ item }"> <template v-slot:item.status="{ item }">
<span>{{ item.status }}</span> <span>{{ item.status }}</span>
</template>
<template v-slot:item.POnumber="{ item }">
<span>{{ item.payment.poNumber }}</span>
</template> </template>
<template v-slot:item.action="{ item }"> <template v-slot:item.action="{ item }">
<v-hover v-slot:default="{ hover }"> <v-hover v-slot:default="{ hover }">
@ -168,6 +171,7 @@
<!-- <ul v-for="(listorder, index) in OrderHistory" v-bind:key="index"> <!-- <ul v-for="(listorder, index) in OrderHistory" v-bind:key="index">
<li> {{ listorder.items[0].orderId}}</li> <li> {{ listorder.items[0].orderId}}</li>
</ul> --> </ul> -->
</v-container> </v-container>
</template> </template>
<script> <script>
@ -187,6 +191,7 @@ export default {
{ text: "Status", value: "status" }, { text: "Status", value: "status" },
{ text: "PO Number", value: "POnumber" }, { text: "PO Number", value: "POnumber" },
{ text: "Action", value: "action" }, { text: "Action", value: "action" },
], ],
}), }),
computed: { computed: {
@ -198,6 +203,9 @@ export default {
}, },
OrderHistory() { OrderHistory() {
return this.$store.state.orderlist.OrderHistory.items; return this.$store.state.orderlist.OrderHistory.items;
},
customerId() {
return this.$store.state.accountOne.one;
}, },
inProgress() { inProgress() {
return this.$store.state.orderlist.inProgress; return this.$store.state.orderlist.inProgress;
@ -231,7 +239,8 @@ export default {
}, },
}, },
created() { created() {
this.$store.dispatch("orderlist/fetchOrderList"); this.$store.dispatch("orderlist/fetchOrderList",this.customerId.id);
}, },
}; };
</script> </script>

View File

@ -676,7 +676,7 @@ export const doFetchProductTags = wrapRequest((sku) => {
}) })
export const doFetchOrderHistory = wrapRequest(() => { export const doFetchOrderHistory = wrapRequest((customerId) => {
const requestOptions = { const requestOptions = {
method: 'GET', method: 'GET',
headers: { headers: {
@ -684,6 +684,5 @@ export const doFetchOrderHistory = wrapRequest(() => {
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
} }
}; };
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crorders?searchCriteria[filter_groups][0][filters][0][field]=customer_id&searchCriteria[filter_groups][0][filters][0][value]=124160&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[filter_groups][1][filters][0][field]=status&searchCriteria[filter_groups][1][filters][0][value]=complete&searchCriteria[filter_groups][1][filters][0][condition_type]=eq&searchCriteria[pageSize]=10&searchCriteria[currentPage]=1&searchCriteria[sortOrders][0][field]=created_at&searchCriteria[sortOrders][0][direction]=DESC`, requestOptions) return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crorders?searchCriteria[filter_groups][0][filters][0][field]=customer_id&searchCriteria[filter_groups][0][filters][0][value]=${customerId}&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[pageSize]=100&searchCriteria[currentPage]=1&searchCriteria[sortOrders][0][field]=created_at&searchCriteria[sortOrders][0][direction]=DESC`, requestOptions)
});
});

View File

@ -1,3 +1,5 @@
/* eslint-disable no-alert, no-console , no-debugger */
import { doFetchOrderHistory } from '@/services/product.service'; import { doFetchOrderHistory } from '@/services/product.service';
import { getField, updateField } from 'vuex-map-fields'; import { getField, updateField } from 'vuex-map-fields';
import humps from 'lodash-humps'; import humps from 'lodash-humps';
@ -7,7 +9,7 @@ export const orderlist = {
state: { state: {
inProgress: true, inProgress: true,
OrderHistory: {}, OrderHistory: {},
// orderNumber: "", // orderNumber: "",
// createdDate: "", // createdDate: "",
// toDate: "", // toDate: "",
@ -28,17 +30,17 @@ export const orderlist = {
// } , // } ,
setOrderHistory(state, orderhistorydata) { setOrderHistory(state, orderhistorydata) {
state.OrderHistory = orderhistorydata state.OrderHistory = orderhistorydata
} },
}, },
actions: { actions: {
searchOrder: ({ commit }, orderItem) => { searchOrder: ({ commit }, orderItem) => {
commit('SetOrderlist', orderItem); commit('SetOrderlist', orderItem);
}, },
fetchOrderList: async ({ commit }) => { fetchOrderList: async ({ commit },customerId) => {
try { try {
commit('inProgress', true); commit('inProgress', true);
let OrderHistory = await doFetchOrderHistory(); let OrderHistory = await doFetchOrderHistory(customerId);
if (OrderHistory) { if (OrderHistory) {
commit('inProgress', false); commit('inProgress', false);
commit('setOrderHistory', humps(OrderHistory)); commit('setOrderHistory', humps(OrderHistory));
@ -48,7 +50,9 @@ export const orderlist = {
commit('inProgress', false); commit('inProgress', false);
throw error throw error
} }
} },
} }
} }