commentcode มอบหมายหน้าที่ความรับผิดชอบ
This commit is contained in:
parent
e7568373c8
commit
0e106cd116
2 changed files with 27 additions and 15 deletions
|
|
@ -2,12 +2,9 @@
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
|
|
||||||
/** importComponents*/
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type {
|
import type {
|
||||||
|
|
@ -15,6 +12,9 @@ import type {
|
||||||
CommandSysAssign,
|
CommandSysAssign,
|
||||||
} from "@/modules/02_users/interface/response/Main";
|
} from "@/modules/02_users/interface/response/Main";
|
||||||
|
|
||||||
|
/** importComponents*/
|
||||||
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
/** use*/
|
/** use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, dialogConfirm, messageError, success } =
|
const { showLoader, hideLoader, dialogConfirm, messageError, success } =
|
||||||
|
|
@ -37,11 +37,12 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const posMasterId = ref<string>("");
|
const posMasterId = ref<string>(""); //id รายการตำแหน่งที่ต้องการกำหนดหน้าที่ความรับผิดชอบ
|
||||||
const sysType = ref<string[]>([]);
|
const sysType = ref<string[]>([]); //รายการหน้าที่ความรับผิดชอบที่เลือก
|
||||||
const isChangData = ref<boolean>(false);
|
const isChangData = ref<boolean>(false); //การเปลี่ยนแปลงของข้อมูล
|
||||||
const sysTypeOptions = ref<CommandSysAssign[]>([]);
|
const sysTypeOptions = ref<CommandSysAssign[]>([]); //ข้อมูลรายการหน้าที่ความรับผิดชอบ
|
||||||
|
|
||||||
|
/** ฟังก์ชันเรียกข้อมูลรายการหน้าที่ความรับผิดชอบ*/
|
||||||
async function fetchCommandSysAssign() {
|
async function fetchCommandSysAssign() {
|
||||||
if (sysTypeOptions.value.length === 0) {
|
if (sysTypeOptions.value.length === 0) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -60,11 +61,13 @@ async function fetchCommandSysAssign() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันปิด popup */
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
sysType.value = [];
|
sysType.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันยืนยันการบันทึกข้อมูลกำหนดหน้าที่ความรับผิดชอบ*/
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (sysType.value.length !== 0) {
|
if (sysType.value.length !== 0) {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
|
|
@ -94,12 +97,19 @@ function onSubmit() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ดูการเปลี่ยนแปลงของ modal
|
||||||
|
* และเมื่อ modal เป็น true เรียก ฟังก์ชัน fetchCommandSysAssign เพื่อเรียกข้อมูลรายการหน้าที่ความรับผิดชอบ
|
||||||
|
* และเกำหนด posMasterId เป็น ID ข้อมูลที่ต้องการกำหนดหน้าที่ความรับผิดชอบ
|
||||||
|
* และเกำหนด sysType เป็น รายการหน้าที่ความรับผิดชอบที่เลือก
|
||||||
|
*/
|
||||||
watch(
|
watch(
|
||||||
() => modal.value,
|
() => modal.value,
|
||||||
async () => {
|
async () => {
|
||||||
if (modal.value) {
|
if (modal.value) {
|
||||||
await fetchCommandSysAssign();
|
await fetchCommandSysAssign();
|
||||||
posMasterId.value = props.dataPosMaster.id;
|
posMasterId.value = props.dataPosMaster.id;
|
||||||
|
// กำหนดรายการหน้าที่ความรับผิดชอบที่เลือก
|
||||||
const assignId = props.dataPosMaster.posMasterAssigns.map(
|
const assignId = props.dataPosMaster.posMasterAssigns.map(
|
||||||
(r: PosMaster) => r.assignId
|
(r: PosMaster) => r.assignId
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ const nodes = ref<Array<NodeTree[]>>([]); // ข้อมูลโครงส
|
||||||
const lazy = ref(nodes);
|
const lazy = ref(nodes);
|
||||||
const expanded = ref<string[]>([]); // แสดงข้อมูลในโหนดที่เลือก
|
const expanded = ref<string[]>([]); // แสดงข้อมูลในโหนดที่เลือก
|
||||||
const nodeId = ref<string>(""); // id โหนด
|
const nodeId = ref<string>(""); // id โหนด
|
||||||
const isOfficer = ref<boolean>(false);
|
const isOfficer = ref<boolean>(false); //แสดง columns สกจ.
|
||||||
|
|
||||||
/** Table*/
|
/** Table*/
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -192,8 +192,8 @@ const reqMaster = reactive<FilterReqMaster>({
|
||||||
keyword: "",
|
keyword: "",
|
||||||
revisionId: "",
|
revisionId: "",
|
||||||
});
|
});
|
||||||
const maxPage = ref<number>(0);
|
const maxPage = ref<number>(0); //จำนวนหน้า
|
||||||
const totalRow = ref<number>(0);
|
const totalRow = ref<number>(0); //จำนวนข้อมูล
|
||||||
const posMaster = ref<PosMaster[]>([]); // ข้อมูลรายการตำแหน่ง
|
const posMaster = ref<PosMaster[]>([]); // ข้อมูลรายการตำแหน่ง
|
||||||
const dataPosMaster = ref<PosMaster>(); // ข้อมูลตำแหน่ง
|
const dataPosMaster = ref<PosMaster>(); // ข้อมูลตำแหน่ง
|
||||||
const pagination = ref<Pagination>({
|
const pagination = ref<Pagination>({
|
||||||
|
|
@ -201,11 +201,9 @@ const pagination = ref<Pagination>({
|
||||||
rowsPerPage: reqMaster.pageSize,
|
rowsPerPage: reqMaster.pageSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const modalDialog = ref<boolean>(false);
|
const modalDialog = ref<boolean>(false); // popup กำหนดหน้าที่ความรับผิดชอบ
|
||||||
|
|
||||||
/**
|
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบัน*/
|
||||||
* function เรียกข้อมูลโครงสร้าง แบบปัจุบัน
|
|
||||||
*/
|
|
||||||
async function fetchOrganizationActive() {
|
async function fetchOrganizationActive() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -301,6 +299,10 @@ function updatePagination(newPagination: Pagination) {
|
||||||
reqMaster.page = 1;
|
reqMaster.page = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function กำหนดหน้าที่ความรับผิดชอบ
|
||||||
|
* @param data ข้อมูลรายการที่ต้องการกำหนดหน้าที่ความรับผิดชอบ
|
||||||
|
*/
|
||||||
function onClickAddRole(data: PosMaster) {
|
function onClickAddRole(data: PosMaster) {
|
||||||
modalDialog.value = true;
|
modalDialog.value = true;
|
||||||
dataPosMaster.value = data;
|
dataPosMaster.value = data;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue