no message

This commit is contained in:
setthawutttty 2023-08-22 14:02:35 +07:00
parent adcff8a09d
commit 7d0c2217d4
13 changed files with 262 additions and 114 deletions

View file

@ -8,6 +8,7 @@ import DialogOrgTree from "@/modules/05_placement/components/AppointMent/Appoint
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { WeekNumberContainer } from "@fullcalendar/core/internal";
const mixin = useCounterMixin(); // const mixin = useCounterMixin(); //
const { const {
showLoader, showLoader,
@ -53,6 +54,7 @@ const visibleColumns = ref<string[]>([
"fullname", "fullname",
"organizationName", "organizationName",
"birthday", "birthday",
"createdAt",
"status", "status",
]); ]);
const visibleColumns2 = ref<string[]>([ const visibleColumns2 = ref<string[]>([
@ -105,6 +107,7 @@ const fecthlistappointment = async () => {
positionNumber: e.positionNumber, positionNumber: e.positionNumber,
positionPath: e.positionPath, positionPath: e.positionPath,
status: status(e.status), status: status(e.status),
createdAt:date2Thai(e.createdAt),
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth), birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth),
})); }));
@ -170,8 +173,7 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationName", field: "organizationName",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "birthday", name: "birthday",
@ -182,6 +184,17 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a, b) => (b.createdAt) - (a.createdAt)
},
{ {
name: "status", name: "status",
align: "left", align: "left",
@ -192,6 +205,7 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const columns2 = ref<QTableProps["columns"]>([ const columns2 = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
@ -240,6 +254,7 @@ const columns2 = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const openModalTree = (id: string) => { const openModalTree = (id: string) => {
@ -391,7 +406,7 @@ const status = (val: string) => {
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
:filter="filterKeyword" :filter="filterKeyword"
row-key="fullname" row-key="citizenId"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
> >
<template v-slot:header="props"> <template v-slot:header="props">
@ -470,6 +485,13 @@ const status = (val: string) => {
> >
{{ props.row.birthday }} {{ props.row.birthday }}
</q-td> </q-td>
<q-td
key="createdAt"
:props="props"
@click="nextPage(props.row)"
>
{{ props.row.createdAt }}
</q-td>
<q-td key="status" :props="props" @click="nextPage(props.row)"> <q-td key="status" :props="props" @click="nextPage(props.row)">
{{ props.row.status }} {{ props.row.status }}
</q-td> </q-td>

View file

@ -5,9 +5,7 @@ import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive"; import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
import type { import type { ResponseDataDetail } from "@/modules/05_placement/interface/response/Transfer";
ResponseDataDetail,
} from "@/modules/05_placement/interface/response/Transfer";
import type { QTableProps, QForm } from "quasar"; import type { QTableProps, QForm } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -237,37 +235,43 @@ const getClass = (val: boolean) => {
แกไขขอมลเพอลงบญชแนบทาย แกไขขอมลเพอลงบญชแนบทาย
</div> </div>
<q-space /> <q-space />
<div class="q-gutter-sm" v-if="!edit"> <div
<q-btn v-if="
outline responseData.status !== 'DONE' && responseData.status !== 'REPORT'
color="primary" "
dense >
icon-right="mdi-file-edit-outline" <div class="q-gutter-sm" v-if="!edit">
class="q-px-sm" <q-btn
label="แก้ไข" outline
style="width: 80px" color="primary"
@click="edit = !edit" dense
/> icon-right="mdi-file-edit-outline"
</div> class="q-px-sm"
<div class="q-gutter-sm" v-else> label="แก้ไข"
<q-btn style="width: 80px"
outline @click="edit = !edit"
color="public" />
dense </div>
class="q-px-sm" <div class="q-gutter-sm" v-else>
label="บันทึก" <q-btn
style="width: 80px" outline
@click="clickEdit" color="public"
/> dense
<q-btn class="q-px-sm"
outline label="บันทึก"
color="red" style="width: 80px"
dense @click="clickEdit"
class="q-px-sm" />
label="ยกเลิก" <q-btn
style="width: 80px" outline
@click="(edit = !edit), fecthOther()" color="red"
/> dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="(edit = !edit), fecthOther()"
/>
</div>
</div> </div>
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>

View file

@ -54,7 +54,7 @@ const visibleColumns = ref<string[]>([
"position", "position",
"positionLevel", "positionLevel",
"organizationPositionOld", "organizationPositionOld",
"createdAt",
"statustext", "statustext",
]); ]);
@ -92,7 +92,7 @@ const fecthlistOthet = async () => {
// listRecevice.value = response; // listRecevice.value = response;
console.log(response); console.log(response);
rows.value = response.map((r: any) => ({ rows.value = response.map((r: any) => ({
createdAt: new Date(), createdAt: date2Thai(r.createdAt),
date: new Date(), date: new Date(),
firstName: r.firstname ?? "", firstName: r.firstname ?? "",
personalId: r.id ?? "", personalId: r.id ?? "",
@ -214,6 +214,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{ {
name: "statustext", name: "statustext",
align: "left", align: "left",
@ -380,7 +389,7 @@ const status = (val: string) => {
color="add" color="add"
icon="mdi-account-arrow-right" icon="mdi-account-arrow-right"
> >
<q-tooltip>งไปออกคำสงรายการอนๆ</q-tooltip> <q-tooltip>ประเภทคำสงรายการอนๆ</q-tooltip>
</q-btn> </q-btn>
<q-space /> <q-space />
@ -472,11 +481,19 @@ const status = (val: string) => {
</q-tooltip> --> </q-tooltip> -->
</div> </div>
</q-td> </q-td>
<q-td key="createdAt" :props="props">
{{ props.row.createdAt }}
</q-td>
<q-td key="statustext" :props="props"> <q-td key="statustext" :props="props">
{{ props.row.statustext }} {{ props.row.statustext }}
</q-td> </q-td>
<q-td key="statustext" :props="props">
<q-td auto-width>
<q-btn <q-btn
v-if="
props.row.status !== 'DONE' &&
props.row.status !== 'REPORT'
"
flat flat
round round
class="text-red-14" class="text-red-14"
@ -496,7 +513,7 @@ const status = (val: string) => {
<q-dialog v-model="modal"> <q-dialog v-model="modal">
<q-card style="width: 1200px; max-width: 80vw"> <q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปออกคำสั่งอื่นๆ" :close="clickClose" /> <DialogHeader title="ประเภทคำสั่งอื่นๆ" :close="clickClose" />
<q-separator /> <q-separator />
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<div class="row justify-between"> <div class="row justify-between">

View file

@ -45,6 +45,7 @@ const visibleColumns = ref<string[]>([
"fullname", "fullname",
"organizationName", "organizationName",
"dateOfBirth", "dateOfBirth",
"createdAt",
"statusText", "statusText",
"btn", "btn",
]); ]);
@ -114,6 +115,16 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{ {
name: "statusText", name: "statusText",
align: "left", align: "left",
@ -248,7 +259,7 @@ const getData = async () => {
positionLevelOld: item.positionLevelOld, positionLevelOld: item.positionLevelOld,
positionNumberOld: item.positionNumberOld, positionNumberOld: item.positionNumberOld,
organizationPositionOld: item.organizationPositionOld, organizationPositionOld: item.organizationPositionOld,
createdAt: item.createdAt, createdAt:date2Thai(item.createdAt),
})); }));
console.log(rows.value); console.log(rows.value);
}) })
@ -459,6 +470,13 @@ onMounted(async () => {
props.row.dateOfBirth !== null ? props.row.dateOfBirth : "-" props.row.dateOfBirth !== null ? props.row.dateOfBirth : "-"
}} }}
</q-td> </q-td>
<q-td
key="createdAt"
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.createdAt }}
</q-td>
<q-td <q-td
key="organizationPositionOld" key="organizationPositionOld"
:props="props" :props="props"

View file

@ -43,6 +43,7 @@ const visibleColumns = ref<string[]>([
"position", "position",
"positionLevel", "positionLevel",
"organizationPositionOld", "organizationPositionOld",
"createdAt",
"statustext", "statustext",
]); ]);
const visibleColumns2 = ref<string[]>([ const visibleColumns2 = ref<string[]>([
@ -114,6 +115,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{ {
name: "statustext", name: "statustext",
align: "left", align: "left",
@ -206,7 +216,7 @@ const getData = async () => {
let list: ResponseData[] = []; let list: ResponseData[] = [];
data.map((r: ResponseData) => { data.map((r: ResponseData) => {
list.push({ list.push({
createdAt: new Date(), createdAt:date2Thai(r.createdAt),
date: new Date(), date: new Date(),
firstName: r.firstName ?? "", firstName: r.firstName ?? "",
id: r.id ?? "", id: r.id ?? "",
@ -420,11 +430,19 @@ const saveOrder = async () => {
</q-tooltip> --> </q-tooltip> -->
</div> </div>
</q-td> </q-td>
<q-td
key="createdAt"
:props="props"
@click="nextPage(props.row)"
>
{{ props.row.createdAt }}
</q-td>
<q-td key="statustext" :props="props"> <q-td key="statustext" :props="props">
{{ props.row.statustext }} {{ props.row.statustext }}
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn <q-btn
v-if="props.row.status !=='DONE' && props.row.status !=='REPORT'"
dense dense
size="12px" size="12px"
flat flat

View file

@ -72,7 +72,8 @@
แกไขขอมลเพอลงบญชแนบทาย แกไขขอมลเพอลงบญชแนบทาย
</div> </div>
<q-space /> <q-space />
<div class="q-gutter-sm" v-if="!edit"> <div v-if="responseData.status !=='DONE' && responseData.status !=='REPORT'">
<div class="q-gutter-sm" v-if="!edit">
<q-btn <q-btn
outline outline
color="primary" color="primary"
@ -103,7 +104,8 @@
style="width: 80px" style="width: 80px"
@click="edit = !edit" @click="edit = !edit"
/> />
</div> </div></div>
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<q-form ref="myForm"> <q-form ref="myForm">

View file

@ -43,6 +43,7 @@ const visibleColumns = ref<string[]>([
"position", "position",
"positionLevel", "positionLevel",
"organizationPositionOld", "organizationPositionOld",
"createdAt",
"statustext", "statustext",
]); ]);
const visibleColumns2 = ref<string[]>([ const visibleColumns2 = ref<string[]>([
@ -114,6 +115,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{ {
name: "statustext", name: "statustext",
align: "left", align: "left",
@ -206,7 +216,7 @@ const getData = async () => {
let list: ResponseData[] = []; let list: ResponseData[] = [];
data.map((r: ResponseData) => { data.map((r: ResponseData) => {
list.push({ list.push({
createdAt: new Date(), createdAt:date2Thai(r.createdAt),
date: new Date(), date: new Date(),
firstName: r.firstName ?? "", firstName: r.firstName ?? "",
id: r.id ?? "", id: r.id ?? "",
@ -420,11 +430,19 @@ const saveOrder = async () => {
</q-tooltip> --> </q-tooltip> -->
</div> </div>
</q-td> </q-td>
<q-td
key="createdAt"
:props="props"
>
{{ props.row.createdAt }}
</q-td>
<q-td key="statustext" :props="props"> <q-td key="statustext" :props="props">
{{ props.row.statustext }} {{ props.row.statustext }}
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn <q-btn
v-if="props.row.status !== 'DONE' && props.row.status !== 'REPORT'"
dense dense
size="12px" size="12px"
flat flat

View file

@ -72,37 +72,43 @@
แกไขขอมลเพอลงบญชแนบทาย แกไขขอมลเพอลงบญชแนบทาย
</div> </div>
<q-space /> <q-space />
<div class="q-gutter-sm" v-if="!edit"> <div
<q-btn v-if="
outline responseData.status !== 'DONE' && responseData.status !== 'REPORT'
color="primary" "
dense >
icon-right="mdi-file-edit-outline" <div class="q-gutter-sm" v-if="!edit">
class="q-px-sm" <q-btn
label="แก้ไข" outline
style="width: 80px" color="primary"
@click="edit = !edit" dense
/> icon-right="mdi-file-edit-outline"
</div> class="q-px-sm"
<div class="q-gutter-sm" v-else> label="แก้ไข"
<q-btn style="width: 80px"
outline @click="edit = !edit"
color="public" />
dense </div>
class="q-px-sm" <div class="q-gutter-sm" v-else>
label="บันทึก" <q-btn
style="width: 80px" outline
@click="conditionSave" color="public"
/> dense
<q-btn class="q-px-sm"
outline label="บันทึก"
color="red" style="width: 80px"
dense @click="conditionSave"
class="q-px-sm" />
label="ยกเลิก" <q-btn
style="width: 80px" outline
@click="edit = !edit" color="red"
/> dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="edit = !edit"
/>
</div>
</div> </div>
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
@ -234,6 +240,7 @@
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
:readonly="!edit"
:borderless="!edit" :borderless="!edit"
:model-value="date !== null ? date2Thai(date) : null" :model-value="date !== null ? date2Thai(date) : null"
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]" :rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
@ -383,7 +390,7 @@ const getData = async () => {
.get(config.API.outByid(dataId)) .get(config.API.outByid(dataId))
.then((res: any) => { .then((res: any) => {
const data = res.data.result; const data = res.data.result;
responseData.value.personId = data.profileId; responseData.value.personId = data.profileId;
responseData.value.createdAt = data.createdAt; responseData.value.createdAt = data.createdAt;
responseData.value.date = responseData.value.date =

View file

@ -43,6 +43,7 @@ const visibleColumns = ref<string[]>([
"position", "position",
"positionLevel", "positionLevel",
"organizationPositionOld", "organizationPositionOld",
"createdAt",
"statustext", "statustext",
]); ]);
const visibleColumns2 = ref<string[]>([ const visibleColumns2 = ref<string[]>([
@ -114,6 +115,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{ {
name: "statustext", name: "statustext",
align: "left", align: "left",
@ -206,7 +216,7 @@ const getData = async () => {
let list: ResponseData[] = []; let list: ResponseData[] = [];
data.map((r: ResponseData) => { data.map((r: ResponseData) => {
list.push({ list.push({
createdAt: new Date(), createdAt:date2Thai(r.createdAt),
date: new Date(), date: new Date(),
firstName: r.firstName ?? "", firstName: r.firstName ?? "",
id: r.id ?? "", id: r.id ?? "",
@ -421,12 +431,20 @@ const saveOrder = async () => {
</q-tooltip> --> </q-tooltip> -->
</div> </div>
</q-td> </q-td>
<q-td
key="createdAt"
:props="props"
>
{{ props.row.createdAt }}
</q-td>
<q-td key="statustext" :props="props"> <q-td key="statustext" :props="props">
{{ props.row.statustext }} {{ props.row.statustext }}
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn <q-btn
v-if="props.row.status !== 'DONE' && props.row.status !=='REPORT'"
dense dense
size="12px" size="12px"
flat flat

View file

@ -72,37 +72,43 @@
แกไขขอมลเพอลงบญชแนบทาย แกไขขอมลเพอลงบญชแนบทาย
</div> </div>
<q-space /> <q-space />
<div class="q-gutter-sm" v-if="!edit"> <div
<q-btn v-if="
outline responseData.status !== 'DONE' && responseData.status !== 'REPORT'
color="primary" "
dense >
icon-right="mdi-file-edit-outline" <div class="q-gutter-sm" v-if="!edit">
class="q-px-sm" <q-btn
label="แก้ไข" outline
style="width: 80px" color="primary"
@click="edit = !edit" dense
/> icon-right="mdi-file-edit-outline"
</div> class="q-px-sm"
<div class="q-gutter-sm" v-else> label="แก้ไข"
<q-btn style="width: 80px"
outline @click="edit = !edit"
color="public" />
dense </div>
class="q-px-sm" <div class="q-gutter-sm" v-else>
label="บันทึก" <q-btn
style="width: 80px" outline
@click="conditionSave" color="public"
/> dense
<q-btn class="q-px-sm"
outline label="บันทึก"
color="red" style="width: 80px"
dense @click="conditionSave"
class="q-px-sm" />
label="ยกเลิก" <q-btn
style="width: 80px" outline
@click="edit = !edit" color="red"
/> dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="edit = !edit"
/>
</div>
</div> </div>
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>

View file

@ -9,7 +9,7 @@ import config from "@/app.config";
const router = useRouter(); const router = useRouter();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, success } = mixin; const { showLoader, hideLoader, messageError, success ,date2Thai} = mixin;
const rows = ref<any>([]); const rows = ref<any>([]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
@ -76,6 +76,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"prefix", "prefix",
@ -85,6 +94,7 @@ const visibleColumns = ref<string[]>([
"positionLevel", "positionLevel",
"positionExecutive", "positionExecutive",
"oc", "oc",
"createdAt",
]); ]);
onMounted(() => { onMounted(() => {
fectListDecased(); fectListDecased();
@ -104,6 +114,7 @@ const fectListDecased = async () => {
positionLevel: e.positionLevel, positionLevel: e.positionLevel,
positionExecutive: e.positionExecutive, positionExecutive: e.positionExecutive,
oc: e.organization, oc: e.organization,
createdAt:date2Thai(e.createdAt),
})); }));
}) })
.catch((e) => { .catch((e) => {
@ -237,6 +248,13 @@ const nextPage = (id: string) => {
<q-td key="oc" :props="props"> <q-td key="oc" :props="props">
{{ props.row.oc }} {{ props.row.oc }}
</q-td> </q-td>
<q-td
key="createdAt"
:props="props"
@click="nextPage(props.row)"
>
{{ props.row.createdAt }}
</q-td>
</q-tr> </q-tr>
</template> </template>
<template v-slot:pagination="scope"> <template v-slot:pagination="scope">

View file

@ -1,5 +1,5 @@
interface ResponseData { interface ResponseData {
createdAt: Date; createdAt: any;
date: Date; date: Date;
firstName: string; firstName: string;
id: string; id: string;

View file

@ -1,5 +1,5 @@
interface ResponseData { interface ResponseData {
createdAt: Date; createdAt: any;
date: Date; date: Date;
firstName: string; firstName: string;
id: string; id: string;