ใช้ข้อมูลหลักจาก dbหลัก
This commit is contained in:
parent
d2e6979d95
commit
afae9edf5f
3 changed files with 19 additions and 10 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import env from '../index'
|
||||
const prefix = `${env.API_URI}/prefix/`
|
||||
const religion = `${env.API_URI}/religion/`
|
||||
const relationship = `${env.API_URI}/relationship/`
|
||||
const educationLevel = `${env.API_URI}/education-level/`
|
||||
const province = `${env.API_URI}/province/`
|
||||
const district = `${env.API_URI}/district/`
|
||||
const subDistrict = `${env.API_URI}/sub-district/`
|
||||
const prefix = `${env.API_METADATA_URI}/prefix/`
|
||||
const religion = `${env.API_METADATA_URI}/religion/`
|
||||
const relationship = `${env.API_METADATA_URI}/relationship/`
|
||||
const educationLevel = `${env.API_METADATA_URI}/education-level/`
|
||||
const province = `${env.API_METADATA_URI}/province/`
|
||||
const district = `${env.API_METADATA_URI}/district/`
|
||||
const subDistrict = `${env.API_METADATA_URI}/sub-district/`
|
||||
|
||||
export default {
|
||||
prefix,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ const config = ref<any>({
|
|||
development: {
|
||||
API_URI: 'https://localhost:7007/api/v1',
|
||||
// API_URI: "https://bma-ehr-exam.frappet.synology.me/api/v1",
|
||||
API_METADATA_URI: 'https://bma-ehr.frappet.synology.me/api/v1/metadata',
|
||||
MEET_URI: 'meet.frappet.com'
|
||||
},
|
||||
test: {
|
||||
|
|
@ -19,16 +20,19 @@ const config = ref<any>({
|
|||
production: {
|
||||
// API_URI: "https://localhost:5010",
|
||||
API_URI: `${window.location.protocol}//${window.location.host}/api/v1`,
|
||||
API_METADATA_URI: 'https://bma-ehr.frappet.synology.me/api/v1/metadata',
|
||||
MEET_URI: 'meet.frappet.com'
|
||||
}
|
||||
})
|
||||
|
||||
const API_URI = ref<string>(config.value[env.value].API_URI)
|
||||
const API_METADATA_URI = ref<string>(config.value[env.value].API_METADATA_URI)
|
||||
const MEET_URI = ref<string>(config.value[env.value].MEET_URI)
|
||||
|
||||
export default {
|
||||
env: env.value,
|
||||
config: config.value,
|
||||
API_URI: API_URI.value,
|
||||
API_METADATA_URI: API_METADATA_URI.value,
|
||||
MEET_URI: MEET_URI.value
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
label="บันทึกข้อมูล"
|
||||
outline
|
||||
icon="mdi-content-save"
|
||||
@click="saveAuto = false && saveData"
|
||||
@click="clickSave"
|
||||
v-if="status === 'register' || status === 'rejectRegister'"
|
||||
:disable="!acceptTermOfUse || statusEdit"
|
||||
/>
|
||||
|
|
@ -131,6 +131,11 @@ const saveForm = async () => {
|
|||
})
|
||||
}
|
||||
|
||||
const clickSave = async () => {
|
||||
saveAuto.value = false
|
||||
await saveData()
|
||||
}
|
||||
|
||||
const saveData = async () => {
|
||||
await formInformation.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
|
|
@ -218,8 +223,9 @@ const saveData = async () => {
|
|||
? false
|
||||
: null
|
||||
})
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
||||
if (saveAuto.value) await saveForm()
|
||||
})
|
||||
.catch(() => {
|
||||
// modalError.value = true
|
||||
|
|
@ -229,7 +235,6 @@ const saveData = async () => {
|
|||
})
|
||||
.finally(async () => {
|
||||
loader.value = false
|
||||
if (saveAuto.value) await saveForm()
|
||||
await props.fetchStep()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue