refactor: export product
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s

This commit is contained in:
Thanaphon Saengchan 2025-09-18 13:21:11 +07:00
parent d53eb15a88
commit d2acd6ba4c
3 changed files with 82 additions and 3 deletions

View file

@ -102,6 +102,8 @@ const {
deleteWork,
importProduct,
productExport,
} = productServiceStore;
const { workNameItems } = storeToRefs(productServiceStore);
@ -1896,6 +1898,25 @@ async function submitWorkName(
else await editWork(workId, data);
}
async function triggerExport() {
productExport({
pageSize: 100_000,
productGroupId: currentIdGroup.value,
query: !!inputSearchProductAndService.value
? inputSearchProductAndService.value
: undefined,
status:
currentStatus.value === 'INACTIVE'
? 'INACTIVE'
: currentStatus.value === 'ACTIVE'
? 'ACTIVE'
: undefined,
startDate: new Date(searchDate.value[0]),
endDate: new Date(searchDate.value[1]),
});
}
watch(
() => formService.value.attributes.workflowId,
async (a, b) => {
@ -2229,7 +2250,6 @@ watch(
</AdvanceSearch>
</template>
</q-input>
<div class="row col-md-6" style="white-space: nowrap">
<q-select
v-show="$q.screen.gt.sm"
@ -2780,6 +2800,13 @@ watch(
}
"
/>
<SaveButton
icon-only
:icon="'material-symbols:download'"
color="var(--info-bg)"
@click.stop="triggerExport()"
/>
</div>
<div class="row col-md-6" style="white-space: nowrap">
@ -3632,7 +3659,7 @@ watch(
:delete-data="() => deleteGroupById()"
:close="
() => {
(drawerInfo = false), (currentIdGroupType = '');
((drawerInfo = false), (currentIdGroupType = ''));
}
"
hide-action