1
0
Fork 0

add record.description

master
panliang 2023-10-26 17:58:03 +08:00
parent 072bb1871b
commit f1be48b702
3 changed files with 66 additions and 32 deletions

View File

@ -86,6 +86,7 @@
<cu-image ref="images" @update="updateImages" />
</view>
</u-cell>
<u-cell title="服务或诊疗次数" :value="total_record"/>
<u-cell title="录入时间" :value="info.created_at"/>
</u-cell-group>
<div class="btn">
@ -145,6 +146,7 @@ export default {
doctor_id: '',
doctor: {},
},
total_record: '0',
modal: {
type: 'text',
show: false,
@ -176,31 +178,31 @@ export default {
this.loadData()
},
methods: {
loadData() {
async loadData() {
if (!this.id) {
return
}
uni.showLoading()
const params = {_action: 'getData'}
this.$ajax.get(`/admin-api/patient/${this.id}`, { params }).then(res => {
uni.stopPullDownRefresh()
if (res.status == 0) {
this.info = {
...res.data,
birthday: res.data.birthday ? res.data.birthday.replaceAll('-', '/') : '',
treat_at: res.data.treat_at ? res.data.treat_at.replaceAll('-', '/') : '',
}
this.type = this.info.type ? this.info.type.name : ''
if (res.data.images) {
this.$refs['images'].setList(res.data.images.map(value => {
return { url: value }
}))
}
uni.setNavigationBarTitle({ title: this.info.name })
let res = await this.$ajax.get(`/admin-api/patient/${this.id}`, { params: {_action: 'getData'} })
uni.stopPullDownRefresh()
if (res.status == 0) {
this.info = {
...res.data,
birthday: res.data.birthday ? res.data.birthday.replaceAll('-', '/') : '',
treat_at: res.data.treat_at ? res.data.treat_at.replaceAll('-', '/') : '',
}
}).catch(error => {
uni.stopPullDownRefresh()
})
this.type = this.info.type ? this.info.type.name : ''
if (res.data.images) {
this.$refs['images'].setList(res.data.images.map(value => {
return { url: value }
}))
}
uni.setNavigationBarTitle({ title: this.info.name })
}
res = await this.$ajax.get('/admin-api/record', { params: {_action: 'getData', patient_id: this.id} })
if (res.status == 0) {
this.total_record = res.data.total + ''
}
},
openModal(title, name) {
this.modal.title = title

View File

@ -66,12 +66,23 @@
:title="`${type.text}情况`"
isLink
rightIcon="edit-pen"
@click="openEditor"
@click="openEditor('content')"
>
<view slot="label">
<!-- <rich-text :nodes="info.illness" /> -->
<u--text :text="info.content" type="info" wordWrap="anywhere" />
</view>
</u-cell>
<u-cell
title="服用方法"
isLink
rightIcon="edit-pen"
@click="openEditor('description')"
>
<view slot="label">
<!-- <rich-text :nodes="info.illness" /> -->
<u--text :text="info.description" type="info" wordWrap="anywhere" />
</view>
</u-cell>
<u-cell title="图片资料">
<view slot="value">
@ -101,10 +112,10 @@
<u-cell
v-if="info.is_notified == 0"
title="通知时间"
:value="info.notify_at | date('yyyy-MM-dd')"
:value="info.notify_at | date"
isLink
rightIcon="edit-pen"
@click="toggleDatePicker('notify_at', 'date')"
@click="toggleDatePicker('notify_at', 'datetime')"
/>
<!-- <u-cell
title="通知备注"
@ -194,6 +205,8 @@ export default {
sell_price: '',
notify_remarks: '',
is_notified: 0,
description: '',
content: '',
},
adminUser: {
key: '',
@ -232,6 +245,9 @@ export default {
label: '',
list: []
},
editor: {
key: ''
},
}
},
onLoad(e) {
@ -380,12 +396,13 @@ export default {
}
})
},
openEditor() {
this.$refs['editor'].open(this.info.content)
openEditor(key) {
this.editor.key = key
this.$refs['editor'].open(this.info[key])
},
confirmEditor(e) {
const value = e
const key = 'content'
const key = this.editor.key
this.update(key, value).then(res => {
if (res.status == 0) {
this.info[key] = value

View File

@ -43,13 +43,21 @@
<u-radio v-for="item in orderStatus.options" :key="item.value" :label="item.name" :name="item.value" />
</u-radio-group>
</u-form-item>
<u-form-item :label="`${typeName}情况`" prop="content" :borderBottom="true" @click="openEditor">
<u-form-item :label="`${typeName}情况`" prop="content" :borderBottom="true" @click="openEditor('content')">
<view class="input-text">
<!-- <rich-text v-if="form.illness" :nodes="form.illness" /> -->
<text v-if="form.content">{{ form.content }}</text>
<text v-else class="input-placeholder">点击修改</text>
<u-icon name="arrow-right" />
</view>
</u-form-item>
<u-form-item label="服用方法" prop="description" :borderBottom="true" @click="openEditor('description')">
<view class="input-text">
<!-- <rich-text v-if="form.illness" :nodes="form.illness" /> -->
<text v-if="form.description">{{ form.description }}</text>
<text v-else class="input-placeholder">点击修改</text>
<u-icon name="arrow-right" />
</view>
</u-form-item>
<u-form-item label="图片资料" prop="images" borderBottom>
<cu-image ref="images" />
@ -71,9 +79,9 @@
<u-icon name="arrow-right" />
</view>
</u-form-item>
<u-form-item v-if="form.is_notified == 0" prop="notify_at" label="通知时间" :borderBottom="true" @click="toggleDatePicker('notify_at', 'date')">
<u-form-item v-if="form.is_notified == 0" prop="notify_at" label="通知时间" :borderBottom="true" @click="toggleDatePicker('notify_at', 'datetime')">
<view class="input-text">
<text v-if="form.notify_at">{{ form.notify_at | date('yyyy-MM-dd') }}</text>
<text v-if="form.notify_at">{{ form.notify_at | date }}</text>
<text v-else class="input-placeholder">请选择通知时间</text>
<u-icon name="arrow-right" />
</view>
@ -138,6 +146,7 @@ export default {
notify_remarks: '',
is_notified: 1,
illness_type_id: '',
description: '',
},
typeList: [],
patient: {},
@ -160,6 +169,10 @@ export default {
list: []
},
typeName: '',
editor: {
key: '',
value: ''
},
}
},
onLoad(e) {
@ -293,11 +306,13 @@ export default {
this.adminUser[`${key}_name`] = e.name
this.closeAdminUser()
},
openEditor() {
this.$refs['editor'].open(this.form.content)
openEditor(key) {
this.editor.key = key
this.editor.value = this.form[key]
this.$refs['editor'].open(this.form[key])
},
confirmEditor(e) {
this.form.content = e
this.form[this.editor.key] = e
},
updateSwitch(e) {
this.form.is_notified = e