สิทธ์ ออกคำสั่งลงโทษทางวินัย

This commit is contained in:
STW_TTTY\stwtt 2024-08-08 18:09:38 +07:00
parent 37f0ecbc1e
commit a7bd09d0f1
12 changed files with 240 additions and 83 deletions

View file

@ -254,9 +254,9 @@ onMounted(() => {
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
@click="openModalOrder"
size="14px"
flat
round
dense
color="add"
icon="mdi-account-arrow-right"
>
@ -326,7 +326,7 @@ onMounted(() => {
</template>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width v-if="checkPermission($route)?.attrIsGet !== false || checkPermission($route)?.attrIsUpdate !== false"/>
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
@ -335,14 +335,14 @@ onMounted(() => {
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td auto-width v-if="checkPermission($route)?.attrIsGet !== false || checkPermission($route)?.attrIsUpdate !== false">
<q-td auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
@click="
router.push(`/discipline-suspend-detail/${props.row.id}`)
"
size="14px"
flat
dense
round
color="info"
icon="mdi-eye"
@ -350,10 +350,13 @@ onMounted(() => {
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet
"
@click="router.push(`/discipline-suspend/${props.row.id}`)"
size="14px"
flat
dense
round
color="edit"
icon="edit"

View file

@ -462,7 +462,6 @@ onMounted(() => {
นอทธรณ/องทกข
<q-btn
v-if="!isReadonly"
size="12px"
flat
round
dense
@ -697,7 +696,6 @@ onMounted(() => {
<q-item-section>{{ data.fileName }}</q-item-section>
<q-space />
<q-btn
size="12px"
flat
round
dense
@ -708,13 +706,12 @@ onMounted(() => {
>
<q-btn
v-if="!checkRoutePermission"
size="12px"
flat
round
dense
color="red"
class="q-ml-sm"
icon="mdi-delete-outline"
icon="mdi-delete"
@click="deleteFile(data.id)"
><q-tooltip>ลบไฟล</q-tooltip></q-btn
>

View file

@ -318,7 +318,7 @@ onMounted(async () => {
v-if="checkPermission($route)?.attrIsCreate"
id="addComplaints"
for="addComplaints"
size="12px"
dense
flat
round
color="primary"
@ -515,13 +515,7 @@ onMounted(async () => {
</template>
<template v-slot:header="props">
<q-tr :props="props">
<q-th
auto-width
v-if="
checkPermission($route)?.attrIsGet !== false ||
checkPermission($route)?.attrIsUpdate !== false
"
></q-th>
<q-th auto-width></q-th>
<q-th
v-for="col in props.cols"
:key="col.name"
@ -533,19 +527,13 @@ onMounted(async () => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td
auto-width
v-if="
checkPermission($route)?.attrIsGet !== false ||
checkPermission($route)?.attrIsUpdate !== false
"
>
<q-tr :props="props">
<q-td auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
id="addComplaints"
for="addComplaints"
size="12px"
dense
flat
round
color="info"
@ -554,11 +542,14 @@ onMounted(async () => {
><q-tooltip>รายละเอยดการอทธรณ/องทกข</q-tooltip></q-btn
>
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet
"
id="addComplaints"
for="addComplaints"
size="12px"
flat
dense
round
color="edit"
icon="edit"

View file

@ -20,6 +20,8 @@ import { useOrderStore } from "@/modules/11_discipline/store/OrderStore";
import { useCounterMixin } from "@/stores/mixin";
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
import { checkPermission } from "@/utils/permissions";
const $q = useQuasar(); // noti quasar
const mixin = useCounterMixin();
const DataStore = useOrderPlacementDataStore();
@ -327,6 +329,7 @@ onMounted(async () => {
<!-- use-input -->
<div>
<q-btn
v-if="checkPermission($route)?.attrIsCreate"
size="12px"
flat
round

View file

@ -5,7 +5,7 @@ import router from "@/router";
import type { QTableProps } from "quasar";
/** importStroe */
import { useOrderStore } from "@/modules/11_discipline/store/OrderStore";
import { checkPermission } from "@/utils/permissions";
const OrderStore = useOrderStore();
/** รับ props มาจากหน้าหลัก */
@ -208,6 +208,29 @@ const redirectToPage = (id?: string, status?: string) => {
}
router.push(`/discipline-order/detail/${id}?step=${step}`);
};
/**
* งช redirect
* @param id id ออกคำส
* @param status status
*/
const redirectToDetailPage = (id?: string, status?: string) => {
let step = 1;
switch (status) {
case "จัดทำร่างคำสั่ง":
step = 1;
break;
case "บัญชีแนบท้าย":
step = 2;
break;
case "เลือกผู้ได้รับสำเนาคำสั่ง":
step = 3;
break;
default:
step = 4;
break;
}
router.push(`/discipline-order-detail/detail/${id}?step=${step}`);
};
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(() => {
@ -233,19 +256,46 @@ onMounted(() => {
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width></q-th>
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
@click="redirectToPage(props.row.orderId, props.row.orderStatusName)"
>
<q-tr :props="props">
<q-td>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
flat
round
dense
icon="mdi-eye"
color="info"
@click="
redirectToDetailPage(props.row.orderId, props.row.orderStatusName)
"
>
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
<q-btn
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
flat
round
dense
icon="edit"
color="edit"
@click="
redirectToPage(props.row.orderId, props.row.orderStatusName)
"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>