This commit is contained in:
2021-01-16 16:21:36 +00:00
parent aaaecf5389
commit 1564276bd1

View File

@@ -7,35 +7,87 @@
<v-row> <v-row>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field <v-text-field
v-model="obj.name" v-model="obj.partNumber"
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$ay.t('PartName')" :label="$ay.t('PartPartNumber')"
:rules="[form().required(this, 'name')]" :rules="[form().required(this, 'partNumber')]"
:error-messages="form().serverErrors(this, 'name')" :error-messages="form().serverErrors(this, 'partNumber')"
ref="name" ref="partNumber"
data-cy="name" data-cy="partNumber"
@input="fieldValueChanged('name')" @input="fieldValueChanged('partNumber')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'PartAccountNumber')" v-if="form().showMe(this, 'PartName')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
xl="3" xl="3"
> >
<v-text-field <v-text-field
v-model="obj.accountNumber" v-model="obj.name"
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$ay.t('PartAccountNumber')" :label="$ay.t('PartName')"
ref="accountNumber" ref="name"
data-cy="accountNumber" data-cy="name"
:error-messages="form().serverErrors(this, 'accountNumber')" :error-messages="form().serverErrors(this, 'name')"
@input="fieldValueChanged('accountNumber')" @input="fieldValueChanged('name')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-currency
v-model="obj.cost"
:readonly="formState.readOnly"
:label="$ay.t('PartCost')"
ref="rateYear"
data-cy="rateYear"
:rules="[
form().decimalValid(this, 'cost'),
form().required(this, 'cost')
]"
:error-messages="form().serverErrors(this, 'cost')"
@input="fieldValueChanged('cost')"
></gz-currency>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-currency
v-model="obj.retail"
:readonly="formState.readOnly"
:label="$ay.t('PartRetail')"
ref="rateYear"
data-cy="rateYear"
:rules="[
form().decimalValid(this, 'retail'),
form().required(this, 'retail')
]"
:error-messages="form().serverErrors(this, 'retail')"
@input="fieldValueChanged('retail')"
></gz-currency>
</v-col>
<v-col
v-if="form().showMe(this, 'UnitOfMeasure')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.unitOfMeasure"
:readonly="formState.readOnly"
:label="$ay.t('UnitOfMeasure')"
ref="unitOfMeasure"
data-cy="unitOfMeasure"
:error-messages="form().serverErrors(this, 'unitOfMeasure')"
@input="fieldValueChanged('unitOfMeasure')"
></v-text-field>
</v-col>
<!-- ------------- -->
<v-col <v-col
v-if="form().showMe(this, 'PartPartOverseerID')" v-if="form().showMe(this, 'PartPartOverseerID')"
cols="12" cols="12"
@@ -708,10 +760,18 @@ async function fetchTranslatedText(vm) {
"Part", "Part",
"PartName", "PartName",
"PartNotes", "PartNotes",
"PartAccountNumber", "PartPartNumber",
"PartPartOverseerID", "PartCost",
"PartDateStarted", "PartRetail",
"PartDateCompleted", "PartTrackSerialNumber",
"PartManufacturerID",
"PartManufacturerNumber",
"PartWholesalerID",
"PartWholesalerNumber",
"PartAlternativeWholesalerID",
"PartAlternativeWholesalerNumber",
"UnitOfMeasure",
"PartUPC",
"PartCustom1", "PartCustom1",
"PartCustom2", "PartCustom2",
"PartCustom3", "PartCustom3",
@@ -730,4 +790,42 @@ async function fetchTranslatedText(vm) {
"PartCustom16" "PartCustom16"
]); ]);
} }
/*
[Required]
public string PartNumber { get; set; }
public long? ManufacturerId { get; set; }
public string ManufacturerNumber { get; set; }
public long? WholeSalerId { get; set; }
public string WholeSalerNumber { get; set; }
public long? AlternativeWholeSalerId { get; set; }
public string AlternativeWholeSalerNumber { get; set; }
[Required]
public decimal Cost { get; set; }
[Required]
public decimal Retail { get; set; }
public string UnitOfMeasure { get; set; }
public string UPC { get; set; }
[Required]
public bool TrackSerialNumber { get; set; }
l.Add(new AyaFormFieldDefinition { TKey = "PartName", FieldKey = "PartName" });
l.Add(new AyaFormFieldDefinition { TKey = "PartNotes", FieldKey = "Notes" });
l.Add(new AyaFormFieldDefinition { TKey = "Active", FieldKey = "Active", Hideable = false });
l.Add(new AyaFormFieldDefinition { TKey = "Tags", FieldKey = "Tags" });
l.Add(new AyaFormFieldDefinition { TKey = "Wiki", FieldKey = "Wiki" });
l.Add(new AyaFormFieldDefinition { TKey = "Attachments", FieldKey = "Attachments" });
l.Add(new AyaFormFieldDefinition { TKey = "PartPartNumber", FieldKey = "PartPartNumber", Hideable = false });
l.Add(new AyaFormFieldDefinition { TKey = "PartCost", FieldKey = "PartCost", Hideable = false });
l.Add(new AyaFormFieldDefinition { TKey = "PartRetail", FieldKey = "PartRetail", Hideable = false });
l.Add(new AyaFormFieldDefinition { TKey = "PartTrackSerialNumber", FieldKey = "PartTrackSerialNumber", Hideable = false });
l.Add(new AyaFormFieldDefinition { TKey = "PartManufacturerID", FieldKey = "PartManufacturerID" });
l.Add(new AyaFormFieldDefinition { TKey = "PartManufacturerNumber", FieldKey = "PartManufacturerNumber" });
l.Add(new AyaFormFieldDefinition { TKey = "PartWholesalerID", FieldKey = "PartWholesalerID" });
l.Add(new AyaFormFieldDefinition { TKey = "PartWholesalerNumber", FieldKey = "PartWholesalerNumber" });
l.Add(new AyaFormFieldDefinition { TKey = "PartAlternativeWholesalerID", FieldKey = "PartAlternativeWholesalerID" });
l.Add(new AyaFormFieldDefinition { TKey = "PartAlternativeWholesalerNumber", FieldKey = "PartAlternativeWholesalerNumber" });
l.Add(new AyaFormFieldDefinition { TKey = "UnitOfMeasure", FieldKey = "UnitOfMeasure" });
l.Add(new AyaFormFieldDefinition { TKey = "PartUPC", FieldKey = "PartUPC" });
*/
</script> </script>