Refactoring code module 08_registryEmployee
This commit is contained in:
parent
bd33093d3e
commit
7091eaaeb9
31 changed files with 169 additions and 24405 deletions
|
|
@ -1,8 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch, onBeforeMount, onMounted } from "vue";
|
||||
import { ref, watch, onBeforeMount } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useStructureTree } from "@/stores/structureTree";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -17,10 +19,6 @@ import type {
|
|||
/** importComponents*/
|
||||
import Header from "@/components/DialogHeader.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useStructureTree } from "@/stores/structureTree";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const { fetchStructureTree } = useStructureTree();
|
||||
|
|
@ -48,16 +46,16 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
/** Tree*/
|
||||
const nodeId = ref<string>("");
|
||||
const nodeLevel = ref<number>(0);
|
||||
const filterTree = ref<string>("");
|
||||
const nodes = ref<Array<TreeMain>>([]);
|
||||
const nodeId = ref<string>(""); //id หน่วยงาน/ส่วนราชการ
|
||||
const nodeLevel = ref<number>(0); // ระดับ หน่วยงาน/ส่วนราชการ
|
||||
const filterTree = ref<string>(""); //คำค้นหาหน่วยงาน/ส่วนราชการ
|
||||
const nodes = ref<Array<TreeMain>>([]); //ข้อมูล โครงสร้าง
|
||||
const lazy = ref(nodes);
|
||||
const expanded = ref<string[]>([]);
|
||||
|
||||
/** Table*/
|
||||
const filters = ref<string>("");
|
||||
const rowsPosition = ref<Position[]>([]);
|
||||
const filters = ref<string>(""); // ค้นหาตำแหน่ง
|
||||
const rowsPosition = ref<Position[]>([]); //รายการตำแหน่ง
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "isPosition",
|
||||
|
|
@ -198,12 +196,12 @@ const visibleColumns = ref<string[]>([
|
|||
]);
|
||||
|
||||
/** Position*/
|
||||
const positionNo = ref<PositionNo[]>([]);
|
||||
const positionId = ref<string>("");
|
||||
const seletcId = ref<string>("");
|
||||
const selectedPos = ref<any[]>([]);
|
||||
const positionNo = ref<PositionNo[]>([]); //รายการตำแหน่ง
|
||||
const positionId = ref<string>(""); //id ตำแหน่ง
|
||||
const seletcId = ref<string>(""); // id ที่ตเ้องการ
|
||||
const selectedPos = ref<any[]>([]); //ตำแหน่ง ที่ต้องการ
|
||||
const datePos = ref<Date>(new Date());
|
||||
const posMasterMain = ref<any>([]);
|
||||
const posMasterMain = ref<any>([]); //รายการตำแหน่ง
|
||||
const orgRevisionId = ref<string>("");
|
||||
const isLoad = ref<boolean>(false);
|
||||
/**
|
||||
|
|
@ -322,7 +320,9 @@ async function fetchPosFind(level: number, id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/** function บันทึกข้อมูลตำแหน่ง*/
|
||||
/**
|
||||
* function บันทึกข้อมูลตำแหน่ง
|
||||
*/
|
||||
async function onClickSubmit() {
|
||||
const dataPosMaster = await posMasterMain.value?.find(
|
||||
(e: any) => e.id === positionId.value
|
||||
|
|
@ -365,13 +365,17 @@ async function onClickSubmit() {
|
|||
}
|
||||
}
|
||||
|
||||
/** function closePopup*/
|
||||
/**
|
||||
* function closePopup
|
||||
*/
|
||||
function closePopup() {
|
||||
modal.value = !modal.value;
|
||||
clearData();
|
||||
}
|
||||
|
||||
/** function clearData*/
|
||||
/**
|
||||
* function clearData
|
||||
*/
|
||||
async function clearData() {
|
||||
nodeId.value = "";
|
||||
expanded.value = [];
|
||||
|
|
@ -392,6 +396,10 @@ function filterItemsTaps(data: any[]) {
|
|||
return orgTreeIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* function เลือกตำแหน่ง
|
||||
* @param id ที่ต้องการ
|
||||
*/
|
||||
async function onClickSelectPos(id: string) {
|
||||
positionId.value = id;
|
||||
selectedPos.value = [];
|
||||
|
|
@ -425,6 +433,9 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อเลือก แสดงตำแหน่งทั้งหมด
|
||||
*/
|
||||
watch(
|
||||
() => isAll.value,
|
||||
(value, oldVal) => {
|
||||
|
|
@ -434,6 +445,9 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อเลือก แสดงเฉพาะตำแหน่งว่าง
|
||||
*/
|
||||
watch(
|
||||
() => isBlank.value,
|
||||
(value, oldVal) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue