hide bottom space rule

This commit is contained in:
Kittapath 2023-03-28 13:22:07 +07:00
parent 3c12d849f6
commit a95c2fcbb4
10 changed files with 469 additions and 494 deletions

View file

@ -64,7 +64,6 @@
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -79,7 +78,6 @@
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -94,7 +92,6 @@
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -127,7 +124,6 @@
<q-input
:class="getClass(edit)"
class="datepicker"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -145,7 +141,6 @@
<div class="col-xs-12 col-sm-12 col-md-12">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -177,11 +172,11 @@
</q-form>
</q-card>
</q-dialog>
<q-dialog :model-value="modalConsend" persistent>
<!-- <q-dialog :model-value="modalConsend" persistent>
<q-card style="min-width: 800px">
<Conference :ok="consendOk" :close="consenClose" />
</q-card>
</q-dialog>
</q-dialog> -->
</template>
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue'
@ -230,7 +225,7 @@ const salary = ref<number | null>()
const duration = ref<[Date, Date]>([new Date(), new Date()])
const reason = ref<string>()
const myForm = ref<any>() //form data input
const edit = ref<boolean>(false) // dialog
const edit = ref<boolean>(true) // dialog
const modal = ref<boolean>(false) //modal add detail
const modalEdit = ref<boolean>(false) //modal
const rawItem = ref<RequestItemsObject>() // row
@ -240,7 +235,7 @@ const next = ref<boolean>() //แสดงปุ่มดูข้อมูล
const editRow = ref<boolean>(false) //
const statusCode = ref<number>()
const checkValidate = ref<boolean>(false) //validate data
const modalConsend = ref<boolean>(false)
// const modalConsend = ref<boolean>(false)
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
const rows = ref<RequestItemsObject[]>([])
const filter = ref<string>('') //search data table
@ -387,7 +382,7 @@ const checkRowPage = () => {
* กดปมแกไขใน dialog
*/
const clickEdit = () => {
edit.value = true
// edit.value = true
next.value = false
previous.value = false
}
@ -424,11 +419,11 @@ const clickDeleteRow = async () => {
.finally(async () => {
loader.value = false
await fetchData()
edit.value = false
// edit.value = false
})
} else {
await fetchData()
edit.value = false
// edit.value = false
}
}
@ -438,15 +433,15 @@ const clickDeleteRow = async () => {
const clickSave = async () => {
myForm.value.validate().then(async (result: boolean) => {
if (result) {
if (store.consend == true) {
if (modalEdit.value) {
await editData()
} else {
await saveData()
}
// if (store.consend == true) {
if (modalEdit.value) {
await editData()
} else {
modalConsend.value = true
await saveData()
}
// } else {
// modalConsend.value = true
// }
}
})
}
@ -476,7 +471,7 @@ const saveData = async () => {
})
.finally(async () => {
loader.value = false
edit.value = false
// edit.value = false
modal.value = false
await fetchData()
})
@ -507,7 +502,7 @@ const editData = async () => {
})
.finally(async () => {
loader.value = false
edit.value = false
// edit.value = false
modal.value = false
await fetchData()
})
@ -548,12 +543,12 @@ const selectData = (props: DataProps) => {
duration.value = props.row.duration
reason.value = props.row.reason
id.value = props.row.id
if (edit.value == true) {
next.value = false
previous.value = false
} else {
checkRowPage()
}
// if (edit.value == true) {
next.value = false
previous.value = false
// } else {
// checkRowPage()
// }
}
/**
@ -569,21 +564,21 @@ const addRow = () => {
reason.value = ''
}
const consenClose = () => {
modalConsend.value = false
}
// const consenClose = () => {
// modalConsend.value = false
// }
const consendOk = () => {
modalConsend.value = false
store.consend = true
clickSave()
}
// const consendOk = () => {
// modalConsend.value = false
// store.consend = true
// clickSave()
// }
/**
* งกนปมยกเลกการแกไขขอม
*/
const clickCancel = async () => {
edit.value = false
// edit.value = false
}
/**

View file

@ -17,7 +17,6 @@
<div class="col-4">
<q-input
class="q-my-sm"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -100,7 +99,7 @@ const props = defineProps({
}
})
const edit = ref<boolean>(false)
const edit = ref<boolean>(true)
const name = ref<string>('')
const files = ref<any>([
{

View file

@ -61,7 +61,6 @@
<div class="col-xs-6 col-sm-6 col-md-6">
<q-select
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -81,7 +80,6 @@
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -97,7 +95,6 @@
<q-input
type="number"
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -112,7 +109,6 @@
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -144,7 +140,6 @@
<q-input
:class="getClass(edit)"
class="datepicker"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -178,11 +173,11 @@
</q-form>
</q-card>
</q-dialog>
<q-dialog :model-value="modalConsend" persistent>
<!-- <q-dialog :model-value="modalConsend" persistent>
<q-card style="min-width: 800px">
<Conference :ok="consendOk" :close="consenClose" />
</q-card>
</q-dialog>
</q-dialog> -->
</template>
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue'
@ -234,7 +229,7 @@ const scores = ref<number | null>()
const name = ref<string>()
const duration = ref<[Date, Date]>([new Date(), new Date()])
const myForm = ref<any>() //form data input
const edit = ref<boolean>(false) // dialog
const edit = ref<boolean>(true) // dialog
const modal = ref<boolean>(false) //modal add detail
const modalEdit = ref<boolean>(false) //modal
const rawItem = ref<RequestItemsObject>() // row
@ -244,7 +239,7 @@ const next = ref<boolean>() //แสดงปุ่มดูข้อมูล
const editRow = ref<boolean>(false) //
const statusCode = ref<number>()
const checkValidate = ref<boolean>(false) //validate data
const modalConsend = ref<boolean>(false)
// const modalConsend = ref<boolean>(false)
const rows = ref<RequestItemsObject[]>([])
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
const filter = ref<string>('') //search data table
@ -413,7 +408,7 @@ const checkRowPage = () => {
* กดปมแกไขใน dialog
*/
const clickEdit = () => {
edit.value = true
// edit.value = true
next.value = false
previous.value = false
}
@ -450,11 +445,11 @@ const clickDeleteRow = async () => {
.finally(async () => {
loader.value = false
await fetchData()
edit.value = false
// edit.value = false
})
} else {
await fetchData()
edit.value = false
// edit.value = false
}
}
@ -464,15 +459,15 @@ const clickDeleteRow = async () => {
const clickSave = async () => {
myForm.value.validate().then(async (result: boolean) => {
if (result) {
if (store.consend == true) {
if (modalEdit.value) {
await editData()
} else {
await saveData()
}
// if (store.consend == true) {
if (modalEdit.value) {
await editData()
} else {
modalConsend.value = true
await saveData()
}
// } else {
// modalConsend.value = true
// }
}
})
}
@ -502,7 +497,7 @@ const saveData = async () => {
})
.finally(async () => {
loader.value = false
edit.value = false
// edit.value = false
modal.value = false
await fetchData()
})
@ -533,7 +528,7 @@ const editData = async () => {
})
.finally(async () => {
loader.value = false
edit.value = false
// edit.value = false
modal.value = false
await fetchData()
})
@ -575,12 +570,12 @@ const selectData = (props: DataProps) => {
name.value = props.row.name
duration.value = props.row.duration
id.value = props.row.id
if (edit.value == true) {
next.value = false
previous.value = false
} else {
checkRowPage()
}
// if (edit.value == true) {
next.value = false
previous.value = false
// } else {
// checkRowPage()
// }
}
/**
@ -597,21 +592,21 @@ const addRow = () => {
duration.value = [new Date(), new Date()]
}
const consenClose = () => {
modalConsend.value = false
}
// const consenClose = () => {
// modalConsend.value = false
// }
const consendOk = () => {
modalConsend.value = false
store.consend = true
clickSave()
}
// const consendOk = () => {
// modalConsend.value = false
// store.consend = true
// clickSave()
// }
/**
* งกนปมยกเลกการแกไขขอม
*/
const clickCancel = async () => {
edit.value = false
// edit.value = false
}
/**

View file

@ -9,16 +9,15 @@
:addData="true"
:editOnly="false"
:cancel="cancelData"
:changeBtn="changeBtn"
:editData="status == 'register' || status == 'rejectRegister'"
:disable="statusEdit"
/>
<!-- :changeBtn="changeBtn" -->
<q-form ref="myform">
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-12">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -34,7 +33,6 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -54,7 +52,6 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -74,7 +71,6 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -95,7 +91,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
dense
lazy-rules
readonly
@ -105,7 +100,7 @@
:label="`${'รหัสไปรษณีย์'}`"
/>
</div>
<div class="col-12 q-pt-lg"><q-separator /></div>
<div class="col-12"><q-separator /></div>
<div class="col-xs-12 q-gutter-sm items-center flex q-my-sm">
<label class="text-bold">อยจจนตรงกบทอยตามทะเบยนบาน</label>
<q-radio
@ -131,7 +126,6 @@
<div class="col-xs-12" v-if="addressData.same == '0'">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -146,7 +140,6 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.same == '0'">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -166,7 +159,6 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.same == '0'">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -186,7 +178,6 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.same == '0'">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -207,7 +198,6 @@
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.same == '0'">
<q-input
:class="getClass(edit)"
hide-bottom-space
dense
lazy-rules
readonly
@ -220,11 +210,11 @@
</div>
</q-form>
</q-card>
<q-dialog :model-value="modalConsend" persistent>
<!-- <q-dialog :model-value="modalConsend" persistent>
<q-card style="min-width: 800px">
<Conference :ok="consendOk" :close="consenClose" />
</q-card>
</q-dialog>
</q-dialog> -->
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
@ -237,7 +227,7 @@ import { useExamDataStore } from '@/modules/01_exam/store'
import type { Address, DataOption } from '@/modules/01_exam/interface/index/Main'
import { defaultAddress } from '@/modules/01_exam/interface/index/Main'
import HeaderTop from '@/components/top.vue'
import Conference from '@/modules/01_exam/components/Conference.vue'
// import Conference from '@/modules/01_exam/components/Conference.vue'
const props = defineProps({
provinceOptions: {
@ -263,10 +253,10 @@ const mixin = useCounterMixin()
const store = useExamDataStore()
const { success } = mixin
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
const edit = ref<boolean>(false)
const edit = ref<boolean>(true)
const addressData = ref<Address>(defaultAddress)
const myform = ref<any>()
const modalConsend = ref<boolean>(false)
// const modalConsend = ref<boolean>(false)
const loader = ref<boolean>(false)
const districtOptions = ref<DataOption[]>([])
const districtCOptions = ref<DataOption[]>([])
@ -277,10 +267,12 @@ const emit = defineEmits(['update:statusEdit'])
onMounted(async () => {
await fetchData()
await fetchDistrict(addressData.value.provinceId, '1')
await fetchDistrict(addressData.value.provinceIdC, '2')
await fetchSubDistrict(addressData.value.districtId, '1')
await fetchSubDistrict(addressData.value.districtIdC, '2')
if (addressData.value.provinceId != null) await fetchDistrict(addressData.value.provinceId, '1')
if (addressData.value.provinceIdC != null) await fetchDistrict(addressData.value.provinceIdC, '2')
if (addressData.value.districtId != null)
await fetchSubDistrict(addressData.value.districtId, '1')
if (addressData.value.districtIdC != null)
await fetchSubDistrict(addressData.value.districtIdC, '2')
})
const fetchData = async () => {
@ -298,7 +290,7 @@ const fetchData = async () => {
addressData.value.subdistrictIdC = data.currentSubDistrictId
addressData.value.code = data.registZipCode
addressData.value.codeC = data.currentZipCode
addressData.value.same = data.registSame == true ? '1' : '0'
addressData.value.same = data.registSame == true ? '1' : data.registSame == false ? '0' : null
})
.catch(() => {})
.finally(() => {
@ -309,57 +301,57 @@ const fetchData = async () => {
const saveData = async () => {
await myform.value.validate().then(async (suc: boolean) => {
if (suc) {
if (store.consend == true) {
loader.value = true
await http
.post(config.API.candidateAddress(candidateId.value), {
registAddress: addressData.value.address,
currentAddress: addressData.value.addressC,
registProvinceId: addressData.value.provinceId,
currentProvinceId: addressData.value.provinceIdC,
registDistrictId: addressData.value.districtId,
currentDistrictId: addressData.value.districtIdC,
registSubDistrictId: addressData.value.subdistrictId,
currentSubDistrictId: addressData.value.subdistrictIdC,
registZipCode: addressData.value.code,
currentZipCode: addressData.value.codeC,
registSame:
addressData.value.same == '1' ? true : addressData.value.same == '0' ? false : null
})
.then(() => {
success($q, 'บันทึกข้อมูลที่อยู่สำเร็จ')
edit.value = false
emit('update:statusEdit', false)
})
.catch(() => {
// modalError.value = true
// modalErrorTittle.value = ''
// modalErrorDetail.value = e.response.data.message
// statusCode.value = e.response.data.status
})
.finally(async () => {
loader.value = false
await fetchData()
})
} else {
modalConsend.value = true
}
// if (store.consend == true) {
loader.value = true
await http
.post(config.API.candidateAddress(candidateId.value), {
registAddress: addressData.value.address,
currentAddress: addressData.value.addressC,
registProvinceId: addressData.value.provinceId,
currentProvinceId: addressData.value.provinceIdC,
registDistrictId: addressData.value.districtId,
currentDistrictId: addressData.value.districtIdC,
registSubDistrictId: addressData.value.subdistrictId,
currentSubDistrictId: addressData.value.subdistrictIdC,
registZipCode: addressData.value.code,
currentZipCode: addressData.value.codeC,
registSame:
addressData.value.same == '1' ? true : addressData.value.same == '0' ? false : null
})
.then(() => {
success($q, 'บันทึกข้อมูลที่อยู่สำเร็จ')
// edit.value = false
emit('update:statusEdit', false)
})
.catch(() => {
// modalError.value = true
// modalErrorTittle.value = ''
// modalErrorDetail.value = e.response.data.message
// statusCode.value = e.response.data.status
})
.finally(async () => {
loader.value = false
await fetchData()
})
// } else {
// modalConsend.value = true
// }
}
})
}
const changeBtn = async () => {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
}
} else {
emit('update:statusEdit', false)
}
}
// const changeBtn = async () => {
// if (edit.value == true) {
// if (props.statusEdit === true) {
// edit.value = false
// props.notiNoEdit()
// } else {
// emit('update:statusEdit', true)
// }
// } else {
// emit('update:statusEdit', false)
// }
// }
const selectProvince = (e: string, name: string) => {
if (name == '1') {
@ -388,7 +380,6 @@ const selectDistrict = (e: string, name: string) => {
}
const selectSubDistrict = (e: string, name: string) => {
console.log('zxc')
if (name == '1') {
const findcode = subdistrictOptions.value.filter((r) => r.id == e)
const namecode = findcode.length > 0 ? findcode[0].zipCode : null
@ -448,15 +439,15 @@ const fetchSubDistrict = async (id: string, position: string) => {
})
}
const consenClose = () => {
modalConsend.value = false
}
// const consenClose = () => {
// modalConsend.value = false
// }
const consendOk = () => {
modalConsend.value = false
store.consend = true
saveData()
}
// const consendOk = () => {
// modalConsend.value = false
// store.consend = true
// saveData()
// }
const cancelData = () => {}

View file

@ -9,10 +9,10 @@
:addData="true"
:editOnly="false"
:cancel="cancelData"
:changeBtn="changeBtn"
:editData="status == 'register' || status == 'rejectRegister'"
:disable="statusEdit"
/>
<!-- :changeBtn="changeBtn" -->
<q-form ref="myform" class="col-12">
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-12 q-gutter-sm items-center flex q-my-sm">
@ -40,7 +40,6 @@
</div>
<div class="col-xs-12 col-sm-2 col-md-2" v-if="familyData.same == '1'">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -61,7 +60,6 @@
<div class="col-xs-6 col-sm-3 col-md-3" v-if="familyData.same == '1'">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -75,7 +73,6 @@
<div class="col-xs-6 col-sm-3 col-md-3" v-if="familyData.same == '1'">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -89,7 +86,6 @@
<div class="col-xs-12 col-sm-2 col-md-2" v-if="familyData.same == '1'">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -103,7 +99,6 @@
<div class="col-xs-12 col-sm-2 col-md-2" v-if="familyData.same == '1'">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -118,7 +113,6 @@
<div class="col-xs-12 text-weight-bold"> ดา</div>
<div class="col-xs-12 col-sm-2 col-md-2">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -139,7 +133,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -153,7 +146,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -167,7 +159,6 @@
<div class="col-xs-12 col-sm-2 col-md-2">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -181,7 +172,6 @@
<div class="col-xs-12 col-sm-2 col-md-2">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -196,7 +186,6 @@
<div class="col-xs-12 text-weight-bold"> มารดา</div>
<div class="col-xs-12 col-sm-2 col-md-2">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -216,7 +205,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -230,7 +218,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -244,7 +231,6 @@
<div class="col-xs-12 col-sm-2 col-md-2">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -258,7 +244,6 @@
<div class="col-xs-12 col-sm-2 col-md-2">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -272,11 +257,11 @@
</div>
</q-form>
</q-card>
<q-dialog :model-value="modalConsend" persistent>
<!-- <q-dialog :model-value="modalConsend" persistent>
<q-card style="min-width: 800px">
<Conference :ok="consendOk" :close="consenClose" />
</q-card>
</q-dialog>
</q-dialog> -->
</template>
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue'
@ -314,10 +299,10 @@ const $q = useQuasar()
const mixin = useCounterMixin()
const store = useExamDataStore()
const { success } = mixin
const edit = ref<boolean>(false)
const edit = ref<boolean>(true)
const myform = ref<any>()
const familyData = ref<Family>(defaultFamily)
const modalConsend = ref<boolean>(false)
// const modalConsend = ref<boolean>(false)
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
const loader = ref<boolean>(false)
@ -359,61 +344,61 @@ const fetchData = async () => {
const saveData = async () => {
await myform.value.validate().then(async (suc: boolean) => {
if (suc) {
if (store.consend == true) {
loader.value = true
await http
.post(config.API.candidateFamily(candidateId.value), {
marryPrefixId: familyData.value.prefixIdC,
marryFirstName: familyData.value.firstnameC,
marryLastName: familyData.value.lastnameC,
marryOccupation: familyData.value.occupationC,
marryNationality: familyData.value.nationalityC,
fatherPrefixId: familyData.value.prefixIdM,
fatherFirstName: familyData.value.firstnameM,
fatherLastName: familyData.value.lastnameM,
fatherOccupation: familyData.value.occupationM,
fatherNationality: familyData.value.nationalityM,
motherPrefixId: familyData.value.prefixIdF,
motherFirstName: familyData.value.firstnameF,
motherLastName: familyData.value.lastnameF,
motherOccupation: familyData.value.occupationF,
motherNationality: familyData.value.nationalityF,
marry: familyData.value.same == '1' ? true : familyData.value.same == '0' ? false : null
})
.then(() => {
success($q, 'บันทึกข้อมูลครอบครัวสำเร็จ')
edit.value = false
emit('update:statusEdit', false)
})
.catch(() => {
// modalError.value = true
// modalErrorTittle.value = ''
// modalErrorDetail.value = e.response.data.message
// statusCode.value = e.response.data.status
})
.finally(async () => {
loader.value = false
await fetchData()
})
} else {
modalConsend.value = true
}
// if (store.consend == true) {
loader.value = true
await http
.post(config.API.candidateFamily(candidateId.value), {
marryPrefixId: familyData.value.prefixIdC,
marryFirstName: familyData.value.firstnameC,
marryLastName: familyData.value.lastnameC,
marryOccupation: familyData.value.occupationC,
marryNationality: familyData.value.nationalityC,
fatherPrefixId: familyData.value.prefixIdM,
fatherFirstName: familyData.value.firstnameM,
fatherLastName: familyData.value.lastnameM,
fatherOccupation: familyData.value.occupationM,
fatherNationality: familyData.value.nationalityM,
motherPrefixId: familyData.value.prefixIdF,
motherFirstName: familyData.value.firstnameF,
motherLastName: familyData.value.lastnameF,
motherOccupation: familyData.value.occupationF,
motherNationality: familyData.value.nationalityF,
marry: familyData.value.same == '1' ? true : familyData.value.same == '0' ? false : null
})
.then(() => {
success($q, 'บันทึกข้อมูลครอบครัวสำเร็จ')
// edit.value = false
emit('update:statusEdit', false)
})
.catch(() => {
// modalError.value = true
// modalErrorTittle.value = ''
// modalErrorDetail.value = e.response.data.message
// statusCode.value = e.response.data.status
})
.finally(async () => {
loader.value = false
await fetchData()
})
// } else {
// modalConsend.value = true
// }
}
})
}
const changeBtn = async () => {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
}
} else {
emit('update:statusEdit', false)
}
}
// const changeBtn = async () => {
// if (edit.value == true) {
// if (props.statusEdit === true) {
// edit.value = false
// props.notiNoEdit()
// } else {
// emit('update:statusEdit', true)
// }
// } else {
// emit('update:statusEdit', false)
// }
// }
const selectRadio = (e: boolean) => {
if (!e) {
@ -424,15 +409,15 @@ const selectRadio = (e: boolean) => {
}
}
const consenClose = () => {
modalConsend.value = false
}
// const consenClose = () => {
// modalConsend.value = false
// }
const consendOk = async () => {
modalConsend.value = false
store.consend = true
saveData()
}
// const consendOk = async () => {
// modalConsend.value = false
// store.consend = true
// saveData()
// }
const cancelData = () => {}

View file

@ -9,15 +9,14 @@
:addData="true"
:editOnly="false"
:cancel="cancelData"
:changeBtn="changeBtn"
:editData="status == 'register' || status == 'rejectRegister'"
:disable="statusEdit"
/>
<!-- :changeBtn="changeBtn" -->
<q-form ref="myform" class="col-12 row">
<div class="row col-10 items-center q-col-gutter-x-sm q-col-gutter-y-sm">
<div class="col-xs-6 col-sm-3 col-md-3">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -37,7 +36,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -51,7 +49,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -65,7 +62,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -95,13 +91,14 @@
<template #trigger>
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="date2Thai(informaData.birthDate)"
:model-value="
informaData.birthDate == null ? null : date2Thai(informaData.birthDate)
"
:rules="[(val) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]"
:label="`${'วัน/เดือน/ปี เกิด'}`"
>
@ -120,19 +117,17 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
dense
lazy-rules
readonly
borderless
:style="!edit ? '' : 'padding:0 12px;'"
:model-value="calAge(informaData.birthDate)"
:model-value="informaData.birthDate == null ? null : calAge(informaData.birthDate)"
:label="`${'อายุ'}`"
/>
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -152,7 +147,6 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -166,9 +160,9 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
counter
lazy-rules
:readonly="!edit"
:borderless="!edit"
@ -183,7 +177,6 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -204,7 +197,7 @@
<div class="col-xs-6 col-sm-3 col-md-3">
<!-- <q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -215,7 +208,6 @@
label="ออกให้ ณ อำเภอ"
/> -->
<q-select
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -252,13 +244,14 @@
<template #trigger>
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="date2Thai(informaData.cardIdDate)"
:model-value="
informaData.cardIdDate == null ? null : date2Thai(informaData.cardIdDate)
"
:rules="[(val) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี'}`]"
:label="`${'วัน/เดือน/ปี'}`"
>
@ -276,13 +269,12 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
hide-bottom-space
:outlined="edit"
dense
counter
lazy-rules
type="tel"
maxlength="12"
maxlength="10"
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -296,13 +288,12 @@
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input
hide-bottom-space
:outlined="edit"
dense
counter
lazy-rules
type="tel"
maxlength="12"
maxlength="10"
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
@ -317,7 +308,6 @@
<div class="col-xs-12 col-sm-12 col-md-12">
<q-input
:class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
@ -355,11 +345,11 @@
</div>
</q-form>
</q-card>
<q-dialog :model-value="modalConsend" persistent>
<!-- <q-dialog :model-value="modalConsend" persistent>
<q-card style="min-width: 800px">
<Conference :ok="consendOk" :close="consenClose" />
</q-card>
</q-dialog>
</q-dialog> -->
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
@ -407,12 +397,12 @@ const store = useExamDataStore()
const { date2Thai, calAge, success, dateToISO } = mixin
const districtOptions = ref<DataOption[]>([])
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
const edit = ref<boolean>(false)
const edit = ref<boolean>(true)
const informaData = ref<Information>(defaultInformation)
const myform = ref<any>()
const imageUrl = ref<string | null>(null)
const disabledPic = ref<boolean>(false)
const modalConsend = ref<boolean>(false)
// const modalConsend = ref<boolean>(false)
const fileData = ref<File | null>()
const loader = ref<boolean>(false)
@ -420,7 +410,7 @@ const emit = defineEmits(['update:statusEdit'])
onMounted(async () => {
await fetchData()
await fetchDistrict(informaData.value.provinceId)
if (informaData.value.provinceId != null) await fetchDistrict(informaData.value.provinceId)
})
const fetchData = async () => {
@ -433,8 +423,8 @@ const fetchData = async () => {
informaData.value.lastname = data.lastName
informaData.value.provinceId = data.citizenProvinceId
informaData.value.districtId = data.citizenDistrictId
informaData.value.birthDate = new Date(data.dateOfBirth)
informaData.value.cardIdDate = new Date(data.citizenDate)
informaData.value.birthDate = data.dateOfBirth == null ? null : new Date(data.dateOfBirth)
informaData.value.cardIdDate = data.citizenDate == null ? null : new Date(data.citizenDate)
informaData.value.cardid = data.citizenId
informaData.value.firstname = data.firstName
informaData.value.relationship = data.relationshipId
@ -459,59 +449,61 @@ const selectProvince = (val: string) => {
const saveData = async () => {
await myform.value.validate().then(async (suc: boolean) => {
if (suc) {
if (store.consend == true) {
loader.value = true
await http
.post(config.API.candidateInformation(candidateId.value), {
prefixId: informaData.value.prefixId,
lastName: informaData.value.lastname,
citizenProvinceId: informaData.value.provinceId,
citizenDistrictId: informaData.value.districtId,
dateOfBirth: dateToISO(informaData.value.birthDate),
citizenDate: dateToISO(informaData.value.cardIdDate),
citizenId: informaData.value.cardid,
firstName: informaData.value.firstname,
relationshipId: informaData.value.relationship,
nationality: informaData.value.nationality,
email: informaData.value.email,
mobilePhone: informaData.value.phone,
telephone: informaData.value.tel,
knowledge: informaData.value.knowledge
})
.then(() => {
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
edit.value = false
emit('update:statusEdit', false)
})
.catch(() => {
// modalError.value = true
// modalErrorTittle.value = ''
// modalErrorDetail.value = e.response.data.message
// statusCode.value = e.response.data.status
})
.finally(async () => {
loader.value = false
await fetchData()
})
} else {
modalConsend.value = true
}
// if (store.consend == true) {
loader.value = true
await http
.post(config.API.candidateInformation(candidateId.value), {
prefixId: informaData.value.prefixId,
lastName: informaData.value.lastname,
citizenProvinceId: informaData.value.provinceId,
citizenDistrictId: informaData.value.districtId,
dateOfBirth:
informaData.value.birthDate == null ? null : dateToISO(informaData.value.birthDate),
citizenDate:
informaData.value.cardIdDate == null ? null : dateToISO(informaData.value.cardIdDate),
citizenId: informaData.value.cardid,
firstName: informaData.value.firstname,
relationshipId: informaData.value.relationship,
nationality: informaData.value.nationality,
email: informaData.value.email,
mobilePhone: informaData.value.phone,
telephone: informaData.value.tel,
knowledge: informaData.value.knowledge
})
.then(() => {
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
// edit.value = false
emit('update:statusEdit', false)
})
.catch(() => {
// modalError.value = true
// modalErrorTittle.value = ''
// modalErrorDetail.value = e.response.data.message
// statusCode.value = e.response.data.status
})
.finally(async () => {
loader.value = false
await fetchData()
})
// } else {
// modalConsend.value = true
// }
}
})
}
const changeBtn = async () => {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
}
} else {
emit('update:statusEdit', false)
}
}
// const changeBtn = async () => {
// if (edit.value == true) {
// if (props.statusEdit === true) {
// edit.value = false
// props.notiNoEdit()
// } else {
// emit('update:statusEdit', true)
// }
// } else {
// emit('update:statusEdit', false)
// }
// }
const fetchDistrict = async (id: string) => {
loader.value = true
@ -541,15 +533,15 @@ const pickFile = () => {
disabledPic.value = true
}
const consenClose = () => {
modalConsend.value = false
}
// const consenClose = () => {
// modalConsend.value = false
// }
const consendOk = () => {
modalConsend.value = false
store.consend = true
saveData()
}
// const consendOk = () => {
// modalConsend.value = false
// store.consend = true
// saveData()
// }
const cancelData = () => {
fileData.value = null

View file

@ -9,10 +9,10 @@
:addData="true"
:editOnly="false"
:cancel="cancelData"
:changeBtn="changeBtn"
:editData="status == 'register' || status == 'rejectRegister'"
:disable="statusEdit"
/>
<!-- :changeBtn="changeBtn" -->
<q-form ref="myform">
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-12 row">
@ -230,11 +230,11 @@
</div>
</q-form>
</q-card>
<q-dialog :model-value="modalConsend" persistent>
<!-- <q-dialog :model-value="modalConsend" persistent>
<q-card style="min-width: 800px">
<Conference :ok="consendOk" :close="consenClose" />
</q-card>
</q-dialog>
</q-dialog> -->
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
@ -267,10 +267,10 @@ const $q = useQuasar()
const mixin = useCounterMixin()
const store = useExamDataStore()
const { success } = mixin
const edit = ref<boolean>(false)
const edit = ref<boolean>(true)
const occupationData = ref<Occupation>(defaultOccupation)
const myform = ref<any>()
const modalConsend = ref<boolean>(false)
// const modalConsend = ref<boolean>(false)
const loader = ref<boolean>(false)
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
@ -310,68 +310,68 @@ const fetchData = async () => {
const saveData = async () => {
await myform.value.validate().then(async (suc: boolean) => {
if (suc) {
if (store.consend == true) {
const type = ref<string | null>('')
if (occupationData.value.status == 'official') type.value = occupationData.value.official
if (occupationData.value.status == 'personnel') type.value = occupationData.value.personnel
if (occupationData.value.status == 'officialsOther')
type.value = occupationData.value.officialsOther
if (occupationData.value.status == 'employee') type.value = occupationData.value.employee
if (occupationData.value.status == 'other') type.value = occupationData.value.other
loader.value = true
await http
.post(config.API.candidateOccupation(candidateId.value), {
occupationType: occupationData.value.status,
occupationCompany: occupationData.value.company,
occupationDepartment: occupationData.value.department,
occupationEmail: occupationData.value.email,
occupationTelephone: occupationData.value.tel,
occupationPosition: type.value
})
.then(() => {
success($q, 'บันทึกข้อมูลอาชีพสำเร็จ')
edit.value = false
emit('update:statusEdit', false)
})
.catch(() => {
// modalError.value = true
// modalErrorTittle.value = ''
// modalErrorDetail.value = e.response.data.message
// statusCode.value = e.response.data.status
})
.finally(async () => {
loader.value = false
await fetchData()
})
} else {
modalConsend.value = true
}
// if (store.consend == true) {
const type = ref<string | null>('')
if (occupationData.value.status == 'official') type.value = occupationData.value.official
if (occupationData.value.status == 'personnel') type.value = occupationData.value.personnel
if (occupationData.value.status == 'officialsOther')
type.value = occupationData.value.officialsOther
if (occupationData.value.status == 'employee') type.value = occupationData.value.employee
if (occupationData.value.status == 'other') type.value = occupationData.value.other
loader.value = true
await http
.post(config.API.candidateOccupation(candidateId.value), {
occupationType: occupationData.value.status,
occupationCompany: occupationData.value.company,
occupationDepartment: occupationData.value.department,
occupationEmail: occupationData.value.email,
occupationTelephone: occupationData.value.tel,
occupationPosition: type.value
})
.then(() => {
success($q, 'บันทึกข้อมูลอาชีพสำเร็จ')
// edit.value = false
emit('update:statusEdit', false)
})
.catch(() => {
// modalError.value = true
// modalErrorTittle.value = ''
// modalErrorDetail.value = e.response.data.message
// statusCode.value = e.response.data.status
})
.finally(async () => {
loader.value = false
await fetchData()
})
// } else {
// modalConsend.value = true
// }
}
})
}
const changeBtn = async () => {
if (edit.value == true) {
if (props.statusEdit === true) {
edit.value = false
props.notiNoEdit()
} else {
emit('update:statusEdit', true)
}
} else {
emit('update:statusEdit', false)
}
}
// const changeBtn = async () => {
// if (edit.value == true) {
// if (props.statusEdit === true) {
// edit.value = false
// props.notiNoEdit()
// } else {
// emit('update:statusEdit', true)
// }
// } else {
// emit('update:statusEdit', false)
// }
// }
const consenClose = () => {
modalConsend.value = false
}
// const consenClose = () => {
// modalConsend.value = false
// }
const consendOk = () => {
modalConsend.value = false
store.consend = true
saveData()
}
// const consendOk = () => {
// modalConsend.value = false
// store.consend = true
// saveData()
// }
const cancelData = () => {}