history
This commit is contained in:
parent
c2e0e5cb59
commit
bc8a03139d
4 changed files with 51 additions and 48 deletions
|
|
@ -11,11 +11,14 @@ import { QForm, useQuasar } from "quasar";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, success, messageError, dialogConfirm, hideLoader,date2Thai } = mixin;
|
||||
const listCheck = ref<string>("");
|
||||
const id = ref<string>('')
|
||||
const props = defineProps({
|
||||
modal: Boolean,
|
||||
personId: {
|
||||
|
|
@ -37,41 +40,50 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "directions",
|
||||
name: "commandSubject",
|
||||
align: "left",
|
||||
label: "คำสั่ง",
|
||||
sortable: true,
|
||||
field: "directions",
|
||||
field: "commandSubject",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "dateDirections",
|
||||
name: "lastUpdatedAt",
|
||||
align: "left",
|
||||
label: "วันที่ส่งไปออกคำสั่ง",
|
||||
sortable: true,
|
||||
field: "dateDirections",
|
||||
field: "lastUpdatedAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
const data = [
|
||||
{
|
||||
id: "1",
|
||||
directions: "จำลอง1",
|
||||
dateDirections: date2Thai(new Date(),false,true),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
directions: "จำลอง2",
|
||||
dateDirections: date2Thai(new Date(),false,true),
|
||||
},
|
||||
];
|
||||
function getHistory(id:string){
|
||||
showLoader()
|
||||
http
|
||||
.get(config.API.historyOrderById(id))
|
||||
.then((res)=>{
|
||||
console.log(res)
|
||||
const data = res.data.result;
|
||||
rows.value = data.map((item:any)=>({
|
||||
commandSubject:item.commandSubject ? item.commandSubject : '-',
|
||||
createdAt:item.createdAt ? date2Thai(item.createdAt,false,true) : '-',
|
||||
lastUpdatedAt:item.lastUpdatedAt ? date2Thai(item.lastUpdatedAt,false,true) : '-',
|
||||
}))
|
||||
}).catch((e)=>{
|
||||
messageError($q,e)
|
||||
}).finally(()=>{
|
||||
hideLoader()
|
||||
})
|
||||
}
|
||||
|
||||
watch(()=>props.personId,()=>{
|
||||
if(props.personId){
|
||||
getHistory(props.personId)
|
||||
}
|
||||
})
|
||||
|
||||
rows.value = data;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ function openDetial(id: string) {
|
|||
|
||||
function closeDetail() {
|
||||
modalHistory.value = false;
|
||||
personalId.value = "";
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -337,6 +338,7 @@ function closeDetail() {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width></q-th>
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
|
|
@ -347,40 +349,37 @@ function closeDetail() {
|
|||
col.label
|
||||
}}</span>
|
||||
</q-th>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<td>
|
||||
<router-link
|
||||
target="_blank"
|
||||
:to="`/registry/${props.row.personId}`"
|
||||
><q-icon name="info" color="info" size="sm"
|
||||
><q-tooltip>ดูข้อมูลในทะเบียนประวัติ</q-tooltip>
|
||||
</q-icon></router-link
|
||||
>
|
||||
</td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="openDetial(props.row.personId)"
|
||||
>
|
||||
<div
|
||||
v-if="col.name == 'no'"
|
||||
@click="openDetial(props.row.id)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<router-link
|
||||
target="_blank"
|
||||
:to="`/registry/${props.row.personId}`"
|
||||
><q-icon name="info" color="info" size="sm"
|
||||
><q-tooltip
|
||||
>ดูข้อมูลในทะเบียนประวัติ</q-tooltip
|
||||
>
|
||||
</q-icon></router-link
|
||||
>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else-if="col.name === 'organization'"
|
||||
class="table_ellipsis"
|
||||
@click="openDetial(props.row.id)"
|
||||
>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
<div v-else @click="openDetial(props.row.id)">
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -33,15 +33,6 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
const rowsCheck = ref<ArrayPersonAdd[]>([]);
|
||||
/** หัวตารางผู้ถูกร้องเรียน */
|
||||
const columnsRespondent = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "info",
|
||||
align: "left",
|
||||
label: "",
|
||||
sortable: false,
|
||||
field: "info",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue