Sale tracking #514

Merged
jsegarra merged 11 commits from :feature/SaleTracking into dev 2024-07-15 09:24:36 +00:00
1 changed files with 5 additions and 2 deletions
Showing only changes of commit 34ee92ac24 - Show all commits

View File

@ -29,6 +29,7 @@ const itemShelvignsSales = ref([]);
const shelvingsOptions = ref([]); const shelvingsOptions = ref([]);
const parkingsOptions = ref([]); const parkingsOptions = ref([]);
const saleTrackingUrl = computed(() => `SaleTrackings/${route.params.id}/filter`); const saleTrackingUrl = computed(() => `SaleTrackings/${route.params.id}/filter`);
const oldQuantity = ref(null);
watch( watch(
() => route.params.id, () => route.params.id,
@ -191,10 +192,12 @@ const showShelving = async (sale) => {
const updateQuantity = async (sale) => { const updateQuantity = async (sale) => {
try { try {
if (oldQuantity.value === sale.quantity) return;
const params = { const params = {
quantity: sale.quantity, quantity: sale.quantity,
}; };
await axios.patch(`ItemShelvingSales/${sale.id}`, params); await axios.patch(`ItemShelvingSales/${sale.id}`, params);
oldQuantity.value = null;
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
@ -431,7 +434,7 @@ const clickControled = (sale) => {
<span v-if="row.subName" class="color-vn-label"> <span v-if="row.subName" class="color-vn-label">
{{ row.subName }} {{ row.subName }}
</span> </span>
<FetchedTags :item="row" :max-length="6" /> <FetchedTags :item="row" :max-length="6" tag="value" />
</div> </div>
</QTd> </QTd>
</template> </template>
@ -498,7 +501,7 @@ const clickControled = (sale) => {
v-model.number="row.quantity" v-model.number="row.quantity"
@keyup.enter="updateQuantity(row)" @keyup.enter="updateQuantity(row)"
@blur="updateQuantity(row)" @blur="updateQuantity(row)"
@focus="edit.oldQuantity = row.quantity" @focus="oldQuantity = row.quantity"
/> />
</QTd> </QTd>
</template> </template>