refactor: copy now
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s

This commit is contained in:
Thanaphon Frappet 2025-04-24 14:10:11 +07:00
parent a4a101712c
commit 1d38dbc6cf

View file

@ -104,10 +104,6 @@ const {
importProduct,
} = productServiceStore;
const currentCopy = ref<{
id: string | undefined;
type: 'service' | 'product';
}>();
const { workNameItems } = storeToRefs(productServiceStore);
const allStat = ref<{ mode: string; count: number }[]>([]);
@ -1848,16 +1844,9 @@ function handleSubmitSameWorkflow() {
);
}
async function paste() {
if (
!!currentCopy.value &&
currentCopy.value.type === 'service' &&
!!currentCopy.value.id
)
dialogWarningClose(t, {
message: t('dialog.message.warningPaste'),
action: async () => {
const res = await fetchListServiceById(currentCopy.value.id);
async function copy(id: string) {
{
const res = await fetchListServiceById(id);
if (res) {
formService.value = {
code: res.code,
@ -1895,18 +1884,9 @@ async function paste() {
};
});
}
},
});
else {
dialog({
color: 'warning',
icon: 'mdi-alert',
title: t('form.warning.title'),
actionText: t('dialog.action.ok'),
message: t('dialog.message.warningCopyEmpty'),
action: async () => {},
});
}
dialogService.value = true;
}
watch(
@ -3278,11 +3258,7 @@ watch(
:id-name="props.row.name"
@copy="
() => {
notify('create', $t('dialog.message.copy'));
currentCopy = {
id: props.row.id,
type: productAndServiceTab,
};
copy(props.row.id);
}
"
@view="