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