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*/
const props = defineProps({
data: { type: Object, required: true },
type: { type: String, default: "" },
});
const profile = reactive<FormProfile>({
@ -110,7 +111,7 @@ watch(
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<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">
{{ profile.position }}
</div>
@ -118,7 +119,7 @@ watch(
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<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">
{{ profile.positionLevel }}
</div>
@ -140,6 +141,7 @@ watch(
:modal="modalPersonal"
:id="profile.id"
@update:modal="updatemodalPersonal"
:type="props.type"
/>
</template>

View file

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

View file

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