This commit is contained in:
2021-09-19 22:21:14 +00:00
parent 42fc8a8f52
commit a059ad79f2
2 changed files with 30 additions and 1 deletions

View File

@@ -394,7 +394,31 @@ export default {
}, },
methods: { methods: {
newItem(atype) { newItem(atype) {
console.log("new item", atype); let newEvent = this.events[this.events.length - 1];
console.log("new item", { type: atype, event: newEvent });
switch (atype) {
case this.$ay.ayt().WorkOrderItemScheduledUser:
this.$router.push({
name: "workorder-edit",
params: {
recordid: 0,
createNew: {
createType: atype,
start: newEvent.start,
end: newEvent.end,
userId: this.$store.state.userId,
name: this.$store.state.userName
}
}
});
break;
case this.$ay.ayt().Reminder:
this.$router.push({
name: "reminder-edit",
params: { recordid: 0 }
});
break;
}
//remove faux item, server will provide it back once it's created anyway //remove faux item, server will provide it back once it's created anyway
this.events.splice(this.events.length - 1); this.events.splice(this.events.length - 1);

View File

@@ -126,6 +126,7 @@ export default {
//new path //new path
if (this.$route.params.obj) { if (this.$route.params.obj) {
//DUPLICATE OR GEN FROM QUOTE OR PM //DUPLICATE OR GEN FROM QUOTE OR PM
//A whole work order basically is presented here
this.obj = this.$route.params.obj; this.obj = this.$route.params.obj;
this.obj.concurrency = undefined; this.obj.concurrency = undefined;
@@ -138,6 +139,10 @@ export default {
}); });
setDirty = true; setDirty = true;
} else { } else {
console.log(
"svc-workorder::created new, no obj, params are:",
this.$route.params
);
//NEW //NEW
this.formState.loading = false; this.formState.loading = false;
this.formState.ready = true; this.formState.ready = true;