Merge branch 'develop' into working

This commit is contained in:
Tanyalak 2024-04-24 17:26:43 +07:00
commit 3f0ddc0ef6
4 changed files with 32 additions and 5 deletions

View file

@ -219,6 +219,7 @@ watch(
if (props.modal === true) {
if (actionType.value === "ADD") {
console.log(props.dataNode);
console.log(level.value);
if (props.dataNode) {
formData.orgCode =
@ -351,7 +352,9 @@ function selectOrgLevele(val: string, status: boolean = true) {
<div class="col-2">
<q-input
:readonly="
(actionType === 'ADD' && props?.dataNode?.orgLevel !== 0) ||
(actionType === 'ADD' &&
props?.dataNode?.orgLevel !== 0 &&
level !== 0) ||
(actionType === 'EDIT' && props?.dataNode?.orgLevel > 1)
"
mask="##"

View file

@ -364,6 +364,7 @@ function onSubmit() {
posDictExecutiveField: e.positionExecutiveField, //
posDictArea: e.positionArea, ///
isSpecial: e.isSpecial,
positionIsSelected: e.positionIsSelected,
}));
const body = {
posMasterNoPrefix: formData.prefixNo, //*Prefix Optional (/)
@ -524,7 +525,6 @@ watch(
() => {
if (props.modal === true) {
fetchType();
// fetchLevel();
fetchExecutive();
if (props.actionType === "ADD") {
@ -535,6 +535,7 @@ watch(
formData.prefixNo = "";
formData.positionNo = "";
formData.suffixNo = "";
formData.reason = "";
} else {
props.rowId && fetchPosition(props.rowId);
}
@ -543,6 +544,8 @@ watch(
);
async function addPosition(data: RowDetailPositions) {
console.log(data);
const isIdExist = await rows.value.some(
(item: any) =>
item.posExecutiveId == data.posExecutiveId &&
@ -557,7 +560,6 @@ async function addPosition(data: RowDetailPositions) {
if (!isIdExist) {
rows.value = [...rows.value, data];
// rows.value.push(data);
}
}
@ -603,6 +605,7 @@ async function clearFormPositionSelect() {
function close() {
props.close?.();
clearFormPositionSelect();
isPosition.value = false;
}

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, reactive } from "vue";
import { ref, onMounted, reactive,watch } from "vue";
import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
@ -14,6 +14,10 @@ import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore";
import http from "@/plugins/http";
import config from "@/app.config";
import type {
NewPagination,
} from "@/modules/14_KPI/interface/index/Main";
const store = useKPIDataStore();
const router = useRouter();
const $q = useQuasar();
@ -117,6 +121,22 @@ function fetchNewList() {
fetchList();
}
/**
* function updatePagination
* @param newPagination อม Pagination ใหม
*/
function updatePagination(newPagination: NewPagination) {
formQuery.page = 1;
formQuery.pageSize = newPagination.rowsPerPage;
}
watch(
() => formQuery.pageSize,
() => {
fetchNewList();
}
);
onMounted(() => {
fetchList();
});
@ -188,6 +208,7 @@ onMounted(() => {
:rows-per-page-options="[10, 25, 50, 100]"
class="custom-header-table"
:visible-columns="visibleColumns"
@update:pagination="updatePagination"
>
<template v-slot:header="props">
<q-tr :props="props">

View file

@ -358,7 +358,7 @@ watch(
<q-card style="min-width: 80vw">
<DialogHeader
:tittle="
props.actionType === 'ADD' ? 'เพิ่มอัตรากำลัง' : 'แก้ไขอัตรากำลัง'
props.actionType === 'ADD' ? 'เพิ่มอัตรากำลัง' : 'แก้ไขอัตรากำลัง111'
"
:close="close"
/>