diff --git a/src/views/liswork/labItem/tab/useInstr.vue b/src/views/liswork/labItem/tab/useInstr.vue
index 0f57463..14912aa 100644
--- a/src/views/liswork/labItem/tab/useInstr.vue
+++ b/src/views/liswork/labItem/tab/useInstr.vue
@@ -3,28 +3,30 @@
新增
- 删除
+ @column-drag-end="handleColumnDragEnd" :config="tableConfig">
+ objKey="yq" placeholder="请选择仪器" :clearable="false" class="full-width-input" />
- row.zkxm = val ? 1 : 0" />
+
-
+
-
+
-
+
+
+
+ 删除
@@ -43,8 +45,8 @@ const modelParam = defineModel()
const tableRef = ref();
const columns = ref([
{ prop: 'vsid', label: '对照编码', visible: false, align: 'center' },
- { prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 200, showOverflowTooltip: false },
- { prop: 'xs', label: '调整系数', visible: true, align: 'center', slot: 'xs', showOverflowTooltip: false },
+ { prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 160, 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: 'ckxx', label: '参考下限', visible: true, align: 'center', slot: 'ckxx', showOverflowTooltip: false },
{ prop: 'cksx', label: '参考上限', visible: true, align: 'center', slot: 'cksx', showOverflowTooltip: false },
@@ -53,7 +55,8 @@ const columns = ref([
const tableConfig = ref({
border: true, // 边框
height: '78vh', // 高度
- highlightCurrentRow: true, // 高亮当前行
+ highlightCurrentRow: false, // 高亮当前行
+ actionWidth: 60, // 操作列宽度
// cellStyle: cellStyleHd
})
@@ -88,22 +91,23 @@ const onClickAdd = () => {
modelParam.value.userInstrData.push(newData)
}
-const onClickDel = () => {
- if (!selectRow.value.vsid) return ElMessage.warning('请选择要删除的行!')
- ElMessageBox.confirm('是否要删除选中的数据?', '警告',
- {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- }).then(async () => {
- await deleteXmInfoVs({ vsid: selectRow.value.vsid || 0 })
- emit('refreshTabData', modelParam.value.basicData)
- })
+const onClickDel = (row, index) => {
+ if (!row.vsid) {
+ modelParam.value.userInstrData.splice(index, 1)
+ } else {
+ ElMessageBox.confirm('是否要删除选中的数据?', '警告',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }).then(async () => {
+ await deleteXmInfoVs({ vsid: row.vsid })
+ emit('refreshTabData', modelParam.value.basicData)
+ })
+ }
}
-const onRowClick = (row: any) => {
- selectRow.value = row
-}
+
const getDyckz = (row: XmInfoVs) => {
if (!row.cksx && !row.ckxx) {
diff --git a/src/views/liswork/micro/index.vue b/src/views/liswork/micro/index.vue
index fd7fd46..fe3ce03 100644
--- a/src/views/liswork/micro/index.vue
+++ b/src/views/liswork/micro/index.vue
@@ -727,7 +727,7 @@ const fetchlabPatList = () => {
}
} else {
labInfo.value = {}
- labPat.value = { ybh: '1' }
+ labPat.value = {}
zbLabResuts.value = []
handleCreate()
}
diff --git a/src/views/liswork/micro/labpat.vue b/src/views/liswork/micro/labpat.vue
index ec191d8..d654d9a 100644
--- a/src/views/liswork/micro/labpat.vue
+++ b/src/views/liswork/micro/labpat.vue
@@ -341,7 +341,7 @@ const getColor = (type: string) => {
}
const formInfoRefs = useTemplateRef('formInfoRefs')
-const currentTarget = ref(null);
+const currentTarget = ref(null);
// 回车跳转到下一个表单元素
const nextFocus = (e?: Event, idx?: number) => {
if (e) e.preventDefault() // 禁止回车提交表单
@@ -364,8 +364,12 @@ const nextFocus = (e?: Event, idx?: number) => {
// 找到当前触发元素在列表中的位置
currentTarget.value = e?.target as HTMLElement;
// 兼容 SelectTable:如果点击的是组件外层,定位到内部输入框
- if (currentTarget.value.closest('.select-table-container')) {
- currentTarget.value = currentTarget.value.closest('.select-table-container').querySelector('.el-select__input');
+ const container = currentTarget.value.closest('.select-table-container');
+ 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));
diff --git a/src/views/liswork/work/labpat.vue b/src/views/liswork/work/labpat.vue
index 0815e3f..18d6892 100644
--- a/src/views/liswork/work/labpat.vue
+++ b/src/views/liswork/work/labpat.vue
@@ -334,7 +334,7 @@ const getColor = (type: string) => {
}
const formInfoRefs = useTemplateRef('formInfoRefs')
-const currentTarget = ref(null);
+const currentTarget = ref(null);
// 回车跳转到下一个表单元素
const nextFocus = (e?: Event, idx?: number) => {
if (e) e.preventDefault() // 禁止回车提交表单
@@ -357,8 +357,12 @@ const nextFocus = (e?: Event, idx?: number) => {
// 找到当前触发元素在列表中的位置
currentTarget.value = e?.target as HTMLElement;
// 兼容 SelectTable:如果点击的是组件外层,定位到内部输入框
- if (currentTarget.value.closest('.select-table-container')) {
- currentTarget.value = currentTarget.value.closest('.select-table-container').querySelector('.el-select__input');
+ const conatiner = currentTarget.value.closest('.select-table-container') as HTMLElement;
+ 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));