From f1be48b70218988b1341d58753bd469ee00fe774 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Thu, 26 Oct 2023 17:58:03 +0800 Subject: [PATCH] add record.description --- src/pages/patient/detail.vue | 42 +++++++++++++++++++----------------- src/pages/record/detail.vue | 29 +++++++++++++++++++------ src/pages/record/form.vue | 27 +++++++++++++++++------ 3 files changed, 66 insertions(+), 32 deletions(-) diff --git a/src/pages/patient/detail.vue b/src/pages/patient/detail.vue index 1637014..690f4b3 100644 --- a/src/pages/patient/detail.vue +++ b/src/pages/patient/detail.vue @@ -86,6 +86,7 @@ +
@@ -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 diff --git a/src/pages/record/detail.vue b/src/pages/record/detail.vue index 5089b90..50ab367 100644 --- a/src/pages/record/detail.vue +++ b/src/pages/record/detail.vue @@ -66,12 +66,23 @@ :title="`${type.text}情况`" isLink rightIcon="edit-pen" - @click="openEditor" + @click="openEditor('content')" > + + + + + + @@ -101,10 +112,10 @@ {{ form.content }} 点击修改 + + + + + {{ form.description }} + 点击修改 + + @@ -71,9 +79,9 @@ - + - {{ form.notify_at | date('yyyy-MM-dd') }} + {{ form.notify_at | date }} 请选择通知时间 @@ -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