Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m3s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m3s
This commit is contained in:
commit
c8a8321014
2 changed files with 69 additions and 4 deletions
|
|
@ -9,7 +9,7 @@ import config from "@/app.config";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { Director } from "@/modules/11_discipline/interface/request/Disciplinary";
|
import type { Director } from "@/modules/11_discipline/interface/request/disciplinary";
|
||||||
import type { Directors } from "@/modules/12_evaluatePersonal/interface/response/Main";
|
import type { Directors } from "@/modules/12_evaluatePersonal/interface/response/Main";
|
||||||
|
|
||||||
/** importComponents*/
|
/** importComponents*/
|
||||||
|
|
@ -20,7 +20,14 @@ import DialogDuty from "@/modules/12_evaluatePersonal/components/Detail/viewTab2
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin;
|
const {
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
dialogConfirm,
|
||||||
|
success,
|
||||||
|
dialogRemove,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -201,6 +208,21 @@ function onEditDuty(data: Director) {
|
||||||
modalDuty.value = true;
|
modalDuty.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDelete(id: string) {
|
||||||
|
dialogRemove($q, async () => {
|
||||||
|
showLoader();
|
||||||
|
try {
|
||||||
|
await http.delete(config.API.evaluationMain() + `/del-director/${id}`);
|
||||||
|
await props.fetchData();
|
||||||
|
await success($q, "ลบสำเร็จ");
|
||||||
|
} catch (error) {
|
||||||
|
messageError($q, error);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ทำงานเมื่อ props.data มีการเปลี่ยนแปลง
|
* ทำงานเมื่อ props.data มีการเปลี่ยนแปลง
|
||||||
*/
|
*/
|
||||||
|
|
@ -268,17 +290,30 @@ watch(
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-td>
|
<q-td auto-width>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsUpdate"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
denes
|
dense
|
||||||
icon="edit"
|
icon="edit"
|
||||||
color="edit"
|
color="edit"
|
||||||
@click.stop.prevent="onEditDuty(props.row)"
|
@click.stop.prevent="onEditDuty(props.row)"
|
||||||
>
|
>
|
||||||
<q-tooltip>แก้ไขหน้าที่</q-tooltip>
|
<q-tooltip>แก้ไขหน้าที่</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsDelete"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="delete"
|
||||||
|
color="red"
|
||||||
|
@click="handleDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบ</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ const {
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
success,
|
success,
|
||||||
|
dialogRemove,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/** props*/
|
/** props*/
|
||||||
|
|
@ -208,6 +209,21 @@ async function getList() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDelete(meetingId: string) {
|
||||||
|
dialogRemove($q, async () => {
|
||||||
|
showLoader();
|
||||||
|
try {
|
||||||
|
await http.delete(config.API.evaluationMain() + `/del-meeting/${id.value}/${meetingId}`);
|
||||||
|
await props.fetchData();
|
||||||
|
await success($q, "ลบสำเร็จ");
|
||||||
|
} catch (error) {
|
||||||
|
messageError($q, error);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.data,
|
() => props.data,
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -265,6 +281,7 @@ watch(
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
<q-th auto-width />
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
|
|
@ -272,6 +289,19 @@ watch(
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
<q-th auto-width>
|
||||||
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsUpdate"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="delete"
|
||||||
|
color="red"
|
||||||
|
@click="handleDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบ</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</q-th>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue