Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
589beb2189
5 changed files with 133 additions and 151 deletions
|
|
@ -48,4 +48,6 @@ export default {
|
|||
placementPosition: () => `${placement}/position/use`,
|
||||
// putPositiom
|
||||
putPosition: (id:any) => `${placement}/position/${id}`,
|
||||
// clear Position
|
||||
clearPosition: (personalId:string) => `${placement}/position/clear/${personalId}`
|
||||
};
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@ const fetchplacementPosition = async () => {
|
|||
await http
|
||||
.get(config.API.placementPosition())
|
||||
.then((res: any) => {
|
||||
console.log("1221111111");
|
||||
|
||||
placementPosition.value = res.data.result;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
|
|
@ -277,7 +279,7 @@ const positionLevelOptions = ref<Object[]>([
|
|||
]);
|
||||
|
||||
const selectedPosition = async (data: any) => {
|
||||
console.log("selecteds", data);
|
||||
// console.log("selecteds", data);
|
||||
if (data.name == null && selected.value != data.keyId) {
|
||||
// console.log("selecteds", data);
|
||||
|
||||
|
|
@ -361,7 +363,7 @@ const selectedPosition = async (data: any) => {
|
|||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
}
|
||||
console.log("dataForm", dataForm);
|
||||
// console.log("dataForm", dataForm);
|
||||
};
|
||||
|
||||
const checkPosition = (val: string) => {
|
||||
|
|
@ -374,6 +376,7 @@ const expanded = ref<string[]>([]);
|
|||
watch(props, () => {
|
||||
expanded.value = [];
|
||||
const dataPersonal = props.personal;
|
||||
fetchplacementPosition();
|
||||
if (dataPersonal) {
|
||||
dataPersonal.map((data: any) => {
|
||||
personal.value = data;
|
||||
|
|
@ -382,15 +385,19 @@ watch(props, () => {
|
|||
}
|
||||
// console.log("draft===>", personal.value.draft);
|
||||
|
||||
if (personal.value && personal.value.draft === false) {
|
||||
if (
|
||||
personal.value &&
|
||||
personal.value.draft === false &&
|
||||
personal.value.positionNumber !== null
|
||||
) {
|
||||
// const findData = dataRespone.value.find(findByPerson);
|
||||
let findData: any = null;
|
||||
dataRespone.value.map((x: any) => {
|
||||
findData = findByPerson(x);
|
||||
console.log(findData);
|
||||
// console.log(findData);
|
||||
|
||||
if (findData != null) {
|
||||
console.log("findData===>", findData);
|
||||
// console.log("findData===>", findData);
|
||||
selectedPosition(findData);
|
||||
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
||||
expanded.value.push(findData.keyId.slice(0, i));
|
||||
|
|
@ -423,6 +430,34 @@ function findByPerson(element: any): any {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
const clearPosition = () => {
|
||||
console.log(personal.value);
|
||||
$q.dialog({
|
||||
title: "ยืนยันการคืนตำแหน่ง",
|
||||
message: "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
const: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.clearPosition(personal.value.personalId), {})
|
||||
.then((res: Object) => success($q, "คืนตำแหน่งสำเร็จ"))
|
||||
|
||||
.catch((e: Object) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await closeAndClear();
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -707,6 +742,20 @@ function findByPerson(element: any): any {
|
|||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-12 col-md-12 q-pa-lg"
|
||||
v-if="personal.positionNumber"
|
||||
>
|
||||
<div class="row">
|
||||
<div class="col-md-4 offset-md-4">
|
||||
<q-btn
|
||||
color="grey"
|
||||
label="คืนตำแหน่ง"
|
||||
@click="clearPosition"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-sx-12 col-sm-12 col-md-12">
|
||||
<q-separator inset size="2px" class="q-my-md" />
|
||||
</div> -->
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch, reactive, computed } from "vue";
|
||||
import { ref, onMounted, watch, reactive, computed, watchEffect } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -209,7 +209,7 @@ const getTable = async () => {
|
|||
await http
|
||||
.get(config.API.personalList(examIdString))
|
||||
.then(async (res: any) => {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
dataRes.value = res.data.result;
|
||||
rowsAll.value = [];
|
||||
(rowsFilter.value = []),
|
||||
|
|
@ -252,7 +252,9 @@ const getTable = async () => {
|
|||
? rowsAll.value
|
||||
: rowsAll.value.filter((x: any) => x.statusId != "CONTAIN");
|
||||
|
||||
rowsFilter.value = rows.value.filter((e: any) => e.draft == "รอส่งตัว");
|
||||
rowsFilter.value = rows.value.filter(
|
||||
(e: any) => e.draft == "รอส่งตัว" && e.positionNumber == null
|
||||
);
|
||||
console.log(rowsFilter.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -433,6 +435,7 @@ const openAppointModal = (pid: string) => {
|
|||
const clickCloseModalTree = async () => {
|
||||
await getTable();
|
||||
appointModal.value = false;
|
||||
props.statCard();
|
||||
};
|
||||
|
||||
const validateData = async () => {
|
||||
|
|
@ -492,6 +495,11 @@ onMounted(async () => {
|
|||
}
|
||||
await getTable();
|
||||
});
|
||||
watchEffect(() => {
|
||||
if (getTable()) {
|
||||
props.statCard();
|
||||
}
|
||||
});
|
||||
|
||||
const containStatus = ref<boolean>(false);
|
||||
watch(containStatus, () => {
|
||||
|
|
@ -532,6 +540,7 @@ const savelist = () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ watch(props, () => {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
const validateData = () => {
|
||||
const selectedIds = personalForm.value.isProperty;
|
||||
|
||||
|
|
@ -105,24 +106,24 @@ const validateData = () => {
|
|||
);
|
||||
};
|
||||
|
||||
const ClickSave = () => {
|
||||
const isValid = validateData();
|
||||
// const ClickSave = () => {
|
||||
// const isValid = validateData();
|
||||
|
||||
if (isValid) {
|
||||
// props.close();
|
||||
// props.validate();
|
||||
// putpersonalForm();
|
||||
modalConfirm(
|
||||
$q,
|
||||
"การยืนยัน",
|
||||
"ยืนยันการบันทึกการคัดกรองคุณสมบัติ",
|
||||
putpersonalForm
|
||||
);
|
||||
} else {
|
||||
success($q, "กรอกให้ครบ");
|
||||
console.log();
|
||||
}
|
||||
};
|
||||
// if (isValid) {
|
||||
// // props.close();
|
||||
// // props.validate();
|
||||
// // putpersonalForm();
|
||||
// modalConfirm(
|
||||
// $q,
|
||||
// "การยืนยัน",
|
||||
// "ยืนยันการบันทึกการคัดกรองคุณสมบัติ",
|
||||
// putpersonalForm
|
||||
// );
|
||||
// } else {
|
||||
// success($q, "กรอกให้ครบ");
|
||||
// console.log();
|
||||
// }
|
||||
// };
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -134,7 +135,7 @@ const fetchData = async () => {
|
|||
university: e.name,
|
||||
degree: e.degree,
|
||||
major: e.field,
|
||||
graduation: e.finishDate,
|
||||
graduation: date2Thai(e.finishDate),
|
||||
});
|
||||
});
|
||||
})
|
||||
|
|
@ -145,6 +146,7 @@ const fetchData = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const formBmaofficer = (val: string) => {
|
||||
switch (val) {
|
||||
case "OFFICER":
|
||||
|
|
@ -345,7 +347,7 @@ const putpersonalForm = async () => {
|
|||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<!-- <q-separator />
|
||||
<div>
|
||||
<DialogFooter
|
||||
@click="ClickSave"
|
||||
|
|
@ -353,7 +355,7 @@ const putpersonalForm = async () => {
|
|||
:editvisible="save"
|
||||
:validate="validateData"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
|
|
@ -34,15 +34,15 @@ const columns = ref<any["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
/* {
|
||||
name: "fixname",
|
||||
align: "left",
|
||||
label: "คำนำหน้านาม",
|
||||
title: "คำนำหน้านาม",
|
||||
field: "fixname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
}, */
|
||||
/* {
|
||||
name: "fixname",
|
||||
align: "left",
|
||||
label: "คำนำหน้านาม",
|
||||
title: "คำนำหน้านาม",
|
||||
field: "fixname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
}, */
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
|
|
@ -253,8 +253,8 @@ const clickDelete = (prop: any) => {
|
|||
} else await fecthlist(retireld_params);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
.onCancel(() => { })
|
||||
.onDismiss(() => { });
|
||||
};
|
||||
// note
|
||||
const fetchReason = async (prop: string) => {
|
||||
|
|
@ -269,6 +269,7 @@ const fetchReason = async (prop: string) => {
|
|||
messageError($q, e);
|
||||
});
|
||||
};
|
||||
|
||||
const saveNote = () => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูลข้อมูล",
|
||||
|
|
@ -297,8 +298,8 @@ const saveNote = () => {
|
|||
modalNote.value = false;
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
.onCancel(() => { })
|
||||
.onDismiss(() => { });
|
||||
};
|
||||
|
||||
const UpdateListId = (retireld: string, pId: string) => {
|
||||
|
|
@ -361,26 +362,13 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="backHistory"
|
||||
/>
|
||||
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="backHistory" />
|
||||
รายชื่อผู้เกษียณอายุราชการ
|
||||
</div>
|
||||
<div>
|
||||
<q-card class="col-12 q-pa-md">
|
||||
<div class="row col-12 q-pb-sm">
|
||||
<AddList
|
||||
:retireld="retireld"
|
||||
:profile-id="profileId"
|
||||
:UpdateListId="UpdateListId"
|
||||
/>
|
||||
<AddList :retireld="retireld" :profile-id="profileId" :UpdateListId="UpdateListId" />
|
||||
<!-- <q-btn flat round style="color: #016987;" icon="save" @click="saveList">
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn> -->
|
||||
|
|
@ -409,35 +397,15 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
|
||||
<q-space />
|
||||
<q-tabs shrink>
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<q-input borderless outlined dense debounce="300" v-model="filter" placeholder="ค้นหา" style="max-width: 200px"
|
||||
class="q-ml-sm">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
>
|
||||
<q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns"
|
||||
emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm">
|
||||
<!-- <template v-slot:option="{ opt }">
|
||||
<div>{{ opt.label }}</div>
|
||||
<div class="sublabel">{{ opt.sublabel }}</div>
|
||||
|
|
@ -447,20 +415,9 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<q-table
|
||||
flat
|
||||
dense
|
||||
bordered
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
row-key="order"
|
||||
class="custom-header-table"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
no-data-label="ไม่มีข้อมูล"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<q-table flat dense bordered :rows="rows" :columns="columns" row-key="order" class="custom-header-table"
|
||||
:filter="filter" :visible-columns="visibleColumns" no-data-label="ไม่มีข้อมูล"
|
||||
:pagination-label="paginationLabel" v-model:pagination="pagination">
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
@ -476,11 +433,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
:style="props.row.profileId === profileId && 'color: #26a69a;'"
|
||||
>
|
||||
<q-tr :props="props" class="cursor-pointer" :style="props.row.profileId === profileId && 'color: #26a69a;'"
|
||||
@click="
|
||||
fetchReason(props.row.id), (modalNote = true), (note = '')
|
||||
">
|
||||
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
||||
<!-- <q-td key="fixname" :props="props">{{ props.row.fixname }}</q-td> -->
|
||||
<q-td key="name" :props="props">{{ props.row.fixname + props.row.name }}</q-td>
|
||||
|
|
@ -521,40 +477,20 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
>
|
||||
<q-tooltip>โน้ต</q-tooltip></q-btn
|
||||
> -->
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="blue"
|
||||
dense
|
||||
icon="mdi-file-account"
|
||||
@click="router.push(`/registry/${props.row.profileId}`)"
|
||||
>
|
||||
<q-btn flat round color="blue" dense icon="mdi-file-account"
|
||||
@click="router.push(`/registry/${props.row.profileId}`)">
|
||||
<q-tooltip>ดูข้อมูลทะเบียนประวัติ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
class="text-red-14"
|
||||
icon="mdi-delete"
|
||||
dense
|
||||
@click="clickDelete(props.row)"
|
||||
><q-tooltip>ลบข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn flat round class="text-red-14" icon="mdi-delete" dense
|
||||
@click="clickDelete(props.row)"><q-tooltip>ลบข้อมูล</q-tooltip></q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
color="primary"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
<q-pagination v-model="pagination.page" color="primary" :max="scope.pagesNumber" :max-pages="5" size="sm"
|
||||
boundary-links direction-links></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
|
|
@ -566,38 +502,19 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-card style="width: 700px; max-width: 80vw">
|
||||
<q-card-section class="q-pt-none">
|
||||
<q-toolbar class="q-py-md">
|
||||
<q-toolbar-title class="header-text text-weight-bolder"
|
||||
>กรอกเหตุผล
|
||||
<q-toolbar-title class="header-text text-weight-bolder">กรอกเหตุผล
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="modalNote = false"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
<q-btn icon="close" unelevated round dense @click="modalNote = false"
|
||||
style="color: #ff8080; background-color: #ffdede" />
|
||||
</q-toolbar>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pt-none">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="note"
|
||||
:rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
|
||||
:label="`${'กรอกเหตุผล'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
<q-input outlined dense lazy-rules v-model="note" :rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
|
||||
:label="`${'กรอกเหตุผล'}`" type="textarea" />
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="บักทึก"
|
||||
color="secondary"
|
||||
@click="saveNote"
|
||||
:disable="visibleNote"
|
||||
/>
|
||||
<q-btn label="บักทึก" color="secondary" @click="saveNote" :disable="visibleNote" />
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
@ -623,13 +540,16 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
position: sticky;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.q-table thead tr:last-child th {
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.q-btn-dropdown__arrow {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue