@@ -1,82 +0,0 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
@@ -1,402 +0,0 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user