Skip to content

Commit 9b2f92a

Browse files
committed
Change local mail button to be similar to IFXMailButton but with first choice
- The first choice is to do what it has always done, namely bring up a dialog that either sends to the managers of the selected labs or lets the admin send to specific email addresses. - The other choices bring up the Compose Mailing page with either To, CC or BCC set to the lab managers of the selected labs.
1 parent 4388dc8 commit 9b2f92a

File tree

1 file changed

+56
-4
lines changed

1 file changed

+56
-4
lines changed

src/components/billingRecord/IFXBillingRecordListDecimal.vue

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ export default {
129129
{ text: 'Lab', value: 'account.organization', sortable: true },
130130
{ text: 'Expense Code / PO', value: 'account.slug', sortable: true },
131131
{ text: 'Product', value: 'product', sortable: true },
132-
{ text: 'Start Date', value: 'startDate', sortable: true, hide: !this.showDates && !this.showStartDate, namedSlot: true },
132+
{
133+
text: 'Start Date',
134+
value: 'startDate',
135+
sortable: true,
136+
hide: !this.showDates && !this.showStartDate,
137+
namedSlot: true,
138+
},
133139
{ text: 'End Date', value: 'endDate', sortable: true, hide: !this.showDates, namedSlot: true },
134140
{ text: 'Charge', value: 'decimalCharge', sortable: true, width: '100px' },
135141
{ text: 'Percent', value: 'percent', sortable: true, width: '100px' },
@@ -654,6 +660,20 @@ export default {
654660
allowEditingRecords(item) {
655661
return item.currentState !== 'FINAL'
656662
},
663+
goToComposeMessage(field) {
664+
this.recipientField = field
665+
const orgs = this.selected.length ? this.selected : this.filteredItems
666+
const orgSlugs = orgs.map((item) => item.account.organization)
667+
this.$router.push({
668+
name: 'MailingCompose',
669+
params: {
670+
labManagerOrgSlugs: [...new Set(orgSlugs)],
671+
message: null,
672+
subject: null,
673+
recipientField: this.recipientField,
674+
},
675+
})
676+
},
657677
defaultNotifyLabManagers() {
658678
const orgSlugs = this.items.map((item) => item.account.organization)
659679
this.$api.notifyLabManagers(
@@ -838,9 +858,41 @@ export default {
838858
<v-tooltip top v-else>
839859
<template v-slot:activator="{ on, attrs }">
840860
<div v-on="on">
841-
<v-btn small fab color="green" v-bind="attrs" @click="openNotifyDialog">
842-
<v-icon dark color="white">mdi-email-send-outline</v-icon>
843-
</v-btn>
861+
<v-speed-dial direction="bottom" v-model="mailFab" v-bind="attrs">
862+
<template v-slot:activator>
863+
<v-btn v-model="mailFab" small color="green" fab>
864+
<v-icon color="white" dark v-if="mailFab">mdi-close</v-icon>
865+
<v-icon color="white" dark v-else>mdi-email-send-outline</v-icon>
866+
</v-btn>
867+
</template>
868+
<v-btn small color="teal" class="white--text" @click="openNotifyDialog">
869+
Notify Lab Managers
870+
</v-btn>
871+
<v-btn
872+
xSmall
873+
color="#A4F323"
874+
@click="goToComposeMessage('to')"
875+
:disabled="!filteredItems.length"
876+
>
877+
Send a message to selected Lab Managers
878+
</v-btn>
879+
<v-btn
880+
xSmall
881+
color="#86C61D"
882+
@click="goToComposeMessage('cc')"
883+
:disabled="!filteredItems.length"
884+
>
885+
CC selected Lab Managers
886+
</v-btn>
887+
<v-btn
888+
xSmall
889+
color="#669617"
890+
@click="goToComposeMessage('bcc')"
891+
:disabled="!filteredItems.length"
892+
>
893+
BCC selected Lab Managers
894+
</v-btn>
895+
</v-speed-dial>
844896
845897
<v-dialog v-bind="attrs" v-model="notifyDialog" max-width="600px">
846898
<v-card>

0 commit comments

Comments
 (0)