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