patient user_id
parent
88b3ac258d
commit
552961fd9a
|
|
@ -78,7 +78,7 @@ export default {
|
|||
page: this.page,
|
||||
perPage: this.perPage,
|
||||
keyword: this.search,
|
||||
ignore_type_id: this.type ? this.type : uni.getStorageSync('medical_record_treat_type_id')
|
||||
treat_type_id: this.type ? this.type : uni.getStorageSync('medical_record_treat_type_id')
|
||||
}
|
||||
this.$ajax.get('/admin-api/user', { params }).then(res => {
|
||||
this.loading = false
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view class="page">
|
||||
<u-cell-group :border="false">
|
||||
<u-cell title="类别" :value="info.type ? info.type.name : ''" />
|
||||
<u-cell title="客户" :value="info.user ? info.user.phone : ''" />
|
||||
<u-cell title="客户" :value="info.user ? `${info.user.name}(${info.user.phone})` : ''" isLink rightIcon="edit-pen" @click="openUser" />
|
||||
<u-cell
|
||||
title="姓名"
|
||||
:value="info.name"
|
||||
|
|
@ -124,6 +124,7 @@
|
|||
/>
|
||||
<select-admin-user ref="select-admin-user" @select="selectDoctor" />
|
||||
<cu-editor ref="editor" @confirm="confirmEditor" />
|
||||
<select-user ref="select-user" @select="selectUser" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -132,9 +133,10 @@ import gender from '../../enums/gender'
|
|||
import SelectAdminUser from '../../components/select-admin-user'
|
||||
import CuEditor from '../../components/cu-editor'
|
||||
import CuImage from '../../components/cu-image'
|
||||
import SelectUser from '../../components/select-user'
|
||||
|
||||
export default {
|
||||
components: {SelectAdminUser, CuEditor, CuImage},
|
||||
components: {SelectAdminUser, CuEditor, CuImage, SelectUser},
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
|
|
@ -286,6 +288,21 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
openUser() {
|
||||
this.$refs['select-user'].open()
|
||||
},
|
||||
closeUser() {
|
||||
this.$refs['select-user'].close()
|
||||
},
|
||||
selectUser(e) {
|
||||
this.closeUser()
|
||||
this.update({ user_id: e.id }).then(res => {
|
||||
if (res.status == 0) {
|
||||
this.info.user_id = e.id
|
||||
this.info.user = e
|
||||
}
|
||||
})
|
||||
},
|
||||
addRecord() {
|
||||
return uni.navigateTo({ url: `/pages/record/form?patient=${this.id}` })
|
||||
},
|
||||
|
|
@ -294,8 +311,8 @@ export default {
|
|||
},
|
||||
deletePatient() {
|
||||
uni.showModal({
|
||||
title: '删除 ' + this.info.name,
|
||||
content: '是否确定?',
|
||||
title: '删除病人档案信息',
|
||||
content: `同时会删除相关联的病历记录!`,
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
this.delete(this.info.id)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<u--form :model="form" ref="form" labelWidth="70">
|
||||
<u-form-item prop="user_id" label="客户" required @click="openUser">
|
||||
<u-form-item prop="user_id" label="客户" @click="openUser">
|
||||
<view class="input-text">
|
||||
<text v-if="form.user_id">{{ user.text }}</text>
|
||||
<text v-else class="input-placeholder">请选择客户</text>
|
||||
|
|
@ -263,14 +263,12 @@ export default {
|
|||
},
|
||||
submit() {
|
||||
this.form.images = this.$refs['images'].getList().map(item => item.url)
|
||||
this.$refs['form'].validate().then(res => {
|
||||
uni.showLoading()
|
||||
if (this.id) {
|
||||
this.update()
|
||||
} else {
|
||||
this.create()
|
||||
}
|
||||
}).catch(error => {})
|
||||
uni.showLoading()
|
||||
if (this.id) {
|
||||
this.update()
|
||||
} else {
|
||||
this.create()
|
||||
}
|
||||
},
|
||||
update() {
|
||||
this.$ajax.put(`/admin-api/patient/${this.id}`, this.form).then(res => {
|
||||
|
|
@ -292,9 +290,9 @@ export default {
|
|||
title: '提交成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// setTimeout(() => {
|
||||
// uni.navigateBack()
|
||||
// }, 1500);
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ export default {
|
|||
this.datePicker.show = !this.datePicker.show
|
||||
},
|
||||
selectDatePicker(e) {
|
||||
const value = Math.floor(e.value / 1000)
|
||||
const value = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
|
||||
const key = this.datePicker.name
|
||||
this.update(key, value).then(res => {
|
||||
if (res.status == 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue