This commit is contained in:
2021-04-29 19:11:59 +00:00
parent 27b5416d4e
commit d143e30b96
2 changed files with 9 additions and 15 deletions

View File

@@ -10,7 +10,13 @@ export default {
// called from App.vue
handleOpenObjectClick(vm, tid) {
//expects extra data (tid) to be one of { type: [AYATYPE], id: [RECORDID] }
//NOTE: for new objects all edit pages assume record ID 0 means create rather than open
//NOTE: for new objects all edit pages assume record ID 0 (or null) means create rather than open
//for sake of ease of coding I'm going to assume null id also means make a new record intent
//so I don't have to parse and decide constantly on forms for every control that has a open record link in it
if (tid.id == null) {
tid.id = 0;
}
if (tid.type && tid.id != null) {
//if these come from route parameters they may well be strings

View File

@@ -77,7 +77,7 @@
item-value="id"
dense
:label="$ay.t('NewStatus')"
:prepend-icon="editStateIcon()"
prepend-icon="$ayiEdit"
@click:prepend="handleEditStateClick()"
>
<template v-slot:item="data">
@@ -233,22 +233,10 @@ export default {
}
return "$ayiHistory";
},
editStateIcon: function() {
//assuming if have rights to at least view wo have rights to at least view states
if (this.value != null) {
return "$ayiEdit";
}
return "$ayiPlus";
},
handleEditStateClick: function() {
let idToOpen = 0;
if (this.selectedStatus != null) {
console.log("selectedStatus is", this.selectedStatus);
idToOpen = this.selectedStatus;
}
window.$gz.eventBus.$emit("openobject", {
type: window.$gz.type.WorkOrderStatus,
id: idToOpen
id: this.selectedStatus
});
},
save() {