Merge branch 'develop' into dev

* develop:
  fix ข้อความ
  fix(command): disable button delete
This commit is contained in:
Warunee Tamkoo 2026-03-13 16:19:04 +07:00
commit 5ad9010654
2 changed files with 11 additions and 7 deletions

View file

@ -248,7 +248,7 @@ onMounted(() => {
</q-item-section> </q-item-section>
</q-item> </q-item>
<!-- มอบหมายคำส --> <!-- มอบหมายคำส -->
<q-item <q-item
clickable clickable
v-close-popup v-close-popup
@ -262,7 +262,7 @@ onMounted(() => {
size="xs" size="xs"
name="mdi-account-check" name="mdi-account-check"
/> />
<div class="q-pl-md">มอบหมายคำส</div> <div class="q-pl-md">มอบหมายคำส</div>
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>

View file

@ -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>