feat: Assign Command

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-03-11 16:37:32 +07:00
parent 6252f4a6ca
commit fd05f8c73e
4 changed files with 366 additions and 0 deletions

View file

@ -12,6 +12,7 @@ import config from "@/app.config";
import type { Pagination } from "@/modules/18_command/interface/index/Main";
import DialogFormCommand from "@/modules/18_command/components/Main/DialogFormCommand.vue";
import DialogAssign from "@/modules/18_command/components/DialogAssign.vue";
const $q = useQuasar();
const router = useRouter();
@ -36,6 +37,7 @@ const props = defineProps({
const modalCopy = ref<boolean>(false);
const isCheckPageSize = ref<boolean>(false);
const commandId = ref<string>("");
const modalAssign = ref<boolean>(false);
async function fetchListCommand() {
await props.fetchList?.();
@ -96,6 +98,7 @@ function onReCommand(id: string) {
"ต้องการยืนยืนยันการดึงไปทำคำสั่งใหม่ใช่หรือไม่ ?"
);
}
function onDeleteCommand(id: string) {
dialogRemove(
$q,
@ -120,6 +123,11 @@ function onDeleteCommand(id: string) {
);
}
function onAssignCommand(id: string) {
commandId.value = id;
modalAssign.value = true;
}
onMounted(() => {
!isCheckPageSize.value && fetchListCommand();
});
@ -240,6 +248,25 @@ onMounted(() => {
</q-item-section>
</q-item>
<!-- หมอบหมายคำส -->
<q-item
clickable
v-close-popup
v-if="checkPermission($route)?.attrOwnership === 'OWNER'"
@click.prevent="onAssignCommand(props.row.id)"
>
<q-item-section>
<div class="row items-center">
<q-icon
color="green-6"
size="xs"
name="mdi-account-check"
/>
<div class="q-pl-md">หมอบหมายคำส</div>
</div>
</q-item-section>
</q-item>
<!-- ยกเล ไมแสดง Tabs ยกเล -->
<q-item
v-if="
@ -317,6 +344,8 @@ onMounted(() => {
:is-copy="true"
:command-id="commandId"
/>
<DialogAssign v-model:modal="modalAssign" :command-id="commandId" :fetch-list-command="fetchListCommand" />
</template>
<style scoped></style>