1
0
Fork 0
master
panliang 2023-10-12 11:02:12 +08:00
parent 5fd56bd2bf
commit a18e117b56
2 changed files with 32 additions and 33 deletions

View File

@ -248,45 +248,43 @@ export default {
// if (res.status == 0) { // if (res.status == 0) {
// this.type.options = res.data.items // this.type.options = res.data.items
// } // }
res = await this.$ajax.get('/admin-api/api/keywords/list', { params: { type_key: 'illness_type' } }) await this.loadData()
res = await this.$ajax.get('/admin-api/api/keywords/list', { params: { type_key: 'illness_type', value: this.info?.type?.key } })
if (res.status == 0) { if (res.status == 0) {
this.illnessType.list = [res.data] this.illnessType.list = [res.data]
} }
this.loadData()
}, },
loadData() { async loadData() {
if (!this.id) { if (!this.id) {
return return
} }
uni.showLoading() uni.showLoading()
const params = { _action: 'getData' } const params = { _action: 'getData' }
this.$ajax.get(`/admin-api/record/${this.id}`, { params }).then(res => { let res = await this.$ajax.get(`/admin-api/record/${this.id}`, { params })
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
if (res.status == 0) { if (res.status == 0) {
this.info = { this.info = {
...res.data, ...res.data,
treat_at: res.data.treat_at ? res.data.treat_at.replaceAll('-', '/') : '', treat_at: res.data.treat_at ? res.data.treat_at.replaceAll('-', '/') : '',
next_treat_at: res.data.next_treat_at ? res.data.next_treat_at.replaceAll('-', '/') : '', next_treat_at: res.data.next_treat_at ? res.data.next_treat_at.replaceAll('-', '/') : '',
notify_at: res.data.notify_at ? res.data.notify_at.replaceAll('-', '/') : '', notify_at: res.data.notify_at ? res.data.notify_at.replaceAll('-', '/') : '',
}
if (res.data.images) {
this.$refs['images'].setList(res.data.images.map(value => {
return { url: value }
}))
}
this.type.text = this.info.type ? this.info.type.name : ''
this.adminUser.doctor_name = this.info.doctor ? this.info.doctor.name : ''
this.orderStatus.text = orderStatus.map[this.info.order_status]
this.adminUser.notify_user_name = this.info.notify_user ? this.info.notify_user.name : ''
if (res.data.illness_type) {
const illness = res.data.illness_type
this.illnessType.label = illness.name
this.illnessType.value = illness.id
}
} }
}).catch(error => { if (res.data.images) {
uni.stopPullDownRefresh() this.$refs['images'].setList(res.data.images.map(value => {
}) return { url: value }
}))
}
this.type.text = this.info.type ? this.info.type.name : ''
this.adminUser.doctor_name = this.info.doctor ? this.info.doctor.name : ''
this.orderStatus.text = orderStatus.map[this.info.order_status]
this.adminUser.notify_user_name = this.info.notify_user ? this.info.notify_user.name : ''
if (res.data.illness_type) {
const illness = res.data.illness_type
this.illnessType.label = illness.name
this.illnessType.value = illness.id
}
}
}, },
update(key, value) { update(key, value) {
const params = { const params = {

View File

@ -170,10 +170,7 @@ export default {
methods: { methods: {
async init() { async init() {
let res let res
res = await this.$ajax.get('/admin-api/api/keywords/list', { params: { type_key: 'illness_type' } })
if (res.status == 0) {
this.illnessType.list = [res.data]
}
res = await this.$ajax.get('/admin-api/current-user') res = await this.$ajax.get('/admin-api/current-user')
if (res.status == 0) { if (res.status == 0) {
this.currentUser = res.data this.currentUser = res.data
@ -227,6 +224,10 @@ export default {
this.typeName = this.patient.type.name this.typeName = this.patient.type.name
} }
} }
res = await this.$ajax.get('/admin-api/api/keywords/list', { params: { type_key: 'illness_type', value: this.patient?.type?.key} })
if (res.status == 0) {
this.illnessType.list = [res.data]
}
}, },
submit() { submit() {
this.form.images = this.$refs['images'].getList().map(item => item.url) this.form.images = this.$refs['images'].getList().map(item => item.url)