Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-09-07 17:08:39 +07:00
commit b93a03d0d2
16 changed files with 153 additions and 101 deletions

View file

@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, onMounted, computed } from "vue";
import { useQuasar } from "quasar";
import { useQuasar, QForm } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
@ -20,7 +20,16 @@ const router = useRouter();
const mixin = useCounterMixin();
const RetirementData = useRetirementDataStore();
const { messageError, date2Thai, showLoader, hideLoader, success } = mixin;
const myForm = ref<QForm>();
const {
messageError,
date2Thai,
showLoader,
hideLoader,
success,
dialogConfirm,
} = mixin;
const { statusText } = RetirementData;
const rows = ref<ResponseItems[]>([]);
@ -164,10 +173,10 @@ const resetFilter = () => {
filterRef.value.focus();
};
const openModalCalendar = (rows:any) => {
const openModalCalendar = (rows: any) => {
openModal();
dateBreak.value = null;
id.value= rows.id;
id.value = rows.id;
};
const openModalOrder = () => {
@ -208,7 +217,7 @@ const fecthlist = async () => {
suggestFriendsReason: r.suggestFriendsReason ?? "",
suggestion: r.suggestion ?? "",
status: r.status ?? "",
appointDate: date2Thai(r.appointDate)
appointDate: date2Thai(r.appointDate),
});
});
@ -222,25 +231,31 @@ const fecthlist = async () => {
hideLoader();
});
};
const saveAppoint = async () =>{
const body = {
appointDate : dateBreak.value
};
showLoader();
await http
.put(config.API.AppointInterview(id.value),body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
closeModal();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fecthlist();
hideLoader();
});
}
const saveAppoint = async () => {
await myForm.value!.validate().then(async (result: boolean) => {
if (result) {
dialogConfirm($q, async () => {
const body = {
appointDate: dateBreak.value,
};
showLoader();
await http
.put(config.API.AppointInterview(id.value), body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
closeModal();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fecthlist();
hideLoader();
});
});
}
});
};
// const saveOrder = async () => {
// const id = selected.value.map((r) => r.id);
// const body = {
@ -415,7 +430,9 @@ const saveAppoint = async () =>{
router.push(`/exit-Interview/questionnair/${props.row.id}`)
"
>
{{ props.row.appointDate == null ? "-":props.row.appointDate }}
{{
props.row.appointDate == null ? "-" : props.row.appointDate
}}
</q-td>
<q-td
key="datetext"
@ -428,7 +445,7 @@ const saveAppoint = async () =>{
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.appointDate == null"
v-if="props.row.appointDate == null"
icon="mdi-calendar"
size="12px"
color="blue-7"
@ -565,9 +582,9 @@ const saveAppoint = async () =>{
</q-card>
</q-dialog> -->
<q-dialog v-model="modal" persistent >
<q-dialog v-model="modal" persistent>
<q-card style="width: 800px">
<q-form ref="myFormConfirm">
<q-form ref="myForm">
<DialogHeader
title="กําหนดวันนัดหมายเพื่อทําการสัมภาษณ์การลาออก"
:close="closeModal"
@ -600,6 +617,7 @@ const saveAppoint = async () =>{
"
hide-bottom-space
:label="`${' วันนัดหมายเพื่อทําการสัมภาษณ์การลาออก'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<template v-slot:prepend>
<q-icon
@ -624,7 +642,7 @@ const saveAppoint = async () =>{
>
<q-tooltip>นท</q-tooltip>
</q-btn> -->
<DialogFooter :editvisible="true" :save ="saveAppoint" />
<DialogFooter :editvisible="true" :save="saveAppoint" />
</q-form>
</q-card>
</q-dialog>

View file

@ -1031,6 +1031,7 @@ const statusOrder = (val: boolean) => {
"
hide-bottom-space
:label="`${' วันสุดท้ายที่ยับยั้ง'}`"
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
>
<template v-slot:prepend>
<q-icon

View file

@ -290,7 +290,8 @@ import { useCounterMixin } from "@/stores/mixin";
import type { resMain } from "@/modules/06_retirement/interface/response/Main";
const mixin = useCounterMixin();
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
const { messageError, date2Thai, showLoader, hideLoader, dialogConfirm } =
mixin;
const router = useRouter();
const $q = useQuasar(); // noti quasar
const modal = ref<boolean>(false);
@ -482,54 +483,22 @@ const rows2 = ref<FormMainProbation2[]>([
// };
const clickAdd = () => {
// console.log(rows.value.length, type.value);
console.log(rows.value.length, type.value);
if (rows.value.length == 0) {
$q.dialog({
title: "ยืนยันการเพิ่มข้อมูลประกาศเกษียณ",
message: "ต้องการเพิ่มข้อมูลประกาศเกษียณใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
dialogConfirm(
$q,
async () => {
let data = { type: type.value, year: currentYear };
await cerateRetirement(data);
})
.onCancel(() => {})
.onDismiss(() => {});
},
"ยืนยันการเพิ่มข้อมูลประกาศเกษียณ",
"ต้องการเพิ่มข้อมูลประกาศเกษียณใช่หรือไม่ ?"
);
} else {
modal.value = true;
action.value = "";
radio.value = "";
}
// $q.dialog({
// title: "",
// message: "",
// options: {
// type: "radio",
// model: "opt1",
// // inline: true
// items: [
// { label: "", value: "ADD" },
// { label: "", value: "EDIT" },
// { label: "", value: "REMOVE" },
// ],
// },
// cancel: {
// flat: true,
// color: "negative",
// },
// persistent: true,
// })
// .onOk((data) => {
// console.log("option===>", data);
// router.push(`/retirement/list/${type.value}/${currentYear}`);
// })
// .onCancel(() => {})
// .onDismiss(() => {});
};
const cerateRetirement = async (data: object) => {
await http
@ -544,40 +513,26 @@ const cerateRetirement = async (data: object) => {
});
};
const clickSelect = async (action: string) => {
// console.log(action);
// console.log(radio.value);
$q.dialog({
title: "ยืนยันการแก้ไขข้อมูลประกาศเกษียณ",
message: "ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
dialogConfirm(
$q,
async () => {
let data = {
type: type.value,
year: currentYear,
retireHistoryId: action,
option: radio.value,
};
// console.log(data);
await cerateRetirement(data);
})
.onCancel(() => {})
.onDismiss(() => {});
},
"ยืนยันการแก้ไขข้อมูลประกาศเกษียณ",
"ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่ ?"
);
};
// const clickClose = async () => {
// modal.value = false;
// };
const checkjson = ref<boolean>();
const checkststus = (data: any) => {
let jsonfasle = data.find((e: any) => e.document == false);
// console.log(jsonfasle)

View file

@ -225,6 +225,7 @@ onMounted(async () => {
"officer",
props.tab
);
DataStore.mainTab = props.tab;
}
}
});

View file

@ -157,6 +157,7 @@ onMounted(async () => {
"officer",
props.tab
);
DataStore.mainTab = props.tab;
}
}
});

View file

@ -143,6 +143,7 @@ const columns = ref<QTableProps["columns"]>([
},
]);
onMounted(async () => {
organizationOptions.value = DataStore.optionsTypeOc;
organization.value = await (DataStore.agency != null
? DataStore.agency
@ -156,6 +157,7 @@ onMounted(async () => {
"officer",
props.tab
);
DataStore.mainTab = props.tab;
}
}
});

View file

@ -5,10 +5,12 @@ import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const DataStore = useInsigniaDataStore();
const props = defineProps({
roundId: {
type: String,
@ -44,6 +46,7 @@ const rows = ref<any[]>([]);
onMounted(async () => {
await fecthOrg();
DataStore.mainTab = props.tab;
});
watch(props, async () => {
if (props.tab === "organization") {

View file

@ -30,7 +30,7 @@ const round = ref<string>("");
const roundName = ref<string>("");
const optionRound = ref<any>([]);
const optiontypeOc = ref<any>([]);
const tab = ref<any>("pending");
const tab = ref<any>("");
const stat = ref<any>({
allUserUser: 0,
orgAllCount: 0,
@ -39,6 +39,7 @@ const stat = ref<any>({
});
onMounted(async () => {
tab.value = DataStore.mainTab;
await checkRole();
await fecthlistRound();
});

View file

@ -408,6 +408,7 @@ const searchcardid = () => {
borderless
:enableTimePicker="false"
week-start="0"
:readonly="disbleStatus || status == 'DONE'"
>
<template #year="{ year }">
{{ year + 543 }}
@ -495,6 +496,7 @@ const searchcardid = () => {
borderless
:enableTimePicker="false"
week-start="0"
:readonly="disbleStatus || status == 'DONE'"
>
<template #year="{ year }">
{{ year + 543 }}

View file

@ -94,11 +94,16 @@ const fecthInsignia = async () => {
};
const fecthInsigniaType = async () => {
console.log(DataStore.mainTab);
await http(config.API.insigniaType)
.then((res) => {
let data = res.data.result;
DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name;
if (DataStore.mainTab) {
tab.value = DataStore.mainTab;
} else tab.value = DataStore.insigniaType[0].name;
loadView.value = true;
fecthInsignia();
})
@ -177,6 +182,7 @@ const selectorRound = (round: string) => {
};
const fecthlistInsignia = async () => {
DataStore.mainTab = tab.value;
showLoader();
await http
.get(config.API.insigniaManageType(tab.value, Number(roundYear.value)))

View file

@ -114,6 +114,10 @@ const visibleColumns = ref<String[]>([
"name",
"type",
"employeeType",
"date",
"volumeNo",
"section",
"dateReceive",
"page",
"number",
"vatnumber",
@ -155,6 +159,15 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "employeeType",
align: "left",
label: "สถานภาพ",
field: "employeeType",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "type",
align: "left",
@ -165,10 +178,38 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "employeeType",
name: "dateReceive",
align: "left",
label: "สถานภาพ",
field: "employeeType",
label: "วันที่ได้รับพระราชทาน",
field: "dateReceive",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "date",
align: "left",
label: "วันที่ในราชกิจนุเบกษา",
field: "date",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "volumeNo",
align: "left",
label: "เล่มที่ในราชกิจนุเบกษา",
field: "volumeNo",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "section",
align: "left",
label: "ตอนที่ในราชกิจนุเบกษา",
field: "section",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),

View file

@ -22,6 +22,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
const typeReport = ref<string>("");
const titleReport = ref<string>("");
const mainTab = ref<string | undefined>('pending');
const setTypeandTitle = (type: string, title: string) => {
typeReport.value = type;
@ -110,6 +111,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
return {
optionsTypeOc,
mainTab,
typeOc,
rows,
typeinsigniaOptions,

View file

@ -14,6 +14,7 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
const insigniaType = ref<any>()
const rows = ref<any>([])
const listInsignia = ref<any>([])
const mainTab = ref<string>("")
const fetchDatainsignia = async (data: any) => {
insignia.value = ''
@ -22,8 +23,10 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
insigniaOp.value.push({ name: e.name, id: e.id, type: e.insigniaType.id })
});
}
const fetchDatainsigniaType = async (data: any) => {
const fetchDatainsigniaType = async (data: any,) => {
insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
// mainTab.value = insigniaType.value[0].name
}
const listinsignia = async (data: any) => {
rows.value = [];
@ -64,6 +67,7 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
listinsignia,
selectInsignia,
profileType,
insigniaName
insigniaName,
mainTab
};
});

View file

@ -40,6 +40,10 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
requestInsigniaId: e.requestInsigniaId,
employeeType: profileType(e.profileType),
profileType: e.profileType,
dateReceive: date2Thai(e.dateReceive),
date: date2Thai(e.date),
volumeNo: e.volumeNo,
section: e.section,
page: e.page,
number: e.no,
vatnumber: e.number,

View file

@ -47,6 +47,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
type: e.requestInsignia,
employeeType: profileType(e.profileType),
profileType: e.profileType,
date: date2Thai(e.date),
volumeNo: e.volumeNo,
section: e.section,
page: e.page,

View file

@ -94,6 +94,7 @@ const visibleColumns = ref<String[]>([
"name",
"type",
"dateReceive",
"date",
"employeeType",
"volumeNo",
"section",
@ -169,10 +170,19 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "date",
align: "left",
label: "วันที่ในราชกิจนุเบกษา",
field: "date",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "volumeNo",
align: "left",
label: "เล่มในราชกิจนุเบกษา",
label: "เล่มที่ในราชกิจนุเบกษา",
field: "volumeNo",
sortable: true,
sort: (a: string, b: string) =>
@ -181,7 +191,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "section",
align: "left",
label: "ตอนในราชกิจนุเบกษา",
label: "ตอนที่ในราชกิจนุเบกษา",
field: "section",
sortable: true,
sort: (a: string, b: string) =>
@ -191,7 +201,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "page",
align: "left",
label: "หน้าในราชกิจนุเบกษา",
label: "หน้าที่ในราชกิจนุเบกษา",
field: "page",
sortable: true,
sort: (a: string, b: string) =>