patient user_id
parent
b5ee34d829
commit
88b3ac258d
|
|
@ -0,0 +1,115 @@
|
||||||
|
<template>
|
||||||
|
<u-popup :show="show" mode="right" :safeAreaInsetTop="true" @close="close" @open="open">
|
||||||
|
<u-search
|
||||||
|
v-model="search"
|
||||||
|
placeholder="输入 姓名/手机号 搜索"
|
||||||
|
:clearabled="true"
|
||||||
|
:showAction="false"
|
||||||
|
margin="10px 0"
|
||||||
|
@search="load(true)"
|
||||||
|
@change="changeSearch"
|
||||||
|
/>
|
||||||
|
<u-list :width="300" :height="listHeight" @scrolltolower="reachBottom">
|
||||||
|
<u-list-item v-for="(item, index) in list" :key="item.id">
|
||||||
|
<u-cell
|
||||||
|
:title="item.name"
|
||||||
|
:name="index"
|
||||||
|
:value="item.phone"
|
||||||
|
clickable
|
||||||
|
@click="click"
|
||||||
|
/>
|
||||||
|
</u-list-item>
|
||||||
|
</u-list>
|
||||||
|
<view v-if="loading" class="loading">
|
||||||
|
<u-loadmore :status="status" />
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "SelectAdminUser",
|
||||||
|
props: ['type'],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
search: '',
|
||||||
|
show: false,
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
perPage: 20,
|
||||||
|
loading: true,
|
||||||
|
// 'loading', 'nomore', 'loadmore'
|
||||||
|
status: 'loadmore',
|
||||||
|
listHeight: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.load(true)
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
this.listHeight = res.safeArea.height - 54
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.show = true
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.show = false
|
||||||
|
},
|
||||||
|
click(e) {
|
||||||
|
this.$emit('select', this.list[e.name])
|
||||||
|
},
|
||||||
|
load(refresh) {
|
||||||
|
if (refresh) {
|
||||||
|
this.page = 1
|
||||||
|
this.list = []
|
||||||
|
this.status = 'loadmore'
|
||||||
|
}
|
||||||
|
if (this.status == 'nomore') {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
this.loading = true
|
||||||
|
this.status = 'loading'
|
||||||
|
// uni.showLoading()
|
||||||
|
const params = {
|
||||||
|
_action: 'getData',
|
||||||
|
page: this.page,
|
||||||
|
perPage: this.perPage,
|
||||||
|
keyword: this.search,
|
||||||
|
ignore_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
|
||||||
|
if (res.status == 0) {
|
||||||
|
this.list = this.list.concat(res.data.items)
|
||||||
|
if (this.list.length >= res.data.total) {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.loading = false
|
||||||
|
this.status = 'nomore'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
reachBottom() {
|
||||||
|
this.page++
|
||||||
|
this.load()
|
||||||
|
},
|
||||||
|
changeSearch(value) {
|
||||||
|
if (!value) {
|
||||||
|
this.load(true)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.loading {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: white;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,16 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<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.user ? info.user.phone : ''" />
|
||||||
<u-cell
|
<u-cell
|
||||||
title="姓名"
|
title="姓名"
|
||||||
:value="info.name"
|
:value="info.name"
|
||||||
isLink
|
isLink
|
||||||
rightIcon="edit-pen"
|
rightIcon="edit-pen"
|
||||||
@click="openModal('姓名', 'name')"
|
@click="openModal('姓名', 'name')"
|
||||||
/>
|
|
||||||
<u-cell
|
|
||||||
title="类别"
|
|
||||||
:value="info.type ? info.type.name : ''"
|
|
||||||
/>
|
/>
|
||||||
<u-cell
|
<u-cell
|
||||||
title="性别"
|
title="性别"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,13 @@
|
||||||
<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">
|
||||||
|
<view class="input-text">
|
||||||
|
<text v-if="form.user_id">{{ user.text }}</text>
|
||||||
|
<text v-else class="input-placeholder">请选择客户</text>
|
||||||
|
<u-icon name="arrow-right" />
|
||||||
|
</view>
|
||||||
|
</u-form-item>
|
||||||
<u-form-item prop="name" label="姓名" :required="true">
|
<u-form-item prop="name" label="姓名" :required="true">
|
||||||
<u--input v-model="form.name" border="bottom" placeholder="请输入姓名" />
|
<u--input v-model="form.name" border="bottom" placeholder="请输入姓名" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
@ -85,6 +92,7 @@
|
||||||
@select="selectGender"
|
@select="selectGender"
|
||||||
/>
|
/>
|
||||||
<cu-editor ref="editor" @confirm="confirmEditor" />
|
<cu-editor ref="editor" @confirm="confirmEditor" />
|
||||||
|
<select-user ref="select-user" @select="selectUser" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -93,14 +101,16 @@ 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: '',
|
||||||
form: {
|
form: {
|
||||||
type_id: '',
|
type_id: '',
|
||||||
|
user_id: '',
|
||||||
name: '',
|
name: '',
|
||||||
sex: gender.none.value,
|
sex: gender.none.value,
|
||||||
phone: '',
|
phone: '',
|
||||||
|
|
@ -143,6 +153,10 @@ export default {
|
||||||
text: '',
|
text: '',
|
||||||
value: '',
|
value: '',
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
value: '',
|
||||||
|
text: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -225,6 +239,28 @@ export default {
|
||||||
confirmEditor(e) {
|
confirmEditor(e) {
|
||||||
this.form.illness = e
|
this.form.illness = e
|
||||||
},
|
},
|
||||||
|
openUser() {
|
||||||
|
this.$refs['select-user'].open()
|
||||||
|
},
|
||||||
|
closeUser() {
|
||||||
|
this.$refs['select-user'].close()
|
||||||
|
},
|
||||||
|
selectUser(e) {
|
||||||
|
this.user = {
|
||||||
|
value: e.id,
|
||||||
|
text: e.phone
|
||||||
|
}
|
||||||
|
this.form.user_id = e.id
|
||||||
|
this.form.name = e.name
|
||||||
|
this.form.phone = e.phone
|
||||||
|
this.form.address = e.address
|
||||||
|
this.selectGender({
|
||||||
|
name: e.sex_text,
|
||||||
|
value: e.sex
|
||||||
|
})
|
||||||
|
this.form.birthday = e.birthday_format
|
||||||
|
this.closeUser()
|
||||||
|
},
|
||||||
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 => {
|
this.$refs['form'].validate().then(res => {
|
||||||
|
|
@ -256,9 +292,9 @@ export default {
|
||||||
title: '提交成功',
|
title: '提交成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
uni.navigateBack()
|
// uni.navigateBack()
|
||||||
}, 1500);
|
// }, 1500);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
</u-cell>
|
</u-cell>
|
||||||
<u-cell
|
<u-cell
|
||||||
v-if="info.is_notified == 0"
|
v-if="info.is_notified == 0"
|
||||||
title="通知人"
|
title="通知医师"
|
||||||
:value="adminUser.notify_user_name"
|
:value="adminUser.notify_user_name"
|
||||||
isLink
|
isLink
|
||||||
rightIcon="edit-pen"
|
rightIcon="edit-pen"
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
<u-form-item label="开启通知" prop="is_notified" borderBottom>
|
<u-form-item label="开启通知" prop="is_notified" borderBottom>
|
||||||
<u-switch v-model="form.is_notified" :activeValue="0" :inactiveValue="1" asyncChange @change="updateSwitch" />
|
<u-switch v-model="form.is_notified" :activeValue="0" :inactiveValue="1" asyncChange @change="updateSwitch" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item v-if="form.is_notified == 0" prop="notify_user_id" label="通知人" :borderBottom="true" @click="opendAdminUser('notify_user')">
|
<u-form-item v-if="form.is_notified == 0" prop="notify_user_id" label="通知医师" :borderBottom="true" @click="opendAdminUser('notify_user')">
|
||||||
<view class="input-text">
|
<view class="input-text">
|
||||||
<text v-if="form.notify_user_id">{{ adminUser.notify_user_name }}</text>
|
<text v-if="form.notify_user_id">{{ adminUser.notify_user_name }}</text>
|
||||||
<text v-else class="input-placeholder">请选择通知人</text>
|
<text v-else class="input-placeholder">请选择通知人</text>
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,8 @@ export default {
|
||||||
this.page = 1
|
this.page = 1
|
||||||
}
|
}
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
const params = {_action: 'getData', page: this.page, perPage: this.perPage, patient_id: this.patient_id}
|
const params = { _action: 'getData', page: this.page, perPage: this.perPage, patient_id: this.patient_id }
|
||||||
this.$ajax.get('/admin-api/record?', { params }).then(res => {
|
this.$ajax.get('/admin-api/record', { params }).then(res => {
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
if (res.status == 0) {
|
if (res.status == 0) {
|
||||||
this.list = this.list.concat(res.data.items)
|
this.list = this.list.concat(res.data.items)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue