Refactoring code module 02_organization
This commit is contained in:
parent
63b9aafbaf
commit
0f5d772e53
24 changed files with 805 additions and 1033 deletions
|
|
@ -1,22 +1,23 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
import genreport from "@/plugins/genreportxlsx";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
ListMenu,
|
||||
NewPagination,
|
||||
DataDocument,
|
||||
} from "@/modules/02_organization/interface/index/Main";
|
||||
import type { FilterMaster } from "@/modules/02_organization/interface/request/organizational";
|
||||
import type {
|
||||
PosMaster2,
|
||||
OrgTree,
|
||||
} from "@/modules/02_organization/interface/response/organizational";
|
||||
import type { PosMaster2 } from "@/modules/02_organization/interface/response/organizational";
|
||||
import type { DataPosition } from "@/modules/02_organization/interface/index/organizational";
|
||||
|
||||
/** importComponents*/
|
||||
|
|
@ -29,8 +30,6 @@ import DialogSelectPerson from "@/modules/02_organization/components/DialogSelec
|
|||
import DialogSuccession from "@/modules/02_organization/components/DialogSuccession.vue"; // สืบทอดตำแหน่ง
|
||||
|
||||
/** importStore*/
|
||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const $q = useQuasar();
|
||||
const store = useOrganizational();
|
||||
|
|
@ -64,9 +63,9 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const modalSelectPerson = ref<boolean>(false);
|
||||
const rowId = ref<string>("");
|
||||
const actionType = ref<string>("");
|
||||
const modalSelectPerson = ref<boolean>(false); //เลือกคนครอล
|
||||
const rowId = ref<string>(""); //id ที่ต้องการกระทำ
|
||||
const actionType = ref<string>(""); //ประเภทการกระทำ
|
||||
/** ListMenu Table*/
|
||||
const listMenu = ref<ListMenu[]>([
|
||||
{
|
||||
|
|
@ -106,7 +105,7 @@ const listMenu = ref<ListMenu[]>([
|
|||
color: "deep-purple",
|
||||
},
|
||||
]);
|
||||
const document = ref<any>([
|
||||
const document = ref<DataDocument[]>([
|
||||
{
|
||||
name: "บัญชี 1",
|
||||
val: "report1",
|
||||
|
|
@ -254,7 +253,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const dialogPosition = ref<boolean>(false);
|
||||
const dialogPosition = ref<boolean>(false); //ตำแหน่ง
|
||||
/**
|
||||
* function openPopup เพิ่มอัตรากำลัง
|
||||
* @param type ประเภท
|
||||
|
|
@ -266,14 +265,19 @@ function onClickPosition(type: string, id: string) {
|
|||
dialogPosition.value = !dialogPosition.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* function เปิด popup เพิ่มแก้ไข อัตรากำลัง
|
||||
* @param type ประเภทการกระทำ
|
||||
* @param id id ที่ต้องการกระทำ
|
||||
*/
|
||||
function onClickCopyPosition(type: string, id: string) {
|
||||
rowId.value = id ? id : "";
|
||||
actionType.value = type;
|
||||
dialogPosition.value = !dialogPosition.value;
|
||||
}
|
||||
|
||||
const dialogDetail = ref<boolean>(false);
|
||||
const dataDetailPos = ref<DataPosition[]>([]);
|
||||
const dialogDetail = ref<boolean>(false); //ดูรายละเอียดประวัติตำแหน่ง
|
||||
const dataDetailPos = ref<DataPosition[]>([]); //รายละเอียดตำแหน่ง
|
||||
/**
|
||||
* function ดูรายละเอียดประวัติตำแหน่ง
|
||||
* @param data ข้อมูล ประวัติตำแหน่ง
|
||||
|
|
@ -351,13 +355,19 @@ function updatePagination(newPagination: NewPagination) {
|
|||
reqMaster.value.page = 1;
|
||||
}
|
||||
|
||||
/** function openPopup เลือกตนครอง*/
|
||||
/**
|
||||
* function เปิด pop เลือกตนครอง
|
||||
* @param data ข้อมูลตำแหน่งที่ต้องการเพิ่มคนครอง
|
||||
*/
|
||||
function openSelectPerson(data: DataPosition[]) {
|
||||
modalSelectPerson.value = true;
|
||||
dataDetailPos.value = data;
|
||||
}
|
||||
|
||||
/** ลบคนครอง */
|
||||
/**
|
||||
* function ยืนยันการลบข้อมูลคนครอง
|
||||
* @param id รายการที่ต้องการลบ
|
||||
*/
|
||||
function removePerson(id: string) {
|
||||
dialogRemove(
|
||||
$q,
|
||||
|
|
@ -389,13 +399,17 @@ function removePerson(id: string) {
|
|||
}
|
||||
|
||||
const modalDialogSuccession = ref<boolean>(false);
|
||||
/** function openPopup สืบทอดตำแหน่ง*/
|
||||
/**
|
||||
* function openPopup สืบทอดตำแหน่ง
|
||||
*/
|
||||
function onClickInherit(id: string) {
|
||||
modalDialogSuccession.value = !modalDialogSuccession.value;
|
||||
rowId.value = id;
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
|
||||
/**
|
||||
* ดึงข้อมูลสถิติจำนวนด้านบน
|
||||
*/
|
||||
function getSummary() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -428,7 +442,9 @@ function getSummary() {
|
|||
});
|
||||
}
|
||||
|
||||
/** function DownloadReport*/
|
||||
/**
|
||||
* function DownloadReport
|
||||
*/
|
||||
async function onClickDownloadReport(val: string, name: string) {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue