Merge branch 'develop' into dev-tee
# Conflicts: # src/api/index.ts # src/modules/05_placement/router.ts
This commit is contained in:
commit
314d7113bf
22 changed files with 1341 additions and 1472 deletions
|
|
@ -1,741 +0,0 @@
|
|||
div
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-py-md q-pl-md" style="height: 68vh; overflow-y: scroll">
|
||||
<div class="col-12 row q-pb-sm items-center">
|
||||
<q-btn flat round color="primary" @click="refresh" icon="mdi-plus">
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<div class="items-center" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
v-model="filter"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<d-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="selectModal(props.row)"
|
||||
>{{ col.name == "no" ? props.rowIndex + 1 : col.value }}</q-td
|
||||
>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:color="props.rowIndex + 1 == 1 ? 'grey' : 'green'"
|
||||
:disable="props.rowIndex + 1 == 1"
|
||||
@click="upDown(props)"
|
||||
icon="mdi-arrow-up-bold"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับขึ้น</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:color="rows.length == props.rowIndex + 1 ? 'grey' : 'red'"
|
||||
:disable="rows.length == props.rowIndex + 1"
|
||||
@click="upDown(props, false)"
|
||||
icon="mdi-arrow-down-bold"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับลง</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="dialogDeleteData(props.row.personalId)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="flex justify-end q-pa-sm q-gutter-sm">
|
||||
<q-btn
|
||||
dense
|
||||
outline
|
||||
color="primary"
|
||||
icon="chevron_left"
|
||||
@click="previous"
|
||||
class="q-pr-md"
|
||||
label="กรอกรายละเอียด"
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="save"
|
||||
class="q-px-md"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</q-btn>
|
||||
<!-- <q-btn dense flat round color="primary" icon="chevron_right" @click="next">
|
||||
<q-tooltip>ต่อไป</q-tooltip>
|
||||
</q-btn> -->
|
||||
</div>
|
||||
</div>
|
||||
<!--********************************** เงินเดือน ********************************** -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 50vw; max-width: 50vw">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :tittle="titleName" :close="modalOpenClose" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-sm bg-grey-1">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-xs-12">
|
||||
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="modalData.salaryAmount"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="modalData.positionSalaryAmount"
|
||||
:label="`${'เงินประจำตำแหน่ง'}`"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<!-- :rules="[
|
||||
(val) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`,
|
||||
]" -->
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="modalData.mouthSalaryAmount"
|
||||
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<!-- :rules="[
|
||||
(val) => !!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`,
|
||||
]" -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="saveModal"
|
||||
class="q-px-md"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<!--********************************** รายชื่อ ********************************** -->
|
||||
<q-dialog v-model="modalAdd" persistent>
|
||||
<q-card style="width: 50vw; max-width: 50vw">
|
||||
<q-form ref="myFormAdd">
|
||||
<DialogHeader tittle="รายชื่อในการออกคำสั่ง" :close="modalAddChange" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-sm bg-grey-1">
|
||||
<d-table
|
||||
:rows="rows2"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>{{ col.name == "no" ? props.rowIndex + 1 : col.value }}</q-td
|
||||
>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="saveModalAdd"
|
||||
class="q-px-md"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { QInput } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Order";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const props = defineProps({
|
||||
next: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
previous: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
|
||||
const next = () => props.next();
|
||||
const previous = () => props.previous();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dialogMessage, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
|
||||
const modalData = ref<any>({
|
||||
salaryAmount: 0,
|
||||
positionSalaryAmount: 0,
|
||||
mouthSalaryAmount: 0,
|
||||
});
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const myFormAdd = ref<QForm | null>(null);
|
||||
const modal = ref<boolean>(false);
|
||||
const modalAdd = ref<boolean>(false);
|
||||
const titleName = ref<string>("");
|
||||
const filterRef = ref<QInput>();
|
||||
const filter = ref<string>("");
|
||||
const visibleColumns = ref<String[]>(["no", "idCard", "name", "education"]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
field: "no",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "idCard",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
field: "idCard",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
field: "name",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "education",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษาในการออกคำสั่ง",
|
||||
field: "education",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const rows = ref<ResponseData[]>([]);
|
||||
const rows2 = ref<ResponseData[]>([]);
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
await conditionData();
|
||||
});
|
||||
|
||||
const conditionData = async () => {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
: localStorage.getItem("orderId")
|
||||
? localStorage.getItem("orderId")
|
||||
: null;
|
||||
if (id !== null) {
|
||||
await getData(id);
|
||||
}
|
||||
};
|
||||
|
||||
const getData = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.personsselectedOrder(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list: ResponseData[] = [];
|
||||
data.map((r: ResponseData) => {
|
||||
list.push({
|
||||
education: r.education ?? "",
|
||||
idCard: r.idCard ?? "",
|
||||
name: r.name ?? "",
|
||||
personalId: r.personalId ?? "",
|
||||
selectStatus: r.selectStatus !== null ? r.selectStatus : false,
|
||||
sequence: r.sequence !== null ? r.sequence : 0,
|
||||
refRecordId: r.refRecordId,
|
||||
});
|
||||
});
|
||||
// console.log("list", list);
|
||||
rows.value = list;
|
||||
selected.value = rows.value;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// const saveSalary = async (id: string) => {
|
||||
// await http
|
||||
// .put(config.API.salaryOrder(id))
|
||||
// .then((res) => {
|
||||
// // const data = res.data.result;
|
||||
// // console.log(res);
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
|
||||
const dialogDeleteData = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"red",
|
||||
() => deleteData(id),
|
||||
undefined
|
||||
);
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.personsOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await conditionData();
|
||||
});
|
||||
};
|
||||
|
||||
const swapUp = async (id: string) => {
|
||||
// id = personalId
|
||||
await http
|
||||
.put(config.API.swapUpOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await conditionData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const swapDown = async (id: string) => {
|
||||
// id = personalId
|
||||
await http
|
||||
.put(config.API.swapDownOrder(id))
|
||||
.then((res) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await conditionData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const upDown = async (value: any, up: boolean = true) => {
|
||||
const indexCurrent = value.rowIndex;
|
||||
if (up) {
|
||||
await swapUp(value.row.personalId);
|
||||
// rows.value[indexCurrent] = rows.value[indexCurrent - 1];
|
||||
// rows.value[indexCurrent - 1] = value.row;
|
||||
} else {
|
||||
await swapDown(value.row.personalId);
|
||||
// rows.value[indexCurrent] = rows.value[indexCurrent + 1];
|
||||
// rows.value[indexCurrent + 1] = value.row;
|
||||
}
|
||||
};
|
||||
|
||||
const saveModal = () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
putSalary(modalData.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const personalId = ref<string>("");
|
||||
const selectModal = (e: any) => {
|
||||
console.log(e);
|
||||
titleName.value = e.name;
|
||||
personalId.value = e.personalId;
|
||||
// modalData.value = {
|
||||
// salaryAmount: 0,
|
||||
// positionSalaryAmount: 0,
|
||||
// mouthSalaryAmount: 0,
|
||||
// };
|
||||
|
||||
modalOpenClose(e.personalId);
|
||||
};
|
||||
|
||||
const modalOpenClose = async (personalId: string) => {
|
||||
modal.value = !modal.value;
|
||||
if (!modal.value) {
|
||||
titleName.value = "";
|
||||
}
|
||||
if (modal.value == true) {
|
||||
await fetchSalary(personalId);
|
||||
}
|
||||
};
|
||||
const fetchSalary = async (personalId: string) => {
|
||||
console.log(personalId);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.salaryOrder(personalId))
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
let salary = res.data.result;
|
||||
modalData.value = {
|
||||
salaryAmount: salary.salaryAmount,
|
||||
positionSalaryAmount: salary.positionSalaryAmount,
|
||||
mouthSalaryAmount: salary.monthSalaryAmount,
|
||||
};
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const putSalary = async (salary: any) => {
|
||||
modalData.value = {
|
||||
salaryAmount: Number(salary.salaryAmount),
|
||||
positionSalaryAmount: Number(salary.positionSalaryAmount),
|
||||
monthSalaryAmount: Number(salary.mouthSalaryAmount),
|
||||
};
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
await http
|
||||
.put(config.API.salaryOrder(personalId.value), modalData.value)
|
||||
.then((res: any) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await conditionData();
|
||||
modal.value = false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const modalAddChange = async () => {
|
||||
modalAdd.value = !modalAdd.value;
|
||||
if (modalAdd.value == true) {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
: localStorage.getItem("orderId")
|
||||
? localStorage.getItem("orderId")
|
||||
: null;
|
||||
if (id !== null) {
|
||||
await fetchaddlist(id);
|
||||
}
|
||||
} else await conditionData();
|
||||
};
|
||||
const fetchaddlist = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.personsOrder(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list = [];
|
||||
list = data.map((r: ResponseData) => ({
|
||||
education: r.education ?? "",
|
||||
idCard: r.idCard ?? "",
|
||||
name: r.name ?? "",
|
||||
personalId: r.personalId ?? "",
|
||||
selectStatus: r.selectStatus !== null ? r.selectStatus : false,
|
||||
sequence: r.sequence !== null ? r.sequence : 0,
|
||||
refRecordId: r.refRecordId,
|
||||
}));
|
||||
rows2.value = list;
|
||||
selected.value = rows.value;
|
||||
// rows2.value = list.filter((e: any) => e.selectStatus === false);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const saveModalAdd = () => {
|
||||
if (myFormAdd.value !== null) {
|
||||
myFormAdd.value.validate().then(async (result: boolean) => {
|
||||
if (result && selected.value.length !== 0) {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการเพิ่มรายชื่อออกคำสั่ง",
|
||||
message: "ต้องการยืนยันการเพิ่มรายชื่อออกคำสั่งนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let data = [];
|
||||
data.push(...selected.value.map((e: any) => e.refRecordId));
|
||||
// console.log(data);
|
||||
addlist(data);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const addlist = async (data: Object) => {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
: localStorage.getItem("orderId")
|
||||
? localStorage.getItem("orderId")
|
||||
: null;
|
||||
if (id !== null) {
|
||||
await http
|
||||
.post(config.API.personsOrder(id), data)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
modalAddChange();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const click = (e: any) => {
|
||||
console.log(e);
|
||||
console.log(rows.value.length);
|
||||
};
|
||||
|
||||
const save = () => {
|
||||
if (selected.value.length > 0) {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการบันทึกข้อมูล",
|
||||
message: "ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
next();
|
||||
});
|
||||
} else {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ข้อความแจ้งเตือน",
|
||||
"กรุณาเลือกรายชื่อ",
|
||||
"warning",
|
||||
undefined,
|
||||
"orange",
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const selectData = (row: any) => {};
|
||||
|
||||
const refresh = async () => {
|
||||
// await conditionData();
|
||||
modalAddChange();
|
||||
selected.value = [];
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
filter.value = "";
|
||||
filterRef.value!.focus();
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
139
src/modules/05_placement/components/Receive/receiveDetail2.vue
Normal file
139
src/modules/05_placement/components/Receive/receiveDetail2.vue
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายละเอียดการรับโอนของ {{ title.fullname }}
|
||||
</div>
|
||||
<q-card bordered class="row col-12 text-dark">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-subtitle2">
|
||||
{{ title.fullname }}
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
outline
|
||||
color="blue"
|
||||
dense
|
||||
icon-right="mdi-open-in-new"
|
||||
class="q-px-sm"
|
||||
label="ดูข้อมูลทะเบียนประวัติ"
|
||||
@click="router.push(`/registry/${paramsId}`)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-3 col-sm-2 col-md-1 row">
|
||||
<!-- <q-img
|
||||
:src="responseData.avataPath"
|
||||
v-if="responseData.avataPath !== ''"
|
||||
/> -->
|
||||
<q-img src="@/assets/avatar_user.jpg" />
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12 q-pl-md">
|
||||
<div class="col-12 text-top">ตำแหน่งในสายงาน</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ title.positionTypeOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">ระดับ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ title.positionLevelOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">สังกัด</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ title.organizationPositionOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const paramsId = route.params.id;
|
||||
const {
|
||||
date2Thai,
|
||||
dialogMessage,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
} = mixin;
|
||||
|
||||
const title = ref<ResponseTitle>({
|
||||
fullname: "",
|
||||
organizationPositionOld: "",
|
||||
positionLevelOld: "",
|
||||
positionTypeOld: "",
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.receiveDataId(paramsId.toString()))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
|
||||
title.value.fullname = `${data.firstname ?? "-"} ${data.lastname ?? "-"}`;
|
||||
title.value.organizationPositionOld = data.organizationPositionOld ?? "-";
|
||||
title.value.positionLevelOld = data.positionLevelOld ?? "-";
|
||||
title.value.positionTypeOld = data.positionTypeOld ?? "-";
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
border-radius: 5px;
|
||||
height: 70px;
|
||||
}
|
||||
.text-top {
|
||||
color: gray;
|
||||
font-weight: 400;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.text-detail {
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -489,9 +489,9 @@ const getData = async () => {
|
|||
responseData.value.salary = data.salary !== null ? data.salary : 0;
|
||||
responseData.value.status = data.status ?? "";
|
||||
responseData.value.avataPath = data.avataPath ?? "";
|
||||
responseData.value.fullname = `${data.prefix ?? "-"} ${
|
||||
data.firstName ?? "-"
|
||||
} ${data.lastName ?? "-"}`;
|
||||
responseData.value.fullname = `${data.firstName ?? "-"} ${
|
||||
data.lastName ?? "-"
|
||||
}`;
|
||||
|
||||
organizationPositionOld.value = data.organizationPositionOld ?? "";
|
||||
positionTypeOld.value = data.positionTypeOld ?? "";
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ const {
|
|||
hideLoader,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
|
||||
const assign = ref<any>([]);
|
||||
const mentors = ref<any>([]);
|
||||
const commander = ref<any>([]);
|
||||
const status = ref<boolean>(true);
|
||||
const evaluate = ref<any>([]);
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -39,6 +39,8 @@ const fecthAssign = async (id: string) => {
|
|||
console.log(res);
|
||||
assign.value = res.data.data.assign;
|
||||
mentors.value = res.data.data.mentors;
|
||||
date_start.value = assign.value.date_start;
|
||||
date_finish.value = assign.value.date_finish;
|
||||
|
||||
director_id.value = res.data.data.commander.name;
|
||||
director_id2.value = mentors.value[0].name;
|
||||
|
|
@ -55,14 +57,14 @@ const fecthAssign = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
const date_start = ref<Date>(new Date("10-10-2023"));
|
||||
const date_start = ref<Date>(new Date());
|
||||
const date_finish = ref<Date>();
|
||||
const develop = ref<number>();
|
||||
const result = ref<number>();
|
||||
const reson = ref<string>("");
|
||||
const chairman_dated = ref<string>("");
|
||||
const director1_dated = ref<string>("");
|
||||
const director2_dated = ref<string>("");
|
||||
const director1_dated = ref<any>("");
|
||||
const director2_dated = ref<any>("");
|
||||
const fecthResult = async (id: string) => {
|
||||
await http
|
||||
.get(config.API.evaluateReport(id))
|
||||
|
|
@ -77,6 +79,7 @@ const fecthResult = async (id: string) => {
|
|||
chairman_dated.value = data.chairman_dated;
|
||||
director1_dated.value = data.director1_dated;
|
||||
director2_dated.value = data.director2_dated;
|
||||
status.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
|
|
@ -87,11 +90,11 @@ const fecthResult = async (id: string) => {
|
|||
|
||||
const options = [
|
||||
{ value: 1, label: "พัฒนาครบ 3 ส่วน" },
|
||||
{ value: 0, label: "พัฒนาไม่ครบ 3 ส่วน" },
|
||||
{ value: 2, label: "พัฒนาไม่ครบ 3 ส่วน" },
|
||||
];
|
||||
const optionsResult = [
|
||||
{ value: 1, label: "ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อ" },
|
||||
{ value: 0, label: "ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกจากราชการ" },
|
||||
{ value: 2, label: "ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกจากราชการ" },
|
||||
];
|
||||
|
||||
const director_id = ref<any>(null);
|
||||
|
|
@ -272,6 +275,7 @@ const postData = async () => {
|
|||
emit-value
|
||||
map-options
|
||||
option-label="label"
|
||||
option-value="value"
|
||||
outlined
|
||||
v-model="result"
|
||||
label="ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ"
|
||||
|
|
@ -371,7 +375,6 @@ const postData = async () => {
|
|||
:options="optionDirector"
|
||||
label=""
|
||||
option-label="name"
|
||||
|
||||
/>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<datepicker
|
||||
|
|
@ -430,7 +433,6 @@ const postData = async () => {
|
|||
:options="optionDirector"
|
||||
label=""
|
||||
option-label="name"
|
||||
|
||||
/>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<datepicker
|
||||
|
|
@ -479,7 +481,12 @@ const postData = async () => {
|
|||
|
||||
<q-toolbar class="text-primary">
|
||||
<q-space />
|
||||
<q-btn label="บันทึก" color="secondary" @click="savaForm" />
|
||||
<q-btn
|
||||
label="บันทึก"
|
||||
color="secondary"
|
||||
@click="savaForm"
|
||||
v-if="status"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</q-form>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue