refactor: update emit type and simplify attribute handling in MessengerExpansion and RequestListView components

This commit is contained in:
puriphatt 2024-12-26 13:45:36 +07:00
parent a709ab6692
commit f485d95e81
2 changed files with 5 additions and 9 deletions

View file

@ -16,7 +16,7 @@ const props = defineProps<{
}>();
const emit = defineEmits<{
(e: 'updateAttributes', value: AttributesForm): void;
(e: 'updateAttributes', value: Step): void;
}>();
const requestListStore = useRequestList();
@ -69,7 +69,7 @@ async function triggerSubmit() {
if (res) {
attributesForm.value = JSON.parse(JSON.stringify(formData.value));
state.isEdit = false;
emit('updateAttributes', attributesForm.value);
emit('updateAttributes', res);
}
}

View file

@ -169,10 +169,11 @@ async function triggerChangeStatusWork(step: Step, responsibleUserId?: string) {
message: t('dialog.message.warningSelectDeliveryStaff'),
action: async () => {
await nextTick();
return;
},
});
return;
}
const res = await requestListStore.editStatusRequestWork(step);
if (res) {
const indexWork = workList.value?.findIndex(
@ -782,12 +783,7 @@ function goToQuotation(
"
@update-attributes="
(opt) => {
value.stepStatus[
pageState.currentStep - 1
].responsibleUserId = opt.responsibleUserId;
value.stepStatus[
pageState.currentStep - 1
].responsibleUserLocal = opt.responsibleUserLocal;
value.stepStatus[pageState.currentStep - 1] = opt;
}
"
/>