This commit is contained in:
2021-01-18 23:35:17 +00:00
parent b43846df6d
commit b7bedd5c4b
3 changed files with 14 additions and 96 deletions

View File

@@ -17,7 +17,7 @@
@input="fieldValueChanged('name')"
></v-text-field>
</v-col>
{{ sortedList }}
<v-col cols="12">
<gz-pick-list
v-if="!formState.readOnly"
@@ -41,9 +41,13 @@
</th>
</tr>
</thead>
<!-- margin only if > xs and hide underline in qty field and onchange in qty if less than 1 make 1 -->
<tbody>
<tr v-for="item in sortedList" :key="item.partId">
<!-- Note the use of partid which is unique plus quantity, without that quantity Vue doesn't update the display of quantity if it's changed by the quanittyChanged method -->
<tr
v-for="item in sortedList()"
:key="item.partId.toString() + item.quantity.toString()"
>
<td>
{{ item.partDisplay }}
<template v-if="$vuetify.breakpoint.xs">
@@ -287,7 +291,8 @@ export default {
deep: true
}
},
computed: {
methods: {
sortedList: function() {
function compare(a, b) {
if (a.partDisplay < b.partDisplay) return -1;
@@ -296,9 +301,7 @@ export default {
}
return this.obj.items.slice().sort(compare);
}
},
methods: {
},
addItem: function() {
let vm = this;
let selected = vm.$refs.partId.getFullSelectionValue();
@@ -346,6 +349,8 @@ export default {
}
item.quantity = 1;
//vm.obj.name = vm.obj.name + "X";
//vm.$set(vm.obj.items, index, item);
//vm.obj.items.splice(index, 1, item);
}