This commit is contained in:
@@ -256,12 +256,25 @@
|
|||||||
v-model="obj.template"
|
v-model="obj.template"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
:label="$ay.t('EmailTemplate')"
|
:label="$ay.t('EmailTemplate')"
|
||||||
|
:rules="[form().required(this, 'template')]"
|
||||||
:error-messages="form().serverErrors(this, 'template')"
|
:error-messages="form().serverErrors(this, 'template')"
|
||||||
data-cy="template"
|
data-cy="template"
|
||||||
auto-grow
|
auto-grow
|
||||||
@input="fieldValueChanged('template')"
|
@input="fieldValueChanged('template')"
|
||||||
></v-textarea>
|
></v-textarea>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-select
|
||||||
|
v-if="showWorkOrderTokenSelector"
|
||||||
|
v-model="woToken"
|
||||||
|
prepend-icon="$ayiAt"
|
||||||
|
:items="selectLists.workOrderTemplateTokens"
|
||||||
|
item-text="name"
|
||||||
|
item-value="id"
|
||||||
|
:label="$ay.t('TemplateTokens')"
|
||||||
|
@click:prepend="insertToken(woToken)"
|
||||||
|
></v-select>
|
||||||
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-tab-item>
|
</v-tab-item>
|
||||||
<v-tab-item class="mt-4 ml-2">
|
<v-tab-item class="mt-4 ml-2">
|
||||||
@@ -426,7 +439,10 @@ export default {
|
|||||||
wostatus: [],
|
wostatus: [],
|
||||||
quotestatus: [],
|
quotestatus: [],
|
||||||
eventTypes: [],
|
eventTypes: [],
|
||||||
translations: []
|
translations: [],
|
||||||
|
workOrderTemplateTokens: [],
|
||||||
|
quoteTemplateTokens: [],
|
||||||
|
csrTemplateTokens: []
|
||||||
},
|
},
|
||||||
obj: {
|
obj: {
|
||||||
id: 0,
|
id: 0,
|
||||||
@@ -459,7 +475,8 @@ export default {
|
|||||||
ayaType: window.$gz.type.CustomerNotifySubscription,
|
ayaType: window.$gz.type.CustomerNotifySubscription,
|
||||||
tab: 0,
|
tab: 0,
|
||||||
whoDialog: false,
|
whoDialog: false,
|
||||||
whoList: []
|
whoList: [],
|
||||||
|
woToken: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -537,6 +554,72 @@ export default {
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
showWorkOrderTokenSelector() {
|
||||||
|
switch (this.obj.eventType) {
|
||||||
|
case 4: //WorkorderStatusChange = 4
|
||||||
|
return true;
|
||||||
|
// case 6: //notifyCSRAccepted;
|
||||||
|
// return true;
|
||||||
|
// case 7: //notifyCSRRejected;
|
||||||
|
// return true;
|
||||||
|
// case 9: //QuoteStatusChange = 9
|
||||||
|
// return true;
|
||||||
|
case 21: //notifyServiceImminent;
|
||||||
|
return true;
|
||||||
|
case 24: //WorkorderStatusAge = 24 This is to replace the v7 wo follow up x days after closed notification to send message for follow up after closed
|
||||||
|
return true;
|
||||||
|
case 30: //notifyWOCompleted;
|
||||||
|
return true;
|
||||||
|
case 31: //notifyWOCreated;
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showQuoteTokenSelector() {
|
||||||
|
switch (this.obj.eventType) {
|
||||||
|
// case 4: //WorkorderStatusChange = 4
|
||||||
|
// return true;
|
||||||
|
// case 6: //notifyCSRAccepted;
|
||||||
|
// return true;
|
||||||
|
// case 7: //notifyCSRRejected;
|
||||||
|
// return true;
|
||||||
|
case 9: //QuoteStatusChange = 9
|
||||||
|
return true;
|
||||||
|
// case 21: //notifyServiceImminent;
|
||||||
|
// return true;
|
||||||
|
// case 24: //WorkorderStatusAge = 24 This is to replace the v7 wo follow up x days after closed notification to send message for follow up after closed
|
||||||
|
// return true;
|
||||||
|
// case 30: //notifyWOCompleted;
|
||||||
|
// return true;
|
||||||
|
// case 31: //notifyWOCreated;
|
||||||
|
// return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showCSRTokenSelector() {
|
||||||
|
switch (this.obj.eventType) {
|
||||||
|
// case 4: //WorkorderStatusChange = 4
|
||||||
|
// return true;
|
||||||
|
case 6: //notifyCSRAccepted;
|
||||||
|
return true;
|
||||||
|
case 7: //notifyCSRRejected;
|
||||||
|
return true;
|
||||||
|
// case 9: //QuoteStatusChange = 9
|
||||||
|
// return true;
|
||||||
|
// case 21: //notifyServiceImminent;
|
||||||
|
// return true;
|
||||||
|
// case 24: //WorkorderStatusAge = 24 This is to replace the v7 wo follow up x days after closed notification to send message for follow up after closed
|
||||||
|
// return true;
|
||||||
|
// case 30: //notifyWOCompleted;
|
||||||
|
// return true;
|
||||||
|
// case 31: //notifyWOCreated;
|
||||||
|
// return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -626,6 +709,9 @@ export default {
|
|||||||
window.$gz.eventBus.$off("menu-click", clickHandler);
|
window.$gz.eventBus.$off("menu-click", clickHandler);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
insertToken(t) {
|
||||||
|
console.log("INSERT TOKEN: ", t);
|
||||||
|
},
|
||||||
objectTagsTitle() {
|
objectTagsTitle() {
|
||||||
let objectName = null;
|
let objectName = null;
|
||||||
switch (this.obj.eventType) {
|
switch (this.obj.eventType) {
|
||||||
@@ -1049,5 +1135,43 @@ async function populateSelectionLists(vm) {
|
|||||||
} else {
|
} else {
|
||||||
vm.obj.translationId = res.data.translationId;
|
vm.obj.translationId = res.data.translationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Template tokens
|
||||||
|
workorder:
|
||||||
|
[Client.Label.Name] - Client name, [O.WorkorderStatus] - Workorder status, [Workorder.Label.CustomerContactName] - Contact,
|
||||||
|
[Workorder.Label.CustomerReferenceNumber] - Client Reference #, [Workorder.Label.Summary] - Summary,[WorkorderService.Label.ServiceNumber] - Service Number
|
||||||
|
|
||||||
|
Quote:
|
||||||
|
[Client.Label.Name] - Client name,[WorkorderQuote.Label.QuoteNumber] - Quote Number
|
||||||
|
|
||||||
|
CSR:
|
||||||
|
[Client.Label.Name] - Client name,[ClientServiceRequest.Label.Title] - Title
|
||||||
|
|
||||||
|
*/
|
||||||
|
vm.selectLists.workOrderTemplateTokens.push(
|
||||||
|
...[
|
||||||
|
{ name: vm.$ay.t("Customer"), id: "{{Customer}}" },
|
||||||
|
{
|
||||||
|
name: vm.$ay.t("WorkOrderStatus"),
|
||||||
|
id: "{{WorkOrderStatus}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: vm.$ay.t("WorkOrderCustomerContactName"),
|
||||||
|
id: "{{WorkOrderCustomerContactName}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: vm.$ay.t("WorkOrderCustomerReferenceNumber"),
|
||||||
|
id: "{{WorkOrderCustomerReferenceNumber}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: vm.$ay.t("WorkOrderSummary"),
|
||||||
|
id: "{{WorkOrderSummary}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: vm.$ay.t("WorkOrderSerialNumber"),
|
||||||
|
id: "{{WorkOrderSerialNumber}}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user