科内开单

This commit is contained in:
wyuu 2026-03-05 18:03:05 +08:00
parent 5b806fa489
commit 98632e6463
7 changed files with 626 additions and 143 deletions

View File

@ -0,0 +1,62 @@
// @ts-ignore
import request from '@/utils/request'
//获取项目信息
export function queryXmInfoList(query: any) {
return request({
url: '/reqInput/queryXmInfoList',
method: 'get',
params: query
})
}
//保存病人信息
export function saveReqInfo(query: any) {
return request({
url: '/reqInput/saveReqInfo',
method: 'post',
data: query
})
}
//保存病人信息
export function queryPatList(query: any) {
return request({
url: '/reqInput/queryPatList',
method: 'post',
data: query
})
}
//查询病人信息
export function queryPatInfo(query: any) {
return request({
url: '/reqInput/queryPatInfo',
method: 'get',
params: query
})
}
//不可开单项目列表
export function queryCreateReqList(query: any) {
return request({
url: '/reqInput/queryCreateReqList',
method: 'get',
params: query
})
}
//可开单项目列表
export function queryCanCreateReqList(query: any) {
return request({
url: '/reqInput/queryCanCreateReqList',
method: 'get',
params: query
})
}
//保存可开单项目
export function saveCanCreaeReqList(query: any) {
return request({
url: '/reqInput/saveCanCreaeReqList',
method: 'post',
data: query
})
}

View File

@ -175,7 +175,7 @@
word-break: break-word;
background-color: #1F6DD3 !important;
color: #FFF;
height: 1.6875rem !important;
height: 1.875rem !important;
font-size: .8125rem;
}
}
@ -213,8 +213,8 @@
.el-table__body-wrapper .el-table-column--selection>.cell {
padding: 0 !important;
height: 1.875rem;
line-height: 1.875rem;
height: 1.8125rem;
line-height: 1.8125rem;
}
.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
@ -224,8 +224,8 @@
.cell.el-tooltip {
padding: 0 !important;
height: 1.875rem;
line-height: 1.875rem;
height: 1.8125rem;
line-height: 1.8125rem;
}
.el-table-header-cell .cell {
@ -241,8 +241,8 @@
.el-table__cell {
padding: 0 !important;
height: 1.875rem;
line-height: 1.875rem;
height: 1.8125rem;
line-height: 1.8125rem;
}
.el-checkbox {

View File

@ -1,93 +1,97 @@
<template>
<div class="labpat_box">
<el-form :model="labPat" label-width="70px" class="compact-form" label-position="right">
<el-form :model="labPat" label-width="4.3rem" class="compact-form" label-position="right">
<el-form-item label="病人来源">
<el-col :span="14">
<SelectTable v-model:data="labPat.brly" :fields="brlyFields" dict-type="PT" placeholder="请选择" size="small"
@getDataValue="handleFieldChange" />
<el-col :span="16">
<SelectTable v-model:data="labPat.brly" :fields="brlyFields" :table-data="dictData.PT" size="small"
placeholder="" @getDataValue="handleFieldChange" />
</el-col>
<el-col :span="10">
<el-switch v-model="labPat.jzbz" active-text="急诊" active-color="#FD0101" active-value="1" inactive-value="0"
@change="handleFieldChange"></el-switch>
<el-col :span="8">
<el-checkbox v-model="labPat.jzbz" true-value="1" class="check_box"> 急诊 </el-checkbox>
</el-col>
</el-form-item>
<el-form-item label="病 历 号">
<el-input v-model="labPat.brdh" placeholder="请输入病历号" @change="handleFieldChange" size="small" />
<el-form-item label="病人代号">
<el-input v-model="labPat.brdh" @keyup.enter="brdhHandle" size="small" />
</el-form-item>
<el-form-item label="姓 名">
<el-input v-model="labPat.brxm" placeholder="请输入姓名" @change="handleFieldChange" size="small" />
<el-input v-model="labPat.brxm" @change="handleFieldChange" size="small" />
</el-form-item>
<el-form-item label="性 别">
<SelectTable v-model:data="labPat.brxb" dict-type="SX" placeholder="请选择" size="small"
<SelectTable v-model:data="labPat.brxb" :table-data="dictData.SX" size="small" placeholder=""
@getDataValue="handleFieldChange" />
</el-form-item>
<el-form-item label="年龄">
<el-row :gutter="5">
<el-col :span="14">
<el-input v-model="labPat.nl" placeholder="年龄" @change="handleFieldChange" style="width:100%"
size="small" />
</el-col>
<el-col :span="10">
<SelectTable v-model:data="labPat.nldw" dict-type="AU" placeholder="请选择" size="small"
@getDataValue="handleFieldChange" />
</el-col>
</el-row>
<el-col :span="14">
<el-input v-model="labPat.nl" @change="handleFieldChange" size="small" />
</el-col>
<el-col :span="10">
<SelectTable v-model:data="labPat.nldw" :table-data="dictData.AU" size="small" placeholder=""
@getDataValue="handleFieldChange" />
</el-col>
</el-form-item>
<el-form-item label="样本类型">
<SelectTable v-model:data="labPat.yblx" :table-data="dictData.BT" size="small" placeholder=""
@getDataValue="handleFieldChange" />
</el-form-item>
<el-form-item label="送检医生">
<SelectTable v-model:data="labPat.yhdh" :fields="ysFields" :tableData="userList || []" label="nickName"
value="userName" objKey="userName" :border="true" size="small" placeholder=""
@getDataValue="handleFieldChange" />
</el-form-item>
<el-form-item label="送检科室">
<SelectTable v-model:data="labPat.ksdh" dict-type="DP" placeholder="请选择" size="small"
<SelectTable v-model:data="labPat.ksdh" :table-data="dictData.DP" size="small" placeholder=""
@getDataValue="handleFieldChange" />
</el-form-item>
<el-form-item label="床 号">
<el-input v-model="labPat.ch" placeholder="请输入床号" @change="handleFieldChange" size="small" />
</el-form-item>
<el-form-item label="样本类型">
<SelectTable v-model:data="labPat.yblx" dict-type="BT" placeholder="请选择" size="small"
@getDataValue="handleFieldChange" />
</el-form-item>
<el-form-item label="申请医生">
<SelectTable v-model:data="labPat.sjys" dict-type="SRD" placeholder="请选择" size="small"
@getDataValue="handleFieldChange" />
</el-form-item>
<el-form-item label="上机时间">
<el-date-picker v-model="labPat.sqsj" type="datetime" placeholder="上机时间" format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss" @change="handleFieldChange" size="small" style="width: 100%;" />
</el-form-item>
<el-form-item label="采样时间">
<el-date-picker v-model="labPat.cyrq" type="datetime" placeholder="采样时间" format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss" @change="handleFieldChange" size="small" style="width: 100%;" />
</el-form-item>
<el-form-item label="报告时间">
<el-date-picker v-model="labPat.dysj" type="datetime" placeholder="报告时间" format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss" @change="handleFieldChange" size="small" style="width: 100%;" />
<el-input v-model="labPat.ch" @change="handleFieldChange" size="small" />
</el-form-item>
<el-form-item label="临床诊断">
<el-input v-model="labPat.zd" placeholder="请输入临床诊断" @change="handleFieldChange" size="small" />
<el-input v-model="labPat.zd" @change="handleFieldChange" size="small" />
</el-form-item>
<el-form-item label="备 注">
<el-input v-model="labPat.bz" placeholder="请输入备注" @change="handleFieldChange" size="small" />
</el-form-item>
<el-form-item label="检验医生">
<SelectTable v-model:data="labPat.yhdh" :fields="ysFields" :tableData="userList || []" label="nickName"
value="userName" objKey="userName" :border="true" placeholder="请选择" size="small"
@getDataValue="handleFieldChange" />
</el-form-item>
<el-form-item label="审核医生">
<SelectTable v-model:data="labPat.hdys" :fields="ysFields" :tableData="userList || []" label="nickName"
value="userName" objKey="userName" :border="true" placeholder="请选择" size="small"
@getDataValue="handleFieldChange" />
<el-input v-model="labPat.bz" @change="handleFieldChange" size="small" />
</el-form-item>
<el-form-item label="登记人员">
<SelectTable v-model:data="labPat.sjys" :table-data="dictData.SRD" size="small" placeholder=""
:disabled="true" />
</el-form-item>
<el-form-item label="登记时间">
<el-date-picker v-model="labPat.djry" type="datetime" format="YYYY-MM-DD HH:mm:ss" :disabled="true"
value-format="YYYY-MM-DD HH:mm:ss" size="small" style="width: 100%;" />
</el-form-item>
<el-form-item label="条 码 号">
<el-input v-model="labPat.sqh" :disabled="true" size="small" />
</el-form-item>
<el-form-item label="申请状态">
<SelectTable v-model:data="labPat.zt" size="small" :table-data="lisReqs" placeholder="" :disabled="true" />
</el-form-item>
<el-form-item label="证件类型">
<SelectTable v-model:data="labPat.zjlx" size="small" :table-data="dictData.ZJLX" placeholder=""
@getDataValue="handleFieldChange" />
</el-form-item>
<el-form-item label="证件号码">
<el-input v-model="labPat.sfzh" size="small" />
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="labPat.phone" size="small" />
</el-form-item>
</el-form>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, watch, toRaw, computed, onMounted } from 'vue';
import { changepatcolumn, updateLabPat } from "@/api/liswork/work/LisWork";
import { queryPatInfo } from '@/api/liswork/order'
import SelectTable from '@/components/SelectTable/index.vue';
import { getDictData, formatDict, dictData } from '@/hooks'
// @ts-ignore
import { listUser } from '@/api/system/user.js'
//@ts-ignore
import { getDicts } from '@/api/system/dict/data'
const props = defineProps({
labPat: {
type: Object,
@ -98,10 +102,6 @@ const props = defineProps({
type: Object,
default: () => { }
},
dictData: {
type: Object,
default: () => { }
}
});
const lastJgbz = ref();
watch(() => props.labPat, (newVal) => {
@ -109,6 +109,7 @@ watch(() => props.labPat, (newVal) => {
lastJgbz.value = newVal.jgbz;
})
const emit = defineEmits(['update:labPat']);
const lastValue = ref('');
@ -117,10 +118,6 @@ const brlyFields = ref([
{ prop: 'label', label: '名称', width: 120, enablePinyinSearch: true },
])
const ksdhFields = ref([
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
])
const ysFields = ref([
{ prop: 'userName', label: '用户代号', width: 80, enablePinyinSearch: true },
{ prop: 'nickName', label: '用户姓名', width: 150, enablePinyinSearch: true },
@ -129,85 +126,79 @@ const ysFields = ref([
* 通用字段变化处理(失焦、回车触发)
*/
const handleFieldChange = async () => {
// 将当前labPat转为字符串用于比较
const currentValue = JSON.stringify(props.labPat);
// 对比与上一次保存的值是否有变化
if (currentValue !== lastValue.value) {
// 找出变化的字段
const oldObj = JSON.parse(lastValue.value);
const newObj = props.labPat;
const changedField = getChangedField(oldObj, newObj);
if (changedField) {
// 这里可以添加实际的更新逻辑,比如调用接口
try {
// if (props.labPat.id) {
// updateLabPat({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue }).then((res: any) => {
// if (res.code == 0) {
// // 将当前labPat转为字符串用于比较
// const currentValue = JSON.stringify(props.labPat);
// // 对比与上一次保存的值是否有变化
// if (currentValue !== lastValue.value) {
// }
// })
// } else {
// changepatcolumn({ ...props.labPatKey, column: changedField?.field, value: changedField?.newValue })
// }
} catch (error) {
console.error('更新失败:', error);
// 失败时可以恢复旧值
emit('update:labPat', oldObj);
lastValue.value = JSON.stringify(oldObj);
}
}
}
};
// 完善字段变化检测方法
const getChangedField = (oldObj: { [key: string]: any }, newObj: { [key: string]: any }) => {
const oldKeys = Object.keys(oldObj);
for (const key of oldKeys) {
const oldVal = oldObj[key];
const newVal = newObj[key];
if (oldVal instanceof Date && newVal instanceof Date) {
if (oldVal.getTime() !== newVal.getTime()) {
return { field: key, oldValue: oldVal, newValue: newVal };
}
} else if (oldVal !== newVal) {
return { field: key, oldValue: oldVal, newValue: newVal };
}
}
const newKeys = Object.keys(newObj);
for (const key of newKeys) {
if (!(key in oldObj)) {
return { field: key, oldValue: undefined, newValue: newObj[key] };
}
}
return null;
// // 找出变化的字段
// const oldObj = JSON.parse(lastValue.value);
// const newObj = props.labPat;
// const changedField = getChangedField(oldObj, newObj);
// if (changedField) {
// // 这里可以添加实际的更新逻辑,比如调用接口
// try {
// // saveLabPat(changedField)
// } catch (error) {
// console.error('更新失败:', error);
// // 失败时可以恢复旧值
// // emit('update:labPat', oldObj);
// lastValue.value = JSON.stringify(oldObj);
// }
// }
// }
};
// 病人代号查询病人信息的逻辑
const brdhHandle = () => {
queryPatInfo({ brdh: props.labPat.brdh }).then((res: any) => {
if (res.data) {
emit('update:labPat', { ...props.labPat, ...res.data })
}
})
}
const lisReqs = ref([]);
const userList = ref([]);
onMounted(() => {
const data = { status: 0, del_flag: 0, pageSize: 1000, pageNum: 1 }
listUser(data).then((res: any) => {
userList.value = res.rows;
});
getDicts('lis_req_type').then((resp: any) => {
lisReqs.value = resp.data.map((p: any) => ({
label: p.dictLabel,
value: p.dictValue,
elTagType: p.listClass,
elTagClass: p.cssClass
}))
})
})
</script>
<style scoped lang="scss">
.labpat_box {
height: calc(90vh - 20px);
height: calc(90vh - 40px);
display: flex;
flex-direction: column;
overflow: hidden;
border-right: 1px solid #E6E9ED;
padding-right: 5px;
.check_box {
:deep(.el-checkbox__input.is-checked+.el-checkbox__label) {
color: #f00 !important;
font-size: .875rem;
}
:deep(.el-checkbox__label) {
font-size: .875rem;
}
}

View File

@ -0,0 +1,192 @@
/**
* @file setBilling.vue 开单项目设置
* @author: w
* @since: 2026-03-05
*/
<template>
<div>
<el-dialog v-model="showDialog" title="开单项目设置" width="80%" @close="handleDialogClose">
<el-row :gutter="10" class="table-toolbar">
<el-col :span="10">
<el-button type="primary" @click="cpHandle">存盘</el-button>
<el-button type="primary" @click="firstHandle">首位</el-button>
<el-button type="primary" @click="lastHadnle">末位</el-button>
</el-col>
<el-col :span="14">
项目检索: <el-input v-model="searchKey" size="small" style="width: 200px;" @clear="filterDictData"
@input="filterDictData" /> &nbsp;
<div class="tips">
说明:从右边列表中双击某个项目可以直接加入到左边的列表中,代表这个项目为分支医疗机构开单项目
</div>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="10">
<CustomTable ref="tableRef" :data="CanReqListData" :columns="leftColumns" @row-dblclick="handleLeftDblclick"
:config="{ border: true, height: '80vh', highlightCurrentRow: true, key: 'sfxmdh' }" :enableRowDrag="true"
@row-drag-end="handleRowDragEnd" @row-click="handleRowClick">
<!-- <template #dyxh="{ row }">
<el-input v-model="row.dyxh" class="full-width-input" />
</template> -->
</CustomTable>
</el-col>
<el-col :span="14" style="height:80vh">
<CustomVxeTable :table-data="filterData" :columns="columns" @cell-dblclick="handleDblclick" size="small"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" ref="tableRef">
</CustomVxeTable>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script setup>
import { queryCreateReqList, queryCanCreateReqList, saveCanCreaeReqList } from '@/api/liswork/order'
import { ElMessage } from 'element-plus'
import { getFirstLetter } from '@/utils/pinyin';
const emit = defineEmits(["update"]);
const searchKey = ref('')
const showDialog = ref(false)
const selectedRow = ref(null)
const CanReqListData = ref([])
const columns = [
{ field: 'sflbmc', title: '类别', align: 'center', resizable: true },
{ field: 'sfxmdh', title: '代号', align: 'center', resizable: true },
{ field: 'sfxmmc', title: '简称', align: 'center', width: 200, resizable: true },
{ field: 'dj', title: '单价', align: 'center', width: 80, resizable: true },
{ field: 'yblx', title: '样本', align: 'center', resizable: true },
{ field: 'bz', title: '采集说明', align: 'center', width: 200, resizable: true },
]
const leftColumns = [
{ prop: 'sfxmdh', label: '项目代号', visible: true, align: 'center' },
{ prop: 'sfxmmc', label: '医疗机构可开展的诊疗项目', visible: true, align: 'center' },
{ prop: 'xh', label: '排序', visible: true, align: 'center', },
]
const handleDblclick = ({ row }) => {
const index = CanReqListData.value.findIndex(item => item.sfxmdh === row.sfxmdh)
if (index === -1) {
CanReqListData.value.push(row)
resetSortNumber()
} else {
ElMessage.warning('已存在该项目')
}
}
const filterData = ref([])
const processedTableData = ref([])
const filterDictData = () => {
const key = searchKey.value.trim().toLowerCase();
if (!key) {
// 空搜索时显示全部预处理数据
filterData.value = [...processedTableData.value];
return;
}
filterData.value = processedTableData.value.filter((item) => {
const matchLabel = item.pinyin?.toString().toLowerCase().includes(key);
return matchLabel;
});
}
const open = () => {
queryCanCreateReqList().then(res => {
CanReqListData.value = res.data.sort((a, b) => a.xh - b.xh)
})
queryCreateReqList().then(res => {
processedTableData.value = processTableData(res.data)
filterData.value = [...processedTableData.value];
})
showDialog.value = true
}
const processTableData = (data) => {
return data.map((item) => {
const pinyinMap = {};
pinyinMap['pinyin'] = getFirstLetter(item.sfxmmc).toLowerCase();
return { ...item, ...pinyinMap };
});
};
const handleRowClick = (row) => {
selectedRow.value = row
}
const handleLeftDblclick = (row) => {
const index = CanReqListData.value.findIndex(item => item.sfxmdh == row.sfxmdh)
if (index !== -1) {
CanReqListData.value.splice(index, 1)
resetSortNumber()
}
}
//退拽属性
const handleRowDragEnd = (data) => {
// 更新行顺序
CanReqListData.value = data.list.map((item) => {
return {
...item,
xh: item.sort,
}
})
}
const cpHandle = () => {
saveCanCreaeReqList(CanReqListData.value).then((res) => {
if (res.code == 0) {
emit('update')
showDialog.value = false
ElMessage.success('保存成功')
}
})
}
const firstHandle = () => {
if (!selectedRow.value) return
const currentIndex = CanReqListData.value.findIndex(item => item.sfxmdh === selectedRow.value.sfxmdh)
if (currentIndex === 0) return
const [movedRow] = CanReqListData.value.splice(currentIndex, 1)
CanReqListData.value.unshift(movedRow)
resetSortNumber()
tableRef.value.setScrollTop(0)
}
const lastHadnle = () => {
if (!selectedRow.value) return
const currentIndex = CanReqListData.value.findIndex(item => item.sfxmdh === selectedRow.value.sfxmdh)
if (currentIndex === CanReqListData.value.length - 1) return
const [movedRow] = CanReqListData.value.splice(currentIndex, 1)
CanReqListData.value.push(movedRow)
resetSortNumber()
tableRef.value.setScrollTop(CanReqListData.value.length)
}
const resetSortNumber = () => {
CanReqListData.value.forEach((item, index) => {
item.xh = index + 1
})
}
const handleDialogClose = () => {
showDialog.value = false
}
defineExpose({
open
})
</script>
<style scoped lang="scss">
.tips {
color: #1f6dd3;
font-weight: 600;
}
/* 可拖拽表格行样式提示 */
:deep(.drag-table .el-table__row) {
cursor: move;
/* 鼠标移入行显示拖拽光标 */
transition: background-color 0.2s;
}
</style>

View File

@ -9,12 +9,47 @@
<el-row :gutter="10" class="row-box">
<el-col :span="13" style="height: 100%;">
<div class="box-shadow">
<el-row :gutter="5">
<el-col :span="8">
<Info :lab-pat="labpat" :dict-data="dictData" />
<el-row class="top-box">
<el-col :span="7">
<el-button type="primary" size="small" @click="saveHandle">保存</el-button>
<el-button type="primary" size="small" @click="addHandle">新增</el-button>
<el-button type="danger" size="small" @click="deleteHandle">删除</el-button>
</el-col>
<el-col :span="16">
<el-col :span="17">
<div class="tips">
项目检索: <el-input v-model="searchKey" size="small" style="width: 150px;" @clear="filterDictData"
@input="filterDictData" /> &nbsp;
<el-button type="primary" size="small" @click="BillingHandle">开单项目</el-button>
</div>
</el-col>
</el-row>
<el-row :gutter="5" style="height: 100%;">
<el-col :span="7">
<Info v-model:labPat="labpat" />
</el-col>
<el-col :span="17" style="height: 100%;">
<div class="xmBoxs">
<template v-for="item in filterData" :key="item.sflbmc">
<div class="title">{{ item.sflbmc }}</div>
<el-checkbox-group v-model="checkboxs" @change="handleChecksChange">
<el-row>
<el-col :span="12" v-for="v in item.children" :key="v.sfxmdh">
<el-checkbox :label="v.sfxmdh">
{{ v.sfxmmc }}
</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
</template>
</div>
<div style="height: calc(40% - 30px)">
<CustomVxeTable :table-data="sqXmList" :columns="sqXmColumns" @cell-dblclick="dbRowclick"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style">
<template #zt="{ row }">
申请
</template>
</CustomVxeTable>
</div>
</el-col>
</el-row>
</div>
@ -22,7 +57,6 @@
<el-col :span="11" style="height: 100%;">
<div class="box-shadow">
<el-form :model="queryParams" inline size="small" label-width="5.5rem">
<el-form-item label="姓名:" prop="brxm">
<el-input v-model="queryParams.brxm" style="width: 9rem;" />
</el-form-item>
@ -35,10 +69,10 @@
<el-option label="显示所有" value="0" />
</el-select>
</el-form-item>
<el-form-item label="登记时间:" prop="st">
<el-date-picker v-model="queryParams.st" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
<el-form-item label="登记时间:" prop="begdate">
<el-date-picker v-model="queryParams.begdate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
style="width: 7.5rem;" />&nbsp; -&nbsp;
<el-date-picker v-model="queryParams.et" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
<el-date-picker v-model="queryParams.enddate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
style="width: 7.5rem;" />
</el-form-item>
<el-form-item label="">
@ -51,28 +85,58 @@
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" :row-style="rowStyle"
:cell-style="cellStyle" class="mytable-style" ref="tableRef" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd">
<template #brxb="{ row }">
{{ formatDict(row.brxb, 'SX') }}
</template>
<template #nldw="{ row }">
{{ formatDict(row.nldw, 'AU') }}
</template>
<template #yblx="{ row }">
{{ formatDict(row.yblx, 'BT') }}
</template>
<template #ksdh="{ row }">
{{ formatDict(row.ksdh, 'DP') }}
</template>
<template #brly="{ row }">
{{ formatDict(row.brly, 'PT') }}
</template>
</CustomVxeTable>
</div>
</div>
</el-col>
</el-row>
<!-- 开单项目设置 -->
<SetBilling ref="setbilRef" @update="getXmList" />
</div>
</template>
<script setup>
import { templateRef } from '@vueuse/core'
import Info from './components/info.vue'
import { getDictData, formatDict, dictData } from '@/hooks'
import { queryXmInfoList, saveReqInfo, queryPatList } from '@/api/liswork/order'
import dayjs from 'dayjs'
const labpat = ref({})
import { ElMessage } from 'element-plus'
import { getFirstLetter } from '@/utils/pinyin';
import SetBilling from './components/setBilling.vue'
const labpat = ref({
zt: '1'
})
const checkboxs = ref([])
const searchKey = ref('')
const loading = ref(false)
const tableRef = templateRef('tableRef')
const tableRef = useTemplateRef('tableRef')
const labPatList = ref([])
const queryParams = ref({})
const tableColumns = ref([
{ field: 'brdh', title: '病历号', width: 80, align: 'center', resizable: true },
{ field: 'brxm', title: '姓名', width: 40, align: 'center', resizable: true, slotName: 'brxm' },
{ field: 'brxm', title: '姓名', width: 40, align: 'center', resizable: true, },
{ field: 'brxb', title: '性别', width: 30, align: 'center', slotName: 'brxb', resizable: true },
{ field: 'sqh', title: '条码号', width: 100, align: 'center', resizable: true, },
{ field: 'zt', title: '状态', width: 40, align: 'center', resizable: true, },
@ -81,9 +145,9 @@ const tableColumns = ref([
{ field: 'yblx', title: '标本', width: 50, align: 'center', resizable: true, slotName: 'yblx' },
{ field: 'yhdh', title: '检验医生', width: 60, align: 'center', resizable: true, slotName: 'yhdh' },
{ field: 'ksdh', title: '科室', width: 80, align: 'center', slotName: 'ksdh', resizable: true },
{ field: 'time', title: '登记时间', width: 80, align: 'center', resizable: true },
{ field: 'sqsj', title: '登记时间', width: 80, align: 'center', resizable: true },
{ field: 'brly', title: '病人来源', width: 90, align: 'center', slotName: 'brly', resizable: true },
{ field: 'xmdh', title: '项目', width: 90, align: 'center', resizable: true },
{ field: 'jymd', title: '项目', width: 90, align: 'center', resizable: true },
])
const rowStyle = ({ row }) => {
@ -93,9 +157,40 @@ const cellStyle = ({ row, column }) => {
}
const handleRowClick = (row) => {
row.brxb = row.brxb.trim()
row.zt = row.zt.trim()
labpat.value = row
}
const handleQuery = () => {
queryParams.value.begdate = dayjs(queryParams.value.begdate).format('YYYY-MM-DD') + ' 00:00:00'
queryParams.value.enddate = dayjs(queryParams.value.enddate).format('YYYY-MM-DD') + ' 23:59:59'
queryPatList(queryParams.value).then(res => {
labPatList.value = res.data
})
}
const saveHandle = () => {
if (!labpat.value.brdh) return ElMessage.warning('病人代号不能为空!')
if (!labpat.value.yblx) return ElMessage.warning('样本类型不能为空!')
if (!sqXmList.value.length) return ElMessage.warning('请选择项目!')
const data = {
labReqmain: labpat.value,
reqInputLisWorkVOList: sqXmList.value
}
saveReqInfo(data).then(res => {
handleQuery()
})
}
const addHandle = () => {
labpat.value = {
zt: '1'
}
}
const deleteHandle = () => {
}
// 更新列配置
const handleColumnDragEnd = (data) => {
@ -106,9 +201,108 @@ const handleColumnDragEnd = (data) => {
});
}
const filterData = ref([])
const xmColumns = ref([
{ field: 'sflbmc', title: '类别', align: 'center', resizable: true },
{ field: 'sfxmdh', title: '代号', align: 'center', resizable: true },
{ field: 'sfxmmc', title: '简称', align: 'center', width: 150, resizable: true },
{ field: 'dj', title: '单价', align: 'center', resizable: true },
{ field: 'spec', title: '规格', align: 'center', resizable: true },
{ field: 'yblx', title: '样本', align: 'center', resizable: true },
])
const setbilRef = useTemplateRef('setbilRef')
const BillingHandle = () => {
setbilRef.value.open()
}
const processedTableData = ref([])
const filterDictData = () => {
const key = searchKey.value.trim().toLowerCase();
if (!key) {
// 空搜索时显示全部预处理数据
filterData.value = resultList([...processedTableData.value])
return;
}
filterData.value = resultList(processedTableData.value.filter((item) => {
const matchLabel = item.pinyin.toString().toLowerCase().includes(key);
return matchLabel;
})
)
}
const processTableData = (data) => {
return data.map((item) => {
const pinyinMap = {};
pinyinMap['pinyin'] = getFirstLetter(item.sfxmmc).toLowerCase();
return { ...item, ...pinyinMap };
});
};
const sqXmList = ref([])
const sqXmColumns = ref([
{ field: 'sflbmc', title: '类别', align: 'center', resizable: true },
{ field: 'sfxmdh', title: '代号', align: 'center', resizable: true },
{ field: 'sfxmmc', title: '简称', align: 'center', width: 150, resizable: true },
{ field: 'dj', title: '单价', align: 'center', resizable: true },
{ field: 'spec', title: '规格', align: 'center', resizable: true },
{ field: 'yblx', title: '样本', align: 'center', resizable: true },
{ field: 'zt', title: '状态', align: 'center', resizable: true, slotName: 'zt' },
])
const handleChecksChange = (val) => {
sqXmList.value = []
val.forEach(item => {
const existingItem = processedTableData.value.find((row) => row.sfxmdh == item)
if (existingItem) {
sqXmList.value.push(existingItem)
}
})
}
const dbRowclick = ({ row }) => {
const index = sqXmList.value.findIndex((item) => item.sfxmdh == row.sfxmdh)
if (index > -1) {
sqXmList.value.splice(index, 1)
}
}
const getXmList = () => {
queryXmInfoList().then(res => {
processedTableData.value = processTableData(res.data);
filterData.value = resultList([...processedTableData.value])
})
}
//数据分类
const resultList = (arr) => {
const categoryList = Array.from(new Set(arr.map(item => item.sflbmc))).map(v => {
return {
sflbmc: v,
children: []
}
})
categoryList.forEach(item => {
arr.forEach(v => {
if (item.sflbmc == v.sflbmc) {
item.children.push(v)
}
})
})
return categoryList
}
onMounted(() => {
queryParams.value.st = dayjs().format('YYYY-MM-DD')
queryParams.value.et = dayjs().format('YYYY-MM-DD')
queryParams.value.begdate = dayjs().format('YYYY-MM-DD')
queryParams.value.enddate = dayjs().format('YYYY-MM-DD')
getXmList()
getDictData('PT', 'SX', 'AU', 'BT', 'DP', 'SRD', 'ZJLX')
})
</script>
@ -141,4 +335,38 @@ onMounted(() => {
.el-form-item {
margin-bottom: 5px;
}
.top-box {
border-bottom: 1px solid #E6E9ED;
padding-bottom: 2px;
}
.xmBoxs {
:deep(.el-checkbox__label) {}
height: 60%;
overflow-y: auto;
&::-webkit-scrollbar {
width: 8px;
height: 8px;
}
&::-webkit-scrollbar-thumb {
background: #817e7e;
border-radius: 4px;
}
}
.tips {
font-style: 15px;
color: #123d64;
font-weight: 600;
}
.title {
font-size: 14px;
color: #000;
font-weight: 700;
}
</style>

View File

@ -354,6 +354,11 @@ onMounted(() => {
.check_box {
:deep(.el-checkbox__input.is-checked+.el-checkbox__label) {
color: #f00 !important;
font-size: .875rem;
}
:deep(.el-checkbox__label) {
font-size: .875rem;
}
}

View File

@ -348,6 +348,11 @@ onMounted(() => {
.check_box {
:deep(.el-checkbox__input.is-checked+.el-checkbox__label) {
color: #f00 !important;
font-size: .875rem;
}
:deep(.el-checkbox__label) {
font-size: .875rem;
}
}