refactor: update responsible user logic and permissions for task orders
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s

This commit is contained in:
puriphatt 2025-07-04 15:06:44 +07:00
parent ca57f4790c
commit 33e040c21a
4 changed files with 11 additions and 3 deletions

View file

@ -86,7 +86,11 @@ function assignToForm() {
customerDutyCost: attributesForm.value.customerDutyCost ?? 30, customerDutyCost: attributesForm.value.customerDutyCost ?? 30,
companyDuty: attributesForm.value.companyDuty ?? false, companyDuty: attributesForm.value.companyDuty ?? false,
companyDutyCost: attributesForm.value.companyDutyCost ?? 30, companyDutyCost: attributesForm.value.companyDutyCost ?? 30,
responsibleUserLocal: attributesForm.value.responsibleUserLocal ?? true, responsibleUserLocal: attributesForm.value.responsibleUserLocal
? attributesForm.value.responsibleUserLocal
: props.responsibleAreaDistrictId
? false
: true,
responsibleUserId: responsibleUserId:
attributesForm.value.responsibleUserId || props.defaultMessenger, attributesForm.value.responsibleUserId || props.defaultMessenger,
individualDuty: attributesForm.value.individualDuty ?? false, individualDuty: attributesForm.value.individualDuty ?? false,

View file

@ -867,7 +867,7 @@ function toEmployee(employee: RequestData['employee']) {
requestWorkId: value.id || '', requestWorkId: value.id || '',
}, },
value.stepStatus?.[pageState.currentStep - 1] value.stepStatus?.[pageState.currentStep - 1]
?.responsibleUserId, ?.responsibleUserId ?? data.defaultMessengerId,
); );
} }
" "

View file

@ -173,7 +173,7 @@ watch(
</script> </script>
<template> <template>
<FloatingActionButton <FloatingActionButton
v-if="canAccess('related', 'edit')" v-if="canAccess('taskOrder', 'edit')"
style="z-index: 999" style="z-index: 999"
:hide-icon="!pageState.isMessenger" :hide-icon="!pageState.isMessenger"
@click.stop=" @click.stop="

View file

@ -278,6 +278,10 @@ const permissions = {
edit: allRoles.slice(0, 9).filter((r) => r !== 'branch_accountant'), edit: allRoles.slice(0, 9).filter((r) => r !== 'branch_accountant'),
view: allRoles.slice(0, 9), view: allRoles.slice(0, 9),
}, },
taskOrder: {
edit: [...allRoles.slice(0, 6), 'data_entry'],
view: allRoles,
},
related: { related: {
// ใช้กับหลายเมนู // ใช้กับหลายเมนู
edit: allRoles.slice(0, 6), edit: allRoles.slice(0, 6),