ข้อมูลตำแหน่งข้าราชการ => fix bug

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-06-04 17:11:29 +07:00
parent ad63f82ebf
commit 2fc79f2c63
4 changed files with 117 additions and 103 deletions

View file

@ -181,7 +181,6 @@ function copyDetiail(data: RowDetailPositions) {
* @param data อมลตำแหน
*/
function editDetiail(data: RowDetailPositions) {
console.log(data);
formPositionSelect.positionId = data.id;
formPositionSelect.posTypeId = data.posTypeId;
formPositionSelect.positionName = data.positionName;

View file

@ -162,6 +162,8 @@ onMounted(async () => {
function closeDialog() {
dialog.value = false;
posTypeName.value = "";
posTypeRank.value = null;
}
function onclickDetail(id: string) {
@ -322,6 +324,7 @@ async function onSubmit() {
borderless
:rules="[(val) => val.length > 0 || 'กรุณากรอกประเภทตำแหน่ง']"
hide-bottom-space
class="inputgreen"
/>
</div>
<div class="col-12 q-ma-md">
@ -337,6 +340,7 @@ async function onSubmit() {
:rules="[(val) => val != undefined || 'กรุณากรอกระดับตำแหน่ง']"
hide-bottom-space
mask="############"
class="inputgreen"
/>
</div>
</q-card-section>

View file

@ -374,102 +374,106 @@ onMounted(async () => {
</q-tr>
</template>
</d-table>
<q-dialog v-model="dialog" class="dialog" persistent>
<q-card style="width: 350px">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:close="closeDialog"
/>
</q-card-section>
<q-separator color="grey-4" />
<q-card-section class="row q-gutter-y-md">
<div class="col-12">
<q-input
outlined
ref="posLevelNameRef"
v-model="posLevelName"
label="ชื่อระดับตำแหน่ง"
dense
lazy-rules
borderless
bg-color="white"
hide-bottom-space
:rules="[(val) => val.length > 0 || 'กรุณากรอกระดับตำแหน่ง']"
/>
</div>
<div class="col-12">
<q-input
ref="posLevelRankRef"
outlined
v-model="posLevelRank"
label="ระดับ"
dense
lazy-rules
borderless
min="1"
bg-color="white"
:rules="[(val) => val > 0 || 'กรุณากรอกระดับ']"
hide-bottom-space
mask="############"
/>
</div>
<div class="col-12">
<q-select
ref="posLevelAuthorityRef"
outlined
v-model="posLevelAuthority"
emit-value
map-options
:options="storeOption.posLevelAuthorityOption"
option-value="id"
label="ผู้มีอำนาจสั่งบรรจุ"
dense
lazy-rules
:rules="[(val) => !!val || 'กรุณาเลือกผู้มีอำนาจสั่งบรรจุ']"
borderless
bg-color="white"
hide-bottom-space
/>
</div>
<div class="col-12">
<q-select
ref="posTypeIdRef"
v-model="posName"
label="ประเภทตำแหน่ง"
outlined
dense
bg-color="white"
options-cover
hide-bottom-space
readonly
/>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</div>
<q-dialog v-model="dialog" class="dialog" persistent>
<q-card style="width: 350px">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:close="closeDialog"
/>
</q-card-section>
<q-separator color="grey-4" />
<q-card-section class="row q-gutter-y-md">
<div class="col-12">
<q-input
outlined
ref="posLevelNameRef"
v-model="posLevelName"
label="ชื่อระดับตำแหน่ง"
dense
lazy-rules
borderless
bg-color="white"
hide-bottom-space
:rules="[(val) => val.length > 0 || 'กรุณากรอกระดับตำแหน่ง']"
class="inputgreen"
/>
</div>
<div class="col-12">
<q-input
ref="posLevelRankRef"
outlined
v-model="posLevelRank"
label="ระดับ"
dense
lazy-rules
borderless
min="1"
bg-color="white"
:rules="[(val) => val > 0 || 'กรุณากรอกระดับ']"
hide-bottom-space
mask="############"
class="inputgreen"
/>
</div>
<div class="col-12">
<q-select
ref="posLevelAuthorityRef"
outlined
v-model="posLevelAuthority"
emit-value
map-options
:options="storeOption.posLevelAuthorityOption"
option-value="id"
label="ผู้มีอำนาจสั่งบรรจุ"
dense
lazy-rules
:rules="[(val) => !!val || 'กรุณาเลือกผู้มีอำนาจสั่งบรรจุ']"
borderless
bg-color="white"
hide-bottom-space
class="inputgreen"
/>
</div>
<div class="col-12">
<q-select
ref="posTypeIdRef"
v-model="posName"
label="ประเภทตำแหน่ง"
outlined
dense
bg-color="white"
options-cover
hide-bottom-space
readonly
class="inputgreen"
/>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</template>
<style scoped lang="scss">

View file

@ -39,7 +39,7 @@ const props = defineProps({
const { dialogConfirm, showLoader, success, hideLoader, messageError } =
useCounterMixin();
const isReadonly = ref<boolean>(false); //
const isReadonly = ref<boolean>(true); //
const modal = defineModel<boolean>("addPosition", { required: true });
const formData = defineModel<any>("formData", { required: true });
const editCheck = defineModel<boolean>("editCheck", { required: true });
@ -85,8 +85,6 @@ function validateFormPositionEdit() {
/** ฟังชั่น บันทึก */
function saveSelectEdit() {
console.log(formPositionSelect.positionExecutive);
console.log(formPositionSelect.positionArea);
dialogConfirm(
$q,
async () => {
@ -197,7 +195,9 @@ async function fetchType() {
messageError($q, err);
})
.finally(() => {
hideLoader();
setTimeout(() => {
hideLoader();
}, 1000);
});
}
@ -217,7 +217,9 @@ async function fetchExecutive() {
messageError($q, err);
})
.finally(() => {
hideLoader();
setTimeout(() => {
hideLoader();
}, 1000);
});
}
@ -227,7 +229,7 @@ watch(
if (modal.value == true) {
fetchType();
fetchExecutive();
if (formData.value) {
if (editCheck.value) {
const dataList = formData.value;
setTimeout(() => {
updateSelectType(dataList.posTypeId);
@ -259,6 +261,7 @@ function updateSelectType(val: string) {
function close() {
modal.value = false;
editCheck.value = false;
clearFormPositionSelect();
}
</script>
@ -386,7 +389,11 @@ function close() {
</div>
<div class="col-6 self-center">
<q-checkbox size="md" v-model="isSpecial" label="เฉพาะสายงานที่กำหนด" />
<q-checkbox
size="md"
v-model="isSpecial"
label="เฉพาะสายงานที่กำหนด"
/>
</div>
</div>
</q-card-section>