diff --git a/ayanova/src/views/ay-report-edit.vue b/ayanova/src/views/ay-report-edit.vue index 20d99b77..8eba07b1 100644 --- a/ayanova/src/views/ay-report-edit.vue +++ b/ayanova/src/views/ay-report-edit.vue @@ -330,9 +330,14 @@ export default { } else { 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 { //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({ vm: vm, loading: false @@ -1105,7 +1110,6 @@ function generateMenu(vm) { // async function initForm(vm) { await fetchTranslatedText(vm); - await fetchReportData(vm); } ////////////////////////////////////////////////////////// @@ -1153,6 +1157,10 @@ async function fetchReportData(vm) { } 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); //We never expect there to be no data here if (!res.hasOwnProperty("data")) {