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

View File

@ -66,12 +66,23 @@
:title="`${type.text}情况`" :title="`${type.text}情况`"
isLink isLink
rightIcon="edit-pen" rightIcon="edit-pen"
@click="openEditor" @click="openEditor('content')"
> >
<view slot="label"> <view slot="label">
<!-- <rich-text :nodes="info.illness" /> --> <!-- <rich-text :nodes="info.illness" /> -->
<u--text :text="info.content" type="info" wordWrap="anywhere" /> <u--text :text="info.content" type="info" wordWrap="anywhere" />
</view> </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>
<u-cell title="图片资料"> <u-cell title="图片资料">
<view slot="value"> <view slot="value">
@ -101,10 +112,10 @@
<u-cell <u-cell
v-if="info.is_notified == 0" v-if="info.is_notified == 0"
title="通知时间" title="通知时间"
:value="info.notify_at | date('yyyy-MM-dd')" :value="info.notify_at | date"
isLink isLink
rightIcon="edit-pen" rightIcon="edit-pen"
@click="toggleDatePicker('notify_at', 'date')" @click="toggleDatePicker('notify_at', 'datetime')"
/> />
<!-- <u-cell <!-- <u-cell
title="通知备注" title="通知备注"
@ -194,6 +205,8 @@ export default {
sell_price: '', sell_price: '',
notify_remarks: '', notify_remarks: '',
is_notified: 0, is_notified: 0,
description: '',
content: '',
}, },
adminUser: { adminUser: {
key: '', key: '',
@ -232,6 +245,9 @@ export default {
label: '', label: '',
list: [] list: []
}, },
editor: {
key: ''
},
} }
}, },
onLoad(e) { onLoad(e) {
@ -380,12 +396,13 @@ export default {
} }
}) })
}, },
openEditor() { openEditor(key) {
this.$refs['editor'].open(this.info.content) this.editor.key = key
this.$refs['editor'].open(this.info[key])
}, },
confirmEditor(e) { confirmEditor(e) {
const value = e const value = e
const key = 'content' const key = this.editor.key
this.update(key, value).then(res => { this.update(key, value).then(res => {
if (res.status == 0) { if (res.status == 0) {
this.info[key] = value 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 v-for="item in orderStatus.options" :key="item.value" :label="item.name" :name="item.value" />
</u-radio-group> </u-radio-group>
</u-form-item> </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"> <view class="input-text">
<!-- <rich-text v-if="form.illness" :nodes="form.illness" /> --> <!-- <rich-text v-if="form.illness" :nodes="form.illness" /> -->
<text v-if="form.content">{{ form.content }}</text> <text v-if="form.content">{{ form.content }}</text>
<text v-else class="input-placeholder">点击修改</text> <text v-else class="input-placeholder">点击修改</text>
<u-icon name="arrow-right" /> <u-icon name="arrow-right" />
</view> </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>
<u-form-item label="图片资料" prop="images" borderBottom> <u-form-item label="图片资料" prop="images" borderBottom>
<cu-image ref="images" /> <cu-image ref="images" />
@ -71,9 +79,9 @@
<u-icon name="arrow-right" /> <u-icon name="arrow-right" />
</view> </view>
</u-form-item> </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"> <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> <text v-else class="input-placeholder">请选择通知时间</text>
<u-icon name="arrow-right" /> <u-icon name="arrow-right" />
</view> </view>
@ -138,6 +146,7 @@ export default {
notify_remarks: '', notify_remarks: '',
is_notified: 1, is_notified: 1,
illness_type_id: '', illness_type_id: '',
description: '',
}, },
typeList: [], typeList: [],
patient: {}, patient: {},
@ -160,6 +169,10 @@ export default {
list: [] list: []
}, },
typeName: '', typeName: '',
editor: {
key: '',
value: ''
},
} }
}, },
onLoad(e) { onLoad(e) {
@ -293,11 +306,13 @@ export default {
this.adminUser[`${key}_name`] = e.name this.adminUser[`${key}_name`] = e.name
this.closeAdminUser() this.closeAdminUser()
}, },
openEditor() { openEditor(key) {
this.$refs['editor'].open(this.form.content) this.editor.key = key
this.editor.value = this.form[key]
this.$refs['editor'].open(this.form[key])
}, },
confirmEditor(e) { confirmEditor(e) {
this.form.content = e this.form[this.editor.key] = e
}, },
updateSwitch(e) { updateSwitch(e) {
this.form.is_notified = e this.form.is_notified = e