This commit is contained in:
@@ -10,7 +10,13 @@ export default {
|
|||||||
// called from App.vue
|
// called from App.vue
|
||||||
handleOpenObjectClick(vm, tid) {
|
handleOpenObjectClick(vm, tid) {
|
||||||
//expects extra data (tid) to be one of { type: [AYATYPE], id: [RECORDID] }
|
//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 (tid.type && tid.id != null) {
|
||||||
//if these come from route parameters they may well be strings
|
//if these come from route parameters they may well be strings
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
item-value="id"
|
item-value="id"
|
||||||
dense
|
dense
|
||||||
:label="$ay.t('NewStatus')"
|
:label="$ay.t('NewStatus')"
|
||||||
:prepend-icon="editStateIcon()"
|
prepend-icon="$ayiEdit"
|
||||||
@click:prepend="handleEditStateClick()"
|
@click:prepend="handleEditStateClick()"
|
||||||
>
|
>
|
||||||
<template v-slot:item="data">
|
<template v-slot:item="data">
|
||||||
@@ -233,22 +233,10 @@ export default {
|
|||||||
}
|
}
|
||||||
return "$ayiHistory";
|
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() {
|
handleEditStateClick: function() {
|
||||||
let idToOpen = 0;
|
|
||||||
if (this.selectedStatus != null) {
|
|
||||||
console.log("selectedStatus is", this.selectedStatus);
|
|
||||||
idToOpen = this.selectedStatus;
|
|
||||||
}
|
|
||||||
window.$gz.eventBus.$emit("openobject", {
|
window.$gz.eventBus.$emit("openobject", {
|
||||||
type: window.$gz.type.WorkOrderStatus,
|
type: window.$gz.type.WorkOrderStatus,
|
||||||
id: idToOpen
|
id: this.selectedStatus
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
|
|||||||
Reference in New Issue
Block a user