refactor code ส่วนของเครื่องราชฯ
This commit is contained in:
parent
33c2b338a2
commit
1ed9faebf2
11 changed files with 326 additions and 149 deletions
|
|
@ -33,7 +33,7 @@ const stat = ref<any>({
|
||||||
contain: 0,
|
contain: 0,
|
||||||
disclaim: 0,
|
disclaim: 0,
|
||||||
});
|
});
|
||||||
|
// เรียกข้อมูล Stat
|
||||||
const getStat = async () => {
|
const getStat = async () => {
|
||||||
const examIdString = Array.isArray(examId) ? examId[0] : examId;
|
const examIdString = Array.isArray(examId) ? examId[0] : examId;
|
||||||
await http
|
await http
|
||||||
|
|
@ -76,7 +76,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
const fetchPlacementData = async () => {
|
const fetchPlacementData = async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.get(config.API.MainDetail(0))
|
.get(config.API.MainDetail(0))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
DataStore.DataMainOrig = res.data.result;
|
DataStore.DataMainOrig = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ const closeModal = () => {
|
||||||
closeAndClear();
|
closeAndClear();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// clean ข้อมูล
|
||||||
const closeAndClear = async () => {
|
const closeAndClear = async () => {
|
||||||
await props.close();
|
await props.close();
|
||||||
editDataStatus.value = false;
|
editDataStatus.value = false;
|
||||||
|
|
@ -346,7 +346,7 @@ const checkPosition = (val: string) => {
|
||||||
};
|
};
|
||||||
const personal = ref<any>();
|
const personal = ref<any>();
|
||||||
const expanded = ref<string[]>([]);
|
const expanded = ref<string[]>([]);
|
||||||
|
// เมื่อ props เปลี่ยนแปลงจะโหลดหน่วยงาน
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
expanded.value = [];
|
expanded.value = [];
|
||||||
const dataPersonal = props.personal;
|
const dataPersonal = props.personal;
|
||||||
|
|
@ -361,10 +361,10 @@ watch(props, () => {
|
||||||
personal.value.draft === false &&
|
personal.value.draft === false &&
|
||||||
personal.value.positionNumber !== null
|
personal.value.positionNumber !== null
|
||||||
) {
|
) {
|
||||||
let findData: any = null;
|
let findData: any = null;
|
||||||
dataRespone.value.map((x: any) => {
|
dataRespone.value.map((x: any) => {
|
||||||
findData = findByPerson(x);
|
findData = findByPerson(x);
|
||||||
|
// ถ้ามีตำแต่งจะทำการ expandedTree
|
||||||
if (findData != null) {
|
if (findData != null) {
|
||||||
selectedPosition(findData);
|
selectedPosition(findData);
|
||||||
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
||||||
|
|
@ -374,7 +374,7 @@ watch(props, () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// หาตำหน่วยงานที่เลือก
|
// หาหน่วยงานที่เลือก
|
||||||
function findByPerson(element: any): any {
|
function findByPerson(element: any): any {
|
||||||
if (
|
if (
|
||||||
element.positionNumId &&
|
element.positionNumId &&
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||||
const { showLoader, hideLoader, date2Thai } = mixin;
|
const { showLoader, hideLoader, date2Thai, messageError } = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -78,13 +78,13 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
const myForm = ref<any>([]);
|
const myForm = ref<any>([]);
|
||||||
const personalForm = ref<any>([]);
|
const personalForm = ref<any>([]);
|
||||||
const selection = ref<any>([]);
|
const selection = ref<any>([]);
|
||||||
|
// เมื่อ props.Modal จะเรียกข้อมูลการศึกษา
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
if (props.Modal === true) {
|
if (props.Modal === true) {
|
||||||
fetchData();
|
fetchData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// ข้อมูลการศึกษา
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -101,7 +101,7 @@ const fetchData = async () => {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log("e", e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -120,7 +120,7 @@ const formBmaofficer = (val: string) => {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// ปิด POPUP ข้อมูล
|
||||||
const close = async () => {
|
const close = async () => {
|
||||||
props.close();
|
props.close();
|
||||||
selection.value = [];
|
selection.value = [];
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ const fecthlistRetire = async () => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// เรียกรายชื่อประกาศเกษียณอายุราชการเพิ่ม
|
||||||
const findlist = async (id: string) => {
|
const findlist = async (id: string) => {
|
||||||
let data = [{}];
|
let data = [{}];
|
||||||
if (type.value === "officer") {
|
if (type.value === "officer") {
|
||||||
|
|
@ -122,7 +123,7 @@ const findlist = async (id: string) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// putlist
|
// ยืนยันการเพิ่มราชชื่อ
|
||||||
const clickAdd = (props: any) => {
|
const clickAdd = (props: any) => {
|
||||||
if (retireld.value == undefined) {
|
if (retireld.value == undefined) {
|
||||||
retireld.value = retireld_params;
|
retireld.value = retireld_params;
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,7 @@ const fecthlistprofile = async (id: string) => {
|
||||||
statusReport.value = res.data.result.json;
|
statusReport.value = res.data.result.json;
|
||||||
typeReport.value = res.data.result.typeReport;
|
typeReport.value = res.data.result.typeReport;
|
||||||
textReport.value = res.data.result.detail;
|
textReport.value = res.data.result.detail;
|
||||||
|
// รายชื่อผู้เกษียณอายุราชการ
|
||||||
rows.value = res.data.result.profile.map((e: any) => ({
|
rows.value = res.data.result.profile.map((e: any) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
profileId: e.profileId,
|
profileId: e.profileId,
|
||||||
|
|
@ -266,6 +267,7 @@ const UpdateListId = (retireld: string, pId: string) => {
|
||||||
profileId.value = pId;
|
profileId.value = pId;
|
||||||
fecthlistprofile(retireld);
|
fecthlistprofile(retireld);
|
||||||
};
|
};
|
||||||
|
// กลับหน้าเดิม
|
||||||
const backHistory = () => {
|
const backHistory = () => {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
};
|
};
|
||||||
|
|
@ -274,6 +276,7 @@ const visibleNote = computed(() => {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// อัปโหลดไฟล์
|
||||||
const uploadFile = async (event: any) => {
|
const uploadFile = async (event: any) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
const selectedFile = event;
|
const selectedFile = event;
|
||||||
|
|
@ -294,7 +297,7 @@ const uploadFile = async (event: any) => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// downloadAttachment
|
||||||
const downloadAttachment = async (type: string, id: string) => {
|
const downloadAttachment = async (type: string, id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -311,6 +314,7 @@ const downloadAttachment = async (type: string, id: string) => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// downloadFile
|
||||||
const downloadFile = (response: any, filename: string) => {
|
const downloadFile = (response: any, filename: string) => {
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
var fileName = filename;
|
var fileName = filename;
|
||||||
|
|
@ -320,7 +324,7 @@ const downloadFile = (response: any, filename: string) => {
|
||||||
link.click();
|
link.click();
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
};
|
};
|
||||||
|
// ยืนยันการแก้ไขข้อมูล
|
||||||
const saveEdiitReport = (reason: string) => {
|
const saveEdiitReport = (reason: string) => {
|
||||||
const formdata = new FormData();
|
const formdata = new FormData();
|
||||||
formdata.append("Detail", reason);
|
formdata.append("Detail", reason);
|
||||||
|
|
@ -344,9 +348,11 @@ const saveEdiitReport = (reason: string) => {
|
||||||
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
|
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
// เปิด popup เหตุผล
|
||||||
const openmodalEditReport = () => {
|
const openmodalEditReport = () => {
|
||||||
modalEdit.value = true;
|
modalEdit.value = true;
|
||||||
};
|
};
|
||||||
|
// ปิด popup เหตุผล
|
||||||
const closemodalEditReport = () => {
|
const closemodalEditReport = () => {
|
||||||
modalEdit.value = false;
|
modalEdit.value = false;
|
||||||
};
|
};
|
||||||
|
|
@ -587,7 +593,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<q-td class="table_ellipsis" key="bureau" :props="props">{{
|
<q-td class="table_ellipsis" key="bureau" :props="props">{{
|
||||||
props.row.bureau
|
props.row.bureau
|
||||||
}}</q-td>
|
}}</q-td>
|
||||||
|
<q-td auto-width></q-td>
|
||||||
<q-td
|
<q-td
|
||||||
auto-width
|
auto-width
|
||||||
v-if="
|
v-if="
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,11 @@ const options = ref([
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (route.params.id) {
|
if (route.params.id) {
|
||||||
|
// มี params id ให้ เรียกข้อมูลของรอบการเสนอขอ
|
||||||
await fetchData();
|
await fetchData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// เรียกข้อมูลของรอบการเสนอขอ
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
edit.value = true;
|
edit.value = true;
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -77,7 +78,70 @@ const fileUploadDoc = async (files: any) => {
|
||||||
const updateYear = async (e: number) => {
|
const updateYear = async (e: number) => {
|
||||||
yearly.value = e;
|
yearly.value = e;
|
||||||
};
|
};
|
||||||
|
// แก้ไขข้อมูล
|
||||||
|
|
||||||
|
// คลิกบันทึก
|
||||||
|
const checkSave = () => {
|
||||||
|
if (myForm.value !== null) {
|
||||||
|
myForm.value.validate().then(async (success) => {
|
||||||
|
if (success) {
|
||||||
|
dialogConfirm($q, () => SaveData());
|
||||||
|
} else if (Number(datelast.value) !== 0) {
|
||||||
|
dialogMessageNotify($q, "กรุณาเลือกรอบการเสนอขอพระราชทานเครื่องราชฯ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// บันทึกข้อมูล
|
||||||
|
const SaveData = async () => {
|
||||||
|
if (edit.value) {
|
||||||
|
await editData(id.value);
|
||||||
|
} else {
|
||||||
|
await addData();
|
||||||
|
clickBack();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// อัพเดทวันที่เริ่มต้น และ สิ้นสุด
|
||||||
|
const updateDateRange = () => {
|
||||||
|
if (roundInsig.value.value == 1) {
|
||||||
|
dateStart.value = new Date(new Date().getFullYear(), 9, 1);
|
||||||
|
dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29);
|
||||||
|
} else if (roundInsig.value.value == 2) {
|
||||||
|
dateStart.value = new Date(new Date().getFullYear(), 3, 29);
|
||||||
|
dateEnd.value = new Date(new Date().getFullYear(), 4, 29);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// เพิ่มข้อมูลรอบการเสนอขอพระราชทานเครื่องราชฯ
|
||||||
|
const addData = async () => {
|
||||||
|
const formData = new FormData();
|
||||||
|
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||||
|
roundInsig.value.value
|
||||||
|
} ปี ${yearly.value + 543} `;
|
||||||
|
formData.append("name", name);
|
||||||
|
formData.append("year", yearly.value.toString());
|
||||||
|
formData.append("amount", datelast.value.toString());
|
||||||
|
formData.append("round", roundInsig.value.value);
|
||||||
|
if (dateStart.value !== null) {
|
||||||
|
formData.append("startDate", dateToISO(dateStart.value));
|
||||||
|
}
|
||||||
|
if (dateEnd.value !== null) {
|
||||||
|
formData.append("endDate", dateToISO(dateEnd.value));
|
||||||
|
}
|
||||||
|
formData.append("file", files.value);
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.post(config.API.listRoundInsignia(), formData)
|
||||||
|
.then(() => {
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// แก้ไขข้อมูล
|
||||||
const editData = async (id: string) => {
|
const editData = async (id: string) => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||||
|
|
@ -108,66 +172,6 @@ const editData = async (id: string) => {
|
||||||
clickBack();
|
clickBack();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const checkSave = () => {
|
|
||||||
if (myForm.value !== null) {
|
|
||||||
myForm.value.validate().then(async (success) => {
|
|
||||||
if (success) {
|
|
||||||
dialogConfirm($q, () => SaveData());
|
|
||||||
} else {
|
|
||||||
dialogMessageNotify($q, "กรุณาเลือกรอบการเสนอขอพระราชทานเครื่องราชฯ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const SaveData = async () => {
|
|
||||||
if (edit.value) {
|
|
||||||
await editData(id.value);
|
|
||||||
} else {
|
|
||||||
await addData();
|
|
||||||
clickBack();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const updateDateRange = () => {
|
|
||||||
if (roundInsig.value.value == 1) {
|
|
||||||
dateStart.value = new Date(new Date().getFullYear(), 9, 1);
|
|
||||||
dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29);
|
|
||||||
} else if (roundInsig.value.value == 2) {
|
|
||||||
dateStart.value = new Date(new Date().getFullYear(), 3, 29);
|
|
||||||
dateEnd.value = new Date(new Date().getFullYear(), 4, 29);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const addData = async () => {
|
|
||||||
const formData = new FormData();
|
|
||||||
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
|
||||||
roundInsig.value.value
|
|
||||||
} ปี ${yearly.value + 543} `;
|
|
||||||
formData.append("name", name);
|
|
||||||
formData.append("year", yearly.value.toString());
|
|
||||||
formData.append("amount", datelast.value.toString());
|
|
||||||
formData.append("round", roundInsig.value.value);
|
|
||||||
if (dateStart.value !== null) {
|
|
||||||
formData.append("startDate", dateToISO(dateStart.value));
|
|
||||||
}
|
|
||||||
if (dateEnd.value !== null) {
|
|
||||||
formData.append("endDate", dateToISO(dateEnd.value));
|
|
||||||
}
|
|
||||||
formData.append("file", files.value);
|
|
||||||
|
|
||||||
showLoader();
|
|
||||||
await http
|
|
||||||
.post(config.API.listRoundInsignia(), formData)
|
|
||||||
.then(() => {
|
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(async () => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const clickBack = () => {
|
const clickBack = () => {
|
||||||
router.push({ name: "insigniaProposals" });
|
router.push({ name: "insigniaProposals" });
|
||||||
|
|
@ -329,6 +333,11 @@ const clickBack = () => {
|
||||||
v-model="datelast"
|
v-model="datelast"
|
||||||
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
|
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
|
||||||
mask="###"
|
mask="###"
|
||||||
|
:rules="[
|
||||||
|
(val) =>
|
||||||
|
!!val || `${'กรุณากรอกจำนวนวันแจ้งเตือนก่อนวันสิ้นสุด'}`,
|
||||||
|
]"
|
||||||
|
lazy-rules
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-file
|
<q-file
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// ข้อมูลตาราง (จำลอง)
|
// ข้อมูลตาราง (จำลอง)
|
||||||
const rows = ref<FormProprsalsRound2[]>([]);
|
const rows = ref<FormProprsalsRound2[]>([]);
|
||||||
|
|
||||||
|
|
@ -118,11 +117,11 @@ const fetchData = async () => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// redirect หน้าข้อมูลรอบการเสนอข้อ
|
||||||
const clickEdit = (col: any) => {
|
const clickEdit = (col: any) => {
|
||||||
router.push(`/insignia/round-add/${col.period_id}`);
|
router.push(`/insignia/round-add/${col.period_id}`);
|
||||||
};
|
};
|
||||||
|
// ยืนยันการลบรอบการเสนอขอ
|
||||||
const clickDelete = (id: string) => {
|
const clickDelete = (id: string) => {
|
||||||
dialogRemove($q, async () => {
|
dialogRemove($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -144,15 +143,15 @@ const clickDelete = (id: string) => {
|
||||||
const clickAdd = () => {
|
const clickAdd = () => {
|
||||||
router.push({ name: "roundAdd" });
|
router.push({ name: "roundAdd" });
|
||||||
};
|
};
|
||||||
|
// คำนวณราชชื่อผู้ได้รับเครื่องราช
|
||||||
const clickListInsignia = async (propsId: string) => {
|
const clickListInsignia = async (propsId: string) => {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
await getRequest(propsId);
|
await getRequest(propsId);
|
||||||
},
|
},
|
||||||
"ยืนยันการคำนวณราชชื่อผู้ได้รับเครื่องราช",
|
"ยืนยันการคำนวณราชชื่อผู้ได้รับเครื่องราชฯ",
|
||||||
"ต้องการยืนยันการคำนวณราชชื่อผู้ได้รับเครื่องราชนี้หรือไม่ ?"
|
"ต้องการยืนยันการคำนวณราชชื่อผู้ได้รับเครื่องราชฯนี้หรือไม่ ?"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
// เรียกจาก API ข้อมูลผู้ได้รับเครื่องราชฯ
|
// เรียกจาก API ข้อมูลผู้ได้รับเครื่องราชฯ
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ const checkStatus = computed(() => {
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else return false;
|
||||||
});
|
});
|
||||||
// เลืแกหน่วยงาน
|
// เลือกหน่วยงาน
|
||||||
const changtypeOc = () => {
|
const changtypeOc = () => {
|
||||||
if (props.fecthInsigniaByOc) {
|
if (props.fecthInsigniaByOc) {
|
||||||
props.fecthInsigniaByOc(
|
props.fecthInsigniaByOc(
|
||||||
|
|
|
||||||
|
|
@ -62,12 +62,12 @@ const clearAnnounceExam = () => {
|
||||||
// reset วันที่ได้รับพระราชทานเครื่องราชอิสริยาภรณ์
|
// reset วันที่ได้รับพระราชทานเครื่องราชอิสริยาภรณ์
|
||||||
const clearDateReceivedate = () => {
|
const clearDateReceivedate = () => {
|
||||||
receivedate.value = null;
|
receivedate.value = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
// reset วันที่จ่ายใบกำกับ
|
// reset วันที่จ่ายใบกำกับ
|
||||||
const clearDateInvoiceDate = () => {
|
const clearDateInvoiceDate = () => {
|
||||||
invoiceDate.value = null;
|
invoiceDate.value = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modal: Boolean,
|
modal: Boolean,
|
||||||
|
|
@ -90,6 +90,7 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
// เปิด popup เพิ่มราชชื่อบันทึกผล
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
if (props.modal === true) {
|
if (props.modal === true) {
|
||||||
employeeClass.value = "";
|
employeeClass.value = "";
|
||||||
|
|
@ -111,7 +112,7 @@ watch(props, () => {
|
||||||
payment.value = "";
|
payment.value = "";
|
||||||
if (props.personId !== undefined) {
|
if (props.personId !== undefined) {
|
||||||
if (props.action === "editData") {
|
if (props.action === "editData") {
|
||||||
fectDataByid(props.personId);
|
fectDataByid(props.personId); // เมือแก้ไข เรียกข้อมูลบันทึกผล
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -121,7 +122,7 @@ const disbleStatus = computed(() => {
|
||||||
return false;
|
return false;
|
||||||
} else return true;
|
} else return true;
|
||||||
});
|
});
|
||||||
|
// เลือกประเภทลูกจ้าง
|
||||||
const selectType = async () => {
|
const selectType = async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
cardid.value = "";
|
cardid.value = "";
|
||||||
|
|
@ -142,24 +143,27 @@ const selectType = async () => {
|
||||||
payment.value = "";
|
payment.value = "";
|
||||||
await fecthlistPerson();
|
await fecthlistPerson();
|
||||||
};
|
};
|
||||||
|
// เรียกหน่วยงาน
|
||||||
const fecthlistPerson = async () => {
|
const fecthlistPerson = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileOrganizRoot)
|
.get(config.API.profileOrganizRoot)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const id = res.data.result[0].id;
|
const id = res.data.result[0].id;
|
||||||
if (id !== "") {
|
if (id !== "") {
|
||||||
findlist(id);
|
findlist(id); // id หน่วยงานไปเรียกราชชื่อ
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// เรียกราชชื่อลูกจ้างตาม id หน่วยงาน
|
||||||
const findlist = async (id: string) => {
|
const findlist = async (id: string) => {
|
||||||
let data = [{}];
|
let data = [{}];
|
||||||
|
// ข้าราชการ
|
||||||
if (employeeClass.value === "officer") {
|
if (employeeClass.value === "officer") {
|
||||||
data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
|
data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
|
||||||
|
// ลูกจ้างประจำ
|
||||||
} else if (employeeClass.value === "employee") {
|
} else if (employeeClass.value === "employee") {
|
||||||
data = [
|
data = [
|
||||||
{ criteriaType: "is_retire", criteriaValue: "false" },
|
{ criteriaType: "is_retire", criteriaValue: "false" },
|
||||||
|
|
@ -180,6 +184,7 @@ const findlist = async (id: string) => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// เรียกข้อมูลบันทึกผลตาม id
|
||||||
const fectDataByid = async (id: string) => {
|
const fectDataByid = async (id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
if (props.profileType !== undefined) {
|
if (props.profileType !== undefined) {
|
||||||
|
|
@ -215,6 +220,7 @@ const fectDataByid = async (id: string) => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// บักทึกผล
|
||||||
const clickSave = async () => {
|
const clickSave = async () => {
|
||||||
let body = {
|
let body = {
|
||||||
citizanId: cardid.value, // เลขบัตร
|
citizanId: cardid.value, // เลขบัตร
|
||||||
|
|
@ -233,6 +239,7 @@ const clickSave = async () => {
|
||||||
typePayment: payment.value, // รูปแบบการจ่าย
|
typePayment: payment.value, // รูปแบบการจ่าย
|
||||||
address: addressPayment.value, //ที่อยู่
|
address: addressPayment.value, //ที่อยู่
|
||||||
};
|
};
|
||||||
|
// เช็คค่าว่าง
|
||||||
await myForm.value!.validate().then((result: boolean) => {
|
await myForm.value!.validate().then((result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
|
|
@ -241,6 +248,7 @@ const clickSave = async () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// เพิ่มแก้ ข้อมูลบันทึกผล
|
||||||
const addNote = async (body: any) => {
|
const addNote = async (body: any) => {
|
||||||
if (props.roundId !== undefined) {
|
if (props.roundId !== undefined) {
|
||||||
await http
|
await http
|
||||||
|
|
@ -258,12 +266,13 @@ const addNote = async (body: any) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// หาเลขบัตรประจำตัวประชาชน
|
||||||
const searchcardid = () => {
|
const searchcardid = () => {
|
||||||
if (cardid.value.length === 13) {
|
if (cardid.value.length === 13) {
|
||||||
let data = listPerson.value.find((e: any) => e.citizenId === cardid.value);
|
let data = listPerson.value.find((e: any) => e.citizenId === cardid.value);
|
||||||
if (data) {
|
if (data) {
|
||||||
fullName.value = data.fullname;
|
fullName.value = data.fullname; // ชื่อ
|
||||||
position.value = data.positionEmployeePosition;
|
position.value = data.positionEmployeePosition; // ตำแหน่ง
|
||||||
} else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้");
|
} else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main"
|
||||||
import type { QTableProps, QInput } from "quasar";
|
import type { QTableProps, QInput } from "quasar";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
|
|
||||||
const DataStore = useAllocateDataStore();
|
const DataStore = useAllocateDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, dialogRemove, success } = mixin;
|
const { showLoader, hideLoader, messageError, dialogRemove, success } = mixin;
|
||||||
|
|
@ -47,7 +46,7 @@ const loadView = ref<boolean>(false);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fecthRound();
|
await fecthRound();
|
||||||
});
|
});
|
||||||
|
// เรียกรอบการเสนอขอ
|
||||||
const fecthRound = async () => {
|
const fecthRound = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.noteround())
|
.get(config.API.noteround())
|
||||||
|
|
@ -78,7 +77,7 @@ const fecthRound = async () => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// ประเภทเครื่องราช
|
||||||
const fecthInsignia = async () => {
|
const fecthInsignia = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.insignia)
|
.get(config.API.insignia)
|
||||||
|
|
@ -95,7 +94,7 @@ const fecthInsignia = async () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// tab
|
||||||
const fecthInsigniaType = async () => {
|
const fecthInsigniaType = async () => {
|
||||||
await http(config.API.insigniaType)
|
await http(config.API.insigniaType)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
@ -167,6 +166,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
// เมื่อเปลี่ยน tab
|
||||||
watch(tab, () => {
|
watch(tab, () => {
|
||||||
insigniaOp.value = DataStore.insigniaOp.filter(
|
insigniaOp.value = DataStore.insigniaOp.filter(
|
||||||
(x: any) => x.type == tab.value || x.type === ""
|
(x: any) => x.type == tab.value || x.type === ""
|
||||||
|
|
@ -178,23 +178,25 @@ watch(tab, () => {
|
||||||
fecthlistInsignia();
|
fecthlistInsignia();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// เลือกรอบการเสนขอ
|
||||||
const selectorRound = (round: string | undefined) => {
|
const selectorRound = (round: string | undefined) => {
|
||||||
selectRound.value = round;
|
selectRound.value = round;
|
||||||
if (selectRound.value) {
|
if (selectRound.value) {
|
||||||
DataStore.roundId = selectRound.value;
|
DataStore.roundId = selectRound.value;
|
||||||
}
|
}
|
||||||
const yearFilter = selectRoundOption.value.find((x: any) => x.id == round);
|
const yearFilter = selectRoundOption.value.find((x: any) => x.id == round); // หาปีของรอบการเสนอขอ
|
||||||
roundYear.value = yearFilter?.year;
|
roundYear.value = yearFilter?.year;
|
||||||
DataStore.roundYear = roundYear.value;
|
DataStore.roundYear = roundYear.value;
|
||||||
fecthlistInsignia();
|
fecthlistInsignia();
|
||||||
};
|
};
|
||||||
|
// เรียกรายการเครืองราชฯ
|
||||||
const fecthlistInsignia = async () => {
|
const fecthlistInsignia = async () => {
|
||||||
DataStore.mainTab = tab.value;
|
DataStore.mainTab = tab.value;
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.insigniaManageType(tab.value, Number(roundYear.value)))
|
.get(config.API.insigniaManageType(tab.value, Number(roundYear.value)))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.listinsignia(data);
|
DataStore.listinsignia(data);
|
||||||
})
|
})
|
||||||
|
|
@ -213,7 +215,7 @@ const close = () => {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
modalEdit.value = false;
|
modalEdit.value = false;
|
||||||
};
|
};
|
||||||
|
// เปิด popup การเพิ่มการจัดสรรเครื่องราชฯ
|
||||||
const addData = () => {
|
const addData = () => {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
action.value = "addData";
|
action.value = "addData";
|
||||||
|
|
@ -227,7 +229,7 @@ const clickEditrow = (data: any) => {
|
||||||
modalEdit.value = true;
|
modalEdit.value = true;
|
||||||
actionType.value = "insignia";
|
actionType.value = "insignia";
|
||||||
};
|
};
|
||||||
|
// บันทึกการเพิ่มการจัดสรรเครื่องราชฯ
|
||||||
const save = async (insigniaId: string, total: string) => {
|
const save = async (insigniaId: string, total: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -248,6 +250,7 @@ const save = async (insigniaId: string, total: string) => {
|
||||||
close();
|
close();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// แก้ไขการจัดสรรเครื่องราชฯ
|
||||||
const saveEdit = async (
|
const saveEdit = async (
|
||||||
id: string,
|
id: string,
|
||||||
insigniaId: string,
|
insigniaId: string,
|
||||||
|
|
@ -274,6 +277,7 @@ const saveEdit = async (
|
||||||
close();
|
close();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// ลบการจัดสรรเครื่องราชฯ
|
||||||
const clickDelete = async (insigniaId: string) => {
|
const clickDelete = async (insigniaId: string) => {
|
||||||
dialogRemove($q, async () => {
|
dialogRemove($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -303,16 +307,42 @@ const resetFilter = () => {
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
จัดสรรเครื่องราชอิสริยาภรณ์
|
จัดสรรเครื่องราชอิสริยาภรณ์
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders" v-if="loadView">
|
<q-card
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
class="col-12 q-my-md q-mt-sm rounded-borders"
|
||||||
|
v-if="loadView"
|
||||||
|
>
|
||||||
<div class="bg-grey-1 col-12 row items-center">
|
<div class="bg-grey-1 col-12 row items-center">
|
||||||
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
||||||
<q-select hide-bottom-space borderless dense lazy-rules emit-value map-options options-dense option-label="name"
|
<q-select
|
||||||
option-value="id" v-model="selectRound" :options="selectRoundOption" use-input input-debounce="0"
|
hide-bottom-space
|
||||||
input-class="text-bold text-grey" @update:model-value="selectorRound(selectRound)">
|
borderless
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
options-dense
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
v-model="selectRound"
|
||||||
|
:options="selectRoundOption"
|
||||||
|
use-input
|
||||||
|
input-debounce="0"
|
||||||
|
input-class="text-bold text-grey"
|
||||||
|
@update:model-value="selectorRound(selectRound)"
|
||||||
|
>
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-tabs dense v-model="tab" align="left" class="bg-white text-grey" active-color="primary" indicator-color="primary">
|
<q-tabs
|
||||||
|
dense
|
||||||
|
v-model="tab"
|
||||||
|
align="left"
|
||||||
|
class="bg-white text-grey"
|
||||||
|
active-color="primary"
|
||||||
|
indicator-color="primary"
|
||||||
|
>
|
||||||
<div v-for="item in DataStore.insigniaType">
|
<div v-for="item in DataStore.insigniaType">
|
||||||
<q-tab :name="item.name" :label="item.label" />
|
<q-tab :name="item.name" :label="item.label" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -320,41 +350,105 @@ const resetFilter = () => {
|
||||||
|
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-tab-panels v-model="tab" animated>
|
<q-tab-panels v-model="tab" animated>
|
||||||
<q-tab-panel v-for="item in DataStore.insigniaType" :key="item.name" :name="item.name" class="q-pa-none">
|
<q-tab-panel
|
||||||
|
v-for="item in DataStore.insigniaType"
|
||||||
|
:key="item.name"
|
||||||
|
:name="item.name"
|
||||||
|
class="q-pa-none"
|
||||||
|
>
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<div class="row col-12 q-pb-sm q-col-gutter-x-xs">
|
<div class="row col-12 q-pb-sm q-col-gutter-x-xs">
|
||||||
<div>
|
<div>
|
||||||
<q-select v-model="DataStore.insignia" dense outlined lazy-rules hide-bottom-space
|
<q-select
|
||||||
:label="`${'เครื่องราชฯ'}`" emit-value map-options option-label="name" :options="insigniaOp"
|
v-model="DataStore.insignia"
|
||||||
option-value="id" :readonly="false" :borderless="false" style="min-width: 200px" @update:model-value="
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'เครื่องราชฯ'}`"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
:options="insigniaOp"
|
||||||
|
option-value="id"
|
||||||
|
:readonly="false"
|
||||||
|
:borderless="false"
|
||||||
|
style="min-width: 200px"
|
||||||
|
@update:model-value="
|
||||||
DataStore.selectInsignia(DataStore.insignia)
|
DataStore.selectInsignia(DataStore.insignia)
|
||||||
" />
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<q-btn @click="addData()" size="12px" flat round color="add" icon="mdi-plus">
|
<q-btn
|
||||||
|
@click="addData()"
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="add"
|
||||||
|
icon="mdi-plus"
|
||||||
|
>
|
||||||
<q-tooltip>เพิ่ม</q-tooltip>
|
<q-tooltip>เพิ่ม</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="items-center" style="display: flex">
|
<div class="items-center" style="display: flex">
|
||||||
<!-- ค้นหาข้อความใน table -->
|
<!-- ค้นหาข้อความใน table -->
|
||||||
<q-input standout dense v-model="filter" ref="filterRef" outlined debounce="300" placeholder="ค้นหา"
|
<q-input
|
||||||
style="max-width: 200px" class="q-ml-sm">
|
standout
|
||||||
|
dense
|
||||||
|
v-model="filter"
|
||||||
|
ref="filterRef"
|
||||||
|
outlined
|
||||||
|
debounce="300"
|
||||||
|
placeholder="ค้นหา"
|
||||||
|
style="max-width: 200px"
|
||||||
|
class="q-ml-sm"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="filter == ''" name="search" />
|
<q-icon v-if="filter == ''" name="search" />
|
||||||
<q-icon v-if="filter !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
<q-icon
|
||||||
|
v-if="filter !== ''"
|
||||||
|
name="clear"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="resetFilter"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
<!-- แสดงคอลัมน์ใน table -->
|
<!-- แสดงคอลัมน์ใน table -->
|
||||||
<q-select v-model="visibleColumns" :display-value="$q.lang.table.columns" multiple outlined dense
|
<q-select
|
||||||
:options="columns" options-dense option-value="name" map-options emit-value style="min-width: 150px"
|
v-model="visibleColumns"
|
||||||
class="gt-xs q-ml-sm" />
|
:display-value="$q.lang.table.columns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
:options="columns"
|
||||||
|
options-dense
|
||||||
|
option-value="name"
|
||||||
|
map-options
|
||||||
|
emit-value
|
||||||
|
style="min-width: 150px"
|
||||||
|
class="gt-xs q-ml-sm"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<d-table ref="table" :columns="columns" :rows="DataStore.rows" :filter="filter" row-key="id" flat bordered
|
<d-table
|
||||||
:paging="true" dense class="custom-header-table" v-bind="attrs" :visible-columns="visibleColumns"
|
ref="table"
|
||||||
:pagination-label="paginationLabel" v-model:pagination="pagination">
|
:columns="columns"
|
||||||
|
:rows="DataStore.rows"
|
||||||
|
:filter="filter"
|
||||||
|
row-key="id"
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
:paging="true"
|
||||||
|
dense
|
||||||
|
class="custom-header-table"
|
||||||
|
v-bind="attrs"
|
||||||
|
:visible-columns="visibleColumns"
|
||||||
|
:pagination-label="paginationLabel"
|
||||||
|
v-model:pagination="pagination"
|
||||||
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
|
@ -365,37 +459,88 @@ const resetFilter = () => {
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td key="no" :props="props" @click="redirectToPage(props.row.id, props.row.insignia)">
|
<q-td
|
||||||
|
key="no"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.insignia)"
|
||||||
|
>
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="year" :props="props" @click="redirectToPage(props.row.id, props.row.insignia)">
|
<q-td
|
||||||
|
key="year"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.insignia)"
|
||||||
|
>
|
||||||
{{ props.row.year }}
|
{{ props.row.year }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="insignia" :props="props" @click="redirectToPage(props.row.id, props.row.insignia)">
|
<q-td
|
||||||
|
key="insignia"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.insignia)"
|
||||||
|
>
|
||||||
{{ props.row.insignia }}
|
{{ props.row.insignia }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="total" :props="props" @click="redirectToPage(props.row.id, props.row.insignia)">
|
<q-td
|
||||||
|
key="total"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.insignia)"
|
||||||
|
>
|
||||||
{{ props.row.total }}
|
{{ props.row.total }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="allocate" :props="props" @click="redirectToPage(props.row.id, props.row.insignia)">
|
<q-td
|
||||||
|
key="allocate"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.insignia)"
|
||||||
|
>
|
||||||
{{ props.row.allocate }}
|
{{ props.row.allocate }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="remain" :props="props" @click="redirectToPage(props.row.id, props.row.insignia)">
|
<q-td
|
||||||
|
key="remain"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.insignia)"
|
||||||
|
>
|
||||||
{{ props.row.remain }}
|
{{ props.row.remain }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td auto-width>
|
<q-td auto-width>
|
||||||
<q-btn icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense @click.stop>
|
<q-btn
|
||||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
icon="mdi-dots-vertical"
|
||||||
|
size="12px"
|
||||||
|
color="grey-7"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<q-menu
|
||||||
|
transition-show="jump-down"
|
||||||
|
transition-hide="jump-up"
|
||||||
|
>
|
||||||
<q-list dense style="min-width: auto">
|
<q-list dense style="min-width: auto">
|
||||||
<q-item clickable @click.stop="clickEditrow(props.row)">
|
<q-item clickable @click.stop="clickEditrow(props.row)">
|
||||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
<q-item-section
|
||||||
|
style="min-width: 0px"
|
||||||
|
avatar
|
||||||
|
class="q-py-sm"
|
||||||
|
>
|
||||||
<q-tooltip>แก้ไข</q-tooltip>
|
<q-tooltip>แก้ไข</q-tooltip>
|
||||||
<q-icon color="primary" size="xs" name="mdi-pencil" />
|
<q-icon
|
||||||
|
color="primary"
|
||||||
|
size="xs"
|
||||||
|
name="mdi-pencil"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>แก้ไข</q-item-section>
|
<q-item-section>แก้ไข</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup @click.stop="clickDelete(props.row.id)">
|
<q-item
|
||||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click.stop="clickDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-item-section
|
||||||
|
style="min-width: 0px"
|
||||||
|
avatar
|
||||||
|
class="q-py-sm"
|
||||||
|
>
|
||||||
<q-tooltip>ลบ</q-tooltip>
|
<q-tooltip>ลบ</q-tooltip>
|
||||||
<q-icon color="red" size="xs" name="mdi-delete" />
|
<q-icon color="red" size="xs" name="mdi-delete" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
@ -408,8 +553,16 @@ const resetFilter = () => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
<q-pagination v-model="pagination.page" active-color="primary" color="dark" :max="scope.pagesNumber"
|
<q-pagination
|
||||||
:max-pages="5" size="sm" boundary-links direction-links></q-pagination>
|
v-model="pagination.page"
|
||||||
|
active-color="primary"
|
||||||
|
color="dark"
|
||||||
|
:max="scope.pagesNumber"
|
||||||
|
:max-pages="5"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
></q-pagination>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -424,8 +577,19 @@ const resetFilter = () => {
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<DialogForm :modal="modal" :save="save" :close="close" :insignia-list="insigniaOp" />
|
<DialogForm
|
||||||
|
:modal="modal"
|
||||||
|
:save="save"
|
||||||
|
:close="close"
|
||||||
|
:insignia-list="insigniaOp"
|
||||||
|
/>
|
||||||
|
|
||||||
<DialogEdit :modal="modalEdit" :save="saveEdit" :close="close" :insigniadata="rowData" :actionType="actionType" />
|
<DialogEdit
|
||||||
|
:modal="modalEdit"
|
||||||
|
:save="saveEdit"
|
||||||
|
:close="close"
|
||||||
|
:insigniadata="rowData"
|
||||||
|
:actionType="actionType"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,7 @@ import DialogHeader from "@/modules/07_insignia/components/DialogHeader.vue";
|
||||||
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue";
|
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogMessage } =
|
const { dialogMessage } = mixin;
|
||||||
mixin;
|
|
||||||
const name = ref<string>("");
|
const name = ref<string>("");
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
|
|
@ -301,15 +300,9 @@ const saveNote = async () => {
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
await saveTextNote();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const saveTextNote = async () => {};
|
|
||||||
|
|
||||||
const redirectToPage = (id?: string) => {
|
|
||||||
router.push({ name: "allocateDetail" });
|
|
||||||
};
|
|
||||||
// ค้นหาในตาราง
|
// ค้นหาในตาราง
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const filterRef = ref<any>(null);
|
const filterRef = ref<any>(null);
|
||||||
|
|
@ -483,11 +476,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td>
|
<q-td>
|
||||||
<q-btn
|
<q-btn label="คืนแล้ว" @click="clickNote()" color="blue" />
|
||||||
label="คืนแล้ว"
|
|
||||||
@click="clickNote()"
|
|
||||||
color="blue"
|
|
||||||
/>
|
|
||||||
</q-td>
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue