Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2024-03-18 13:14:16 +07:00
commit 629f437163
5 changed files with 38 additions and 44 deletions

View file

@ -23,6 +23,7 @@ export default {
orgPosPositionExecutive : () => `${orgPos}/position/executive`,
orgPosExecutive: `${orgPos}/executive`,
orgPosType: `${orgPos}/type`,
orgPosTypeId: (id: string) => `${orgPos}/type/${id}`,
orgPosLevel: `${orgPos}/level`,
orgPosMaster: `${orgPos}/master`,
orgPosMasterById: (id: string) => `${orgPos}/master/${id}`,

View file

@ -2,7 +2,7 @@
import { ref, onMounted } from "vue";
import type { QInput, QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import { useRoute } from "vue-router";
import { usePositionDataStore } from "@/modules/01_metadataNew/stores/positionListStore";
import { useMainOptionDataStore } from "@/modules/01_metadataNew/stores/main";
import { usePositionTypeDataStore } from "@/modules/01_metadataNew/stores/positionTypeStore";
@ -133,6 +133,7 @@ const posLevelAuthority = ref<string>("");
const posLevelNameRef = ref<QInput | null>(null);
const posLevelRankRef = ref<QInput | null>(null);
const posTypeIdRef = ref<QInput | null>(null);
const posLevelAuthorityRef = ref<QInput | null>(null);
const visibleColumns = ref<string[]>([
"no",
"posTypeName",
@ -144,9 +145,10 @@ const visibleColumns = ref<string[]>([
async function fetchData() {
showLoader();
await http
.get(config.API.orgPosLevel)
.get(config.API.orgPosTypeId(id.value))
.then(async (res) => {
store.save(res.data.result, id.value);
posName.value = res.data.result.posTypeName;
store.save(res.data.result.posLevels);
})
.catch((err) => {
messageError($q, err);
@ -221,6 +223,7 @@ function validateForm() {
posLevelNameRef.value?.validate();
posLevelRankRef.value?.validate();
posTypeIdRef.value?.validate();
posLevelAuthorityRef.value?.validate();
onSubmit();
}
@ -238,28 +241,7 @@ async function onSubmit() {
}
}
async function fetchName() {
showLoader();
await http
.get(config.API.orgPosType)
.then(async (res) => {
storeName.save(res.data.result);
storeName.row.forEach((e) => {
if (e.id === id.value) {
posName.value = e.posTypeName ? e.posTypeName : "";
}
});
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
onMounted(async () => {
fetchName();
fetchData();
});
</script>
@ -348,11 +330,18 @@ onMounted(async () => {
@click.stop="
() => {
dialogStatus = 'edit';
dialog = true;
editId = props.row.id;
posLevelName = props.row.posLevelName;
posLevelRank = props.row.posLevelRank;
posLevelAuthority = props.row.posLevelAuthority;
if (props.row.posLevelAuthority === 'หัวหน้าหน่วยงาน') {
posLevelAuthority = 'HEAD';
} else if (props.row.posLevelAuthority === 'ปลัด') {
posLevelAuthority = 'DEPUTY';
} else {
posLevelAuthority = 'GOVERNOR';
}
dialog = true;
}
"
>
@ -424,6 +413,7 @@ onMounted(async () => {
<div class="col-12">
<q-select
ref="posLevelAuthorityRef"
outlined
v-model="posLevelAuthority"
emit-value
@ -433,6 +423,7 @@ onMounted(async () => {
label="ผู้มีอำนาจสั่งบรรจุ"
dense
lazy-rules
:rules="[(val) => !!val || 'กรุณาเลือกผู้มีอำนาจสั่งบรรจุ']"
borderless
bg-color="white"
hide-bottom-space

View file

@ -13,7 +13,7 @@ const { date2Thai } = useCounterMixin();
export const usePositionDataStore = defineStore("PositionData", () => {
const pathLocation = ref<string>("list_position");
const row = ref<DataRow[]>([]);
function save(data: DataResponse[], id: string) {
function save(data: DataResponse[]) {
const list = data.map((e) => ({
...e,
posTypes: undefined,
@ -26,7 +26,7 @@ export const usePositionDataStore = defineStore("PositionData", () => {
? storeOption.posLevelAuthorityConvert(e.posLevelAuthority)
: "-",
})) satisfies DataRow[];
row.value = list.filter((e) => e.posTypeId === id);
row.value = list;
}
return {

View file

@ -324,12 +324,12 @@ onMounted(async () => {
>
<q-tab :name="item.name" :label="item.lable">
<q-tooltip>
<q-list dense v-if="item.name === 'group1'">
<q-list dense v-if="item.name === 'group1'" class="tootip-txt-normal">
<q-item>
<q-item-section>
<q-item-label lines="1">
<span class="text-bold">วไป: </span>
<span> ปฏงาน,ชำนาญงาน,อาวโส</span></q-item-label
<span> ปฏงาน, ชำนาญงาน, อาวโส</span></q-item-label
>
</q-item-section>
</q-item>
@ -337,7 +337,9 @@ onMounted(async () => {
<q-item-section>
<q-item-label lines="1">
<span class="text-bold">ชาการ: </span>
<span> ปฏการ,ชำนาญการ,ชำนาญการพเศษ</span></q-item-label
<span>
ปฏการ, ชำนาญการ, ชำนาญการพเศษ</span
></q-item-label
>
</q-item-section>
</q-item>
@ -351,7 +353,7 @@ onMounted(async () => {
</q-item-section>
</q-item>
</q-list>
<q-list dense v-if="item.name === 'group2'">
<q-list dense v-if="item.name === 'group2'" class="tootip-txt-normal">
<q-item>
<q-item-section>
<q-item-label lines="1">
@ -364,7 +366,7 @@ onMounted(async () => {
<q-item-section>
<q-item-label lines="1">
<span class="text-bold">ชาการ: </span>
<span> เชยวชาญ,ทรงคณว</span></q-item-label
<span> เชยวชาญ, ทรงคณว</span></q-item-label
>
</q-item-section>
</q-item>
@ -381,7 +383,7 @@ onMounted(async () => {
<q-item-section>
<q-item-label lines="1">
<span class="text-bold">บรหาร: </span>
<span> ,</span></q-item-label
<span> , </span></q-item-label
>
</q-item-section>
</q-item>
@ -555,4 +557,7 @@ onMounted(async () => {
.q-tabs--vertical .q-tab {
padding: 0 20px;
}
.tootip-txt-normal {
font-size: 0.8rem;
}
</style>

View file

@ -16,7 +16,6 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { br } from "@fullcalendar/core/internal-common";
const maxPage = ref<number>(1);
const $q = useQuasar();
@ -176,7 +175,7 @@ function getData() {
posName: item.position,
posLevel: item.posLevel,
rateOldMin: item.salaryMin,
groupOld: item.salaryEmployeeMin.sort((a,b)=>a -b),
groupOld: item.salaryEmployeeMin.sort((a, b) => a - b),
rateMaxOld: item.salary,
groupRateHigh: item.group,
rateHighMax: item.salaryMax,
@ -212,7 +211,7 @@ function updatePageSize(newPagination: NewPagination) {
function onClickDelete(id: string) {
dialogRemove($q, () => {
http
.delete(config.API.salaryFormula()+`/${id}`)
.delete(config.API.salaryFormula() + `/${id}`)
.then(() => {
getData();
success($q, "ลบข้อมูลสำเร็จ");
@ -317,16 +316,14 @@ onMounted(() => {
{{ col.value ? col.value.toLocaleString() : "-" }}
</div>
<div v-else-if="col.name == 'groupOld'">
<span v-for="item,index in col.value">
{{ item }}{{index+1 == col.value.length ?'':','}}
</span>
<!-- {{ col.value }} -->
<span v-for="(item, index) in col.value">
{{ item }}{{ index + 1 == col.value.length ? "" : "," }}
</span>
<!-- {{ col.value }} -->
</div>
<div v-else>{{ col.value != "" ? col.value : "-" }}</div>
</q-td>
<q-td>
<q-btn
flat