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
|
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
|
<v-text-field
|
||||||
label="Order Number"
|
label="Order Number"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
v-model="orderNumber"
|
v-model="orderNumber"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</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-menu
|
||||||
v-model="menu1"
|
v-model="menu1"
|
||||||
:close-on-content-click="false"
|
:close-on-content-click="false"
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
<div class="pt-md-7">-</div>
|
<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-menu
|
||||||
v-model="menu2"
|
v-model="menu2"
|
||||||
:close-on-content-click="false"
|
:close-on-content-click="false"
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
</v-menu>
|
</v-menu>
|
||||||
</v-col>
|
</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
|
<v-text-field
|
||||||
label="Purchase Order Number"
|
label="Purchase Order Number"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
hide-details
|
hide-details
|
||||||
v-model="purchaseOrderNumber"
|
v-model="purchaseOrderNumber"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</v-col> -->
|
||||||
<v-col cols="12" sm="12" md="6" lg="3">
|
<v-col cols="12" sm="12" md="6" lg="3">
|
||||||
<v-hover v-slot:default="{ hover }">
|
<v-hover v-slot:default="{ hover }">
|
||||||
<v-btn
|
<v-btn
|
||||||
|
@ -102,12 +102,12 @@
|
||||||
:class="hover ? 'white--text warning' : 'warning--text'"
|
:class="hover ? 'white--text warning' : 'warning--text'"
|
||||||
class="width-250px"
|
class="width-250px"
|
||||||
outlined
|
outlined
|
||||||
@click="searchOrder"
|
@click.prevent="searchOrder"
|
||||||
>
|
>
|
||||||
Search
|
Search
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-hover>
|
</v-hover>
|
||||||
</v-col>--->
|
</v-col>-
|
||||||
<v-col cols="12" sm="12" md="6" lg="3">
|
<v-col cols="12" sm="12" md="6" lg="3">
|
||||||
<v-hover v-slot:default="{ hover }">
|
<v-hover v-slot:default="{ hover }">
|
||||||
<router-link
|
<router-link
|
||||||
|
@ -141,7 +141,7 @@
|
||||||
<span>{{ isoStringToNormalDate(item.updatedAt) }}</span>
|
<span>{{ isoStringToNormalDate(item.updatedAt) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:item.order="{ item }">
|
<template v-slot:item.order="{ item }">
|
||||||
<span>{{ item.items[0].orderId }}</span>
|
<span>{{ item.incrementId }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:item.retailername="{ item }">
|
<template v-slot:item.retailername="{ item }">
|
||||||
<span>{{ `-` }}</span>
|
<span>{{ `-` }}</span>
|
||||||
|
@ -197,6 +197,7 @@ export default {
|
||||||
{ text: "Action", value: "action" },
|
{ text: "Action", value: "action" },
|
||||||
|
|
||||||
],
|
],
|
||||||
|
orderNumber : ""
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
createdDate() {
|
createdDate() {
|
||||||
|
@ -211,6 +212,7 @@ export default {
|
||||||
customerId() {
|
customerId() {
|
||||||
return this.$store.state.accountOne.one;
|
return this.$store.state.accountOne.one;
|
||||||
},
|
},
|
||||||
|
|
||||||
inProgress() {
|
inProgress() {
|
||||||
return this.$store.state.orderlist.inProgress;
|
return this.$store.state.orderlist.inProgress;
|
||||||
},
|
},
|
||||||
|
@ -238,13 +240,17 @@ export default {
|
||||||
let tmp = new Date(newDateTime).toLocaleDateString().split("/");
|
let tmp = new Date(newDateTime).toLocaleDateString().split("/");
|
||||||
return (date = tmp[1] + "/" + tmp[0] + "/" + tmp[2]);
|
return (date = tmp[1] + "/" + tmp[0] + "/" + tmp[2]);
|
||||||
},
|
},
|
||||||
searchOrder(value) {
|
searchOrder() {
|
||||||
value.preventDeafult();
|
this.$store.dispatch("orderlist/fetchSearchOrder");
|
||||||
|
},
|
||||||
|
reset(){
|
||||||
|
this.$store.dispatch("orderlist/fetchReset");
|
||||||
|
|
||||||
},
|
},
|
||||||
orderlistApi() {
|
orderlistApi() {
|
||||||
if(this.customerId && this.customerId.id)
|
if(this.customerId && this.customerId.id)
|
||||||
{
|
{
|
||||||
debugger
|
|
||||||
this.$store.dispatch("orderlist/fetchOrderList",this.customerId.id);
|
this.$store.dispatch("orderlist/fetchOrderList",this.customerId.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -253,7 +259,6 @@ export default {
|
||||||
{
|
{
|
||||||
customerId()
|
customerId()
|
||||||
{
|
{
|
||||||
debugger
|
|
||||||
this.orderlistApi();
|
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)
|
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 */
|
/* 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 { getField, updateField } from 'vuex-map-fields';
|
||||||
import humps from 'lodash-humps';
|
import humps from 'lodash-humps';
|
||||||
|
|
||||||
|
@ -10,7 +10,8 @@ export const orderlist = {
|
||||||
inProgress: true,
|
inProgress: true,
|
||||||
OrderHistory: {},
|
OrderHistory: {},
|
||||||
|
|
||||||
// orderNumber: "",
|
customerId: "",
|
||||||
|
incrementId: ""
|
||||||
// createdDate: "",
|
// createdDate: "",
|
||||||
// toDate: "",
|
// toDate: "",
|
||||||
// purchaseOrderNumber: "",
|
// purchaseOrderNumber: "",
|
||||||
|
@ -25,18 +26,33 @@ export const orderlist = {
|
||||||
inProgress(state, yesOrNo) {
|
inProgress(state, yesOrNo) {
|
||||||
state.inProgress = yesOrNo
|
state.inProgress = yesOrNo
|
||||||
},
|
},
|
||||||
// SetOrderlist(state, orderItem) {
|
|
||||||
// // console.log(state.orderNumber=orderItem)
|
|
||||||
// } ,
|
|
||||||
setOrderHistory(state, orderhistorydata) {
|
setOrderHistory(state, orderhistorydata) {
|
||||||
state.OrderHistory = orderhistorydata
|
state.OrderHistory = orderhistorydata
|
||||||
},
|
},
|
||||||
|
setSearchOrder(state, orderItem,customerId) {
|
||||||
|
state.customerId=orderItem
|
||||||
|
state.customerId=customerId
|
||||||
|
|
||||||
|
} ,
|
||||||
|
// setReset(state,incrementId){
|
||||||
|
// state.incrementId=incrementId
|
||||||
|
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
searchOrder: ({ commit }, orderItem) => {
|
fetchSearchOrder:async ({ commit, state} ) => {
|
||||||
commit('SetOrderlist', orderItem);
|
debugger
|
||||||
|
const filterOrderlist = await doFetchIncrementId( state.OrderHistory,state.incrementId)
|
||||||
|
if(filterOrderlist){
|
||||||
|
commit('setSearchOrder', humps(filterOrderlist));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// fetchReset({commit}){
|
||||||
|
// commit('setReset');
|
||||||
|
|
||||||
|
// },
|
||||||
fetchOrderList: async ({ commit },customerId) => {
|
fetchOrderList: async ({ commit },customerId) => {
|
||||||
try {
|
try {
|
||||||
commit('inProgress', true);
|
commit('inProgress', true);
|
||||||
|
|
Loading…
Reference in New Issue