This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
MISC ITEMS THAT CAME UP
|
||||
|
||||
todo: Active field is probably very seldom used, perhaps it should always be the last field in the forms?
|
||||
|
||||
todo: I keep thinking I should just move to LT keys for all datalist and formfield and picklist column definitions, drop the tkey and fieldkey type fields in favor of just one key that is the translation key
|
||||
But maybe I'd regret that later if I have a really complex object with multiple of the same field names?
|
||||
Maybe it's a complete non-issue and fuck it
|
||||
|
||||
@@ -18,6 +18,24 @@
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitSerial')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="obj.serial"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('LoanUnitSerial')"
|
||||
ref="serial"
|
||||
data-cy="serial"
|
||||
:error-messages="form().serverErrors(this, 'serial')"
|
||||
@input="fieldValueChanged('serial')"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'Active')"
|
||||
cols="12"
|
||||
@@ -36,84 +54,159 @@
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<!--
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitAccountNumber')"
|
||||
v-if="form().showMe(this, 'LoanUnitRateHour')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="obj.accountNumber"
|
||||
<gz-currency
|
||||
v-model="obj.rateHour"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('LoanUnitAccountNumber')"
|
||||
ref="accountNumber"
|
||||
data-cy="accountNumber"
|
||||
:error-messages="form().serverErrors(this, 'accountNumber')"
|
||||
@input="fieldValueChanged('accountNumber')"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitLoanUnitOverseerID')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-pick-list
|
||||
:ayaType="ayaTypes().User"
|
||||
:variant="'inside'"
|
||||
:showEditIcon="true"
|
||||
v-model="obj.projectOverseerId"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('LoanUnitLoanUnitOverseerID')"
|
||||
ref="projectOverseerId"
|
||||
data-cy="projectOverseerId"
|
||||
:error-messages="form().serverErrors(this, 'projectOverseerId')"
|
||||
@input="fieldValueChanged('projectOverseerId')"
|
||||
></gz-pick-list>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitDateStarted')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-date-time-picker
|
||||
:label="$ay.t('LoanUnitDateStarted')"
|
||||
v-model="obj.dateStarted"
|
||||
:readonly="formState.readOnly"
|
||||
ref="dateStarted"
|
||||
testId="dateStarted"
|
||||
:error-messages="form().serverErrors(this, 'dateStarted')"
|
||||
@input="fieldValueChanged('dateStarted')"
|
||||
></gz-date-time-picker>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitDateCompleted')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-date-time-picker
|
||||
:label="$ay.t('LoanUnitDateCompleted')"
|
||||
:label="$ay.t('LoanUnitRateHour')"
|
||||
ref="rateHour"
|
||||
data-cy="rateHour"
|
||||
:rules="[
|
||||
form().datePrecedence(this, 'dateStarted', 'dateCompleted')
|
||||
form().decimalValid(this, 'rateHour'),
|
||||
form().required(this, 'rateHour')
|
||||
]"
|
||||
:error-messages="form().serverErrors(this, 'dateCompleted')"
|
||||
v-model="obj.dateCompleted"
|
||||
:error-messages="form().serverErrors(this, 'rateHour')"
|
||||
@input="fieldValueChanged('rateHour')"
|
||||
></gz-currency>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitRateHalfDay')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-currency
|
||||
v-model="obj.rateHalfDay"
|
||||
:readonly="formState.readOnly"
|
||||
ref="dateCompleted"
|
||||
testId="dateCompleted"
|
||||
@input="fieldValueChanged('dateCompleted')"
|
||||
></gz-date-time-picker>
|
||||
</v-col> -->
|
||||
:label="$ay.t('LoanUnitRateHalfDay')"
|
||||
ref="rateHalfDay"
|
||||
data-cy="rateHalfDay"
|
||||
:rules="[
|
||||
form().decimalValid(this, 'rateHalfDay'),
|
||||
form().required(this, 'rateHalfDay')
|
||||
]"
|
||||
:error-messages="form().serverErrors(this, 'rateHalfDay')"
|
||||
@input="fieldValueChanged('rateHalfDay')"
|
||||
></gz-currency>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitRateDay')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-currency
|
||||
v-model="obj.rateDay"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('LoanUnitRateDay')"
|
||||
ref="rateDay"
|
||||
data-cy="rateDay"
|
||||
:rules="[
|
||||
form().decimalValid(this, 'rateDay'),
|
||||
form().required(this, 'rateDay')
|
||||
]"
|
||||
:error-messages="form().serverErrors(this, 'rateDay')"
|
||||
@input="fieldValueChanged('rateDay')"
|
||||
></gz-currency>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitRateWeek')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-currency
|
||||
v-model="obj.rateWeek"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('LoanUnitRateWeek')"
|
||||
ref="rateWeek"
|
||||
data-cy="rateWeek"
|
||||
:rules="[
|
||||
form().decimalValid(this, 'rateWeek'),
|
||||
form().required(this, 'rateWeek')
|
||||
]"
|
||||
:error-messages="form().serverErrors(this, 'rateWeek')"
|
||||
@input="fieldValueChanged('rateWeek')"
|
||||
></gz-currency>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitRateMonth')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-currency
|
||||
v-model="obj.rateMonth"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('LoanUnitRateMonth')"
|
||||
ref="rateMonth"
|
||||
data-cy="rateMonth"
|
||||
:rules="[
|
||||
form().decimalValid(this, 'rateMonth'),
|
||||
form().required(this, 'rateMonth')
|
||||
]"
|
||||
:error-messages="form().serverErrors(this, 'rateMonth')"
|
||||
@input="fieldValueChanged('rateMonth')"
|
||||
></gz-currency>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitRateYear')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-currency
|
||||
v-model="obj.rateYear"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('LoanUnitRateYear')"
|
||||
ref="rateYear"
|
||||
data-cy="rateYear"
|
||||
:rules="[
|
||||
form().decimalValid(this, 'rateYear'),
|
||||
form().required(this, 'rateYear')
|
||||
]"
|
||||
:error-messages="form().serverErrors(this, 'rateYear')"
|
||||
@input="fieldValueChanged('rateYear')"
|
||||
></gz-currency>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'LoanUnitDefaultRate')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<v-select
|
||||
v-model="obj.defaultRate"
|
||||
:items="selectLists.loanunitrateunit"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
:readonly="formState.readOnly"
|
||||
:label="$ay.t('LoanUnitDefaultRate')"
|
||||
ref="defaultRate"
|
||||
data-cy="defaultRate"
|
||||
:rules="[form().integerValid(this, 'defaultRate')]"
|
||||
:error-messages="form().serverErrors(this, 'defaultRate')"
|
||||
@input="fieldValueChanged('defaultRate')"
|
||||
></v-select>
|
||||
</v-col>
|
||||
<!-- --------------------------------- -->
|
||||
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
||||
<v-textarea
|
||||
@@ -253,10 +346,39 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||
selectLists: {
|
||||
loanunitrateunit: []
|
||||
},
|
||||
obj:
|
||||
//IMPORTANT NOTE: Fields that are NON NULLABLE in the schema for the table but *are* hideable **MUST** have a default value set here or else there will be no way to save the record
|
||||
//I.E. Serial, usertype fields, ACTIVE
|
||||
//Also, if it's a non-nullable Enum backed field then it should have a valid selection i.e. not zero if there is no zero
|
||||
/*
|
||||
{
|
||||
"data": {
|
||||
"id": 4,
|
||||
"concurrency": 3041599,
|
||||
"name": "Fantastic Concrete Chicken",
|
||||
"active": true,
|
||||
"notes": "Velit iste aspernatur quia numquam consectetur nemo maiores.",
|
||||
"wiki": null,
|
||||
"customFields": null,
|
||||
"tags": [
|
||||
"quince"
|
||||
],
|
||||
"serial": "44420135",
|
||||
"workOrderItemLoanId": null,
|
||||
"rateHour": 6.6008,
|
||||
"rateHalfDay": 26.403,
|
||||
"rateDay": 52.8061,
|
||||
"rateWeek": 242.908,
|
||||
"rateMonth": 1108.9278,
|
||||
"rateYear": 12631.2152,
|
||||
"defaultRate": 3,
|
||||
"unitId": null
|
||||
}
|
||||
}
|
||||
*/
|
||||
{
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -266,10 +388,16 @@ export default {
|
||||
wiki: null,
|
||||
customFields: "{}",
|
||||
tags: [],
|
||||
dateStarted: window.$gz.locale.nowUTC8601String(),
|
||||
dateCompleted: null,
|
||||
projectOverseerId: null,
|
||||
accountNumber: null
|
||||
serial: null,
|
||||
workOrderItemLoanId: null,
|
||||
rateHour: 0,
|
||||
rateHalfDay: 0,
|
||||
rateDay: 0,
|
||||
rateWeek: 0,
|
||||
rateMonth: 0,
|
||||
rateYear: 0,
|
||||
defaultRate: 1,
|
||||
unitId: null
|
||||
},
|
||||
formState: {
|
||||
ready: false,
|
||||
@@ -744,4 +872,15 @@ async function fetchTranslatedText(vm) {
|
||||
"LoanUnitCustom16"
|
||||
]);
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
//
|
||||
//
|
||||
async function populateSelectionLists(vm) {
|
||||
//ensure the pick lists required are pre-fetched
|
||||
await window.$gz.enums.fetchEnumList("loanunitrateunit");
|
||||
vm.selectLists.loanunitrateunit = window.$gz.enums.getSelectionList(
|
||||
"loanunitrateunit"
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user