ปรับโครงสร้างและเปลี่ยนสถานะทดลองงาน

This commit is contained in:
Warunee Tamkoo 2024-06-20 11:44:17 +07:00
parent 8d438e9bc7
commit 4c0c0551f8
3 changed files with 37 additions and 29 deletions

View file

@ -61,7 +61,10 @@ const orgLevelOptionMain = ref<DataOption[]>([
{ name: "ระดับฝ่าย/กลุ่มงาน", id: "SECTION" },
]);
const orgLevelSubOptionMain = ref<DataOption[]>([]);
const orgLevelSubOptionMain = ref<DataOption[]>([
{ name: "สำนัก/สำนักงาน", id: "OFFICER" },
{ name: "สำนักงานเขต", id: "DISTRICT" },
]);
const orgLevelOption = ref<DataOption[]>([]);
@ -143,8 +146,7 @@ function onSubmit() {
["org" + type + "PhoneIn"]: formData.orgPhoneIn,
["org" + type + "Fax"]: formData.orgFax,
["org" + type + "Rank"]: formData.orgLevel,
["org" + type + "RankSub"]:
level.value !== 0 ? formData.orgLevelSub : undefined,
["org" + type + "RankSub"]: formData.orgLevelSub,
[nameId]: rootId,
responsibility:
formData.responsibility != null ? formData.responsibility : "",
@ -276,7 +278,7 @@ function selectOrgLevele(val: string, status: boolean = true) {
switch (val) {
case "OFFICE":
orgLevelSubOptionMain.value = [
{ name: "ระดับกอง", id: "DIVISION" },
{ name: "กอง", id: "DIVISION" },
{
name: "สำนักงาน",
id: "OFFICE",
@ -289,7 +291,7 @@ function selectOrgLevele(val: string, status: boolean = true) {
break;
case "DIVISION":
orgLevelSubOptionMain.value = [
{ name: "ระดับส่วน", id: "SECTION" },
{ name: "ส่วน", id: "SECTION" },
{
name: "กลุ่มภารกิจ",
id: "MISSION",
@ -298,7 +300,7 @@ function selectOrgLevele(val: string, status: boolean = true) {
case "SECTION":
orgLevelSubOptionMain.value = [
{ name: "ระดับฝ่าย", id: "FACTION" },
{ name: "ฝ่าย", id: "FACTION" },
{
name: "กลุ่มงาน",
id: "WORK",
@ -419,9 +421,8 @@ function selectOrgLevele(val: string, status: boolean = true) {
lazy-rules
/>
</div>
<div class="col-4" v-if="formData.orgLevel !== '' && level !== 0">
<div class="col-4" v-if="formData.orgLevel !== ''">
<q-select
:readonly="level === 0 || formData.orgLevel === 'DEPARTMENT'"
ref="orgLevelSubRef"
dense
hide-bottom-space

View file

@ -327,22 +327,22 @@ async function filterKeyword2Fn(page: number) {
* @param id string
* @param data type
*/
async function fecthlistProbation(id: string, data: any) {
try {
probationlist.value = [];
const res = await http.post(
config.API.profileSearchNewOcIdType(id, "officer"),
{
criterias: data,
}
);
return res.data.result;
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
}
// async function fecthlistProbation(id: string, data: any) {
// try {
// probationlist.value = [];
// const res = await http.post(
// config.API.profileSearchNewOcIdType(id, "officer"),
// {
// criterias: data,
// }
// );
// return res.data.result;
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// }
/**
* นหาขอมลตามไอด
@ -389,9 +389,16 @@ function clickAdd(data: any) {
await http
.post(config.API.personalAdd(), data)
.then(() => {
getpersonalList();
success($q, "เพิ่มข้อมูลสำเร็จ");
.then(async () => {
await http
.get(config.API.orgProfileStatus(data.id))
.then((res) => {
getpersonalList();
success($q, "เพิ่มข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
});
})
.catch((e) => {
messageError($q, e);