fix: incomplete information

This commit is contained in:
Thanaphon Frappet 2024-12-11 14:59:36 +07:00
parent 6edee8829d
commit c7852c7782

View file

@ -521,7 +521,6 @@ watch(modal, () => {
watch(modalDrawer, () => {
if (!modalDrawer.value) {
console.log('asdasd');
clearData();
}
});
@ -636,7 +635,9 @@ async function triggerDelete(id: string) {
await fetchList({ tree: true, pageSize: 99999, withHead: true });
modalDrawer.value = false;
modal.value = false;
await calculateStats();
await calculateStats(
currentHq.value.id === '' ? undefined : currentHq.value.id,
);
const branchLength = treeData.value.find(
(node) => node.id === expandedTree.value[0],
@ -695,7 +696,6 @@ function triggerEditQrCodeBank(opts?: { save?: boolean }) {
);
}
console.log(deletesStatusQrCodeBankImag.value);
currentIndexQrCodeBank.value = -1;
statusDeletesQrCode.value = false;
}
@ -752,11 +752,6 @@ async function onSubmit(submitSelectedItem?: boolean) {
if (formType.value === 'edit' || submitSelectedItem) {
delete formData.value['code'];
console.log(
deletesStatusQrCodeImag.value,
deletesStatusQrCodeBankImag.value,
);
const res = await branchStore.editById(
currentEdit.value.id,
{
@ -805,6 +800,9 @@ async function onSubmit(submitSelectedItem?: boolean) {
}
await fetchList({ tree: true, pageSize: 99999, withHead: true });
await calculateStats(
currentHq.value.id === '' ? undefined : currentHq.value.id,
);
};
if (
@ -853,24 +851,6 @@ async function onSubmit(submitSelectedItem?: boolean) {
formType.value = 'view';
}
const _stats = await branchStore.stats();
if (_stats) {
stats.value = [
{
icon: 'mdi-home',
count: _stats.hq,
label: 'branch.card.branchHQLabel',
color: 'pink',
},
{
icon: 'mdi-domain',
count: _stats.br,
label: 'branch.card.branchLabel',
color: 'purple',
},
];
}
flowStore.rotate();
}