props type

This commit is contained in:
STW_TTTY\stwtt 2024-05-17 17:20:50 +07:00
parent e66a5f8258
commit 30befa38c2
6 changed files with 44 additions and 15 deletions

View file

@ -21,6 +21,7 @@ const { messageError, findOrgName } = useCounterMixin();
/** propsDataProfile*/ /** propsDataProfile*/
const props = defineProps({ const props = defineProps({
data: { type: Object, required: true }, data: { type: Object, required: true },
type: { type: String, default: "" },
}); });
const profile = reactive<FormProfile>({ const profile = reactive<FormProfile>({
@ -110,7 +111,7 @@ watch(
</div> </div>
<div class="col-xs-6 col-sm-3 row items-center"> <div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12 q-pl-md"> <div class="col-12 q-pl-md">
<div class="col-12 text-top">ตำแหนงในสายงาน</div> <div class="col-12 text-top">{{ props.type == 'employee' ? 'ตำแหน่ง':'ตำแหน่งในสายงาน'}}</div>
<div class="col-12 text-detail"> <div class="col-12 text-detail">
{{ profile.position }} {{ profile.position }}
</div> </div>
@ -118,7 +119,7 @@ watch(
</div> </div>
<div class="col-xs-6 col-sm-3 row items-center"> <div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12"> <div class="col-12">
<div class="col-12 text-top">ประเภทตำแหน</div> <div class="col-12 text-top">{{ props.type == 'employee' ? 'กลุ่มงาน':'ประเภทตำแหน่ง'}}</div>
<div class="col-12 text-detail"> <div class="col-12 text-detail">
{{ profile.positionLevel }} {{ profile.positionLevel }}
</div> </div>
@ -140,6 +141,7 @@ watch(
:modal="modalPersonal" :modal="modalPersonal"
:id="profile.id" :id="profile.id"
@update:modal="updatemodalPersonal" @update:modal="updatemodalPersonal"
:type="props.type"
/> />
</template> </template>

View file

@ -39,7 +39,7 @@ const {
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const title = defineModel<string>("title", { required: true }); const title = defineModel<string>("title", { required: true });
const type = defineModel<any>("type", { required: true });
const posType = defineModel<any>("posType", { required: true }); const posType = defineModel<any>("posType", { required: true });
const posLevel = defineModel<any>("posLevel", { required: true }); const posLevel = defineModel<any>("posLevel", { required: true });
const position = defineModel<any>("position", { required: true }); const position = defineModel<any>("position", { required: true });
@ -214,7 +214,7 @@ function close() {
filter.value = ""; filter.value = "";
isAll.value = false; isAll.value = false;
isBlank.value = false; isBlank.value = false;
type.value = null;
nodes.value = []; nodes.value = [];
expanded.value = []; expanded.value = [];
nodeLevel.value = 0; nodeLevel.value = 0;
@ -232,7 +232,7 @@ async function getDataTable(id: string, level: number = 0) {
posType: position.value ? position.value : "", posType: position.value ? position.value : "",
isAll: isAll.value, isAll: isAll.value,
isBlank: isBlank.value, isBlank: isBlank.value,
typeCommand: null, typeCommand: type.value,
}; };
await http await http
@ -481,6 +481,7 @@ function onSubmit() {
posLevelName: selectedPos.value[0].posLevelName, // posLevelName: selectedPos.value[0].posLevelName, //
reportingDate: datePos.value, reportingDate: datePos.value,
posmasterId: dataPosMaster.id, posmasterId: dataPosMaster.id,
typeCommand: type.value,
}; };
props.onSubmit?.(body); props.onSubmit?.(body);
}); });

View file

@ -29,6 +29,7 @@ const props = defineProps({
type: Boolean, type: Boolean,
requier: true, requier: true,
}, },
type: { type: String, default: "" },
}); });
/** emit*/ /** emit*/
@ -394,7 +395,7 @@ async function fetchProfile(id: string) {
label="ระดับ" label="ระดับ"
/> />
</div> </div>
<div class="col-xs-6 col-md-6"> <div class="col-xs-6 col-md-6" v-if="props.type !== 'employee'">
<q-input <q-input
borderless borderless
readonly readonly
@ -402,7 +403,7 @@ async function fetchProfile(id: string) {
label="ตำแหน่งทางการบริหาร" label="ตำแหน่งทางการบริหาร"
/> />
</div> </div>
<div class="col-xs-6 col-md-6"> <div class="col-xs-6 col-md-6" v-if="props.type !== 'employee'">
<q-input <q-input
borderless borderless
readonly readonly

View file

@ -181,7 +181,11 @@ onMounted(async () => {
/> />
รายละเอยดการปรบระดบชนงานลกจาง {{ title.fullname }} รายละเอยดการปรบระดบชนงานลกจาง {{ title.fullname }}
</div> </div>
<CardProfile :data="dataProfile as DataProfile" />
<CardProfile
:data="dataProfile as DataProfile"
:type="'employee'"
/>
<q-card bordered class="row col-12 text-dark q-mt-sm"> <q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"> <div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">

View file

@ -157,7 +157,7 @@ watchEffect(() => {
<div class="row justify-between"> <div class="row justify-between">
<div class="col-5"> <div class="col-5">
<q-toolbar style="padding: 0"> <q-toolbar style="padding: 0">
<q-select <!-- <q-select
outlined outlined
dense dense
:model-value="type" :model-value="type"
@ -169,7 +169,7 @@ watchEffect(() => {
map-options map-options
option-label="name" option-label="name"
option-value="id" option-value="id"
/> /> -->
</q-toolbar> </q-toolbar>
</div> </div>
<div class="col-5"> <div class="col-5">

View file

@ -19,6 +19,7 @@ import config from "@/app.config";
import DialogOrgSelectEmployee from "@/components/Dialogs/DialogOrgSelectEmployee.vue"; import DialogOrgSelectEmployee from "@/components/Dialogs/DialogOrgSelectEmployee.vue";
const typeModal = ref<string>("");
const posType = ref<string>(""); const posType = ref<string>("");
const posLevel = ref<string>(""); const posLevel = ref<string>("");
const position = ref<string>(""); const position = ref<string>("");
@ -437,7 +438,7 @@ const clickClose = () => {
const popup = () => { const popup = () => {
modal.value = true; modal.value = true;
filterKeyword2.value = ""; filterKeyword2.value = "";
fecthTypeOption(); // fecthTypeOption();
}; };
const checkSave = () => { const checkSave = () => {
@ -487,9 +488,9 @@ const savePosition = async () => {
function openModalTree(data:any){ function openModalTree(data:any,type:string){
modalTree.value = true modalTree.value = true
typeModal.value = type;
personalId.value = data.id; personalId.value = data.id;
dataRows.value = data; dataRows.value = data;
posType.value = data.posTypeId; posType.value = data.posTypeId;
@ -513,6 +514,7 @@ function onSave(data: any) {
posLevelName: data.posLevelName, posLevelName: data.posLevelName,
reportingDate: data.reportingDate, reportingDate: data.reportingDate,
posmasterId: data.posmasterId, posmasterId: data.posmasterId,
typeCommand: data.typeCommand,
}; };
showLoader(); showLoader();
@ -709,7 +711,7 @@ function onSave(data: any) {
<q-item <q-item
clickable clickable
v-close-popup v-close-popup
@click="openModalTree(props.row)" @click="openModalTree(props.row,'SLIP')"
> >
<q-item-section <q-item-section
style="min-width: 0px" style="min-width: 0px"
@ -722,7 +724,25 @@ function onSave(data: any) {
name="mdi-bookmark-outline" name="mdi-bookmark-outline"
/> />
</q-item-section> </q-item-section>
<q-item-section>หนวยงานทบการปรบระดบชนงาน</q-item-section> <q-item-section>เลอกหนวยงานทบปรบระดบชนงาน</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@click="openModalTree(props.row,'MOVE')"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
color="primary"
size="xs"
name="mdi-bookmark-outline"
/>
</q-item-section>
<q-item-section>เลอกหนวยงานทบยาย</q-item-section>
</q-item> </q-item>
<q-item <q-item
clickable clickable
@ -850,6 +870,7 @@ function onSave(data: any) {
<DialogOrgSelectEmployee <DialogOrgSelectEmployee
:title="`เลือกหน่วยงานที่รับการปรับระดับชั้นงาน`" :title="`เลือกหน่วยงานที่รับการปรับระดับชั้นงาน`"
v-model:modal="modalTree" v-model:modal="modalTree"
v-model:type="typeModal"
:posType="posType" :posType="posType"
:posLevel="posLevel" :posLevel="posLevel"
:position="position" :position="position"