API รายละเอียด รายการลงเวลา
This commit is contained in:
parent
b4f269cd94
commit
9100062af6
5 changed files with 22 additions and 11 deletions
|
|
@ -24,6 +24,10 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
require: true,
|
||||
},
|
||||
typeTab: {
|
||||
type: String,
|
||||
require: true,
|
||||
},
|
||||
detail: {
|
||||
type: Object,
|
||||
require: true,
|
||||
|
|
@ -59,10 +63,10 @@ const formData = reactive<FormDetail>({
|
|||
* function เรียกรายการลงเวลาตาม
|
||||
* @param id รายการลงเวลาปฏิบัติงาน
|
||||
*/
|
||||
async function fetchDetailByid(id: string) {
|
||||
async function fetchDetailByid(id: string, type: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.timeRecordById(id))
|
||||
.get(config.API.recordById(id, type))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formData.checkInDate = data.checkInDate && date2Thai(data.checkInDate);
|
||||
|
|
@ -111,7 +115,9 @@ function closePopup() {
|
|||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
props.modal === true && props.detail && fetchDetailByid(props.detail.id);
|
||||
props.modal === true &&
|
||||
props.detail &&
|
||||
fetchDetailByid(props.detail.id, props.typeTab as string);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue