检验项目优化
This commit is contained in:
parent
29990c0ba9
commit
f256dd5d34
@ -3,28 +3,30 @@
|
|||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="onClickAdd">新增</el-button>
|
<el-button type="primary" @click="onClickAdd">新增</el-button>
|
||||||
<el-button type="primary" @click="onClickDel">删除</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<CustomTable ref="tableRef" :data="modelParam.userInstrData" :columns="columns" :enable-column-drag="true"
|
<CustomTable ref="tableRef" :data="modelParam.userInstrData" :columns="columns" :enable-column-drag="true"
|
||||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="onRowClick">
|
@column-drag-end="handleColumnDragEnd" :config="tableConfig">
|
||||||
<template #yq="{ row }">
|
<template #yq="{ row }">
|
||||||
<SelectTable v-model:data="row.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc" value="yq"
|
<SelectTable v-model:data="row.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc" value="yq"
|
||||||
objKey="yq" :border="true" placeholder="请选择仪器" :clearable="false" class="full-width-input" />
|
objKey="yq" placeholder="请选择仪器" :clearable="false" class="full-width-input" />
|
||||||
</template>
|
</template>
|
||||||
<template #xs="{ row }">
|
<template #xs="{ row }">
|
||||||
<el-input v-model="row.xs" class="full-width-input" />
|
<el-input v-model="row.xs" class="full-width-input" />
|
||||||
</template>
|
</template>
|
||||||
<template #zkxm="{ row }">
|
<template #zkxm="{ row }">
|
||||||
<el-checkbox :checked="row.zkxm === '1'" @change="(val: any) => row.zkxm = val ? 1 : 0" />
|
<el-checkbox v-model="row.zkxm" true-value="1" false-value="0" />
|
||||||
</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" />
|
||||||
</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" />
|
||||||
</template>
|
</template>
|
||||||
<template #dyckz="{ row }">
|
<template #dyckz="{ row }">
|
||||||
<el-input :model-value="getDyckz(row)" disabled class="full-width-input"></el-input>
|
<el-input :model-value="getDyckz(row)" disabled class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
<template #action="{ row, $index }">
|
||||||
|
<el-button type="danger" text @click="onClickDel(row, $index)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
</div>
|
</div>
|
||||||
@ -43,8 +45,8 @@ const modelParam = defineModel<any>()
|
|||||||
const tableRef = ref<any>();
|
const tableRef = ref<any>();
|
||||||
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: 200, showOverflowTooltip: false },
|
{ prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 160, showOverflowTooltip: false },
|
||||||
{ prop: 'xs', label: '调整系数', visible: true, align: 'center', slot: 'xs', showOverflowTooltip: false },
|
{ prop: 'xs', label: '调整系数', visible: true, align: 'center', slot: 'xs', width: 80, showOverflowTooltip: false },
|
||||||
{ prop: 'zkxm', label: '质控', visible: true, align: 'center', slot: 'zkxm', width: 40 },
|
{ prop: 'zkxm', label: '质控', visible: true, align: 'center', slot: 'zkxm', width: 40 },
|
||||||
{ prop: 'ckxx', label: '参考下限', visible: true, align: 'center', slot: 'ckxx', showOverflowTooltip: false },
|
{ prop: 'ckxx', label: '参考下限', visible: true, align: 'center', slot: 'ckxx', showOverflowTooltip: false },
|
||||||
{ prop: 'cksx', label: '参考上限', visible: true, align: 'center', slot: 'cksx', showOverflowTooltip: false },
|
{ prop: 'cksx', label: '参考上限', visible: true, align: 'center', slot: 'cksx', showOverflowTooltip: false },
|
||||||
@ -53,7 +55,8 @@ const columns = ref([
|
|||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '78vh', // 高度
|
height: '78vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: false, // 高亮当前行
|
||||||
|
actionWidth: 60, // 操作列宽度
|
||||||
// cellStyle: cellStyleHd
|
// cellStyle: cellStyleHd
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -88,22 +91,23 @@ const onClickAdd = () => {
|
|||||||
modelParam.value.userInstrData.push(newData)
|
modelParam.value.userInstrData.push(newData)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClickDel = () => {
|
const onClickDel = (row, index) => {
|
||||||
if (!selectRow.value.vsid) return ElMessage.warning('请选择要删除的行!')
|
if (!row.vsid) {
|
||||||
|
modelParam.value.userInstrData.splice(index, 1)
|
||||||
|
} else {
|
||||||
ElMessageBox.confirm('是否要删除选中的数据?', '警告',
|
ElMessageBox.confirm('是否要删除选中的数据?', '警告',
|
||||||
{
|
{
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
await deleteXmInfoVs({ vsid: selectRow.value.vsid || 0 })
|
await deleteXmInfoVs({ vsid: row.vsid })
|
||||||
emit('refreshTabData', modelParam.value.basicData)
|
emit('refreshTabData', modelParam.value.basicData)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onRowClick = (row: any) => {
|
|
||||||
selectRow.value = row
|
|
||||||
}
|
|
||||||
|
|
||||||
const getDyckz = (row: XmInfoVs) => {
|
const getDyckz = (row: XmInfoVs) => {
|
||||||
if (!row.cksx && !row.ckxx) {
|
if (!row.cksx && !row.ckxx) {
|
||||||
|
|||||||
@ -727,7 +727,7 @@ const fetchlabPatList = () => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
labInfo.value = {}
|
labInfo.value = {}
|
||||||
labPat.value = { ybh: '1' }
|
labPat.value = {}
|
||||||
zbLabResuts.value = []
|
zbLabResuts.value = []
|
||||||
handleCreate()
|
handleCreate()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -341,7 +341,7 @@ const getColor = (type: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const formInfoRefs = useTemplateRef('formInfoRefs')
|
const formInfoRefs = useTemplateRef('formInfoRefs')
|
||||||
const currentTarget = ref(null);
|
const currentTarget = ref<HTMLElement | null>(null);
|
||||||
// 回车跳转到下一个表单元素
|
// 回车跳转到下一个表单元素
|
||||||
const nextFocus = (e?: Event, idx?: number) => {
|
const nextFocus = (e?: Event, idx?: number) => {
|
||||||
if (e) e.preventDefault() // 禁止回车提交表单
|
if (e) e.preventDefault() // 禁止回车提交表单
|
||||||
@ -364,8 +364,12 @@ const nextFocus = (e?: Event, idx?: number) => {
|
|||||||
// 找到当前触发元素在列表中的位置
|
// 找到当前触发元素在列表中的位置
|
||||||
currentTarget.value = e?.target as HTMLElement;
|
currentTarget.value = e?.target as HTMLElement;
|
||||||
// 兼容 SelectTable:如果点击的是组件外层,定位到内部输入框
|
// 兼容 SelectTable:如果点击的是组件外层,定位到内部输入框
|
||||||
if (currentTarget.value.closest('.select-table-container')) {
|
const container = currentTarget.value.closest('.select-table-container');
|
||||||
currentTarget.value = currentTarget.value.closest('.select-table-container').querySelector('.el-select__input');
|
if (container) {
|
||||||
|
const input = container.querySelector('.el-select__input');
|
||||||
|
if (input) {
|
||||||
|
currentTarget.value = input as HTMLElement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
index = arr.findIndex((item: any) => item === currentTarget.value || item.contains(currentTarget.value));
|
index = arr.findIndex((item: any) => item === currentTarget.value || item.contains(currentTarget.value));
|
||||||
|
|||||||
@ -334,7 +334,7 @@ const getColor = (type: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const formInfoRefs = useTemplateRef('formInfoRefs')
|
const formInfoRefs = useTemplateRef('formInfoRefs')
|
||||||
const currentTarget = ref(null);
|
const currentTarget = ref<HTMLElement | null>(null);
|
||||||
// 回车跳转到下一个表单元素
|
// 回车跳转到下一个表单元素
|
||||||
const nextFocus = (e?: Event, idx?: number) => {
|
const nextFocus = (e?: Event, idx?: number) => {
|
||||||
if (e) e.preventDefault() // 禁止回车提交表单
|
if (e) e.preventDefault() // 禁止回车提交表单
|
||||||
@ -357,8 +357,12 @@ const nextFocus = (e?: Event, idx?: number) => {
|
|||||||
// 找到当前触发元素在列表中的位置
|
// 找到当前触发元素在列表中的位置
|
||||||
currentTarget.value = e?.target as HTMLElement;
|
currentTarget.value = e?.target as HTMLElement;
|
||||||
// 兼容 SelectTable:如果点击的是组件外层,定位到内部输入框
|
// 兼容 SelectTable:如果点击的是组件外层,定位到内部输入框
|
||||||
if (currentTarget.value.closest('.select-table-container')) {
|
const conatiner = currentTarget.value.closest('.select-table-container') as HTMLElement;
|
||||||
currentTarget.value = currentTarget.value.closest('.select-table-container').querySelector('.el-select__input');
|
if (conatiner) {
|
||||||
|
const input = conatiner.querySelector('.el-select__input');
|
||||||
|
if (input) {
|
||||||
|
currentTarget.value = input as HTMLElement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
index = arr.findIndex((item: any) => item === currentTarget.value || item.contains(currentTarget.value));
|
index = arr.findIndex((item: any) => item === currentTarget.value || item.contains(currentTarget.value));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user