Merge branch 'develop' into devTee
This commit is contained in:
commit
989741a7b4
6 changed files with 223 additions and 166 deletions
|
|
@ -176,21 +176,29 @@ defineExpose({
|
|||
: ""
|
||||
: item.isApproveSetting
|
||||
? item.isApprove === true
|
||||
? "อนุมันติ"
|
||||
? "อนุมัติ"
|
||||
: item.isApprove === false
|
||||
? "ไม่อนุมันติ"
|
||||
? "ไม่อนุมัติ"
|
||||
: ""
|
||||
: ""
|
||||
}}
|
||||
</q-item-label>
|
||||
|
||||
<q-btn
|
||||
v-if="item.isComment && state === index + 1"
|
||||
v-if="
|
||||
item.isComment &&
|
||||
state === index + 1 &&
|
||||
item.isAccept === null &&
|
||||
item.reason === null &&
|
||||
item.isApprove === null
|
||||
"
|
||||
unelevated
|
||||
rounded
|
||||
@click.prevent="
|
||||
(dataUserComment = item), (modalApprove = true)
|
||||
"
|
||||
label="แสดงความเห็น"
|
||||
color="public"
|
||||
color="blue"
|
||||
/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
|
|
|||
|
|
@ -17,8 +17,14 @@ const $q = useQuasar();
|
|||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const store = useRequestEditStore();
|
||||
const { date2Thai, showLoader, hideLoader, messageError, success } =
|
||||
useCounterMixin();
|
||||
const {
|
||||
dialogConfirm,
|
||||
date2Thai,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
} = useCounterMixin();
|
||||
|
||||
const requestId = ref<string>(route.params.id.toString());
|
||||
const dataRequest = ref<any>({
|
||||
|
|
@ -35,6 +41,7 @@ const formData = reactive({
|
|||
});
|
||||
|
||||
const isReadOnly = ref<boolean>(false); //อ่ายได้อย่างเดียว
|
||||
const workflowRef = ref<any>(null);
|
||||
//ข้อมูลรายการสถานะ
|
||||
const statusOptionMain = ref<DataOption[]>(
|
||||
store.optionStatus.filter((e) => e.id !== "")
|
||||
|
|
@ -55,13 +62,13 @@ async function fetchDataRequest() {
|
|||
detail: data.detail,
|
||||
};
|
||||
|
||||
// formData.status = data.status;
|
||||
// formData.remark = data.remark;
|
||||
// if (data.status !== "PENDING") {
|
||||
// isReadOnly.value = true;
|
||||
// } else {
|
||||
// isReadOnly.value = false;
|
||||
// }
|
||||
formData.status = data.status;
|
||||
formData.remark = data.remark;
|
||||
if (data.status !== "PENDING") {
|
||||
isReadOnly.value = true;
|
||||
} else {
|
||||
isReadOnly.value = false;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -71,6 +78,28 @@ async function fetchDataRequest() {
|
|||
});
|
||||
}
|
||||
|
||||
/** function บันทึกรายการคำร้อง*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.patch(config.API.requestEdit + `${requestId.value}`, {
|
||||
status: formData.status,
|
||||
remark: formData.remark,
|
||||
})
|
||||
.then(async () => {
|
||||
await fetchDataRequest();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function ค้นหาคำใน select สถานะคำร้อง
|
||||
* @param val คำค้น
|
||||
|
|
@ -203,64 +232,93 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
|
||||
<!-- แก้ไขสถานะคำร้อง -->
|
||||
<q-card bordered class="row col-12">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
แก้ไขสถานะคำร้อง
|
||||
<q-form
|
||||
class="col-12"
|
||||
greedy
|
||||
@submit.prevent
|
||||
@validation-success="onSubmit"
|
||||
>
|
||||
<q-card bordered class="row col-12">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
แก้ไขสถานะคำร้อง
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-card-section class="col-12">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-md-12">
|
||||
<q-select
|
||||
:class="classInput(isReadOnly)"
|
||||
:readonly="isReadOnly"
|
||||
v-model="formData.status"
|
||||
label="สถานะ"
|
||||
dense
|
||||
outlined
|
||||
emit-value
|
||||
map-options
|
||||
:options="statusOption"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกสถานะ'}`]"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
use-input
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
@filter="(inputValue:string,
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-card-section class="col-12">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-md-12">
|
||||
<q-select
|
||||
:class="
|
||||
classInput(
|
||||
isReadOnly || !workflowRef?.permission.isUpdate
|
||||
)
|
||||
"
|
||||
:readonly="isReadOnly || !workflowRef?.permission.isUpdate"
|
||||
v-model="formData.status"
|
||||
label="สถานะ"
|
||||
dense
|
||||
outlined
|
||||
emit-value
|
||||
map-options
|
||||
:options="statusOption"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกสถานะ'}`]"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
use-input
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterOption(inputValue, doneFn
|
||||
) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-12">
|
||||
<q-input
|
||||
:class="classInput(isReadOnly)"
|
||||
:readonly="isReadOnly"
|
||||
v-model="formData.remark"
|
||||
label="หมายเหตุ"
|
||||
dense
|
||||
outlined
|
||||
type="textarea"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<div class="col-xs-12 col-md-12">
|
||||
<q-input
|
||||
:class="
|
||||
classInput(
|
||||
isReadOnly || !workflowRef?.permission.isUpdate
|
||||
)
|
||||
"
|
||||
:readonly="isReadOnly || !workflowRef?.permission.isUpdate"
|
||||
v-model="formData.remark"
|
||||
label="หมายเหตุ"
|
||||
dense
|
||||
outlined
|
||||
type="textarea"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="row col-12 justify-end"
|
||||
v-if="!isReadOnly && workflowRef?.permission.isUpdate"
|
||||
>
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึก</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
</q-card>
|
||||
</q-form>
|
||||
|
||||
<div class="col-12">
|
||||
<Workflow :id="requestId" sys-name=" REGISTRY_PROFILE" />
|
||||
<Workflow
|
||||
ref="workflowRef"
|
||||
:id="requestId"
|
||||
sys-name="REGISTRY_PROFILE"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const stat = ref<StatResponse>({
|
|||
total: 0,
|
||||
unContain: 0,
|
||||
prepareContain: 0,
|
||||
contain: 0,
|
||||
done: 0,
|
||||
disclaim: 0,
|
||||
report: 0,
|
||||
});
|
||||
|
|
@ -49,7 +49,7 @@ async function getStat() {
|
|||
total: statCard.total,
|
||||
unContain: statCard.unContain,
|
||||
prepareContain: statCard.prepareContain,
|
||||
contain: statCard.contain,
|
||||
done: statCard.done,
|
||||
disclaim: statCard.disclaim,
|
||||
report: statCard.report,
|
||||
};
|
||||
|
|
@ -140,7 +140,7 @@ onMounted(async () => {
|
|||
color="orange"
|
||||
/>
|
||||
<CardTop
|
||||
:amount="stat.contain"
|
||||
:amount="stat.done"
|
||||
label="จำนวนที่บรรจุแล้ว"
|
||||
color="#4154B3"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ interface StatResponse {
|
|||
total: number;
|
||||
unContain: number;
|
||||
prepareContain: number;
|
||||
contain: number;
|
||||
done: number;
|
||||
disclaim: number;
|
||||
report: number;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const {
|
|||
/** ตัวแปร */
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const roleUser = ref<string>("");
|
||||
// const roleUser = ref<string>("");
|
||||
const dataProfile = ref<DataProfile>();
|
||||
|
||||
const id = ref<string>(route.params.id.toString());
|
||||
|
|
@ -210,72 +210,72 @@ function popUp(action: "pass" | "passNot") {
|
|||
}
|
||||
|
||||
//เงื่อนไขpop up
|
||||
function conditionPopup() {
|
||||
if (myFormConfirm.value !== null) {
|
||||
myFormConfirm.value.validate().then(async (check) => {
|
||||
if (check) {
|
||||
if (actionPass.value) {
|
||||
await confirmpopUp();
|
||||
} else {
|
||||
await rejectpopUp();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// function conditionPopup() {
|
||||
// if (myFormConfirm.value !== null) {
|
||||
// myFormConfirm.value.validate().then(async (check) => {
|
||||
// if (check) {
|
||||
// if (actionPass.value) {
|
||||
// await confirmpopUp();
|
||||
// } else {
|
||||
// await rejectpopUp();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
//pop up ยืนยันการอนุญาต
|
||||
async function confirmpopUp() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const body = {
|
||||
reason: reasonReign.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.resignConfirm(roleUser.value, id.value), body)
|
||||
.then(() => {
|
||||
success($q, "การอนุญาตสำเร็จ");
|
||||
closeModal();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchData(id.value);
|
||||
});
|
||||
},
|
||||
"ยืนยันการอนุญาต",
|
||||
"ต้องการยืนยันการอนุญาตการลานี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
// async function confirmpopUp() {
|
||||
// dialogConfirm(
|
||||
// $q,
|
||||
// async () => {
|
||||
// const body = {
|
||||
// reason: reasonReign.value,
|
||||
// };
|
||||
// await http
|
||||
// .put(config.API.resignConfirm(roleUser.value, id.value), body)
|
||||
// .then(() => {
|
||||
// success($q, "การอนุญาตสำเร็จ");
|
||||
// closeModal();
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// fetchData(id.value);
|
||||
// });
|
||||
// },
|
||||
// "ยืนยันการอนุญาต",
|
||||
// "ต้องการยืนยันการอนุญาตการลานี้หรือไม่ ?"
|
||||
// );
|
||||
// }
|
||||
|
||||
//pop up การยับยั้งสำเร็จ
|
||||
async function rejectpopUp() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const body = {
|
||||
reason: reasonReign.value,
|
||||
date: dateBreak.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.resignReject(roleUser.value, id.value), body)
|
||||
.then(() => {
|
||||
success($q, "การยับยั้งสำเร็จ");
|
||||
closeModal();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchData(id.value);
|
||||
});
|
||||
},
|
||||
"ยืนยันการยับยั้ง",
|
||||
"ต้องการยืนยันการยับยั้งนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
// async function rejectpopUp() {
|
||||
// dialogConfirm(
|
||||
// $q,
|
||||
// async () => {
|
||||
// const body = {
|
||||
// reason: reasonReign.value,
|
||||
// date: dateBreak.value,
|
||||
// };
|
||||
// await http
|
||||
// .put(config.API.resignReject(roleUser.value, id.value), body)
|
||||
// .then(() => {
|
||||
// success($q, "การยับยั้งสำเร็จ");
|
||||
// closeModal();
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// fetchData(id.value);
|
||||
// });
|
||||
// },
|
||||
// "ยืนยันการยับยั้ง",
|
||||
// "ต้องการยืนยันการยับยั้งนี้หรือไม่ ?"
|
||||
// );
|
||||
// }
|
||||
|
||||
/**
|
||||
* กดยกเลิก
|
||||
|
|
@ -511,20 +511,20 @@ onMounted(async () => {
|
|||
fetchData(id.value);
|
||||
fetchFile();
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
const commander = await user.role.includes("commander");
|
||||
const oligarch = await user.role.includes("oligarch");
|
||||
const officer = await user.role.includes("officer");
|
||||
if (commander) {
|
||||
roleUser.value = "commander";
|
||||
} else if (oligarch) {
|
||||
roleUser.value = "oligarch";
|
||||
} else if (officer) {
|
||||
roleUser.value = "officer";
|
||||
} else {
|
||||
roleUser.value = "admin";
|
||||
}
|
||||
}
|
||||
// if (user) {
|
||||
// const commander = await user.role.includes("commander");
|
||||
// const oligarch = await user.role.includes("oligarch");
|
||||
// const officer = await user.role.includes("officer");
|
||||
// if (commander) {
|
||||
// roleUser.value = "commander";
|
||||
// } else if (oligarch) {
|
||||
// roleUser.value = "oligarch";
|
||||
// } else if (officer) {
|
||||
// roleUser.value = "officer";
|
||||
// } else {
|
||||
// roleUser.value = "admin";
|
||||
// }
|
||||
// }
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -551,7 +551,7 @@ onMounted(async () => {
|
|||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||
<q-space />
|
||||
<!-- <q-space />
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
|
|
@ -583,7 +583,7 @@ onMounted(async () => {
|
|||
label="ยับยั้ง"
|
||||
@click="popUp('passNot')"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
|
|
@ -749,8 +749,8 @@ onMounted(async () => {
|
|||
<div
|
||||
v-if="
|
||||
dataDetail.status == 'WAITTING' &&
|
||||
roleUser === 'officer' &&
|
||||
!checkRoutePermisson
|
||||
!checkRoutePermisson &&
|
||||
workflowRef?.permission.isUpdate
|
||||
"
|
||||
>
|
||||
<div v-if="!conditions">
|
||||
|
|
@ -793,7 +793,7 @@ onMounted(async () => {
|
|||
v-model="isNoDebt"
|
||||
label="ไม่เป็นหนี้สหกรณ์"
|
||||
color="teal"
|
||||
:disable="!conditions"
|
||||
:disable="!conditions && !workflowRef?.permission.isUpdate"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
|
@ -801,7 +801,7 @@ onMounted(async () => {
|
|||
v-model="isNoBurden"
|
||||
label="ไม่มีภาระผูกพันค้ำประกันทุนการศึกษา"
|
||||
color="teal"
|
||||
:disable="!conditions"
|
||||
:disable="!conditions && !workflowRef?.permission.isUpdate"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
|
@ -809,15 +809,9 @@ onMounted(async () => {
|
|||
v-model="isDiscipline"
|
||||
label="ไม่มีพฤติการณ์ทางวินัย"
|
||||
color="teal"
|
||||
:disable="!conditions"
|
||||
:disable="!conditions && !workflowRef?.permission.isUpdate"
|
||||
/>
|
||||
</div>
|
||||
<!-- <q-option-group
|
||||
:options="checkboxOp"
|
||||
type="checkbox"
|
||||
v-model="checkboxGroup"
|
||||
:disable="!conditions"
|
||||
/> -->
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
|
|
@ -833,8 +827,8 @@ onMounted(async () => {
|
|||
<q-file
|
||||
v-if="
|
||||
dataDetail.status == 'WAITTING' &&
|
||||
roleUser === 'officer' &&
|
||||
!checkRoutePermisson
|
||||
!checkRoutePermisson &&
|
||||
workflowRef?.permission.isUpdate
|
||||
"
|
||||
class="col-12"
|
||||
for="#evidenceFiles"
|
||||
|
|
@ -891,7 +885,6 @@ onMounted(async () => {
|
|||
<q-btn
|
||||
v-if="
|
||||
dataDetail.status == 'WAITTING' &&
|
||||
roleUser === 'officer' &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
dense
|
||||
|
|
@ -1066,7 +1059,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
<q-space />
|
||||
|
||||
<div v-if="roleUser === 'officer' && !checkRoutePermisson">
|
||||
<div v-if="!checkRoutePermisson && workflowRef?.permission.isUpdate">
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
|
|
@ -1357,7 +1350,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<DialogFooter :editvisible="true" :save="conditionPopup" />
|
||||
<!-- <DialogFooter :editvisible="true" :save="conditionPopup" /> -->
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
|
|
@ -133,9 +133,7 @@ async function fetchList() {
|
|||
page: formQuery.page,
|
||||
pageSize: formQuery.pageSize,
|
||||
kpiPeriodId: store.formQuery.round,
|
||||
keyword: store.formQuery.keyword
|
||||
? store.formQuery.keyword.replace(/\s+/g, "")
|
||||
: store.formQuery.keyword,
|
||||
keyword: store.formQuery.keyword,
|
||||
};
|
||||
|
||||
await http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue