Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2024-02-21 11:29:09 +07:00
commit cdc5746454
11 changed files with 74 additions and 56 deletions

View file

@ -74,7 +74,7 @@
<q-icon
name="mdi-plus"
size="25px"
color="grey-7"
color="primary"
@click="addCalendar()"
/>
<q-tooltip>เพมวนหย</q-tooltip>
@ -84,7 +84,7 @@
<q-icon
name="mdi-content-copy"
size="22px"
color="grey-7"
color="blue-6"
@click="copyCalendar()"
/>
<q-tooltip>ดลอกวนหย</q-tooltip>

View file

@ -139,13 +139,13 @@ watch(
);
</script>
<template>
<q-dialog v-model="modal" full-width full-height persistent>
<q-dialog v-model="modal" full-width persistent>
<q-card>
<HeaderDialog :tittle="title" :close="() => (modal = false)" />
<q-separator />
<q-card-section class="q-pt-none bg-grey-2 q-pa-md">
<div class="row q-col-gutter-md">
<q-card-section class="q-pt-none bg-grey-2 q-pa-sm">
<div class="row">
<q-card bordered class="col-12 col-sm-8 q-pa-sm">
<q-toolbar style="padding: 0">
<q-toolbar-title class="text-subtitle2 text-bold"

View file

@ -668,7 +668,11 @@ watch([() => page.value, () => pageSize.value], () => {
:props="props"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
{{
(page - 1) * Number(pageSize) +
props.rowIndex +
1
}}
</div>
<div v-else>

View file

@ -75,6 +75,7 @@ function getData() {
page: 1,
pageSize: 100,
keyword: "",
revisionId: store.draftId,
})
.then((res) => {
const dataList = res.data.result.data;

View file

@ -215,8 +215,8 @@ function clearForm() {
</script>
<template>
<q-dialog v-model="modal" full-width full-height persistent>
<q-card class="column full-height">
<q-dialog v-model="modal" full-width persistent>
<q-card>
<Header
:tittle="'เลือกตำแหน่งที่ต้องการสืบทอดจากโครงสร้างปัจจุบัน'"
:close="
@ -227,8 +227,8 @@ function clearForm() {
/>
<q-separator />
<q-card-section class="q-pt-none q-pa-md bg-grey-2">
<div class="row q-col-gutter-md">
<q-card-section class="q-pt-none q-pa-sm bg-grey-2">
<div class="row">
<q-card
bordered
class="col-12 col-sm-4 scroll q-pa-sm"

View file

@ -1648,7 +1648,7 @@ watch(
() => {
const num =
profileType.value === "officer"
? 32
? 31
: employeeClass.value === "temp"
? 29
: 31;

View file

@ -1299,7 +1299,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
onMounted(async () => {
// await fetchPosition();
await getPosition();
// await getPosition();
// await nodeTree();
await fetchData();
});

View file

@ -1,15 +1,18 @@
<script setup lang="ts">
import { ref, onMounted, watch } from "vue";
import { ref, onMounted } from "vue";
/** importType*/
import type { QTableProps } from "quasar";
import type { Positions } from "@/modules/05_placement/interface/response/SelectOrg";
import type { DataPositionNo } from "@/modules/05_placement/interface/index/SelectOrg";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
const { date2Thai, showLoader, hideLoader } = useCounterMixin();
/** use*/
const { date2Thai } = useCounterMixin();
/** props*/
const selected = defineModel("selectedPos", { required: true });
const positionId = defineModel<string>("positionId", { required: true });
const seletcId = defineModel<string>("seletcId", { required: true });
@ -19,22 +22,6 @@ const positionData = defineModel<any>("position", { required: true });
const filters = ref<string>("");
const rowsPosition = ref<Positions[]>([]);
async function onClickSelectPos(id: string) {
positionId.value = id;
selected.value = [];
const position: DataPositionNo = positionData.value.find(
(e: DataPositionNo) => e.id === id
);
if (position) {
rowsPosition.value = position.positions;
if (seletcId.value) {
selected.value = rowsPosition.value.filter(
(e) => e.id === seletcId.value
);
}
}
}
/** columns*/
const columns = ref<QTableProps["columns"]>([
{
@ -187,14 +174,32 @@ const visibleColumns = ref<string[]>([
"positionIsSelected",
]);
/**
* function เลอกเลขทตำแหน
* @param id เลชทตำแหน
*/
async function onClickSelectPos(id: string) {
positionId.value = id;
selected.value = [];
const position: DataPositionNo = positionData.value.find(
(e: DataPositionNo) => e.id === id
);
//
if (position) {
rowsPosition.value = position.positions;
if (seletcId.value) {
selected.value = rowsPosition.value.filter(
(e) => e.id === seletcId.value
);
}
}
}
onMounted(async () => {
if (positionId.value) {
// showLoader();
setTimeout(async () => {
await onClickSelectPos(positionId.value);
// setTimeout(() => {
// hideLoader();
// }, 2000);
}, 1000);
}
});
@ -208,8 +213,6 @@ onMounted(async () => {
เลอกเลขทตำแหน
</div>
<div class="col-12"><q-separator /></div>
<!-- TABLE -->
<div class="col-12 q-pa-md">
<q-toolbar style="padding: 0px">
<q-space />

View file

@ -36,7 +36,6 @@ const {
/**props*/
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
dataRow: {
type: Object,
@ -57,16 +56,13 @@ const nodes = ref<Array<TreeMain>>([]);
const lazy = ref(nodes);
const expanded = ref<string[]>([]);
/** Position*/
const positionNo = ref<DataPositionNo[]>();
const positionId = ref<string>("");
const seletcId = ref<string>("");
const selectedPos = ref<any[]>([]);
const datePos = ref<Date>(new Date());
function closePopup() {
modal.value = !modal.value;
}
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
async function fetchOrganizationActive() {
showLoader();
@ -113,7 +109,6 @@ async function fetchDataTree(id: string) {
* @param data อม Tree
*/
function updateSelected(data: TreeMain) {
// console.log(props?.dataRow?.nodeId === data.orgTreeId);
if (props?.dataRow?.nodeId === data.orgTreeId) {
positionId.value = props?.dataRow?.posmasterId;
seletcId.value = props?.dataRow?.positionId;
@ -150,8 +145,8 @@ async function fetchDataTable(id: string, level: number = 0) {
if (p.length !== 0) {
const a = p.find((el: Positions) => el.positionIsSelected === true);
const { id, ...rest } = a ? a : p[0];
const test = { ...e, ...rest };
dataMain.push(test);
const data = { ...e, ...rest };
dataMain.push(data);
}
});
positionNo.value = store.fetchPosNo(dataMain);
@ -166,6 +161,11 @@ async function fetchDataTable(id: string, level: number = 0) {
});
}
/**
* function fetch อม expanded tree
* @param level levelTree
* @param id treeId
*/
async function fetchPosFind(level: number, id: string) {
showLoader();
const body = {
@ -176,8 +176,6 @@ async function fetchPosFind(level: number, id: string) {
.post(config.API.orgPosFind, body)
.then((res) => {
const data = res.data.result;
console.log(data);
expanded.value = data;
nodeId.value = id;
positionId.value = props?.dataRow?.posmasterId;
@ -191,6 +189,7 @@ async function fetchPosFind(level: number, id: string) {
});
}
/** function บันทึกข้อมูลตำแหน่ง*/
function onClickSubmit() {
if (selectedPos.value.length === 0) {
dialogMessageNotify($q, "กรุณาเลือกตำแหน่ง");
@ -223,26 +222,29 @@ function onClickSubmit() {
}
}
/** function closePopup*/
function closePopup() {
modal.value = !modal.value;
clearData();
}
/** function clearData*/
function clearData() {
nodeId.value = "";
expanded.value = [];
}
/** callback function เมื่อมีการเปิด popup*/
watch(
() => modal.value,
async () => {
if (modal.value) {
showLoader();
await fetchOrganizationActive();
console.log(props.dataRow);
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
} else {
expanded.value = [];
}
} else {
clearData();
}
}
);

View file

@ -55,7 +55,7 @@ const formData = reactive({
startDate: null, //
endDate: null, //
details: "", //
isSpecial: false
isSpecial: false,
});
/** ตัวแปร ref สำหรับแสดง validate */
@ -191,6 +191,7 @@ function clearFormData() {
formData.salaryType = "";
formData.posTypeId = "";
formData.posLevelId = "";
formData.isSpecial = false;
formData.isActive = false;
formData.date = null;
formData.startDate = null;
@ -401,7 +402,6 @@ async function downloadFile(url: string, type: string, fileName: string) {
/>
</div>
<div class="col-xs-12 col-md-3">
<q-select
ref="posTypeRef"
@ -443,7 +443,11 @@ async function downloadFile(url: string, type: string, fileName: string) {
</div>
<div class="col-xs-12 col-md-1">
<q-checkbox size="md" v-model="formData.isSpecial" label="ฉ" />
<q-checkbox
size="md"
v-model="formData.isSpecial"
label="ฉ"
/>
</div>
<div
@ -484,7 +488,7 @@ async function downloadFile(url: string, type: string, fileName: string) {
? date2Thai(formData.date)
: null
"
label="ให้ไว ณ วันที่"
label="ให้ไว ณ วันที่"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่ ให้ไว ณ วันที่'}`,