1
0
Fork 0

patient user_id

master
panliang 2023-10-14 14:27:35 +08:00
parent b5ee34d829
commit 88b3ac258d
6 changed files with 161 additions and 12 deletions

View File

@ -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>

View File

@ -1,16 +1,14 @@
<template>
<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.name"
isLink
rightIcon="edit-pen"
@click="openModal('姓名', 'name')"
/>
<u-cell
title="类别"
:value="info.type ? info.type.name : ''"
/>
<u-cell
title="性别"

View File

@ -1,6 +1,13 @@
<template>
<view class="page">
<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--input v-model="form.name" border="bottom" placeholder="请输入姓名" />
</u-form-item>
@ -85,6 +92,7 @@
@select="selectGender"
/>
<cu-editor ref="editor" @confirm="confirmEditor" />
<select-user ref="select-user" @select="selectUser" />
</view>
</template>
@ -93,14 +101,16 @@ 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: '',
form: {
type_id: '',
user_id: '',
name: '',
sex: gender.none.value,
phone: '',
@ -143,6 +153,10 @@ export default {
text: '',
value: '',
},
},
user: {
value: '',
text: ''
}
}
},
@ -225,6 +239,28 @@ export default {
confirmEditor(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() {
this.form.images = this.$refs['images'].getList().map(item => item.url)
this.$refs['form'].validate().then(res => {
@ -256,9 +292,9 @@ export default {
title: '提交成功',
icon: 'success'
})
setTimeout(() => {
uni.navigateBack()
}, 1500);
// setTimeout(() => {
// uni.navigateBack()
// }, 1500);
}
})
}

View File

@ -92,7 +92,7 @@
</u-cell>
<u-cell
v-if="info.is_notified == 0"
title="通知"
title="通知医师"
:value="adminUser.notify_user_name"
isLink
rightIcon="edit-pen"

View File

@ -64,7 +64,7 @@
<u-form-item label="开启通知" prop="is_notified" borderBottom>
<u-switch v-model="form.is_notified" :activeValue="0" :inactiveValue="1" asyncChange @change="updateSwitch" />
</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">
<text v-if="form.notify_user_id">{{ adminUser.notify_user_name }}</text>
<text v-else class="input-placeholder">请选择通知人</text>

View File

@ -101,8 +101,8 @@ export default {
this.page = 1
}
uni.showLoading()
const params = {_action: 'getData', page: this.page, perPage: this.perPage, patient_id: this.patient_id}
this.$ajax.get('/admin-api/record?', { params }).then(res => {
const params = { _action: 'getData', page: this.page, perPage: this.perPage, patient_id: this.patient_id }
this.$ajax.get('/admin-api/record', { params }).then(res => {
uni.stopPullDownRefresh()
if (res.status == 0) {
this.list = this.list.concat(res.data.items)