Browse Source

收藏患者相关功能待完成

360view
bianyaqi 2 years ago
parent
commit
fa2b672a2e
  1. 46
      src/components/360View/collection.vue

46
src/components/360View/collection.vue

@ -82,7 +82,7 @@ export default {
return { return {
dialogFormVisible: false, dialogFormVisible: false,
remark: '', remark: '',
curId: '',
curNode: '',
editName: '', editName: '',
editMessage: '', editMessage: '',
disabled: false, // disabled: false, //
@ -123,7 +123,6 @@ export default {
// //
initPatient() { initPatient() {
this.findTree() this.findTree()
this.queryPatientRemarks()
}, },
// //
async queryPatientRemarks() { async queryPatientRemarks() {
@ -134,7 +133,21 @@ export default {
platform: this.platform platform: this.platform
} }
}) })
console.log('备注', data)
// this.tableData =
this.collectData = this.handlePatientList(data.data)
},
handlePatientList(arr) {
arr.forEach(item => {
if (!item.childs) {
item.childs = []
}
if (item.hisManagePatientEntity) {
this.$set(item.hisManagePatientEntity, 'name', item.hisManagePatientEntity.remark)
item.childs.push(item.hisManagePatientEntity)
this.handlePatientList(item.childs)
}
})
return arr
}, },
// //
async findTree() { async findTree() {
@ -145,6 +158,7 @@ export default {
} }
}) })
this.collectData = data.data this.collectData = data.data
await this.queryPatientRemarks()
}, },
// //
// async patientTrees() { // async patientTrees() {
@ -158,7 +172,7 @@ export default {
// console.log('', data) // console.log('', data)
// }, // },
levelClick(data) { levelClick(data) {
this.curId = data.id
this.curNode = data
}, },
searchRemark(data) { searchRemark(data) {
// this.treeId = data.id // this.treeId = data.id
@ -171,7 +185,7 @@ export default {
patientId: this.patientId, patientId: this.patientId,
platform: this.platform, platform: this.platform,
remark: this.remark, remark: this.remark,
treeId: this.curId
treeId: this.curNode.id
} }
this.$http.post('/tree/addPatientTree', params).then(() => { this.$http.post('/tree/addPatientTree', params).then(() => {
this.editMessage = '收藏成功!' this.editMessage = '收藏成功!'
@ -180,7 +194,6 @@ export default {
type: 'success' type: 'success'
}) })
this.findTree() this.findTree()
this.queryPatientRemarks()
}) })
}, },
// //
@ -221,7 +234,12 @@ export default {
...this.addParam ...this.addParam
} }
this.disabled = true this.disabled = true
if (this.curNode.patientId) {
this.curNode.name = this.editName
await this.$http.post('/tree/addPatientTree', { ...this.curNode })
} else {
await this.$http.post('/tree/addTree', params) await this.$http.post('/tree/addTree', params)
}
this.dialogFormVisible = false this.dialogFormVisible = false
await this.findTree() await this.findTree()
}, },
@ -236,6 +254,17 @@ export default {
}, },
// //
deleteNode(node, data) { deleteNode(node, data) {
if (this.curNode.patientId) {
this.$confirmFun('你确定要删除吗?').then(() => {
this.$http.post('/tree/deletePatientTree', { ...this.curNode }).then(() => {
this.$message({
message: '删除成功!',
type: 'success'
})
this.findTree()
})
})
} else {
const params = { const params = {
doctorId: this.doctorId, doctorId: this.doctorId,
flag: '1', flag: '1',
@ -243,13 +272,16 @@ export default {
platform: this.platform, platform: this.platform,
id: data.id id: data.id
} }
this.$confirmFun('你确定要删除吗?').then(() => {
this.$http.post('/tree/deleteTree', params).then(() => { this.$http.post('/tree/deleteTree', params).then(() => {
this.$message({ this.$message({
message: '删除成功!', message: '删除成功!',
type: 'success' type: 'success'
}) })
})
this.findTree() this.findTree()
})
})
}
}, },
// //
editNode(node, data) { editNode(node, data) {

Loading…
Cancel
Save