ตำแหน่ง/ค่าจ้าง ทะเบียนลูกจ้าง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-13 14:06:44 +07:00
parent 421b410a03
commit 577b04b1a5

View file

@ -536,6 +536,7 @@
</q-form> </q-form>
</q-card> </q-card>
</q-dialog> </q-dialog>
<HistoryTable <HistoryTable
:rows="rowsHistory" :rows="rowsHistory"
:columns="columnsHistory" :columns="columnsHistory"
@ -619,6 +620,7 @@ const {
showLoader, showLoader,
hideLoader, hideLoader,
dialogConfirm, dialogConfirm,
dialogMessageNotify,
} = mixin; } = mixin;
const route = useRoute(); const route = useRoute();
const id = ref<string>(""); const id = ref<string>("");
@ -1498,6 +1500,8 @@ const fetchData = async () => {
.get(config.API.profileSalaryEmployeeId(profileId.value)) .get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
console.log(data);
rows.value = []; rows.value = [];
data.map((e: ResponseObjectEmployee) => { data.map((e: ResponseObjectEmployee) => {
rows.value.push({ rows.value.push({
@ -1711,12 +1715,14 @@ const clickSave = () => {
}; };
const SaveData = async () => { const SaveData = async () => {
await myForm.value.validate().then(async (result: boolean) => { await myForm.value.validate().then(async (result: boolean) => {
if (result) { if (result && agencyId.value) {
if (modalEdit.value) { if (modalEdit.value) {
await editData(); await editData();
} else { } else {
await saveData(); await saveData();
} }
} else if (agencyId.value == "") {
dialogMessageNotify($q, "กรุณาเลือกหน่วยงาน");
} }
}); });
}; };
@ -1761,6 +1767,8 @@ const saveData = async () => {
* นทกแกไขขอม * นทกแกไขขอม
*/ */
const editData = async () => { const editData = async () => {
console.log(agencyId.value);
showLoader(); showLoader();
await http await http
.put(config.API.profileSalaryEmployeeId(id.value), { .put(config.API.profileSalaryEmployeeId(id.value), {
@ -1970,7 +1978,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
.get(config.API.profileSalaryHisId(row.id)) .get(config.API.profileSalaryHisId(row.id))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
// console.log("clickHistory", data); console.log("clickHistory", data);
rowsHistory.value = []; rowsHistory.value = [];
data.map((e: ResponseObjectEmployee) => { data.map((e: ResponseObjectEmployee) => {
rowsHistory.value.push({ rowsHistory.value.push({