fix(request-edit): add field isDeputy

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-03-05 13:17:20 +07:00
parent 4276bd83b3
commit a7459a2dc0

View file

@ -59,6 +59,8 @@ const formData = reactive({
const isReadOnly = ref<boolean>(false); //
const workflowRef = ref<any>(null);
const isDeputy = ref<boolean>(false); //
//
const statusOptionMain = ref<DataOption[]>(
store.optionStatus.filter((e) => e.id !== "")
@ -86,6 +88,7 @@ async function fetchDataRequest() {
formData.status = data.status;
formData.remark = data.remark;
isDeputy.value = data.isDeputy;
if (data.status !== "PENDING") {
isReadOnly.value = true;
@ -312,6 +315,7 @@ onMounted(async () => {
!isReadOnly) ||
(typeEmp === 'employee' &&
isStaff &&
isDeputy &&
topicConvert(dataRequest.topic) !== '' &&
!isReadOnly)
"
@ -470,14 +474,14 @@ onMounted(async () => {
:class="
classInput(
isReadOnly ||
(typeEmp === 'employee' && !isStaff) ||
(typeEmp === 'employee' && !isStaff && !isDeputy) ||
(typeEmp !== 'employee' &&
!workflowRef?.permission.isUpdate)
)
"
:readonly="
isReadOnly ||
(typeEmp === 'employee' && !isStaff) ||
(typeEmp === 'employee' && !isStaff && !isDeputy) ||
(typeEmp !== 'employee' &&
!workflowRef?.permission.isUpdate)
"
@ -515,14 +519,14 @@ onMounted(async () => {
:class="
classInput(
isReadOnly ||
(typeEmp === 'employee' && !isStaff) ||
(typeEmp === 'employee' && !isStaff && !isDeputy) ||
(typeEmp !== 'employee' &&
!workflowRef?.permission.isUpdate)
)
"
:readonly="
isReadOnly ||
(typeEmp === 'employee' && !isStaff) ||
(typeEmp === 'employee' && !isStaff && !isDeputy) ||
(typeEmp !== 'employee' &&
!workflowRef?.permission.isUpdate)
"
@ -539,7 +543,10 @@ onMounted(async () => {
class="row col-12 justify-end"
v-if="
(!isReadOnly && workflowRef?.permission.isUpdate) ||
(typeEmp === 'employee' && isStaff && !isReadOnly)
(typeEmp === 'employee' &&
isStaff &&
!isReadOnly &&
isDeputy)
"
>
<q-btn label="บันทึก" color="secondary" type="submit"