From 9497240e47b10e2f9dbaf8644f451719773b449b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 6 Mar 2022 22:28:45 +0000 Subject: [PATCH] --- .../views/customer-notify-subscription.vue | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/ayanova/src/views/customer-notify-subscription.vue b/ayanova/src/views/customer-notify-subscription.vue index 48972ba6..30ac2400 100644 --- a/ayanova/src/views/customer-notify-subscription.vue +++ b/ayanova/src/views/customer-notify-subscription.vue @@ -586,7 +586,7 @@ export default { objectName = this.$ay.t("WorkOrder"); break; default: - return false; + return this.$ay.t("TaggedWith"); } return objectName + " - " + this.$ay.t("TaggedWith"); }, @@ -730,6 +730,32 @@ export default { this.formState.loading = false; } }, + + async who() { + try { + this.formState.loading = true; + if (this.$route.params.recordid == 0) { + return; + } else { + window.$gz.form.deleteAllErrorBoxErrors(this); + const res = await window.$gz.api.post( + API_BASE_URL + "who", + this.obj.customerTags + ); + if (res.error) { + this.formState.serverError = res.error; + window.$gz.form.setErrorBoxErrors(this); + } else { + //todo: show in popup list here + console.log(res.data); + } + } + } catch (ex) { + window.$gz.errorHandler.handleFormError(ex, this); + } finally { + this.formState.loading = false; + } + }, duplicate() { this.$router.push({ name: "cust-notify-subscription", @@ -767,6 +793,9 @@ async function clickHandler(menuItem) { case "duplicate": m.vm.duplicate(); break; + case "who": + m.vm.who(); + break; default: window.$gz.eventBus.$emit( "notify-warning", @@ -830,6 +859,17 @@ function generateMenu(vm) { vm: vm }); } + + if (vm.rights.change && vm.$route.params.recordid != 0) { + menuOptions.menuItems.push({ divider: true, inset: false }); + menuOptions.menuItems.push({ + title: "WhoWillBeNotified", + icon: null, + key: FORM_KEY + ":who", + vm: vm + }); + } + menuOptions.menuItems.push({ divider: true, inset: false }); window.$gz.eventBus.$emit("menu-change", menuOptions); } @@ -870,7 +910,8 @@ async function fetchTranslatedText() { "Translation", "CustomerServiceRequest", "WorkOrder", - "Quote" + "Quote", + "WhoWillBeNotified" ]); }