เพิ่มปุ่มส่งข้อมูลไปตรวจสอบ

This commit is contained in:
Warunee Tamkoo 2024-02-12 14:31:56 +07:00
parent 5a7622a0c7
commit afd02241d7
2 changed files with 37 additions and 2 deletions

View file

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

View file

@ -155,7 +155,7 @@
<q-space /> <q-space />
<div v-if="roleRegistryverify || roleKeyregistry"> <div v-if="roleRegistryverify || roleKeyregistry">
<q-btn <q-btn
v-if="!profileStore.isVerified && roleRegistryverify" v-if="!profileStore.isVerified && isSendVerified && roleRegistryverify"
outlined outlined
color="green" color="green"
icon="verified" icon="verified"
@ -164,6 +164,16 @@
> >
<q-tooltip>นยนการตรวจสอบขอม</q-tooltip> <q-tooltip>นยนการตรวจสอบขอม</q-tooltip>
</q-btn> </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 <q-btn
v-else-if="profileStore.isVerified && roleRegistryverify" v-else-if="profileStore.isVerified && roleRegistryverify"
outlined 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() { function onClickUnlock() {
dialogConfirm( dialogConfirm(
$q, $q,
@ -1006,6 +1039,7 @@ const fetchData = async () => {
}); });
}; };
const isSendVerified = ref<boolean>(false);
async function checIsVerified() { async function checIsVerified() {
// showLoader(); // showLoader();
await http await http
@ -1014,6 +1048,7 @@ async function checIsVerified() {
const data = res.data.result; const data = res.data.result;
profileStore.isVerified = data.isVerified; profileStore.isVerified = data.isVerified;
isSendVerified.value = data.isSendVerified;
if (roleRegistryverify.value || roleKeyregistry.value) { if (roleRegistryverify.value || roleKeyregistry.value) {
if (data.isVerified || roleRegistryverify.value) { if (data.isVerified || roleRegistryverify.value) {
profileStore.isEdit = false; profileStore.isEdit = false;