This commit is contained in:
@@ -271,7 +271,7 @@ function initNavPanel() {
|
|||||||
sub.push({
|
sub.push({
|
||||||
title: "HeadOfficeList",
|
title: "HeadOfficeList",
|
||||||
icon: "$ayiSitemap",
|
icon: "$ayiSitemap",
|
||||||
route: "/cust-headoffices",
|
route: "/cust-head-offices",
|
||||||
key: key++
|
key: key++
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ export default {
|
|||||||
params: { recordid: tid.id }
|
params: { recordid: tid.id }
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case ayatype.HeadOffice:
|
||||||
|
vm.$router.push({
|
||||||
|
name: "head-office-edit",
|
||||||
|
params: { recordid: tid.id }
|
||||||
|
});
|
||||||
|
break;
|
||||||
case ayatype.Widget:
|
case ayatype.Widget:
|
||||||
vm.$router.push({
|
vm.$router.push({
|
||||||
name: "widget-edit",
|
name: "widget-edit",
|
||||||
|
|||||||
@@ -179,12 +179,6 @@ export default new Router({
|
|||||||
component: () =>
|
component: () =>
|
||||||
import(/* webpackChunkName: "cust" */ "./views/cust-customer-note.vue")
|
import(/* webpackChunkName: "cust" */ "./views/cust-customer-note.vue")
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "/cust-headoffices",
|
|
||||||
name: "cust-headoffices",
|
|
||||||
component: () =>
|
|
||||||
import(/* webpackChunkName: "cust" */ "./views/cust-headoffices.vue")
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "/cust-users",
|
path: "/cust-users",
|
||||||
name: "cust-users",
|
name: "cust-users",
|
||||||
@@ -197,6 +191,18 @@ export default new Router({
|
|||||||
component: () =>
|
component: () =>
|
||||||
import(/* webpackChunkName: "cust" */ "./views/cust-user.vue")
|
import(/* webpackChunkName: "cust" */ "./views/cust-user.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/cust-head-offices",
|
||||||
|
name: "cust-head-offices",
|
||||||
|
component: () =>
|
||||||
|
import(/* webpackChunkName: "cust" */ "./views/cust-head-offices.vue")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/cust-head-offices/:recordid",
|
||||||
|
name: "head-office-edit",
|
||||||
|
component: () =>
|
||||||
|
import(/* webpackChunkName: "cust" */ "./views/cust-head-office.vue")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/svc-schedule",
|
path: "/svc-schedule",
|
||||||
name: "svc-schedule",
|
name: "svc-schedule",
|
||||||
|
|||||||
1521
ayanova/src/views/cust-head-office.vue
Normal file
1521
ayanova/src/views/cust-head-office.vue
Normal file
File diff suppressed because it is too large
Load Diff
170
ayanova/src/views/cust-head-offices.vue
Normal file
170
ayanova/src/views/cust-head-offices.vue
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<gz-report-selector ref="reportSelector"></gz-report-selector>
|
||||||
|
<gz-extensions
|
||||||
|
:ayaType="ayType"
|
||||||
|
:selectedItems="selectedItems"
|
||||||
|
ref="extensions"
|
||||||
|
>
|
||||||
|
</gz-extensions>
|
||||||
|
<gz-data-table
|
||||||
|
ref="gzdatatable"
|
||||||
|
formKey="head-office-list"
|
||||||
|
:dataListKey="dataListKey"
|
||||||
|
:dataListFilter="dataListFilter"
|
||||||
|
:dataListSort="dataListSort"
|
||||||
|
:showSelect="rights.change"
|
||||||
|
v-on:selection-change="handleSelected"
|
||||||
|
data-cy="headofficesTable"
|
||||||
|
>
|
||||||
|
</gz-data-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const FORM_KEY = "head-office-list";
|
||||||
|
export default {
|
||||||
|
created() {
|
||||||
|
this.rights = window.$gz.role.getRights(window.$gz.type.HeadOffice);
|
||||||
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
|
generateMenu(this);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
window.$gz.eventBus.$off("menu-click", clickHandler);
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
currentListViewId: 1,
|
||||||
|
dataListKey: "HeadOfficeDataList",
|
||||||
|
dataListFilter: "",
|
||||||
|
dataListSort: "",
|
||||||
|
rights: window.$gz.role.defaultRightsObject(),
|
||||||
|
ayType: window.$gz.type.HeadOffice,
|
||||||
|
selectedItems: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSelected(selected) {
|
||||||
|
this.selectedItems = selected;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////////
|
||||||
|
//
|
||||||
|
//
|
||||||
|
async function clickHandler(menuItem) {
|
||||||
|
if (!menuItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let m = window.$gz.menu.parseMenuItem(menuItem);
|
||||||
|
if (m.owner == FORM_KEY && !m.disabled) {
|
||||||
|
switch (m.key) {
|
||||||
|
case "new":
|
||||||
|
m.vm.$router.push({
|
||||||
|
name: "head-office-edit",
|
||||||
|
params: { recordid: 0 }
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "extensions":
|
||||||
|
let res = await m.vm.$refs.extensions.open(
|
||||||
|
m.vm.$refs.gzdatatable.getDataListSelection(
|
||||||
|
window.$gz.type.HeadOffice
|
||||||
|
)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "report":
|
||||||
|
if (m.id != null) {
|
||||||
|
//last report selected is in m.id
|
||||||
|
m.vm.$router.push({
|
||||||
|
name: "ay-report",
|
||||||
|
params: { recordid: m.id, ayatype: window.$gz.type.HeadOffice }
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//general report selector chosen
|
||||||
|
|
||||||
|
let res = await m.vm.$refs.reportSelector.open(
|
||||||
|
m.vm.$refs.gzdatatable.getDataListSelection(
|
||||||
|
window.$gz.type.HeadOffice
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
//if null for no selection
|
||||||
|
//just bail out
|
||||||
|
if (res == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//persist last report selected
|
||||||
|
window.$gz.form.setLastReport(FORM_KEY, res);
|
||||||
|
|
||||||
|
//Now open the report viewer...
|
||||||
|
m.vm.$router.push({
|
||||||
|
name: "ay-report",
|
||||||
|
params: { recordid: res.id, ayatype: window.$gz.type.HeadOffice }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
window.$gz.eventBus.$emit(
|
||||||
|
"notify-warning",
|
||||||
|
FORM_KEY + "::context click: [" + m.key + "]"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////
|
||||||
|
//
|
||||||
|
//
|
||||||
|
function generateMenu(vm) {
|
||||||
|
let menuOptions = {
|
||||||
|
isMain: true,
|
||||||
|
icon: "$ayiSitemap",
|
||||||
|
title: "HeadOfficeList",
|
||||||
|
helpUrl: "form-cust-head-offices",
|
||||||
|
menuItems: [],
|
||||||
|
formData: {
|
||||||
|
ayaType: window.$gz.type.HeadOffice
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (vm.rights.change) {
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "New",
|
||||||
|
icon: "$ayiPlus",
|
||||||
|
surface: true,
|
||||||
|
key: FORM_KEY + ":new",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//REPORTS
|
||||||
|
//Report not Print, print is a further option
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "Report",
|
||||||
|
icon: "$ayiFileAlt",
|
||||||
|
key: FORM_KEY + ":report",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
|
||||||
|
//get last report selected
|
||||||
|
let lastReport = window.$gz.form.getLastReport(FORM_KEY);
|
||||||
|
if (lastReport != null) {
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: lastReport.name,
|
||||||
|
icon: "$ayiFileAlt",
|
||||||
|
key: FORM_KEY + ":report:" + lastReport.id,
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "Extensions",
|
||||||
|
icon: "$ayiPuzzlePiece",
|
||||||
|
key: FORM_KEY + ":extensions",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<template>
|
|
||||||
<UnderConstruction data-cy="underconstruction" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import UnderConstruction from "../components/underconstruction.vue";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
UnderConstruction
|
|
||||||
},
|
|
||||||
beforeCreate() {
|
|
||||||
window.$gz.eventBus.$emit("menu-change", {
|
|
||||||
isMain: true,
|
|
||||||
icon: "$ayiSitemap",
|
|
||||||
title: "HeadOfficeList",
|
|
||||||
helpUrl: "form-cust-headoffices"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -67,9 +67,9 @@ describe("SMOKE", () => {
|
|||||||
cy.url().should("include", "/cust-customers/1");
|
cy.url().should("include", "/cust-customers/1");
|
||||||
cy.get("[data-cy=name]");
|
cy.get("[data-cy=name]");
|
||||||
|
|
||||||
cy.visit("/cust-headoffices");
|
cy.visit("/cust-head-offices");
|
||||||
cy.url().should("include", "/cust-headoffices");
|
cy.url().should("include", "/cust-head-offices");
|
||||||
cy.get("[data-cy=underconstruction]");
|
cy.get("[data-cy=headofficesTable]");
|
||||||
|
|
||||||
cy.visit("/cust-users");
|
cy.visit("/cust-users");
|
||||||
cy.url().should("include", "/cust-users");
|
cy.url().should("include", "/cust-users");
|
||||||
|
|||||||
Reference in New Issue
Block a user