postman code-pending
This commit is contained in:
parent
a57b07eaa8
commit
8c3f940308
|
@ -1 +1 @@
|
|||
{"branch_name":"dev","last_commit_date":"2022-02-12T09:32:16.000Z","last_commit_author":"anjujangid","last_commit_hash":"05692cdd9e04477236c4cb6b90f065e83e6cbeb2"}
|
||||
{"branch_name":"dev","last_commit_date":"2022-02-12T12:20:27.000Z","last_commit_author":"anjujangid","last_commit_hash":"a57b07eaa8b1f0f62e4854ee8176a6f7f88836e9"}
|
|
@ -10,7 +10,7 @@
|
|||
justify-md-start
|
||||
"
|
||||
>
|
||||
<!--<v-col cols="12" sm="12" md="12" lg="12">
|
||||
<v-col cols="12" sm="12" md="12" lg="12">
|
||||
<v-text-field
|
||||
label="Order Number"
|
||||
persistent-hint
|
||||
|
@ -19,7 +19,7 @@
|
|||
v-model="orderNumber"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="12" md="6" lg="4">
|
||||
<v-col cols="12" sm="12" md="6" lg="5">
|
||||
<v-menu
|
||||
v-model="menu1"
|
||||
:close-on-content-click="false"
|
||||
|
@ -48,7 +48,7 @@
|
|||
|
||||
<div class="pt-md-7">-</div>
|
||||
|
||||
<v-col cols="12" sm="12" md="6" lg="4">
|
||||
<v-col cols="12" sm="12" md="6" lg="5">
|
||||
<v-menu
|
||||
v-model="menu2"
|
||||
:close-on-content-click="false"
|
||||
|
@ -75,7 +75,7 @@
|
|||
</v-menu>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="12" md="12" lg="12">
|
||||
<!-- <v-col cols="12" sm="12" md="12" lg="12">
|
||||
<v-text-field
|
||||
label="Purchase Order Number"
|
||||
persistent-hint
|
||||
|
@ -83,7 +83,7 @@
|
|||
hide-details
|
||||
v-model="purchaseOrderNumber"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-col> -->
|
||||
<v-col cols="12" sm="12" md="6" lg="3">
|
||||
<v-hover v-slot:default="{ hover }">
|
||||
<v-btn
|
||||
|
@ -102,12 +102,12 @@
|
|||
:class="hover ? 'white--text warning' : 'warning--text'"
|
||||
class="width-250px"
|
||||
outlined
|
||||
@click="searchOrder"
|
||||
@click.prevent="searchOrder"
|
||||
>
|
||||
Search
|
||||
</v-btn>
|
||||
</v-hover>
|
||||
</v-col>--->
|
||||
</v-col>-
|
||||
<v-col cols="12" sm="12" md="6" lg="3">
|
||||
<v-hover v-slot:default="{ hover }">
|
||||
<router-link
|
||||
|
@ -141,7 +141,7 @@
|
|||
<span>{{ isoStringToNormalDate(item.updatedAt) }}</span>
|
||||
</template>
|
||||
<template v-slot:item.order="{ item }">
|
||||
<span>{{ item.items[0].orderId }}</span>
|
||||
<span>{{ item.incrementId }}</span>
|
||||
</template>
|
||||
<template v-slot:item.retailername="{ item }">
|
||||
<span>{{ `-` }}</span>
|
||||
|
@ -197,6 +197,7 @@ export default {
|
|||
{ text: "Action", value: "action" },
|
||||
|
||||
],
|
||||
orderNumber : ""
|
||||
}),
|
||||
computed: {
|
||||
createdDate() {
|
||||
|
@ -211,6 +212,7 @@ export default {
|
|||
customerId() {
|
||||
return this.$store.state.accountOne.one;
|
||||
},
|
||||
|
||||
inProgress() {
|
||||
return this.$store.state.orderlist.inProgress;
|
||||
},
|
||||
|
@ -238,13 +240,17 @@ export default {
|
|||
let tmp = new Date(newDateTime).toLocaleDateString().split("/");
|
||||
return (date = tmp[1] + "/" + tmp[0] + "/" + tmp[2]);
|
||||
},
|
||||
searchOrder(value) {
|
||||
value.preventDeafult();
|
||||
searchOrder() {
|
||||
this.$store.dispatch("orderlist/fetchSearchOrder");
|
||||
},
|
||||
reset(){
|
||||
this.$store.dispatch("orderlist/fetchReset");
|
||||
|
||||
},
|
||||
orderlistApi() {
|
||||
if(this.customerId && this.customerId.id)
|
||||
{
|
||||
debugger
|
||||
|
||||
this.$store.dispatch("orderlist/fetchOrderList",this.customerId.id);
|
||||
}
|
||||
},
|
||||
|
@ -253,7 +259,6 @@ export default {
|
|||
{
|
||||
customerId()
|
||||
{
|
||||
debugger
|
||||
this.orderlistApi();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -686,3 +686,47 @@ export const doFetchOrderHistory = wrapRequest((customerId) => {
|
|||
};
|
||||
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)
|
||||
});
|
||||
|
||||
|
||||
export const doFetchIncrementId = wrapRequest((customerId,incrementId) => {
|
||||
debugger
|
||||
const requestOptions = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
};
|
||||
|
||||
if(customerId){
|
||||
let query = "";
|
||||
query = `?
|
||||
searchCriteria[pageSize]=1000&searchCriteria[currentPage]=1
|
||||
&searchCriteria[filter_groups][1][filters][0][field]=customer_id
|
||||
&searchCriteria[filter_groups][1][filters][0][value]=${customerId}
|
||||
&searchCriteria[filter_groups][1][filters][0][condition_type]=eq`
|
||||
|
||||
console.log('CustomerId', `${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`, requestOptions)
|
||||
}
|
||||
if(incrementId){
|
||||
let query = "";
|
||||
query = `?
|
||||
searchCriteria[pageSize]=1000&searchCriteria[currentPage]=1
|
||||
&searchCriteria[filter_groups][1][filters][0][field]=increment_id
|
||||
&searchCriteria[filter_groups][1][filters][0][value]=${incrementId}
|
||||
&searchCriteria[filter_groups][1][filters][0][condition_type]=eq`
|
||||
|
||||
console.log('incrementId', `${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`, requestOptions)
|
||||
}
|
||||
if(incrementId && customerId){
|
||||
let query = "";
|
||||
query = `?searchCriteria[pageSize]=1000&searchCriteria[currentPage]=1&searchCriteria[filter_groups][1][filters][0][field]=increment_id&searchCriteria[filter_groups][0][filters][0][field]=customer_id&searchCriteria[filter_groups][0][filters][0][value]=${customerId}&searchCriteria[filter_groups][1][filters][0][value]=${incrementId}&searchCriteria[filter_groups][1][filters][0][condition_type]=eq`
|
||||
|
||||
console.log('incrementId & CustomerId', `${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`, requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/* eslint-disable no-alert, no-console , no-debugger */
|
||||
import { doFetchOrderHistory } from '@/services/product.service';
|
||||
import { doFetchOrderHistory ,doFetchIncrementId} from '@/services/product.service';
|
||||
import { getField, updateField } from 'vuex-map-fields';
|
||||
import humps from 'lodash-humps';
|
||||
|
||||
|
@ -10,7 +10,8 @@ export const orderlist = {
|
|||
inProgress: true,
|
||||
OrderHistory: {},
|
||||
|
||||
// orderNumber: "",
|
||||
customerId: "",
|
||||
incrementId: ""
|
||||
// createdDate: "",
|
||||
// toDate: "",
|
||||
// purchaseOrderNumber: "",
|
||||
|
@ -25,18 +26,33 @@ export const orderlist = {
|
|||
inProgress(state, yesOrNo) {
|
||||
state.inProgress = yesOrNo
|
||||
},
|
||||
// SetOrderlist(state, orderItem) {
|
||||
// // console.log(state.orderNumber=orderItem)
|
||||
// } ,
|
||||
setOrderHistory(state, orderhistorydata) {
|
||||
state.OrderHistory = orderhistorydata
|
||||
},
|
||||
setSearchOrder(state, orderItem,customerId) {
|
||||
state.customerId=orderItem
|
||||
state.customerId=customerId
|
||||
|
||||
} ,
|
||||
// setReset(state,incrementId){
|
||||
// state.incrementId=incrementId
|
||||
|
||||
// }
|
||||
},
|
||||
|
||||
actions: {
|
||||
searchOrder: ({ commit }, orderItem) => {
|
||||
commit('SetOrderlist', orderItem);
|
||||
fetchSearchOrder:async ({ commit, state} ) => {
|
||||
debugger
|
||||
const filterOrderlist = await doFetchIncrementId( state.OrderHistory,state.incrementId)
|
||||
if(filterOrderlist){
|
||||
commit('setSearchOrder', humps(filterOrderlist));
|
||||
}
|
||||
},
|
||||
|
||||
// fetchReset({commit}){
|
||||
// commit('setReset');
|
||||
|
||||
// },
|
||||
fetchOrderList: async ({ commit },customerId) => {
|
||||
try {
|
||||
commit('inProgress', true);
|
||||
|
|
Loading…
Reference in New Issue