commentcode มอบหมายหน้าที่ความรับผิดชอบ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-08 09:35:51 +07:00
parent e7568373c8
commit 0e106cd116
2 changed files with 27 additions and 15 deletions

View file

@ -2,12 +2,9 @@
import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
/** importComponents*/
import DialogHeader from "@/components/DialogHeader.vue";
/** importType*/
import type {
@ -15,6 +12,9 @@ import type {
CommandSysAssign,
} from "@/modules/02_users/interface/response/Main";
/** importComponents*/
import DialogHeader from "@/components/DialogHeader.vue";
/** use*/
const $q = useQuasar();
const { showLoader, hideLoader, dialogConfirm, messageError, success } =
@ -37,11 +37,12 @@ const props = defineProps({
},
});
const posMasterId = ref<string>("");
const sysType = ref<string[]>([]);
const isChangData = ref<boolean>(false);
const sysTypeOptions = ref<CommandSysAssign[]>([]);
const posMasterId = ref<string>(""); //id
const sysType = ref<string[]>([]); //
const isChangData = ref<boolean>(false); //
const sysTypeOptions = ref<CommandSysAssign[]>([]); //
/** ฟังก์ชันเรียกข้อมูลรายการหน้าที่ความรับผิดชอบ*/
async function fetchCommandSysAssign() {
if (sysTypeOptions.value.length === 0) {
showLoader();
@ -60,11 +61,13 @@ async function fetchCommandSysAssign() {
}
}
/** ฟังก์ชันปิด popup */
function closeDialog() {
modal.value = false;
sysType.value = [];
}
/** ฟังก์ชันยืนยันการบันทึกข้อมูลกำหนดหน้าที่ความรับผิดชอบ*/
function onSubmit() {
if (sysType.value.length !== 0) {
dialogConfirm($q, async () => {
@ -94,12 +97,19 @@ function onSubmit() {
}
}
/**
* การเปลยนแปลงของ modal
* และเม modal เป true เรยก งก fetchCommandSysAssign เพอเรยกขอมลรายการหนาทความรบผดชอบ
* และเกำหนด posMasterId เป ID อมลทองการกำหนดหนาทความรบผดชอบ
* และเกำหนด sysType เป รายการหนาทความรบผดชอบทเลอก
*/
watch(
() => modal.value,
async () => {
if (modal.value) {
await fetchCommandSysAssign();
posMasterId.value = props.dataPosMaster.id;
//
const assignId = props.dataPosMaster.posMasterAssigns.map(
(r: PosMaster) => r.assignId
);

View file

@ -30,7 +30,7 @@ const nodes = ref<Array<NodeTree[]>>([]); // ข้อมูลโครงส
const lazy = ref(nodes);
const expanded = ref<string[]>([]); //
const nodeId = ref<string>(""); // id
const isOfficer = ref<boolean>(false);
const isOfficer = ref<boolean>(false); // columns .
/** Table*/
const columns = ref<QTableProps["columns"]>([
@ -192,8 +192,8 @@ const reqMaster = reactive<FilterReqMaster>({
keyword: "",
revisionId: "",
});
const maxPage = ref<number>(0);
const totalRow = ref<number>(0);
const maxPage = ref<number>(0); //
const totalRow = ref<number>(0); //
const posMaster = ref<PosMaster[]>([]); //
const dataPosMaster = ref<PosMaster>(); //
const pagination = ref<Pagination>({
@ -201,11 +201,9 @@ const pagination = ref<Pagination>({
rowsPerPage: reqMaster.pageSize,
});
const modalDialog = ref<boolean>(false);
const modalDialog = ref<boolean>(false); // popup
/**
* function เรยกขอมลโครงสราง แบบป
*/
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบัน*/
async function fetchOrganizationActive() {
showLoader();
await http
@ -301,6 +299,10 @@ function updatePagination(newPagination: Pagination) {
reqMaster.page = 1;
}
/**
* function กำหนดหนาทความรบผดชอบ
* @param data อมลรายการทองการกำหนดหนาทความรบผดชอบ
*/
function onClickAddRole(data: PosMaster) {
modalDialog.value = true;
dataPosMaster.value = data;