Merge branch 'develop' into devTee
This commit is contained in:
commit
4511e5ae87
17 changed files with 81 additions and 59 deletions
|
|
@ -137,7 +137,6 @@ function resetFilter() {
|
|||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ const resetFilter = () => {
|
|||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@ function resetFilter() {
|
|||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ const resetFilter = () => {
|
|||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ watchEffect(() => {
|
|||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
v-model="filterKeyword"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@ onMounted(async () => {
|
|||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -409,7 +409,6 @@ onMounted(async () => {
|
|||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -240,12 +240,6 @@ const filterAndApply = () => {
|
|||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
<!-- <q-icon
|
||||
v-if="filterMain !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/> -->
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
|
|
@ -266,7 +260,6 @@ const filterAndApply = () => {
|
|||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
<!-- :filter="filterMain" -->
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watchEffect, computed } from "vue";
|
||||
import { ref, computed, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -30,7 +30,7 @@ const dataMapToSend = computed(() => {
|
|||
}));
|
||||
});
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, date2Thai } = mixin;
|
||||
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
|
||||
|
||||
/** props*/
|
||||
const props = defineProps({
|
||||
|
|
@ -43,6 +43,8 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
//Table
|
||||
const rowsData = ref<ResponseItems[]>([]);
|
||||
const rowsDataMain = ref<ResponseItems[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -60,7 +62,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: (row) => `${row.prefix}${row.firstName} ${row.lastName}`,
|
||||
field: "fullname",
|
||||
format(val, row) {
|
||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -129,7 +134,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: (row) => statusText(row.status),
|
||||
field: "status",
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -166,20 +174,31 @@ function updateInput(value: any) {
|
|||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
/** รีเซ็ตค่าในช่องค้นหา */
|
||||
function Reset() {
|
||||
emit("update:filterKeyword2", "");
|
||||
async function onSearch() {
|
||||
rowsData.value = onSearchDataTable(
|
||||
props.filterKeyword2 ? props.filterKeyword2 : "",
|
||||
rowsDataMain.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
if (props.modal === true) {
|
||||
selected.value = [];
|
||||
watch(
|
||||
() => props.modal,
|
||||
(val) => {
|
||||
if (val) {
|
||||
selected.value = [];
|
||||
rowsData.value = props.rows ? props.rows : [];
|
||||
rowsDataMain.value = props.rows ? props.rows : [];
|
||||
} else {
|
||||
rowsData.value = [];
|
||||
rowsDataMain.value = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<q-card style="min-width: 80%">
|
||||
<DialogHeader tittle="ส่งไปออกคำสั่งลาออก" :close="closeModal" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
|
|
@ -190,9 +209,9 @@ watchEffect(() => {
|
|||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
@keydown.enter="onSearch"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
|
|
@ -218,8 +237,7 @@ watchEffect(() => {
|
|||
<div class="col-12">
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword2?.trim()"
|
||||
:rows="rowsData"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
selection="multiple"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watchEffect, computed } from "vue";
|
||||
import { ref, watch, computed } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -30,7 +30,7 @@ const dataMapToSend = computed(() => {
|
|||
}));
|
||||
});
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, date2Thai } = mixin;
|
||||
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
|
||||
|
||||
/** props*/
|
||||
const props = defineProps({
|
||||
|
|
@ -43,6 +43,8 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
//Table
|
||||
const rowsData = ref<ResponseItems[]>([]);
|
||||
const rowsDataMain = ref<ResponseItems[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -60,7 +62,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: (row) => `${row.prefix}${row.firstName} ${row.lastName}`,
|
||||
field: "fullname",
|
||||
format(val, row) {
|
||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -129,7 +134,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: (row) => statusText(row.status),
|
||||
field: "status",
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
},
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -166,15 +174,31 @@ function updateInput(value: any) {
|
|||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
if (props.modal === true) {
|
||||
selected.value = [];
|
||||
async function onSearch() {
|
||||
rowsData.value = onSearchDataTable(
|
||||
props.filterKeyword2 ? props.filterKeyword2 : "",
|
||||
rowsDataMain.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modal,
|
||||
(val) => {
|
||||
if (val) {
|
||||
selected.value = [];
|
||||
rowsData.value = props.rows ? props.rows : [];
|
||||
rowsDataMain.value = props.rows ? props.rows : [];
|
||||
} else {
|
||||
rowsData.value = [];
|
||||
rowsDataMain.value = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<q-card style="min-width: 80%">
|
||||
<DialogHeader tittle="ส่งไปออกคำสั่งลาออก" :close="closeModal" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
|
|
@ -185,10 +209,10 @@ watchEffect(() => {
|
|||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -213,8 +237,7 @@ watchEffect(() => {
|
|||
<div class="col-12">
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword2?.trim()"
|
||||
:rows="rowsData"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
selection="multiple"
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ const {
|
|||
hideLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
onSearchDataTable,
|
||||
} = mixin;
|
||||
|
||||
/** props*/
|
||||
|
|
@ -52,6 +53,7 @@ const modalSelectOrg = ref<boolean>(false);
|
|||
|
||||
const selectedModal = ref<any[]>([]);
|
||||
const rows = ref<DataCopyOrder[]>([]);
|
||||
const rowsMain = ref<DataCopyOrder[]>([]);
|
||||
const editRows = ref<DataCopyOrder[]>([]);
|
||||
|
||||
/** selcet OPtion */
|
||||
|
|
@ -59,7 +61,6 @@ const optionSelect = ref<any>([
|
|||
{ id: 1, name: "อีเมล" },
|
||||
{ id: 2, name: "กล่องข้อความ" },
|
||||
]);
|
||||
|
||||
/** คอลัมน์ที่แสดง */
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
|
|
@ -158,6 +159,7 @@ async function getData() {
|
|||
});
|
||||
}
|
||||
rows.value = list;
|
||||
rowsMain.value = list;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -189,12 +191,6 @@ async function saveData() {
|
|||
});
|
||||
}
|
||||
|
||||
function resetFilter() {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
filter.value = "";
|
||||
filterRef.value!.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
* @param val ข้อมูล input สำหรับแก้ไขหรือไม่
|
||||
|
|
@ -257,7 +253,7 @@ async function saveDataCopyOrder() {
|
|||
//อัพเดทข้อมูลหลัง Save
|
||||
async function fetchSaveCopyOrder() {
|
||||
let list: requestSendNoti[] = [];
|
||||
rows.value.map((r: DataCopyOrder) => {
|
||||
rowsMain.value.map((r: DataCopyOrder) => {
|
||||
list.push({
|
||||
profileId: r.personalId,
|
||||
isSendMail: r.mutiselect.includes(1),
|
||||
|
|
@ -285,6 +281,14 @@ function updateData(row: DataCopyOrder) {
|
|||
editRows.value.push(row);
|
||||
}
|
||||
|
||||
async function onSearch() {
|
||||
rows.value = onSearchDataTable(
|
||||
filter.value,
|
||||
rowsMain.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
|
|
@ -320,9 +324,9 @@ onMounted(async () => {
|
|||
v-model="filter"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
class="q-ml-sm"
|
||||
@keydown.enter="onSearch"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -350,7 +354,6 @@ onMounted(async () => {
|
|||
:rows="rows"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter.trim()"
|
||||
row-key="idCard"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ function resetFilter() {
|
|||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ watch(props, () => {
|
|||
outlined
|
||||
dense
|
||||
class="col-12 q-mb-sm"
|
||||
debounce="300"
|
||||
label="หน้าที่"
|
||||
:rules="[(val:string) => !!val || `กรุณากรอกหน้าที่`]"
|
||||
hide-bottom-space
|
||||
|
|
@ -81,7 +80,6 @@ watch(props, () => {
|
|||
outlined
|
||||
dense
|
||||
class="col-12 q-mb-sm"
|
||||
debounce="300"
|
||||
label="มติ/คำสั่ง"
|
||||
:rules="[(val:string) => !!val || `กรุณากรอก มติ/คำสั่ง`]"
|
||||
hide-bottom-space
|
||||
|
|
|
|||
|
|
@ -201,7 +201,6 @@ watch(
|
|||
outlined
|
||||
dense
|
||||
class="col-12 q-mb-sm"
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
placeholder="ค้นหารายชื่อ"
|
||||
style="max-width: 100%"
|
||||
|
|
|
|||
|
|
@ -201,7 +201,6 @@ watch(
|
|||
outlined
|
||||
dense
|
||||
class="col-12 q-mb-sm"
|
||||
debounce="300"
|
||||
:model-value="filterKeyword"
|
||||
placeholder="ค้นหารายการประชุม"
|
||||
style="max-width: 100%"
|
||||
|
|
|
|||
|
|
@ -541,7 +541,6 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
|
|||
<q-input
|
||||
borderless
|
||||
dense
|
||||
debounce="300"
|
||||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -487,7 +487,6 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
|
|||
<q-input
|
||||
borderless
|
||||
dense
|
||||
debounce="300"
|
||||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
outlined
|
||||
|
|
@ -524,7 +523,6 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
|
|||
bordered
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue