Merge branch 'develop' into nice_dev
This commit is contained in:
commit
788620f4e3
11 changed files with 178 additions and 32 deletions
|
|
@ -15,7 +15,7 @@
|
|||
{{ header }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!profileStore.isVerified">
|
||||
<div v-if="profileStore.isEdit">
|
||||
<div class="q-gutter-sm q-mx-sm" v-if="addData == false">
|
||||
<q-btn
|
||||
size="12px"
|
||||
|
|
|
|||
|
|
@ -918,7 +918,21 @@ const roleRegistryverify = ref<boolean>(false);
|
|||
function onClickVerified() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {},
|
||||
async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileVerified(profileId.value))
|
||||
.then((res) => {
|
||||
checIsVerified();
|
||||
success($q, "ยืนยันการตรวจสอบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการตรวจสอบข้อมูล",
|
||||
"ต้องการยืนยันการตรวจสอบข้อมูลนี้หรือไม่?"
|
||||
);
|
||||
|
|
@ -927,7 +941,21 @@ function onClickVerified() {
|
|||
function onClickUnlock() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {},
|
||||
async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileVerifiedUnlock(profileId.value))
|
||||
.then((res) => {
|
||||
checIsVerified();
|
||||
success($q, "ปลดล็อคให้แก้ไขข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการปลดให้แก้ไขข้อมูล",
|
||||
"ต้องการยืนยันการปลดให้แก้ไขข้อมูลนี้หรือไม่?"
|
||||
);
|
||||
|
|
@ -985,13 +1013,16 @@ async function checIsVerified() {
|
|||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
profileStore.isVerified = data.isVerified
|
||||
? true
|
||||
: roleRegistryverify.value
|
||||
? true
|
||||
: roleKeyregistry.value
|
||||
? false
|
||||
: false;
|
||||
profileStore.isVerified = data.isVerified;
|
||||
if (roleRegistryverify.value || roleKeyregistry.value) {
|
||||
if (data.isVerified || roleRegistryverify.value) {
|
||||
profileStore.isEdit = false;
|
||||
} else {
|
||||
profileStore.isEdit = true;
|
||||
}
|
||||
} else {
|
||||
profileStore.isEdit = true;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { defineStore } from "pinia";
|
|||
|
||||
export const useProfileDataStore = defineStore("profile", () => {
|
||||
const isVerified = ref<boolean>(false);
|
||||
const isEdit = ref<boolean>(false);
|
||||
const emplployeeClass = ref<string | null>("");
|
||||
interface profile {
|
||||
main: { columns: String[] };
|
||||
|
|
@ -79,6 +80,7 @@ export const useProfileDataStore = defineStore("profile", () => {
|
|||
return {
|
||||
isLoad,
|
||||
isVerified,
|
||||
isEdit,
|
||||
profileData,
|
||||
changeProfileColumns,
|
||||
birthDate,
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
v-if="props.row.isVerified"
|
||||
name="verified"
|
||||
color="green"
|
||||
size="2rem"
|
||||
size="1.4rem"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue