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