Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-05-16 17:31:30 +07:00
commit d395bcbab5

View file

@ -72,6 +72,17 @@ const itemsMenu = ref<DataOption[]>([
},
]);
const itemsMenuEmployee = ref<DataOption[]>([
{
id: "1",
name: "ปรับระดับชั้นงาน - ย้าย",
},
{
id: "2",
name: "ถึงแก่กรรม",
},
]);
const uploadUrl = ref<string>("");
const fileName = ref<string>("");
const profilePicture = ref<string>("");
@ -306,6 +317,26 @@ async function otherPost() {
});
}
const appointEmployeePost = async () => {
const formData = new FormData();
formData.append("id", profileId.value);
dialogConfirm($q, async () => {
showLoader();
await http
.post(config.API.appointEmployee(), formData)
.then(() => {
success($q, "ดำเนินการสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
router.push("/appoint-employee");
});
});
};
function closePassaway() {
dialogPassaway.value = false;
}
@ -480,7 +511,11 @@ onMounted(async () => {
icon="mdi-home-export-outline"
dropdown-icon="mdi-chevron-down"
>
<q-list v-for="(item, index) in itemsMenu" key="index">
<q-list
v-if="empType === 'officer'"
v-for="(item, index) in itemsMenu"
:key="index"
>
<q-item
clickable
@click="
@ -503,6 +538,21 @@ onMounted(async () => {
<q-item-section>{{ item.name }}</q-item-section>
</q-item>
</q-list>
<q-list v-else v-for="(item, index) in itemsMenuEmployee" :key="item.id">
<q-item
clickable
@click="
item.name == 'ปรับระดับชั้นงาน - ย้าย'
? appointEmployeePost()
: item.name == 'ถึงแก่กรรม'
? clickPassaway()
: null
"
v-close-popup
>
<q-item-section>{{ item.name }}</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<q-btn
@ -593,7 +643,7 @@ onMounted(async () => {
</q-card>
<q-card bordered class="q-mt-md rounded">
<TabMain :fetchDataPersonal="fetchDataPersonal"/>
<TabMain :fetchDataPersonal="fetchDataPersonal" />
</q-card>
<!-- Dialog แนบใบมรณบตร -->