Browse Source

打印部分功能恢复

360view
bianyaqi 2 years ago
parent
commit
59f34f6cc5
  1. 80
      src/components/360View/collection.vue
  2. 9
      src/components/360View/commonForm/optometryForm.vue
  3. 3
      src/components/360View/medicalRecord/outPatientRecord/index.vue

80
src/components/360View/collection.vue

@ -8,14 +8,13 @@
:data="collectData"
node-key="id"
: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>{{ node.label }}</span>
</span>
<span>
<el-dropdown v-if="!data.treeId" trigger="click" @command="(command)=>addNode(command,node,data)">
<el-dropdown v-if="!data.patientId" trigger="click" @command="(command)=>addNode(command,node,data)">
<span>
<i class="el-icon-plus" />
</span>
@ -27,7 +26,8 @@
<el-dropdown trigger="click" style="margin-left: 10px" @command="(command)=>handleNode(command,node,data)">
<span>···</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="rename">重命名</el-dropdown-item>
<el-dropdown-item v-if="!data.patientId" command="rename">重命名</el-dropdown-item>
<el-dropdown-item v-else command="edit">编辑</el-dropdown-item>
<el-dropdown-item command="delete">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -82,6 +82,7 @@ export default {
curNode: '',
editName: '',
editMessage: '',
curPatient: {}, // id
disabled: false, //
addParam: {
id: '',
@ -128,17 +129,23 @@ export default {
patient: this.patientId,
platform: this.platform
}).then(res => {
console.log(res.data)
// console.log(res.data)
})
},
findTreePatient() {
this.$http.get('/tree/findPatientTree', {
this.$http.get('/tree/findPatientTree', { params: {
limit: 10,
page: 1,
platform: this.platform,
treeId: this.curNode.id
}).then(res => {
console.log(res)
}}).then(res => {
this.curPatient = res.data.data.list.map(item => {
return {
name: item.patientName,
...item
}
})
this.handlePatientList(this.collectData)
})
},
//
@ -150,23 +157,22 @@ export default {
platform: this.platform
}
})
this.collectData = this.handlePatientList(data.data)
this.collectData = data.data
},
//
handlePatientList(arr) {
arr.forEach(item => {
if (!item.childs && item.hisManagePatientEntity) {
handlePatientList(data) {
data.forEach(item => {
if (!item.childs) {
item.childs = []
}
if (item.hisManagePatientEntity) {
this.$set(item.hisManagePatientEntity, 'name', item.hisManagePatientEntity.remark)
item.childs.push(item.hisManagePatientEntity)
}
if (item.childs && item.childs.length) {
if (this.curNode.id === item.id) {
const arr = _.uniqWith(item.childs.concat(this.curPatient), (item1, item2) => item1.id === item2.id)
this.$set(item, 'childs', arr)
} else {
this.handlePatientList((item.childs))
}
})
return arr
return data
},
//
async findTree() {
@ -176,7 +182,6 @@ export default {
platform: this.platform
}
})
this.collectData = data.data
await this.queryPatientRemarks()
},
//
@ -256,39 +261,32 @@ export default {
...this.addParam
}
this.disabled = true
if (this.curNode.patientId) {
this.curNode.name = this.editName
this.curNode.remark = this.editName
await this.$http.post('/tree/addPatientTree', { ...this.curNode })
this.$message({
message: this.editMessage,
type: 'success'
})
} else {
await this.$http.post('/tree/addTree', params)
this.$message({
message: this.editMessage,
type: 'success'
})
}
await this.$http.post('/tree/addTree', params)
this.$message({
message: this.editMessage,
type: 'success'
})
this.dialogFormVisible = false
await this.findTree()
},
//
handleNode(command, node, data) {
if (command === 'delete') {
this.deleteNode(node, data)
} else {
this.disabled = false
console.log(this.curNode)
this.editNode(node, data)
switch (command) {
case 'rename':
this.disabled = false
this.editNode(node, data)
break
case 'delete':
this.deleteNode(node, data)
break
case 'edit':
}
},
//
deleteNode(node, data) {
if (this.curNode.patientId) {
if (data.patientId) {
this.$confirmFun('你确定要删除吗?').then(() => {
this.$http.post('/tree/deletePatientTree', { ...this.curNode }).then(() => {
this.$http.post('/tree/deletePatientTree', { ...data }).then(() => {
this.$message({
message: '删除成功!',
type: 'success'

9
src/components/360View/commonForm/optometryForm.vue

@ -313,7 +313,6 @@
</div>
</template>
<script>
import { getLodop } from '@/utils/LodopFuncs'
export default {
props: {
isSearch: {
@ -429,14 +428,6 @@ export default {
// this.queryData()
},
methods: {
doPrint() {
const html = document.getElementById('optomeFunc').innerHTML
const lodop = getLodop()
console.log(lodop)
lodop.ADD_PRINT_HTM('2%', '5%', '100%', '100%', html)
lodop.SET_PRINT_PAGESIZE(2, 0, 0, 'A5')
lodop.PREVIEW()
},
setData() {
this.dataForm = this.formContent.a
this.tableData = this.formContent.b

3
src/components/360View/medicalRecord/outPatientRecord/index.vue

@ -99,8 +99,7 @@ export default {
flag: '', // 1 2 3 4 5
comonFormActive: '1',
printAll: {
id: 'allForeForm',
beforeOpenCallback() { console.log('开始打印前') }
id: 'allForeForm'
}
}
},

Loading…
Cancel
Save