API ข้อมูลการจ้าง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-10-25 15:20:28 +07:00
parent 1f18b1257e
commit 95e02c21ec
4 changed files with 51 additions and 9 deletions

View file

@ -184,7 +184,11 @@ export default {
profileCitizenId: (citizenId: string) => `${profile}citizenId/${citizenId}`,
profileEmployeeIn: `${profile}information/employee`,
profileHistory: (type: string) => `${profile}search/history/oc/${type}`
profileHistory: (type: string) => `${profile}search/history/oc/${type}`,
//ระบบ ลูกจ้างชั่คราว
employmentId: (profileId: string) => `${profile}employment/${profileId}`

View file

@ -1,7 +1,10 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import type { QTableProps } from "quasar";
import type {
@ -10,8 +13,10 @@ import type {
} from "@/modules/08_registryEmployee/interface/response/Main";
const $q = useQuasar();
const route = useRoute();
const maxin = useCounterMixin();
const { date2Thai, dialogConfirm } = maxin;
const { date2Thai, dialogConfirm, success, messageError } = maxin;
const profileId = ref<string>(route.params.id.toString());
const rows = ref<any[]>([]);
const columns = ref<QTableProps["columns"]>([
@ -36,6 +41,21 @@ const columns = ref<QTableProps["columns"]>([
]);
const visibleColumns = ref<string[]>(["dateEmployment", "orderEmployment"]);
const filter = ref<string>();
onMounted(async () => {
// await fetchList();
});
async function fetchList() {
await http
.get(config.API.employmentId(profileId.value))
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
}
//
const modal = ref<boolean>(false);
const formData = reactive<FormEmployment>({
@ -79,7 +99,18 @@ function onSubmit() {
$q,
async () => {
console.log(formData);
colsePopup();
// await http
// .post(config.API.employmentId(profileId.value), formData)
// .then(async () => {
// await fetchList();
// success($q, "");
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(() => {
// colsePopup();
// });
},
"ยืนยันการบันทึกข้อมูล",
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"

View file

@ -1507,4 +1507,4 @@ const getClass = (val: boolean) => {
</div>
</template>
</DialogHistory>
</template>
</template>

View file

@ -659,7 +659,10 @@ const editData = async () => {
nationality: informaData.value.nationality,
race: informaData.value.ethnicity,
religionId: informaData.value.religionId,
birthDate: informaData.value.birthDate != null ? dateToISO(informaData.value.birthDate) : dateToISO(new Date()),
birthDate:
informaData.value.birthDate != null
? dateToISO(informaData.value.birthDate)
: dateToISO(new Date()),
bloodGroupId: informaData.value.bloodId,
relationshipId: informaData.value.statusId,
telephoneNumber: informaData.value.tel,
@ -758,7 +761,7 @@ const getClass = (val: boolean) => {
:addEmployee="statusAdd()"
/>
<q-form ref="myform" class="col-12">
<div class="row col-12 q-col-gutter-x-sm q-col-gutter-y-sm">
<div class="row col-12 q-col-gutter-x-sm q-col-gutter-y-sm">
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
@ -861,7 +864,11 @@ const getClass = (val: boolean) => {
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="informaData.birthDate ? date2Thai(informaData.birthDate) : null"
:model-value="
informaData.birthDate
? date2Thai(informaData.birthDate)
: null
"
:rules="[(val:string) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]"
:label="`${'วัน/เดือน/ปี เกิด'}`"
>
@ -1156,4 +1163,4 @@ const getClass = (val: boolean) => {
</q-tr>
</template>
</HistoryTable>
</template>
</template>