diff --git a/ayanova/src/views/inv-purchase-order.vue b/ayanova/src/views/inv-purchase-order.vue index b4025128..601d5b4f 100644 --- a/ayanova/src/views/inv-purchase-order.vue +++ b/ayanova/src/views/inv-purchase-order.vue @@ -380,6 +380,7 @@ export default { selectLists: { status: [] }, + showWarehouses: true, headers: [], itemList: [], obj: @@ -816,23 +817,32 @@ async function initForm(vm) { await fetchTranslatedText(vm); await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY); await populateSelectionLists(vm); + await fetchWarehouseCount(vm); await createTableHeaders(vm); } +////////////////////// +// +// +async function fetchWarehouseCount(vm) { + let res = await window.$gz.api.get("part-warehouse/count"); + if (res.error) { + vm.formState.serverError = res.error; + window.$gz.form.setErrorBoxErrors(vm); + } else { + vm.showWarehouses = res.data > 1; + } +} + ////////////////////// // // async function createTableHeaders(vm) { - vm.headers = [ - { - text: vm.$ay.t("FileName"), - align: "start", - value: "name" - }, - { text: vm.$ay.t("FileDate"), value: "created" }, - { text: vm.$ay.t("FileSize"), value: "length" }, - { text: "", value: "actions", sortable: false } - ]; + vm.headers.push({ + text: vm.$ay.t("FileName"), + align: "start", + value: "name" + }); } //////////////////////