re-factor / cleanup

This commit is contained in:
2022-01-11 22:08:38 +00:00
parent e871708b20
commit e0be8a7cfe
251 changed files with 14680 additions and 15693 deletions

View File

@@ -12,12 +12,12 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
ref="taxPartPurchaseId"
v-model="obj.taxPartPurchaseId"
:aya-type="ayaTypes().TaxCode"
show-edit-icon
v-model="obj.taxPartPurchaseId"
:readonly="formState.readOnly"
:label="$ay.t('GlobalTaxPartPurchaseID')"
ref="taxPartPurchaseId"
data-cy="taxPartPurchaseId"
:error-messages="form().serverErrors(this, `taxPartPurchaseId`)"
@input="fieldValueChanged(`taxPartPurchaseId`)"
@@ -26,12 +26,12 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
ref="taxRateSaleId"
v-model="obj.taxRateSaleId"
:aya-type="ayaTypes().TaxCode"
show-edit-icon
v-model="obj.taxRateSaleId"
:readonly="formState.readOnly"
:label="$ay.t('GlobalTaxRateSaleID')"
ref="taxRateSaleId"
data-cy="taxRateSaleId"
:error-messages="form().serverErrors(this, `taxRateSaleId`)"
@input="fieldValueChanged(`taxRateSaleId`)"
@@ -40,12 +40,12 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list
ref="taxPartSaleId"
v-model="obj.taxPartSaleId"
:aya-type="ayaTypes().TaxCode"
show-edit-icon
v-model="obj.taxPartSaleId"
:readonly="formState.readOnly"
:label="$ay.t('GlobalTaxPartSaleID')"
ref="taxPartSaleId"
data-cy="taxPartSaleId"
:error-messages="form().serverErrors(this, `taxPartSaleId`)"
@input="fieldValueChanged(`taxPartSaleId`)"
@@ -54,10 +54,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
ref="filterCaseSensitive"
v-model="obj.filterCaseSensitive"
:readonly="formState.readOnly"
:label="$ay.t('GlobalFilterCaseSensitive')"
ref="filterCaseSensitive"
data-cy="filterCaseSensitive"
@change="fieldValueChanged('filterCaseSensitive')"
></v-checkbox>
@@ -65,10 +65,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
ref="useInventory"
v-model="obj.useInventory"
:readonly="formState.readOnly"
:label="$ay.t('GlobalUseInventory')"
ref="useInventory"
data-cy="useInventory"
@change="fieldValueChanged('useInventory')"
></v-checkbox>
@@ -76,11 +76,11 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-duration-picker
ref="workOrderCompleteByAge"
v-model="obj.workOrderCompleteByAge"
:readonly="formState.readOnly"
:label="$ay.t('GlobalWorkOrderCompleteByAge')"
:show-seconds="false"
ref="workOrderCompleteByAge"
data-cy="workOrderCompleteByAge"
:error-messages="
form().serverErrors(this, 'workOrderCompleteByAge')
@@ -91,10 +91,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
ref="allowScheduleConflicts"
v-model="obj.allowScheduleConflicts"
:readonly="formState.readOnly"
:label="$ay.t('GlobalAllowScheduleConflicts')"
ref="allowScheduleConflicts"
data-cy="allowScheduleConflicts"
@change="fieldValueChanged('allowScheduleConflicts')"
></v-checkbox>
@@ -102,10 +102,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="workLaborScheduleDefaultMinutes"
v-model="obj.workLaborScheduleDefaultMinutes"
:readonly="formState.readOnly"
:label="$ay.t('GlobalLaborSchedUserDfltTimeSpan')"
ref="workLaborScheduleDefaultMinutes"
data-cy="workLaborScheduleDefaultMinutes"
:rules="[
form().integerValid(this, 'workLaborScheduleDefaultMinutes'),
@@ -120,10 +120,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="workOrderTravelDefaultMinutes"
v-model="obj.workOrderTravelDefaultMinutes"
:readonly="formState.readOnly"
:label="$ay.t('GlobalTravelDfltTimeSpan')"
ref="workOrderTravelDefaultMinutes"
data-cy="workOrderTravelDefaultMinutes"
:rules="[
form().integerValid(this, 'workOrderTravelDefaultMinutes'),
@@ -150,10 +150,10 @@
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-url
ref="webAddress"
v-model="obj.webAddress"
:readonly="formState.readOnly"
:label="$ay.t('WebAddress')"
ref="webAddress"
data-cy="webAddress"
:error-messages="form().serverErrors(this, 'webAddress')"
@input="fieldValueChanged('webAddress')"
@@ -162,10 +162,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-email
ref="emailAddress"
v-model="obj.emailAddress"
:readonly="formState.readOnly"
:label="$ay.t('CompanyEmail')"
ref="emailAddress"
data-cy="emailAddress"
:error-messages="form().serverErrors(this, 'emailAddress')"
@input="fieldValueChanged('emailAddress')"
@@ -174,10 +174,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-phone
ref="phone1"
v-model="obj.phone1"
:readonly="formState.readOnly"
:label="$ay.t('CompanyPhone1')"
ref="phone1"
data-cy="phone1"
:error-messages="form().serverErrors(this, 'phone1')"
@input="fieldValueChanged('phone1')"
@@ -186,10 +186,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-phone
ref="phone2"
v-model="obj.phone2"
:readonly="formState.readOnly"
:label="$ay.t('CompanyPhone2')"
ref="phone2"
data-cy="phone2"
:error-messages="form().serverErrors(this, 'phone2')"
@input="fieldValueChanged('phone2')"
@@ -203,10 +203,10 @@
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="address"
v-model="obj.address"
:readonly="formState.readOnly"
:label="$ay.t('AddressDeliveryAddress')"
ref="address"
data-cy="address"
:error-messages="form().serverErrors(this, 'address')"
@input="fieldValueChanged('address')"
@@ -215,10 +215,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="city"
v-model="obj.city"
:readonly="formState.readOnly"
:label="$ay.t('AddressCity')"
ref="city"
data-cy="city"
:error-messages="form().serverErrors(this, 'city')"
@input="fieldValueChanged('city')"
@@ -227,10 +227,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="region"
v-model="obj.region"
:readonly="formState.readOnly"
:label="$ay.t('AddressStateProv')"
ref="region"
data-cy="region"
:error-messages="form().serverErrors(this, 'region')"
@input="fieldValueChanged('region')"
@@ -239,10 +239,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="country"
v-model="obj.country"
:readonly="formState.readOnly"
:label="$ay.t('AddressCountry')"
ref="country"
data-cy="country"
:error-messages="form().serverErrors(this, 'country')"
@input="fieldValueChanged('country')"
@@ -251,29 +251,29 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-decimal
ref="latitude"
v-model="obj.latitude"
:readonly="formState.readOnly"
:label="$ay.t('AddressLatitude')"
ref="latitude"
data-cy="latitude"
:rules="[form().decimalValid(this, 'latitude')]"
:error-messages="form().serverErrors(this, 'latitude')"
@input="fieldValueChanged('latitude')"
:precision="6"
@input="fieldValueChanged('latitude')"
></gz-decimal>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-decimal
ref="longitude"
v-model="obj.longitude"
:readonly="formState.readOnly"
:label="$ay.t('AddressLongitude')"
ref="longitude"
data-cy="longitude"
:rules="[form().decimalValid(this, 'longitude')]"
:error-messages="form().serverErrors(this, 'longitude')"
@input="fieldValueChanged('longitude')"
:precision="6"
@input="fieldValueChanged('longitude')"
></gz-decimal>
</v-col>
@@ -285,10 +285,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="postAddress"
v-model="obj.postAddress"
:readonly="formState.readOnly"
:label="$ay.t('AddressPostalDeliveryAddress')"
ref="postAddress"
data-cy="postAddress"
:error-messages="form().serverErrors(this, 'postAddress')"
@input="fieldValueChanged('postAddress')"
@@ -297,10 +297,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="postCity"
v-model="obj.postCity"
:readonly="formState.readOnly"
:label="$ay.t('AddressPostalCity')"
ref="postCity"
data-cy="postCity"
:error-messages="form().serverErrors(this, 'postCity')"
@input="fieldValueChanged('postCity')"
@@ -309,10 +309,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="postRegion"
v-model="obj.postRegion"
:readonly="formState.readOnly"
:label="$ay.t('AddressPostalStateProv')"
ref="postRegion"
data-cy="postRegion"
:error-messages="form().serverErrors(this, 'postRegion')"
@input="fieldValueChanged('postRegion')"
@@ -321,10 +321,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="postCountry"
v-model="obj.postCountry"
:readonly="formState.readOnly"
:label="$ay.t('AddressPostalCountry')"
ref="postCountry"
data-cy="postCountry"
:error-messages="form().serverErrors(this, 'postCountry')"
@input="fieldValueChanged('postCountry')"
@@ -333,10 +333,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="postCode"
v-model="obj.postCode"
:readonly="formState.readOnly"
:label="$ay.t('AddressPostalPostal')"
ref="postCode"
data-cy="postCode"
:error-messages="form().serverErrors(this, 'postCode')"
@input="fieldValueChanged('postCode')"
@@ -367,10 +367,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="signatureTitle"
v-model="obj.signatureTitle"
:readonly="formState.readOnly"
:label="$ay.t('GlobalSignatureTitle')"
ref="signatureTitle"
data-cy="signatureTitle"
:error-messages="form().serverErrors(this, 'signatureTitle')"
@input="fieldValueChanged('signatureTitle')"
@@ -379,10 +379,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="signatureHeader"
v-model="obj.signatureHeader"
:readonly="formState.readOnly"
:label="$ay.t('GlobalSignatureHeader')"
ref="signatureHeader"
data-cy="signatureHeader"
:error-messages="form().serverErrors(this, 'signatureHeader')"
@input="fieldValueChanged('signatureHeader')"
@@ -391,10 +391,10 @@
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="signatureFooter"
v-model="obj.signatureFooter"
:readonly="formState.readOnly"
:label="$ay.t('GlobalSignatureFooter')"
ref="signatureFooter"
data-cy="signatureFooter"
:error-messages="form().serverErrors(this, 'signatureFooter')"
@input="fieldValueChanged('signatureFooter')"
@@ -420,10 +420,10 @@
<v-row>
<v-col cols="12" sm="6" lg="2">
<v-checkbox
ref="customerAllowCSR"
v-model="obj.customerAllowCSR"
:readonly="formState.readOnly"
:label="$ay.t('Active')"
ref="customerAllowCSR"
data-cy="customerAllowCSR"
:error-messages="
form().serverErrors(this, 'customerAllowCSR')
@@ -434,10 +434,10 @@
<template v-if="obj.customerAllowCSR">
<v-col cols="12" sm="6" lg="10">
<gz-tag-picker
ref="customerAllowCSRInTags"
v-model="obj.customerAllowCSRInTags"
:readonly="formState.readOnly"
:label="$ay.t('ContactCustomerHeadOfficeTaggedWith')"
ref="customerAllowCSRInTags"
data-cy="customerAllowCSRInTags"
:error-messages="
form().serverErrors(this, 'customerAllowCSRInTags')
@@ -448,6 +448,7 @@
<v-col cols="12">
<v-textarea
ref="customerServiceRequestInfoText"
v-model="obj.customerServiceRequestInfoText"
:readonly="formState.readOnly"
:label="$ay.t('CSRInfoText')"
@@ -457,21 +458,20 @@
'customerServiceRequestInfoText'
)
"
ref="customerServiceRequestInfoText"
data-cy="customerServiceRequestInfoText"
auto-grow
@input="
fieldValueChanged('customerServiceRequestInfoText')
"
auto-grow
></v-textarea>
</v-col>
<v-col cols="12" sm="6" lg="2">
<v-checkbox
ref="customerAllowCreateUnit"
v-model="obj.customerAllowCreateUnit"
:readonly="formState.readOnly"
:label="$ay.t('CustomerAllowCreateUnit')"
ref="customerAllowCreateUnit"
data-cy="customerAllowCreateUnit"
:error-messages="
form().serverErrors(this, 'customerAllowCreateUnit')
@@ -482,12 +482,12 @@
<template v-if="obj.customerAllowCreateUnit">
<v-col cols="12" sm="6" lg="10">
<gz-tag-picker
ref="customerAllowCreateUnitInTags"
v-model="obj.customerAllowCreateUnitInTags"
:readonly="formState.readOnly"
:label="
$ay.t('ContactCustomerHeadOfficeTaggedWith')
"
ref="customerAllowCreateUnitInTags"
data-cy="customerAllowCreateUnitInTags"
:error-messages="
form().serverErrors(
@@ -515,10 +515,10 @@
<v-row>
<v-col cols="12" sm="6" lg="2">
<v-checkbox
ref="customerAllowViewWO"
v-model="obj.customerAllowViewWO"
:readonly="formState.readOnly"
:label="$ay.t('Active')"
ref="customerAllowViewWO"
data-cy="customerAllowViewWO"
:error-messages="
form().serverErrors(this, 'customerAllowViewWO')
@@ -529,10 +529,10 @@
<template v-if="obj.customerAllowViewWO">
<v-col cols="12" sm="6" lg="10">
<gz-tag-picker
ref="customerAllowViewWOInTags"
v-model="obj.customerAllowViewWOInTags"
:readonly="formState.readOnly"
:label="$ay.t('ContactCustomerHeadOfficeTaggedWith')"
ref="customerAllowViewWOInTags"
data-cy="customerAllowViewWOInTags"
:error-messages="
form().serverErrors(
@@ -556,13 +556,13 @@
<v-row>
<v-col cols="12">
<gz-pick-list
ref="customerDefaultWorkOrderReportId"
v-model="obj.customerDefaultWorkOrderReportId"
:aya-type="ayaTypes().Report"
:variant="ayaTypes().WorkOrder.toString()"
show-edit-icon
v-model="obj.customerDefaultWorkOrderReportId"
:readonly="formState.readOnly"
:label="$ay.t('DefaultReport')"
ref="customerDefaultWorkOrderReportId"
data-cy="customerDefaultWorkOrderReportId"
:error-messages="
form().serverErrors(
@@ -581,10 +581,10 @@
<!-- ------------ -->
<v-col cols="12" sm="6">
<gz-tag-picker
ref="customerWorkOrderReport1Tags"
v-model="obj.customerWorkOrderReport1Tags"
:readonly="formState.readOnly"
:label="$ay.t('WorkOrderCustomerTaggedWith')"
ref="customerWorkOrderReport1Tags"
data-cy="customerWorkOrderReport1Tags"
:error-messages="
form().serverErrors(
@@ -602,13 +602,13 @@
<v-col cols="12" sm="6">
<gz-pick-list
ref="customerTagWorkOrderReport1Id"
v-model="obj.customerTagWorkOrderReport1Id"
:aya-type="ayaTypes().Report"
:variant="ayaTypes().WorkOrder.toString()"
show-edit-icon
v-model="obj.customerTagWorkOrderReport1Id"
:readonly="formState.readOnly"
:label="$ay.t('DefaultReport')"
ref="customerTagWorkOrderReport1Id"
data-cy="customerTagWorkOrderReport1Id"
:error-messages="
form().serverErrors(
@@ -627,10 +627,10 @@
<!-- ------------ -->
<v-col cols="12" sm="6">
<gz-tag-picker
ref="customerWorkOrderReport2Tags"
v-model="obj.customerWorkOrderReport2Tags"
:readonly="formState.readOnly"
:label="$ay.t('WorkOrderCustomerTaggedWith')"
ref="customerWorkOrderReport2Tags"
data-cy="customerWorkOrderReport2Tags"
:error-messages="
form().serverErrors(
@@ -648,13 +648,13 @@
<v-col cols="12" sm="6">
<gz-pick-list
ref="customerTagWorkOrderReport2Id"
v-model="obj.customerTagWorkOrderReport2Id"
:aya-type="ayaTypes().Report"
:variant="ayaTypes().WorkOrder.toString()"
show-edit-icon
v-model="obj.customerTagWorkOrderReport2Id"
:readonly="formState.readOnly"
:label="$ay.t('DefaultReport')"
ref="customerTagWorkOrderReport2Id"
data-cy="customerTagWorkOrderReport2Id"
:error-messages="
form().serverErrors(
@@ -673,10 +673,10 @@
<!-- ------------ -->
<v-col cols="12" sm="6">
<gz-tag-picker
ref="customerWorkOrderReport3Tags"
v-model="obj.customerWorkOrderReport3Tags"
:readonly="formState.readOnly"
:label="$ay.t('WorkOrderCustomerTaggedWith')"
ref="customerWorkOrderReport3Tags"
data-cy="customerWorkOrderReport3Tags"
:error-messages="
form().serverErrors(
@@ -694,13 +694,13 @@
<v-col cols="12" sm="6">
<gz-pick-list
ref="customerTagWorkOrderReport3Id"
v-model="obj.customerTagWorkOrderReport3Id"
:aya-type="ayaTypes().Report"
:variant="ayaTypes().WorkOrder.toString()"
show-edit-icon
v-model="obj.customerTagWorkOrderReport3Id"
:readonly="formState.readOnly"
:label="$ay.t('DefaultReport')"
ref="customerTagWorkOrderReport3Id"
data-cy="customerTagWorkOrderReport3Id"
:error-messages="
form().serverErrors(
@@ -719,10 +719,10 @@
<!-- ------------ -->
<v-col cols="12" sm="6">
<gz-tag-picker
ref="customerWorkOrderReport4Tags"
v-model="obj.customerWorkOrderReport4Tags"
:readonly="formState.readOnly"
:label="$ay.t('WorkOrderCustomerTaggedWith')"
ref="customerWorkOrderReport4Tags"
data-cy="customerWorkOrderReport4Tags"
:error-messages="
form().serverErrors(
@@ -740,13 +740,13 @@
<v-col cols="12" sm="6">
<gz-pick-list
ref="customerTagWorkOrderReport4Id"
v-model="obj.customerTagWorkOrderReport4Id"
:aya-type="ayaTypes().Report"
:variant="ayaTypes().WorkOrder.toString()"
show-edit-icon
v-model="obj.customerTagWorkOrderReport4Id"
:readonly="formState.readOnly"
:label="$ay.t('DefaultReport')"
ref="customerTagWorkOrderReport4Id"
data-cy="customerTagWorkOrderReport4Id"
:error-messages="
form().serverErrors(
@@ -765,10 +765,10 @@
<!-- ------------ -->
<v-col cols="12" sm="6">
<gz-tag-picker
ref="customerWorkOrderReport5Tags"
v-model="obj.customerWorkOrderReport5Tags"
:readonly="formState.readOnly"
:label="$ay.t('WorkOrderCustomerTaggedWith')"
ref="customerWorkOrderReport5Tags"
data-cy="customerWorkOrderReport5Tags"
:error-messages="
form().serverErrors(
@@ -786,13 +786,13 @@
<v-col cols="12" sm="6">
<gz-pick-list
ref="customerTagWorkOrderReport5Id"
v-model="obj.customerTagWorkOrderReport5Id"
:aya-type="ayaTypes().Report"
:variant="ayaTypes().WorkOrder.toString()"
show-edit-icon
v-model="obj.customerTagWorkOrderReport5Id"
:readonly="formState.readOnly"
:label="$ay.t('DefaultReport')"
ref="customerTagWorkOrderReport5Id"
data-cy="customerTagWorkOrderReport5Id"
:error-messages="
form().serverErrors(
@@ -820,10 +820,10 @@
<v-row>
<v-col cols="12" sm="6" lg="2">
<v-checkbox
ref="customerAllowWOWiki"
v-model="obj.customerAllowWOWiki"
:readonly="formState.readOnly"
:label="$ay.t('Active')"
ref="customerAllowWOWiki"
data-cy="customerAllowWOWiki"
:error-messages="
form().serverErrors(
@@ -839,6 +839,7 @@
<template v-if="obj.customerAllowWOWiki">
<v-col cols="12" sm="6" lg="10">
<gz-tag-picker
ref="customerAllowWOWikiInTags"
v-model="obj.customerAllowWOWikiInTags"
:readonly="formState.readOnly"
:label="
@@ -846,7 +847,6 @@
'WorkOrderContactCustomerHeadOfficeTaggedWith'
)
"
ref="customerAllowWOWikiInTags"
data-cy="customerAllowWOWikiInTags"
:error-messages="
form().serverErrors(
@@ -875,10 +875,10 @@
<v-row>
<v-col cols="12" sm="6" lg="2">
<v-checkbox
ref="customerAllowWOAttachments"
v-model="obj.customerAllowWOAttachments"
:readonly="formState.readOnly"
:label="$ay.t('Active')"
ref="customerAllowWOAttachments"
data-cy="customerAllowWOAttachments"
:error-messages="
form().serverErrors(
@@ -896,6 +896,7 @@
<template v-if="obj.customerAllowWOAttachments">
<v-col cols="12" sm="6" lg="10">
<gz-tag-picker
ref="customerAllowWOAttachmentsInTags"
v-model="
obj.customerAllowWOAttachmentsInTags
"
@@ -905,7 +906,6 @@
'WorkOrderContactCustomerHeadOfficeTaggedWith'
)
"
ref="customerAllowWOAttachmentsInTags"
data-cy="customerAllowWOAttachmentsInTags"
:error-messages="
form().serverErrors(
@@ -939,10 +939,10 @@
<v-row>
<v-col cols="12" sm="6" lg="2">
<v-checkbox
ref="customerAllowUserSettings"
v-model="obj.customerAllowUserSettings"
:readonly="formState.readOnly"
:label="$ay.t('Active')"
ref="customerAllowUserSettings"
data-cy="customerAllowUserSettings"
:error-messages="
form().serverErrors(this, 'customerAllowUserSettings')
@@ -953,10 +953,10 @@
<template v-if="obj.customerAllowUserSettings">
<v-col cols="12" sm="6" lg="10">
<gz-tag-picker
ref="customerAllowUserSettingsInTags"
v-model="obj.customerAllowUserSettingsInTags"
:readonly="formState.readOnly"
:label="$ay.t('ContactCustomerHeadOfficeTaggedWith')"
ref="customerAllowUserSettingsInTags"
data-cy="customerAllowUserSettingsInTags"
:error-messages="
form().serverErrors(
@@ -983,10 +983,10 @@
<v-row>
<v-col cols="12" sm="6" lg="3">
<v-checkbox
ref="customerAllowNotifyServiceImminent"
v-model="obj.customerAllowNotifyServiceImminent"
:readonly="formState.readOnly"
:label="$ay.t('NotifyEventCustomerServiceImminent')"
ref="customerAllowNotifyServiceImminent"
data-cy="customerAllowNotifyServiceImminent"
:error-messages="
form().serverErrors(
@@ -1003,16 +1003,16 @@
</v-col>
<v-col
v-if="obj.customerAllowNotifyServiceImminent"
cols="12"
sm="6"
lg="9"
v-if="obj.customerAllowNotifyServiceImminent"
>
<gz-tag-picker
ref="customerAllowNotifyServiceImminentInTags"
v-model="obj.customerAllowNotifyServiceImminentInTags"
:readonly="formState.readOnly"
:label="$ay.t('ContactCustomerHeadOfficeTaggedWith')"
ref="customerAllowNotifyServiceImminentInTags"
data-cy="customerAllowNotifyServiceImminentInTags"
:error-messages="
form().serverErrors(
@@ -1032,10 +1032,10 @@
<v-col cols="12" sm="6" lg="3">
<v-checkbox
ref="customerAllowNotifyCSRAccepted"
v-model="obj.customerAllowNotifyCSRAccepted"
:readonly="formState.readOnly"
:label="$ay.t('NotifyEventCSRAccepted')"
ref="customerAllowNotifyCSRAccepted"
data-cy="customerAllowNotifyCSRAccepted"
:error-messages="
form().serverErrors(
@@ -1049,16 +1049,16 @@
></v-checkbox>
</v-col>
<v-col
v-if="obj.customerAllowNotifyCSRAccepted"
cols="12"
sm="6"
lg="9"
v-if="obj.customerAllowNotifyCSRAccepted"
>
<gz-tag-picker
ref="customerAllowNotifyCSRAcceptedInTags"
v-model="obj.customerAllowNotifyCSRAcceptedInTags"
:readonly="formState.readOnly"
:label="$ay.t('ContactCustomerHeadOfficeTaggedWith')"
ref="customerAllowNotifyCSRAcceptedInTags"
data-cy="customerAllowNotifyCSRAcceptedInTags"
:error-messages="
form().serverErrors(
@@ -1078,10 +1078,10 @@
<v-col cols="12" sm="6" lg="3">
<v-checkbox
ref="customerAllowNotifyCSRRejected"
v-model="obj.customerAllowNotifyCSRRejected"
:readonly="formState.readOnly"
:label="$ay.t('NotifyEventCSRRejected')"
ref="customerAllowNotifyCSRRejected"
data-cy="customerAllowNotifyCSRRejected"
:error-messages="
form().serverErrors(
@@ -1095,16 +1095,16 @@
></v-checkbox>
</v-col>
<v-col
v-if="obj.customerAllowNotifyCSRRejected"
cols="12"
sm="6"
lg="9"
v-if="obj.customerAllowNotifyCSRRejected"
>
<gz-tag-picker
ref="customerAllowNotifyCSRRejectedInTags"
v-model="obj.customerAllowNotifyCSRRejectedInTags"
:readonly="formState.readOnly"
:label="$ay.t('ContactCustomerHeadOfficeTaggedWith')"
ref="customerAllowNotifyCSRRejectedInTags"
data-cy="customerAllowNotifyCSRRejectedInTags"
:error-messages="
form().serverErrors(
@@ -1124,10 +1124,10 @@
<v-col cols="12" sm="6" lg="3">
<v-checkbox
ref="customerAllowNotifyWOCreated"
v-model="obj.customerAllowNotifyWOCreated"
:readonly="formState.readOnly"
:label="$ay.t('NotifyEventWorkorderCreatedForCustomer')"
ref="customerAllowNotifyWOCreated"
data-cy="customerAllowNotifyWOCreated"
:error-messages="
form().serverErrors(
@@ -1141,16 +1141,16 @@
></v-checkbox>
</v-col>
<v-col
v-if="obj.customerAllowNotifyWOCreated"
cols="12"
sm="6"
lg="9"
v-if="obj.customerAllowNotifyWOCreated"
>
<gz-tag-picker
ref="customerAllowNotifyWOCreatedInTags"
v-model="obj.customerAllowNotifyWOCreatedInTags"
:readonly="formState.readOnly"
:label="$ay.t('ContactCustomerHeadOfficeTaggedWith')"
ref="customerAllowNotifyWOCreatedInTags"
data-cy="customerAllowNotifyWOCreatedInTags"
:error-messages="
form().serverErrors(
@@ -1170,10 +1170,10 @@
<v-col cols="12" sm="6" lg="3">
<v-checkbox
ref="customerAllowNotifyWOCompleted"
v-model="obj.customerAllowNotifyWOCompleted"
:readonly="formState.readOnly"
:label="$ay.t('NotifyEventWorkorderCompleted')"
ref="customerAllowNotifyWOCompleted"
data-cy="customerAllowNotifyWOCompleted"
:error-messages="
form().serverErrors(
@@ -1187,16 +1187,16 @@
></v-checkbox>
</v-col>
<v-col
v-if="obj.customerAllowNotifyWOCompleted"
cols="12"
sm="6"
lg="9"
v-if="obj.customerAllowNotifyWOCompleted"
>
<gz-tag-picker
ref="customerAllowNotifyWOCompletedInTags"
v-model="obj.customerAllowNotifyWOCompletedInTags"
:readonly="formState.readOnly"
:label="$ay.t('ContactCustomerHeadOfficeTaggedWith')"
ref="customerAllowNotifyWOCompletedInTags"
data-cy="customerAllowNotifyWOCompletedInTags"
:error-messages="
form().serverErrors(
@@ -1229,51 +1229,6 @@
const FORM_KEY = "global-settings-edit";
const API_BASE_URL = "global-biz-setting/";
export default {
async created() {
const vm = this;
try {
await initForm(vm);
vm.rights = window.$gz.role.getRights(window.$gz.type.Global);
vm.formState.readOnly = !vm.rights.change;
window.$gz.eventBus.$on("menu-click", clickHandler);
//NOTE: slightly different in this form as there is only ever a single global object so no need for a bunch of code
//is there already an obj from a prior operation?
if (this.$route.params.obj) {
//yes, no need to fetch it
this.obj = this.$route.params.obj;
window.$gz.form.setFormState({
vm: vm,
loading: false
});
} else {
await vm.getDataFromApi();
}
window.$gz.form.setFormState({
vm: vm,
dirty: false,
valid: true
});
generateMenu(vm);
} catch (error) {
window.$gz.errorHandler.handleFormError(error, vm);
} finally {
vm.formState.ready = true;
}
},
async beforeRouteLeave(to, from, next) {
if (!this.formState.dirty) {
next();
return;
}
if ((await window.$gz.dialog.confirmLeaveUnsaved()) === true) {
next();
} else {
next(false);
}
},
beforeDestroy() {
window.$gz.eventBus.$off("menu-click", clickHandler);
},
data() {
return {
obj: {
@@ -1357,6 +1312,51 @@ export default {
deep: true
}
},
async created() {
const vm = this;
try {
await initForm();
vm.rights = window.$gz.role.getRights(window.$gz.type.Global);
vm.formState.readOnly = !vm.rights.change;
window.$gz.eventBus.$on("menu-click", clickHandler);
//NOTE: slightly different in this form as there is only ever a single global object so no need for a bunch of code
//is there already an obj from a prior operation?
if (this.$route.params.obj) {
//yes, no need to fetch it
this.obj = this.$route.params.obj;
window.$gz.form.setFormState({
vm: vm,
loading: false
});
} else {
await vm.getDataFromApi();
}
window.$gz.form.setFormState({
vm: vm,
dirty: false,
valid: true
});
generateMenu(vm);
} catch (error) {
window.$gz.errorHandler.handleFormError(error, vm);
} finally {
vm.formState.ready = true;
}
},
async beforeRouteLeave(to, from, next) {
if (!this.formState.dirty) {
next();
return;
}
if ((await window.$gz.dialog.confirmLeaveUnsaved()) === true) {
next();
} else {
next(false);
}
},
beforeDestroy() {
window.$gz.eventBus.$off("menu-click", clickHandler);
},
methods: {
canSave: function() {
return this.formState.valid && this.formState.dirty;
@@ -1507,15 +1507,15 @@ function generateMenu(vm) {
/////////////////////////////////
//
//
async function initForm(vm) {
await fetchTranslatedText(vm);
async function initForm() {
await fetchTranslatedText();
}
//////////////////////////////////////////////////////////
//
// Ensures UI translated text is available
//
async function fetchTranslatedText(vm) {
async function fetchTranslatedText() {
await window.$gz.translation.cacheTranslations([
"DefaultReport",
"ContactCustomerHeadOfficeTaggedWith",