fixing registry loading & display value

This commit is contained in:
Warunee Tamkoo 2024-11-29 14:14:30 +07:00
parent 1a82792683
commit bcd5d1d56c
4 changed files with 21 additions and 21 deletions

View file

@ -186,7 +186,6 @@ function onClickViewDetail(id: string) {
/** function redirect ไปหน้ารายการคำร้องขอแก้ไขข้อมูล*/
function redirectToPagePetition() {
if (empType.value === "officer") {
router.push(`/registry-officer/request-edit`);
} else {
@ -210,7 +209,10 @@ watch(
<div class="col-12 row q-pb-sm q-col-gutter-sm items-center">
<div class="row q-gutter-sm">
<q-btn
v-if="empType === 'officer' || empType === 'perm' && checkPermission($route)?.attrIsUpdate"
v-if="
empType === 'officer' ||
(empType === 'perm' && checkPermission($route)?.attrIsUpdate)
"
color="primary"
label="รายการคำร้องขอแก้ไข"
@click="redirectToPagePetition()"

View file

@ -59,8 +59,6 @@ const editId = ref<string>("");
const dialog = ref<boolean>(false); // popup -
const dialogStatus = ref<string>("create"); //
const filterSearch = ref<string>(""); //
const historyDialog = ref<boolean>(false); //
const historyKeyword = ref<string>(""); //
//
const changeNameData = reactive<FormChangeName>({
profileId: profileId.value,
@ -235,7 +233,6 @@ function onSubmit() {
* @param id
*/
async function uploadProfile(id: string) {
showLoader();
await http
.post(
config.API.subFile(
@ -259,7 +256,6 @@ async function uploadProfile(id: string) {
})
.catch((err) => {
messageError($q, err);
hideLoader();
});
}
@ -269,7 +265,6 @@ async function uploadProfile(id: string) {
* @param file ไฟลเอกสาร
*/
async function uploadFileURL(uploadUrl: string, file: any) {
showLoader();
await axios
.put(uploadUrl, file, {
headers: {
@ -281,9 +276,6 @@ async function uploadFileURL(uploadUrl: string, file: any) {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
@ -334,11 +326,11 @@ async function addData() {
.then(async (res) => {
subId.value = await res.data.result;
await uploadProfile(res.data.result);
await fetchData(profileId.value);
await props?.fetchDataPersonal?.();
await fetchDataPersonal();
success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
success($q, "บันทึกข้อมูลสำเร็จ");
fetchData(profileId.value);
props?.fetchDataPersonal?.();
fetchDataPersonal();
})
.catch((err) => {
messageError($q, err);
@ -364,11 +356,11 @@ function editData(idData: string) {
)
.then(async () => {
await uploadProfile(subId.value);
await fetchData(profileId.value);
await props.fetchDataPersonal?.();
await fetchDataPersonal();
success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
success($q, "บันทึกข้อมูลสำเร็จ");
fetchData(profileId.value);
props.fetchDataPersonal?.();
fetchDataPersonal();
})
.catch((err) => {
messageError($q, err);

View file

@ -1019,14 +1019,14 @@ onMounted(async () => {
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!fromData.isLive ? 'grey' : 'primary'"
color="primary"
/>
<q-radio
v-model="fromData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!fromData.isLive ? 'grey' : 'red'"
color="primary"
label="ถึงแก่กรรม"
dense
/>

View file

@ -966,7 +966,13 @@ onMounted(async () => {
empType === ""
? ""
: formDetail?.posType?.posTypeShortName
} ${formDetail?.posLevel?.posLevelName}` || "-"
? formDetail?.posType?.posTypeShortName
: ""
} ${
formDetail?.posLevel?.posLevelName
? formDetail?.posLevel?.posLevelName
: "-"
}`
}}
</div>
</div>