This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<v-card elevation="24">
|
||||
<v-card-title class="headline lighten-2" primary-title>
|
||||
<span> {{ $ay.t("Report") }} </span>
|
||||
TYPE: {{ ayaType }}, idList:{{ idList }}
|
||||
TYPE: {{ ayaType }}, idList:{{ idList }} rights: {{ rights }}
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text style="height: 500px;">
|
||||
@@ -31,6 +31,14 @@
|
||||
<!-- <v-divider></v-divider> v-bind:class="options.type" -->
|
||||
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
v-if="rights.change"
|
||||
color="primary darken-1"
|
||||
text
|
||||
@click.native="newReport"
|
||||
:data-cy="!!$ay.dev ? 'reportselector:ok' : false"
|
||||
>{{ $ay.t("New") }}</v-btn
|
||||
>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary darken-1"
|
||||
@@ -54,6 +62,7 @@
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
rights: window.$gz.role.getRights(window.$gz.type.Report),
|
||||
ayaType: null,
|
||||
idList: [],
|
||||
isVisible: false,
|
||||
@@ -74,10 +83,13 @@ export default {
|
||||
}
|
||||
this.ayaType = ayaType;
|
||||
this.idList = idList;
|
||||
|
||||
//rights
|
||||
|
||||
//get report list from server
|
||||
|
||||
let res = await window.$gz.api.get(`report/list/${ayaType}`);
|
||||
console.log("report-selectr report list from server is: ", res);
|
||||
//console.log("report-selectr report list from server is: ", res);
|
||||
if (res.error) {
|
||||
throw res.error;
|
||||
} else {
|
||||
@@ -97,6 +109,14 @@ export default {
|
||||
cancel() {
|
||||
this.isVisible = false;
|
||||
this.resolve(null);
|
||||
},
|
||||
newReport() {
|
||||
this.isVisible = false;
|
||||
this.resolve(null);
|
||||
this.$router.push({
|
||||
name: "ay-report-edit",
|
||||
params: { recordid: 0, ayaType: this.ayaType, idList: this.idList }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user