Browse Source

代码冲突解决

360view
bianyaqi 2 years ago
parent
commit
faaa64d032
  1. 62
      src/components/360View/afterPart/index.vue
  2. 28
      src/components/360View/forePart/index.vue
  3. 6
      src/components/360View/medicalRecord/outPatientRecord/afterForm.vue
  4. 79
      src/components/360View/medicalRecord/outPatientRecord/foreForm.vue

62
src/components/360View/afterPart/index.vue

@ -103,6 +103,7 @@ export default {
type: '', type: '',
doctorId: '', doctorId: '',
deleteId: '', deleteId: '',
treeFlag: '',
treeId: '', treeId: '',
treeName: '', treeName: '',
weight: '', weight: '',
@ -119,6 +120,7 @@ export default {
name: '黄斑' name: '黄斑'
}, { }, {
name: '黄斑', name: '黄斑',
sort: 99,
id: 14, id: 14,
type: 'hangman', type: 'hangman',
od: '', od: '',
@ -143,6 +145,7 @@ export default {
name: '视网膜' name: '视网膜'
}, { }, {
name: '视网膜', name: '视网膜',
sort: 99,
id: 17, id: 17,
type: 'showing', type: 'showing',
od: '', od: '',
@ -151,6 +154,7 @@ export default {
name: '脉络膜' name: '脉络膜'
}, { }, {
name: '脉络膜', name: '脉络膜',
sort: 99,
id: 18, id: 18,
type: 'mailbomb', type: 'mailbomb',
od: '', od: '',
@ -159,6 +163,7 @@ export default {
name: '玻璃体 vitreous' name: '玻璃体 vitreous'
}, { }, {
name: '玻璃体 vitreous', name: '玻璃体 vitreous',
sort: 99,
id: 19, id: 19,
type: 'blit', type: 'blit',
od: '', od: '',
@ -167,6 +172,7 @@ export default {
name: '血管' name: '血管'
}, { }, {
name: '血管', name: '血管',
sort: 99,
id: 20, id: 20,
type: 'began', type: 'began',
od: '', od: '',
@ -175,6 +181,7 @@ export default {
name: '巩膜' name: '巩膜'
}, { }, {
name: '巩膜', name: '巩膜',
sort: 99,
id: 21, id: 21,
type: 'gong', type: 'gong',
od: '', od: '',
@ -183,6 +190,7 @@ export default {
name: '边缘 periphery' name: '边缘 periphery'
}, { }, {
name: '边缘 periphery', name: '边缘 periphery',
sort: 99,
id: 22, id: 22,
type: 'banyan', type: 'banyan',
od: '', od: '',
@ -240,8 +248,9 @@ export default {
}, },
// //
addAfterData() { addAfterData() {
if (!this.multipleSelection.length) return this.$message.warning('请勾选数据!')
const data = this.multipleSelection.filter(item => { const data = this.multipleSelection.filter(item => {
return item.id >= 1
return item.type !== undefined
}) })
eventBus.$emit('sendForData', data) eventBus.$emit('sendForData', data)
}, },
@ -260,7 +269,12 @@ export default {
item.forEach(row => { item.forEach(row => {
this.tableData.forEach(e => { this.tableData.forEach(e => {
if (e.type === row.type) { if (e.type === row.type) {
e.data = [row]
e.data = item
const sort = item.sort
item.sort = ''
this.$nextTick(() => {
item.sort = sort
})
} }
}) })
}) })
@ -278,12 +292,24 @@ export default {
this.tableData.forEach(item => { this.tableData.forEach(item => {
if (item.sort) { if (item.sort) {
item.od = item.os item.od = item.os
item.odValue = item.osValue
const sort = item.sort
item.sort = ''
this.$nextTick(() => {
item.sort = sort
})
} }
}) })
} else { } else {
this.tableData.forEach(item => { this.tableData.forEach(item => {
if (item.sort) { if (item.sort) {
item.os = item.od item.os = item.od
item.osValue = item.odValue
const sort = item.sort
item.sort = ''
this.$nextTick(() => {
item.sort = sort
})
} }
}) })
} }
@ -292,18 +318,25 @@ export default {
moveHandle(value) { moveHandle(value) {
if (value.type === 1) { if (value.type === 1) {
this.tableData[value.index].od = value.row this.tableData[value.index].od = value.row
this.tableData[value.index].odValue = value.row.osValue
} else { } else {
this.tableData[value.index].os = value.row this.tableData[value.index].os = value.row
this.tableData[value.index].osValue = value.row.odValue
} }
const sort = this.tableData[value.index].sort
this.tableData[value.index].sort = ''
this.$nextTick(() => {
this.tableData[value.index].sort = sort
})
}, },
// //
async saveAfter() { async saveAfter() {
const params = { const params = {
flag: 3, // 1234
flag: '3', // 1234
jsonText: JSON.stringify(this.tableData), jsonText: JSON.stringify(this.tableData),
name: '后段检查', name: '后段检查',
patientId: this.patientId, patientId: this.patientId,
platform: 1
platform: '1'
} }
let url = '' let url = ''
if (this.collectId) { if (this.collectId) {
@ -334,6 +367,7 @@ export default {
this.form.name = '' this.form.name = ''
this.type = value.event.type this.type = value.event.type
this.parentId = value.event.id this.parentId = value.event.id
this.treeFlag = value.event.flag
this.dialogFormVisible = true this.dialogFormVisible = true
}, },
// - // -
@ -341,7 +375,7 @@ export default {
const params = { const params = {
doctorId: this.doctorId, doctorId: this.doctorId,
name: this.form.name, name: this.form.name,
flag: 1, // 1,2
flag: this.treeFlag, // 1,2
type: this.type, type: this.type,
parentId: this.parentId, parentId: this.parentId,
platform: 1 platform: 1
@ -422,19 +456,13 @@ export default {
templateData(data, node) { templateData(data, node) {
if (data && data.caseJson) { if (data && data.caseJson) {
this.tableData = JSON.parse(data.caseJson) this.tableData = JSON.parse(data.caseJson)
//
this.$nextTick(() => {
this.tableData.forEach(item => {
this.$refs.multipleTable.toggleRowSelection(item, true)
})
})
} else { } else {
this.tableData = _.cloneDeep(this.sourceData) this.tableData = _.cloneDeep(this.sourceData)
} }
}, },
// //
handleTemplate() { handleTemplate() {
if (!this.multipleSelection.length) return this.$message.warning('请勾选模板内容!')
// if (!this.multipleSelection.length) return this.$message.warning('!')
this.form.name = '' this.form.name = ''
this.queryTemplate() this.queryTemplate()
this.templateFlag = true this.templateFlag = true
@ -445,8 +473,9 @@ export default {
}, },
// //
async saveTreeTemplete() { async saveTreeTemplete() {
if (!this.treeId) return this.$message.warning('请选择节点!')
const params = { const params = {
caseJson: JSON.stringify(this.multipleSelection),
caseJson: JSON.stringify(this.tableData),
doctorId: this.doctorId, doctorId: this.doctorId,
name: this.form.name, name: this.form.name,
type: 3, // 2 3 type: 3, // 2 3
@ -455,7 +484,7 @@ export default {
const { data: res } = await this.$http.post('/treetemplate/addTreeCase', params) const { data: res } = await this.$http.post('/treetemplate/addTreeCase', params)
if (res.code === 0) { if (res.code === 0) {
this.templateFlag = false this.templateFlag = false
this.queryTreeCase()
await this.queryTreeCase()
this.$message.success('保存成功') this.$message.success('保存成功')
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
@ -517,8 +546,8 @@ export default {
const { data: res } = await this.$http.post(url, params) const { data: res } = await this.$http.post(url, params)
if (res.code === 0) { if (res.code === 0) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.queryTreeCase()
this.getforeList('2')
await this.queryTreeCase()
await this.getforeList('3')
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
} }
@ -576,7 +605,6 @@ export default {
}) })
if (res.code === 0) { if (res.code === 0) {
this.treeCaseList = this.fn(res.data) this.treeCaseList = this.fn(res.data)
console.log(this.treeCaseList)
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
} }

28
src/components/360View/forePart/index.vue

@ -29,6 +29,7 @@
<fore-form <fore-form
:table-data="tableData" :table-data="tableData"
@handleSelectionChange="handleSelectionChange" @handleSelectionChange="handleSelectionChange"
@selection="selection"
@addTree="addTree" @addTree="addTree"
/> />
</div> </div>
@ -275,6 +276,33 @@ export default {
this.$message.error(res.msg) this.$message.error(res.msg)
} }
}, },
selection(value) {
if (!value.val.id) {
const data = this.tableData.filter(item => item.name === value.val.name)
if (value.val.flag) {
data.forEach(row => {
row.flag = false
this.$refs.multipleTable.toggleRowSelection(row, false)
})
} else {
data.forEach(row => {
row.flag = true
this.$refs.multipleTable.toggleRowSelection(row, true)
})
}
} else {
const data = this.tableData.filter(item => item.id === value.val.id)
if (value.val.flag) {
data.forEach(row => {
row.flag = false
})
} else {
data.forEach(row => {
row.flag = true
})
}
}
},
// //
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val

6
src/components/360View/medicalRecord/outPatientRecord/afterForm.vue

@ -16,7 +16,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span v-if="!scope.row.sort && scope.row.id">
<span v-if="scope.row.sort === 99">
<treeSelect v-model="scope.row.od" :options="scope.row.data" :props="treeProps" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'od', $event)" @add="addTree(scope.row, $event)" @remove="removeTree" /> <treeSelect v-model="scope.row.od" :options="scope.row.data" :props="treeProps" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'od', $event)" @add="addTree(scope.row, $event)" @remove="removeTree" />
</span> </span>
<span v-if="!scope.row.sort && !scope.row.id">{{ scope.row.name }}</span> <span v-if="!scope.row.sort && !scope.row.id">{{ scope.row.name }}</span>
@ -35,7 +35,7 @@
width="120" width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.sort&&!isPrint">
<div v-if="scope.row.id">
<p @click="moveHandle(scope.$index,1, scope.row.os)"><i class="el-icon-back" /></p> <p @click="moveHandle(scope.$index,1, scope.row.os)"><i class="el-icon-back" /></p>
<p style="margin-top: 5px" @click="moveHandle(scope.$index,2, scope.row.od)"><i class="el-icon-back" style="transform: rotateY(180deg)" /></p> <p style="margin-top: 5px" @click="moveHandle(scope.$index,2, scope.row.od)"><i class="el-icon-back" style="transform: rotateY(180deg)" /></p>
</div> </div>
@ -48,7 +48,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span v-if="!scope.row.sort && scope.row.id">
<span v-if="scope.row.sort === 99">
<treeSelect v-model="scope.row.os" :options="scope.row.data" :props="treeProps" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'os', $event)" @add="addTree(scope.row, $event)" /> <treeSelect v-model="scope.row.os" :options="scope.row.data" :props="treeProps" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'os', $event)" @add="addTree(scope.row, $event)" />
</span> </span>
<span v-if="!scope.row.sort && !scope.row.id">{{ scope.row.name }}</span> <span v-if="!scope.row.sort && !scope.row.id">{{ scope.row.name }}</span>

79
src/components/360View/medicalRecord/outPatientRecord/foreForm.vue

@ -4,7 +4,7 @@
ref="multipleTable" ref="multipleTable"
:data="tableData" :data="tableData"
style="margin: 8px 8px 0 0" style="margin: 8px 8px 0 0"
@selection-change="handleSelectionChange"
@select="selection"
> >
<el-table-column <el-table-column
type="selection" type="selection"
@ -17,13 +17,37 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span v-if="scope.row.sort === 1"> <span v-if="scope.row.sort === 1">
<span style="margin-right: 16px">结膜充血</span><treeSelect v-model="scope.row.od" :props="treeProps" style="display: inline-block;width: 60%" :options="scope.row.data" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'od', $event)" @add="addTree(scope.row, $event)" />
<span style="margin-right: 16px">结膜充血</span><treeSelect
v-model="scope.row.od"
:props="treeProps"
style="display: inline-block;width: 60%"
:options="scope.row.data"
:multiple="true"
:filterable="true"
:check-strictly="true"
:default-expand-all="true"
@handleNode="handleNode(scope.$index,'od', $event)"
@add="addTree(scope.row, $event)"
@remove="removeTree"
/>
</span> </span>
<span v-if="scope.row.sort === 2"> <span v-if="scope.row.sort === 2">
<span style="margin-right: 16px">结膜分泌物</span><treeSelect v-model="scope.row.od" :props="treeProps" style="display: inline-block;width: 60%" :options="scope.row.data" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'od', $event)" @add="addTree(scope.row, $event)" />
<span style="margin-right: 16px">结膜分泌物</span><treeSelect
v-model="scope.row.od"
:props="treeProps"
style="display: inline-block;width: 60%"
:options="scope.row.data"
:multiple="true"
:filterable="true"
:check-strictly="true"
:default-expand-all="true"
@handleNode="handleNode(scope.$index,'od', $event)"
@add="addTree(scope.row, $event)"
@remove="removeTree"
/>
</span> </span>
<span v-if="!scope.row.sort && scope.row.id">
<treeSelect v-model="scope.row.od" :options="scope.row.data" :props="treeProps" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'od', $event)" @add="addTree(scope.row, $event)" />
<span v-if="scope.row.sort === 99">
<treeSelect v-model="scope.row.od" :options="scope.row.data" :props="treeProps" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'od', $event)" @add="addTree(scope.row, $event)" @remove="removeTree" />
</span> </span>
<span v-if="!scope.row.sort && !scope.row.id">{{ scope.row.name }}</span> <span v-if="!scope.row.sort && !scope.row.id">{{ scope.row.name }}</span>
</div> </div>
@ -35,9 +59,9 @@
width="120" width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.sort&&!isPrint">
<p @click="moveHandle(scope.$index,1, scope.row.os)"><i class="el-icon-back" /></p>
<p style="margin-top: 5px" @click="moveHandle(scope.$index,2, scope.row.od)"><i class="el-icon-back" style="transform: rotateY(180deg)" /></p>
<div>
<p @click="moveHandle(scope.$index,1, scope.row)"><i class="el-icon-back" /></p>
<p style="margin-top: 5px" @click="moveHandle(scope.$index,2, scope.row)"><i class="el-icon-back" style="transform: rotateY(180deg)" /></p>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -49,8 +73,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span v-if="scope.row.sort === 1"> <span v-if="scope.row.sort === 1">
<span style="margin-right: 16px">结膜充血</span>
<treeSelect
<span style="margin-right: 16px">结膜充血</span><treeSelect
v-model="scope.row.os" v-model="scope.row.os"
:props="treeProps" :props="treeProps"
style="display: inline-block;width: 60%" style="display: inline-block;width: 60%"
@ -61,11 +84,11 @@
:default-expand-all="true" :default-expand-all="true"
@handleNode="handleNode(scope.$index,'os', $event)" @handleNode="handleNode(scope.$index,'os', $event)"
@add="addTree(scope.row, $event)" @add="addTree(scope.row, $event)"
@remove="removeTree"
/> />
</span> </span>
<span v-if="scope.row.sort === 2"> <span v-if="scope.row.sort === 2">
<span style="margin-right: 16px">结膜分泌物</span>
<treeSelect
<span style="margin-right: 16px">结膜分泌物</span><treeSelect
v-model="scope.row.os" v-model="scope.row.os"
:props="treeProps" :props="treeProps"
style="display: inline-block;width: 60%" style="display: inline-block;width: 60%"
@ -76,20 +99,11 @@
:default-expand-all="true" :default-expand-all="true"
@handleNode="handleNode(scope.$index,'os', $event)" @handleNode="handleNode(scope.$index,'os', $event)"
@add="addTree(scope.row, $event)" @add="addTree(scope.row, $event)"
@remove="removeTree"
/> />
</span> </span>
<span v-if="!scope.row.sort && scope.row.id">
<treeSelect
v-model="scope.row.os"
:options="scope.row.data"
:props="treeProps"
:multiple="true"
:filterable="true"
:check-strictly="true"
:default-expand-all="true"
@handleNode="handleNode(scope.$index,'os', $event)"
@add="addTree(scope.row, $event)"
/>
<span v-if="scope.row.sort === 99">
<treeSelect v-model="scope.row.os" :options="scope.row.data" :props="treeProps" :multiple="true" :filterable="true" :check-strictly="true" :default-expand-all="true" @handleNode="handleNode(scope.$index,'os', $event)" @add="addTree(scope.row, $event)" @remove="removeTree" />
</span> </span>
<span v-if="!scope.row.sort && !scope.row.id">{{ scope.row.name }}</span> <span v-if="!scope.row.sort && !scope.row.id">{{ scope.row.name }}</span>
</div> </div>
@ -131,10 +145,17 @@ export default {
// //
moveHandle(index, type, row) { moveHandle(index, type, row) {
if (type === 1) { if (type === 1) {
this.tableData[index].od = row
this.tableData[index].od = row.os
this.tableData[index].odValue = row.osValue
} else { } else {
this.tableData[index].os = row
this.tableData[index].os = row.od
this.tableData[index].osValue = row.odValue
} }
const sort = this.tableData[index].sort
this.tableData[index].sort = ''
this.$nextTick(() => {
this.tableData[index].sort = sort
})
}, },
handleNode(index, type, event) { handleNode(index, type, event) {
if (type === 'os') { if (type === 'os') {
@ -145,6 +166,12 @@ export default {
}, },
addTree(item, event) { addTree(item, event) {
this.$emit('addTree', { item, event }) this.$emit('addTree', { item, event })
},
removeTree(item) {
this.$emit('removeTree', item)
},
selection(selection, val) {
this.$emit('selection', { selection, val })
} }
} }
} }

Loading…
Cancel
Save