แก้ไข + เพิ่มเงื่อนไข ทะเบียนประวัติลูกจ้าง
This commit is contained in:
parent
735834fc4b
commit
7afbb2911a
2 changed files with 33 additions and 7 deletions
|
|
@ -746,7 +746,7 @@ import type { QTableProps } from "quasar";
|
|||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, modalError, messageError, showLoader, hideLoader } =
|
||||
const { fails, success, modalError, messageError, showLoader, hideLoader } =
|
||||
mixin;
|
||||
const store = useOrganizationalDataStore();
|
||||
const { organizationalData, changeOrganizationalColumns } = store;
|
||||
|
|
@ -974,7 +974,6 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const onSelected = async (id: string) => {
|
||||
// await fetchPositionNumber(id);
|
||||
organizationId.value = id;
|
||||
};
|
||||
|
||||
|
|
@ -1077,7 +1076,10 @@ const fetchData = async () => {
|
|||
positionEmployeeStatus: r.positionEmployeeStatus,
|
||||
positionMasterUserNote: r.positionMasterUserNote,
|
||||
qualification: r.qualification,
|
||||
organizationId: r.organizationId,
|
||||
organizationId:
|
||||
r.organizationId == "00000000-0000-0000-0000-000000000000"
|
||||
? null
|
||||
: r.organizationId,
|
||||
});
|
||||
});
|
||||
})
|
||||
|
|
@ -1394,12 +1396,18 @@ const clickSave = async () => {
|
|||
if (modalEdit.value) {
|
||||
await editData();
|
||||
} else {
|
||||
await saveData();
|
||||
if (selected.value == "") {
|
||||
fails($q, "กรุณาเลือกหน่วยงาน");
|
||||
} else {
|
||||
// console.log("save");
|
||||
await saveData();
|
||||
}
|
||||
// await saveData();
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log(selected.value);
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
|
|
@ -1439,6 +1447,7 @@ const saveData = async () => {
|
|||
isActive: isActive.value,
|
||||
isCondition: isCondition.value,
|
||||
conditionNote: conditionNote.value,
|
||||
organizationId: organizationId.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลร่างสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
|
||||
function dateToISO(date: Date) {
|
||||
if (date != null) {
|
||||
const srcDate = new Date(date)
|
||||
const srcDate = new Date(date);
|
||||
|
||||
return (
|
||||
srcDate.getFullYear() +
|
||||
|
|
@ -255,7 +255,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
appendLeadingZeroes(srcDate.getDate())
|
||||
);
|
||||
} else {
|
||||
return ""
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -396,6 +396,22 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
}
|
||||
};
|
||||
|
||||
const fails = (q: any, val: string) => {
|
||||
// useQuasar ไม่สามารถใช้นอกไฟล์ .vue
|
||||
if (val !== "") {
|
||||
return q.notify({
|
||||
message: val,
|
||||
color: "red",
|
||||
icon: "mdi-information",
|
||||
position: "bottom-right",
|
||||
multiLine: true,
|
||||
timeout: 1000,
|
||||
badgeColor: "positive",
|
||||
classes: "my-notif-class",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const dialogMessage = (
|
||||
// ไม่เอาใส่ undefined
|
||||
q: any,
|
||||
|
|
@ -818,5 +834,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
dialogConfirm,
|
||||
dialogRemove,
|
||||
dialogMessageNotify,
|
||||
fails,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue