Commit de797dda authored by 刘怀志's avatar 刘怀志

67122 收入管理,住院押金详情排版错乱

parent 4fd1281a
......@@ -116,3 +116,17 @@ export function delDevice(data) {
data: data
})
}
export function getAreTreeStructure() {
return request({
url: '/system/hospital/are-tree-structure',
method: 'get'
})
}
// 查询治疗/检查项目管理列表
export function listItem(query) {
return request({
url: '/business/item/list',
method: 'get',
params: query
})
}
......@@ -964,7 +964,7 @@ color: #333333;"
<script>
// 导入获取宠物信息的接口
import { checkRole } from '@/utils/permission'
import { isEmpty, parseTime, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
import { isEmpty, parseTime, selectDictLabel } from '@/utils/ruoyi'
import { getRegister, updateRegister } from '@/api/business/register'
import { checkPetOwner } from '@/api/business/registration'
import {
......@@ -978,7 +978,7 @@ import { tradeTypeMap, tradeTypeMapDepositList, refundTypeMap, payTypeMap } from
import { mapGetters } from 'vuex'
import refundModle from '@/views/financial-management/revenue-management/components/refund-modle.vue'
import { listHospital } from '@/api/business/hospital'
import { getDevice } from '@/api/business/device'
import { getAreTreeStructure, getDevice, listItem } from '@/api/business/device'
import { moneyFormat } from '@/utils'
import inputTips from '@/components/InputTips/InputTips.vue'
......@@ -992,6 +992,15 @@ export default {
},
data() {
return {
// 检查项目下拉框
checkItemOptions: [],
checkItemAll: [],
// 地址列表
areaOptions: [],
// 日期格式
replace(time) {
return parseTime(time, '{y}/{m}/{d}')
},
fristVisitOptions: [
{
label: '首诊',
......@@ -1460,6 +1469,37 @@ export default {
this.petOwnerBo['cardBalanceShow'] = moneyFormat(this.petOwnerBo.cardBalance)
})
},
removeEmptyChildren(array) {
if (!array || !Array.isArray(array)) {
return
}
for (let i = 0; i < array.length; i++) {
const item = array[i]
if (item && Array.isArray(item.children)) {
if (item.children.length === 0) {
// 如果 children 数组为空,则删除该属性
delete item.children
} else {
// 否则继续递归遍历 children 数组
this.removeEmptyChildren(item.children)
}
}
}
},
getAreaData() {
return getAreTreeStructure().then(response => {
this.removeEmptyChildren(response.data)
this.areaOptions = response.data
})
},
// 获取检查项目下拉框
getItemByType() {
return listItem({ itemType: this.deptLevel === '1' ? 3 : 0 }).then(res => {
console.log('这是我查到的检查项目', res)
this.checkItemOptions = res.rows
this.checkItemAll = res.rows
})
},
/**
* @Description: 获取详情信息
* @Author: 刘
......@@ -1493,19 +1533,69 @@ export default {
})
}
if (this.rowData.tradeType === '9') {
getDevice(this.rowData.linkId).then(response => {
console.log('getDevice', response)
this.deviceInfo = response.data
this.deviceInfo.selectedOptions = response.data.addressCode.split(',')
this.deviceInfo.serviceAreaText = selectDictLabels(this.dict.type.service_area, this.deviceInfo.serviceArea)
this.deviceInfo.serviceArea = response.data.serviceArea.split(',')
if (this.deviceInfo.checkType != null && this.deviceInfo.checkType !== '') {
this.deviceInfo.checkTypeText = selectDictLabels(this.dict.type.exam_type, this.deviceInfo.checkType)
console.log(' this.deviceInfo.checkTypeText', this.deviceInfo.checkTypeText)
this.deviceInfo.checkType = response.data.checkType.split(',')
}
this.deviceInfo.useTime = JSON.parse(response.data.useTime)
})
Promise.all([this.getAreaData(), this.getItemByType()])
.then(_ => {
getDevice(this.rowData.linkId).then(({ data }) => {
data.selectedOptions = data.addressCode.split(',').map(Number)
data.serviceArea = data.serviceArea.split(';')
if (data.checkType != null && data.checkType !== '') {
data.checkType = data.checkType.split(',').map(Number)
console.log(':支持检查项目', data.checkType)
}
if (data.useTime !== null && data.useTime !== '') {
data.useTime = JSON.parse(data.useTime)
}
data.createTimeShow = this.replace(data.createTime)
data.checkTypeText = this.checkItemAll.filter(({ id }) => data.checkType.includes(id))
.map(({ name }) => name)
.join(',')
// 回显服务地区
console.log('data.service', data.serviceArea)
const valueGroups = data.serviceArea
const labelList = []
// const getAreaName = (valueList, parentNameList) => {
//
// }
for (let i = 0; i < valueGroups.length; i++) {
const values = valueGroups[i].split(',')
let currentData = this.areaOptions
const currentLabel = []
let foundLabel = true
for (let j = 0; j < values.length; j++) {
const value = parseInt(values[j])
const item = currentData.find((item) => item.value === value)
if (item) {
if (currentLabel.length === 0) {
currentLabel.push(item.label)
} else {
currentLabel.push(`-${item.label}`)
}
currentData = item.children
} else {
foundLabel = false
break
}
}
if (foundLabel) {
labelList.push(currentLabel.join(''))
} else {
labelList.push('-')
}
}
data.serviceAreaText = labelList.join(',')
console.log('支持服务地区', data.serviceAreaText)
this.deviceInfo = data
})
})
}
// if (this.detailType === '0') {
// getRegister(this.rowData.registerId).then(response => {
......
......@@ -68,13 +68,13 @@
<svg-icon style="margin-right: 1px" icon-class="shaixuan_icon_daochu" />
批量导出
</el-button>
<!-- <el-button-->
<!-- class="fourWordsBtn"-->
<!-- icon="el-icon-plus"-->
<!-- :disabled="multiple"-->
<!-- @click="bulkDelivery"-->
<!-- >办理出库-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- class="fourWordsBtn"-->
<!-- icon="el-icon-plus"-->
<!-- :disabled="multiple"-->
<!-- @click="bulkDelivery"-->
<!-- >办理出库-->
<!-- </el-button>-->
</el-col>
<el-col :span="12" style="padding-bottom: 20px;text-align: end;">
<el-button class="queryBtn" icon="el-icon-search" @click="handleQuery">查询</el-button>
......@@ -84,7 +84,7 @@
<el-table ref="table" v-loading="loading" :data="drugdeliveryList" :header-cell-style="{background:'#F4F4F4'}" @select="selectChange" @select-all="selectChange">
<el-table-column type="selection" width="47" align="center" />
<el-table-column align="left" label="序号" min-width="60" show-overflow-tooltip prop="index" >
<el-table-column align="left" label="序号" min-width="60" show-overflow-tooltip prop="index">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment