Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop

This commit is contained in:
setthawutttty 2024-02-12 14:34:53 +07:00
commit e3d2b99bdc
2 changed files with 37 additions and 2 deletions

View file

@ -201,7 +201,7 @@ export default {
profileVerified: (profileId: string) => `${profile}verified/${profileId}`,
profileVerifiedUnlock: (profileId: string) =>
`${profile}not-verified/${profileId}`,
profileSendVerified: (profileId: string) => `${profile}send-verified/${profileId}`,
registryNew,
registryNewId: (id: string) => `${registryNew}${id}`,

View file

@ -155,7 +155,7 @@
<q-space />
<div v-if="roleRegistryverify || roleKeyregistry">
<q-btn
v-if="!profileStore.isVerified && roleRegistryverify"
v-if="!profileStore.isVerified && isSendVerified && roleRegistryverify"
outlined
color="green"
icon="verified"
@ -164,6 +164,16 @@
>
<q-tooltip>นยนการตรวจสอบขอม</q-tooltip>
</q-btn>
<q-btn
v-else-if="!profileStore.isVerified && !isSendVerified && roleKeyregistry"
outlined
color="secondary"
icon="send"
@click="onClickSend"
label="ส่งข้อมูลไปตรวจสอบ"
>
<q-tooltip>งขอมลไปตรวจสอบ</q-tooltip>
</q-btn>
<q-btn
v-else-if="profileStore.isVerified && roleRegistryverify"
outlined
@ -938,6 +948,29 @@ function onClickVerified() {
);
}
function onClickSend() {
dialogConfirm(
$q,
async () => {
showLoader();
await http
.put(config.API.profileSendVerified(profileId.value))
.then((res) => {
checIsVerified();
success($q, "ส่งข้อมูลไปตรวจสอบสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการส่งข้อมูลไปตรวจสอบ",
"ต้องการยืนยันการส่งข้อมูลไปตรวจสอบหรือไม่?"
);
}
function onClickUnlock() {
dialogConfirm(
$q,
@ -1006,6 +1039,7 @@ const fetchData = async () => {
});
};
const isSendVerified = ref<boolean>(false);
async function checIsVerified() {
// showLoader();
await http
@ -1014,6 +1048,7 @@ async function checIsVerified() {
const data = res.data.result;
profileStore.isVerified = data.isVerified;
isSendVerified.value = data.isSendVerified;
if (roleRegistryverify.value || roleKeyregistry.value) {
if (data.isVerified || roleRegistryverify.value) {
profileStore.isEdit = false;