提交merge1.3
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询参数列表
|
||||
export function collectionList(query) {
|
||||
return request({
|
||||
url: '/inspection/collection/information-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 修改参数配置
|
||||
export function editStatus(ids,type) {
|
||||
return request({
|
||||
url: '/inspection/collection/information-status',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids: ids,
|
||||
type: type
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
269
openhis-ui-vue3/src/views/inspection/groupRec/index.vue
Normal file
269
openhis-ui-vue3/src/views/inspection/groupRec/index.vue
Normal file
@@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="数据查询" prop="searchKey">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="患者姓名/项目名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px;">
|
||||
<el-date-picker
|
||||
v-model="authoredTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
:disabled="collect"
|
||||
@click="handleCollect('已接收')"
|
||||
>样本接收</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="Edit"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- >合管</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleCollect('已采集')"
|
||||
>取消</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>打印条码</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-if="refreshTable"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
row-key="chargeName"
|
||||
:default-expand-all="false"
|
||||
>
|
||||
<!-- 子表列 -->
|
||||
<el-table-column
|
||||
type="expand"
|
||||
width="50"
|
||||
fixed="left"
|
||||
>
|
||||
<template #default="props">
|
||||
<el-table
|
||||
:data="props.row.children"
|
||||
style="width: 100%"
|
||||
:show-header="true"
|
||||
@selection-change="handleSelectionChange($event, props.row)"
|
||||
ref="childTable"
|
||||
>
|
||||
<!-- 子表的多选框 -->
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
:selectable="selectable"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="specimenName"
|
||||
label="样本名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="specimenVolume"
|
||||
label="样本数量"
|
||||
>
|
||||
<template #default="innerProps">
|
||||
{{ innerProps.row.specimenVolume }} {{ innerProps.row.specimenUnit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="collectionStatusEnumText"
|
||||
label="样本状态"
|
||||
>
|
||||
<template #default="nerProp">
|
||||
<span v-if="nerProp.row.collectionStatusEnum == 1" style="color:green">
|
||||
已采集
|
||||
</span>
|
||||
<span v-else-if="nerProp.row.collectionStatusEnum == 0" style="color:orange">
|
||||
待采集
|
||||
</span>
|
||||
<span v-else-if="nerProp.row.collectionStatusEnum == 2" style="color:#0EB396">
|
||||
已接收
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="receivedDate"
|
||||
label="接收时间"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 母表列 -->
|
||||
<el-table-column
|
||||
prop="chargeName"
|
||||
label="项目名称"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="patientName"
|
||||
label="患者姓名"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="genderEnumText"
|
||||
label="性别"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column label="样本状态">
|
||||
<template #default="sprops">
|
||||
<span v-if="hasPendingCollection(sprops.row.children)" style="color:red">
|
||||
待接收
|
||||
</span>
|
||||
<span v-else style="color:#0EB396">
|
||||
已接收
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="doctorName"
|
||||
label="开单医生"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="authoredTime"
|
||||
label="开单时间"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Config">
|
||||
import { collectionList,editStatus } from "./components/collect.js";
|
||||
import {formatDateStr} from "@/utils/index.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const dataList = ref([]);
|
||||
const refreshTable = ref(true);
|
||||
|
||||
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const collect = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const authoredTime = ref([
|
||||
//默认三天前
|
||||
formatDateStr(new Date(new Date().setDate(new Date().getDate() - 3)), 'YYYY-MM-DD'),
|
||||
formatDateStr(new Date(), 'YYYY-MM-DD'),
|
||||
]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询参数列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.authoredTimeSTime = authoredTime.value[0] + ' 00:00:00';
|
||||
queryParams.value.authoredTimeETime = authoredTime.value[1] + ' 23:59:59';
|
||||
collectionList(queryParams.value).then(response => {
|
||||
dataList.value = proxy.handleTree(response.data.records , "id");
|
||||
total.value = response.data.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
collect.value = selection.length <= 0;
|
||||
single.value = selection.length < 2;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 采集按钮操作 */
|
||||
function handleCollect(type) {
|
||||
|
||||
editStatus(ids.value,type).then(()=>{
|
||||
proxy.$modal.msgSuccess("操作成功");
|
||||
getList();
|
||||
})
|
||||
}
|
||||
|
||||
function hasPendingCollection(children) {
|
||||
return children.some(child => child.collectionStatusEnum === 0 || child.collectionStatusEnum === 1); // 如果有任意子项是待采集或已采集状态
|
||||
}
|
||||
function selectable(row) {
|
||||
// 判断 collectionStatusEnum
|
||||
return row.collectionStatusEnum !== 0;
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
@@ -0,0 +1,82 @@
|
||||
import request from '@/utils/request.js'
|
||||
|
||||
// 查询器材目录列表
|
||||
export function getInstrumentList(query) {
|
||||
return request({
|
||||
url: '/inspection/instrument/information-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询器材目录详细
|
||||
export function getInstrumentOne(id) {
|
||||
return request({
|
||||
url: '/inspection/instrument/information-one',
|
||||
method: 'get',
|
||||
params: { id } // 确保参数正确传递
|
||||
})
|
||||
}
|
||||
|
||||
// 新增器材目录
|
||||
export function addInstrument(data) {
|
||||
return request({
|
||||
url: '/inspection/instrument/information',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改器材目录
|
||||
export function editInstrument(data) {
|
||||
return request({
|
||||
url: '/inspection/instrument/information',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// // 删除器材目录
|
||||
// export function delUser(userId) {
|
||||
// return request({
|
||||
// url: '/system/user/' + userId,
|
||||
// method: 'delete'
|
||||
// })
|
||||
// }
|
||||
|
||||
// 器材目录分类查询
|
||||
export function getInstrumentInit() {
|
||||
return request({
|
||||
url: '/inspection/instrument/init',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function editInstrumentStatus(ids,type) {
|
||||
return request({
|
||||
url: '/inspection/instrument/information-status',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids: ids,
|
||||
type: type
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 查询部门树形数据
|
||||
export function deptTreeSelect(queryParams) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
// 查询地点树形数据
|
||||
export function locationTreeSelect(queryParams) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location-page-tree',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,402 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 添加或修改用户配置对话框 -->
|
||||
<el-dialog :title="title" v-model="visible" width="955px" append-to-body>
|
||||
<el-form
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
ref="instrumentDialogRef"
|
||||
label-width="110px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仪器类型" prop="instrumentTypeEnum">
|
||||
<el-tree-select
|
||||
v-model="form.instrumentTypeEnum"
|
||||
:data="instrumentTypeEnum"
|
||||
:props="{ value: 'value', label: 'info', children: 'children' }"
|
||||
:disabled="false"
|
||||
value-key="value"
|
||||
placeholder="请选择样本类型"
|
||||
check-strictly
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仪器编号" prop="instrumentCode">
|
||||
<el-input v-model="form.instrumentCode" placeholder="请输入仪器编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仪器名称" prop="instrumentName">
|
||||
<el-input v-model="form.instrumentName" placeholder="请输入仪器名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仪器主码" prop="instrumentMainCode">
|
||||
<el-input v-model="form.instrumentMainCode" placeholder="请输入仪器主码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仪器型号" prop="instrumentModel">
|
||||
<el-input v-model="form.instrumentModel" placeholder="请输入仪器型号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制造商" prop="manufacturer">
|
||||
<el-input v-model="form.manufacturer" placeholder="请输入制造商" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="序列号" prop="serialNumber">
|
||||
<el-input v-model="form.serialNumber" placeholder="请输入序列号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购公司" prop="purchasingCompany">
|
||||
<el-input v-model="form.purchasingCompany" placeholder="请输入采购公司" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input v-model="form.contactPerson" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购日期" prop="purchaseDate">
|
||||
<el-date-picker
|
||||
v-model="form.purchaseDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetime"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="原始价格" prop="originalPrice">
|
||||
<el-input v-model="form.originalPrice" placeholder="请输入原始价格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="交易价格" prop="transactionPrice">
|
||||
<el-input v-model="form.transactionPrice" placeholder="请输入交易价格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="安装日期" prop="installationDate">
|
||||
<el-date-picker
|
||||
v-model="form.installationDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetime"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="安装人员" prop="installationPerson">
|
||||
<el-input v-model="form.installationPerson" placeholder="请输入安装人员" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维护人员" prop="maintenancePerson">
|
||||
<el-input v-model="form.maintenancePerson" placeholder="请输入维护人员" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用科室" prop="orgId">
|
||||
<el-tree-select
|
||||
v-model="form.orgId"
|
||||
:data="deptOptions"
|
||||
:props="{ value: 'id', label: 'name', children: 'children' }"
|
||||
value-key="id"
|
||||
placeholder="请选择科室"
|
||||
check-strictly
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="鉴定人员" prop="identificationPerson">
|
||||
<el-input v-model="form.identificationPerson" placeholder="请输入鉴定人员" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="记录温度" prop="recordedTemperature">
|
||||
<el-input v-model="form.recordedTemperature" placeholder="请输入记录温度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="配件" prop="accessories">
|
||||
<el-input v-model="form.accessories" placeholder="请输入配件" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仪器状态" prop="instrumentStatusEnum">
|
||||
<el-select v-model="form.instrumentStatusEnum" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="dict in InstrumentStatusEnumOption"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="损坏报告日期" prop="damageReportDate">
|
||||
<el-date-picker
|
||||
v-model="form.damageReportDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetime"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否可重新检查" prop="recheckableInstrumentEnum">
|
||||
<el-select v-model="form.recheckableInstrumentEnum" placeholder="请选择" clearable>
|
||||
<el-option label="是" :value="1"></el-option>
|
||||
<el-option label="否" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="使用状态" prop="usageStatusEnum">
|
||||
<el-select
|
||||
v-model="form.usageStatusEnum"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in statusFlagOptions"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item >
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报废原因" prop="decommissionReason">
|
||||
<el-input v-model="form.decommissionReason" placeholder="请输入报废原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input v-model="form.remarks" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer v-if="title != '查看'">
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="InstrumentDialog">
|
||||
import { editInstrument, addInstrument, deptTreeSelect, locationTreeSelect } from './instrument.js';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const title = ref('');
|
||||
const visible = ref(false);
|
||||
const emits = defineEmits(['submit']); // 声明自定义事件
|
||||
const instrumentTypeEnum = ref([]); // 仪器分类
|
||||
const statusFlagOptions = ref([]); // 使用状态标记
|
||||
const InstrumentStatusEnumOption = ref([]); // 仪器状态标记
|
||||
const deptOptions = ref(undefined); // 部门树选项
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
rules: {
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
instrumentTypeEnum: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
statusFlagOptions: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
instrumentStatusEnumOption:{
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
});
|
||||
|
||||
// 显示弹框
|
||||
function show() {
|
||||
console.log("2111",props.instrumentStatusEnumOption)
|
||||
reset();
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
instrumentTypeEnum.value = props.instrumentTypeEnum;
|
||||
statusFlagOptions.value = props.statusFlagOptions;
|
||||
InstrumentStatusEnumOption.value = props.instrumentStatusEnumOption;
|
||||
getDeptTree()
|
||||
visible.value = true;
|
||||
|
||||
}
|
||||
//医保目录对照后,赋值
|
||||
function setValue(row) {
|
||||
form.value = {
|
||||
name: formatValue(row.consumableName), //医疗服务项目名称
|
||||
// modelNumber: formatValue(row.productModel), // 产品型号
|
||||
modelNumber: formatValue(row.specification), // 规格
|
||||
manufacturerText: formatValue(row.manufacturerName), // 厂家名称
|
||||
partPercent: 1,
|
||||
};
|
||||
}
|
||||
|
||||
// 显示弹框
|
||||
function edit() {
|
||||
reset();
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
form.value = props.item;
|
||||
instrumentTypeEnum.value = props.instrumentTypeEnum;
|
||||
statusFlagOptions.value = props.statusFlagOptions;
|
||||
InstrumentStatusEnumOption.value = props.instrumentStatusEnumOption;
|
||||
getDeptTree();
|
||||
visible.value = true;
|
||||
}
|
||||
/** 重置操作表单 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
instrumentCode: undefined,
|
||||
instrumentName: undefined,
|
||||
instrumentMainCode: undefined,
|
||||
instrumentType: 1, // 替换为 1
|
||||
instrumentModel: undefined,
|
||||
manufacturer: undefined,
|
||||
serialNumber: undefined,
|
||||
purchasingCompany: undefined,
|
||||
contactPerson: undefined,
|
||||
purchaseDate: undefined,
|
||||
originalPrice: undefined,
|
||||
transactionPrice: undefined,
|
||||
installationDate: undefined,
|
||||
installationPerson: undefined,
|
||||
maintenancePerson: undefined,
|
||||
department: undefined,
|
||||
identificationPerson: undefined,
|
||||
recordedTemperature: undefined,
|
||||
accessories: undefined,
|
||||
instrumentStatus: 1, // 替换为 1
|
||||
damageReportDate: undefined,
|
||||
recheckableInstrument: 1, // 替换为 1
|
||||
usageStatusEnum: 2, // 替换为 1
|
||||
decommissionReason: undefined,
|
||||
remarks: undefined
|
||||
};
|
||||
proxy.resetForm('instrumentDialogRef');
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs['instrumentDialogRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(form.value, 'form.value');
|
||||
if (form.value.id != undefined) {
|
||||
editInstrument(form.value).then((response) => {
|
||||
// 触发自定义事件,并传递数据给父组件
|
||||
emits('submit');
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
visible.value = false;
|
||||
reset(); // 重置表单数据
|
||||
});
|
||||
} else {
|
||||
addInstrument(form.value).then((response) => {
|
||||
// 触发自定义事件,并传递数据给父组件
|
||||
emits('submit');
|
||||
proxy.$modal.msgSuccess('新增成功');
|
||||
visible.value = false;
|
||||
reset(); // 重置表单数据
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function getDeptTree() {
|
||||
deptTreeSelect().then((response) => {
|
||||
console.log(response, 'response查询部门下拉树结构');
|
||||
deptOptions.value = response.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function formatValue(str) {
|
||||
if (str === null || str === undefined || str === '' || str === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
visible.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
edit,
|
||||
setValue,
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
/* 使用深度选择器 */
|
||||
.custom-label-spacing :deep(.el-form-item__label) {
|
||||
line-height: 1.2; /* 调整行间距 */
|
||||
margin-bottom: 4px; /* 调整 label 和输入框之间的间距 */
|
||||
}
|
||||
</style>
|
||||
505
openhis-ui-vue3/src/views/inspection/instrument/index.vue
Normal file
505
openhis-ui-vue3/src/views/inspection/instrument/index.vue
Normal file
@@ -0,0 +1,505 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--器材目录-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-title">仪器类型目录</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="instrumentType"
|
||||
:props="{ label: 'info', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="treeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--器材目录-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<!-- <el-col :span="6"> -->
|
||||
<el-form-item label="仪器名" prop="searchKey" label-width="55">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="名称/编码/"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="5"> -->
|
||||
<el-form-item label="状态" prop="statusEnum" label-width="50">
|
||||
<el-select v-model="queryParams.statusEnum" clearable>
|
||||
<el-option
|
||||
v-for="status in statusFlagOptions"
|
||||
:key="status.value"
|
||||
:label="status.info"
|
||||
:value="status.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="openAddInstrument()"
|
||||
>添加</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Remove"
|
||||
:disabled="multiple"
|
||||
@click="handleClose"
|
||||
>停用</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="CirclePlus"
|
||||
:disabled="multiple"
|
||||
@click="handleStart"
|
||||
>启用</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Search"
|
||||
@click="getList"
|
||||
>查询</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出Excel</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="instrumentList"
|
||||
@selection-change="handleSelectionChange"
|
||||
width="90%"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column
|
||||
label="仪器编码"
|
||||
align="center"
|
||||
key="instrumentCode"
|
||||
prop="instrumentCode"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="仪器名称"
|
||||
align="center"
|
||||
key="instrumentName"
|
||||
prop="instrumentName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="主编码"
|
||||
align="center"
|
||||
key="instrumentMainCode"
|
||||
prop="instrumentMainCode"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="类型"
|
||||
align="center"
|
||||
key="instrumentTypeEnumText"
|
||||
prop="instrumentTypeEnumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="型号"
|
||||
align="center"
|
||||
key="instrumentModel"
|
||||
prop="instrumentModel"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="生产厂家"
|
||||
align="center"
|
||||
key="manufacturer"
|
||||
prop="manufacturer"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="序列号"
|
||||
align="center"
|
||||
key="serialNumber"
|
||||
prop="serialNumber"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="采购单位"
|
||||
align="center"
|
||||
key="purchasingCompany"
|
||||
prop="purchasingCompany"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系人"
|
||||
align="center"
|
||||
key="contactPerson"
|
||||
prop="contactPerson"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="采购日期"
|
||||
align="center"
|
||||
key="purchaseDate"
|
||||
prop="purchaseDate"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="原价"
|
||||
align="center"
|
||||
key="originalPrice"
|
||||
prop="originalPrice"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="成交价"
|
||||
align="center"
|
||||
key="transactionPrice"
|
||||
prop="transactionPrice"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="安装日期"
|
||||
align="center"
|
||||
key="installationDate"
|
||||
prop="installationDate"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.installationDate )}}</span>
|
||||
</template>
|
||||
</el-table-column>>
|
||||
<el-table-column
|
||||
label="安装人"
|
||||
align="center"
|
||||
key="installationPerson"
|
||||
prop="installationPerson"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="维护人"
|
||||
align="center"
|
||||
key="maintenancePerson"
|
||||
prop="maintenancePerson"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="使用科室"
|
||||
align="center"
|
||||
key="orgId_dictText"
|
||||
prop="orgId_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
</el-table-column>>
|
||||
<el-table-column
|
||||
label="鉴定人"
|
||||
align="center"
|
||||
key="identificationPerson"
|
||||
prop="identificationPerson"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="记录温度"
|
||||
align="center"
|
||||
key="recordedTemperature"
|
||||
prop="recordedTemperature"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="附件"
|
||||
align="center"
|
||||
key="accessories"
|
||||
prop="accessories"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="仪器状态"
|
||||
align="center"
|
||||
key="instrumentStatusEnum"
|
||||
prop="instrumentStatusEnum"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="报损日期"
|
||||
align="center"
|
||||
key="damageReportDate"
|
||||
prop="damageReportDate"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="可复检"
|
||||
align="center"
|
||||
key="recheckableInstrumentEnum"
|
||||
prop="recheckableInstrumentEnum"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="使用情况"
|
||||
align="center"
|
||||
key="usageStatusEnum"
|
||||
prop="usageStatusEnum"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="报废原因"
|
||||
align="center"
|
||||
key="decommissionReason"
|
||||
prop="decommissionReason"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
key="remarks"
|
||||
prop="remarks"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150"
|
||||
class-name="small-padding fixed-width"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="openEditInstrument(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<instrument-dialog
|
||||
ref="instrumentRef"
|
||||
:title="title"
|
||||
:item="currentData"
|
||||
:instrument-type-enum="instrumentTypeList"
|
||||
:statusFlagOptions="statusFlagOptions"
|
||||
:instrument-status-enum-option="instrumentStatusEnumOptions"
|
||||
@submit="getList()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="instrument">
|
||||
import {
|
||||
getInstrumentList,
|
||||
getInstrumentOne, getInstrumentInit, editInstrumentStatus,
|
||||
} from "./components/instrument.js";
|
||||
import instrumentDialog from "./components/instrumentDialog.vue";
|
||||
import { nextTick } from "vue";
|
||||
import {parseTime} from "../../../utils/his.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const instrumentList = ref([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]); // 存储选择的行数据
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const instrumentType = ref(undefined);
|
||||
const instrumentTypeList = ref(undefined);
|
||||
const statusFlagOptions = ref(undefined);
|
||||
const instrumentStatusEnumOptions = ref(undefined);
|
||||
|
||||
const currentData = ref({});
|
||||
|
||||
const viewData = ref({});
|
||||
const currentCategoryEnum = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined, // 品名/商品名/英文品名/编码/拼音
|
||||
typeEnum: undefined, // 类型
|
||||
statusEnum: undefined, // 状态(
|
||||
|
||||
},
|
||||
rules: {},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
/** 样本分类查询下拉树结构 */
|
||||
function getTreatmentList() {
|
||||
getInstrumentInit().then((response) => {
|
||||
console.log(response, "response器材目录分类查询下拉树结构");
|
||||
instrumentType.value = JSON.parse(JSON.stringify(response.data.instrumentTypeList)).sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
});
|
||||
instrumentType.value.push({ info: "全部", value: "" });
|
||||
instrumentTypeList.value = response.data.instrumentTypeList.sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
});
|
||||
statusFlagOptions.value = response.data.statusFlagOptions;
|
||||
instrumentStatusEnumOptions.value = response.data.instrumentStatusEnumList;
|
||||
|
||||
});
|
||||
}
|
||||
/** 查询器材目录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
getInstrumentList(queryParams.value).then((res) => {
|
||||
loading.value = false;
|
||||
instrumentList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
queryParams.value.instrumentTypeEnum = data.value;
|
||||
currentCategoryEnum.value = data.value;
|
||||
handleQuery();
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 启用按钮操作 */
|
||||
function handleStart() {
|
||||
const startIds = ids.value;
|
||||
// selectedData
|
||||
proxy.$modal
|
||||
.confirm("是否确定启用数据!")
|
||||
.then(function () {
|
||||
return editInstrumentStatus(startIds,'启用');
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("启用成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 停用按钮操作 */
|
||||
function handleClose() {
|
||||
const stopIds = ids.value;
|
||||
proxy.$modal
|
||||
.confirm("是否确认停用数据!")
|
||||
.then(function () {
|
||||
return editInstrumentStatus(stopIds,'停用');
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("停用成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
"system/user/export",
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`user_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, "selection");
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 打开新增弹窗 */
|
||||
function openAddInstrument() {
|
||||
// if (!currentCategoryEnum.value) {
|
||||
// return proxy.$modal.msgError("请选择器材目录分类");
|
||||
// }
|
||||
title.value = "新增";
|
||||
nextTick(() => {
|
||||
proxy.$refs.instrumentRef.show();
|
||||
});
|
||||
}
|
||||
/** 打开编辑弹窗 */
|
||||
function openEditInstrument(row) {
|
||||
currentData.value = {};
|
||||
console.log("打开编辑弹窗");
|
||||
getInstrumentOne(row.id).then((response) => {
|
||||
console.log(response, "currentDataform");
|
||||
currentData.value = response.data;
|
||||
title.value = "编辑";
|
||||
nextTick(() => {
|
||||
proxy.$refs["instrumentRef"].edit();
|
||||
});
|
||||
getList();
|
||||
});
|
||||
}
|
||||
getTreatmentList();
|
||||
getList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.el-select{
|
||||
width: 150px!important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,36 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 初始化
|
||||
export function getItemList(query) {
|
||||
return request({
|
||||
url: '/inspection/lisConfig/init-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getItemDetailList(id) {
|
||||
return request({
|
||||
url: '/inspection/lisConfig/info-detail',
|
||||
method: 'get',
|
||||
params: {id}
|
||||
})
|
||||
}
|
||||
export function getInfoList(query) {
|
||||
return request({
|
||||
url: '/inspection/lisConfig/init-list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function saveAllConfig(data) {
|
||||
return request({
|
||||
url: '/inspection/lisConfig/saveAll',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
503
openhis-ui-vue3/src/views/inspection/lisconfig/index.vue
Normal file
503
openhis-ui-vue3/src/views/inspection/lisconfig/index.vue
Normal file
@@ -0,0 +1,503 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--诊疗目录-->
|
||||
<el-col :span="7" :xs="24">
|
||||
<div class="head-title">检验项目</div>
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="名称/编码"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
@keyup.enter="getItemList"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Search"
|
||||
@click="getItemPageList()"
|
||||
>查询</el-button>
|
||||
<div>
|
||||
<el-table
|
||||
ref="freTableRef"
|
||||
v-loading="loading"
|
||||
:data="itemList"
|
||||
row-key="id"
|
||||
@row-click="handleRowClick"
|
||||
>
|
||||
<el-table-column label="项目名称" align="left" prop="name" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="itemListTotal > 0"
|
||||
:total="itemListTotal"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getItemPageList()"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="17" :xs="24">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleFormSubmit"
|
||||
v-hasPermi="['system:user:add']"
|
||||
>保存配置详情</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-popover
|
||||
:popper-style="{ padding: '0' }"
|
||||
placement="bottom-start"
|
||||
:visible="deviceShowPopover"
|
||||
trigger="manual"
|
||||
:width="800"
|
||||
>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
height="400"
|
||||
:data="deviceDefs"
|
||||
@row-click = "addMaterialsRow"
|
||||
row-key="id"
|
||||
class="mb8"
|
||||
>
|
||||
<el-table-column label="项目名称" align="left" prop="name" />
|
||||
</el-table>
|
||||
<template #reference>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<el-input
|
||||
@focus="handleFocus('materials')"
|
||||
@blur="handleBlur('materials')"
|
||||
@input="handleSearch('materials')"
|
||||
v-model="query.deviceSearchKey"
|
||||
placeholder="请输入耗材名称"
|
||||
style="flex-grow: 1;"
|
||||
/>
|
||||
<el-button type="text"
|
||||
icon="Plus"
|
||||
style="margin-left: 8px; cursor: pointer;"
|
||||
:disabled="true">
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
<!-- 耗材 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="materialsList"
|
||||
row-key="id"
|
||||
class="mb8"
|
||||
>
|
||||
<el-table-column
|
||||
prop="deviceDefinitionName"
|
||||
label="耗材名称"
|
||||
width="200"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" width="400">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
icon="Delete"
|
||||
:disabled="scope.row.id == ''"
|
||||
@click="deleteMaterial(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 样本定义表格 -->
|
||||
<el-popover
|
||||
:popper-style="{ padding: '0' }"
|
||||
placement="bottom-start"
|
||||
:visible="speShowPopover"
|
||||
trigger="manual"
|
||||
:width="800"
|
||||
>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="specimenDefs"
|
||||
row-key="id"
|
||||
@row-click="addSamplesRow"
|
||||
class="mb8"
|
||||
>
|
||||
<el-table-column label="项目名称" align="left" prop="specimenName" />
|
||||
</el-table>
|
||||
<template #reference>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<el-input
|
||||
@focus="handleFocus('samples')"
|
||||
@blur="handleBlur('samples')"
|
||||
@input="handleSearch('samples')"
|
||||
v-model="query.specimenSearchKey"
|
||||
placeholder="请输入样本名称"
|
||||
style="flex-grow: 1;"
|
||||
/>
|
||||
<el-button type="text"
|
||||
icon="Plus"
|
||||
style="margin-left: 8px; cursor: pointer;"
|
||||
:disabled="true">
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="sampleList"
|
||||
:key="sample => sample.id"
|
||||
class="mb8"
|
||||
>
|
||||
<el-table-column
|
||||
prop="specimenName"
|
||||
label="样本名称"
|
||||
width="200"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="specimenVolume"
|
||||
label="数量"
|
||||
width="200"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.specimenVolume" placeholder="请输入数量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="specimenUnit"
|
||||
label="单位"
|
||||
width="200"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.specimenUnit" placeholder="请输入单位"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" width="400">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
icon="Delete"
|
||||
:disabled="scope.row.id == ''"
|
||||
@click="deleteSample(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-popover
|
||||
:popper-style="{ padding: '0' }"
|
||||
placement="bottom-start"
|
||||
:visible="obserShowPopover"
|
||||
trigger="manual"
|
||||
:width="800"
|
||||
>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="observationDefs"
|
||||
row-key="id"
|
||||
@row-click="addObservationsRow"
|
||||
class="mb8"
|
||||
>
|
||||
<el-table-column label="项目名称" align="left" prop="name" />
|
||||
</el-table>
|
||||
<template #reference>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<el-input
|
||||
@focus="handleFocus('observations')"
|
||||
@blur="handleBlur('observations')"
|
||||
@input="handleSearch('observations')"
|
||||
v-model="query.observationSearchKey"
|
||||
placeholder="请输入观测名称"
|
||||
style="flex-grow: 1;"
|
||||
/>
|
||||
<el-button type="text"
|
||||
icon="Plus"
|
||||
style="margin-left: 8px; cursor: pointer;"
|
||||
:disabled="true">
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
<!-- 观测定义表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="observationList"
|
||||
:key="observation => observation.id"
|
||||
class="mb8"
|
||||
>
|
||||
<el-table-column
|
||||
prop="observationName"
|
||||
label="观测名称"
|
||||
width="200"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="observationCode"
|
||||
label="观测代码"
|
||||
width="200"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" width="400">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
link
|
||||
icon="Delete"
|
||||
:disabled="scope.row.id == ''"
|
||||
@click="deleteObservation(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="itemList">
|
||||
import {
|
||||
getItemList, getItemDetailList, getInfoList, saveAllConfig
|
||||
} from './components/lisConfig.js';
|
||||
import { ElMessage } from "element-plus";
|
||||
import {saveAll} from "@/views/basicmanage/medicalOrderSet/components/api.js";
|
||||
const itemList = ref([]);
|
||||
const loading = ref(true);
|
||||
const itemListTotal = ref(0);
|
||||
const deviceDefs = ref([]);
|
||||
const specimenDefs = ref([]);
|
||||
const observationDefs = ref([]);
|
||||
const materialsList = ref([]);
|
||||
const sampleList = ref([]);
|
||||
const observationList = ref([]);
|
||||
const currentLeftRow = ref(null);
|
||||
let deviceShowPopover = ref(false);
|
||||
let speShowPopover = ref(false);
|
||||
let obserShowPopover = ref(false);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
searchKey:'',
|
||||
status : 0,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
categoryCode:22,
|
||||
},
|
||||
query :{
|
||||
searchKey:'',
|
||||
deviceSearchKey:'',
|
||||
specimenSearchKey:'',
|
||||
observationSearchKey:'',
|
||||
type: 'all'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const { queryParams, form, tableRules, query} = toRefs(data);
|
||||
|
||||
/** 获取字典列表 */
|
||||
function getItemPageList() {
|
||||
getItemList(queryParams.value).then((res) => {
|
||||
if (res.code === 200) {
|
||||
itemList.value =
|
||||
res.data.records.length > 0
|
||||
? res.data.records.map((res) => {
|
||||
return {
|
||||
...res,
|
||||
isEditing: false, // 标记当前行是否正在编辑
|
||||
error: false, // 新增 error 字段
|
||||
};
|
||||
})
|
||||
: [];
|
||||
}
|
||||
itemListTotal.value = res.data.total;
|
||||
});
|
||||
getInfoLists(query);
|
||||
loading.value = false
|
||||
}
|
||||
function getDetailList(id) {
|
||||
getItemDetailList(id).then((res) => {
|
||||
if (res.code === 200) {
|
||||
materialsList.value = res.data.activityDefDeviceDefs;
|
||||
sampleList.value = res.data.activityDefSpecimenDefs;
|
||||
observationList.value = res.data.activityDefObservationDefs;
|
||||
}
|
||||
});
|
||||
loading.value = false
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleRowClick(row) {
|
||||
currentLeftRow.value = row; // 记录当前行
|
||||
getDetailList(row.id);
|
||||
|
||||
}
|
||||
|
||||
function getInfoLists(query) {
|
||||
switch (query.value.type) {
|
||||
case 'all':
|
||||
getInfoList( query.value).then((res) => {
|
||||
deviceDefs.value = res.data.deviceDefs;
|
||||
specimenDefs.value = res.data.specimenDefs;
|
||||
observationDefs.value = res.data.observationDefs;
|
||||
})
|
||||
break;
|
||||
case 'device':
|
||||
getInfoList( query.value).then((res) => {
|
||||
deviceDefs.value = res.data;
|
||||
})
|
||||
break;
|
||||
case 'specimen':
|
||||
getInfoList( query.value).then((res) => {
|
||||
specimenDefs.value = res.data;
|
||||
})
|
||||
break;
|
||||
case 'observation':
|
||||
getInfoList( query.value).then((res) => {
|
||||
observationDefs.value = res.data;
|
||||
})
|
||||
}
|
||||
}
|
||||
// 处理表单提交
|
||||
/* 保存/新增 */
|
||||
function handleFormSubmit() {
|
||||
saveAllConfig({
|
||||
id: currentLeftRow.value.id,
|
||||
activityDefDeviceDefs: materialsList.value,
|
||||
activityDefSpecimenDefs: sampleList.value,
|
||||
activityDefObservationDefs: observationList.value,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success("保存成功");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//添加行
|
||||
function isDuplicate(id, list,e) {
|
||||
switch (e) {
|
||||
case 'materials':
|
||||
return list.some(item => item.deviceDefinitionId === id);
|
||||
case 'samples':
|
||||
return list.some(item => item.specimenDefinitionId === id);
|
||||
case 'observations':
|
||||
return list.some(item => item.
|
||||
observationDefinitionId === id);
|
||||
}
|
||||
|
||||
}
|
||||
function addMaterialsRow(row) {
|
||||
if (isDuplicate(row.id, materialsList.value,'materials')) {
|
||||
ElMessage.warning("请勿重复添加此材料!");
|
||||
return;
|
||||
}
|
||||
let newRow = { deviceDefinitionName: row.name, deviceDefinitionId
|
||||
: row.id };
|
||||
materialsList.value.push(newRow);
|
||||
}
|
||||
|
||||
function addSamplesRow(row) {
|
||||
if (isDuplicate(row.id, sampleList.value,'samples')) {
|
||||
ElMessage.warning("请勿重复添加此样本!");
|
||||
return;
|
||||
}
|
||||
let newRow = { specimenName: row.specimenName, specimenDefinitionId: row.id };
|
||||
sampleList.value.push(newRow);
|
||||
}
|
||||
function addObservationsRow(row) {
|
||||
if (isDuplicate(row.id, observationList.value,'observations')) {
|
||||
ElMessage.warning("请勿重复添加此观察项!");
|
||||
return;
|
||||
}
|
||||
let newRow = { observationName: row.name, observationDefinitionId: row.id };
|
||||
observationList.value.push(newRow);
|
||||
}
|
||||
|
||||
function handleBlur(e) {
|
||||
switch (e) {
|
||||
case 'materials':
|
||||
deviceShowPopover.value = false;
|
||||
break;
|
||||
case 'samples':
|
||||
speShowPopover.value = false;
|
||||
break;
|
||||
case 'observations':
|
||||
obserShowPopover.value = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
function handleSearch(e) {
|
||||
switch (e) {
|
||||
case 'materials':
|
||||
query.value.searchKey = query.value.deviceSearchKey;
|
||||
query.value.type = 'device';
|
||||
getInfoLists(query);
|
||||
break;
|
||||
case 'samples':
|
||||
speShowPopover.value = false;
|
||||
break;
|
||||
case 'observations':
|
||||
obserShowPopover.value = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function handleFocus(e) {
|
||||
switch (e) {
|
||||
case 'materials':
|
||||
deviceShowPopover.value = true;
|
||||
break;
|
||||
case 'samples':
|
||||
speShowPopover.value = true;
|
||||
break;
|
||||
case 'observations':
|
||||
obserShowPopover.value = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 删除数据
|
||||
function deleteMaterial(row) {
|
||||
const index = materialsList.value.indexOf(row);
|
||||
if (index > -1) {
|
||||
materialsList.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
function deleteSample(row) {
|
||||
const index = sampleList.value.indexOf(row);
|
||||
if (index > -1) {
|
||||
sampleList.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function deleteObservation(row) {
|
||||
const index = observationList.value.indexOf(row);
|
||||
if (index > -1) {
|
||||
observationList.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
getItemPageList();
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.error-border {
|
||||
border: 1px solid red;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,66 @@
|
||||
import request from '@/utils/request.js'
|
||||
|
||||
// 查询器材目录列表
|
||||
export function getObservationList(query) {
|
||||
return request({
|
||||
url: '/inspection/observation/information-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询器材目录详细
|
||||
export function getObservationOne(id) {
|
||||
return request({
|
||||
url: '/inspection/observation/information-one',
|
||||
method: 'get',
|
||||
params: { id } // 确保参数正确传递
|
||||
})
|
||||
}
|
||||
|
||||
// 新增器材目录
|
||||
export function addObservation(data) {
|
||||
return request({
|
||||
url: '/inspection/observation/information',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改器材目录
|
||||
export function editObservation(data) {
|
||||
return request({
|
||||
url: '/inspection/observation/information',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// // 删除器材目录
|
||||
// export function delUser(userId) {
|
||||
// return request({
|
||||
// url: '/system/user/' + userId,
|
||||
// method: 'delete'
|
||||
// })
|
||||
// }
|
||||
|
||||
// 器材目录分类查询
|
||||
export function getObservationInit() {
|
||||
return request({
|
||||
url: '/inspection/observation/init',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function editObservationStatus(ids,type) {
|
||||
return request({
|
||||
url: '/inspection/observation/information-status',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids: ids,
|
||||
type: type
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 添加或修改用户配置对话框 -->
|
||||
<el-dialog :title="title" v-model="visible" width="955px" append-to-body>
|
||||
<el-form
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
ref="observationDialogRef"
|
||||
label-width="110px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="观测类型" prop="observationTypeEnum">
|
||||
<el-tree-select
|
||||
v-model="form.observationTypeEnum"
|
||||
:data="observationTypeEnum"
|
||||
:props="{ value: 'value', label: 'info', children: 'children' }"
|
||||
:disabled="false"
|
||||
value-key="value"
|
||||
placeholder="请选择观测类型"
|
||||
check-strictly
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="观测名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入观测名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="观测代码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入观测代码" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参考范围" prop="referenceRange">
|
||||
<el-input v-model="form.referenceRange" placeholder="请输入参考范围" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仪器信息" prop="instrumentId">
|
||||
<el-select
|
||||
v-model="form.instrumentId"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in instrumentIdOption"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="状态" prop="statusEnum">
|
||||
<el-select
|
||||
v-model="form.statusEnum"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in statusFlagOptions"
|
||||
:key="dict.value"
|
||||
:label="dict.info"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item >
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer v-if="title != '查看'">
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ObservationDialog">
|
||||
import { editObservation, addObservation } from './observation.js';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const title = ref('');
|
||||
const visible = ref(false);
|
||||
const emits = defineEmits(['submit']); // 声明自定义事件
|
||||
const observationTypeEnum = ref([]); // 仪器分类
|
||||
const statusFlagOptions = ref([]); // 状态标记
|
||||
const instrumentIdOption = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
rules: {
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
observationTypeEnum: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
statusFlagOptions: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
instrumentIdOption:{
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
});
|
||||
|
||||
// 显示弹框
|
||||
function show() {
|
||||
reset();
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
observationTypeEnum.value = props.observationTypeEnum;
|
||||
statusFlagOptions.value = props.statusFlagOptions;
|
||||
instrumentIdOption.value = props.instrumentIdOption;
|
||||
visible.value = true;
|
||||
|
||||
}
|
||||
|
||||
// 显示弹框
|
||||
function edit() {
|
||||
reset();
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
form.value = props.item;
|
||||
observationTypeEnum.value = props.observationTypeEnum;
|
||||
statusFlagOptions.value = props.statusFlagOptions;
|
||||
instrumentIdOption.value = props.instrumentIdOption;
|
||||
visible.value = true;
|
||||
}
|
||||
/** 重置操作表单 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
name : undefined,
|
||||
code : undefined,
|
||||
observationType: undefined,
|
||||
observationTypeEnum: undefined,
|
||||
referenceRange: undefined,
|
||||
instrumentId: undefined,
|
||||
statusEnum: 2, // 替换为 1
|
||||
|
||||
};
|
||||
proxy.resetForm('observationDialogRef');
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs['observationDialogRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(form.value, 'form.value');
|
||||
if (form.value.id != undefined) {
|
||||
editObservation(form.value).then((response) => {
|
||||
// 触发自定义事件,并传递数据给父组件
|
||||
emits('submit');
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
visible.value = false;
|
||||
reset(); // 重置表单数据
|
||||
});
|
||||
} else {
|
||||
addObservation(form.value).then((response) => {
|
||||
// 触发自定义事件,并传递数据给父组件
|
||||
emits('submit');
|
||||
proxy.$modal.msgSuccess('新增成功');
|
||||
visible.value = false;
|
||||
reset(); // 重置表单数据
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formatValue(str) {
|
||||
if (str === null || str === undefined || str === '' || str === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
visible.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
edit,
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
/* 使用深度选择器 */
|
||||
.custom-label-spacing :deep(.el-form-item__label) {
|
||||
line-height: 1.2; /* 调整行间距 */
|
||||
margin-bottom: 4px; /* 调整 label 和输入框之间的间距 */
|
||||
}
|
||||
</style>
|
||||
370
openhis-ui-vue3/src/views/inspection/observation/index.vue
Normal file
370
openhis-ui-vue3/src/views/inspection/observation/index.vue
Normal file
@@ -0,0 +1,370 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--器材目录-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-title">观测类型</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="observationType"
|
||||
:props="{ label: 'info', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="treeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--器材目录-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<!-- <el-col :span="6"> -->
|
||||
<el-form-item label="定义名" prop="searchKey" label-width="55">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="名称/编码"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="5"> -->
|
||||
<el-form-item label="状态" prop="statusEnum" label-width="50">
|
||||
<el-select v-model="queryParams.statusEnum" clearable>
|
||||
<el-option
|
||||
v-for="status in statusFlagOptions"
|
||||
:key="status.value"
|
||||
:label="status.info"
|
||||
:value="status.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="openAddObservation()"
|
||||
>添加</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Remove"
|
||||
:disabled="multiple"
|
||||
@click="handleClose"
|
||||
>停用</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="CirclePlus"
|
||||
:disabled="multiple"
|
||||
@click="handleStart"
|
||||
>启用</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Search"
|
||||
@click="getList"
|
||||
>查询</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出Excel</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="observationList"
|
||||
@selection-change="handleSelectionChange"
|
||||
width="90%"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
|
||||
<el-table-column
|
||||
label="观测名称"
|
||||
align="center"
|
||||
key="name"
|
||||
prop="name"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="观测代码"
|
||||
align="center"
|
||||
key="code"
|
||||
prop="code"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="观测类型"
|
||||
align="center"
|
||||
key="observationTypeEnumText"
|
||||
prop="observationTypeEnumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="参考范围"
|
||||
align="center"
|
||||
key="referenceRange"
|
||||
prop="referenceRange"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="仪器"
|
||||
align="center"
|
||||
key="instrumentId_dictText"
|
||||
prop="instrumentId_dictText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
key="statusEnumText"
|
||||
prop="statusEnumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150"
|
||||
class-name="small-padding fixed-width"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="openEditObservation(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<observation-dialog
|
||||
ref="observationRef"
|
||||
:title="title"
|
||||
:item="currentData"
|
||||
:observation-type-enum="observationTypeList"
|
||||
:statusFlagOptions="statusFlagOptions"
|
||||
:instrument-id-option="instrumentIdOption"
|
||||
@submit="getList()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="observation">
|
||||
import {
|
||||
getObservationList,
|
||||
getObservationOne, getObservationInit, editObservationStatus,
|
||||
} from "./components/observation.js";
|
||||
import observationDialog from "./components/observationDialog.vue";
|
||||
import { nextTick } from "vue";
|
||||
import {parseTime} from "../../../utils/his.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const observationList = ref([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]); // 存储选择的行数据
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const observationType = ref(undefined);
|
||||
const observationTypeList = ref(undefined);
|
||||
const statusFlagOptions = ref(undefined);
|
||||
const instrumentIdOption = ref(undefined);
|
||||
// 使用 ref 定义当前器材数据
|
||||
const currentData = ref({});
|
||||
// 使用 ref 定义当前查看器材数据
|
||||
const viewData = ref({});
|
||||
const currentCategoryEnum = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined, // 品名/商品名/英文品名/编码/拼音
|
||||
typeEnum: undefined, // 类型
|
||||
statusEnum: undefined, // 状态(
|
||||
},
|
||||
rules: {},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
/** 样本分类查询下拉树结构 */
|
||||
function getTreatmentList() {
|
||||
getObservationInit().then((response) => {
|
||||
console.log(response, "response器材目录分类查询下拉树结构");
|
||||
observationType.value = JSON.parse(JSON.stringify(response.data.observationTypeList)).sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
});
|
||||
observationType.value.push({ info: "全部", value: "" });
|
||||
observationTypeList.value = response.data.observationTypeList.sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
});
|
||||
statusFlagOptions.value = response.data.statusFlagOptions;
|
||||
instrumentIdOption.value = response.data.instrumentEnumOptionList;
|
||||
});
|
||||
}
|
||||
/** 查询器材目录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
getObservationList(queryParams.value).then((res) => {
|
||||
loading.value = false;
|
||||
observationList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
queryParams.value.observationTypeEnum = data.value;
|
||||
currentCategoryEnum.value = data.value;
|
||||
handleQuery();
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 启用按钮操作 */
|
||||
function handleStart() {
|
||||
const startIds = ids.value;
|
||||
// selectedData
|
||||
proxy.$modal
|
||||
.confirm("是否确定启用数据!")
|
||||
.then(function () {
|
||||
return editObservationStatus(startIds,'启用');
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("启用成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 停用按钮操作 */
|
||||
function handleClose() {
|
||||
const stopIds = ids.value;
|
||||
proxy.$modal
|
||||
.confirm("是否确认停用数据!")
|
||||
.then(function () {
|
||||
return editObservationStatus(stopIds,'停用');
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("停用成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
"system/user/export",
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`user_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, "selection");
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 打开新增弹窗 */
|
||||
function openAddObservation() {
|
||||
// if (!currentCategoryEnum.value) {
|
||||
// return proxy.$modal.msgError("请选择器材目录分类");
|
||||
// }
|
||||
title.value = "新增";
|
||||
nextTick(() => {
|
||||
proxy.$refs.observationRef.show();
|
||||
});
|
||||
}
|
||||
/** 打开编辑弹窗 */
|
||||
function openEditObservation(row) {
|
||||
currentData.value = {};
|
||||
console.log("打开编辑弹窗");
|
||||
getObservationOne(row.id).then((response) => {
|
||||
console.log(response, "currentDataform");
|
||||
currentData.value = response.data;
|
||||
title.value = "编辑";
|
||||
nextTick(() => {
|
||||
proxy.$refs["observationRef"].edit();
|
||||
});
|
||||
getList();
|
||||
});
|
||||
}
|
||||
getTreatmentList();
|
||||
getList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.el-select{
|
||||
width: 150px!important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,22 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询参数列表
|
||||
export function reportList(query) {
|
||||
return request({
|
||||
url: '/inspection/laboratory/information-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function reports (id) {
|
||||
return request({
|
||||
url: '/inspection/laboratory/reports/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
216
openhis-ui-vue3/src/views/inspection/report/index.vue
Normal file
216
openhis-ui-vue3/src/views/inspection/report/index.vue
Normal file
@@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="数据查询" prop="searchKey">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="患者姓名/项目名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px;">
|
||||
<el-date-picker
|
||||
v-model="authoredTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="Edit"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- >合管</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-if="refreshTable"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
row-key="chargeName"
|
||||
:default-expand-all="false"
|
||||
>
|
||||
<!-- 子表列 -->
|
||||
<el-table-column
|
||||
type="expand"
|
||||
width="50"
|
||||
fixed="left"
|
||||
>
|
||||
<template #default="props">
|
||||
<el-table
|
||||
:data="props.row.children"
|
||||
style="width: 100%"
|
||||
:show-header="true"
|
||||
ref="childTable"
|
||||
>
|
||||
<el-table-column
|
||||
prop="observationName"
|
||||
label="名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="observationResult"
|
||||
label="结果"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="specimenName"
|
||||
label="样本"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="referenceRange"
|
||||
label="参考范围"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="receivedDate"
|
||||
label="观测人"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="observationDate"
|
||||
label="观测时间"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 母表列 -->
|
||||
<el-table-column
|
||||
prop="chargeName"
|
||||
label="项目名称"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="patientName"
|
||||
label="患者姓名"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="genderEnumText"
|
||||
label="性别"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="doctorName"
|
||||
label="开单医生"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="authoredTime"
|
||||
label="开单时间"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="120"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="printReport(scope.row)"
|
||||
>
|
||||
打印报告
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Config">
|
||||
import {reportList, reports} from "./components/report.js";
|
||||
import {formatDateStr} from "@/utils/index.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const dataList = ref([]);
|
||||
const refreshTable = ref(true);
|
||||
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const authoredTime = ref([
|
||||
//默认三天前
|
||||
formatDateStr(new Date(new Date().setDate(new Date().getDate() - 3)), 'YYYY-MM-DD'),
|
||||
formatDateStr(new Date(), 'YYYY-MM-DD'),
|
||||
]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询参数列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.authoredTimeSTime = authoredTime.value[0] + ' 00:00:00';
|
||||
queryParams.value.authoredTimeETime = authoredTime.value[1] + ' 23:59:59';
|
||||
reportList(queryParams.value).then(response => {
|
||||
dataList.value = proxy.handleTree(response.data.records , "id");
|
||||
total.value = response.data.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
function printReport(row) {
|
||||
reports(row.id).then( response => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
getList();
|
||||
</script>
|
||||
@@ -0,0 +1,24 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询参数列表
|
||||
export function collectionList(query) {
|
||||
return request({
|
||||
url: '/inspection/collection/information-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 修改参数配置
|
||||
export function editStatus(ids,type) {
|
||||
return request({
|
||||
url: '/inspection/collection/information-status',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids: ids,
|
||||
type: type
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
268
openhis-ui-vue3/src/views/inspection/sampleCollection/index.vue
Normal file
268
openhis-ui-vue3/src/views/inspection/sampleCollection/index.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="数据查询" prop="searchKey">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="患者姓名/项目名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px;">
|
||||
<el-date-picker
|
||||
v-model="authoredTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
:disabled="collect"
|
||||
@click="handleCollect('已采集')"
|
||||
>采集</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>合管</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleCollect('待采集')"
|
||||
>取消</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>打印条码</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-if="refreshTable"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
row-key="chargeName"
|
||||
:default-expand-all="false"
|
||||
>
|
||||
<!-- 子表列 -->
|
||||
<el-table-column
|
||||
type="expand"
|
||||
width="50"
|
||||
fixed="left"
|
||||
>
|
||||
<template #default="props">
|
||||
<el-table
|
||||
:data="props.row.children"
|
||||
style="width: 100%"
|
||||
:show-header="true"
|
||||
@selection-change="handleSelectionChange($event, props.row)"
|
||||
ref="childTable"
|
||||
>
|
||||
<!-- 子表的多选框 -->
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
:selectable="selectable"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="specimenName"
|
||||
label="样本名称"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="specimenVolume"
|
||||
label="样本数量"
|
||||
>
|
||||
<template #default="innerProps">
|
||||
{{ innerProps.row.specimenVolume }} {{ innerProps.row.specimenUnit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="collectionStatusEnumText"
|
||||
label="采集状态"
|
||||
>
|
||||
<template #default="nerProp">
|
||||
<span v-if="nerProp.row.collectionStatusEnum == 1" style="color:green">
|
||||
已采集
|
||||
</span>
|
||||
<span v-else-if="nerProp.row.collectionStatusEnum == 0" style="color:orange">
|
||||
待采集
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="collectionDate"
|
||||
label="采集时间"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 母表列 -->
|
||||
<el-table-column
|
||||
prop="chargeName"
|
||||
label="项目名称"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="patientName"
|
||||
label="患者姓名"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="genderEnumText"
|
||||
label="性别"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="样本状态"
|
||||
>
|
||||
<template #default="sprops">
|
||||
<span v-if="hasPendingCollection(sprops.row.children)" style="color:orange">
|
||||
待采集
|
||||
</span>
|
||||
<span v-else style="color:green">
|
||||
已采集
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="doctorName"
|
||||
label="开单医生"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="authoredTime"
|
||||
label="开单时间"
|
||||
:sortable="true"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Config">
|
||||
import { collectionList,editStatus } from "./components/collect.js";
|
||||
import {formatDateStr} from "@/utils/index.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const dataList = ref([]);
|
||||
const refreshTable = ref(true);
|
||||
|
||||
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const collect = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const authoredTime = ref([
|
||||
//默认三天前
|
||||
formatDateStr(new Date(new Date().setDate(new Date().getDate() - 3)), 'YYYY-MM-DD'),
|
||||
formatDateStr(new Date(), 'YYYY-MM-DD'),
|
||||
]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询参数列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.authoredTimeSTime = authoredTime.value[0] + ' 00:00:00';
|
||||
queryParams.value.authoredTimeETime = authoredTime.value[1] + ' 23:59:59';
|
||||
collectionList(queryParams.value).then(response => {
|
||||
dataList.value = proxy.handleTree(response.data.records , "id");
|
||||
total.value = response.data.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
dateRange.value = [];
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
collect.value = selection.length <= 0;
|
||||
single.value = selection.length < 2;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 采集按钮操作 */
|
||||
function handleCollect(type) {
|
||||
|
||||
editStatus(ids.value,type).then(()=>{
|
||||
proxy.$modal.msgSuccess("操作成功");
|
||||
getList();
|
||||
})
|
||||
}
|
||||
|
||||
function hasPendingCollection(children) {
|
||||
return children.some(child => child.collectionStatusEnum === 0); // 如果有任意子项是待采集状态
|
||||
}
|
||||
function selectable(row) {
|
||||
// 判断 collectionStatusEnum 是否为 2,若为2,则禁用该行的勾选框
|
||||
return row.collectionStatusEnum !== 2;
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
@@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request.js'
|
||||
|
||||
|
||||
export function getSpecimenList(query) {
|
||||
return request({
|
||||
url: '/inspection/specimen/information-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getSpecimenOne(id) {
|
||||
return request({
|
||||
url: '/inspection/specimen/information-one',
|
||||
method: 'get',
|
||||
params: { id } // 确保参数正确传递
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function addSpecimen(data) {
|
||||
return request({
|
||||
url: '/inspection/specimen/information',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function editSpecimen(data) {
|
||||
return request({
|
||||
url: '/inspection/specimen/information',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 目录分类查询
|
||||
export function getSpecimenInit() {
|
||||
return request({
|
||||
url: '/inspection/specimen/init',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function editSpecimenStatus(ids,type) {
|
||||
return request({
|
||||
url: '/inspection/specimen/information-status',
|
||||
method: 'post',
|
||||
data: {
|
||||
ids: ids,
|
||||
type: type
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 查询部门树形数据
|
||||
export function deptTreeSelect(queryParams) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
// 查询地点树形数据
|
||||
export function locationTreeSelect(queryParams) {
|
||||
return request({
|
||||
url: '/base-data-manage/location/location-page-tree',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 添加或修改用户配置对话框 -->
|
||||
<el-dialog :title="title" v-model="visible" width="955px" append-to-body>
|
||||
<el-form
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
ref="specimenDialogRef"
|
||||
label-width="110px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="样本类型" prop="specimenTypeEnum">
|
||||
<el-tree-select
|
||||
v-model="form.specimenTypeEnum"
|
||||
:data="specimenTypeEnum"
|
||||
:props="{ value: 'value', label: 'info', children: 'children' }"
|
||||
:disabled="false"
|
||||
value-key="value"
|
||||
placeholder="请选择样本类型"
|
||||
check-strictly
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="样本名称" prop="specimenName">
|
||||
<el-input v-model="form.specimenName" placeholder="请输入样本名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第二行 -->
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="自定义码" prop="customCode">
|
||||
<el-input v-model="form.customCode" placeholder="请输入自定义码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="类型顺序" prop="typeOrder">
|
||||
<el-input v-model="form.typeOrder" placeholder="请输入类型顺序" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="外部代码" prop="externalCode">
|
||||
<el-input v-model="form.externalCode" placeholder="请输入外部代码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第三行 -->
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="序号" prop="serialNumber">
|
||||
<el-input v-model="form.serialNumber" placeholder="请输入序号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="全网型" prop="globalType">
|
||||
<el-input v-model="form.globalType" placeholder="请输入全网型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="拼音" prop="pyStr">
|
||||
<el-input v-model="form.pyStr" placeholder="请输入拼音" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第四行 -->
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="五笔" prop="wbStr">
|
||||
<el-input v-model="form.wbStr" placeholder="请输入五笔" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="样本类" prop="specimenClass">
|
||||
<el-input v-model="form.specimenClass" placeholder="请输入样本类" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="扩展类型" prop="extendedType">
|
||||
<el-input v-model="form.extendedType" placeholder="请输入扩展类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 第五行 -->
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="WHONET码" prop="whonetCode">
|
||||
<el-input v-model="form.whonetCode" placeholder="请输入WHONET代码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item label="状态" prop="statusEnum">-->
|
||||
<!-- <el-input v-model="form.statusEnum" placeholder="请输入状态" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<template #footer v-if="title != '查看'">
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SpecimenDialog">
|
||||
import { editSpecimen, addSpecimen, deptTreeSelect, locationTreeSelect } from './specimen.js';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const title = ref('');
|
||||
const visible = ref(false);
|
||||
const emits = defineEmits(['submit']); // 声明自定义事件
|
||||
const specimenTypeEnum = ref([]); // 样本分类
|
||||
const statusFlagOptions = ref([]); // 状态标记
|
||||
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
rules: {
|
||||
// specimenTypeEnum: [{ required: true, message: '请输入样本类型', trigger: 'blur' }],
|
||||
// specimenName: [{ required: true, message: '请输入样本名称', trigger: 'blur' }],
|
||||
// customCode: [{ required: true, message: '请输入自定义码', trigger: 'blur' }],
|
||||
// typeOrder: [{ required: true, message: '请输入类型顺序', trigger: 'blur' }],
|
||||
// externalCode: [{ required: true, message: '请输入外部代码', trigger: 'blur' }],
|
||||
// serialNumber: [{ required: true, message: '请输入序号', trigger: 'blur' }],
|
||||
// globalType: [{ required: true, message: '请输入全网型', trigger: 'blur' }],
|
||||
// pyStr: [{ required: true, message: '请输入拼音', trigger: 'blur' }],
|
||||
// wbStr: [{ required: true, message: '请输入五笔', trigger: 'blur' }],
|
||||
// specimenClass: [{ required: true, message: '请输入样本类', trigger: 'blur' }],
|
||||
// extendedType: [{ required: true, message: '请输入扩展类型', trigger: 'blur' }],
|
||||
// whonetCode: [{ required: true, message: '请输入WHONET代码', trigger: 'blur' }],
|
||||
// statusEnum: [{ required: true, message: '请输入状态', trigger: 'blur' }]
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
specimenTypeEnum: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
statusFlagOptions: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
// 显示弹框
|
||||
function show() {
|
||||
reset();
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
specimenTypeEnum.value = props.specimenTypeEnum;
|
||||
statusFlagOptions.value = props.statusFlagOptions;
|
||||
form.value.partPercent = 1;
|
||||
visible.value = true;
|
||||
}
|
||||
//医保目录对照后,赋值
|
||||
function setValue(row) {
|
||||
form.value = {
|
||||
name: formatValue(row.consumableName), //医疗服务项目名称
|
||||
// modelNumber: formatValue(row.productModel), // 产品型号
|
||||
modelNumber: formatValue(row.specification), // 规格
|
||||
manufacturerText: formatValue(row.manufacturerName), // 厂家名称
|
||||
partPercent: 1,
|
||||
};
|
||||
}
|
||||
|
||||
// 显示弹框
|
||||
function edit() {
|
||||
reset();
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
form.value = props.item;
|
||||
specimenTypeEnum.value = props.specimenTypeEnum;
|
||||
statusFlagOptions.value = props.statusFlagOptions;
|
||||
visible.value = true;
|
||||
}
|
||||
/** 重置操作表单 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
specimenTypeEnum: undefined,
|
||||
specimenName:undefined,
|
||||
customCode: undefined,
|
||||
typeOrder: undefined,
|
||||
externalCode: undefined,
|
||||
serialNumber:undefined,
|
||||
globalType: undefined,
|
||||
pyStr: undefined,
|
||||
wbStr: undefined,
|
||||
specimenClass: undefined,
|
||||
extendedType: undefined,
|
||||
whonetCode: undefined,
|
||||
statusEnum: undefined
|
||||
};
|
||||
proxy.resetForm('specimenDialogRef');
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs['specimenDialogRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(form.value, 'form.value');
|
||||
if (form.value.id != undefined) {
|
||||
editSpecimen(form.value).then((response) => {
|
||||
// 触发自定义事件,并传递数据给父组件
|
||||
emits('submit');
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
visible.value = false;
|
||||
reset(); // 重置表单数据
|
||||
});
|
||||
} else {
|
||||
addSpecimen(form.value).then((response) => {
|
||||
// 触发自定义事件,并传递数据给父组件
|
||||
emits('submit');
|
||||
proxy.$modal.msgSuccess('新增成功');
|
||||
visible.value = false;
|
||||
reset(); // 重置表单数据
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function formatValue(str) {
|
||||
if (str === null || str === undefined || str === '' || str === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
visible.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
edit,
|
||||
setValue,
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
/* 使用深度选择器 */
|
||||
.custom-label-spacing :deep(.el-form-item__label) {
|
||||
line-height: 1.2; /* 调整行间距 */
|
||||
margin-bottom: 4px; /* 调整 label 和输入框之间的间距 */
|
||||
}
|
||||
</style>
|
||||
414
openhis-ui-vue3/src/views/inspection/sampleType/index.vue
Normal file
414
openhis-ui-vue3/src/views/inspection/sampleType/index.vue
Normal file
@@ -0,0 +1,414 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--器材目录-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-title">样本类型目录</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="specimenType"
|
||||
:props="{ label: 'info', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="treeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<!--器材目录-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<!-- <el-col :span="6"> -->
|
||||
<el-form-item label="样本名" prop="searchKey" label-width="55">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="品名/商品名/英文品名/编码/拼音"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- </el-col> -->
|
||||
<!-- <el-col :span="5"> -->
|
||||
<el-form-item label="状态" prop="statusEnum" label-width="50">
|
||||
<el-select v-model="queryParams.statusEnum" clearable>
|
||||
<el-option
|
||||
v-for="status in statusFlagOptions"
|
||||
:key="status.value"
|
||||
:label="status.info"
|
||||
:value="status.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="openAddSpecimen()"
|
||||
>添加新样本</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Remove"
|
||||
:disabled="multiple"
|
||||
@click="handleClose"
|
||||
>停用</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="CirclePlus"
|
||||
:disabled="multiple"
|
||||
@click="handleStart"
|
||||
>启用</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Search"
|
||||
@click="getList"
|
||||
>查询</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出Excel</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="specimenList"
|
||||
@selection-change="handleSelectionChange"
|
||||
width="90%"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column
|
||||
label="样本类型"
|
||||
align="center"
|
||||
key="specimenTypeEnumText"
|
||||
prop="specimenTypeEnumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="样本名称"
|
||||
align="center"
|
||||
key="specimenName"
|
||||
prop="specimenName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="自定义码"
|
||||
align="center"
|
||||
key="customCode"
|
||||
prop="customCode"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="类型顺序"
|
||||
align="center"
|
||||
key="typeOrder"
|
||||
prop="typeOrder"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="外部代码"
|
||||
align="center"
|
||||
key="externalCode"
|
||||
prop="externalCode"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
key="serialNumber"
|
||||
prop="serialNumber"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="全网型"
|
||||
align="center"
|
||||
key="globalType"
|
||||
prop="globalType"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="拼音"
|
||||
align="center"
|
||||
key="pyStr"
|
||||
prop="pyStr"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="五笔"
|
||||
align="center"
|
||||
key="wbStr"
|
||||
prop="wbStr"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="样本类"
|
||||
align="center"
|
||||
key="specimenClass"
|
||||
prop="specimenClass"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="扩展类型"
|
||||
align="center"
|
||||
key="extendedType"
|
||||
prop="extendedType"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="WHONET代码"
|
||||
align="center"
|
||||
key="whonetCode"
|
||||
prop="whonetCode"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
key="statusEnumText"
|
||||
prop="statusEnumText"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="150"
|
||||
class-name="small-padding fixed-width"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="openEditSpecimen(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<specimen-dialog
|
||||
ref="specimenRef"
|
||||
:title="title"
|
||||
:item="currentData"
|
||||
:specimen-type-enum="specimenTypeList"
|
||||
:statusFlagOptions="statusFlagOptions"
|
||||
@submit="getList()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="specimen">
|
||||
import {
|
||||
getSpecimenList,
|
||||
getSpecimenOne, getSpecimenInit, editSpecimenStatus,
|
||||
} from "./components/specimen.js";
|
||||
import specimenDialog from "./components/specimenDialog.vue";
|
||||
import { nextTick } from "vue";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const specimenList = ref([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]); // 存储选择的行数据
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const specimenType = ref(undefined);
|
||||
const specimenTypeList = ref(undefined);
|
||||
const statusFlagOptions = ref(undefined);
|
||||
const statusYBWeatherOptions = ref(undefined);
|
||||
const supplierListOptions = ref(undefined);
|
||||
// 使用 ref 定义当前器材数据
|
||||
const currentData = ref({});
|
||||
// 使用 ref 定义当前查看器材数据
|
||||
const viewData = ref({});
|
||||
const currentCategoryEnum = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined, // 品名/商品名/英文品名/编码/拼音
|
||||
typeEnum: undefined, // 类型(包括 1:中药,2:成药)
|
||||
statusEnum: undefined, // 状态(包括 1:预置,2:启用,3:停用)
|
||||
specimenTypeEnum : undefined,
|
||||
},
|
||||
rules: {},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
/** 样本分类查询下拉树结构 */
|
||||
function getTreatmentList() {
|
||||
getSpecimenInit().then((response) => {
|
||||
console.log(response, "response器材目录分类查询下拉树结构");
|
||||
specimenType.value = JSON.parse(JSON.stringify(response.data.specimenTypeList)).sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
});
|
||||
specimenType.value.push({ info: "全部", value: "" });
|
||||
specimenTypeList.value = response.data.specimenTypeList.sort((a, b) => {
|
||||
return parseInt(a.value) - parseInt(b.value);
|
||||
});
|
||||
statusFlagOptions.value = response.data.statusFlagOptions;
|
||||
statusYBWeatherOptions.value = response.data.statusYBWeatherOptions;
|
||||
|
||||
});
|
||||
}
|
||||
/** 查询器材目录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
getSpecimenList(queryParams.value).then((res) => {
|
||||
loading.value = false;
|
||||
specimenList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
queryParams.value.specimenTypeEnum= data.value;
|
||||
currentCategoryEnum.value = data.value;
|
||||
handleQuery();
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 启用按钮操作 */
|
||||
function handleStart() {
|
||||
const startIds = ids.value;
|
||||
// selectedData
|
||||
proxy.$modal
|
||||
.confirm("是否确定启用数据!")
|
||||
.then(function () {
|
||||
return editSpecimenStatus(startIds,'启用');
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("启用成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 停用按钮操作 */
|
||||
function handleClose() {
|
||||
const stopIds = ids.value;
|
||||
proxy.$modal
|
||||
.confirm("是否确认停用数据!")
|
||||
.then(function () {
|
||||
return editSpecimenStatus(stopIds,'停用');
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("停用成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
"system/user/export",
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`user_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, "selection");
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 打开新增弹窗 */
|
||||
function openAddSpecimen() {
|
||||
// if (!currentCategoryEnum.value) {
|
||||
// return proxy.$modal.msgError("请选择器材目录分类");
|
||||
// }
|
||||
title.value = "新增";
|
||||
nextTick(() => {
|
||||
proxy.$refs.specimenRef.show();
|
||||
});
|
||||
}
|
||||
/** 打开编辑弹窗 */
|
||||
function openEditSpecimen(row) {
|
||||
currentData.value = {};
|
||||
console.log("打开编辑弹窗");
|
||||
getSpecimenOne(row.id).then((response) => {
|
||||
console.log(response, "currentDataform");
|
||||
currentData.value = response.data;
|
||||
title.value = "编辑";
|
||||
nextTick(() => {
|
||||
proxy.$refs["specimenRef"].edit();
|
||||
});
|
||||
getList();
|
||||
});
|
||||
}
|
||||
getTreatmentList();
|
||||
getList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-form--inline .el-form-item {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
.el-select{
|
||||
width: 150px!important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user