This commit is contained in:
2022-12-27 00:20:23 +00:00
parent 57f425eccc
commit 9b77da02a0

View File

@@ -9,11 +9,11 @@
</gz-extensions> </gz-extensions>
<gz-data-table <gz-data-table
ref="gzdatatable" ref="gzdatatable"
form-key="customer-list" form-key="license-list"
data-list-key="CustomerDataList" data-list-key="LicenseDataList"
:show-select="rights.read" :show-select="rights.read"
:reload="reload" :reload="reload"
data-cy="customersTable" data-cy="licensesTable"
:client-criteria="clientCriteria" :client-criteria="clientCriteria"
:pre-filter-mode="preFilterMode" :pre-filter-mode="preFilterMode"
@selection-change="handleSelected" @selection-change="handleSelected"
@@ -24,12 +24,12 @@
</template> </template>
<script> <script>
const FORM_KEY = "customer-list"; const FORM_KEY = "license-list";
export default { export default {
data() { data() {
return { return {
rights: window.$gz.role.defaultRightsObject(), rights: window.$gz.role.defaultRightsObject(),
aType: window.$gz.type.Customer, aType: window.$gz.type.License,
selectedItems: [], selectedItems: [],
reload: false, reload: false,
clientCriteria: undefined, clientCriteria: undefined,
@@ -37,11 +37,11 @@ export default {
}; };
}, },
created() { created() {
this.rights = window.$gz.role.getRights(window.$gz.type.Customer); this.rights = window.$gz.role.getRights(window.$gz.type.License);
window.$gz.eventBus.$on("menu-click", clickHandler); window.$gz.eventBus.$on("menu-click", clickHandler);
//------ pre-filter ---- //------ pre-filter ----
//OPTIONAL "Show All customers of head office" FILTER //OPTIONAL "Show All licenses of head office" FILTER
this.objectId = window.$gz.util.stringToIntOrNull( this.objectId = window.$gz.util.stringToIntOrNull(
this.$route.params.objectId this.$route.params.objectId
); );
@@ -89,16 +89,14 @@ async function clickHandler(menuItem) {
switch (m.key) { switch (m.key) {
case "new": case "new":
m.vm.$router.push({ m.vm.$router.push({
name: "customer-edit", name: "license-edit",
params: { recordid: 0 } params: { recordid: 0 }
}); });
break; break;
case "extensions": case "extensions":
{ {
const res = await m.vm.$refs.extensions.open( const res = await m.vm.$refs.extensions.open(
m.vm.$refs.gzdatatable.getDataListSelection( m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.License)
window.$gz.type.Customer
)
); );
if (res && res.refresh == true) { if (res && res.refresh == true) {
m.vm.reload = !m.vm.reload; m.vm.reload = !m.vm.reload;
@@ -109,7 +107,7 @@ async function clickHandler(menuItem) {
{ {
const res = await m.vm.$refs.reportSelector.open( const res = await m.vm.$refs.reportSelector.open(
m.vm.$refs.gzdatatable.getDataListSelection( m.vm.$refs.gzdatatable.getDataListSelection(
window.$gz.type.Customer window.$gz.type.License
), ),
m.id m.id
); );
@@ -134,11 +132,11 @@ async function clickHandler(menuItem) {
function generateMenu(vm) { function generateMenu(vm) {
const menuOptions = { const menuOptions = {
isMain: true, isMain: true,
icon: "$sockiAddressCard", icon: "$sockiGem",
title: "CustomerList", title: "LicenseList",
menuItems: [], menuItems: [],
formData: { formData: {
sockType: window.$gz.type.Customer sockType: window.$gz.type.License
} }
}; };