รายการเงินเดือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-27 16:58:33 +07:00
parent 4f9f8ecc65
commit 0a367f7c57
6 changed files with 209 additions and 73 deletions

View file

@ -7,13 +7,22 @@ import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
const $q = useQuasar();
const store = useSalaryListSDataStore();
const modal = defineModel<boolean>("modal", { required: true });
const profileId = defineModel<string>("profileId", { required: true });
const type = ref<string>("");
const isReadonly = ref<boolean>(false); //
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai, messageError } = mixin;
const { dialogConfirm, success, messageError, showLoader, hideLoader } = mixin;
const props = defineProps({
fetchData: {
type: Function,
},
});
const typeOp = ref<DataOption[]>([
{ id: "NONE", name: "ไม่ได้เลื่อน" },
{ id: "HAFT", name: "ครึ่งขั้น" },
@ -33,20 +42,24 @@ function close() {
function onSubmit() {
dialogConfirm($q, () => {
showLoader();
const body = {
profileId: "????????????????????????????????????????????",
profileId: profileId.value,
type: type.value,
};
http
.post(config.API.salaryPeriod() + `/change/type`, body)
.then((res) => {
modal.value = false;
type.value = "";
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
.finally(() => {
close();
hideLoader();
});
});
}
@ -77,7 +90,7 @@ function inputEdit(val: boolean) {
map-options
option-label="name"
option-value="id"
:options="typeOp"
:options="typeOp.filter((e) => e.id !== store.tabType)"
:rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]"
lazy-rules
hide-bottom-space