diff --git a/src/components/cu-editor.vue b/src/components/cu-editor.vue
index d8331aa..2350725 100644
--- a/src/components/cu-editor.vue
+++ b/src/components/cu-editor.vue
@@ -1,6 +1,7 @@
-
+
+
@@ -37,10 +38,13 @@ export default {
if (this.editor) {
this.editor.getContents({
success: (e) => {
- this.$emit('confirm', e)
+ this.$emit('confirm', e.html)
this.close()
}
})
+ } else {
+ this.$emit('confirm', this.value)
+ this.close()
}
},
}
diff --git a/src/pages/patient/detail.vue b/src/pages/patient/detail.vue
index 1ec8e91..856f0ee 100644
--- a/src/pages/patient/detail.vue
+++ b/src/pages/patient/detail.vue
@@ -56,7 +56,12 @@
isLink
rightIcon="edit-pen"
@click="openEditor"
- />
+ >
+
+
+ {{info.illness}}
+
+
@@ -197,9 +202,9 @@ export default {
this.$refs['editor'].open(this.info.illness)
},
confirmEditor(e) {
- this.update({ illness: e.html }).then(res => {
+ this.update({ illness: e }).then(res => {
if (res.status == 0) {
- this.info.illness = e.html
+ this.info.illness = e
}
})
},
diff --git a/src/pages/patient/form.vue b/src/pages/patient/form.vue
index 8acd04e..e14c2f5 100644
--- a/src/pages/patient/form.vue
+++ b/src/pages/patient/form.vue
@@ -40,7 +40,8 @@
- 点击修改
+ {{ form.illness }}
+ 点击修改
@@ -191,7 +192,7 @@ export default {
this.$refs['editor'].open(this.form.illness)
},
confirmEditor(e) {
- this.form.illness = e.html
+ this.form.illness = e
},
submit() {
this.form.images = this.$refs['images'].getList().map(item => item.url)
diff --git a/src/pages/record/detail.vue b/src/pages/record/detail.vue
index b12d5f0..d3a7c58 100644
--- a/src/pages/record/detail.vue
+++ b/src/pages/record/detail.vue
@@ -52,7 +52,12 @@
isLink
rightIcon="edit-pen"
@click="openEditor"
- />
+ >
+
+
+ {{info.content}}
+
+
@@ -331,7 +336,7 @@ export default {
this.$refs['editor'].open(this.info.content)
},
confirmEditor(e) {
- const value = e.html
+ const value = e
const key = 'content'
this.update(key, value).then(res => {
if (res.status == 0) {
diff --git a/src/pages/record/form.vue b/src/pages/record/form.vue
index d02b40d..5bd30bd 100644
--- a/src/pages/record/form.vue
+++ b/src/pages/record/form.vue
@@ -26,26 +26,28 @@
-
+ asyncChange
+ /> -->
+
-
+ asyncChange
+ /> -->
+
@@ -53,9 +55,10 @@
-
-
- 点击修改
+
+
+ {{ form.content }}
+ 点击修改
@@ -125,8 +128,8 @@ export default {
type_id: '',
doctor_id: '',
treat_at: Math.floor((new Date).getTime() / 1000),
- origin_price: 0,
- sell_price: 0,
+ origin_price: '',
+ sell_price: '',
order_status: orderStatus.success.value,
content: '',
next_treat_at: '',
@@ -134,28 +137,6 @@ export default {
notify_at: '',
notify_remarks: ''
},
- rules: {
- 'treat_at': {
- required: true,
- message: '必填',
- trigger: ['blur', 'change']
- },
- 'doctor_id': {
- required: true,
- message: '必填',
- trigger: ['blur', 'change']
- },
- 'origin_price': {
- required: true,
- message: '必填',
- trigger: ['blur', 'change']
- },
- 'sell_price': {
- required: true,
- message: '必填',
- trigger: ['blur', 'change']
- },
- },
typeList: [],
patient: {},
datePicker: {
@@ -174,32 +155,39 @@ export default {
},
onLoad(e) {
this.id = e.id
- if (!e.id) {
- uni.setNavigationBarTitle({
- title: '添加病历'
- })
- if (!e.patient) {
- return uni.showModal({
- title: '请选择病人',
- showCancel: false,
- success: () => {
- uni.navigateBack()
- }
- })
- }
- const params = { _action: 'getData' }
- this.$ajax.get(`/admin-api/patient/${e.patient}`, { params }).then(res => {
- if (res.status == 0) {
- this.patient = res.data
- this.form.patient_id = this.patient.id
+ this.form.patient_id = e.patient
+ this.form.type_id = e.type
+ this.init()
+ },
+ methods: {
+ async init() {
+ let res
+ res = await this.$ajax.get('/admin-api/category', { params: {_action: 'getData'}})
+ if (res.status == 0) {
+ this.typeList = res.data.items
+ let type_id = this.form.type_id
+ if (!type_id) {
+ type_id = uni.getStorageSync('medical_record_treat_type_id')
}
- })
- } else {
- uni.setNavigationBarTitle({
- title: '修改病历'
- })
+ if (type_id) {
+ this.form.type_id = parseInt(type_id)
+ this.typeChange(type_id)
+ }
+ }
+ res = await this.$ajax.get('/admin-api/current-user')
+ if (res.status == 0) {
+ this.currentUser = res.data
+ this.form.doctor_id = this.currentUser.id
+ this.adminUser.doctor_name = this.currentUser.name
+ this.form.notify_user_id = this.currentUser.id
+ this.adminUser.notify_user_name = this.currentUser.name
+ }
+ if (this.id) {
+ uni.setNavigationBarTitle({
+ title: '修改病历'
+ })
- this.$ajax.get(`/admin-api/record/${e.id}`, { params: {_action: 'getData'}}).then(res => {
+ res = await this.$ajax.get(`/admin-api/record/${this.id}`, { params: {_action: 'getData'}})
if (res.status == 0) {
this.info = res.data
this.patient = res.data.patient
@@ -218,45 +206,34 @@ export default {
notify_remarks: this.info.notify_remarks
}
}
- })
- }
- this.$ajax.get('/admin-api/category', { params: {_action: 'getData'}}).then(res => {
- if (res.status == 0) {
- this.typeList = res.data.items
- let type_id = e.type_id
- if (!type_id) {
- type_id = uni.getStorageSync('medical_record_treat_type_id')
+ } else {
+ uni.setNavigationBarTitle({
+ title: '添加病历'
+ })
+ if (!this.form.patient_id) {
+ return uni.showModal({
+ title: '请选择病人',
+ showCancel: false,
+ success: () => {
+ uni.navigateBack()
+ }
+ })
}
- if (type_id) {
- this.form.type_id = parseInt(type_id)
- this.typeChange(type_id)
+ const params = { _action: 'getData' }
+ res = await this.$ajax.get(`/admin-api/patient/${this.form.patient_id}`, { params })
+ if (res.status == 0) {
+ this.patient = res.data
}
}
- })
- this.$ajax.get('/admin-api/current-user').then(res => {
- if (res.status == 0) {
- this.currentUser = res.data
- this.form.doctor_id = this.currentUser.id
- this.adminUser.doctor_name = this.currentUser.name
- this.form.notify_user_id = this.currentUser.id
- this.adminUser.notify_user_name = this.currentUser.name
- }
- })
- },
- onReady() {
- this.$refs['form'].setRules(this.rules)
- },
- methods: {
+ },
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.form.id = this.id
@@ -324,7 +301,7 @@ export default {
this.$refs['editor'].open(this.form.content)
},
confirmEditor(e) {
- this.form.content = e.html
+ this.form.content = e
}
}
}
diff --git a/src/pages/record/index.vue b/src/pages/record/index.vue
index 2c49f4c..41f8636 100644
--- a/src/pages/record/index.vue
+++ b/src/pages/record/index.vue
@@ -167,7 +167,7 @@ export default {
},
add() {
const type = this.typeList[this.typeIndex]
- return uni.navigateTo({ url: `/pages/record/form?patient=${this.patient_id}&type_id=${type.id}` })
+ return uni.navigateTo({ url: `/pages/record/form?patient=${this.patient_id}&type=${type.id}` })
}
}
}