Browse Source

'收藏患者功能待实现'

360view
bianyaqi 2 years ago
parent
commit
3340fa01d3
  1. 35
      src/components/360View/collection.vue

35
src/components/360View/collection.vue

@ -8,11 +8,12 @@
:data="collectData"
node-key="id"
default-expand-all
:props="defaultProps"
:expand-on-click-node="false"
>
<span slot-scope="{ node, data }" class="custom-tree-node" @click="levelClick(data)">
<span style="display: inline-block;min-width: 100px">
<span>{{ data.name }}</span>
<span>{{ node.label }}</span>
</span>
<span>
<el-dropdown trigger="click" @command="(command)=>addNode(command,node,data)">
@ -35,7 +36,7 @@
</span>
</el-tree>
<el-dialog :modal-append-to-body="false" width="30%" title="节点名称" :visible.sync="dialogFormVisible">
<el-input ref="renameRef" v-model="editName" @change="confirmNode" />
<el-input ref="renameRef" v-model="editName" />
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" :disabled="disabled" @click="confirmNode()"> </el-button>
@ -86,12 +87,16 @@ export default {
editMessage: '',
disabled: false, //
addParam: {
id: 0,
id: '',
parentId: 0
},
doctorId: JSON.parse(window.localStorage.getItem('qg-userData')).id,
collectData: [],
tableData: []
tableData: [],
defaultProps: {
children: 'childs',
label: 'name'
}
}
},
watch: {
@ -101,6 +106,14 @@ export default {
this.$refs.renameRef.focus()
})
}
},
collectData(val) {
if (!val.length) {
this.disabled = false
this.addParam.id = ''
this.addParam.parentId = 0
this.editName = ''
}
}
},
async created() {
@ -154,8 +167,7 @@ export default {
},
handleAddPatient() {
const params = {
createDate: new Date().getDate(),
id: 0,
createDate: this.$moment().format('YYYY-MM-DD HH:mm:ss'),
patientId: this.patientId,
platform: this.platform,
remark: this.remark,
@ -167,12 +179,13 @@ export default {
message: this.editMessage,
type: 'success'
})
this.findTree()
this.queryPatientRemarks()
})
},
//
addNode(command, node, data) {
this.editMessage = '添加成功!'
console.log(data)
this.disabled = false
switch (command) {
//
@ -223,16 +236,12 @@ export default {
},
//
deleteNode(node, data) {
this.addParam.id = node.id
this.addParam.parentId = node.parent.id
const params = {
createDate: new Date().getDate(),
doctorId: this.doctorId,
flag: '1',
name: data.label,
platform: this.platform,
weight: 1,
id: this.curId
id: data.id
}
this.$http.post('/tree/deleteTree', params).then(() => {
this.$message({
@ -247,6 +256,8 @@ export default {
this.dialogFormVisible = true
this.editName = node.label
this.editMessage = '重命名成功!'
this.addParam.id = data.id
this.addParam.parentId = data.parentId
}
}
}

Loading…
Cancel
Save