Browse Source

收藏患者相关功能待完成

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

72
src/components/360View/collection.vue

@ -82,7 +82,7 @@ export default {
return {
dialogFormVisible: false,
remark: '',
curId: '',
curNode: '',
editName: '',
editMessage: '',
disabled: false, //
@ -123,7 +123,6 @@ export default {
//
initPatient() {
this.findTree()
this.queryPatientRemarks()
},
//
async queryPatientRemarks() {
@ -134,7 +133,21 @@ export default {
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() {
@ -145,6 +158,7 @@ export default {
}
})
this.collectData = data.data
await this.queryPatientRemarks()
},
//
// async patientTrees() {
@ -158,7 +172,7 @@ export default {
// console.log('', data)
// },
levelClick(data) {
this.curId = data.id
this.curNode = data
},
searchRemark(data) {
// this.treeId = data.id
@ -171,7 +185,7 @@ export default {
patientId: this.patientId,
platform: this.platform,
remark: this.remark,
treeId: this.curId
treeId: this.curNode.id
}
this.$http.post('/tree/addPatientTree', params).then(() => {
this.editMessage = '收藏成功!'
@ -180,7 +194,6 @@ export default {
type: 'success'
})
this.findTree()
this.queryPatientRemarks()
})
},
//
@ -221,7 +234,12 @@ export default {
...this.addParam
}
this.disabled = true
await this.$http.post('/tree/addTree', params)
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)
}
this.dialogFormVisible = false
await this.findTree()
},
@ -236,20 +254,34 @@ export default {
},
//
deleteNode(node, data) {
const params = {
doctorId: this.doctorId,
flag: '1',
name: data.label,
platform: this.platform,
id: data.id
}
this.$http.post('/tree/deleteTree', params).then(() => {
this.$message({
message: '删除成功!',
type: 'success'
if (this.curNode.patientId) {
this.$confirmFun('你确定要删除吗?').then(() => {
this.$http.post('/tree/deletePatientTree', { ...this.curNode }).then(() => {
this.$message({
message: '删除成功!',
type: 'success'
})
this.findTree()
})
})
})
this.findTree()
} else {
const params = {
doctorId: this.doctorId,
flag: '1',
name: data.label,
platform: this.platform,
id: data.id
}
this.$confirmFun('你确定要删除吗?').then(() => {
this.$http.post('/tree/deleteTree', params).then(() => {
this.$message({
message: '删除成功!',
type: 'success'
})
this.findTree()
})
})
}
},
//
editNode(node, data) {

Loading…
Cancel
Save