This commit is contained in:
@@ -9,22 +9,24 @@
|
||||
</gz-extensions>
|
||||
<gz-data-table
|
||||
ref="gzdatatable"
|
||||
form-key="part-list"
|
||||
data-list-key="PartDataList"
|
||||
form-key="part-restocks"
|
||||
data-list-key="PartRestockDataList"
|
||||
:show-select="rights.read"
|
||||
:reload="reload"
|
||||
@selection-change="handleSelected"
|
||||
data-cy="partsTable"
|
||||
data-cy="partRestocksTable"
|
||||
>
|
||||
</gz-data-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const FORM_KEY = "part-list";
|
||||
const FORM_KEY = "part-restocks";
|
||||
export default {
|
||||
created() {
|
||||
this.rights = window.$gz.role.getRights(window.$gz.type.Part);
|
||||
this.rights = window.$gz.role.getRights(
|
||||
window.$gz.type.PartInventoryRestock
|
||||
);
|
||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||
generateMenu(this);
|
||||
},
|
||||
@@ -34,7 +36,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
rights: window.$gz.role.defaultRightsObject(),
|
||||
ayType: window.$gz.type.Part,
|
||||
ayType: window.$gz.type.PartInventoryRestock,
|
||||
selectedItems: [],
|
||||
reload: false
|
||||
};
|
||||
@@ -56,15 +58,11 @@ async function clickHandler(menuItem) {
|
||||
let m = window.$gz.menu.parseMenuItem(menuItem);
|
||||
if (m.owner == FORM_KEY && !m.disabled) {
|
||||
switch (m.key) {
|
||||
case "new":
|
||||
m.vm.$router.push({
|
||||
name: "inv-part",
|
||||
params: { recordid: 0 }
|
||||
});
|
||||
break;
|
||||
case "extensions":
|
||||
let res = await m.vm.$refs.extensions.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Part)
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(
|
||||
window.$gz.type.PartInventoryRestock
|
||||
)
|
||||
);
|
||||
if (res && res.refresh == true) {
|
||||
m.vm.reload = !m.vm.reload;
|
||||
@@ -75,13 +73,18 @@ async function clickHandler(menuItem) {
|
||||
//last report selected is in m.id
|
||||
m.vm.$router.push({
|
||||
name: "ay-report",
|
||||
params: { recordid: m.id, ayatype: window.$gz.type.Part }
|
||||
params: {
|
||||
recordid: m.id,
|
||||
ayatype: window.$gz.type.PartInventoryRestock
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//general report selector chosen
|
||||
|
||||
let res = await m.vm.$refs.reportSelector.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Part)
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(
|
||||
window.$gz.type.PartInventoryRestock
|
||||
)
|
||||
);
|
||||
|
||||
//if null for no selection
|
||||
@@ -95,7 +98,10 @@ async function clickHandler(menuItem) {
|
||||
//Now open the report viewer...
|
||||
m.vm.$router.push({
|
||||
name: "ay-report",
|
||||
params: { recordid: res.id, ayatype: window.$gz.type.Part }
|
||||
params: {
|
||||
recordid: res.id,
|
||||
ayatype: window.$gz.type.PartInventoryRestock
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
@@ -120,7 +126,7 @@ function generateMenu(vm) {
|
||||
helpUrl: "inv-part-restocks",
|
||||
menuItems: [],
|
||||
formData: {
|
||||
ayaType: window.$gz.type.Part
|
||||
ayaType: window.$gz.type.PartInventoryRestock
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user