This commit is contained in:
2020-11-11 18:56:49 +00:00
parent 6b8bbe23a1
commit ea9d3901c5
2 changed files with 155 additions and 139 deletions

View File

@@ -9,7 +9,10 @@ todo: Uifielddatatype Phone and TimeSpan support at client, translation keys etc
gz-data-table.vue gz-data-table.vue
ay-data-list-view.vue ay-data-list-view.vue
todo: input type email url phone number etc supported on device to activate?
if not, it must be supported somehow so figure it out
NEXT UP: Customer NEXT UP: Customer

View File

@@ -23,94 +23,7 @@
@input="fieldValueChanged('name')" @input="fieldValueChanged('name')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col
v-if="form().showMe(this, 'Serial')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.serial"
:readonly="true"
:disabled="formState.readOnly"
:label="$ay.t('WidgetSerial')"
data-cy="serial"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'Count')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.count"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
:clearable="!formState.readOnly"
@click:clear="fieldValueChanged('count')"
:counter="10"
:label="$ay.t('WidgetCount')"
ref="count"
data-cy="count"
:rules="[form().integerValid(this, 'count')]"
:error-messages="form().serverErrors(this, 'count')"
@input="fieldValueChanged('count')"
type="number"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'DollarAmount')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-currency
v-model="obj.dollarAmount"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
:label="$ay.t('WidgetDollarAmount')"
ref="dollarAmount"
data-cy="dollarAmount"
:rules="[
form().decimalValid(this, 'dollarAmount'),
form().required(this, 'dollarAmount')
]"
:error-messages="form().serverErrors(this, 'dollarAmount')"
@input="fieldValueChanged('dollarAmount')"
></gz-currency>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
:label="$ay.t('WidgetStartDate')"
v-model="obj.startDate"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
ref="startDate"
testId="startDate"
:error-messages="form().serverErrors(this, 'startDate')"
@input="fieldValueChanged('startDate')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
:label="$ay.t('WidgetEndDate')"
:rules="[form().datePrecedence(this, 'startDate', 'endDate')]"
:error-messages="form().serverErrors(this, 'endDate')"
v-model="obj.endDate"
:readonly="formState.readOnly"
:disabled="formState.readOnly"
ref="endDate"
testId="endDate"
@input="fieldValueChanged('endDate')"
></gz-date-time-picker>
</v-col>
<v-col <v-col
v-if="form().showMe(this, 'Active')" v-if="form().showMe(this, 'Active')"
cols="12" cols="12"
@@ -131,47 +44,128 @@
</v-col> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'UserId')" v-if="form().showMe(this, 'AccountNumber')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
xl="3" xl="3"
> >
<gz-pick-list <v-text-field
:ayaType="ayaTypes().User" v-model="obj.accountNumber"
:showEditIcon="true" :readonly="true"
v-model="obj.userId"
:readonly="formState.readOnly"
:disabled="formState.readOnly" :disabled="formState.readOnly"
:label="$ay.t('User')" :label="$ay.t('CustomerAccountNumber')"
ref="userid" ref="accountNumber"
data-cy="userid" data-cy="accountNumber"
:error-messages="form().serverErrors(this, 'userid')" ></v-text-field>
@input="fieldValueChanged('userid')"
></gz-pick-list>
</v-col> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'UserType')" v-if="form().showMe(this, 'EmailAddress')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
xl="3" xl="3"
> >
<v-select <v-text-field
v-model="obj.userType" v-model="obj.emailAddress"
:items="selectLists.usertypes" :readonly="true"
item-text="name"
item-value="id"
:readonly="formState.readOnly"
:disabled="formState.readOnly" :disabled="formState.readOnly"
:label="$ay.t('UserType')" :label="$ay.t('CustomerEmail')"
ref="usertype" ref="emailAddress"
data-cy="usertype" data-cy="emailAddress"
:rules="[form().integerValid(this, 'usertype')]" type="email"
:error-messages="form().serverErrors(this, 'usertype')" ></v-text-field>
@input="fieldValueChanged('usertype')" </v-col>
></v-select>
<v-col
v-if="form().showMe(this, 'Phone1')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.phone1"
:readonly="true"
:disabled="formState.readOnly"
:label="$ay.t('CustomerPhone1')"
ref="phone1"
data-cy="phone1"
type="tel"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'Phone2')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.phone2"
:readonly="true"
:disabled="formState.readOnly"
:label="$ay.t('CustomerPhone2')"
ref="phone2"
data-cy="phone2"
type="tel"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'Phone3')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.phone3"
:readonly="true"
:disabled="formState.readOnly"
:label="$ay.t('CustomerPhone3')"
ref="phone3"
data-cy="phone3"
type="tel"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'Phone4')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.phone4"
:readonly="true"
:disabled="formState.readOnly"
:label="$ay.t('CustomerPhone4')"
ref="phone4"
data-cy="phone4"
type="tel"
></v-text-field>
</v-col>
<v-col
v-if="form().showMe(this, 'Phone5')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.phone5"
:readonly="true"
:disabled="formState.readOnly"
:label="$ay.t('CustomerPhone5')"
ref="phone5"
data-cy="phone5"
type="tel"
></v-text-field>
</v-col> </v-col>
<v-col v-if="form().showMe(this, 'Notes')" cols="12"> <v-col v-if="form().showMe(this, 'Notes')" cols="12">
@@ -777,32 +771,51 @@ async function initForm(vm) {
// //
async function fetchTranslatedText(vm) { async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations([ await window.$gz.translation.cacheTranslations([
"Customer", "CustomerName",
"WidgetName", "CustomerNotes",
"WidgetSerial", "WebAddress",
"WidgetDollarAmount", "CustomerPopUpNotes",
"WidgetCount", "CustomerBillHeadOffice",
"User", "HeadOffice",
"UserType", "CustomerTechNotes",
"WidgetStartDate", "CustomerAccountNumber",
"WidgetEndDate", "UsesBanking",
"WidgetNotes", "Contract",
"WidgetCustom1", "ContractExpires",
"WidgetCustom2", "WorkOrderTemplate",
"WidgetCustom3", "CustomerPhone1",
"WidgetCustom4", "CustomerPhone2",
"WidgetCustom5", "CustomerPhone3",
"WidgetCustom6", "CustomerPhone4",
"WidgetCustom7", "CustomerPhone5",
"WidgetCustom8", "CustomerEmail",
"WidgetCustom9", "AddressPostalDeliveryAddress",
"WidgetCustom10", "AddressPostalCity",
"WidgetCustom11", "AddressPostalStateProv",
"WidgetCustom12", "AddressPostalCountry",
"WidgetCustom13", "AddressPostalPostal",
"WidgetCustom14", "AddressDeliveryAddress",
"WidgetCustom15", "AddressCity",
"WidgetCustom16" "AddressStateProv",
"AddressCountry",
"AddressLatitude",
"AddressLongitude",
"CustomerCustom1",
"CustomerCustom2",
"CustomerCustom3",
"CustomerCustom4",
"CustomerCustom5",
"CustomerCustom6",
"CustomerCustom7",
"CustomerCustom8",
"CustomerCustom9",
"CustomerCustom10",
"CustomerCustom11",
"CustomerCustom12",
"CustomerCustom13",
"CustomerCustom14",
"CustomerCustom15",
"CustomerCustom16"
]); ]);
} }