This commit is contained in:
2021-06-24 20:05:21 +00:00
parent bc19406282
commit 3e733f3233

View File

@@ -330,9 +330,14 @@ export default {
} else { } else {
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
} }
//Ok, we're here now fetch the report data and can handle includeWoItemDescendants if necessary
await fetchReportData(vm);
} else { } else {
//New record so there *MUST* be an aType on the route params //New record so there *MUST* be an aType on the route params
await fetchReportData(vm); //go ahead and fetch report data now, no need to handle includeWoItemDescendants
window.$gz.form.setFormState({ window.$gz.form.setFormState({
vm: vm, vm: vm,
loading: false loading: false
@@ -1105,7 +1110,6 @@ function generateMenu(vm) {
// //
async function initForm(vm) { async function initForm(vm) {
await fetchTranslatedText(vm); await fetchTranslatedText(vm);
await fetchReportData(vm);
} }
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
@@ -1153,6 +1157,10 @@ async function fetchReportData(vm) {
} }
vm.obj.aType = reportDataOptions.AType; vm.obj.aType = reportDataOptions.AType;
//handle includeWoItemDescendants by adding it's value to the request for report data
reportDataOptions["includeWoItemDescendants"] =
vm.obj.includeWoItemDescendants;
let res = await window.$gz.api.upsert("report/data", reportDataOptions); let res = await window.$gz.api.upsert("report/data", reportDataOptions);
//We never expect there to be no data here //We never expect there to be no data here
if (!res.hasOwnProperty("data")) { if (!res.hasOwnProperty("data")) {