参数试剂维护

This commit is contained in:
wyuu 2025-12-17 17:32:10 +08:00
parent dbf6cfcd8b
commit 3af945b0f3
16 changed files with 202 additions and 78 deletions

View File

@ -99,3 +99,11 @@ export function delXmLot(data?: Object) {
params: data
});
}
// 获取试剂厂家
export function querySjcs(data?: Object) {
return request({
url: '/xminfo/querySjcs',
method: 'get',
params: data
});
}

View File

@ -60,10 +60,13 @@ const props = withDefaults(defineProps<Props>(), {
width: "100%",
dictType: '',
clearable: true,
objKey: 'label'
objKey: 'value',
fields: () => [
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
],
});
const emits = defineEmits<Emits>();
const searchKey = ref('');
const tableRef = ref();

View File

@ -11,7 +11,6 @@
:header-cell-class-name="enableColumnDrag ? 'el-table-header-cell' : ''" @row-dblclick="handleRowDblclick"
@sort-change="handleSortChange" v-bind="$attrs">
<!-- 动态列 -->
<template v-for="item in columns" :key="item.prop">
<!-- 多选列 -->
@ -340,6 +339,10 @@ const setScrollTo = (top: number) => {
tableRef.value?.scrollTo(top);
};
const setScrollTop = (height: number) => {
tableRef.value?.setScrollTop(height);
};
const clearSort = () => {
tableRef.value?.clearSort();
};
@ -359,6 +362,7 @@ defineExpose({
toggleAllSelection,
setCurrentRow,
setScrollTo,
setScrollTop,
clearSort,
doLayout,
sort,

View File

@ -73,7 +73,7 @@ import DictTag from '@/components/DictTag'
// elTable表格组件
import CustomTable from '@/components/elTable'
// vxeTable 组件
import VxeTable from '@/components/vxeTable'
import CustomVxeTable from '@/components/vxeTable'
// 下拉框表格组件
import SelectTable from '@/components/SelectTable'
import print from 'vue3-print-nb';
@ -101,7 +101,7 @@ app.component('ImagePreview', ImagePreview)
app.component('RightToolbar', RightToolbar)
app.component('Editor', Editor)
app.component('CustomTable', CustomTable)
app.component('VxeTable', VxeTable)
app.component('CustomVxeTable ', CustomVxeTable)
app.component('SelectTable', SelectTable)
//VUE3标准方法注入全局方法

View File

@ -5,7 +5,7 @@ export interface Emits {
export interface Props {
data: any;
fields: Field[];
fields?: Field[];
tableData?: object[];
label?: string;
value?: string;

View File

@ -71,7 +71,7 @@
:columns="columns"></right-toolbar> -->
</el-row>
<VxeTable :table-data="tableData" :loading="loading" :columns="columns"
<CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns"
:row-config="{ isHover: true, keyField: 'ybh' }" @current-change="rowHandle" size="small"
:row-style="rowClassNameHd" :cell-style="cellStyleHd" class="mytable-style" ref="tableRef"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" @selection-change="selectionChange"
@ -94,7 +94,7 @@
<template #yljg="{ row }">
{{ formatDict(row.yljg, 'HOS') }}
</template>
</VxeTable>
</CustomVxeTable>
</el-col>
<el-col :span="8" class="right-table">
@ -161,7 +161,7 @@ import { ref, reactive, toRaw, computed, watch, nextTick, onMounted, } from 'vue
import { HiprintPrinter } from '@/utils/hiprintPrinter';
import { classCom } from '@/utils/classCom';
import CustomTable from '@/components/elTable/index.vue'
import VxeTable from '@/components/vxeTable/index.vue'
import CustomVxeTable from '@/components/vxeTable/index.vue'
import { useRouter, useRoute } from 'vue-router'
import { usePrintStore } from '@/store/modules/printStore'
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain } from '@/api/checkCode/index'

View File

@ -91,7 +91,7 @@
<!-- <CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
@selection-change="selectionChange" @row-click="rowHandle" :enableColumnDrag="true"
@column-drag-end="handleColumnDragEnd"> -->
<VxeTable :table-data="tableData" :loading="loading" :columns="columns"
<CustomVxeTable :table-data="tableData" :loading="loading" :columns="columns"
:row-config="{ isHover: true, keyField: 'ybh' }" @current-change="rowHandle" size="small"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" class="mytable-style" ref="tableRefs"
:cell-style="cellStyleHd" @selection-change="selectionChange" :config="tableConfig" :enable-column-drag="true"
@ -105,7 +105,7 @@
<template #jzbz="{ row }">
{{ row.jzbz == 1 ? '急' : '' }}
</template>
</VxeTable>
</CustomVxeTable>
</el-col>
<el-col :span="8" class="right-table">
@ -173,7 +173,7 @@
<script setup lang="ts">
import { ref, reactive, toRaw, computed, watch, nextTick, onMounted } from 'vue';
import CustomTable from '@/components/elTable/index.vue'
import VxeTable from '@/components/vxeTable/index.vue'
import CustomVxeTable from '@/components/vxeTable/index.vue'
import { useRouter } from 'vue-router'
import { reportList, reportPrintPdf, reportResult, reportMedList, reportFsresult } from '@/api/checkCode/index'
import dayjs from 'dayjs';

View File

@ -36,7 +36,7 @@
</el-form-item>
</el-form>
<div style="height: 60vh;">
<VxeTable ref="tableRef" :loading="loading" :data="tableData" :columns="columns" :enable-column-drag="true"
<CustomVxeTable ref="tableRef" :loading="loading" :data="tableData" :columns="columns" :enable-column-drag="true"
:scrollYConfig="{ enabled: true, rSize: 30, height: '100%', }" @column-drag-end="handleColumnDragEnd"
:config="tableConfig" @current-change="rowClick" class="mytable-style" @selection-change="selecChange">
<template #xmgl="{ row }">
@ -54,7 +54,7 @@
<template #yqdl="{ row }">
{{ formatDict(row.yqdl, 'YQDL') }}
</template>
</VxeTable>
</CustomVxeTable>
</div>
<template #footer>
<div class="dialog-footer">
@ -69,7 +69,7 @@
<script setup lang="ts">
import { formatDict, getDictData, dictData } from '@/hooks';
import SelectTable from '@/components/SelectTable/index.vue'
import VxeTable from '@/components/vxeTable/index.vue'
import CustomVxeTable from '@/components/vxeTable/index.vue'
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
import { queryBatchList, addBatch, delBatch } from '@/api/liswork/labItem/labItemApi'
import { ElMessage } from 'element-plus';

View File

@ -9,7 +9,7 @@
<el-col :span="12">
<el-input v-model="searchKey" ref="searchInput" size="small" placeholder="快速搜索(支持简拼)" class="mb5" clearable
@clear="filterDataHandle" @input="filterDataHandle" />
<VxeTable ref="tableRefs" :data="filterData" :columns="columns" class="mytable-style"
<CustomVxeTable ref="tableRefs" :data="filterData" :columns="columns" class="mytable-style"
:scrollYConfig="{ enabled: true, rSize: 30, height: '350', }" @current-change="rowHandle"
:enableColumnDrag="true" @column-drag-end="handleColumnDragEnd" />
</el-col>
@ -39,7 +39,7 @@
</template>
<script setup lang="ts">
import VxeTable from '@/components/vxeTable/index.vue'
import CustomVxeTable from '@/components/vxeTable/index.vue'
import { queryXmInfoNew } from '@/api/liswork/labItem/labItemApi'
import { getFirstLetter } from '@/utils/pinyin';

View File

@ -22,7 +22,7 @@
<el-col :span="12">
<el-input v-model="searchKey" ref="searchInput" size="small" placeholder="快速搜索(支持简拼)" class="mb5" clearable
@clear="filterDataHandle" @input="filterDataHandle" />
<VxeTable ref="tableRefs" :data="filterData" :columns="columnsDown" class="mytable-style"
<CustomVxeTable ref="tableRefs" :data="filterData" :columns="columnsDown" class="mytable-style"
:scrollYConfig="{ enabled: true, rSize: 30, height: '380', }" @current-change="rowHandleDown"
:enableColumnDrag="true" @column-drag-end="handleColumnDragEnd" />
</el-col>
@ -46,7 +46,7 @@
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import VxeTable from '@/components/vxeTable/index.vue'
import CustomVxeTable from '@/components/vxeTable/index.vue'
import { queryXmInfoNew, queryXmAlarmdetailNew, addXmAlarmdetailNew, delXmAlarmdetailNew } from '@/api/liswork/labItem/labItemApi'
import { XmAlarmdetailNew } from '@/types'
import { ElMessageBox, ElMessage } from 'element-plus'

View File

@ -57,7 +57,7 @@ const allClear = () => {
<style scoped lang="scss">
.table-container {
height: 100%;
height: calc(100% - 58px);
}
.table-toolbar {

View File

@ -204,12 +204,12 @@ watch(yq, (newVal) => {
if (newVal !== undefined) {
getList()
}
}, { immediate: true })
}, { deep: true })
</script>
<style scoped lang="scss">
.sys_box {
height: 100%;
height: calc(100% - 58px);
}
.table-toolbar {

View File

@ -204,12 +204,12 @@ watch(yq, (newVal) => {
if (newVal !== undefined) {
getList()
}
}, { immediate: true })
}, { deep: true })
</script>
<style scoped lang="scss">
.sys_box {
height: 100%;
height: calc(100% - 58px);
}
.table-toolbar {

View File

@ -140,7 +140,7 @@
<el-col :span="8">
<el-form-item label="默认模板" prop="mrmb">
<el-select v-model="formData.mrmb" style="width: 12rem;">
<el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" />
<!-- <el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" /> -->
</el-select>
</el-form-item>
</el-col>
@ -195,22 +195,20 @@
</el-table-column>
<el-table-column label="厂商" prop="sjcs">
<template #default="scope">
<el-select v-model="scope.row.sjcs" class="full-width-input">
<el-option label="请选择" value="" />
<el-select v-model="scope.row.sjcs" class="full-width-input" filterable allow-create>
<el-option v-for="item in cjList" :label="item.na" :value="item.no" />
</el-select>
</template>
</el-table-column>
<el-table-column label="有效期" prop="yxq">
<template #default="scope">
<el-date-picker v-model="scope.row.yxq" type="datetime" placeholder="0000:00:00 00:00"
format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DD HH:mm" style="width:100%" />
<el-date-picker v-model="scope.row.yxq" type="datetime" placeholder="0000:00:00 00:00:00"
format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="方法" prop="csff">
<template #default="scope">
<el-select v-model="scope.row.csff" class="full-width-input">
<el-option label="请选择" value="" />
</el-select>
<SelectTable v-model:data="scope.row.csff" :tableData="dictData.MD" class="full-width-input" />
</template>
</el-table-column>
</el-table>
@ -219,9 +217,10 @@
</template>
<script setup lang="ts">
import { queryFilter, addXmFilter, delXmFilter, addXmLot, delXmLot, queryXmLot } from '@/api/liswork/xtwh/ComOpt'
import { queryFilter, addXmFilter, delXmFilter, addXmLot, delXmLot, queryXmLot, querySjcs } from '@/api/liswork/xtwh/ComOpt'
import { ElMessage } from 'element-plus';
import { formatDict, dictData } from '@/hooks'
import { get } from 'lodash';
const yq = defineModel<string>()
@ -256,7 +255,6 @@ const rules = ref({
const form = ref();
const handleSave = () => {
console.log('保存')
form.value.validate((valid: boolean) => {
if (valid) {
console.log('submit!')
@ -314,8 +312,9 @@ interface sjList {
const sjShow = ref(false)
const sjtableData = ref<sjList[]>([])
const sjHandle = () => {
sjShow.value = true
getSjList()
getSjcjList()
sjShow.value = true
}
const sjRowClick = (row: any) => {
@ -323,30 +322,54 @@ const sjRowClick = (row: any) => {
}
const getSjList = () => {
selectRow.value = null
queryXmLot().then((res: any) => {
queryXmLot({ yq: yq.value }).then((res: any) => {
sjtableData.value = res.data
})
}
const sjsavaItem = () => {
sjtableData.value.forEach(item => {
item.yq = yq.value || ''
})
addXmLot(sjtableData.value).then((res: any) => {
if (res.code == 0) {
ElMessage.success('保存成功!')
getSjList()
getSjcjList()
}
})
}
const sjaddItem = () => {
sjtableData.value.push({
sjcs: '',
sjph: '',
yq: '',
yxq: '',
csff: ''
csff: '',
yq: yq.value || '',
})
}
const sjdelItem = () => {
if (!selectRow.value) return ElMessage.warning('请选择要删除的行!')
if (selectRow.value.sjph) {
delXmLot(selectRow.value)
}
sjtableData.value = sjtableData.value.filter(item => item.sjph != selectRow.value.sjph)
selectRow.value = null
}
const cjList = ref<Array<{ no: string, na: string }>>([])
const getSjcjList = () => {
querySjcs({ yq: yq.value }).then((res: any) => {
cjList.value = res.data
})
}
onMounted(() => {
})
watch(yq, (newVal) => {
getDzList()
}, { immediate: true })
getSjList()
}, { deep: true })
</script>
<style scoped lang="scss">

View File

@ -1,30 +1,55 @@
<template>
<!-- 整体排序 -->
<div class="sort_box">
<el-row :gutter="10" class="table-row">
<el-col :span="20" class="table-box">
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true"
@row-click="handleRowClick" @column-drag-end="handleColumnDragEnd" :config="tableConfig">
<template #xmgl="{ row }">
{{ formatDict(row.xmgl, 'XMGL') }}
</template>
<template #dyxh="{ row }">
<el-input v-model="row.dyxh" class="full-width-input" />
</template>
</CustomTable>
</el-col>
<el-col :span="4">
<el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5">
<el-button type="primary" @click="">首位</el-button>
<el-radio-group v-model="radio" @change="radioChange">
<el-radio value="1">上下移动调整</el-radio>
<el-radio value="2">手工输入工号</el-radio>
</el-radio-group>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="top" @click="">上移</el-button>
<el-button type="primary" @click="refresh">刷新</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="bottom" @click="">下移</el-button>
<el-button type="primary" @click="cpHandle">存盘</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" @click="">末位</el-button>
<el-button type="primary" :disabled="radio == '2'" @click="firstHandle">首位</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="top" :disabled="radio == '2'" @click="prevHandle">上移</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" icon="bottom" :disabled="radio == '2'" @click="nextHandle">下移</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" :disabled="radio == '2'" @click="lastHadnle">末位</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
<div class="table-row">
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd" :config="tableConfig" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { formatDict, dictData } from '@/hooks';
const props = defineProps({
dataList: {
@ -33,15 +58,24 @@ const props = defineProps({
}
});
const tableRef = ref<any>(null);
const dataList = ref([]);
interface DataItem {
xmgl: string | number;
xmid: string | number;
xmdh: string | number;
xmmc: string | number;
dyxh: string | number;
fzdyxh: string | number;
}
const currentIndex = ref(0);
const radio = ref('1');
const tableRef = ref();
const dataList = ref<DataItem[]>([]);
const columns = ref([
{ prop: 'xmgl', label: '项目类别', visible: true, align: 'center', },
{ prop: 'xmgl', label: '项目类别', visible: true, align: 'center', slot: "xmgl" },
{ prop: 'xmid', label: '项目ID', visible: true, align: 'center', },
{ prop: 'xmdh', label: '英文缩写', visible: true, align: 'center', },
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center', },
{ prop: 'dyxh', label: '整体排序', visible: true, align: 'center', },
{ prop: 'dyxh', label: '整体排序', visible: false, align: 'center', slot: "dyxh" },
{ prop: 'fzdyxh', label: '分组打印序号', visible: true, align: 'center', },
]);
const tableConfig = ref({
@ -56,28 +90,81 @@ const handleColumnDragEnd = (data: any) => {
// 更新列配置
columns.value = data.columns;
}
const handleRowClick = (row: DataItem) => {
currentIndex.value = dataList.value.indexOf(row);
}
const radioChange = (val: string) => {
if (val == '1') {
columns.value[4].visible = false
} else {
columns.value[4].visible = true
}
}
const refresh = () => {
}
const cpHandle = () => {
}
const firstHandle = () => {
currentIndex.value = 0;
tableRef.value.setCurrentRow(dataList.value[0]);
tableRef.value.setScrollTop(0)
}
const prevHandle = () => {
if (currentIndex.value == 0) return;
currentIndex.value--;
tableRef.value.setCurrentRow(dataList.value[currentIndex.value]);
tableRef.value.setScrollTop(currentIndex.value * 30)
}
const nextHandle = () => {
if (currentIndex.value == dataList.value.length - 1) return;
currentIndex.value++;
tableRef.value.setCurrentRow(dataList.value[currentIndex.value]);
tableRef.value.setScrollTop(currentIndex.value * 30)
}
const lastHadnle = () => {
currentIndex.value = dataList.value.length - 1;
tableRef.value.setCurrentRow(dataList.value[dataList.value.length - 1]);
tableRef.value.setScrollTop(dataList.value.length * 30)
}
onMounted(() => {
})
</script>
<style scoped lang="scss">
.sort_box {
height: 100%;
height: calc(100% - 58px);
padding-top: 8px;
}
.table-toolbar {
margin-bottom: 8px;
height: 36px;
line-height: 36px;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
.el-col {
width: 50%;
}
.el-button {
width: 80%;
margin-top: 20px;
}
}
.tips {
font-family: SourceHanSansCN, SourceHanSansCN;
font-size: 16px;
color: #409eff;
font-weight: 600;
}
.table-row {
height: calc(100% - 45px);
height: 100%;
flex: 3;
.table-box {
height: 100%;

View File

@ -44,7 +44,7 @@ import { ref, watch, nextTick, computed } from 'vue'
import { ElMessage, ElTree, TreeNode, ElMessageBox, ElBadge } from 'element-plus'
import { paramList, paramTree, getdef, updateParam } from '@/api/liswork/xtwh/ComOpt'
import { getFirstLetter } from '@/utils/pinyin'
import { formatDict, getDictData, dictData } from '@/hooks';
import SysGlobal from './components/sysGlobal/index.vue'
import SysInput from './components/sysInput/index.vue'
import SysReport from './components/sysReport/index.vue'
@ -239,7 +239,9 @@ const getDeptTree = async (): Promise<void> => {
onMounted(() => {
getDictData('XMGL', 'MD')
})
// ========== 初始化 ==========
getDeptTree()
</script>
@ -332,9 +334,6 @@ getDeptTree()
.table-col {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
// 仪器标题行样式
.yq-title-row {