Browse Source

病例收集树形结构相关接口调用

360view
bianyaqi 3 years ago
parent
commit
8fb8dcd3aa
  1. 223
      src/components/360View/collection.vue
  2. 8
      src/components/360View/index1.vue
  3. 2
      src/components/360View/medicalRecord/outPatientRecord/index.vue
  4. 356
      src/mixins/view-module.js
  5. 3
      src/page-subspecialty/views/modules/optometryManagement/dioptric/index.vue
  6. 5
      src/page-subspecialty/views/modules/outpatientManagement/call/index.vue
  7. 11
      src/page-subspecialty/views/modules/outpatientManagement/treat/index.vue

223
src/components/360View/collection.vue

@ -1,47 +1,56 @@
<template>
<div class="collection">
<el-tree
:data="tableData"
:props="collectProps"
node-key="id"
default-expand-all
:expand-on-click-node="false"
>
<span slot-scope="{ node, data }" class="custom-tree-node" :name="node.id">
<span style="display: inline-block;min-width: 100px">{{ node.label }}</span>
<span :class="[currentNumber == node.id ? 'active' : 'dis']">
<span class="ml15" @click="delMenu(data)">
<!-- <a-icon type="minus-circle" />-->
</span>
<span class="mr30" @click="addMenu(1,data)">
<!-- <a-icon type="plus-circle" />-->
<div class="collection_title">个人收藏</div>
<div style="flex: 1">
<el-button v-if="!tableData.length" size="mini" @click="dialogFormVisible = true">新增节点</el-button>
<el-tree
v-else
:data="tableData"
:props="collectProps"
node-key="id"
default-expand-all
:expand-on-click-node="false"
>
<span slot-scope="{ node, data }" class="custom-tree-node" :name="node.id">
<span style="display: inline-block;min-width: 100px">
<span>{{ node.label }}</span>
<!-- <el-input v-else v-model="editName" :autofocus="true" @blur="" @change="getRename" />-->
</span>
<span>
<el-button
type="text"
size="mini"
@click="() => addMenu(2,data)"
>
新增子级
</el-button>
<el-button
type="text"
size="mini"
@click="() => editMenu(node, data)"
>
配置
</el-button>
<el-dropdown trigger="click" @command="(command)=>addNode(command,node,data)">
<span>
<i class="el-icon-plus" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="same">新增同级节点</el-dropdown-item>
<el-dropdown-item command="child">新增子级节点</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<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 command="delete">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
</span>
</span>
</el-tree>
<div v-if="collectData.length">
<div style="text-align: center;padding-top: 32px">
<el-input v-model="remark" type="textarea" style="width: 180px;" size="small" clearable placeholder="请输入备注" />
</el-tree>
<el-dialog width="30%" :modal="false" title="节点名称" :visible.sync="dialogFormVisible">
<el-input v-model="editName" />
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="confirmNode()"> </el-button>
</div>
</el-dialog>
</div>
<div>
<div style="display:flex;text-align: center;padding: 16px">
<span>备注</span>
<el-input v-model="remark" style="flex: 1" type="textarea" resize="none" clearable placeholder="请输入备注" />
</div>
<div style="text-align: center;padding-top: 16px">
<el-button style="width: 180px" type="primary" size="small" @click="handleAddPatient">保存</el-button>
<div style="text-align: right;padding:0 16px 16px">
<el-button style="width: 180px" type="primary" size="small" @click="handleAddPatient">收藏当前患者</el-button>
</div>
</div>
</div>
@ -60,20 +69,36 @@ export default {
patientIdNumber: {
type: String,
default: ''
},
platform: {
type: String,
default: ''
},
patientId: {
type: String,
default: ''
}
},
data() {
return {
dialogFormVisible: false,
remark: '',
currentNumber: '',
editName: '',
collectProps: {
// children: 'childs',
// label: 'name'
},
addParam: {
id: 0,
parentId: 0
},
doctorId: JSON.parse(window.localStorage.getItem('qg-userData')).id,
collectData: [],
tableData: [{
id: 1,
label: '一级 1',
isEdit: false,
children: [{
id: 4,
label: '二级 1-1',
@ -87,6 +112,7 @@ export default {
}]
}, {
id: 2,
isEdit: false,
label: '一级 2',
children: [{
id: 5,
@ -97,6 +123,7 @@ export default {
}]
}, {
id: 3,
isEdit: false,
label: '一级 3',
children: [{
id: 7,
@ -115,20 +142,123 @@ export default {
watch: {
},
created() {
async created() {
this.initPatient()
},
mounted() {
},
methods: {
//
initPatient() {
this.findTree()
this.queryPatientRemarks()
},
//
async queryPatientRemarks() {
const { data } = await this.$http.get('/tree/findTreeIsExistPatient', {
params: {
doctorId: this.doctorId,
patientId: this.patientId,
platform: this.platform
}
})
console.log('备注', data)
},
//
async findTree() {
const { data } = await this.$http.get(`/tree/findTree`, {
params: {
doctorId: JSON.parse(window.localStorage.getItem('qg-userData')).id,
platform: this.platform
}
})
console.log('树结构', data)
// this.tableData = data
},
//
// async patientTrees() {
// const { data } = await this.$http.get('/tree/findTreeIsExistPatient', {
// params: {
// doctorId: this.doctorId,
// patientId: this.patientId,
// platform: this.platform
// }
// })
// console.log('', data)
// },
searchRemark(data) {
// this.treeId = data.id
// this.remark = data.hisManagePatientEntity ? data.hisManagePatientEntity.remark : ''
// this.remarkId = data.hisManagePatientEntity ? data.hisManagePatientEntity.id : ''
},
async handleAddPatient() {
handleAddPatient() {
this.$http.post('/tree/addPatientTree', {})
},
//
addNode(command, node) {
switch (command) {
case 'same':
this.dialogFormVisible = true
this.addParam.id = node.id
this.addParam.parentId = node.parent.id
this.editName = node.name
break
case 'child':
this.addParam.id = node.id
this.addParam.parentId = node.parent.id
this.editName = node.name
break
default:
this.addParam.id = 0
this.addParam.parentId = 0
this.editName = ''
break
}
},
//
async confirmNode() {
const params = {
createDate: new Date().getDate(),
doctorId: this.doctorId,
flag: '1',
name: this.editName,
platform: this.platform,
weight: 1,
...this.addParam
}
await this.$http.post('/tree/addTree', params)
await this.findTree()
this.dialogFormVisible = false
},
handleNode(command, node, data) {
if (command === 'delete') {
this.deleteNode(node, data)
} else {
this.editNode(node, data)
}
},
//
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,
...this.addParam
}
this.$http.post('/tree/deleteTree', params)
this.findTree()
},
//
editNode(node, data) {
this.dialogFormVisible = true
this.editName = node.label
this.findTree()
}
}
}
@ -137,6 +267,14 @@ export default {
<style lang="scss" scoped>
.collection {
width: 600px;
display: flex;
flex-direction: column;
justify-content: space-between;
.collection_title{
font-size: 16px;
font-weight: bold;
padding: 18px;
}
.cell-cursor {
cursor: pointer;
color: #1e79ff;
@ -144,5 +282,8 @@ export default {
.table-column-disable {
color: #dddd;
}
::v-deep .el-textarea__inner{
height: 164px;
}
}
</style>

8
src/components/360View/index1.vue

@ -206,7 +206,7 @@
<!-- 数据集-->
<dataInfo v-if="dataType === 2" :source-data="source" :data-list="collectList"/>
<!-- 病历收藏-->
<collection v-if="dataType === 3" />
<collection v-if="dataType === 3" :platform="platform" :patient-id="patientId" />
<!-- 常用业务-->
<business v-if="dataType === 4" />
</drawer>
@ -267,6 +267,10 @@ export default {
isSearch: {
type: String,
default: ''
},
platform: {
type: String,
default: ''
}
},
data() {
@ -276,7 +280,7 @@ export default {
patientBaseData: {},
timeAxisNodeInfo: [], //
source: '', //
collectList: '', //
collectList: [], //
drawerWidth: '',
timeAxisData: [], //
dataType: 1,

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

@ -95,7 +95,7 @@
</el-form>
</el-tab-pane>
<el-tab-pane label="前段检查" name="前段检查" style="height: 100%">
<forePart :patient-id="patientId" />
<!-- <forePart :patient-id="patientId" />-->
</el-tab-pane>
<el-tab-pane label="后段检查" name="后段检查">
<afterPart :patient-id="patientId" />

356
src/mixins/view-module.js

@ -1,178 +1,178 @@
// import Cookies from 'js-cookie'
import qs from 'qs'
// import qs from 'qs'
export default {
data() {
/* eslint-disable */
return {
// 设置属性
mixinViewModuleOptions: {
createdIsNeed: true, // 此页面是否在创建时,调用查询数据列表接口?
activatedIsNeed: false, // 此页面是否在激活(进入)时,调用查询数据列表接口?
getDataListURL: '', // 数据列表接口,API地址
getDataListIsPage: false, // 数据列表接口,是否需要分页?
deleteURL: '', // 删除接口,API地址
deleteIsBatch: false, // 删除接口,是否需要批量?
deleteIsBatchKey: 'id', // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid...
exportURL: '' // 导出接口,API地址
},
// 默认属性
dataForm: {}, // 查询条件
dataList: [], // 数据列表
order: '', // 排序,asc/desc
orderField: '', // 排序,字段
page: 1, // 当前页码
limit: 10, // 每页数
total: 0, // 总条数
dataListLoading: false, // 数据列表,loading状态
dataListSelections: [], // 数据列表,多选项
addOrUpdateVisible: false, // 新增/更新,弹窗visible状态
deleteParams:{}
}
/* eslint-enable */
},
created() {
if (this.mixinViewModuleOptions.createdIsNeed) {
this.getDataList()
}
},
activated() {
if (this.mixinViewModuleOptions.activatedIsNeed) {
this.getDataList()
}
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.mixinViewModuleOptions.getDataListURL ? this.$http.get(
this.mixinViewModuleOptions.getDataListURL, {
params: {
// order: this.order,
// orderField: this.orderField,
page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,
limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,
...this.dataForm
}
}
).then(({ data: res }) => {
this.dataListLoading = false
if (res.code !== 0) {
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data
res.data.drgsName ? this.drgsName = res.data.drgsName : ''
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
}).catch(() => {
this.dataListLoading = false
}) : ''
},
// 多选
dataListSelectionChangeHandle(val) {
this.dataListSelections = val
},
// 排序
dataListSortChangeHandle(data) {
if (!data.order || !data.prop) {
this.order = ''
this.orderField = ''
return false
}
this.order = data.order.replace(/ending$/, '')
this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()
this.getDataList()
},
// 分页, 每页条数
pageSizeChangeHandle(val) {
this.page = 1
this.limit = val
this.getDataList()
},
// 分页, 当前页
pageCurrentChangeHandle(val) {
this.page = val
this.getDataList()
},
// 初始化查询
getDataListInitial() {
this.page = 1
this.getDataList()
},
// 新增 / 修改
addOrUpdateHandle(id, params, title, noParams) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id
noParams ? '' : this.$refs.addOrUpdate.params = params || {}
this.$refs.addOrUpdate.dataForm.title = title
// 存在BUG,params无法覆盖,弃用
// this.$refs.addOrUpdate.dataForm = { id, ...params, title }
this.$refs.addOrUpdate.init()
})
},
// 分配人员
assignPeopleHandle(scope) {
this.currentPeopleId = scope.id
this.dialogVisible = true
// 添加科研人员时,获取人员列表
this.getUserList(scope.id)
},
// 关闭当前窗口
closeCurrentTab(data) {
var tabName = this.$store.state.contentTabsActiveName
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
return false
}
if (tabName === this.$store.state.contentTabsActiveName) {
this.$router.push({ name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name })
}
},
// 删除
deleteHandle(id, callback) {
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { handle: this.$t('delete') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
(Array.isArray(id) ? this.$http({
url: this.mixinViewModuleOptions.deleteURL,
method: 'delete',
data: id
}) : this.$http.delete(this.mixinViewModuleOptions.deleteURL + `/${id}`)).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
callback ? callback() : this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {})
},
// 导出
exportHandle() {
// var params = qs.stringify({
// token: Cookies.get('qg-token'),
// ...this.dataForm
// })
// window.location.href = `${window.SITE_CONFIG.apiURL}${this.mixinViewModuleOptions.exportURL}?${params}`
}
}
}
// import Cookies from 'js-cookie'
import qs from 'qs'
// import qs from 'qs'
export default {
data() {
/* eslint-disable */
return {
// 设置属性
mixinViewModuleOptions: {
createdIsNeed: true, // 此页面是否在创建时,调用查询数据列表接口?
activatedIsNeed: false, // 此页面是否在激活(进入)时,调用查询数据列表接口?
getDataListURL: '', // 数据列表接口,API地址
getDataListIsPage: false, // 数据列表接口,是否需要分页?
deleteURL: '', // 删除接口,API地址
deleteIsBatch: false, // 删除接口,是否需要批量?
deleteIsBatchKey: 'id', // 删除接口,批量状态下由那个key进行标记操作?比如:pid,uid...
exportURL: '' // 导出接口,API地址
},
// 默认属性
dataForm: {}, // 查询条件
dataList: [], // 数据列表
order: '', // 排序,asc/desc
orderField: '', // 排序,字段
page: 1, // 当前页码
limit: 10, // 每页数
total: 0, // 总条数
dataListLoading: false, // 数据列表,loading状态
dataListSelections: [], // 数据列表,多选项
addOrUpdateVisible: false, // 新增/更新,弹窗visible状态
deleteParams:{}
}
/* eslint-enable */
},
created() {
if (this.mixinViewModuleOptions.createdIsNeed) {
this.getDataList()
}
},
activated() {
if (this.mixinViewModuleOptions.activatedIsNeed) {
this.getDataList()
}
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.mixinViewModuleOptions.getDataListURL ? this.$http.get(
this.mixinViewModuleOptions.getDataListURL, {
params: {
// order: this.order,
// orderField: this.orderField,
page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,
limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,
...this.dataForm
}
}
).then(({ data: res }) => {
this.dataListLoading = false
if (res.code !== 0) {
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data
res.data.drgsName ? this.drgsName = res.data.drgsName : ''
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
}).catch(() => {
this.dataListLoading = false
}) : ''
},
// 多选
dataListSelectionChangeHandle(val) {
this.dataListSelections = val
},
// 排序
dataListSortChangeHandle(data) {
if (!data.order || !data.prop) {
this.order = ''
this.orderField = ''
return false
}
this.order = data.order.replace(/ending$/, '')
this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()
this.getDataList()
},
// 分页, 每页条数
pageSizeChangeHandle(val) {
this.page = 1
this.limit = val
this.getDataList()
},
// 分页, 当前页
pageCurrentChangeHandle(val) {
this.page = val
this.getDataList()
},
// 初始化查询
getDataListInitial() {
this.page = 1
this.getDataList()
},
// 新增 / 修改
addOrUpdateHandle(id, params, title, noParams) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id
noParams ? '' : this.$refs.addOrUpdate.params = params || {}
this.$refs.addOrUpdate.dataForm.title = title
// 存在BUG,params无法覆盖,弃用
// this.$refs.addOrUpdate.dataForm = { id, ...params, title }
this.$refs.addOrUpdate.init()
})
},
// 分配人员
assignPeopleHandle(scope) {
this.currentPeopleId = scope.id
this.dialogVisible = true
// 添加科研人员时,获取人员列表
this.getUserList(scope.id)
},
// 关闭当前窗口
closeCurrentTab(data) {
var tabName = this.$store.state.contentTabsActiveName
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
return false
}
if (tabName === this.$store.state.contentTabsActiveName) {
this.$router.push({ name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name })
}
},
// 删除
deleteHandle(id, callback) {
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { handle: this.$t('delete') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
(Array.isArray(id) ? this.$http({
url: this.mixinViewModuleOptions.deleteURL,
method: 'delete',
data: id
}) : this.$http.delete(this.mixinViewModuleOptions.deleteURL + `/${id}`)).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
callback ? callback() : this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {})
},
// 导出
exportHandle() {
// var params = qs.stringify({
// token: Cookies.get('qg-token'),
// ...this.dataForm
// })
// window.location.href = `${window.SITE_CONFIG.apiURL}${this.mixinViewModuleOptions.exportURL}?${params}`
}
}
}

3
src/page-subspecialty/views/modules/optometryManagement/dioptric/index.vue

@ -111,7 +111,7 @@
<!-- HIS引入弹框 -->
<his-add v-if="HisAddVisible" ref="HisAddRef" />
<!-- 详情页 -->
<detail-view v-if="detailViewVisible" :id="detailId" ref="viewRef" :patient-id="patientId" :patient-id-number="patientIdNumber" is-search="" @detailViewVisible="detailViewVisible=false" />
<detail-view v-if="detailViewVisible" :id="detailId" ref="viewRef" platform="2" :patient-id="patientId" :patient-id-number="patientIdNumber" is-search="" @detailViewVisible="detailViewVisible=false" />
</template>
</div>
</template>
@ -162,6 +162,7 @@ export default {
HisAddVisible: false,
editPatidVisible: false,
dataForm: {
platform: '3',
patId: '',
patName: '',
doctorName: '',

5
src/page-subspecialty/views/modules/outpatientManagement/call/index.vue

@ -103,7 +103,7 @@
<!-- HIS引入弹框 -->
<his-add v-if="HisAddVisible" ref="HisAddRef" />
<!-- 详情页 -->
<detail-view v-if="detailViewVisible" :id="detailId" ref="viewRef" :patient-id="patientId" :patient-id-number="patientIdNumber" @detailViewVisible="detailViewVisible=false" />
<detail-view v-if="detailViewVisible" platform="1" :id="detailId" ref="viewRef" :patient-id="patientId" :patient-id-number="patientIdNumber" @detailViewVisible="detailViewVisible=false" />
</div>
</template>
<script>
@ -173,7 +173,8 @@ export default {
// slBeginDate: '',
// slEndDate: '',
// diagNoseName: '',
patientIdNumber: ''
patientIdNumber: '',
platform: '1'
},
doctorNameList: [],
currentTableList: [],

11
src/page-subspecialty/views/modules/outpatientManagement/treat/index.vue

@ -43,7 +43,7 @@
:value="item.value"
/>
</el-select>
<el-button style="margin-left: 0px" size="small" color="white" v-for="(item,index) in typeList" :key="index">{{ item.value }}</el-button>
<el-button v-for="(item,index) in typeList" :key="index" style="margin-left: 0px" size="small" color="white">{{ item.value }}</el-button>
</div>
<div>
<el-button type="primary" size="small" icon="el-icon-plus" @click="addOrUpdateHandle('','','新增患者')">新增</el-button>
@ -64,7 +64,7 @@
<el-table-column prop="patientId" label="就诊号" header-align="center" align="center" />
<el-table-column prop="patientId" label="状态" header-align="center" align="center" />
<el-table-column prop="patientName" label="患者姓名" header-align="center" align="center" />
<!-- <el-table-column prop="patientSex" label="患者性别" header-align="center" align="center" />-->
<!-- <el-table-column prop="patientSex" label="患者性别" header-align="center" align="center" />-->
<el-table-column label="出生日期" header-align="center" align="center">
<template slot-scope="scope">
{{ scope.row.patientBirthday ? $options.filters.dateFilterTwo( scope.row.patientBirthday): '- ' }}
@ -105,7 +105,7 @@
<!-- HIS引入弹框 -->
<his-add v-if="HisAddVisible" ref="HisAddRef" />
<!-- 详情页 -->
<detail-view v-if="detailViewVisible" :id="detailId" ref="viewRef" :patient-id="patientId" :patient-id-number="patientIdNumber" @detailViewVisible="detailViewVisible=false" />
<detail-view v-if="detailViewVisible" :id="detailId" ref="viewRef" platform="1" :patient-id="patientId" :patient-id-number="patientIdNumber" @detailViewVisible="detailViewVisible=false" />
</div>
</template>
<script>
@ -158,7 +158,7 @@ export default {
}, {
value: '就诊中',
label: '就诊中'
} , {
}, {
value: '已诊',
label: '已诊'
}],
@ -175,7 +175,8 @@ export default {
// slBeginDate: '',
// slEndDate: '',
// diagNoseName: '',
patientIdNumber: ''
patientIdNumber: '',
platform: '2'
},
doctorNameList: [],
currentTableList: [],

Loading…
Cancel
Save