批量审核
This commit is contained in:
parent
c728193842
commit
4309d54d09
29
src/api/liswork/batchCheck/batchCheckApi.ts
Normal file
29
src/api/liswork/batchCheck/batchCheckApi.ts
Normal file
@ -0,0 +1,29 @@
|
||||
// @ts-ignore
|
||||
import request from "@/utils/request";
|
||||
|
||||
//获取批量审核列表数据
|
||||
export function queryBatchCheckListService(query: any) {
|
||||
return request({
|
||||
url: "/batchCheck/query",
|
||||
method: "post",
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
//批量审核
|
||||
export function batchCheckService(data: any) {
|
||||
return request({
|
||||
url: "/batchCheck/checkData",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
//取消批量审核
|
||||
export function cancelBatchCheckService(data: any) {
|
||||
return request({
|
||||
url: "/batchCheck/unCheckData",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
@ -1,44 +1,47 @@
|
||||
//仪器,字典数据自动格式化类
|
||||
import { DictData } from '@/types/index';
|
||||
import { getGroupInstrdList } from '@/api/liswork/work/LisWork';
|
||||
import { DictData } from "@/types/index";
|
||||
import { getGroupInstrdList } from "@/api/liswork/work/LisWork";
|
||||
//@ts-ignore
|
||||
import { comDict } from '@/utils/dict'
|
||||
import { comDict } from "@/utils/dict";
|
||||
|
||||
const dictData = ref<DictData>({});
|
||||
const instrOptions = ref<{ yq: string; yqmc: string }[]>([]);
|
||||
|
||||
export const getYqData = (data?: any) => {
|
||||
// 避免重复请求
|
||||
// 避免重复请求
|
||||
// if (instrOptions.value.length > 0) return;
|
||||
getGroupInstrdList(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
instrOptions.value = res.data.map((item: any) => ({
|
||||
yq: item.yq.trim(),
|
||||
yqmc: item.yqmc
|
||||
yqmc: item.yqmc,
|
||||
}));
|
||||
}
|
||||
})
|
||||
});
|
||||
};
|
||||
//'XMGL','ITEMCLASS', 'YQDL'
|
||||
export const getDictData = async (...args: string[]) => {
|
||||
const dictRefs = await comDict(...args);
|
||||
// 遍历传入的字典类型参数,动态处理赋值
|
||||
args.forEach(key => {
|
||||
args.forEach((key) => {
|
||||
if (dictRefs[key] !== undefined) {
|
||||
dictData.value[key] = toRaw(dictRefs[key].value) || [];
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//字典数据格式化方法
|
||||
export const formatDict = (v: string, dictType: string) => {
|
||||
if (v == undefined) return;
|
||||
return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label || v;
|
||||
}
|
||||
return (
|
||||
dictData.value[dictType]?.find((item: any) => item.value == v.trim())
|
||||
?.label || v
|
||||
);
|
||||
};
|
||||
|
||||
//仪器格式化方法
|
||||
export const formatInstr = (v: string) => {
|
||||
return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc || v;
|
||||
}
|
||||
};
|
||||
|
||||
export { dictData, instrOptions }
|
||||
export { dictData, instrOptions };
|
||||
|
||||
@ -1,5 +1,21 @@
|
||||
|
||||
|
||||
// export function getArrayMaxXh(tableList: Array<any>) {
|
||||
// return tableList.length > 0 ? Math.max(...tableList.map((item:any) => item.xh || 0)) : 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
//性别转换
|
||||
export function displayBRXB(brxb: string) {
|
||||
if (brxb === "" || brxb === null || brxb === undefined) {
|
||||
return "";
|
||||
}
|
||||
return brxb === "1" ? "男" : "女";
|
||||
}
|
||||
|
||||
//年龄转换
|
||||
export function displayBRNL(nl: string | number, nldw: string) {
|
||||
if (nl === "" || nl === null || nl === undefined) {
|
||||
return "";
|
||||
}
|
||||
return (
|
||||
nl + (nldw === "1" ? "岁" : nldw === "2" ? "月" : nldw === "3" ? "天" : "")
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,78 +1,127 @@
|
||||
<!-- 批量审核 -->
|
||||
<template>
|
||||
<el-form ref="form" :model="formData" label-width="80px">
|
||||
<el-form-item label="仪器分组" prop="lisgroup">
|
||||
<SelectTable v-model:data="formData.lisgroup" :fields="fields" dict-type="GROUP" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医疗机构" prop="yljg">
|
||||
<el-input placeholder="请选择医疗机构" v-model="formData.yljg"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请科室" prop="ksdh">
|
||||
<el-input placeholder="请选择申请科室" v-model="formData.ksdh"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检验仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="formData.yq" width="200px" clearable @get-data-value="getList"></YQSelectTable>
|
||||
</el-form-item>
|
||||
<el-form-item label="标本日期" prop="">
|
||||
<el-date-picker v-model="formData.jyrq1" type="date" /> - <el-date-picker v-model="formData.jyrq2" type="date" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验医师" prop="yhdh">
|
||||
<el-input placeholder="请填写检验医师" v-model="formData.yhdh"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="病人来源" prop="brly">
|
||||
<el-input placeholder="请填写病人来源" v-model="formData.brly"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标本号">
|
||||
<el-date-picker v-model="formData.ybh1" type="date" /> - <el-date-picker v-model="formData.ybh2" type="date" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核标志">
|
||||
<el-select v-model="formData.jgbz" placeholder="" clearable>
|
||||
<el-option v-for="item in jgbzOption" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig">
|
||||
|
||||
</CustomTable>
|
||||
<h3>{{ msg }}</h3>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="formData" class="form" label-width="80px" :rules="rules" inline inline-message
|
||||
size="small">
|
||||
<el-form-item label="仪器分组" prop="lisgroup" size="small">
|
||||
<SelectTable v-model:data="formData.lisgroup" :fields="fields" width="100px" dict-type="GROUP" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医疗机构" prop="yljg">
|
||||
<SelectTable v-model:data="formData.yljg" :fields="fields" width="200px" dict-type="HOS" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请科室" prop="ksdh">
|
||||
<SelectTable v-model:data="formData.ksdh" :fields="fields" width="200px" dict-type="DP" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="formData.yq" width="200px" clearable @get-data-value="getList"></YQSelectTable>
|
||||
</el-form-item>
|
||||
<el-form-item label="标本日期" prop="jyrq">
|
||||
<el-date-picker v-model="formData.jyrq1" type="date" style="width: 150px;" /> - <el-date-picker
|
||||
v-model="formData.jyrq2" type="date" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验医师" prop="yhdh">
|
||||
<el-input placeholder="请填写检验医师" v-model="formData.yhdh"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="病人来源" prop="brly">
|
||||
<SelectTable v-model:data="formData.brly" :fields="fields" width="120px" dict-type="PT" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标本号" prop="ybh">
|
||||
<el-input placeholder="请输入开始标本号" v-model="formData.ybh1" style="width: 120px;"></el-input> - <el-input
|
||||
placeholder="请输入结束标本号" v-model="formData.ybh2" style="width: 120px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核标志">
|
||||
<el-select v-model="formData.jgbz" style="width: 120px" clearable>
|
||||
<el-option v-for="item in jgbzOption" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="formData.jzbz" label="急诊报告" true-value="1" false-value="0"></el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="checkData">批量审核</el-button>
|
||||
<el-button type="primary" @click="cancelCheck">取消审核</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<h3>{{ msg }}</h3>
|
||||
<div class="table-container">
|
||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig">
|
||||
<template #jgbz="{ row }">
|
||||
<span>{{ displayJGBZ(row.jgbz) }}</span>
|
||||
</template>
|
||||
<template #brly="{ row }">
|
||||
<span>{{ formatDict(row.brly, 'PT') }}</span>
|
||||
</template>
|
||||
<template #brxb="{ row }">
|
||||
<span>{{ displayBRXB(row.brxb) }}</span>
|
||||
</template>
|
||||
<template #brnl="{ row }">
|
||||
<span>{{ displayBRNL(row.nl, row.nldw) }}</span>
|
||||
</template>
|
||||
<template #ksdh="{ row }">
|
||||
<span>{{ formatDict(row.ksdh, 'DP') }}</span>
|
||||
</template>
|
||||
<template #sjys="{ row }">
|
||||
<span>{{ formatDict(row.sjys, 'SRD') }}</span>
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||
import { dictData } from '@/hooks';
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { batchCheckService, queryBatchCheckListService, cancelBatchCheckService } from '@/api/liswork/batchCheck/batchCheckApi';
|
||||
import dayjs from 'dayjs';
|
||||
import { formatDict, getDictData } from '@/hooks'
|
||||
import { displayBRNL, displayBRXB } from '@/utils/czUtil/lisUtil'
|
||||
|
||||
const formData = ref()
|
||||
const formData = ref({
|
||||
lisgroup: '', //仪器分组
|
||||
yljg: '', //医疗机构
|
||||
ksdh: '', //申请科室
|
||||
yq: '', //检验仪器
|
||||
jyrq1: '', //标本日期开始
|
||||
jyrq2: '', //标本日期结束
|
||||
yhdh: '', //检验医师
|
||||
brly: '', //病人来源
|
||||
ybh1: '', //标本号开始
|
||||
ybh2: '', //标本号结束
|
||||
jgbz: '0', //审核标志
|
||||
jzbz: 0 //急诊标志
|
||||
})
|
||||
const tableRef = ref();
|
||||
const msg = ref() //审核后结果显示
|
||||
const form = ref();
|
||||
const msg = ref('') //审核后结果显示
|
||||
const tableData = ref()
|
||||
const columns = ref([
|
||||
{ prop: 'checkSign', label: '审核标志', visible: true, align: 'center' },
|
||||
{ prop: 'yq', label: '检验仪器', visible: true, align: 'center' },
|
||||
{ prop: 'jyrq', label: '检验日期', visible: true, align: 'center' },
|
||||
{ type: 'selection', title: '选择', visible: true, align: 'center', width: 40 },
|
||||
{ prop: 'jgbz', label: '审核标志', visible: true, align: 'center', slot: 'jgbz' },
|
||||
{ prop: 'yqmc', label: '检验仪器', visible: true, align: 'center', width: 150 },
|
||||
{ prop: 'jyrq', label: '检验日期', visible: true, align: 'center', width: 150 },
|
||||
{ prop: 'ybh', label: '样本号', visible: true, align: 'center' },
|
||||
{ prop: 'brxm', label: '姓名', visible: true, align: 'center' },
|
||||
{ prop: 'zyh', label: '住院号', visible: true, align: 'center' },
|
||||
{ prop: 'brdh', label: '住院号', visible: true, align: 'center' },
|
||||
{ prop: 'sqh', label: '申请号', visible: true, align: 'center' },
|
||||
{ prop: 'brly', label: '病人类型', visible: true, align: 'center' },
|
||||
{ prop: 'brxb', label: '性别', visible: true, align: 'center' },
|
||||
{ prop: 'brnl', label: '年', visible: true, align: 'center' },
|
||||
{ prop: 'nldw', label: '龄', visible: true, align: 'center' },
|
||||
{ prop: 'ksdh', label: '科室', visible: true, align: 'center' },
|
||||
{ prop: 'brly', label: '病人类型', visible: true, align: 'center', slot: 'brly' },
|
||||
{ prop: 'brxb', label: '性别', visible: true, align: 'center', slot: 'brxb' },
|
||||
{ prop: 'brnl', label: '年龄', visible: true, align: 'center', slot: 'brnl' },
|
||||
{ prop: 'ksdh', label: '科室', visible: true, align: 'center', slot: 'ksdh' },
|
||||
{ prop: 'ch', label: '床号', visible: true, align: 'center' },
|
||||
{ prop: 'sjys', label: '送检医生', visible: true, align: 'center' },
|
||||
{ prop: 'sqsj', label: '申请时间', visible: true, align: 'center' },
|
||||
{ prop: 'cysj', label: '采样时间', visible: true, align: 'center' },
|
||||
{ prop: 'yhdh', label: '检验医师', visible: true, align: 'center' },
|
||||
{ prop: 'dysj', label: '报告日期', visible: true, align: 'center' },
|
||||
{ prop: 'sjys', label: '送检医生', visible: true, align: 'center', slot: 'sjys' },
|
||||
{ prop: 'sqsj', label: '申请时间', visible: true, align: 'center', width: 150 },
|
||||
{ prop: 'cysj', label: '采样时间', visible: true, align: 'center', width: 150 },
|
||||
{ prop: 'yhdhmc', label: '检验医师', visible: true, align: 'center' },
|
||||
{ prop: 'dysj', label: '报告日期', visible: true, align: 'center', width: 150 },
|
||||
{ prop: 'yblx', label: '样本', visible: true, align: 'center' },
|
||||
{ prop: 'hdys', label: '核对医生', visible: true, align: 'center' },
|
||||
{ prop: 'hdysmc', label: '核对医生', visible: true, align: 'center' },
|
||||
{ prop: 'dybz', label: '打印标志', visible: true, align: 'center' },
|
||||
{ prop: 'zd', label: '临床诊断', visible: true, align: 'center' },
|
||||
{ prop: 'bz', label: '备注', visible: true, align: 'center' },
|
||||
{ prop: 'confirmer', label: '审核人', visible: true, align: 'center' },
|
||||
{ prop: 'confirmdt', label: '审核时间', visible: true, align: 'center' },
|
||||
{ prop: 'confirmermc', label: '审核人', visible: true, align: 'center' },
|
||||
{ prop: 'confirmdt', label: '审核时间', visible: true, align: 'center', width: 150 },
|
||||
]);
|
||||
|
||||
const jgbzOption = ref([
|
||||
@ -84,7 +133,7 @@ const jgbzOption = ref([
|
||||
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '78vh', // 高度
|
||||
height: 'calc(100vh - 220px)', // 高度,
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// cellStyle: cellStyleHd
|
||||
})
|
||||
@ -96,10 +145,110 @@ const fields = ref(
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
const getList = () => {
|
||||
const displayJGBZ = (jgbz: string) => {
|
||||
const option = jgbzOption.value.find((opt) => opt.value === jgbz)
|
||||
return option ? option.label : jgbz
|
||||
}
|
||||
|
||||
|
||||
const validateYbhRange = (rule: any, value: any, callback: any) => {
|
||||
const { ybh1, ybh2 } = formData.value // 同时获取两个输入框的值
|
||||
|
||||
// 场景1:两个都必填
|
||||
if (!ybh1 && !ybh2) {
|
||||
callback(new Error('开始和结束标本号不能为空'))
|
||||
return
|
||||
}
|
||||
if (!ybh1) {
|
||||
callback(new Error('请输入开始标本号'))
|
||||
return
|
||||
}
|
||||
if (!ybh2) {
|
||||
callback(new Error('请输入结束标本号'))
|
||||
return
|
||||
}
|
||||
|
||||
// 校验通过:必须调用空的callback()
|
||||
callback()
|
||||
}
|
||||
|
||||
|
||||
const validateJYRQRange = (rule: any, value: any, callback: any) => {
|
||||
const { jyrq1, jyrq2 } = formData.value
|
||||
if (!jyrq1 || !jyrq2) {
|
||||
callback(new Error('标本日期范围不能为空'))
|
||||
return false
|
||||
}
|
||||
if (new Date(jyrq1) > new Date(jyrq2)) {
|
||||
callback(new Error('标本日期范围不正确,开始日期不能大于结束日期'))
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const rules = ref({
|
||||
yljg: [{ required: true, message: '请选择医疗机构', trigger: 'blur' }],
|
||||
ybh: [{ validator: validateYbhRange, trigger: 'blur' }],
|
||||
yq: [{ required: true, message: '请选择检验仪器', trigger: 'blur' }],
|
||||
jyrq: [{ validator: validateJYRQRange, trigger: 'blur' }],
|
||||
})
|
||||
|
||||
|
||||
const getList = async () => {
|
||||
await form.value.validate()
|
||||
formData.value.jyrq1 = dayjs(formData.value.jyrq1).format('YYYY-MM-DD HH:mm:ss')
|
||||
formData.value.jyrq2 = dayjs(formData.value.jyrq2).format('YYYY-MM-DD HH:mm:ss')
|
||||
const res = await queryBatchCheckListService(formData.value)
|
||||
tableData.value = res.data
|
||||
}
|
||||
|
||||
const checkData = async () => {
|
||||
// 从 CustomTable 暴露的方法获取已选中行(兼容直接访问内部 tableRef)
|
||||
const selected = tableRef.value?.getSelectionRows
|
||||
? tableRef.value.getSelectionRows()
|
||||
: (tableRef.value?.tableRef?.getSelectionRows ? tableRef.value.tableRef.getSelectionRows() : [])
|
||||
|
||||
const paramList = (selected || []).map((item: any) => ({
|
||||
userId: "",
|
||||
yq: String(item.yq).trim(),
|
||||
jyrq: dayjs(item.jyrq).format('YYYY-MM-DD HH:mm:ss'),
|
||||
ybh: item.ybh,
|
||||
}))
|
||||
|
||||
if (!paramList.length) {
|
||||
msg.value = '请先选择要审核的行'
|
||||
return
|
||||
}
|
||||
|
||||
console.log(paramList)
|
||||
const ret = await batchCheckService(paramList)
|
||||
if (ret && ret.code === 200) {
|
||||
msg.value = '审核成功:' + ret.msg
|
||||
getList()
|
||||
}
|
||||
}
|
||||
|
||||
const cancelCheck = async () => {
|
||||
const paramList = tableRef.value.getSelectedRows()
|
||||
const ret = await cancelBatchCheckService(paramList)
|
||||
if (ret.code === 200) {
|
||||
getList()
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDictData('DP', 'SRD')
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
<style scoped lang="scss">
|
||||
.table-container {
|
||||
height: calc(100vh - 220px);
|
||||
overflow: auto;
|
||||
/* 如果表格高度超出,显示滚动条 */
|
||||
padding-bottom: 12px;
|
||||
/* 给底部留出空间,避免被遮挡 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user