Lines 14-20
Link Here
|
14 |
</div> |
14 |
</div> |
15 |
|
15 |
|
16 |
<div class="col-md-2 order-sm-2 order-md-1"> |
16 |
<div class="col-md-2 order-sm-2 order-md-1"> |
17 |
<LeftMenu :title="$__('Vendors')"></LeftMenu> |
17 |
<LeftMenu :title="$__('Vendor management')"></LeftMenu> |
18 |
</div> |
18 |
</div> |
19 |
</div> |
19 |
</div> |
20 |
</div> |
20 |
</div> |
Lines 44-55
export default {
Link Here
|
44 |
|
44 |
|
45 |
const { loading, loaded, setError } = mainStore |
45 |
const { loading, loaded, setError } = mainStore |
46 |
|
46 |
|
|
|
47 |
const permissionsStore = inject("permissionsStore") |
48 |
const { userPermissions } = storeToRefs(permissionsStore) |
49 |
|
47 |
return { |
50 |
return { |
48 |
vendorStore, |
51 |
vendorStore, |
49 |
AVStore, |
52 |
AVStore, |
50 |
setError, |
53 |
setError, |
51 |
loading, |
54 |
loading, |
52 |
loaded, |
55 |
loaded, |
|
|
56 |
userPermissions, |
53 |
AVStore, |
57 |
AVStore, |
54 |
} |
58 |
} |
55 |
}, |
59 |
}, |
Lines 90-95
export default {
Link Here
|
90 |
return Promise.all(promises) |
94 |
return Promise.all(promises) |
91 |
} |
95 |
} |
92 |
|
96 |
|
|
|
97 |
fetchConfig().then(() => { |
98 |
this.loaded() |
99 |
this.initialized = true |
100 |
}) |
101 |
}, |
102 |
beforeCreate() { |
103 |
this.loading() |
104 |
|
105 |
const fetchConfig = () => { |
106 |
let promises = [] |
107 |
|
108 |
const av_client = APIClient.authorised_values |
109 |
const authorised_values = { |
110 |
vendor_types: "VENDOR_TYPE", |
111 |
vendor_interface_types: "VENDOR_INTERFACE_TYPE", |
112 |
vendor_payment_methods: "VENDOR_PAYMENT_METHOD", |
113 |
lang: "LANG", |
114 |
} |
115 |
|
116 |
let av_cat_array = Object.keys(authorised_values).map(function ( |
117 |
av_cat |
118 |
) { |
119 |
return '"' + authorised_values[av_cat] + '"' |
120 |
}) |
121 |
|
122 |
promises.push( |
123 |
av_client.values |
124 |
.getCategoriesWithValues(av_cat_array) |
125 |
.then(av_categories => { |
126 |
Object.entries(authorised_values).forEach( |
127 |
([av_var, av_cat]) => { |
128 |
const av_match = av_categories.find( |
129 |
element => element.category_name == av_cat |
130 |
) |
131 |
this.AVStore[av_var] = |
132 |
av_match.authorised_values |
133 |
} |
134 |
) |
135 |
}) |
136 |
) |
137 |
|
138 |
return Promise.all(promises) |
139 |
} |
140 |
|
93 |
fetchConfig().then(() => { |
141 |
fetchConfig().then(() => { |
94 |
this.vendorStore.currencies = currencies |
142 |
this.vendorStore.currencies = currencies |
95 |
this.vendorStore.gstValues = gstValues.map(gv => { |
143 |
this.vendorStore.gstValues = gstValues.map(gv => { |
Lines 103-108
export default {
Link Here
|
103 |
}) |
151 |
}) |
104 |
}, |
152 |
}, |
105 |
data() { |
153 |
data() { |
|
|
154 |
this.userPermissions = userPermissions |
106 |
return { |
155 |
return { |
107 |
initialized: true, |
156 |
initialized: true, |
108 |
} |
157 |
} |