fix: product count & ref delete & fetch worker

This commit is contained in:
puriphatt 2024-10-15 09:42:16 +07:00
parent 62edd051e6
commit 0b83c943c0
2 changed files with 47 additions and 8 deletions

View file

@ -4,7 +4,7 @@ import { storeToRefs } from 'pinia';
import { useQuasar } from 'quasar';
import { computed, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { dialogCheckData } from 'stores/utils';
import { quotationProductTree } from './utils';
import { ProductTree, quotationProductTree } from './utils';
// NOTE: Import stores
import { setLocale, dateFormat, calculateAge } from 'src/utils/datetime';
@ -544,11 +544,11 @@ watch(
url.searchParams.set('customerBranchId', v);
history.pushState({}, '', url.toString());
// if (!v) return;
// const retEmp = await customerStore.fetchBranchEmployee(v);
// if (retEmp) {
// workerList.value = retEmp.data.result;
// }
if (!v) return;
const retEmp = await customerStore.fetchBranchEmployee(v);
if (retEmp) {
workerList.value = retEmp.data.result;
}
},
);
@ -561,6 +561,15 @@ watch(
history.pushState({}, '', url.toString());
},
);
const productServiceNodes = ref<ProductTree>();
watch(
() => productServiceList.value,
() => {
productServiceNodes.value = quotationProductTree(productServiceList.value);
},
);
</script>
<template>
@ -942,7 +951,7 @@ watch(
<!-- add product service -->
<ProductServiceForm
v-model="pageState.productServiceModal"
:nodes="quotationProductTree(productServiceList)"
v-model:nodes="productServiceNodes"
v-model:product-group="productGroup"
v-model:product-list="productList"
v-model:service-list="serviceList"