检验项目界面功能修改

This commit is contained in:
jiangs 2025-12-05 17:44:21 +08:00
parent 846442e93a
commit c983532bc7
12 changed files with 877 additions and 635 deletions

View File

@ -29,6 +29,7 @@
"js-cookie": "3.0.5", "js-cookie": "3.0.5",
"jsbarcode": "^3.12.1", "jsbarcode": "^3.12.1",
"jsencrypt": "3.3.2", "jsencrypt": "3.3.2",
"lodash": "^4.17.21",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"pinia": "2.1.7", "pinia": "2.1.7",
@ -50,6 +51,7 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.27.0", "@eslint/js": "^9.27.0",
"@types/lodash": "^4.17.21",
"@types/vue": "^2.0.0", "@types/vue": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^8.46.2", "@typescript-eslint/eslint-plugin": "^8.46.2",
"@typescript-eslint/parser": "^8.46.2", "@typescript-eslint/parser": "^8.46.2",

24
pnpm-lock.yaml generated
View File

@ -56,6 +56,9 @@ importers:
jsencrypt: jsencrypt:
specifier: 3.3.2 specifier: 3.3.2
version: 3.3.2 version: 3.3.2
lodash:
specifier: ^4.17.21
version: 4.17.21
mitt: mitt:
specifier: ^3.0.1 specifier: ^3.0.1
version: 3.0.1 version: 3.0.1
@ -77,6 +80,9 @@ importers:
sortablejs: sortablejs:
specifier: ^1.14.0 specifier: ^1.14.0
version: 1.14.0 version: 1.14.0
three:
specifier: ^0.181.2
version: 0.181.2
vue: vue:
specifier: 3.5.23 specifier: 3.5.23
version: 3.5.23(typescript@5.9.3) version: 3.5.23(typescript@5.9.3)
@ -111,6 +117,9 @@ importers:
'@eslint/js': '@eslint/js':
specifier: ^9.27.0 specifier: ^9.27.0
version: 9.27.0 version: 9.27.0
'@types/lodash':
specifier: ^4.17.21
version: 4.17.21
'@types/vue': '@types/vue':
specifier: ^2.0.0 specifier: ^2.0.0
version: 2.0.0(typescript@5.9.3) version: 2.0.0(typescript@5.9.3)
@ -599,8 +608,8 @@ packages:
'@types/lodash-es@4.17.12': '@types/lodash-es@4.17.12':
resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==}
'@types/lodash@4.17.20': '@types/lodash@4.17.21':
resolution: {integrity: sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==} resolution: {integrity: sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ==}
'@types/minimatch@3.0.5': '@types/minimatch@3.0.5':
resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==}
@ -2503,6 +2512,9 @@ packages:
text-segmentation@1.0.3: text-segmentation@1.0.3:
resolution: {integrity: sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==} resolution: {integrity: sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==}
three@0.181.2:
resolution: {integrity: sha512-k/CjiZ80bYss6Qs7/ex1TBlPD11whT9oKfT8oTGiHa34W4JRd1NiH/Tr1DbHWQ2/vMUypxksLnF2CfmlmM5XFQ==}
tiny-emitter@2.1.0: tiny-emitter@2.1.0:
resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==}
@ -3113,9 +3125,9 @@ snapshots:
'@types/lodash-es@4.17.12': '@types/lodash-es@4.17.12':
dependencies: dependencies:
'@types/lodash': 4.17.20 '@types/lodash': 4.17.21
'@types/lodash@4.17.20': {} '@types/lodash@4.17.21': {}
'@types/minimatch@3.0.5': {} '@types/minimatch@3.0.5': {}
@ -3817,7 +3829,7 @@ snapshots:
'@element-plus/icons-vue': 2.3.2(vue@3.5.23(typescript@5.9.3)) '@element-plus/icons-vue': 2.3.2(vue@3.5.23(typescript@5.9.3))
'@floating-ui/dom': 1.6.13 '@floating-ui/dom': 1.6.13
'@popperjs/core': '@sxzz/popperjs-es@2.11.7' '@popperjs/core': '@sxzz/popperjs-es@2.11.7'
'@types/lodash': 4.17.20 '@types/lodash': 4.17.21
'@types/lodash-es': 4.17.12 '@types/lodash-es': 4.17.12
'@vueuse/core': 9.13.0(vue@3.5.23(typescript@5.9.3)) '@vueuse/core': 9.13.0(vue@3.5.23(typescript@5.9.3))
async-validator: 4.2.5 async-validator: 4.2.5
@ -5355,6 +5367,8 @@ snapshots:
dependencies: dependencies:
utrie: 1.0.2 utrie: 1.0.2
three@0.181.2: {}
tiny-emitter@2.1.0: {} tiny-emitter@2.1.0: {}
to-object-path@0.3.0: to-object-path@0.3.0:

View File

@ -104,3 +104,13 @@ export function deleteXmInfoVs(query:any){
params: query params: query
}) })
} }
//删除检验项目
export function deleteXmInfoService(query:any){
return request({
url: '/xminfo/del',
method: 'delete',
params: query
})
}

View File

@ -28,6 +28,10 @@ export const getDictData = async (...args: string[]) => {
if(dictRefs.LF != undefined) dictData.value.LF = toRaw(dictRefs.LF.value) || [] if(dictRefs.LF != undefined) dictData.value.LF = toRaw(dictRefs.LF.value) || []
if(dictRefs.BT != undefined) dictData.value.BT = toRaw(dictRefs.BT.value) || [] if(dictRefs.BT != undefined) dictData.value.BT = toRaw(dictRefs.BT.value) || []
if(dictRefs.SLZQ != undefined) dictData.value.SLZQ = toRaw(dictRefs.SLZQ.value) || [] if(dictRefs.SLZQ != undefined) dictData.value.SLZQ = toRaw(dictRefs.SLZQ.value) || []
if(dictRefs.UT != undefined) dictData.value.UT = toRaw(dictRefs.UT.value) || [] //单位
if(dictRefs.MD != undefined) dictData.value.MD = toRaw(dictRefs.MD.value) || [] //测试方法
if(dictRefs.ITEMCLASS != undefined) dictData.value.ITEMCLASS = toRaw(dictRefs.ITEMCLASS.value) || [] //细菌项目类别
if(dictRefs.GBDM != undefined) dictData.value.GBDM = toRaw(dictRefs.GBDM.value) || [] //国标代码
} }
//字典数据格式化方法 //字典数据格式化方法

View File

@ -19,6 +19,10 @@ export interface DictData {
LF?: Array<any>; LF?: Array<any>;
BT?: Array<any>; BT?: Array<any>;
SLZQ?: Array<any>; SLZQ?: Array<any>;
UT?: Array<any>;
MD?: Array<any>;
ITEMCLASS?: Array<any>;
GBDM?: Array<any>;
[key: string]: any[] | undefined; // 添加索引签名以支持动态访问 [key: string]: any[] | undefined; // 添加索引签名以支持动态访问
} }

View File

@ -0,0 +1,130 @@
<template>
<!-- 批量仪器对应 -->
<el-dialog title="批量项目对应" width="1000px" v-model="batchInstrVsModel.visible" @close="onClose">
<el-form :model="formData" inline>
<el-form-item label="项目类别" prop="xmgl">
<!-- <el-input placeholder="项目类别" v-model="formData.xmgl"></el-input> -->
<SelectTable v-model:data="formData.xmgl" :fields="xmglFields" :tableData="dictData.XMGL" label="label"
value="value" objKey="value" width="140px" placeholder="项目类别" />
</el-form-item>
<el-form-item label="快速查找" prop="inputcode">
<el-input placeholder="快速查找" v-model="formData.inputcode"></el-input>
</el-form-item>
<el-form-item label="细菌标志" prop="itemclass">
<SelectTable v-model:data="formData.xmgl" :fields="xmglFields" :tableData="dictData.ITEMCLASS" label="label"
value="value" objKey="value" width="140px" placeholder="细菌标志" />
</el-form-item>
<el-form-item label="仪器大类" prop="yqdl">
<SelectTable v-model:data="formData.xmgl" :fields="xmglFields" :tableData="dictData.YQDL" label="label"
value="value" objKey="value" width="140px" placeholder="仪器大类" />
</el-form-item>
<el-form-item label="仪器" prop="yq">
<YQSelectTable v-model:data="formData.yq" width="200px" placeholder="请输入仪器名称" />
</el-form-item>
<el-form-item>
<el-checkbox v-model="formData.wsw" label="隐藏微生物"></el-checkbox>
</el-form-item>
</el-form>
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowClick">
</CustomTable>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleCancel">取 消</el-button>
<el-button type="primary" @click="handleOk">确 定</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { getDictData, dictData } from '@/hooks';
import SelectTable from '@/components/SelectTable/index.vue'
import CustomTable from '@/components/elTable/index.vue'
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
const formData = ref({
xmgl: '',
inputcode: '',
itemclass: '',
yqdl: '',
wsw: false,
yq: ''
})
const tableData = ref()
const batchInstrVsModel = defineModel<any>()
const xmglFields = ref([
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', enablePinyinSearch: true },
])
const columns = ref([
{ prop: 'xmgl', label: '项目类别', visible: true, align: 'center', width: 50 },
{ prop: 'xmdh', label: '英文缩写', visible: true, align: 'center', width: 100 },
{ prop: 'xmmc', label: '名称', visible: true, align: 'center', width: 200 },
{ prop: 'dyckz', label: '参考值', visible: true, align: 'center', width: 100 },
{ prop: 'dw', label: '单位', visible: true, align: 'center', width: 100 },
{ prop: 'xmlb', label: '结果类型', visible: true, align: 'center', width: 100 },
{ prop: 'jsxm', label: '计算项目', visible: true, align: 'center', width: 100 },
{ prop: 'dyxh', label: '序号', visible: true, align: 'center', width: 100 },
{ prop: 'xs', label: '调整系数', visible: true, align: 'center', width: 50 },
{ prop: 'xsws', label: '小数位数', visible: true, align: 'center', width: 50 },
{ prop: 'xsbs', label: '稀释倍数', visible: true, align: 'center', width: 50 },
{ prop: 'uflag', label: '停用', visible: true, align: 'center', width: 50 },
{ prop: 'yqdl', label: '仪器大类', visible: true, align: 'center', width: 100 },
{ prop: 'xmid', label: '项目ID', visible: true, align: 'center', width: 100 },
{ prop: 'knowledge', label: '项目编码', visible: true, align: 'center', width: 100 },
{ prop: 'val1', label: '外部代码1', visible: true, align: 'center', width: 100 },
{ prop: 'val2', label: '外部代码2', visible: true, align: 'center', width: 100 },
{ prop: 'val3', label: '外部代码3', visible: true, align: 'center', width: 100 },
{ prop: 'yymc', label: '英文名称', visible: true, align: 'center', width: 100 },
{ prop: 'qccv', label: '允许CA(%)', visible: true, align: 'center', width: 100 },
]);
const tableConfig = ref({
border: true, // 边框
height: '60vh', // 高度
highlightCurrentRow: true, // 高亮当前行
// cellStyle: cellStyleHd
})
//退拽属性
const handleColumnDragEnd = (data: any) => {
// 更新列配置
columns.value = data.columns;
}
const rowClick = () => {
}
const onClose = () => {
batchInstrVsModel.value.visible = false;
}
//刷新数据
const getList = () => {
}
//取消
const handleCancel = () => {
}
//确定
const handleOk = () => {
}
onMounted(async () => {
await getDictData('XMGL', 'ITEMCLASS', 'YQDL', 'YQ');
})
</script>
<style scoped lang="scss"></style>

View File

@ -5,27 +5,26 @@
<!-- 表单区域--> <!-- 表单区域-->
<el-form inline :model="queryParams" class="mb8" size="small"> <el-form inline :model="queryParams" class="mb8" size="small">
<el-form-item label="项目类别"> <el-form-item label="项目类别">
<SelectTable v-model:data="queryParams.xmgl" :fields="xmglFields" :tableData="dictData.XMGL" label="label" value="value" objKey="value" width="140px" placeholder="项目类别" <SelectTable v-model:data="queryParams.xmgl" :fields="xmglFields" :tableData="dictData.XMGL" label="label"
size="small" value="value" objKey="value" width="140px" placeholder="项目类别" size="small" @getDataValue="getList" />
@getDataValue="getList"/>
</el-form-item> </el-form-item>
<el-form-item label="细菌标志"> <el-form-item label="细菌标志">
<SelectTable v-model:data="queryParams.itemclass" :fields="itemclassFields" :tableData="dictData.ITEMCLASS" label="label" value="value" objKey="value" width="140px" placeholder="细菌标志" <SelectTable v-model:data="queryParams.itemclass" :fields="itemclassFields" :tableData="dictData.ITEMCLASS"
size="small" label="label" value="value" objKey="value" width="140px" placeholder="细菌标志" size="small"
@getDataValue="getList" /> @getDataValue="getList" />
</el-form-item> </el-form-item>
<el-form-item label="仪器代号"> <el-form-item label="仪器代号">
<SelectTable v-model:data="queryParams.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc" value="yq" objKey="yq" :border="true" width="140px" placeholder="请选择仪器" <SelectTable v-model:data="queryParams.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc"
size="small" value="yq" objKey="yq" :border="true" width="140px" placeholder="请选择仪器" size="small"
@getDataValue="getList" /> @getDataValue="getList" />
</el-form-item> </el-form-item>
<el-form-item label="快速查找"> <el-form-item label="快速查找">
<el-input clearable placeholder="快速查找" v-model="queryParams.inputcode" prefix-icon="Search" style="width: 150px" <el-input clearable placeholder="快速查找" v-model="queryParams.inputcode" prefix-icon="Search"
@change="getList"/> style="width: 150px" @change="getList" />
</el-form-item> </el-form-item>
<el-form-item label="仪器大类"> <el-form-item label="仪器大类">
<SelectTable v-model:data="queryParams.yqdl" :fields="yqdlFields" :tableData="dictData.YQDL" label="label" value="value" objKey="value" :border="true" width="140px" placeholder="仪器大类" <SelectTable v-model:data="queryParams.yqdl" :fields="yqdlFields" :tableData="dictData.YQDL" label="label"
size="small" value="value" objKey="value" :border="true" width="140px" placeholder="仪器大类" size="small"
@getDataValue="getList" /> @getDataValue="getList" />
</el-form-item> </el-form-item>
<el-form-item label="项目ID"> <el-form-item label="项目ID">
@ -45,15 +44,17 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleRefresh">刷新</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
<el-button type="primary" plain icon="Plus" @click="handleDel">删除</el-button> <el-button type="primary" plain icon="Plus" @click="handleDel">删除</el-button>
<el-button type="primary" plain icon="Plus" @click="handleDelCorr">删除对应</el-button> <el-button type="primary" plain icon="Plus" @click="handleBatchVs">批量项目对应</el-button>
<el-button type="primary" plain icon="Plus" @click="handleBatchDel">批量删除对应</el-button>
<el-button type="primary" plain icon="Plus" @click="handleSave">保存</el-button> <el-button type="primary" plain icon="Plus" @click="handleSave">保存</el-button>
</el-col> </el-col>
</el-row> </el-row>
<!-- 表格区域--> <!-- 表格区域-->
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd" <CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true"
:config="tableConfig" @row-click="rowChange"> @column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowChange">
<template #xmgl="{ row }"> <template #xmgl="{ row }">
{{ formatDict(row.xmgl, 'XMGL') }} {{ formatDict(row.xmgl, 'XMGL') }}
</template> </template>
@ -75,8 +76,10 @@
<el-col :span="10" :xs="24"> <el-col :span="10" :xs="24">
<tabView :tabList="tabList" v-model:activeTab="activeTab" @update:active-tab="updateActive" /> <tabView :tabList="tabList" v-model:activeTab="activeTab" @update:active-tab="updateActive" />
<KeepAlive> <KeepAlive>
<component class="tabDiv" ref="tableTabRef" :is="activeTabN" :dataList="tabDataList" :formData="selectRow" v-model="modelParam" @refreshTabData="rowChange"></component> <component class="tabDiv" ref="tableTabRef" :is="activeTabN" :formData="selectRow" v-model="modelParam"
@refreshTabData="rowChange"></component>
</KeepAlive> </KeepAlive>
<BatchInstrVs v-show="batchInstrVsModel.visible" v-model="batchInstrVsModel" />
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -94,14 +97,15 @@ import Sort from './tab/Sort.vue'
import Parameter from './tab/Parameter.vue'; import Parameter from './tab/Parameter.vue';
import ChannelNumber from './tab/ChannelNumber.vue'; import ChannelNumber from './tab/ChannelNumber.vue';
import ReferenceValueDetails from './tab/ReferenceValueDetails.vue'; import ReferenceValueDetails from './tab/ReferenceValueDetails.vue';
import { queryXmInfoNewService,queryXmInfoNewDetailService,saveDataService} from '@/api/liswork/labItem/labItemApi'; import { queryXmInfoNewService, queryXmInfoNewDetailService, saveDataService, deleteXmInfoService } from '@/api/liswork/labItem/labItemApi';
import SelectTable from '@/components/SelectTable/index.vue' import SelectTable from '@/components/SelectTable/index.vue'
import { getGroupInstrdList } from '@/api/liswork/work/LisWork'; import { getGroupInstrdList } from '@/api/liswork/work/LisWork';
import tabView from '@/components/tabViews/index.vue'; import tabView from '@/components/tabViews/index.vue';
import { LabInstr, XmInfoNew } from '@/types'; import { LabInstr, XmInfoNew } from '@/types';
import { formatDict, getDictData, dictData } from '@/hooks'; import { formatDict, getDictData, dictData } from '@/hooks';
import { ElMessage } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import { datalink } from '../../../api/liswork/work/LisWork'; import BatchInstrVs from './BatchInstrVs.vue';
import _ from 'lodash';
const xmlbList = ref<Array<any>>([ const xmlbList = ref<Array<any>>([
{ label: '数值型', value: '1' }, { label: '数值型', value: '1' },
@ -196,13 +200,13 @@ const yqdlFields = ref([
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true }, { prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
]) ])
//tab页数据
const tabDataList = ref<any>([]);
//选中行数据 //选中行数据
const selectRow = ref(); const selectRow = ref();
//明细数据 //明细数据
const selectDetailRow = ref() const selectDetailRow = ref()
const tableTabRef = ref() const tableTabRef = ref()
//tab页数据
const modelParam = ref<any>({ const modelParam = ref<any>({
basicData: {}, basicData: {},
commonlyValuesData: [], commonlyValuesData: [],
@ -212,8 +216,29 @@ const modelParam = ref<any>({
}) })
const basic = ref<boolean>(false) const basic = ref<boolean>(false)
// 1. 定义变量跟踪是否有未保存的修改
const hasUnsavedChanges = ref(false);
// 保存初始数据快照用于比较
const initialModelParam = ref<any>(null);
const batchInstrVsModel = ref<any>({
visible: false
})
// 2. 深度监视modelParam的所有属性变化
watch(
modelParam,
(newVal, oldVal) => {
// 初始加载时不判断
if (initialModelParam.value) {
// 使用lodash的isEqual进行深度比较
hasUnsavedChanges.value = !_.isEqual(newVal, initialModelParam.value);
}
},
{ deep: true }
);
// 仪器 // 仪器
const getYqConfig = () => { const getYqConfig = () => {
getGroupInstrdList() getGroupInstrdList()
@ -233,50 +258,94 @@ const getList = () => {
dataList.value = res.data; dataList.value = res.data;
}) })
} }
onMounted(async () => {
getDictData('XMGL','ITEMCLASS', 'YQDL');
getList()
getYqConfig();
})
//新增 //新增
const handleAdd = () => { const handleAdd = () => {
console.log('新增') selectRow.value = '';
tableTabRef.value.changeDisabled(false);
modelParam.value = {
basicData: {
yq: '',
xmdh: '',
xmmc: '',
zhbdh: '',
bgdh: '',
cksx: null,
ckxx: null,
dyckz: '',
dylx: '1',
zjf: '',
xmlb: '',
xs: null,
xsws: '-1',
mrz: '',
jg: null,
cb: null,
dw: '',
jsxm: 'N',
jsgs: '',
zkxm: 'N',
sjx: null,
xjx: null,
ygxb: 'N',
ygnl: 'N',
ygbb: 'N',
lcyy: '',
jgbz: '',
uflag: '0',
xsbs: 1
},
commonlyValuesData: [],
userInstrData: [],
commonDescriptionsData: [],
referenceValueDetailsData: []
};
tableConfig.value.highlightCurrentRow = false
// 重置快照
initialModelParam.value = _.cloneDeep(modelParam.value);
hasUnsavedChanges.value = false;
} }
//删除 //删除
const handleDel = () => { const handleDel = async () => {
console.log('删除') if (selectRow.value) {
await ElMessageBox.confirm('是否删除选中的数据?', '提示',
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
);
await deleteXmInfoService({ xmid: selectRow.value.xmid });
ElMessage.success('删除成功!')
getList();
selectRow.value = null;
if (typeof tableTabRef.value.changeDisabled === 'function') {
tableTabRef.value.changeDisabled(true);
} }
//删除对应 }
const handleDelCorr = () => {
}
//批量对应
const handleBatchVs = () => {
batchInstrVsModel.value.visible = true;
}
//批量删除对应
const handleBatchDel = () => {
console.log('删除对应') console.log('删除对应')
} }
//保存 //保存
const handleSave = async () => { const handleSave = async (flag: any) => {
switch(activeTab.value){ //验证表单
case 'Basic': if (typeof tableTabRef.value.validate === 'function') {
basic.value = true const valid = await tableTabRef.value.validate(); // 调用子组件的验证方法
modelParam.value.basicData = tableTabRef.value.basicData; if (!valid) {
break; ElMessage.error('表单验证失败,请检查输入项!');
case 'CommonlyValues': return;
modelParam.value.commonlyValuesData = tableTabRef.value.commonlyValuesData;
break;
case 'UseInstr':
modelParam.value.userInstrData = tableTabRef.value.userInstrData;
break;
case 'CommonDescriptions':
modelParam.value.commonDescriptionsData = tableTabRef.value.commonDescriptionsData;
break;
case 'ReferenceValueDetails':
modelParam.value.referenceValueDetailsData = tableTabRef.value.referenceValueDetailsData;
break;
} }
}
await saveDataService({ await saveDataService({
xmInfoNew: modelParam.value.basicData, xmInfoNew: modelParam.value.basicData,
xmDoubleRows: [], xmDoubleRows: [],
@ -289,15 +358,26 @@ const handleSave = async () => {
xmInfoVsRows: modelParam.value.userInstrData, xmInfoVsRows: modelParam.value.userInstrData,
xmTextresultNewRows: modelParam.value.commonDescriptionsData xmTextresultNewRows: modelParam.value.commonDescriptionsData
}) })
if (!flag) {
rowChange(selectRow.value) rowChange(selectRow.value)
}
if (basic.value) { if (basic.value) {
await getList(); getList();
basic.value = false basic.value = false
} }
ElMessage.success('保存成功!') ElMessage.success('保存成功!')
// 保存后更新快照
initialModelParam.value = _.cloneDeep(modelParam.value);
hasUnsavedChanges.value = false;
} }
const handleRefresh = () => {
getList();
}
//退拽属性 //退拽属性
const handleColumnDragEnd = (data: any) => { const handleColumnDragEnd = (data: any) => {
// 更新列配置 // 更新列配置
@ -314,11 +394,43 @@ const changeStauts = () => {
// 选择行变化 // 选择行变化
const rowChange = async (row: any) => { const rowChange = async (row: any) => {
if (typeof tableTabRef.value.changeDisabled === 'function') {
tableTabRef.value.changeDisabled(false);
}
// 如果有未保存的修改,显示提示
if (hasUnsavedChanges.value) {
try {
await ElMessageBox.confirm(
'当前数据有未保存的修改,是否保存?',
'提示',
{
confirmButtonText: '保存',
cancelButtonText: '不保存',
type: 'warning'
}
);
// 用户选择保存
await handleSave("1");
} catch (error) {
// 用户选择不保存,继续执行
}
}
selectRow.value = row; selectRow.value = row;
const res = await queryXmInfoNewDetailService(row.xmid, row.yq, row.xmdh) const res = await queryXmInfoNewDetailService(row.xmid, row.yq, row.xmdh)
selectDetailRow.value = res.data selectDetailRow.value = res.data
console.log('选中行明细数据:', selectDetailRow.value) console.log('选中行明细数据:', selectDetailRow.value)
changeActiveTab() changeActiveTab()
initialModelParam.value = _.cloneDeep(modelParam.value);
hasUnsavedChanges.value = false;
//重置表单状态
if (typeof tableTabRef.value.resetField === 'function') {
tableTabRef.value.resetField();
}
} }
//tab变化 //tab变化
@ -328,6 +440,7 @@ const updateActive = () => {
const changeActiveTab = () => { const changeActiveTab = () => {
if (selectRow.value) {
modelParam.value.basicData = toRaw(selectDetailRow.value.xmInfoNew || {}); modelParam.value.basicData = toRaw(selectDetailRow.value.xmInfoNew || {});
modelParam.value.commonlyValuesData = toRaw(selectDetailRow.value.xmValNewRows || []); modelParam.value.commonlyValuesData = toRaw(selectDetailRow.value.xmValNewRows || []);
modelParam.value.userInstrData = toRaw(selectDetailRow.value.xmInfoVsRows || []); modelParam.value.userInstrData = toRaw(selectDetailRow.value.xmInfoVsRows || []);
@ -335,6 +448,15 @@ const changeActiveTab = () => {
modelParam.value.referenceValueDetailsData = toRaw(selectDetailRow.value.xmRefNewRows || []); modelParam.value.referenceValueDetailsData = toRaw(selectDetailRow.value.xmRefNewRows || []);
} }
}
onMounted(async () => {
getDictData('XMGL', 'ITEMCLASS', 'YQDL');
getList()
getYqConfig();
})
</script> </script>
<style lang="css"> <style lang="css">

View File

@ -5,19 +5,19 @@
<el-button type="primary" @click="bClickAdd">增加</el-button> <el-button type="primary" @click="bClickAdd">增加</el-button>
<el-button type="primary" @click="bClickDel">删除</el-button> <el-button type="primary" @click="bClickDel">删除</el-button>
</div> </div>
<CustomTable ref="tableRef" :data="tableList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd" <CustomTable ref="tableRef" :data="modelParam.commonlyValuesData" :columns="columns" :enable-column-drag="true"
:config="tableConfig" @row-click="handRowClick"> @column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="handRowClick">
<template #qz = {row}> <template #qz="{ row }">
<el-select v-model="row.qz" clearable allow-create filterable default-first-option> <el-select v-model="row.qz" clearable allow-create filterable default-first-option>
<el-option v-for="item in qzOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in qzOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</template> </template>
<template #jgbz = {row}> <template #jgbz="{ row }">
<el-select v-model="row.jgbz" clearable> <el-select v-model="row.jgbz" clearable>
<el-option v-for="item in jgbzOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in jgbzOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</template> </template>
<template #srm = {row}> <template #srm="{ row }">
<el-input v-model="row.srm" class="full-width-input"></el-input> <el-input v-model="row.srm" class="full-width-input"></el-input>
</template> </template>
</CustomTable> </CustomTable>
@ -30,18 +30,11 @@ import { dictData,getDictData } from '@/hooks';
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
import { delXmValNewService } from '@/api/liswork/labItem/labItemApi' import { delXmValNewService } from '@/api/liswork/labItem/labItemApi'
// const props = defineProps({
// formData: {
// type: Object,
// default: {}
// }
// });
const modelParam = defineModel<any>() const modelParam = defineModel<any>()
const emit = defineEmits(['refreshTabData']) const emit = defineEmits(['refreshTabData'])
const tableRef = ref<any>(); const tableRef = ref<any>();
const tableList = ref<any>();
const columns = ref([ const columns = ref([
{ prop: 'qz', label: '取值', visible: true, align: 'center', slot: 'qz', width: 200 }, { prop: 'qz', label: '取值', visible: true, align: 'center', slot: 'qz', width: 200 },
{ prop: 'srm', label: '快速输入码', visible: true, align: 'center', slot: 'srm', width: 100 }, { prop: 'srm', label: '快速输入码', visible: true, align: 'center', slot: 'srm', width: 100 },
@ -63,17 +56,9 @@ const handleColumnDragEnd = (data: any) => {
columns.value = data.columns; columns.value = data.columns;
} }
watch(
() => modelParam.value,
(newVal:any) => {
tableList.value = [...newVal.commonlyValuesData];
},
{ immediate: true, deep: true }
);
//序号最大值 //序号最大值
const maxXh = computed(() => { const maxXh = computed(() => {
return tableList.value.length > 0 ? Math.max(...tableList.value.map((item:any) => item.xh || 0)) : 0; return modelParam.value.commonlyValuesData.length > 0 ? Math.max(...modelParam.value.commonlyValuesData.value.map((item: any) => item.xh || 0)) : 0;
}); });
const bClickAdd = () => { const bClickAdd = () => {
@ -84,7 +69,7 @@ const bClickAdd = () => {
jgbz: '', jgbz: '',
xh: maxXh.value + 1 xh: maxXh.value + 1
} }
tableList.value.push(newData); modelParam.value.commonlyValuesData.push(newData);
} }
@ -111,15 +96,8 @@ onActivated(async ()=>{
await getDictData('VA', 'LF') await getDictData('VA', 'LF')
qzOptions.value = dictData.value.VA qzOptions.value = dictData.value.VA
jgbzOptions.value = dictData.value.LF jgbzOptions.value = dictData.value.LF
tableList.value = modelParam.value.commonlyValuesData || []
}) })
defineExpose({
commonlyValuesData: tableList
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

View File

@ -1,100 +1,106 @@
<template> <template>
<!-- 基本资料 --> <!-- 基本资料 -->
<div> <div>
<el-form ref="formRef" :model="formData" size="small" class="form-inline" inline label-width="80px"> <el-form ref="formRef" :model="modelParam.basicData" :rules="rules" size="small" class="form-inline" inline
label-width="70px" :disabled="disabled" label-position="right" inline-message>
<span class="text-span">基本参数:</span> <span class="text-span">基本参数:</span>
<el-divider style="margin: 5px 0;" /> <el-divider style="margin: 5px 0;" />
<el-form-item label="项目类别" prop="xmgl"> <el-form-item label="项目类别" prop="xmgl">
<SelectTable v-model:data="formData.xmgl" :fields="xmglFields" :tableData="dictData.XMGL" label="label" value="value" objKey="value" width="140px" placeholder="项目类别" <SelectTable v-model:data="modelParam.basicData.xmgl" :fields="xmglFields" :tableData="dictData.XMGL"
size="small" /> label="label" value="value" objKey="value" width="140px" placeholder="项目类别" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="英文缩写" prop="xmdh"> <el-form-item label="英文缩写" prop="xmdh">
<el-input placeholder="英文缩写" v-model="formData.xmdh"></el-input> <el-input placeholder="英文缩写" v-model="modelParam.basicData.xmdh" @input="xmdhInput"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="项目名称" prop="xmmc"> <el-form-item label="项目名称" prop="xmmc">
<el-input placeholder="项目名称" v-model="formData.xmmc"></el-input> <el-input placeholder="项目名称" v-model="modelParam.basicData.xmmc" @change="xmmcChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="单位" prop="dw"> <el-form-item label="单位" prop="dw">
<el-input placeholder="单位" v-model="formData.dw"></el-input> <SelectTable v-model:data="modelParam.basicData.dw" :fields="xmglFields" :tableData="dictData.UT" label="label"
value="label" objKey="label" width="140px" placeholder="单位" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="结果类别" prop="xmlb"> <el-form-item label="结果类别" prop="xmlb">
<el-input placeholder="结果类别" v-model="formData.xmlb"></el-input> <SelectTable v-model:data="modelParam.basicData.xmlb" :fields="xmglFields" :tableData="xmlbData" label="label"
value="value" objKey="value" width="140px" placeholder="结果类别" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="阴阳性" prop="mrz"> <el-form-item label="阴阳性" prop="mrz">
<el-input placeholder="阴阳性" v-model="formData.mrz"></el-input> <SelectTable v-model:data="modelParam.basicData.mrz" :fields="xmglFields" :tableData="mrzData" label="label"
value="value" objKey="value" width="140px" placeholder="阴阳性" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="仪器大类" prop="yqdl"> <el-form-item label="仪器大类" prop="yqdl">
<el-input placeholder="仪器大类" v-model="formData.yqdl"></el-input> <SelectTable v-model:data="modelParam.basicData.yqdl" :fields="xmglFields" :tableData="dictData.YQDL"
label="label" value="value" objKey="value" width="140px" placeholder="仪器大类" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="允许CV(%)" prop="qccv" label-width="100px"> <el-form-item label="允许CV(%)" prop="qccv" label-width="100px">
<el-input placeholder="允许CV(%)" v-model="formData.qccv"></el-input> <el-input placeholder="允许CV(%)" type="number" v-model="modelParam.basicData.qccv"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="稀释倍数" prop="xsbs"> <el-form-item label="稀释倍数" prop="xsbs">
<el-input placeholder="稀释倍数" v-model="formData.xsbs"></el-input> <el-input placeholder="稀释倍数" v-model="modelParam.basicData.xsbs"></el-input>
</el-form-item>
<el-form-item label="稀释倍数" prop="xsbs">
<el-input placeholder="稀释倍数" v-model="formData.xsbs"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="whonet编码" prop="whocode" label-width="100px"> <el-form-item label="whonet编码" prop="whocode" label-width="100px">
<el-input placeholder="whonet编码" v-model="formData.whocode"></el-input> <el-input placeholder="whonet编码" v-model="modelParam.basicData.whocode"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="Gram" prop="germflag"> <el-form-item label="Gram" prop="germflag">
<el-input placeholder="Gram" v-model="formData.germflag"></el-input> <el-input placeholder="Gram" v-model="modelParam.basicData.germflag"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="英文名称" prop="yymc"> <el-form-item label="英文名称" prop="yymc">
<el-input placeholder="英文名称" v-model="formData.yymc"></el-input> <el-input placeholder="英文名称" v-model="modelParam.basicData.yymc"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="项目ID" prop="xmid"> <el-form-item label="项目ID" prop="xmid">
<el-input placeholder="项目ID" disabled v-model="formData.xmid"></el-input> <el-input placeholder="项目ID" disabled v-model="modelParam.basicData.xmid"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="uflag"> <el-form-item prop="uflag">
<el-checkbox value="uflag">停用</el-checkbox> <el-checkbox value="uflag">停用</el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="知识库编码" prop="knowledge" label-width="100px"> <el-form-item label="知识库编码" prop="knowledge" label-width="100px">
<el-input placeholder="知识库编码" v-model="formData.knowledge"></el-input> <el-input placeholder="知识库编码" v-model="modelParam.basicData.knowledge"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="小数保留位数" prop="xsws" label-width="100px"> <el-form-item label="小数保留位数" prop="xsws" label-width="100px">
<el-input placeholder="小数保留位数" v-model="formData.xsws"></el-input> <SelectTable v-model:data="modelParam.basicData.xsws" :fields="xmglFields" :tableData="xswsData" label="label"
value="value" objKey="value" width="140px" placeholder="小数保留位数" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="打印形式" prop="dylx"> <el-form-item label="打印形式" prop="dylx">
<el-input placeholder="打印形式" v-model="formData.dylx"></el-input> <SelectTable v-model:data="modelParam.basicData.dylx" :fields="xmglFields" :tableData="dylxData" label="label"
value="value" objKey="value" width="140px" placeholder="打印形式" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="总汇表代号" prop="zhbdh" label-width="100px"> <el-form-item label="总汇表代号" prop="zhbdh" label-width="100px">
<el-input placeholder="总汇表代号" v-model="formData.zhbdh"></el-input> <el-input placeholder="总汇表代号" v-model="modelParam.basicData.zhbdh"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报告单代号" prop="bgdh" label-width="90px"> <el-form-item label="报告单代号" prop="bgdh" label-width="90px">
<el-input placeholder="报告单代号" v-model="formData.bgdh"></el-input> <el-input placeholder="报告单代号" v-model="modelParam.basicData.bgdh"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="价格" prop="jg"> <el-form-item label="价格" prop="jg">
<el-input placeholder="价格" v-model="formData.jg"></el-input> <el-input placeholder="价格" type="number" v-model="modelParam.basicData.jg"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="助记符" prop="zjf"> <el-form-item label="助记符" prop="zjf">
<el-input placeholder="助记符" v-model="formData.zjf"></el-input> <el-input placeholder="助记符" v-model="modelParam.basicData.zjf"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="测试方法" prop="csff"> <el-form-item label="测试方法" prop="csff">
<el-input placeholder="测试方法" v-model="formData.csff"></el-input> <SelectTable v-model:data="modelParam.basicData.csff" :fields="xmglFields" :tableData="dictData.MD"
label="label" value="value" objKey="value" width="140px" placeholder="测试方法" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="分组打印组号" prop="fzdyxh" label-width="100px"> <el-form-item label="分组打印组号" prop="fzdyxh" label-width="100px">
<el-input placeholder="分组打印组号" v-model="formData.fzdyxh"></el-input> <el-input placeholder="分组打印组号" type="number" v-model="modelParam.basicData.fzdyxh"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="细菌项目类别" prop="itemclass" label-width="100px"> <el-form-item label="细菌项目类别" prop="itemclass" label-width="100px">
<el-input placeholder="细菌项目类别" v-model="formData.itemclass"></el-input> <SelectTable v-model:data="modelParam.basicData.itemclass" :fields="xmglFields" :tableData="dictData.ITEMCLASS"
label="label" value="value" objKey="value" width="140px" placeholder="细菌项目类别" size="small" />
</el-form-item> </el-form-item>
<span class="text-span">结果参考值计算:</span> <span class="text-span">结果参考值计算:</span>
<el-divider style="margin: 5px 0;" /> <el-divider style="margin: 5px 0;" />
<el-form-item label="参考下限" prop="ckxx"> <el-form-item label="参考下限" prop="ckxx">
<el-input placeholder="参考下限" v-model="formData.ckxx"></el-input> <el-input placeholder="参考下限" v-model="modelParam.basicData.ckxx" @input="updatedyckz"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="参考上限" prop="cksx"> <el-form-item label="参考上限" prop="cksx">
<el-input placeholder="参考上限" v-model="formData.cksx"></el-input> <el-input placeholder="参考上限" v-model="modelParam.basicData.cksx" @input="updatedyckz"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="参考值" prop="dyckz" label-width="60px"> <el-form-item label="参考值" prop="dyckz" label-width="60px">
<el-input placeholder="参考值" v-model="formData.dyckz"></el-input> <el-input placeholder="参考值" v-model="modelParam.basicData.dyckz"></el-input>
<el-button type="primary" @click="multiRefClick">多行参考值向导...</el-button> <el-button type="primary" @click="multiRefClick">多行参考值向导...</el-button>
</el-form-item> </el-form-item>
<el-form-item label="公式" prop="jsgs" label-width="40px"> <el-form-item label="公式" prop="jsgs" label-width="40px">
<el-input placeholder="公式" v-model="formData.jsgs"></el-input> <el-input placeholder="公式" v-model="modelParam.basicData.jsgs"></el-input>
<el-button v-show="formData.jsxm === 'Y'" type="primary" @click="calcGuildeClick">向导...</el-button> <el-button v-show="modelParam.basicData.jsxm === 'Y'" type="primary" @click="calcGuildeClick">向导...</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-checkbox label="参考值与性别有关" v-model="ygxbCheck"></el-checkbox> <el-checkbox label="参考值与性别有关" v-model="ygxbCheck"></el-checkbox>
@ -107,52 +113,55 @@
<span class="text-span">医学审核条件:</span> <span class="text-span">医学审核条件:</span>
<el-divider style="margin: 5px 0;" /> <el-divider style="margin: 5px 0;" />
<el-form-item label="项目结果不可能大于" prop="sjx" label-width="140px"> <el-form-item label="项目结果不可能大于" prop="sjx" label-width="140px">
<el-input placeholder="项目结果不可能大于" v-model="formData.sjx" style="width: 100px;"></el-input> <el-input placeholder="项目结果不可能大于" v-model="modelParam.basicData.sjx" style="width: 100px;"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="不可能小于" prop="xjx" label-width="90px"> <el-form-item label="不可能小于" prop="xjx" label-width="90px">
<el-input placeholder="不可能小于" v-model="formData.xjx" style="width: 100px;"></el-input> <el-input placeholder="不可能小于" v-model="modelParam.basicData.xjx" style="width: 100px;"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="病人两次检验结果在" prop="jgjg" label-width="140px"> <el-form-item label="病人两次检验结果在" prop="jgjg" label-width="140px">
<el-input placeholder="病人两次检验结果在" v-model="formData.jgjg" style="width: 100px;"></el-input> <el-input placeholder="病人两次检验结果在" v-model="modelParam.basicData.jgjg" style="width: 100px;"></el-input>
</el-form-item> </el-form-item>
<!--计算属性--> <!--计算属性-->
<el-form-item label="天内不可能相差" prop="cp_jgz" label-width="120px"> <el-form-item label="天内不可能相差" prop="cp_jgz" label-width="120px">
<el-input placeholder="天内不可能相差" v-model="formData.cp_jgz" style="width: 100px;"></el-input> <el-input placeholder="天内不可能相差" v-model="modelParam.basicData.cp_jgz" style="width: 100px;"></el-input>
</el-form-item> </el-form-item>
<!--报警条件--> <!--报警条件-->
<span class="text-span">报警条件</span> <span class="text-span">报警条件</span>
<el-divider style="margin: 5px 0;" /> <el-divider style="margin: 5px 0;" />
<el-form-item label="危急值"> <el-form-item label="危急值">
<el-input placeholder="上限极值" v-model="formData.hlimt"></el-input> <el-input placeholder="上限极值" v-model="modelParam.basicData.hlimt"></el-input>
<el-input placeholder="下限极值" v-model="formData.llimit"></el-input> <el-input placeholder="下限极值" v-model="modelParam.basicData.llimit"></el-input>
<el-button type="primary" @click="conditionClick">特定条件</el-button> <el-button type="primary" @click="conditionClick">特定条件</el-button>
</el-form-item> </el-form-item>
<el-form-item label="复查"> <el-form-item label="复查">
<el-input placeholder="上限极值" v-model="formData.redoxx"></el-input> <el-input placeholder="上限极值" v-model="modelParam.basicData.redoxx"></el-input>
<el-input placeholder="下限极值" v-model="formData.redosx"></el-input> <el-input placeholder="下限极值" v-model="modelParam.basicData.redosx"></el-input>
</el-form-item> </el-form-item>
<span class="text-span">其他参数</span> <span class="text-span">其他参数</span>
<el-divider style="margin: 5px 0;" /> <el-divider style="margin: 5px 0;" />
<el-form-item label="国标编码"> <el-form-item label="国标编码">
<el-input v-model="formData.val1"></el-input> <SelectTable v-model:data="modelParam.basicData.val1" :fields="xmglFields" :tableData="dictData.GBDM"
label="label" value="value" objKey="value" width="140px" placeholder="国标编码" size="small" />
</el-form-item> </el-form-item>
<el-form-item label="外部代码2"> <el-form-item label="外部代码2">
<el-input v-model="formData.val2"></el-input> <el-input v-model="modelParam.basicData.val2"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部代码3"> <el-form-item label="外部代码3">
<el-input v-model="formData.val3"></el-input> <el-input v-model="modelParam.basicData.val3"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部代码4"> <el-form-item label="外部代码4">
<el-input v-model="formData.val4"></el-input> <el-input v-model="modelParam.basicData.val4"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部代码5"> <el-form-item label="外部代码5">
<el-input v-model="formData.val5"></el-input> <el-input v-model="modelParam.basicData.val5"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<MultiRef :refData="formData.dyckz" v-model:dialog-table-visible="mulitDialogTableVisible" @closeWithReturn="closeWithReturnMultiRef" /> <MultiRef :refData="modelParam.basicData.dyckz" v-model:dialog-table-visible="mulitDialogTableVisible"
<CalcGuilde v-model="calcDialogTableVisible" :form-data="formData" :text="formData.jsgs" @confirm="handleDialogConfirm"/> @closeWithReturn="closeWithReturnMultiRef" />
<Condition v-model="conditionTabVisible" :form-data="formData"/> <CalcGuilde v-model="calcDialogTableVisible" :form-data="modelParam.basicData" :text="modelParam.basicData.jsgs"
@confirm="handleDialogConfirm" />
<Condition v-model="conditionTabVisible" :form-data="modelParam.basicData" />
</div> </div>
</template> </template>
@ -163,18 +172,13 @@ import MultiRef from './child/MultiRef.vue';
import CalcGuilde from './child/CalcGuilde.vue'; import CalcGuilde from './child/CalcGuilde.vue';
import SelectTable from '@/components/SelectTable/index.vue' import SelectTable from '@/components/SelectTable/index.vue'
import Condition from './child/Condition.vue'; import Condition from './child/Condition.vue';
//@ts-ignore
// const props = defineProps({ import { getFirstLetter } from '@/utils/pinyin.js';
// dataList: {
// type: Object , //Object as PropType<XmInfoNew>
// required: false
// }
// });
const modelParam = defineModel<any>() const modelParam = defineModel<any>()
const formRef = ref(); const formRef = ref();
const formData = ref<any>({}); const disabled = ref(true);
const mulitDialogTableVisible = ref(false) const mulitDialogTableVisible = ref(false)
const calcDialogTableVisible = ref(false) const calcDialogTableVisible = ref(false)
const conditionTabVisible = ref(false) const conditionTabVisible = ref(false)
@ -182,120 +186,174 @@ const xmglFields = ref([
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true }, { prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', enablePinyinSearch: true }, { prop: 'label', label: '名称', enablePinyinSearch: true },
]) ])
const xmlbData = [
{ label: '数值型', value: '1' },
{ label: '文字型', value: '2' },
{ label: '阴阳性型', value: '3' },
{ label: '数值文字混合型', value: '4' },
]
const mrzData = [
{ label: '阴性', value: 'N' },
{ label: '阳性', value: 'P' }
]
const xswsData = [
{ label: '保持原始值', value: '-1' },
{ label: '0 位', value: '0' },
{ label: '1 位', value: '1' },
{ label: '2 位', value: '2' },
{ label: '3 位', value: '3' },
{ label: '4 位', value: '4' },
]
const dylxData = [
{ label: '原始检验结果', value: '1' },
{ label: '>上限,<下限模式', value: '2' },
{ label: '不打印', value: '3' },
]
const rules = ref({
dylx: [{ required: true, message: '请选择打印形式', trigger: 'blur' }],
})
computed(() => { computed(() => {
switch(formData.value.jgbz){ switch (modelParam.value.basicData.jgbz) {
case '1': case '1':
formData.value.cp_jgz = formData.value.jgz; modelParam.value.basicData.cp_jgz = modelParam.value.basicData.jgz;
break; break;
case '2': case '2':
formData.value.cp_jgz = formData.value.jgz + '%'; modelParam.value.basicData.cp_jgz = modelParam.value.basicData.jgz + '%';
break; break;
} }
}); });
const jsxmCheck = computed({ const jsxmCheck = computed({
get() { get() {
return formData.value.jsxm === 'Y' return modelParam.value.basicData.jsxm === 'Y'
}, },
set(checked: boolean) { set(checked: boolean) {
formData.value.jsxm = checked ? 'Y' : 'N'; modelParam.value.basicData.jsxm = checked ? 'Y' : 'N';
} }
}) })
const ygzqCheck = computed({ const ygzqCheck = computed({
get() { get() {
return formData.value.ygzq === 'Y' return modelParam.value.basicData.ygzq === 'Y'
}, },
set(checked: boolean) { set(checked: boolean) {
formData.value.ygzq = checked ? 'Y' : 'N'; modelParam.value.basicData.ygzq = checked ? 'Y' : 'N';
} }
}) })
const ygzdCheck = computed({ const ygzdCheck = computed({
get() { get() {
return formData.value.ygzd === 'Y' return modelParam.value.basicData.ygzd === 'Y'
}, },
set(checked: boolean) { set(checked: boolean) {
formData.value.ygzd = checked ? 'Y' : 'N'; modelParam.value.basicData.ygzd = checked ? 'Y' : 'N';
} }
}) })
const ygbbCheck = computed({ const ygbbCheck = computed({
get() { get() {
return formData.value.ygbb === 'Y' return modelParam.value.basicData.ygbb === 'Y'
}, },
set(checked: boolean) { set(checked: boolean) {
formData.value.ygbb = checked ? 'Y' : 'N'; modelParam.value.basicData.ygbb = checked ? 'Y' : 'N';
} }
}) })
const ygnlCheck = computed({ const ygnlCheck = computed({
get() { get() {
return formData.value.ygnl === 'Y' return modelParam.value.basicData.ygnl === 'Y'
}, },
set(checked: boolean) { set(checked: boolean) {
formData.value.ygnl = checked ? 'Y' : 'N'; modelParam.value.basicData.ygnl = checked ? 'Y' : 'N';
} }
}) })
const ygxbCheck = computed({ const ygxbCheck = computed({
get() { get() {
return formData.value.ygxb === 'Y' return modelParam.value.basicData.ygxb === 'Y'
}, },
set(checked: boolean) { set(checked: boolean) {
formData.value.ygxb = checked ? 'Y' : 'N'; modelParam.value.basicData.ygxb = checked ? 'Y' : 'N';
} }
}) })
watch( const updatedyckz = () => {
() => modelParam.value, modelParam.value.basicData.dyckz = !modelParam.value.basicData.ckxx && !modelParam.value.basicData.cksx ? '' : `${modelParam.value.basicData.ckxx}--${modelParam.value.basicData.cksx}`;
(newVal:any) => { }
formData.value = {...newVal.basicData};
},
{ immediate: true,deep: true }
);
//多行参考值 //多行参考值
const multiRefClick = () => { const multiRefClick = () => {
if(formData.value.dyckz){ if (modelParam.value.basicData.dyckz) {
mulitDialogTableVisible.value = true mulitDialogTableVisible.value = true
} }
} }
const closeWithReturnMultiRef = (val: string) => { const closeWithReturnMultiRef = (val: string) => {
formData.value.dyckz = val; modelParam.value.basicData.dyckz = val;
mulitDialogTableVisible.value = false; mulitDialogTableVisible.value = false;
} }
const handleDialogConfirm = (val: string) => { const handleDialogConfirm = (val: string) => {
formData.value.jsgs = val; modelParam.value.basicData.jsgs = val;
calcDialogTableVisible.value = false calcDialogTableVisible.value = false
} }
//计算向导 //计算向导
const calcGuildeClick = () => { const calcGuildeClick = () => {
if(formData.value.jsxm){ if (modelParam.value.basicData.jsxm) {
calcDialogTableVisible.value = true calcDialogTableVisible.value = true
} }
} }
//危急值特定条件 //危急值特定条件
const conditionClick = () => { const conditionClick = () => {
if(formData.value.xmid){ if (modelParam.value.basicData.xmid) {
conditionTabVisible.value = true conditionTabVisible.value = true
} }
} }
const xmdhInput = (val: string) => {
modelParam.value.basicData.zhbdh = val;
modelParam.value.basicData.bgdh = val;
}
const xmmcChange = (val: string) => {
modelParam.value.basicData.zjf = getFirstLetter(val);
}
onActivated(async () => { onActivated(async () => {
await getDictData('XMGL'); await getDictData('XMGL', 'UT', 'YQDL', 'MD', 'ITEMCLASS', 'GBDM');
}) })
// 暴露验证方法(关键步骤)
defineExpose({ defineExpose({
basicData: formData // 封装表单验证方法,返回 Promise
}) validate: () => {
return new Promise((resolve) => {
formRef.value?.validate((valid: boolean) => {
resolve(valid);
});
});
},
// 可选:暴露清除验证的方法
clearValidate: () => {
formRef.value?.clearValidate();
},
resetField: () => {
formRef.value?.resetFields();
},
changeDisabled: (val: any) => {
disabled.value = val;
}
});
</script> </script>
@ -305,16 +363,19 @@ defineExpose({
padding: 10px; padding: 10px;
background-color: #f5f7fa; background-color: #f5f7fa;
height: auto; height: auto;
.el-input { .el-input {
width: 150px; width: 150px;
} }
.el-form-item { .el-form-item {
margin-right: 10px; margin-right: 10px;
margin-bottom: 2px; margin-bottom: 2px;
} }
.text-span { .text-span {
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 14px;
color: #333; color: #333;
display: block; display: block;
} }

View File

@ -5,8 +5,8 @@
<el-button type="primary" @click="onAddClick">增加</el-button> <el-button type="primary" @click="onAddClick">增加</el-button>
<el-button type="primary" @click="onDelClick">删除</el-button> <el-button type="primary" @click="onDelClick">删除</el-button>
</div> </div>
<CustomTable ref="tableRef" :data="tableList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd" <CustomTable ref="tableRef" :data="modelParam.commonDescriptionsData" :columns="columns" :enable-column-drag="true"
:config="tableConfig" @row-click="rowClick"> @column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowClick">
<template #textresult="{ row }"> <template #textresult="{ row }">
<el-input type="textarea" v-model="row.textresult" class="full-width-input" autosize></el-input> <el-input type="textarea" v-model="row.textresult" class="full-width-input" autosize></el-input>
</template> </template>
@ -22,18 +22,9 @@ import { ElMessageBox } from 'element-plus';
import { ref } from 'vue'; import { ref } from 'vue';
import { delXmTextresultNew } from '@/api/liswork/labItem/labItemApi'; import { delXmTextresultNew } from '@/api/liswork/labItem/labItemApi';
// const props = defineProps({
// formData: {
// type: Object,
// default: {}
// }
// });
const modelParam = defineModel<any>() const modelParam = defineModel<any>()
const tableRef = ref(); const tableRef = ref();
const tableList = ref<Array<XmTextresultNew>>([])
const columns = ref([ const columns = ref([
{ prop: 'textresult', label: '文字描述', visible: true, align: 'center', slot: 'textresult', width: 500, showOverflowTooltip: false }, { prop: 'textresult', label: '文字描述', visible: true, align: 'center', slot: 'textresult', width: 500, showOverflowTooltip: false },
]); ]);
@ -56,17 +47,9 @@ const emit = defineEmits(['refreshTabData'])
//序号最大值 //序号最大值
const maxXh = computed(() => { const maxXh = computed(() => {
return tableList.value.length > 0 ? Math.max(...tableList.value.map((item:any) => item.xh || 0)) : 0; return modelParam.value.commonDescriptionsData.length > 0 ? Math.max(...modelParam.value.commonDescriptionsData.map((item: any) => item.xh || 0)) : 0;
}); });
watch(
() => modelParam.value,
(newVal:any) => {
tableList.value = [...newVal.commonDescriptionsData];
},
{ immediate: true, deep: true }
);
const rowClick = (row: any) => { const rowClick = (row: any) => {
selectRow.value = row selectRow.value = row
} }
@ -78,7 +61,7 @@ const onAddClick = () => {
xmdh: modelParam.value.basicData.xmdh, xmdh: modelParam.value.basicData.xmdh,
xh: maxXh.value + 1 xh: maxXh.value + 1
} }
tableList.value.push(newData) modelParam.value.commonDescriptionsData.push(newData)
} }
const onDelClick = async () => { const onDelClick = async () => {
@ -92,11 +75,6 @@ const onDelClick = async ()=> {
} }
defineExpose({
commonDescriptionsData: tableList
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -5,66 +5,46 @@
<el-button type="primary" @click="onAddClick">增加</el-button> <el-button type="primary" @click="onAddClick">增加</el-button>
<el-button type="primary" @click="onDelClick">删除</el-button> <el-button type="primary" @click="onDelClick">删除</el-button>
</div> </div>
<CustomTable ref="tableRefUp" :data="dataListUp" :columns="columnsUp" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd" <CustomTable ref="tableRefUp" :data="modelParam.referenceValueDetailsData" :columns="columnsUp"
:config="tableConfig" @row-click="rowClick"> :enable-column-drag="true" @column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowClick">
<template #xb="{ row }"> <template #xb="{ row }">
<el-select v-model="row.xb" clearable> <el-select v-model="row.xb" clearable>
<el-option <el-option v-for="item in optionsXb" :key="item.value" :label="item.label" :value="item.value"></el-option>
v-for="item in optionsXb"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</template> </template>
<template #cp_nl1="{row}"> <template #nl1="{ row }">
<el-input v-model="row.cp_nl1" class="full-width-input"></el-input> <el-input v-model="row.nl1" class="full-width-input"></el-input>
</template> </template>
<template #cp_nldw1="{ row }"> <template #cp_nldw1="{ row }">
<el-select v-model="row.cp_nldw1" clearable> <el-select v-model="row.nldw" clearable>
<el-option <el-option v-for="item in optionsNLDW" :key="item.value" :label="item.label" :value="item.value"></el-option>
v-for="item in optionsNLDW"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</template> </template>
<template #cp_nl2="{row}"> <template #nl2="{ row }">
<el-input v-model="row.cp_nl2" class="full-width-input"></el-input> <el-input v-model="row.nl2" class="full-width-input"></el-input>
</template> </template>
<template #cp_nldw2="{ row }"> <template #cp_nldw2="{ row }">
<el-select v-model="row.cp_nldw2" clearable> <el-select v-model="row.nldw" clearable>
<el-option <el-option v-for="item in optionsNLDW" :key="item.value" :label="item.label" :value="item.value"></el-option>
v-for="item in optionsNLDW"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</template> </template>
<template #bblx="{ row }"> <template #bblx="{ row }">
<SelectTable v-model:data="row.bblx" :fields="fields" :tableData="bblxOptions" label="label" <SelectTable v-model:data="row.bblx" :fields="fields" :tableData="bblxOptions" label="label" value="label"
value="label" objKey="label" :border="true" /> objKey="label" :border="true" />
</template> </template>
<template #slzq="{ row }"> <template #slzq="{ row }">
<el-select v-model="row.slzq" clearable> <el-select v-model="row.slzq" clearable>
<el-option <el-option v-for="item in optionsSLZQ" :key="item.value" :label="item.label" :value="item.value"></el-option>
v-for="item in optionsSLZQ"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</template> </template>
<template #zd="{ row }"> <template #zd="{ row }">
<el-input v-model="row.zd" class="full-width-input"></el-input> <el-input v-model="row.zd" class="full-width-input"></el-input>
</template> </template>
<template #ckxx="{ row }"> <template #ckxx="{ row }">
<el-input v-model="row.ckxx" class="full-width-input"></el-input> <el-input v-model="row.ckxx" class="full-width-input" @input="updateDyck(row)"></el-input>
</template> </template>
<template #cksx="{ row }"> <template #cksx="{ row }">
<el-input v-model="row.cksx" class="full-width-input"></el-input> <el-input v-model="row.cksx" class="full-width-input" @input="updateDyck(row)"></el-input>
</template> </template>
<template #alterxx="{ row }"> <template #alterxx="{ row }">
<el-input v-model="row.alterxx" class="full-width-input"></el-input> <el-input v-model="row.alterxx" class="full-width-input"></el-input>
@ -73,7 +53,7 @@
<el-input v-model="row.altersx" class="full-width-input"></el-input> <el-input v-model="row.altersx" class="full-width-input"></el-input>
</template> </template>
<template #dyck="{ row }"> <template #dyck="{ row }">
{{ !row.ckxx && !row.cksx ? '':row.ckxx + '--' + row.cksx }} <el-text class="mx-1">{{ row.dyck }}</el-text>
</template> </template>
</CustomTable> </CustomTable>
<el-row> <el-row>
@ -83,8 +63,8 @@
<el-button type="primary" @click="">增加</el-button> <el-button type="primary" @click="">增加</el-button>
<el-button type="primary" @click="">删除</el-button> <el-button type="primary" @click="">删除</el-button>
</div> </div>
<CustomTable ref="tableRefDown" :data="dataListDown" :columns="columnsDown" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd" <CustomTable ref="tableRefDown" :data="dataListDown" :columns="columnsDown" :enable-column-drag="true"
:config="tableConfig"/> @column-drag-end="handleColumnDragEnd" :config="tableConfig" />
</div> </div>
</template> </template>
@ -95,14 +75,9 @@ import {getDictData,dictData} from '@/hooks'
import SelectTable from '@/components/SelectTable/index.vue' import SelectTable from '@/components/SelectTable/index.vue'
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
// const props = defineProps({
// dataList: {
// type: Array,
// default: []
// }
// });
const modelParam = defineModel<any>() const modelParam = defineModel<any>()
const emit = defineEmits(['refreshTabData'])
const optionsXb = [ const optionsXb = [
{ value: '1', label: '男' }, { value: '1', label: '男' },
@ -128,16 +103,16 @@ const bblxOptions = ref<Array<{ zddh: string; zdmc: string }>>([]);
const tableRefUp = ref<any>(); const tableRefUp = ref<any>();
const tableRefDown = ref<any>(); const tableRefDown = ref<any>();
const dataListUp = ref(); // const dataListUp = ref();
const dataListDown = ref(); const dataListDown = ref();
const columnsUp = ref([ const columnsUp = ref([
{ prop: 'xmid', label: 'xmid', visible: false, align: 'center' }, { prop: 'xmid', label: 'xmid', visible: false, align: 'center' },
{ prop: 'xh', label: '序号', visible: false, align: 'center' }, { prop: 'xh', label: '序号', visible: false, align: 'center' },
{ prop: 'xb', label: '性别', visible: true, align: 'center', slot: 'xb', width: 70 }, { prop: 'xb', label: '性别', visible: true, align: 'center', slot: 'xb', width: 70 },
{ prop: 'nl1', label: '年龄下限', visible: true, align: 'center',slot:'cp_nl1', width: 100 }, { prop: 'nl1', label: '年龄下限', visible: true, align: 'center', slot: 'nl1', width: 70 },
{ prop: 'cp_nldw1', label: '年龄单位', visible: true, align: 'center',slot:'cp_nldw1', width: 70 }, { prop: 'nldw', label: '年龄单位', visible: true, align: 'center', slot: 'cp_nldw1', width: 70 },
{ prop: 'nl2', label: '年龄上限', visible: true, align: 'center',slot: 'cp_nl2', width: 100 }, { prop: 'nl2', label: '年龄上限', visible: true, align: 'center', slot: 'nl2', width: 70 },
{ prop: 'cp_nldw2', label: '年龄单位', visible: true, align: 'center',slot: 'cp_nldw2', width: 100 }, { prop: 'nldw', label: '年龄单位', visible: true, align: 'center', slot: 'cp_nldw2', width: 70 },
{ prop: 'bblx', label: '标本类型', visible: true, align: 'center', slot: 'bblx', width: 100 }, { prop: 'bblx', label: '标本类型', visible: true, align: 'center', slot: 'bblx', width: 100 },
{ prop: 'slzq', label: '生理周期', visible: true, align: 'center', slot: 'slzq', width: 100 }, { prop: 'slzq', label: '生理周期', visible: true, align: 'center', slot: 'slzq', width: 100 },
{ prop: 'zd', label: '诊断', visible: true, align: 'center', slot: 'zd', width: 100 }, { prop: 'zd', label: '诊断', visible: true, align: 'center', slot: 'zd', width: 100 },
@ -180,16 +155,12 @@ const handleColumnDragEnd = (data: any) => {
//序号最大值 //序号最大值
const maxXh = computed(() => { const maxXh = computed(() => {
return dataListUp.value.length > 0 ? Math.max(...dataListUp.value.map((item:any) => item.xh || 0)) : 0; return modelParam.value.referenceValueDetailsData.length > 0 ? Math.max(...modelParam.value.referenceValueDetailsData.map((item: any) => item.xh || 0)) : 0;
}); });
watch( const updateDyck = (row: any) => {
() => modelParam.value, row.dyck = !row.ckxx && !row.cksx ? '' : `${row.ckxx}--${row.cksx}`;
(newVal:any) => { }
dataListUp.value = [...newVal.referenceValueDetailsData];
},
{ immediate: true, deep: true }
);
const onAddClick = () => { const onAddClick = () => {
const newData = { const newData = {
@ -197,15 +168,14 @@ const onAddClick = () => {
yq: '0', yq: '0',
xh: maxXh.value + 1 xh: maxXh.value + 1
} }
dataListUp.value.push(newData) modelParam.value.referenceValueDetailsData.push(newData)
} }
const onDelClick = async () => { const onDelClick = async () => {
console.log('删除',selectRow.value)
if (selectRow.value) { if (selectRow.value) {
await ElMessageBox.confirm('是否要删除选中的数据?', '警告', await ElMessageBox.confirm('是否要删除选中的数据?', '警告',
{ confirmButtonText: 'OK', cancelButtonText: 'Cancel', type: 'warning', }); { confirmButtonText: 'OK', cancelButtonText: 'Cancel', type: 'warning', });
dataListUp.value = dataListUp.value.filter((item:any) => item.xh !== selectRow.value.xh) emit('refreshTabData', modelParam.value.basicData)
} }
} }
@ -220,10 +190,6 @@ onActivated( async ()=>{
optionsSLZQ.value = dictData.value.SLZQ || [] optionsSLZQ.value = dictData.value.SLZQ || []
}) })
defineExpose({
referenceValueDetailsData: dataListUp
})
</script> </script>

View File

@ -5,8 +5,8 @@
<el-button type="primary" @click="onClickAdd">新增</el-button> <el-button type="primary" @click="onClickAdd">新增</el-button>
<el-button type="primary" @click="onClickDel">删除</el-button> <el-button type="primary" @click="onClickDel">删除</el-button>
</div> </div>
<CustomTable ref="tableRef" :data="yqList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd" <CustomTable ref="tableRef" :data="modelParam.userInstrData" :columns="columns" :enable-column-drag="true"
:config="tableConfig" @row-click="onRowClick"> @column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="onRowClick">
<template #yq="{ row }"> <template #yq="{ row }">
<YQSelectTable v-model:data="row.yq" placeholder="请输入仪器名称" /> <YQSelectTable v-model:data="row.yq" placeholder="请输入仪器名称" />
</template> </template>
@ -37,19 +37,9 @@ import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
import { ElMessageBox } from 'element-plus' import { ElMessageBox } from 'element-plus'
import { deleteXmInfoVs } from '@/api/liswork/labItem/labItemApi'; import { deleteXmInfoVs } from '@/api/liswork/labItem/labItemApi';
// const props = defineProps({
// formData: {
// type: Object,
// required: false,
// default: {}
// }
// });
const modelParam = defineModel<any>() const modelParam = defineModel<any>()
//const yq = ref<string>('');
const tableRef = ref<any>(); const tableRef = ref<any>();
const yqList = ref<Array<XmInfoVs>>([]);
const columns = ref([ const columns = ref([
{ prop: 'vsid', label: '对照编码', visible: false, align: 'center' }, { prop: 'vsid', label: '对照编码', visible: false, align: 'center' },
{ prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 150 }, { prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 150 },
@ -70,14 +60,6 @@ const selectRow = ref<XmInfoVs>({
xmid: 0 xmid: 0
}) })
watch(
() => modelParam.value,
(newVal:any) => {
yqList.value = [...newVal.userInstrData];
},
{ immediate: true, deep: true }
);
const emit = defineEmits(['refreshTabData']) const emit = defineEmits(['refreshTabData'])
//退拽属性 //退拽属性
@ -87,12 +69,7 @@ const handleColumnDragEnd = (data: any) => {
} }
const handInputChange = () => { const handInputChange = () => {
// yqList.value = yqList.value.filter(item => {
// return item.yq.includes(yq.value) || item.yqmc.includes(yq.value);
// });
// if (yq.value === '') {
// yqList.value = props.dataList;
// }
} }
const onClickAdd = () => { const onClickAdd = () => {
@ -100,7 +77,7 @@ const onClickAdd = () => {
yq: '', yq: '',
xmid: modelParam.value.basicData.xmid, xmid: modelParam.value.basicData.xmid,
} }
yqList.value.push(newData) modelParam.value.userInstrData.push(newData)
} }
const onClickDel = async () => { const onClickDel = async () => {
@ -133,8 +110,4 @@ onActivated(() =>{
}) })
defineExpose({
userInstrData: yqList
})
</script> </script>