This commit is contained in:
2021-02-18 19:52:24 +00:00
parent a26b3c9c68
commit 8852ea7a50

View File

@@ -380,6 +380,7 @@ export default {
selectLists: { selectLists: {
status: [] status: []
}, },
showWarehouses: true,
headers: [], headers: [],
itemList: [], itemList: [],
obj: obj:
@@ -816,23 +817,32 @@ async function initForm(vm) {
await fetchTranslatedText(vm); await fetchTranslatedText(vm);
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY); await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
await populateSelectionLists(vm); await populateSelectionLists(vm);
await fetchWarehouseCount(vm);
await createTableHeaders(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) { async function createTableHeaders(vm) {
vm.headers = [ vm.headers.push({
{ text: vm.$ay.t("FileName"),
text: vm.$ay.t("FileName"), align: "start",
align: "start", value: "name"
value: "name" });
},
{ text: vm.$ay.t("FileDate"), value: "created" },
{ text: vm.$ay.t("FileSize"), value: "length" },
{ text: "", value: "actions", sortable: false }
];
} }
////////////////////// //////////////////////