no message
This commit is contained in:
parent
1234856f80
commit
2bd70c109c
1 changed files with 36 additions and 11 deletions
|
|
@ -2,13 +2,14 @@
|
|||
import { onMounted, ref, watch } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, dialogConfirm } = mixin;
|
||||
const $q = useQuasar();
|
||||
|
||||
const modalNote = ref<boolean>(false);
|
||||
const organization = ref<string>(1);
|
||||
const organization = ref<number>(1);
|
||||
const organizationOptions = ref<any>([{ id: 1, name: "ทั้งหมด" }]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
|
|
@ -182,15 +183,24 @@ const rows = ref<any[]>([
|
|||
]);
|
||||
|
||||
const Note = ref<string>("");
|
||||
const titleModal = ref<string>("");
|
||||
const actionModal = ref<string>("");
|
||||
const person = ref<any>([]);
|
||||
|
||||
const clickNote = (props: any) => {
|
||||
const clickAction = (props: any, action: string) => {
|
||||
Note.value = "";
|
||||
person.value = props;
|
||||
titleModal.value = props.name;
|
||||
actionModal.value = action;
|
||||
modalNote.value = true;
|
||||
};
|
||||
const clickDelete = () => {
|
||||
dialogRemove($q);
|
||||
console.log(person.value, Note.value);
|
||||
};
|
||||
const clickSavenote = () => {
|
||||
dialogConfirm($q);
|
||||
console.log(person.value);
|
||||
};
|
||||
|
||||
const filterKeyword = ref<string>("");
|
||||
|
|
@ -348,40 +358,40 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
dense
|
||||
>
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-list dense style="min-width: 100px">
|
||||
<q-list dense style="min-width: 120px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickNote(props.row)"
|
||||
@click="clickAction(props.row, 'note')"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-tooltip>หมายเหตุ</q-tooltip>
|
||||
<q-tooltip>ไม่ยื่นขอ</q-tooltip>
|
||||
<q-icon
|
||||
color="blue"
|
||||
size="xs"
|
||||
name="mdi-alert-circle-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>หมายเหตุ</q-item-section>
|
||||
<q-item-section>ไม่ยื่นขอ</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickDelete(props.row)"
|
||||
@click="clickAction(props.row, 'delete')"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-tooltip>ลบออก</q-tooltip>
|
||||
<q-icon color="red" size="xs" name="mdi-delete" />
|
||||
</q-item-section>
|
||||
<q-item-section>ลบ</q-item-section>
|
||||
<q-item-section>ลบออก</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
|
|
@ -410,7 +420,8 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<q-card style="min-width: 350px">
|
||||
<q-toolbar>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold">
|
||||
หมายเหตุ
|
||||
<div v-if="actionModal == 'note'">หมายเหตุ {{ titleModal }}</div>
|
||||
<div v-if="actionModal == 'delete'">ลบออก {{ titleModal }}</div>
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
|
|
@ -430,10 +441,24 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
label="กรอกหมายเหตุ"
|
||||
v-model="Note"
|
||||
@keyup.enter="modalNote = false"
|
||||
:rules="[(val) => !!val || 'กรอกหมายเหตุ']"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn label="บันทึก" @click="clickSavenote" color="public" />
|
||||
<q-btn
|
||||
v-if="actionModal == 'note'"
|
||||
label="บันทึก"
|
||||
@click="clickSavenote"
|
||||
color="public"
|
||||
:disable="Note === ''"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="actionModal == 'delete'"
|
||||
label="บันทึก"
|
||||
@click="clickDelete"
|
||||
color="public"
|
||||
:disable="Note === ''"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue