diff --git a/src/pages/patient/detail.vue b/src/pages/patient/detail.vue index 75ca32a..0c0a49c 100644 --- a/src/pages/patient/detail.vue +++ b/src/pages/patient/detail.vue @@ -9,7 +9,7 @@ --> - + @@ -20,6 +20,7 @@ + @@ -38,6 +39,7 @@ export default { doctor_id: '', doctor: {}, }, + total_record: '0', type: '', } }, @@ -49,21 +51,23 @@ export default { this.loadData() }, methods: { - loadData() { + async loadData() { if (!this.id) { return } uni.showLoading() - this.$ajax.get(`/api/client/patient/${this.id}`).then(res => { - uni.stopPullDownRefresh() - if (res.status == 0) { - this.info = res.data - this.type = this.info.type ? this.info.type.name : '' - uni.setNavigationBarTitle({ title: this.info.name }) - } - }).catch(error => { - uni.stopPullDownRefresh() - }) + let res = await this.$ajax.get(`/api/client/patient/${this.id}`) + uni.stopPullDownRefresh() + if (res.status == 0) { + this.info = res.data + this.info.images = res.data.images ?? [] + this.type = this.info.type ? this.info.type.name : '' + uni.setNavigationBarTitle({ title: this.info.name }) + } + res = await this.$ajax.get('/api/client/record', { params: {patient_id: this.id} }) + if (res.status == 0) { + this.total_record = res.data.total + '' + } }, record() { uni.navigateTo({ url: `/pages/record/index?patient=${this.id}` }) diff --git a/src/pages/record/detail.vue b/src/pages/record/detail.vue index fc62b01..da7f9fb 100644 --- a/src/pages/record/detail.vue +++ b/src/pages/record/detail.vue @@ -3,7 +3,7 @@ - + @@ -11,6 +11,11 @@ + + + + + @@ -61,6 +66,7 @@ export default { uni.stopPullDownRefresh() if (res.status == 0) { this.info = res.data + this.info.images = res.data.images ?? [] this.type.text = this.info.type ? this.info.type.name : '' } diff --git a/src/pages/record/form.vue b/src/pages/record/form.vue deleted file mode 100644 index 3224b01..0000000 --- a/src/pages/record/form.vue +++ /dev/null @@ -1,347 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/pages/record/index.vue b/src/pages/record/index.vue index 27b30d5..c48c08d 100644 --- a/src/pages/record/index.vue +++ b/src/pages/record/index.vue @@ -5,7 +5,7 @@ - 患者: {{ item.patient ? item.patient.name : '' }} + 姓名: {{ item.patient ? item.patient.name : '' }}