Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-09-13 17:40:47 +07:00
commit 5c7853e821
14 changed files with 273 additions and 104 deletions

View file

@ -39,7 +39,7 @@ const props = defineProps({
const { inputRef, formattedValue, setValue } = useCurrencyInput({
locale: "en-US",
currency: "EUR",
currencyDisplay: "hidden",
// currencyDisplay: "hidden",
hideCurrencySymbolOnFocus: true,
hideGroupingSeparatorOnFocus: true,
hideNegligibleDecimalDigitsOnFocus: true,

View file

@ -1,6 +1,6 @@
<template>
<q-dialog :model-value="modal" persistent>
<q-card style="width: 600px">
<q-card style="width: 700px; max-width: 80vw">
<DialogHeader :tittle="props.title" :close="close" />
<q-separator />
<q-card-section

View file

@ -148,7 +148,11 @@
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="date2Thai(new Date(govermentData.containDate))"
:model-value="
govermentData.containDate !== null
? date2Thai(govermentData.containDate)
: null
"
:rules="[
(val) =>
!!val ||
@ -201,7 +205,11 @@
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="date2Thai(new Date(govermentData.workDate))"
:model-value="
govermentData.workDate !== null
? date2Thai(govermentData.workDate)
: null
"
:rules="[
(val) =>
!!val ||
@ -615,7 +623,7 @@ const fetchData = async () => {
await http
.get(config.API.profileGovId(route.params.id.toString()))
.then((res) => {
const data: ResponseObject = res.data.result;
const data: any = res.data.result;
govermentData.value.ocId = data.oc;
govermentData.value.positionId = data.position;
govermentData.value.positionPathSide = data.positionPathSide;
@ -625,8 +633,8 @@ const fetchData = async () => {
govermentData.value.numberId = data.posNo;
govermentData.value.positionExecutive = data.positionExecutive;
govermentData.value.positionExecutiveSide = data.positionExecutiveSide;
govermentData.value.containDate = new Date(data.dateAppoint);
govermentData.value.workDate = new Date(data.dateStart);
govermentData.value.containDate = data.dateAppoint;
govermentData.value.workDate = data.dateStart;
govermentData.value.retireDate = data.retireDate;
govermentData.value.absent = data.govAgeAbsent;
govermentData.value.age = data.govAgePlus;

View file

@ -116,7 +116,11 @@
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="date2Thai(informaData.birthDate)"
:model-value="
informaData.birthDate !== null
? date2Thai(informaData.birthDate)
: null
"
:rules="[(val:string) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]"
:label="`${'วัน/เดือน/ปี เกิด'}`"
>
@ -1014,6 +1018,7 @@ const fetchData = async () => {
.get(config.API.profileInforId(route.params.id.toString()))
.then(async (res: any) => {
const data: ResponseObject = res.data.result;
profileStore.emplployeeClass = data.profileType;
defaultCitizenData.value = data.citizenId;
informaData.value.cardid = data.citizenId;
informaData.value.prefix = "";

View file

@ -67,9 +67,8 @@
icon="mdi-history"
@click="clickHistory(props.row)"
>
<q-tooltip>ประวแกไขการลา
</q-tooltip>
</q-btn>
<q-tooltip>ประวแกไขการลา </q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
@ -739,7 +738,10 @@ const fetchData = async () => {
totalLeave: e.totalLeave,
status: e.status,
reason: e.reason,
typeLeaveId: e.typeLeaveId,
typeLeaveId:
e.typeLeaveId !== "00000000-0000-0000-0000-000000000000"
? e.typeLeaveId
: "",
});
});
})
@ -794,7 +796,10 @@ const clickHistory = async (row: RequestItemsObject) => {
totalLeave: e.totalLeave,
status: e.status,
reason: e.reason,
typeLeaveId: e.typeLeaveId,
typeLeaveId:
e.typeLeaveId !== "00000000-0000-0000-0000-000000000000"
? e.typeLeaveId
: "",
});
});
})

View file

@ -388,9 +388,10 @@
:options="{
currency: 'THB',
}"
:rules="[(val: string) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
:label="`${'เงินเดือน'}`"
:rules="[(val: number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
/>
<!-- :rules="[(val: string) => !!val || `${'กรุณากรอกเงินเดือน'}`]" -->
</div>
<div class="col-xs-4 col-sm-4 col-md-4">
<CurrencyInput
@ -400,6 +401,7 @@
currency: 'THB',
}"
:label="`${'เงินประจำตำแหน่ง'}`"
:rules="[(val: number) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`]"
/>
<!-- <q-input
:class="getClass(edit)"
@ -436,6 +438,7 @@
currency: 'THB',
}"
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
:rules="[(val: number) => !!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`]"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
@ -628,15 +631,22 @@ const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const {
date2Thai,
success,
dateToISO,
messageError,
showLoader,
hideLoader,
dialogConfirm,
} = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
const amount = ref<number>(0);
const amount = ref<number | null>(0);
// const salary = ref<number | null>(null);
const positionSalaryAmount = ref<number>(0);
const mouthSalaryAmount = ref<number>(0);
const positionSalaryAmount = ref<number | null>(0);
const mouthSalaryAmount = ref<number | null>(0);
const ocId = ref<string>();
const positionId = ref<string>();
const positionLineId = ref<string>();
@ -1567,7 +1577,6 @@ const fetchData = async () => {
.then((res) => {
let data = res.data.result;
console.log(data);
rows.value = [];
data.map((e: ResponseObject) => {
@ -1587,7 +1596,7 @@ const fetchData = async () => {
posNo: e.posNo,
posNoId:
e.posNoId !== "00000000-0000-0000-0000-000000000000"
? e.posNo
? e.posNoId
: "",
positionLine: e.positionLine,
positionLineId: e.positionLineId,
@ -1807,12 +1816,34 @@ const templateDetail = async () => {
* กดบนทกใน dialog
*/
const clickSave = async () => {
if (amount.value == 0) {
amount.value = null;
} else if (positionSalaryAmount.value == 0) {
positionSalaryAmount.value = null;
} else if (mouthSalaryAmount.value == 0) {
mouthSalaryAmount.value = null;
}
myForm.value.validate().then(async (result: boolean) => {
if (result) {
if (modalEdit.value) {
await editData();
dialogConfirm(
$q,
async () => {
await editData();
},
"ยืนยันการแก้ไขข้อมูล",
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
} else {
await saveData();
dialogConfirm(
$q,
async () => {
await saveData();
},
"ยืนยันการเพิ่มข้อมูล",
"ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ ?"
);
}
}
});
@ -1987,9 +2018,9 @@ const addData = () => {
edit.value = true;
date.value = new Date();
date.value = new Date();
amount.value = null;
positionSalaryAmount.value = null;
mouthSalaryAmount.value = null;
amount.value = 0;
positionSalaryAmount.value = 0;
mouthSalaryAmount.value = 0;
ocId.value = "";
positionId.value = "";
posNoId.value = "";

View file

@ -331,7 +331,7 @@
/>
</div> -->
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
<!-- <q-input
:class="getClass(edit)"
:outlined="edit"
dense
@ -343,6 +343,15 @@
@update:modelValue="clickEditRow"
type="number"
hide-bottom-space
/> -->
<CurrencyInput
v-model="amount"
:edit="edit"
:rules="[(val:string) => !!val || `${'กรุณากรอกค่าจ้าง'}`]"
:options="{
currency: 'THB',
}"
:label="`${'ค่าจ้าง'}`"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
@ -581,6 +590,7 @@ import HistoryTable from "@/components/TableHistory.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import CurrencyInput from "@/components/CurruncyInput.vue";
const props = defineProps({
statusEdit: {
@ -602,6 +612,7 @@ const {
dialogMessage,
showLoader,
hideLoader,
dialogConfirm,
} = mixin;
const route = useRoute();
const id = ref<string>("");
@ -939,7 +950,7 @@ profileData.salary.columns.length == 0
"mouthSalaryAmount",
"oc",
"positionEmployeePosition",
"posNo",
"posNoEmployee",
"positionEmployeePositionSide",
"positionEmployeeLevel",
"positionEmployeeGroup",
@ -1016,11 +1027,11 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNo",
name: "posNoEmployee",
align: "left",
label: "ตำแหน่งเลขที่",
sortable: true,
field: "posNo",
field: "posNoEmployee",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
@ -1481,9 +1492,9 @@ const fetchData = async () => {
.get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => {
const data = res.data.result;
// console.log(data);
console.log(data);
rows.value = [];
data.map((e: ResponseObjectEmployee) => {
data.map((e: any) => {
rows.value.push({
id: e.id,
date: new Date(e.date),
@ -1493,16 +1504,35 @@ const fetchData = async () => {
oc: e.oc,
ocId: e.ocId,
posNo: e.posNo,
posNoId: e.posNoId,
posNoId:
e.posNoId !== "00000000-0000-0000-0000-000000000000"
? e.posNoId
: "",
posNoEmployee: e.posNoEmployee,
positionEmployeeGroup: e.positionEmployeeGroup,
positionEmployeeGroupId: e.positionEmployeeGroupId,
positionEmployeeGroupId:
e.positionEmployeeGroupId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeeGroupId
: "",
positionEmployeeLevel: e.positionEmployeeLevel,
positionEmployeeLevelId: e.positionEmployeeLevelId,
positionEmployeeLevelId:
e.positionEmployeeLevelId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeeLevelId
: "",
positionEmployeePosition: e.positionEmployeePosition,
positionEmployeePositionId: e.positionEmployeePositionId,
positionEmployeePositionId:
e.positionEmployeePositionId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeePositionId
: "",
positionEmployeePositionSide: e.positionEmployeePositionSide,
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
positionEmployeePositionSideId:
e.positionEmployeePositionSideId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeePositionSideId
: "",
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
@ -1687,12 +1717,29 @@ const templateDetail = async () => {
* กดบนทกใน dialog
*/
const clickSave = async () => {
if (amount.value === 0) {
amount.value = null;
}
myForm.value.validate().then(async (result: boolean) => {
if (result) {
if (modalEdit.value) {
await editData();
dialogConfirm(
$q,
async () => {
await editData();
},
"ยืนยันการแก้ไขข้อมูล",
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
} else {
await saveData();
dialogConfirm(
$q,
async () => {
await saveData();
},
"ยืนยันการเพิ่มข้อมูล",
"ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ ?"
);
}
}
});
@ -1872,7 +1919,7 @@ const addData = () => {
modal.value = true;
edit.value = true;
date.value = new Date();
amount.value = null;
amount.value = 0;
positionSalaryAmount.value = null;
mouthSalaryAmount.value = null;
@ -1944,7 +1991,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.get(config.API.profileSalaryEmployeeHisId(row.id))
.then((res) => {
const data = res.data.result;
// console.log("clickHistory", data);

View file

@ -306,7 +306,7 @@
/>
</div> -->
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
<!-- <q-input
:class="getClass(edit)"
:outlined="edit"
dense
@ -318,6 +318,15 @@
@update:modelValue="clickEditRow"
type="number"
hide-bottom-space
/> -->
<CurrencyInput
v-model="amount"
:edit="edit"
:options="{
currency: 'THB',
}"
:label="`${'เงินเดือน'}`"
:rules="[(val: number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
@ -556,6 +565,7 @@ import HistoryTable from "@/components/TableHistory.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import CurrencyInput from "@/components/CurruncyInput.vue";
const props = defineProps({
statusEdit: {
@ -577,6 +587,7 @@ const {
dialogMessage,
showLoader,
hideLoader,
dialogConfirm,
} = mixin;
const route = useRoute();
const id = ref<string>("");
@ -1522,16 +1533,35 @@ const fetchData = async () => {
oc: e.oc,
ocId: e.ocId,
posNo: e.posNo,
posNoId: e.posNoId,
posNoId:
e.posNoId !== "00000000-0000-0000-0000-000000000000"
? e.posNoId
: "",
posNoEmployee: e.posNoEmployee,
positionEmployeeGroup: e.positionEmployeeGroup,
positionEmployeeGroupId: e.positionEmployeeGroupId,
positionEmployeeGroupId:
e.positionEmployeeGroupId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeeGroupId
: "",
positionEmployeeLevel: e.positionEmployeeLevel,
positionEmployeeLevelId: e.positionEmployeeLevelId,
positionEmployeeLevelId:
e.positionEmployeeLevelId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeeLevelId
: "",
positionEmployeePosition: e.positionEmployeePosition,
positionEmployeePositionId: e.positionEmployeePositionId,
positionEmployeePositionId:
e.positionEmployeePositionId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeePositionId
: "",
positionEmployeePositionSide: e.positionEmployeePositionSide,
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
positionEmployeePositionSideId:
e.positionEmployeePositionSideId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeePositionSideId
: "",
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
@ -1716,12 +1746,29 @@ const templateDetail = async () => {
* กดบนทกใน dialog
*/
const clickSave = async () => {
if (amount.value == 0) {
amount.value = null;
}
myForm.value.validate().then(async (result: boolean) => {
if (result) {
if (modalEdit.value) {
await editData();
dialogConfirm(
$q,
async () => {
await editData();
},
"ยืนยันการแก้ไขข้อมูล",
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
} else {
await saveData();
dialogConfirm(
$q,
async () => {
await saveData();
},
"ยืนยันการเพิ่มข้อมูล",
"ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ ?"
);
}
}
});
@ -1901,7 +1948,7 @@ const addData = () => {
modal.value = true;
edit.value = true;
date.value = new Date();
amount.value = null;
amount.value = 0;
positionSalaryAmount.value = null;
mouthSalaryAmount.value = null;
@ -1973,7 +2020,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.get(config.API.profileSalaryEmployeeHisId(row.id))
.then((res) => {
const data = res.data.result;
// console.log("clickHistory", data);
@ -1988,16 +2035,33 @@ const clickHistory = async (row: RequestItemsEmployee) => {
oc: e.oc,
ocId: e.ocId,
posNo: e.posNo,
posNoId: e.posNoId,
posNoId:
e.posNoId !== "00000000-0000-0000-0000-000000000000"
? e.posNoId
: "",
posNoEmployee: e.posNoEmployee,
positionEmployeeGroup: e.positionEmployeeGroup,
positionEmployeeGroupId: e.positionEmployeeGroupId,
positionEmployeeGroupId:
e.positionEmployeeGroupId !== "00000000-0000-0000-0000-000000000000"
? e.positionEmployeeGroupId
: "",
positionEmployeeLevel: e.positionEmployeeLevel,
positionEmployeeLevelId: e.positionEmployeeLevelId,
positionEmployeeLevelId:
e.positionEmployeeLevelId !== "00000000-0000-0000-0000-000000000000"
? e.positionEmployeeLevelId
: "",
positionEmployeePosition: e.positionEmployeePosition,
positionEmployeePositionId: e.positionEmployeePositionId,
positionEmployeePositionId:
e.positionEmployeePositionId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeePositionId
: "",
positionEmployeePositionSide: e.positionEmployeePositionSide,
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
positionEmployeePositionSideId:
e.positionEmployeePositionSideId !==
"00000000-0000-0000-0000-000000000000"
? e.positionEmployeePositionSideId
: "",
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,

View file

@ -2,6 +2,7 @@ import { ref, computed } from "vue";
import { defineStore } from "pinia";
export const useProfileDataStore = defineStore("profile", () => {
const emplployeeClass = ref<string | null>('')
interface profile {
main: { columns: String[] };
education: { columns: String[] };
@ -79,5 +80,6 @@ export const useProfileDataStore = defineStore("profile", () => {
changeBirth,
retireText,
changeRetireText,
emplployeeClass,
};
});

View file

@ -2,6 +2,7 @@
import { ref, watch } from "vue";
import { QForm, useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue";
const mixin = useCounterMixin();
const { dialogConfirm } = mixin;
@ -58,23 +59,11 @@ const clickSave = () => {
<template>
<q-dialog v-model="props.modal" persistent>
<q-card style="width: 800px">
<q-toolbar class="q-py-sm">
<q-toolbar-title class="text-h6"
>แกไขการจดสรรเครองราชฯ
</q-toolbar-title>
<q-btn
icon="close"
unelevated
round
dense
@click="closeModal"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
<DialogHeader tittle="แก้ไขการจัดสรรเครื่องราชฯ" :close="closeModal" />
<q-separator />
<q-form ref="myForm">
<div class="q-pa-md">
<div class="q-pa-md bg-grey-1">
<div
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
>

View file

@ -272,7 +272,14 @@
</q-form>
</q-card>
</q-dialog>
<q-dialog v-model="addNote" persistent>
<DialogPopupReason
:modal="addNote"
title="คืนเครื่องราชฯ"
label="กรอกเหตุผลที่ต้องการคืนเครื่องราชฯ"
:click-close="clickCloseNote"
:savaForm="saveNote"
/>
<!-- <q-dialog v-model="addNote" persistent>
<q-card style="min-width: 350px">
<DialogHeader tittle="คืนเครื่องราชฯ " :close="clickCloseNote" />
@ -290,7 +297,7 @@
<q-btn label="บันทึก" @click="saveNote" color="public" />
</q-card-actions>
</q-card>
</q-dialog>
</q-dialog> -->
</template>
<script setup lang="ts">
@ -299,7 +306,7 @@ import type { QTableProps } from "quasar";
import router from "@/router";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
import DialogHeader from "@/modules/07_insignia/components/DialogHeader.vue";
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue";
import type { FormProprsalsRound } from " @/modules/07_insignia/interface/request/Main.ts";

View file

@ -5,6 +5,7 @@ import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import type { DataOption } from "@/modules/04_registry/components/profileType";
import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
const myForm = ref<QForm>();
@ -230,22 +231,11 @@ const closeDialog = () => {
<template>
<q-dialog v-model="props.modal" persistent>
<q-card style="min-width: 900px" class="q-pb-md">
<q-toolbar class="q-py-md">
<q-toolbar-title class="text-h6">-นเครองราชฯ </q-toolbar-title>
<q-btn
icon="close"
unelevated
round
dense
@click="closeDialog"
style="color: #ff8080; background-color: #ffdede"
><q-tooltip></q-tooltip></q-btn
>
</q-toolbar>
<DialogHeader tittle="ยืม-คืนเครื่องราชฯ" :close="closeDialog" />
<q-separator />
<q-form ref="myForm">
<div class="q-pa-md">
<div class="q-pa-md bg-grey-1">
<div
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
>

View file

@ -390,7 +390,7 @@ const {
dateToISO,
showLoader,
hideLoader,
dialogConfirm
dialogConfirm,
} = mixin;
const route = useRoute();
@ -736,7 +736,10 @@ const fetchData = async () => {
totalLeave: e.totalLeave,
status: e.status,
reason: e.reason,
typeLeaveId: e.typeLeaveId,
typeLeaveId:
e.typeLeaveId !== "00000000-0000-0000-0000-000000000000"
? e.typeLeaveId
: "",
});
});
})
@ -791,7 +794,10 @@ const clickHistory = async (row: RequestItemsObject) => {
totalLeave: e.totalLeave,
status: e.status,
reason: e.reason,
typeLeaveId: e.typeLeaveId,
typeLeaveId:
e.typeLeaveId !== "00000000-0000-0000-0000-000000000000"
? e.typeLeaveId
: "",
});
});
})
@ -952,10 +958,10 @@ const clickCancel = async () => {
// * dialog
// */
const clickSave = () => {
dialogConfirm($q,() => SaveData())
}
dialogConfirm($q, () => SaveData());
};
const SaveData = async () => {
await myFormAdd.value.validate().then(async (result: boolean) => {
await myFormAdd.value.validate().then(async (result: boolean) => {
if (result) {
if (modalEdit.value) {
await editData();

View file

@ -1035,11 +1035,11 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNo",
name: "posNoEmployee",
align: "left",
label: "ตำแหน่งเลขที่",
sortable: true,
field: "posNo",
field: "posNoEmployee",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
@ -1286,7 +1286,7 @@ const visibleColumnsHistory = ref<String[]>([
"mouthSalaryAmount",
"oc",
"positionEmployeePosition",
"posNo",
"posNoEmployee",
"positionEmployeePositionSide",
"positionEmployeeLevel",
"positionEmployeeGroup",
@ -1710,18 +1710,33 @@ const templateDetail = async () => {
/**
* กดบนทกใน dialog
*/
const clickSave = () => {
dialogConfirm($q, () => SaveData());
};
const SaveData = async () => {
const clickSave = async () => {
// dialogConfirm($q, () => SaveData());
if (amount.value == 0) {
amount.value = null;
}
await myForm.value.validate().then(async (result: boolean) => {
if (result && agencyId.value) {
if (modalEdit.value) {
await editData();
dialogConfirm(
$q,
async () => {
await editData();
},
"ยืนยันการแก้ไขข้อมูล",
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
} else {
await saveData();
dialogConfirm(
$q,
async () => {
await saveData();
},
"ยืนยันการเพิ่มข้อมูล",
"ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ ?"
);
}
} else if (agencyId.value == "") {
} else if (result && agencyId.value == "") {
dialogMessageNotify($q, "กรุณาเลือกหน่วยงาน");
}
});
@ -1903,7 +1918,7 @@ const addData = () => {
modal.value = true;
edit.value = true;
date.value = new Date();
amount.value = null;
amount.value = 0;
positionSalaryAmount.value = null;
mouthSalaryAmount.value = null;
@ -1975,7 +1990,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.get(config.API.profileSalaryEmployeeHisId(row.id))
.then((res) => {
const data = res.data.result;
console.log("clickHistory", data);