Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m0s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m0s
This commit is contained in:
commit
d7ea297e61
1 changed files with 9 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref, computed } from "vue";
|
||||||
import { useQuasar, type QTableProps } from "quasar";
|
import { useQuasar, type QTableProps } from "quasar";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
|
@ -37,6 +37,12 @@ const props = defineProps({
|
||||||
formCommandList: { type: Object, required: true },
|
formCommandList: { type: Object, required: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isCanDelete = computed(
|
||||||
|
() => (role: string) =>
|
||||||
|
rows.value.filter((row) => row.roleName === "เจ้าหน้าที่ดำเนินการ")
|
||||||
|
.length === 1 && role === "เจ้าหน้าที่ดำเนินการ"
|
||||||
|
); //เช็คสามารถลบรายชื่อผู้ลงนามในแนบท้ายคำสั่ง ได้หรือไม่
|
||||||
|
|
||||||
const commandId = ref<string>(route.params.id.toString()); //ID คำสั่ง
|
const commandId = ref<string>(route.params.id.toString()); //ID คำสั่ง
|
||||||
const commandCode = ref<string>(""); //รหัสคำสั่ง
|
const commandCode = ref<string>(""); //รหัสคำสั่ง
|
||||||
const createdUserId = ref<string>(""); //ID ผู้สร้างคำสั่ง
|
const createdUserId = ref<string>(""); //ID ผู้สร้างคำสั่ง
|
||||||
|
|
@ -597,14 +603,12 @@ onMounted(async () => {
|
||||||
<q-btn
|
<q-btn
|
||||||
icon="mdi-delete"
|
icon="mdi-delete"
|
||||||
:color="
|
:color="
|
||||||
props.row.roleName === 'เจ้าหน้าที่ดำเนินการ'
|
isCanDelete(props.row.roleName) ? 'grey' : 'red'
|
||||||
? 'grey'
|
|
||||||
: 'red'
|
|
||||||
"
|
"
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
round
|
round
|
||||||
:disable="props.row.roleName === 'เจ้าหน้าที่ดำเนินการ'"
|
:disable="isCanDelete(props.row.roleName)"
|
||||||
@click.prevent.stop="onDeleteData(props.row.id)"
|
@click.prevent.stop="onDeleteData(props.row.id)"
|
||||||
>
|
>
|
||||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue