ปรับ fe sprint2
This commit is contained in:
parent
8576f3c387
commit
0d6ff7be0a
83 changed files with 6932 additions and 2571 deletions
|
|
@ -125,8 +125,10 @@
|
|||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateExam)"
|
||||
:model-value="dateExam != null ? date2Thai(dateExam) : null"
|
||||
:label="`${'วันที่สอบ'}`"
|
||||
clearable
|
||||
@clear="clearDateExam"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -164,6 +166,7 @@
|
|||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateAnnouncement)"
|
||||
:label="`${'วันที่ประกาศ'}`"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ประกาศ'}`]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -183,6 +186,7 @@
|
|||
v-model="dateRegister"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
clearValue
|
||||
borderless
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
|
|
@ -201,6 +205,8 @@
|
|||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateRegister)"
|
||||
:label="`${'วันที่สมัคร'}`"
|
||||
clearable
|
||||
@clear="clearDateRegister"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -238,6 +244,8 @@
|
|||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(datePayment)"
|
||||
:label="`${'วันที่ชำระเงิน'}`"
|
||||
clearable
|
||||
@clear="clearDatePayment"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -272,8 +280,12 @@
|
|||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateAnnounce)"
|
||||
:model-value="
|
||||
dateAnnounce != null ? date2Thai(dateAnnounce) : null
|
||||
"
|
||||
:label="`${'วันประกาศผลสอบ'}`"
|
||||
clearable
|
||||
@clear="clearDateAnnounce"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -417,6 +429,13 @@
|
|||
</template>
|
||||
</selector>
|
||||
</q-td>
|
||||
<q-td key="highDegree" :props="props">
|
||||
<q-checkbox
|
||||
v-model="props.row.highDegree"
|
||||
label="ปริญญาขึ้นไป"
|
||||
color="teal"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td key="type" :props="props">
|
||||
<selector
|
||||
class=""
|
||||
|
|
@ -976,8 +995,7 @@ const $q = useQuasar(); // show dialog
|
|||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
mixin;
|
||||
const { date2Thai, success, dateToISO, messageError } = mixin;
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
const name = ref<string>("");
|
||||
const note = ref<string>("");
|
||||
|
|
@ -991,11 +1009,11 @@ const yearly = ref<number>(new Date().getFullYear());
|
|||
const nameRaw = ref<number | null>(null);
|
||||
const roundRaw = ref<number | null>(null);
|
||||
const yearlyRaw = ref<number | null>(null);
|
||||
const dateRegister = ref<[Date, Date]>([new Date(), new Date()]); //วันที่สมัคร
|
||||
const datePayment = ref<[Date, Date]>([new Date(), new Date()]); //วันที่จ่ายเงิน
|
||||
const dateAnnouncement = ref<[Date, Date]>([new Date(), new Date()]); //วันที่ประกาศ
|
||||
const dateAnnounce = ref<Date>(new Date()); //วันประกาศผลสอบ
|
||||
const dateExam = ref<Date>(new Date()); //วันที่สอบ
|
||||
const dateRegister = ref<[Date, Date] | null>(null); //วันที่สมัคร
|
||||
const datePayment = ref<[Date, Date] | null>(null); //วันที่จ่ายเงิน
|
||||
const dateAnnouncement = ref<[Date, Date] | null>(null); //วันที่ประกาศ
|
||||
const dateAnnounce = ref<Date | null>(null); //วันประกาศผลสอบ
|
||||
const dateExam = ref<Date | null>(null); //วันที่สอบ
|
||||
const myFormPayment = ref<any>();
|
||||
const myFormPosition = ref<any>();
|
||||
const positionPathOptions = ref<DataOption[]>([]);
|
||||
|
|
@ -1007,6 +1025,10 @@ const examTypeOptions = [
|
|||
{ name: "ทั่วไป", id: "normol" },
|
||||
{ name: "แพทย์", id: "docter" },
|
||||
];
|
||||
const educateOptions = [
|
||||
{ name: "ต่ำกว่าปริญญาตรี", id: "low" },
|
||||
{ name: "ปริญญาขึ้นไป", id: "normol" },
|
||||
];
|
||||
const category = ref<string>("");
|
||||
const categoryOptions = [
|
||||
{ name: "สำนักอนามัย", id: "hygiene" },
|
||||
|
|
@ -1065,7 +1087,11 @@ const columnsPayment = ref<QTableProps["columns"]>([
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const visibleColumnsPosition = ref<String[]>(["position", "type"]);
|
||||
const visibleColumnsPosition = ref<String[]>([
|
||||
"position",
|
||||
"type",
|
||||
"highDegree",
|
||||
]);
|
||||
const columnsPosition = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "position",
|
||||
|
|
@ -1078,6 +1104,17 @@ const columnsPosition = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "highDegree",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษาปริญญาขึ้นไป",
|
||||
sortable: true,
|
||||
field: "highDegree",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "type",
|
||||
align: "left",
|
||||
|
|
@ -1100,7 +1137,7 @@ watch(organizationName, (count: DataOption, prevCount: DataOption) => {
|
|||
});
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
if (route.params.id != undefined) {
|
||||
edit.value = true;
|
||||
id.value = route.params.id.toString();
|
||||
|
|
@ -1123,7 +1160,7 @@ const clickBack = () => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamId(id.value))
|
||||
.then((res) => {
|
||||
|
|
@ -1140,6 +1177,7 @@ const fetchData = async () => {
|
|||
id: r.typeId,
|
||||
name: r.typeName,
|
||||
},
|
||||
highDegree: r.highDegree,
|
||||
});
|
||||
});
|
||||
const bankData: ResponsePayment[] = [];
|
||||
|
|
@ -1162,20 +1200,24 @@ const fetchData = async () => {
|
|||
roundRaw.value = data.round;
|
||||
yearlyRaw.value = data.year;
|
||||
fee.value = data.fee;
|
||||
dateAnnounce.value = new Date(data.announcementDate);
|
||||
dateAnnouncement.value = [
|
||||
new Date(data.announcementStartDate),
|
||||
new Date(data.announcementEndDate),
|
||||
];
|
||||
dateExam.value = new Date(data.examDate);
|
||||
dateRegister.value = [
|
||||
new Date(data.registerStartDate),
|
||||
new Date(data.registerEndDate),
|
||||
];
|
||||
datePayment.value = [
|
||||
new Date(data.paymentStartDate),
|
||||
new Date(data.paymentEndDate),
|
||||
];
|
||||
dateAnnounce.value =
|
||||
data.announcementDate != null ? new Date(data.announcementDate) : null;
|
||||
dateAnnouncement.value =
|
||||
data.announcementStartDate != null && data.announcementEndDate != null
|
||||
? [
|
||||
new Date(data.announcementStartDate),
|
||||
new Date(data.announcementEndDate),
|
||||
]
|
||||
: null;
|
||||
dateExam.value = data.examDate != null ? new Date(data.examDate) : null;
|
||||
dateRegister.value =
|
||||
data.registerStartDate != null && data.registerEndDate != null
|
||||
? [new Date(data.registerStartDate), new Date(data.registerEndDate)]
|
||||
: null;
|
||||
datePayment.value =
|
||||
data.paymentStartDate != null && data.paymentEndDate != null
|
||||
? [new Date(data.paymentStartDate), new Date(data.paymentEndDate)]
|
||||
: null;
|
||||
organizationShortName.value = {
|
||||
id: data.organizationCodeId,
|
||||
name: data.organizationCodeName,
|
||||
|
|
@ -1197,7 +1239,7 @@ const fetchData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1205,7 +1247,7 @@ const fetchData = async () => {
|
|||
* get รายการ รหัสหน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationShortName = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationShortName)
|
||||
.then((res) => {
|
||||
|
|
@ -1223,7 +1265,7 @@ const fetchOrganizationShortName = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1231,7 +1273,7 @@ const fetchOrganizationShortName = async () => {
|
|||
* get รายการ หน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationOrganization = async (val: string) => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organization)
|
||||
.then((res) => {
|
||||
|
|
@ -1249,7 +1291,7 @@ const fetchOrganizationOrganization = async (val: string) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1257,7 +1299,7 @@ const fetchOrganizationOrganization = async (val: string) => {
|
|||
* get รายการ ตำแหน่งในสายงาน
|
||||
*/
|
||||
const fetchPositionPath = async (val: string) => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.positionPath)
|
||||
.then((res) => {
|
||||
|
|
@ -1275,7 +1317,7 @@ const fetchPositionPath = async (val: string) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1321,13 +1363,21 @@ const sendData = () => {
|
|||
positionName: r.position.name,
|
||||
typeId: r.type.id,
|
||||
typeName: r.type.name,
|
||||
highDegree: r.highDegree ? true : false,
|
||||
});
|
||||
});
|
||||
const valueData: RequestPeriodExam = {
|
||||
announcementDate: dateToISO(dateAnnounce.value),
|
||||
announcementEndDate: dateToISO(dateAnnouncement.value[1]),
|
||||
announcementStartDate: dateToISO(dateAnnouncement.value[0]),
|
||||
examDate: dateToISO(dateExam.value),
|
||||
announcementDate:
|
||||
dateAnnounce.value != null ? dateToISO(dateAnnounce.value) : null,
|
||||
announcementEndDate:
|
||||
dateAnnouncement.value != null
|
||||
? dateToISO(dateAnnouncement.value[1])
|
||||
: null,
|
||||
announcementStartDate:
|
||||
dateAnnouncement.value != null
|
||||
? dateToISO(dateAnnouncement.value[0])
|
||||
: null,
|
||||
examDate: dateExam.value != null ? dateToISO(dateExam.value) : null,
|
||||
bankExam: rowsPayment.value,
|
||||
checkDisability: checkDisability.value,
|
||||
announcementExam: announcementExam.value,
|
||||
|
|
@ -1342,12 +1392,16 @@ const sendData = () => {
|
|||
organizationCodeName: organizationShortName.value?.name,
|
||||
organizationId: organizationName.value?.id,
|
||||
organizationName: organizationName.value?.name,
|
||||
paymentEndDate: dateToISO(datePayment.value[1]),
|
||||
paymentEndDate:
|
||||
datePayment.value != null ? dateToISO(datePayment.value[1]) : null,
|
||||
paymentKrungThai: pay.value,
|
||||
paymentStartDate: dateToISO(datePayment.value[0]),
|
||||
paymentStartDate:
|
||||
datePayment.value != null ? dateToISO(datePayment.value[0]) : null,
|
||||
positionExam: positionData,
|
||||
registerEndDate: dateToISO(dateRegister.value[1]),
|
||||
registerStartDate: dateToISO(dateRegister.value[0]),
|
||||
registerEndDate:
|
||||
dateRegister.value != null ? dateToISO(dateRegister.value[1]) : null,
|
||||
registerStartDate:
|
||||
dateRegister.value != null ? dateToISO(dateRegister.value[0]) : null,
|
||||
round: round.value,
|
||||
year: yearly.value,
|
||||
category: category.value,
|
||||
|
|
@ -1356,7 +1410,7 @@ const sendData = () => {
|
|||
};
|
||||
|
||||
const addData = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.periodExam, sendData())
|
||||
.then(async (res) => {
|
||||
|
|
@ -1371,12 +1425,12 @@ const addData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const editData = async (id: string) => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodExamId(id), sendData())
|
||||
.then(async (res) => {
|
||||
|
|
@ -1389,7 +1443,7 @@ const editData = async (id: string) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1416,13 +1470,13 @@ const uploadDocData = async () => {
|
|||
fileDocDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodExamDoc(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
} else {
|
||||
clickBack();
|
||||
|
|
@ -1452,13 +1506,13 @@ const uploadImgData = async () => {
|
|||
fileImgDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodExamImg(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -1467,7 +1521,7 @@ const deleteDocData = async (docId: string) => {
|
|||
const params = {
|
||||
documentId: docId,
|
||||
};
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodExamDoc(id.value.toString()), {
|
||||
params,
|
||||
|
|
@ -1510,6 +1564,7 @@ const clickAddPosition = () => {
|
|||
id: "00000000-0000-0000-0000-000000000000",
|
||||
position: { id: "", name: "" },
|
||||
type: { id: "normol", name: "ทั่วไป" },
|
||||
highDegree: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -1526,7 +1581,7 @@ const clickDeletePosition = (row: any) => {
|
|||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
const dateThaiRange = (val: [Date, Date] | null) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
|
|
@ -1535,6 +1590,22 @@ const dateThaiRange = (val: [Date, Date]) => {
|
|||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
|
||||
const clearDateExam = () => {
|
||||
dateExam.value = null;
|
||||
};
|
||||
|
||||
const clearDateRegister = () => {
|
||||
dateRegister.value = null;
|
||||
};
|
||||
|
||||
const clearDatePayment = () => {
|
||||
datePayment.value = null;
|
||||
};
|
||||
|
||||
const clearDateAnnounce = () => {
|
||||
dateAnnounce.value = null;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue