ทะเบียนประวัติ
This commit is contained in:
parent
1915c25dbf
commit
023acccf02
7 changed files with 316 additions and 137 deletions
|
|
@ -207,4 +207,16 @@ export default {
|
||||||
|
|
||||||
requestInformationbyType: (type: string, id: string) =>
|
requestInformationbyType: (type: string, id: string) =>
|
||||||
`${registryNew}/request-edit/${type}/${id}`,
|
`${registryNew}/request-edit/${type}/${id}`,
|
||||||
|
|
||||||
|
// รักษาการในตำแหน่ง
|
||||||
|
profileActposition: (type: string, id: string) =>
|
||||||
|
`${registryNew}${type}/actposition/${id}`,
|
||||||
|
profileActpositionHistory: (id: string, type: string) =>
|
||||||
|
`${registryNew}${type}/actposition/history/${id}`,
|
||||||
|
|
||||||
|
//ช่วยราชการ
|
||||||
|
profileAssistance: (type: string, id: string) =>
|
||||||
|
`${registryNew}${type}/assistance/${id}`,
|
||||||
|
profileAssistanceHistory: (id: string, type: string) =>
|
||||||
|
`${registryNew}${type}/assistance/history/${id}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
import type { DataActing } from "@/modules/04_registryPerson/interface/request/Government";
|
||||||
|
import type { ResActingPosData } from "@/modules/04_registryPerson/interface/response/Government";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPosHistory.vue";
|
import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPosHistory.vue";
|
||||||
|
|
@ -38,8 +40,8 @@ const isLeave = defineModel<boolean>("isLeave", {
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Table*/
|
/** Table*/
|
||||||
const rows = ref<any[]>([]); //รายการวินัย
|
const rows = ref<ResActingPosData[]>([]); //รายการวินัย
|
||||||
const rowsMain = ref<any[]>([]); //รายการวินัย
|
const rowsMain = ref<ResActingPosData[]>([]); //รายการวินัย
|
||||||
const mode = ref<string>("table"); //การแสดงผล Table card
|
const mode = ref<string>("table"); //การแสดงผล Table card
|
||||||
const filterKeyword = ref<string>(""); //คำค้นหา
|
const filterKeyword = ref<string>(""); //คำค้นหา
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -103,11 +105,11 @@ const visibleColumns = ref<String[]>([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Dialog*/
|
/** Dialog*/
|
||||||
const isStarusEdit = ref<boolean>(false);
|
const isStatusEdit = ref<boolean>(false);
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const modalHistory = ref<boolean>(false);
|
const modalHistory = ref<boolean>(false);
|
||||||
const rowId = ref<string>("");
|
const rowId = ref<string>("");
|
||||||
const formData = reactive({
|
const formData = reactive<DataActing>({
|
||||||
dateStart: null,
|
dateStart: null,
|
||||||
dateEnd: null,
|
dateEnd: null,
|
||||||
posNo: "",
|
posNo: "",
|
||||||
|
|
@ -124,32 +126,54 @@ function serchDataTable() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchData() {
|
async function fetchData() {
|
||||||
const data = [
|
await http
|
||||||
{
|
.get(config.API.profileActposition(empType.value, profileId.value))
|
||||||
id: "1",
|
.then((res) => {
|
||||||
dateStart: new Date(),
|
const data = res.data.result;
|
||||||
dateEnd: new Date(),
|
rows.value = data;
|
||||||
posNo: "ขพน. 1",
|
rowsMain.value = data;
|
||||||
position: "ผู้อำนวยการ",
|
})
|
||||||
status: true,
|
.catch((err) => {
|
||||||
},
|
messageError($q, err);
|
||||||
];
|
})
|
||||||
|
.finally(() => {
|
||||||
rows.value = data;
|
hideLoader();
|
||||||
rowsMain.value = data;
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, async () => {
|
||||||
success($q, "รอ API");
|
showLoader();
|
||||||
closeDialogForm();
|
const body = {
|
||||||
|
...formData,
|
||||||
|
profileId: isStatusEdit.value ? undefined : profileId.value,
|
||||||
|
};
|
||||||
|
const method = isStatusEdit.value ? "patch" : "post";
|
||||||
|
await http[method](
|
||||||
|
config.API.profileActposition(
|
||||||
|
empType.value,
|
||||||
|
isStatusEdit.value ? rowId.value : ""
|
||||||
|
),
|
||||||
|
body
|
||||||
|
)
|
||||||
|
.then(async () => {
|
||||||
|
await fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
closeDialogForm();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openEditDialog(data: any) {
|
function openEditDialog(data: ResActingPosData) {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
isStarusEdit.value = true;
|
isStatusEdit.value = true;
|
||||||
rowId.value = data.id;
|
rowId.value = data.id;
|
||||||
formData.dateStart = data.dateStart;
|
formData.dateStart = data.dateStart;
|
||||||
formData.dateEnd = data.dateEnd;
|
formData.dateEnd = data.dateEnd;
|
||||||
|
|
@ -165,7 +189,7 @@ function showHistoryDialog(id: string) {
|
||||||
|
|
||||||
function closeDialogForm() {
|
function closeDialogForm() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
isStarusEdit.value = false;
|
isStatusEdit.value = false;
|
||||||
rowId.value = "";
|
rowId.value = "";
|
||||||
formData.dateStart = null;
|
formData.dateStart = null;
|
||||||
formData.dateEnd = null;
|
formData.dateEnd = null;
|
||||||
|
|
@ -386,7 +410,7 @@ onMounted(() => {
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="
|
:tittle="
|
||||||
isStarusEdit
|
isStatusEdit
|
||||||
? 'แก้ไขข้อมูลรายการรักษาการในตำแหน่ง'
|
? 'แก้ไขข้อมูลรายการรักษาการในตำแหน่ง'
|
||||||
: 'เพิ่มข้อมูลรายการรักษาการในตำแหน่ง'
|
: 'เพิ่มข้อมูลรายการรักษาการในตำแหน่ง'
|
||||||
"
|
"
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,9 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
label: "สถานะ",
|
label: "สถานะ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "status",
|
field: "status",
|
||||||
|
format(val, row) {
|
||||||
|
return row.status ? "Active" : "NoActive";
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -114,36 +117,20 @@ const historyPagination = ref({
|
||||||
|
|
||||||
/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/
|
/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/
|
||||||
function fetchDataHistory() {
|
function fetchDataHistory() {
|
||||||
// showLoader();
|
showLoader();
|
||||||
// http
|
http
|
||||||
// .get(config.API.profileNewDutyHisByDutyId(id.value, empType.value))
|
.get(config.API.profileActpositionHistory(id.value, empType.value))
|
||||||
// .then((res) => {
|
.then((res) => {
|
||||||
// let data = res.data.result;
|
let data = res.data.result;
|
||||||
// rows.value = [];
|
rows.value = data;
|
||||||
// data.map((e: ResponseObject) => {
|
rowsMain.value = data;
|
||||||
// rows.value.push({
|
})
|
||||||
// id: e.id,
|
.catch((e) => {
|
||||||
// dateStart: new Date(e.dateStart),
|
messageError($q, e);
|
||||||
// dateEnd: new Date(e.dateEnd),
|
})
|
||||||
// detail: e.detail,
|
.finally(() => {
|
||||||
// reference: e.reference,
|
hideLoader();
|
||||||
// refCommandNo: e.refCommandNo,
|
});
|
||||||
// refCommandDate:
|
|
||||||
// e.refCommandDate == null ? null : new Date(e.refCommandDate),
|
|
||||||
// createdFullName: e.createdFullName,
|
|
||||||
// createdAt: new Date(e.createdAt),
|
|
||||||
// lastUpdateFullName: e.lastUpdateFullName,
|
|
||||||
// lastUpdatedAt: e.lastUpdatedAt,
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// rowsMain.value = rows.value;
|
|
||||||
// })
|
|
||||||
// .catch((e) => {
|
|
||||||
// messageError($q, e);
|
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// hideLoader();
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function serchDataTable() {
|
function serchDataTable() {
|
||||||
|
|
@ -164,6 +151,8 @@ watch(modal, (status) => {
|
||||||
filterKeyword.value = "";
|
filterKeyword.value = "";
|
||||||
} else {
|
} else {
|
||||||
filterKeyword.value = "";
|
filterKeyword.value = "";
|
||||||
|
rows.value = [];
|
||||||
|
rowsMain.value = [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive } from "vue";
|
import { ref, onMounted, reactive } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import { checkPermission } from "@/utils/permissions";
|
||||||
|
|
@ -9,6 +10,8 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
import type { DatAssistance } from "@/modules/04_registryPerson/interface/request/Government";
|
||||||
|
import type { ResAssistanceData } from "@/modules/04_registryPerson/interface/response/Government";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernmentHistory.vue";
|
import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernmentHistory.vue";
|
||||||
|
|
@ -38,17 +41,17 @@ const isLeave = defineModel<boolean>("isLeave", {
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Table*/
|
/** Table*/
|
||||||
const rows = ref<any[]>([]); //รายการวินัย
|
const rows = ref<ResAssistanceData[]>([]); //รายการวินัย
|
||||||
const rowsMain = ref<any[]>([]); //รายการวินัย
|
const rowsMain = ref<ResAssistanceData[]>([]); //รายการวินัย
|
||||||
const mode = ref<string>("table"); //การแสดงผล Table card
|
const mode = ref<string>("table"); //การแสดงผล Table card
|
||||||
const filterKeyword = ref<string>(""); //คำค้นหา
|
const filterKeyword = ref<string>(""); //คำค้นหา
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "orgHelpGovernment",
|
name: "agency",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "หน่วยงานที่ให้ช่วยราชการ",
|
label: "หน่วยงานที่ให้ช่วยราชการ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "orgHelpGovernment",
|
field: "agency",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -73,11 +76,11 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "refNo",
|
name: "commandNo",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "เลขที่คำสั่ง",
|
label: "เลขที่คำสั่ง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "refNo",
|
field: "commandNo",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -92,25 +95,26 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
"orgHelpGovernment",
|
"agency",
|
||||||
"dateStart",
|
"dateStart",
|
||||||
"dateEnd",
|
"dateEnd",
|
||||||
"refNo",
|
"commandNo",
|
||||||
"document",
|
"document",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Dialog*/
|
/** Dialog*/
|
||||||
const isStarusEdit = ref<boolean>(false);
|
const isStatusEdit = ref<boolean>(false);
|
||||||
const rowId = ref<string>("");
|
const rowId = ref<string>("");
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const modalHistory = ref<boolean>(false);
|
const modalHistory = ref<boolean>(false);
|
||||||
|
|
||||||
const formData = reactive({
|
const formData = reactive<DatAssistance>({
|
||||||
org: "",
|
agency: "",
|
||||||
dateStart: null,
|
dateStart: null,
|
||||||
dateEnd: null,
|
dateEnd: null,
|
||||||
refNo: "",
|
commandNo: "",
|
||||||
document: "",
|
document: "",
|
||||||
|
isUpload: false,
|
||||||
});
|
});
|
||||||
const fileUpload = ref<File>();
|
const fileUpload = ref<File>();
|
||||||
|
|
||||||
|
|
@ -123,39 +127,153 @@ function serchDataTable() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchData() {
|
async function fetchData() {
|
||||||
const data = [
|
await http
|
||||||
{
|
.get(config.API.profileAssistance(empType.value, profileId.value))
|
||||||
id: "1",
|
.then((res) => {
|
||||||
orgHelpGovernment: "สำนักงานเขตพระนคร",
|
const data = res.data.result;
|
||||||
dateStart: new Date(),
|
rows.value = data;
|
||||||
dateEnd: new Date(),
|
rowsMain.value = data;
|
||||||
refNo: "งด. 5013/2568",
|
})
|
||||||
document: "เลื่อนเงินเดือนคำสั่ง สนท.ที่ 91/2544 ลว.21 พ.ย. 44",
|
.catch((err) => {
|
||||||
isUpload: true,
|
messageError($q, err);
|
||||||
},
|
})
|
||||||
];
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
rows.value = data;
|
});
|
||||||
rowsMain.value = data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, async () => {
|
||||||
success($q, "รอ API");
|
showLoader();
|
||||||
closeDialogForm();
|
const body = {
|
||||||
|
...formData,
|
||||||
|
profileId: isStatusEdit.value ? undefined : profileId.value,
|
||||||
|
isUpload: isStatusEdit.value
|
||||||
|
? formData.isUpload
|
||||||
|
? formData.isUpload
|
||||||
|
: fileUpload.value
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
: fileUpload.value
|
||||||
|
? true
|
||||||
|
: false,
|
||||||
|
};
|
||||||
|
const method = isStatusEdit.value ? "patch" : "post";
|
||||||
|
await http[method](
|
||||||
|
config.API.profileAssistance(
|
||||||
|
empType.value,
|
||||||
|
isStatusEdit.value ? rowId.value : ""
|
||||||
|
),
|
||||||
|
body
|
||||||
|
)
|
||||||
|
.then(async (res) => {
|
||||||
|
if (fileUpload.value) {
|
||||||
|
const id = isStatusEdit.value ? rowId.value : res.data.result;
|
||||||
|
await uploadProfile(id);
|
||||||
|
}
|
||||||
|
await fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
closeDialogForm();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openEditDialog(data: any) {
|
/**
|
||||||
|
* ฟังก์ชันส้ราง Path อัปโหลดไฟล์
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
async function uploadProfile(id: string) {
|
||||||
|
await http
|
||||||
|
.post(
|
||||||
|
config.API.subFile(
|
||||||
|
"ทะเบียนประวัติ",
|
||||||
|
"ปฏิบัติราชการพิเศษ",
|
||||||
|
profileId.value,
|
||||||
|
id
|
||||||
|
),
|
||||||
|
{
|
||||||
|
replace: true,
|
||||||
|
fileList: [
|
||||||
|
{
|
||||||
|
fileName: "เอกสารหลักฐาน",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(async (res) => {
|
||||||
|
const uploadUrl = res.data["เอกสารหลักฐาน"].uploadUrl;
|
||||||
|
await uploadFileURL(uploadUrl, fileUpload.value);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันอัปโหลไฟล์
|
||||||
|
* @param uploadUrl Path อัปโหลดไฟล์
|
||||||
|
* @param file ไฟล์เอกสาร
|
||||||
|
*/
|
||||||
|
async function uploadFileURL(uploadUrl: string, file: any) {
|
||||||
|
await axios
|
||||||
|
.put(uploadUrl, file, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": file.type,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
fileUpload.value = undefined;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันโหลไฟลเอกสารหลักฐาน
|
||||||
|
* @param id รายการที่ต้องการโหลด
|
||||||
|
*/
|
||||||
|
async function onDownloadFile(id: string) {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(
|
||||||
|
config.API.subFileByFileName(
|
||||||
|
"ทะเบียนประวัติ",
|
||||||
|
"ปฏิบัติราชการพิเศษ",
|
||||||
|
profileId.value,
|
||||||
|
id,
|
||||||
|
"เอกสารหลักฐาน"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.then(async (res) => {
|
||||||
|
const data = res.data.downloadUrl;
|
||||||
|
window.open(data, "_blank");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function openEditDialog(data: ResAssistanceData) {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
isStarusEdit.value = true;
|
isStatusEdit.value = true;
|
||||||
rowId.value = data.id;
|
rowId.value = data.id;
|
||||||
formData.org = data.orgHelpGovernment;
|
formData.agency = data.agency;
|
||||||
formData.dateStart = data.dateStart;
|
formData.dateStart = data.dateStart;
|
||||||
formData.dateEnd = data.dateEnd;
|
formData.dateEnd = data.dateEnd;
|
||||||
formData.refNo = data.refNo;
|
formData.commandNo = data.commandNo;
|
||||||
formData.document = data.document;
|
formData.document = data.document;
|
||||||
|
formData.isUpload = data.isUpload;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showHistoryDialog(id: string) {
|
function showHistoryDialog(id: string) {
|
||||||
|
|
@ -165,13 +283,14 @@ function showHistoryDialog(id: string) {
|
||||||
|
|
||||||
function closeDialogForm() {
|
function closeDialogForm() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
isStarusEdit.value = false;
|
isStatusEdit.value = false;
|
||||||
rowId.value = "";
|
rowId.value = "";
|
||||||
formData.org = "";
|
formData.agency = "";
|
||||||
formData.dateStart = null;
|
formData.dateStart = null;
|
||||||
formData.dateEnd = null;
|
formData.dateEnd = null;
|
||||||
formData.refNo = "";
|
formData.commandNo = "";
|
||||||
formData.document = "";
|
formData.document = "";
|
||||||
|
formData.isUpload = false;
|
||||||
fileUpload.value = undefined;
|
fileUpload.value = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -316,6 +435,7 @@ onMounted(() => {
|
||||||
color="green"
|
color="green"
|
||||||
icon="mdi-file-document-outline"
|
icon="mdi-file-document-outline"
|
||||||
v-if="props.row.isUpload"
|
v-if="props.row.isUpload"
|
||||||
|
@click="onDownloadFile(props.row.id)"
|
||||||
>
|
>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -356,11 +476,7 @@ onMounted(() => {
|
||||||
หน่วยงานที่ให้ช่วยราชการ
|
หน่วยงานที่ให้ช่วยราชการ
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
{{
|
{{ props.row.agency ? props.row.agency : "-" }}
|
||||||
props.row.orgHelpGovernment
|
|
||||||
? props.row.orgHelpGovernment
|
|
||||||
: "-"
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row q-pa-sm bg-grey-2">
|
<div class="row q-pa-sm bg-grey-2">
|
||||||
|
|
@ -383,7 +499,7 @@ onMounted(() => {
|
||||||
เลขที่คำสั่ง
|
เลขที่คำสั่ง
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
{{ props.row.refNo ? props.row.refNo : "-" }}
|
{{ props.row.commandNo ? props.row.commandNo : "-" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
@ -407,7 +523,7 @@ onMounted(() => {
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="
|
:tittle="
|
||||||
isStarusEdit
|
isStatusEdit
|
||||||
? 'แก้ไขข้อมูลรายการช่วยราชการ'
|
? 'แก้ไขข้อมูลรายการช่วยราชการ'
|
||||||
: 'เพิ่มข้อมูลรายการช่วยราชการ'
|
: 'เพิ่มข้อมูลรายการช่วยราชการ'
|
||||||
"
|
"
|
||||||
|
|
@ -422,7 +538,7 @@ onMounted(() => {
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="formData.org"
|
v-model="formData.agency"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกหน่วยงานที่ให้ช่วยราชการ'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกหน่วยงานที่ให้ช่วยราชการ'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'หน่วยงานที่ให้ช่วยราชการ'}`"
|
:label="`${'หน่วยงานที่ให้ช่วยราชการ'}`"
|
||||||
|
|
@ -508,7 +624,7 @@ onMounted(() => {
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="formData.refNo"
|
v-model="formData.commandNo"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'เลขที่คำสั่ง'}`"
|
:label="`${'เลขที่คำสั่ง'}`"
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,11 @@ const rows = ref<ResponseObject[]>([]); //data history
|
||||||
const rowsMain = ref<ResponseObject[]>([]); //data history
|
const rowsMain = ref<ResponseObject[]>([]); //data history
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "orgHelpGovernment",
|
name: "agency",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "หน่วยงานที่ให้ช่วยราชการ",
|
label: "หน่วยงานที่ให้ช่วยราชการ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "orgHelpGovernment",
|
field: "agency",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -61,11 +61,11 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "refNo",
|
name: "commandNo",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "เลขที่คำสั่ง",
|
label: "เลขที่คำสั่ง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "refNo",
|
field: "commandNo",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -99,10 +99,10 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
"orgHelpGovernment",
|
"agency",
|
||||||
"dateStart",
|
"dateStart",
|
||||||
"dateEnd",
|
"dateEnd",
|
||||||
"refNo",
|
"commandNo",
|
||||||
"document",
|
"document",
|
||||||
"lastUpdateFullName",
|
"lastUpdateFullName",
|
||||||
"lastUpdatedAt",
|
"lastUpdatedAt",
|
||||||
|
|
@ -114,36 +114,20 @@ const historyPagination = ref({
|
||||||
|
|
||||||
/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/
|
/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/
|
||||||
function fetchDataHistory() {
|
function fetchDataHistory() {
|
||||||
// showLoader();
|
showLoader();
|
||||||
// http
|
http
|
||||||
// .get(config.API.profileNewDutyHisByDutyId(id.value, empType.value))
|
.get(config.API.profileAssistanceHistory(id.value, empType.value))
|
||||||
// .then((res) => {
|
.then((res) => {
|
||||||
// let data = res.data.result;
|
let data = res.data.result;
|
||||||
// rows.value = [];
|
rows.value = data;
|
||||||
// data.map((e: ResponseObject) => {
|
rowsMain.value = rows.value;
|
||||||
// rows.value.push({
|
})
|
||||||
// id: e.id,
|
.catch((e) => {
|
||||||
// dateStart: new Date(e.dateStart),
|
messageError($q, e);
|
||||||
// dateEnd: new Date(e.dateEnd),
|
})
|
||||||
// detail: e.detail,
|
.finally(() => {
|
||||||
// reference: e.reference,
|
hideLoader();
|
||||||
// refCommandNo: e.refCommandNo,
|
});
|
||||||
// refCommandDate:
|
|
||||||
// e.refCommandDate == null ? null : new Date(e.refCommandDate),
|
|
||||||
// createdFullName: e.createdFullName,
|
|
||||||
// createdAt: new Date(e.createdAt),
|
|
||||||
// lastUpdateFullName: e.lastUpdateFullName,
|
|
||||||
// lastUpdatedAt: e.lastUpdatedAt,
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// rowsMain.value = rows.value;
|
|
||||||
// })
|
|
||||||
// .catch((e) => {
|
|
||||||
// messageError($q, e);
|
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// hideLoader();
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function serchDataTable() {
|
function serchDataTable() {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
interface DataActing {
|
||||||
|
dateStart: null | Date;
|
||||||
|
dateEnd: null | Date;
|
||||||
|
posNo: string;
|
||||||
|
position: string;
|
||||||
|
status: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DatAssistance {
|
||||||
|
dateStart: Date | null;
|
||||||
|
dateEnd: Date | null;
|
||||||
|
agency: string;
|
||||||
|
commandNo: string;
|
||||||
|
document: string;
|
||||||
|
isUpload: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { DataActing, DatAssistance };
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
interface ResActingPosData {
|
||||||
|
createdAt: string;
|
||||||
|
createdFullName: string;
|
||||||
|
createdUserId: string;
|
||||||
|
dateEnd: Date | null;
|
||||||
|
dateStart: Date | null;
|
||||||
|
id: string;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
lastUpdateUserId: string;
|
||||||
|
lastUpdatedAt: string;
|
||||||
|
posNo: string;
|
||||||
|
position: string;
|
||||||
|
profileEmployeeId: string;
|
||||||
|
profileId: string;
|
||||||
|
status: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ResAssistanceData {
|
||||||
|
agency: string;
|
||||||
|
commandNo: string;
|
||||||
|
createdAt: Date | null;
|
||||||
|
createdFullName: string;
|
||||||
|
createdUserId: string;
|
||||||
|
dateEnd: Date | null;
|
||||||
|
dateStart: Date | null;
|
||||||
|
document: string;
|
||||||
|
id: string;
|
||||||
|
isUpload: false;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
lastUpdateUserId: string;
|
||||||
|
lastUpdatedAt: string;
|
||||||
|
profileEmployeeId: string;
|
||||||
|
profileId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { ResActingPosData, ResAssistanceData };
|
||||||
Loading…
Add table
Add a link
Reference in a new issue