This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-22 16:56:40 +07:00
parent 7f3eb5225f
commit 4c35662eed
22 changed files with 632 additions and 343 deletions

View file

@ -73,7 +73,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "createdAt",
align: "center",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
@ -85,7 +85,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "lastUpdatedAt",
align: "center",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
@ -308,7 +308,6 @@ onMounted(async () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
@ -382,7 +381,7 @@ onMounted(async () => {
/>
</div>
<div v-else>
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>
@ -397,7 +396,9 @@ onMounted(async () => {
<q-card style="max-width: 350px">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:tittle="
dialogStatus == 'edit' ? 'แก้ไขเครื่องราชฯ' : 'เพิ่มเครื่องราชฯ'
"
:close="closeDialog"
/>

View file

@ -82,6 +82,7 @@ const dialog = ref<boolean>(false); // เพิ่มข้อมูล,แก
const dialogStatus = ref<string>(""); // ,
const personalName = ref<string>("เขต/อำเภอ"); //label input
const rows = ref<FormDistrict[]>([]); // /
const provinceName = ref<string>(""); //
/**
* fetch อมลรายการ ระดบการเขต/อำเภอ ตาม id ของจงหว
@ -94,6 +95,7 @@ async function fetchData() {
.get(config.API.orgProvince + `/${id.value}`)
.then(async (res) => {
const data = await res.data.result.districts;
provinceName.value = await res.data.result.name;
const list = data.map((e: FormDistrict) => ({
...e,
@ -187,7 +189,7 @@ onMounted(async () => {
class="q-mr-sm"
@click="router.go(-1)"
/>
เขต/อำเภอ
เขต/อำเภอ {{ `(${provinceName})` }}
</div>
<q-card flat bordered>
@ -227,7 +229,6 @@ onMounted(async () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
@ -283,7 +284,7 @@ onMounted(async () => {
@click="nextPage(props.row.id)"
>
<div>
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>

View file

@ -95,6 +95,7 @@ const subDistrict = ref<string>(""); //แขวง / ตำบล;
const zipCode = ref<string>(""); //
const dialogStatus = ref<string>(""); // ,
const personalName = ref<string>("แขวง/ตำบล"); //label input
const subdistrict = ref<string>(""); ///
/**
* fetch อมลรายการ ระดบการเขต/อำเภอ ตาม id ของแขวง/ตำบล
@ -107,6 +108,7 @@ async function fetchData() {
.get(config.API.orgDistrict + `/${id.value}`)
.then(async (res) => {
const data = await res.data.result.subDistricts;
subdistrict.value = await res.data.result.name;
const list = data.map((e: FormSubDistrict) => ({
...e,
createdAt: e.createdAt ? date2Thai(new Date(e.createdAt)) : "",
@ -192,7 +194,7 @@ onMounted(async () => {
class="q-mr-sm"
@click="router.go(-1)"
/>
แขวง/ตำบล
แขวง/ตำบล {{ `(${subdistrict})` }}
</div>
<q-card flat bordered>
@ -233,7 +235,6 @@ onMounted(async () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
@ -286,7 +287,7 @@ onMounted(async () => {
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div>
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>

View file

@ -68,12 +68,42 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "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: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>([
"no",
"posDictName",
"posTypeName",
"posLevelName",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]);
//
const optionFilter = ref<DataOption[]>([
@ -269,8 +299,58 @@ onMounted(async () => {
});
</script>
<template>
<div class="row col-12 q-mb-sm">
<div class="col-md-2">
<div class="row col-12 q-mb-sm q-col-gutter-sm">
<div class="row col-12">
<q-space />
<div class="row col-md-10 q-col-gutter-sm">
<div class="col-md-4">
<q-select
label="ค้นหาจาก"
v-model="formQuery.type"
:options="optionFilter"
emit-value
dense
map-options
outlined
option-label="name"
option-value="id"
/>
</div>
<div class="col-md-6">
<q-input
ref="searchRef"
v-model="formQuery.keyword"
outlined
dense
lazy-rules
label="คำค้น"
hide-bottom-space
@keydown.enter="fetchData()"
>
<template v-slot:append>
<q-icon
v-if="formQuery.keyword"
name="cancel"
@click="(formQuery.keyword = ''), fetchData()"
class="cursor-pointer"
></q-icon>
</template>
</q-input>
</div>
<div class="row col-md-2">
<q-btn
color="primary"
icon="search"
label="ค้นหา"
class="full-width"
@click="fetchData()"
/>
</div>
</div>
</div>
<div class="row col-12">
<q-btn
id="addComplaints"
for="addComplaints"
@ -282,54 +362,21 @@ onMounted(async () => {
@click="onClickOpenDialog()"
><q-tooltip>เพมตำเเหน </q-tooltip></q-btn
>
</div>
<q-space />
<div class="row col-md-10 q-col-gutter-sm">
<div class="col-md-4">
<q-select
label="ค้นหาจาก"
v-model="formQuery.type"
:options="optionFilter"
emit-value
dense
map-options
outlined
option-label="name"
option-value="id"
/>
</div>
<div class="col-md-6">
<q-input
ref="searchRef"
v-model="formQuery.keyword"
outlined
dense
lazy-rules
label="คำค้น"
hide-bottom-space
@keydown.enter="fetchData()"
>
<template v-slot:append>
<q-icon
v-if="formQuery.keyword"
name="cancel"
@click="(formQuery.keyword = ''), fetchData()"
class="cursor-pointer"
></q-icon>
</template>
</q-input>
</div>
<div class="row col-md-2">
<q-btn
color="primary"
icon="search"
label="ค้นหา"
class="full-width"
@click="fetchData()"
/>
</div>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div>

View file

@ -57,11 +57,41 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "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: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>([
"posTypeName",
"posTypeShortName",
"posTypeRank",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]);
//
@ -204,7 +234,6 @@ onMounted(async () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>

View file

@ -70,12 +70,42 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "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: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>([
"no",
"posLevelName",
"posTypeName",
"posLevelAuthority",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]);
const posTypeId = ref<string>(route.params.id.toString()); // id
@ -248,7 +278,6 @@ onMounted(() => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
@ -298,7 +327,7 @@ onMounted(() => {
{{ col.value ? convertPosLevelAuthority(col.value) : "-" }}
</div>
<div v-else>
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>
@ -365,7 +394,6 @@ onMounted(() => {
outlined
dense
bg-color="white"
hide-bottom-space
readonly
/>

View file

@ -94,6 +94,33 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "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: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>([
"no",
@ -104,6 +131,9 @@ const visibleColumns = ref<string[]>([
"posExecutiveName",
"positionExecutiveField",
"positionArea",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]);
//
@ -254,8 +284,60 @@ onMounted(async () => {
<template>
<q-form @submit.prevent="fetchData()">
<div class="row col-12 q-mb-sm">
<div class="col-md-2">
<div class="row col-12 q-mb-sm q-col-gutter-sm">
<div class="row col-12">
<q-space />
<div class="row col-md-10 q-col-gutter-sm">
<div class="col-md-4">
<q-select
label="ค้นหาจาก"
v-model="type"
:options="optionFilter"
emit-value
dense
map-options
outlined
option-label="name"
option-value="id"
:clearable="type !== 'ALL'"
@clear="type = 'ALL'"
/>
</div>
<div class="col-md-6">
<q-input
:class="inputEdit(isReadonly)"
v-model="search"
outlined
dense
lazy-rules
label="คำค้น"
hide-bottom-space
>
<template v-slot:append>
<q-icon
v-if="search"
name="cancel"
@click="search = ''"
class="cursor-pointer"
></q-icon>
</template>
</q-input>
</div>
<div class="row col-md-2">
<q-btn
color="primary"
icon="search"
label="ค้นหา"
class="full-width"
type="submit"
/>
</div>
</div>
</div>
<div class="row col-12">
<q-btn
id="addComplaints"
for="addComplaints"
@ -267,55 +349,21 @@ onMounted(async () => {
@click="popupAdd()"
><q-tooltip>เพมตำเเหน </q-tooltip></q-btn
>
</div>
<q-space />
<div class="row col-md-10 q-col-gutter-sm">
<div class="col-md-4">
<q-select
label="ค้นหาจาก"
v-model="type"
:options="optionFilter"
emit-value
dense
map-options
outlined
option-label="name"
option-value="id"
:clearable="type !== 'ALL'"
@clear="type = 'ALL'"
/>
</div>
<div class="col-md-6">
<q-input
:class="inputEdit(isReadonly)"
v-model="search"
outlined
dense
lazy-rules
label="คำค้น"
hide-bottom-space
>
<template v-slot:append>
<q-icon
v-if="search"
name="cancel"
@click="search = ''"
class="cursor-pointer"
></q-icon>
</template>
</q-input>
</div>
<div class="row col-md-2">
<q-btn
color="primary"
icon="search"
label="ค้นหา"
class="full-width"
type="submit"
/>
</div>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div>
</q-form>

View file

@ -77,7 +77,13 @@ const columns = [
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
] as const satisfies QTableProps["columns"];
const visibleColumns = ref<string[]>(["posTypeName", "posTypeRank"]);
const visibleColumns = ref<string[]>([
"posTypeName",
"posTypeRank",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]);
const editId = ref<string>(""); // id
const dialog = ref<boolean>(false); // modal popu ,
@ -201,7 +207,6 @@ onMounted(async () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
@ -257,7 +262,7 @@ onMounted(async () => {
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
{{ col.value }}
{{ col.value ?? "-" }}
</q-td>
</q-tr>
</template>

View file

@ -21,6 +21,9 @@ const visibleColumns = ref<string[]>([
"no",
"posExecutiveName",
"posExecutivePriority",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]);
const columns = ref<QTableProps["columns"]>([
{
@ -50,6 +53,33 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "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: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const dataEdit = ref<RowListForm>(); //
@ -130,7 +160,6 @@ onMounted(async () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
@ -197,7 +226,7 @@ onMounted(async () => {
{{ props.rowIndex + 1 }}
</div>
<div v-else>
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>

View file

@ -126,6 +126,9 @@ const visibleColumns = ref<string[]>([
"posLevelName",
"posLevelRank",
"posLevelAuthority",
"createdAt",
"lastUpdatedAt",
"lastUpdateFullName",
]);
const id = ref<string>(route.params.id.toString()); //
@ -295,7 +298,6 @@ onMounted(async () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
@ -376,7 +378,7 @@ onMounted(async () => {
{{ posName }}
</div>
<div v-else>
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>
@ -458,7 +460,6 @@ onMounted(async () => {
outlined
dense
bg-color="white"
hide-bottom-space
readonly
/>

View file

@ -20,8 +20,8 @@ export const usePositionDataStore = defineStore("PositionData", () => {
posTypeId: e.posTypes?.id,
posTypeName: e.posTypes?.posTypeName,
posTypeRank: e.posTypes?.posTypeRank,
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "-",
posLevelAuthority: e.posLevelAuthority
? storeOption.posLevelAuthorityConvert(e.posLevelAuthority)
: "-",

View file

@ -22,8 +22,8 @@ export const usePositionTypeDataStore = defineStore("PositionTypeData", () => {
...e,
posTypes: undefined,
posTypeId: e.posTypes?.id,
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "-",
})) satisfies DataRow[];
row.value = list;
}

View file

@ -34,7 +34,7 @@ const columns = ref<QTableProps["columns"]>([
},
{
name: "createdAt",
align: "center",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
@ -45,7 +45,7 @@ const columns = ref<QTableProps["columns"]>([
},
{
name: "lastUpdatedAt",
align: "center",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
@ -214,7 +214,6 @@ onMounted(async () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
@ -300,7 +299,11 @@ onMounted(async () => {
<q-card style="max-width: 350px">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<dialog-header
:tittle="dialogStatus === 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:tittle="
dialogStatus === 'edit'
? 'แก้ไขประเภทเครื่องราชฯ'
: 'เพิ่มประเภทเครื่องราชฯ'
"
:close="closeDialog"
/>