feat(position-employee): copy position-employee

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-19 10:44:52 +07:00
parent 18a5eecbb1
commit e97c1a97f7
3 changed files with 32 additions and 14 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, reactive, watch } from "vue";
import { ref, reactive, watch, computed } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
@ -63,6 +63,16 @@ const props = defineProps({
positionHolderInfo: { type: Object, default: () => ({}) },
});
const titlePopup = computed(() => {
return props.actionType === "ADD"
? "เพิ่มอัตรากำลัง"
: props.actionType === "EDIT"
? "แก้ไขอัตรากำลัง"
: props.actionType === "COPY"
? "คัดลอกอัตรากำลัง"
: "";
});
const isReadonly = ref<boolean>(false); //
const isEdit = ref<boolean>(false); //
const modalAdd = ref<boolean>(false); //
@ -582,12 +592,7 @@ watch(
<template>
<q-dialog v-model="props.modal" persistent>
<q-card style="min-width: 80vw">
<DialogHeader
:tittle="
props.actionType === 'ADD' ? 'เพิ่มอัตรากำลัง' : 'แก้ไขอัตรากำลัง'
"
:close="close"
/>
<DialogHeader :tittle="titlePopup" :close="close" />
<q-separator />
<q-form greedy @submit.prevent @validation-success="onSubmit">
<q-card-section class="q-pa-sm fixed-height">

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, reactive, watch } from "vue";
import { ref, reactive, watch, computed } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
@ -49,6 +49,16 @@ const props = defineProps({
shortName: { type: String, required: true },
});
const titlePopup = computed(() => {
return props.actionType === "ADD"
? "เพิ่มอัตรากำลัง"
: props.actionType === "EDIT"
? "แก้ไขอัตรากำลัง"
: props.actionType === "COPY"
? "คัดลอกอัตรากำลัง"
: "";
});
const modalAdd = ref<boolean>(false); //
const isEdit = ref<boolean>(false); //
const isReadonly = ref<boolean>(false); //
@ -349,12 +359,7 @@ watch(
<template>
<q-dialog v-model="props.modal" persistent>
<q-card style="min-width: 80vw">
<DialogHeader
:tittle="
props.actionType === 'ADD' ? 'เพิ่มอัตรากำลัง' : 'แก้ไขอัตรากำลัง'
"
:close="close"
/>
<DialogHeader :tittle="titlePopup" :close="close" />
<q-separator />
<q-form greedy @submit.prevent @validation-success="onSubmit">
<q-card-section class="q-pa-sm fixed-height">

View file

@ -101,6 +101,12 @@ const listMenu = ref<ListMenu[]>([
type: "EDIT",
color: "edit",
},
{
label: "คัดลอก",
icon: "content_copy",
type: "COPY",
color: "blue-6",
},
{
label: "ลบ",
icon: "delete",
@ -585,6 +591,8 @@ watch(
? onClickHistoryPos(props.row.id)
: item.type === 'INHERIT'
? onClickInherit(props.row.id)
: item.type === 'COPY'
? onClickPosition('COPY', props.row.id)
: null
"
>