Browse Source

打印部分功能恢复

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

66
src/components/360View/collection.vue

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

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

@ -313,7 +313,6 @@
</div> </div>
</template> </template>
<script> <script>
import { getLodop } from '@/utils/LodopFuncs'
export default { export default {
props: { props: {
isSearch: { isSearch: {
@ -429,14 +428,6 @@ export default {
// this.queryData() // this.queryData()
}, },
methods: { 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() { setData() {
this.dataForm = this.formContent.a this.dataForm = this.formContent.a
this.tableData = this.formContent.b 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 flag: '', // 1 2 3 4 5
comonFormActive: '1', comonFormActive: '1',
printAll: { printAll: {
id: 'allForeForm',
beforeOpenCallback() { console.log('开始打印前') }
id: 'allForeForm'
} }
} }
}, },

Loading…
Cancel
Save