This commit is contained in:
@@ -29,19 +29,53 @@
|
|||||||
data-cy="partId"
|
data-cy="partId"
|
||||||
@input="addItem()"
|
@input="addItem()"
|
||||||
></gz-pick-list>
|
></gz-pick-list>
|
||||||
<v-simple-table>
|
<v-simple-table class="my-6">
|
||||||
<template v-slot:default>
|
<!-- WIDE TABLE VIEW -->
|
||||||
|
<template v-if="$vuetify.breakpoint.smAndUp" v-slot:default>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-left">
|
<th class="text-left">
|
||||||
{{ $ay.t("PartList") }}
|
{{ $ay.t("PartList") }}
|
||||||
</th>
|
</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="item in sortedList" :key="item.partId">
|
<tr v-for="item in sortedList" :key="item.partId">
|
||||||
<td>{{ item.partDisplay }}</td>
|
<td>{{ item.partDisplay }}</td>
|
||||||
|
<td>
|
||||||
|
<v-icon @click="openItem(item)">
|
||||||
|
$ayiEdit
|
||||||
|
</v-icon>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<v-icon @click="removeItem(item)">
|
||||||
|
$ayiTrashAlt
|
||||||
|
</v-icon>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</template>
|
||||||
|
<!-- MOBILE TABLE VIEW -->
|
||||||
|
<template v-else v-slot:default>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-left">
|
||||||
|
{{ $ay.t("PartList") }}
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="item in sortedList" :key="item.partId">
|
||||||
|
<td>{{ item.partDisplay }}</td>
|
||||||
|
<td>
|
||||||
|
<v-icon small @click="openItem(item)">
|
||||||
|
$ayiEdit
|
||||||
|
</v-icon>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<v-icon small @click="removeItem(item)">
|
<v-icon small @click="removeItem(item)">
|
||||||
$ayiTrashAlt
|
$ayiTrashAlt
|
||||||
@@ -68,7 +102,7 @@
|
|||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="obj.notes"
|
v-model="obj.notes"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
:label="$ay.t('Notes')"
|
:label="$ay.t('PartAssemblyNotes')"
|
||||||
:error-messages="form().serverErrors(this, 'notes')"
|
:error-messages="form().serverErrors(this, 'notes')"
|
||||||
ref="notes"
|
ref="notes"
|
||||||
data-cy="notes"
|
data-cy="notes"
|
||||||
@@ -303,6 +337,12 @@ export default {
|
|||||||
vm.obj.items.splice(index, 1);
|
vm.obj.items.splice(index, 1);
|
||||||
vm.formState.dirty = true;
|
vm.formState.dirty = true;
|
||||||
},
|
},
|
||||||
|
openItem: function(item) {
|
||||||
|
window.$gz.eventBus.$emit("openobject", {
|
||||||
|
type: window.$gz.type.Part,
|
||||||
|
id: item.partId
|
||||||
|
});
|
||||||
|
},
|
||||||
canSave: function() {
|
canSave: function() {
|
||||||
return this.formState.valid && this.formState.dirty;
|
return this.formState.valid && this.formState.dirty;
|
||||||
},
|
},
|
||||||
@@ -649,8 +689,6 @@ function generateMenu(vm) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
|
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
@@ -674,7 +712,7 @@ async function fetchTranslatedText(vm) {
|
|||||||
await window.$gz.translation.cacheTranslations([
|
await window.$gz.translation.cacheTranslations([
|
||||||
"PartAssembly",
|
"PartAssembly",
|
||||||
"PartAssemblyName",
|
"PartAssemblyName",
|
||||||
"Notes",
|
"PartAssemblyNotes",
|
||||||
"PartList",
|
"PartList",
|
||||||
"Part",
|
"Part",
|
||||||
"PartAssemblyCustom1",
|
"PartAssemblyCustom1",
|
||||||
|
|||||||
Reference in New Issue
Block a user