From 552961fd9aaa063acb1e9279e3ff3145fbc5dbaf Mon Sep 17 00:00:00 2001
From: panliang <1163816051@qq.com>
Date: Mon, 16 Oct 2023 13:11:00 +0800
Subject: [PATCH] patient user_id
---
src/components/select-user.vue | 2 +-
src/pages/patient/detail.vue | 25 +++++++++++++++++++++----
src/pages/patient/form.vue | 22 ++++++++++------------
src/pages/record/detail.vue | 2 +-
4 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/src/components/select-user.vue b/src/components/select-user.vue
index 80e95ad..9b3a095 100644
--- a/src/components/select-user.vue
+++ b/src/components/select-user.vue
@@ -78,7 +78,7 @@ export default {
page: this.page,
perPage: this.perPage,
keyword: this.search,
- ignore_type_id: this.type ? this.type : uni.getStorageSync('medical_record_treat_type_id')
+ treat_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
diff --git a/src/pages/patient/detail.vue b/src/pages/patient/detail.vue
index c1ccac8..4abc5d8 100644
--- a/src/pages/patient/detail.vue
+++ b/src/pages/patient/detail.vue
@@ -2,7 +2,7 @@
-
+
+
@@ -132,9 +133,10 @@ 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: '',
@@ -286,6 +288,21 @@ export default {
}
})
},
+ openUser() {
+ this.$refs['select-user'].open()
+ },
+ closeUser() {
+ this.$refs['select-user'].close()
+ },
+ selectUser(e) {
+ this.closeUser()
+ this.update({ user_id: e.id }).then(res => {
+ if (res.status == 0) {
+ this.info.user_id = e.id
+ this.info.user = e
+ }
+ })
+ },
addRecord() {
return uni.navigateTo({ url: `/pages/record/form?patient=${this.id}` })
},
@@ -294,8 +311,8 @@ export default {
},
deletePatient() {
uni.showModal({
- title: '删除 ' + this.info.name,
- content: '是否确定?',
+ title: '删除病人档案信息',
+ content: `同时会删除相关联的病历记录!`,
success: (result) => {
if (result.confirm) {
this.delete(this.info.id)
diff --git a/src/pages/patient/form.vue b/src/pages/patient/form.vue
index c88c783..50eee0a 100644
--- a/src/pages/patient/form.vue
+++ b/src/pages/patient/form.vue
@@ -1,7 +1,7 @@
-
+
{{ user.text }}
请选择客户
@@ -263,14 +263,12 @@ export default {
},
submit() {
this.form.images = this.$refs['images'].getList().map(item => item.url)
- this.$refs['form'].validate().then(res => {
- uni.showLoading()
- if (this.id) {
- this.update()
- } else {
- this.create()
- }
- }).catch(error => {})
+ uni.showLoading()
+ if (this.id) {
+ this.update()
+ } else {
+ this.create()
+ }
},
update() {
this.$ajax.put(`/admin-api/patient/${this.id}`, this.form).then(res => {
@@ -292,9 +290,9 @@ export default {
title: '提交成功',
icon: 'success'
})
- // setTimeout(() => {
- // uni.navigateBack()
- // }, 1500);
+ setTimeout(() => {
+ uni.navigateBack()
+ }, 1500);
}
})
}
diff --git a/src/pages/record/detail.vue b/src/pages/record/detail.vue
index fc1fc7c..4428935 100644
--- a/src/pages/record/detail.vue
+++ b/src/pages/record/detail.vue
@@ -337,7 +337,7 @@ export default {
this.datePicker.show = !this.datePicker.show
},
selectDatePicker(e) {
- const value = Math.floor(e.value / 1000)
+ const value = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
const key = this.datePicker.name
this.update(key, value).then(res => {
if (res.status == 0) {