This commit is contained in:
2021-02-22 23:47:53 +00:00
parent 3f94db609e
commit 6582861474
2 changed files with 53 additions and 4 deletions

View File

@@ -222,6 +222,7 @@
</v-col>
<!-- ################################ PURCHASE ORDER ITEMS LIST ############################### -->
{{ formState.serverError }}
<v-col cols="12">
<v-data-table
:headers="headerList"
@@ -233,7 +234,7 @@
hide-default-footer
data-cy="itemsTable"
dense
:item-class="rowClasses"
:item-class="poItemsRowClasses"
>
<template v-slot:top>
<span class="title">{{ $ay.t("PurchaseOrderItemList") }}</span>
@@ -324,7 +325,7 @@
:label="$ay.t('Part')"
ref="Items.PartId"
data-cy="Items.PartId"
:rules="[form().required(this, 'Items.PartId')]"
:rules="[form().required(this, 'Items.PartId')]"
></gz-pick-list>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
@@ -848,8 +849,12 @@ export default {
}
},
methods: {
rowClasses: function(item, index) {
console.log("row_classes", { item: item });
poItemsRowClasses: function(item) {
let hasError = this.form().childRowHasError(this, "Items", item.index);
if (hasError) {
return "error";
}
//console.log("row_classes", { item: item, hasError: hasError });
//if item.index in errors collection then highlight the row
// if (item.calories < 200) {
// return "orange"; //can also return multiple classes e.g ["orange","disabled"]