This commit is contained in:
2021-01-15 22:15:29 +00:00
parent 344346c0dd
commit 4036794dd3

View File

@@ -17,7 +17,31 @@
@input="fieldValueChanged('name')" @input="fieldValueChanged('name')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
{{ obj.items }}
<v-col cols="12">
<v-simple-table>
<template v-slot:default>
<thead>
<tr>
<th class="text-left">
{{ $ay.t("PartList") }}
</th>
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="item in obj.items" :key="item.partId">
<td>{{ item.partDisplay }}</td>
<td>
<v-icon small @click="removeItem(item)">
$ayiTrashAlt
</v-icon>
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox <v-checkbox
v-model="obj.active" v-model="obj.active"
@@ -30,11 +54,11 @@
></v-checkbox> ></v-checkbox>
</v-col> </v-col>
<!-- --------------------------------- --> <!-- --------------------------------- -->
<v-col v-if="form().showMe(this, 'Notes')" cols="12"> <v-col v-if="form().showMe(this, 'PartAssemblyNotes')" cols="12">
<v-textarea <v-textarea
v-model="obj.notes" v-model="obj.notes"
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$ay.t('PartAssemblyNotes')" :label="$ay.t('Notes')"
:error-messages="form().serverErrors(this, 'notes')" :error-messages="form().serverErrors(this, 'notes')"
ref="notes" ref="notes"
data-cy="notes" data-cy="notes"
@@ -278,6 +302,9 @@ export default {
} }
}, },
methods: { methods: {
removeItem: function(item) {
console.log(item);
},
canSave: function() { canSave: function() {
return this.formState.valid && this.formState.dirty; return this.formState.valid && this.formState.dirty;
}, },
@@ -673,8 +700,9 @@ async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations([ await window.$gz.translation.cacheTranslations([
"PartAssembly", "PartAssembly",
"PartAssemblyName", "PartAssemblyName",
"PartAssemblyNotes", "Notes",
"PartList", "PartList",
"Part",
"PartAssemblyCustom1", "PartAssemblyCustom1",
"PartAssemblyCustom2", "PartAssemblyCustom2",
"PartAssemblyCustom3", "PartAssemblyCustom3",