检验项目界面功能修改
This commit is contained in:
parent
846442e93a
commit
c983532bc7
@ -29,6 +29,7 @@
|
||||
"js-cookie": "3.0.5",
|
||||
"jsbarcode": "^3.12.1",
|
||||
"jsencrypt": "3.3.2",
|
||||
"lodash": "^4.17.21",
|
||||
"mitt": "^3.0.1",
|
||||
"nprogress": "0.2.0",
|
||||
"pinia": "2.1.7",
|
||||
@ -50,6 +51,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.27.0",
|
||||
"@types/lodash": "^4.17.21",
|
||||
"@types/vue": "^2.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
||||
"@typescript-eslint/parser": "^8.46.2",
|
||||
|
||||
24
pnpm-lock.yaml
generated
24
pnpm-lock.yaml
generated
@ -56,6 +56,9 @@ importers:
|
||||
jsencrypt:
|
||||
specifier: 3.3.2
|
||||
version: 3.3.2
|
||||
lodash:
|
||||
specifier: ^4.17.21
|
||||
version: 4.17.21
|
||||
mitt:
|
||||
specifier: ^3.0.1
|
||||
version: 3.0.1
|
||||
@ -77,6 +80,9 @@ importers:
|
||||
sortablejs:
|
||||
specifier: ^1.14.0
|
||||
version: 1.14.0
|
||||
three:
|
||||
specifier: ^0.181.2
|
||||
version: 0.181.2
|
||||
vue:
|
||||
specifier: 3.5.23
|
||||
version: 3.5.23(typescript@5.9.3)
|
||||
@ -111,6 +117,9 @@ importers:
|
||||
'@eslint/js':
|
||||
specifier: ^9.27.0
|
||||
version: 9.27.0
|
||||
'@types/lodash':
|
||||
specifier: ^4.17.21
|
||||
version: 4.17.21
|
||||
'@types/vue':
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0(typescript@5.9.3)
|
||||
@ -599,8 +608,8 @@ packages:
|
||||
'@types/lodash-es@4.17.12':
|
||||
resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==}
|
||||
|
||||
'@types/lodash@4.17.20':
|
||||
resolution: {integrity: sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==}
|
||||
'@types/lodash@4.17.21':
|
||||
resolution: {integrity: sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ==}
|
||||
|
||||
'@types/minimatch@3.0.5':
|
||||
resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==}
|
||||
@ -2503,6 +2512,9 @@ packages:
|
||||
text-segmentation@1.0.3:
|
||||
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:
|
||||
resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==}
|
||||
|
||||
@ -3113,9 +3125,9 @@ snapshots:
|
||||
|
||||
'@types/lodash-es@4.17.12':
|
||||
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': {}
|
||||
|
||||
@ -3817,7 +3829,7 @@ snapshots:
|
||||
'@element-plus/icons-vue': 2.3.2(vue@3.5.23(typescript@5.9.3))
|
||||
'@floating-ui/dom': 1.6.13
|
||||
'@popperjs/core': '@sxzz/popperjs-es@2.11.7'
|
||||
'@types/lodash': 4.17.20
|
||||
'@types/lodash': 4.17.21
|
||||
'@types/lodash-es': 4.17.12
|
||||
'@vueuse/core': 9.13.0(vue@3.5.23(typescript@5.9.3))
|
||||
async-validator: 4.2.5
|
||||
@ -5355,6 +5367,8 @@ snapshots:
|
||||
dependencies:
|
||||
utrie: 1.0.2
|
||||
|
||||
three@0.181.2: {}
|
||||
|
||||
tiny-emitter@2.1.0: {}
|
||||
|
||||
to-object-path@0.3.0:
|
||||
|
||||
@ -104,3 +104,13 @@ export function deleteXmInfoVs(query:any){
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//删除检验项目
|
||||
export function deleteXmInfoService(query:any){
|
||||
return request({
|
||||
url: '/xminfo/del',
|
||||
method: 'delete',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -28,6 +28,10 @@ export const getDictData = async (...args: string[]) => {
|
||||
if(dictRefs.LF != undefined) dictData.value.LF = toRaw(dictRefs.LF.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.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) || [] //国标代码
|
||||
}
|
||||
|
||||
//字典数据格式化方法
|
||||
|
||||
4
src/types/Object.d.ts
vendored
4
src/types/Object.d.ts
vendored
@ -19,6 +19,10 @@ export interface DictData {
|
||||
LF?: Array<any>;
|
||||
BT?: Array<any>;
|
||||
SLZQ?: Array<any>;
|
||||
UT?: Array<any>;
|
||||
MD?: Array<any>;
|
||||
ITEMCLASS?: Array<any>;
|
||||
GBDM?: Array<any>;
|
||||
[key: string]: any[] | undefined; // 添加索引签名以支持动态访问
|
||||
}
|
||||
|
||||
|
||||
130
src/views/liswork/labItem/BatchInstrVs.vue
Normal file
130
src/views/liswork/labItem/BatchInstrVs.vue
Normal 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>
|
||||
@ -5,27 +5,26 @@
|
||||
<!-- 表单区域-->
|
||||
<el-form inline :model="queryParams" class="mb8" size="small">
|
||||
<el-form-item label="项目类别">
|
||||
<SelectTable v-model:data="queryParams.xmgl" :fields="xmglFields" :tableData="dictData.XMGL" label="label" value="value" objKey="value" width="140px" placeholder="项目类别"
|
||||
size="small"
|
||||
@getDataValue="getList"/>
|
||||
<SelectTable v-model:data="queryParams.xmgl" :fields="xmglFields" :tableData="dictData.XMGL" label="label"
|
||||
value="value" objKey="value" width="140px" placeholder="项目类别" size="small" @getDataValue="getList" />
|
||||
</el-form-item>
|
||||
<el-form-item label="细菌标志">
|
||||
<SelectTable v-model:data="queryParams.itemclass" :fields="itemclassFields" :tableData="dictData.ITEMCLASS" label="label" value="value" objKey="value" width="140px" placeholder="细菌标志"
|
||||
size="small"
|
||||
<SelectTable v-model:data="queryParams.itemclass" :fields="itemclassFields" :tableData="dictData.ITEMCLASS"
|
||||
label="label" value="value" objKey="value" width="140px" placeholder="细菌标志" size="small"
|
||||
@getDataValue="getList" />
|
||||
</el-form-item>
|
||||
<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="请选择仪器"
|
||||
size="small"
|
||||
<SelectTable v-model:data="queryParams.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc"
|
||||
value="yq" objKey="yq" :border="true" width="140px" placeholder="请选择仪器" size="small"
|
||||
@getDataValue="getList" />
|
||||
</el-form-item>
|
||||
<el-form-item label="快速查找">
|
||||
<el-input clearable placeholder="快速查找" v-model="queryParams.inputcode" prefix-icon="Search" style="width: 150px"
|
||||
@change="getList"/>
|
||||
<el-input clearable placeholder="快速查找" v-model="queryParams.inputcode" prefix-icon="Search"
|
||||
style="width: 150px" @change="getList" />
|
||||
</el-form-item>
|
||||
<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="仪器大类"
|
||||
size="small"
|
||||
<SelectTable v-model:data="queryParams.yqdl" :fields="yqdlFields" :tableData="dictData.YQDL" label="label"
|
||||
value="value" objKey="value" :border="true" width="140px" placeholder="仪器大类" size="small"
|
||||
@getDataValue="getList" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目ID">
|
||||
@ -45,15 +44,17 @@
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<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="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-col>
|
||||
</el-row>
|
||||
<!-- 表格区域-->
|
||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig" @row-click="rowChange">
|
||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowChange">
|
||||
<template #xmgl="{ row }">
|
||||
{{ formatDict(row.xmgl, 'XMGL') }}
|
||||
</template>
|
||||
@ -75,8 +76,10 @@
|
||||
<el-col :span="10" :xs="24">
|
||||
<tabView :tabList="tabList" v-model:activeTab="activeTab" @update:active-tab="updateActive" />
|
||||
<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>
|
||||
<BatchInstrVs v-show="batchInstrVsModel.visible" v-model="batchInstrVsModel" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -94,14 +97,15 @@ import Sort from './tab/Sort.vue'
|
||||
import Parameter from './tab/Parameter.vue';
|
||||
import ChannelNumber from './tab/ChannelNumber.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 { getGroupInstrdList } from '@/api/liswork/work/LisWork';
|
||||
import tabView from '@/components/tabViews/index.vue';
|
||||
import { LabInstr, XmInfoNew } from '@/types';
|
||||
import { formatDict, getDictData, dictData } from '@/hooks';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { datalink } from '../../../api/liswork/work/LisWork';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import BatchInstrVs from './BatchInstrVs.vue';
|
||||
import _ from 'lodash';
|
||||
|
||||
const xmlbList = ref<Array<any>>([
|
||||
{ label: '数值型', value: '1' },
|
||||
@ -196,13 +200,13 @@ const yqdlFields = ref([
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
])
|
||||
|
||||
//tab页数据
|
||||
const tabDataList = ref<any>([]);
|
||||
|
||||
//选中行数据
|
||||
const selectRow = ref();
|
||||
//明细数据
|
||||
const selectDetailRow = ref()
|
||||
const tableTabRef = ref()
|
||||
//tab页数据
|
||||
const modelParam = ref<any>({
|
||||
basicData: {},
|
||||
commonlyValuesData: [],
|
||||
@ -212,8 +216,29 @@ const modelParam = ref<any>({
|
||||
})
|
||||
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 = () => {
|
||||
getGroupInstrdList()
|
||||
@ -233,50 +258,94 @@ const getList = () => {
|
||||
dataList.value = res.data;
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
getDictData('XMGL','ITEMCLASS', 'YQDL');
|
||||
getList()
|
||||
getYqConfig();
|
||||
})
|
||||
|
||||
|
||||
//新增
|
||||
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 = () => {
|
||||
console.log('删除')
|
||||
const handleDel = async () => {
|
||||
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('删除对应')
|
||||
}
|
||||
|
||||
//保存
|
||||
const handleSave = async () => {
|
||||
const handleSave = async (flag: any) => {
|
||||
|
||||
switch(activeTab.value){
|
||||
case 'Basic':
|
||||
basic.value = true
|
||||
modelParam.value.basicData = tableTabRef.value.basicData;
|
||||
break;
|
||||
case 'CommonlyValues':
|
||||
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;
|
||||
//验证表单
|
||||
if (typeof tableTabRef.value.validate === 'function') {
|
||||
const valid = await tableTabRef.value.validate(); // 调用子组件的验证方法
|
||||
if (!valid) {
|
||||
ElMessage.error('表单验证失败,请检查输入项!');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await saveDataService({
|
||||
xmInfoNew: modelParam.value.basicData,
|
||||
xmDoubleRows: [],
|
||||
@ -289,15 +358,26 @@ const handleSave = async () => {
|
||||
xmInfoVsRows: modelParam.value.userInstrData,
|
||||
xmTextresultNewRows: modelParam.value.commonDescriptionsData
|
||||
})
|
||||
if (!flag) {
|
||||
rowChange(selectRow.value)
|
||||
}
|
||||
|
||||
if (basic.value) {
|
||||
await getList();
|
||||
getList();
|
||||
basic.value = false
|
||||
}
|
||||
|
||||
ElMessage.success('保存成功!')
|
||||
|
||||
// 保存后更新快照
|
||||
initialModelParam.value = _.cloneDeep(modelParam.value);
|
||||
hasUnsavedChanges.value = false;
|
||||
|
||||
}
|
||||
|
||||
const handleRefresh = () => {
|
||||
getList();
|
||||
}
|
||||
|
||||
//退拽属性
|
||||
const handleColumnDragEnd = (data: any) => {
|
||||
// 更新列配置
|
||||
@ -314,11 +394,43 @@ const changeStauts = () => {
|
||||
|
||||
// 选择行变化
|
||||
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;
|
||||
const res = await queryXmInfoNewDetailService(row.xmid, row.yq, row.xmdh)
|
||||
selectDetailRow.value = res.data
|
||||
console.log('选中行明细数据:', selectDetailRow.value)
|
||||
changeActiveTab()
|
||||
initialModelParam.value = _.cloneDeep(modelParam.value);
|
||||
hasUnsavedChanges.value = false;
|
||||
|
||||
//重置表单状态
|
||||
if (typeof tableTabRef.value.resetField === 'function') {
|
||||
tableTabRef.value.resetField();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//tab变化
|
||||
@ -328,6 +440,7 @@ const updateActive = () => {
|
||||
|
||||
|
||||
const changeActiveTab = () => {
|
||||
if (selectRow.value) {
|
||||
modelParam.value.basicData = toRaw(selectDetailRow.value.xmInfoNew || {});
|
||||
modelParam.value.commonlyValuesData = toRaw(selectDetailRow.value.xmValNewRows || []);
|
||||
modelParam.value.userInstrData = toRaw(selectDetailRow.value.xmInfoVsRows || []);
|
||||
@ -335,6 +448,15 @@ const changeActiveTab = () => {
|
||||
modelParam.value.referenceValueDetailsData = toRaw(selectDetailRow.value.xmRefNewRows || []);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
getDictData('XMGL', 'ITEMCLASS', 'YQDL');
|
||||
getList()
|
||||
getYqConfig();
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="css">
|
||||
|
||||
@ -5,19 +5,19 @@
|
||||
<el-button type="primary" @click="bClickAdd">增加</el-button>
|
||||
<el-button type="primary" @click="bClickDel">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="tableList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig" @row-click="handRowClick">
|
||||
<template #qz = {row}>
|
||||
<CustomTable ref="tableRef" :data="modelParam.commonlyValuesData" :columns="columns" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="handRowClick">
|
||||
<template #qz="{ row }">
|
||||
<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-select>
|
||||
</template>
|
||||
<template #jgbz = {row}>
|
||||
<template #jgbz="{ row }">
|
||||
<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-select>
|
||||
</template>
|
||||
<template #srm = {row}>
|
||||
<template #srm="{ row }">
|
||||
<el-input v-model="row.srm" class="full-width-input"></el-input>
|
||||
</template>
|
||||
</CustomTable>
|
||||
@ -30,18 +30,11 @@ import { dictData,getDictData } from '@/hooks';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { delXmValNewService } from '@/api/liswork/labItem/labItemApi'
|
||||
|
||||
// const props = defineProps({
|
||||
// formData: {
|
||||
// type: Object,
|
||||
// default: {}
|
||||
// }
|
||||
// });
|
||||
|
||||
const modelParam = defineModel<any>()
|
||||
const emit = defineEmits(['refreshTabData'])
|
||||
|
||||
const tableRef = ref<any>();
|
||||
const tableList = ref<any>();
|
||||
const columns = ref([
|
||||
{ prop: 'qz', label: '取值', visible: true, align: 'center', slot: 'qz', width: 200 },
|
||||
{ prop: 'srm', label: '快速输入码', visible: true, align: 'center', slot: 'srm', width: 100 },
|
||||
@ -63,17 +56,9 @@ const handleColumnDragEnd = (data: any) => {
|
||||
columns.value = data.columns;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => modelParam.value,
|
||||
(newVal:any) => {
|
||||
tableList.value = [...newVal.commonlyValuesData];
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
|
||||
//序号最大值
|
||||
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 = () => {
|
||||
@ -84,7 +69,7 @@ const bClickAdd = () => {
|
||||
jgbz: '',
|
||||
xh: maxXh.value + 1
|
||||
}
|
||||
tableList.value.push(newData);
|
||||
modelParam.value.commonlyValuesData.push(newData);
|
||||
|
||||
}
|
||||
|
||||
@ -111,15 +96,8 @@ onActivated(async ()=>{
|
||||
await getDictData('VA', 'LF')
|
||||
qzOptions.value = dictData.value.VA
|
||||
jgbzOptions.value = dictData.value.LF
|
||||
tableList.value = modelParam.value.commonlyValuesData || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
commonlyValuesData: tableList
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
@ -1,100 +1,106 @@
|
||||
<template>
|
||||
<!-- 基本资料 -->
|
||||
<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>
|
||||
<el-divider style="margin: 5px 0;" />
|
||||
<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="项目类别"
|
||||
size="small" />
|
||||
<SelectTable v-model:data="modelParam.basicData.xmgl" :fields="xmglFields" :tableData="dictData.XMGL"
|
||||
label="label" value="value" objKey="value" width="140px" placeholder="项目类别" size="small" />
|
||||
</el-form-item>
|
||||
<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 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 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 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 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 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 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 label="稀释倍数" prop="xsbs">
|
||||
<el-input placeholder="稀释倍数" v-model="formData.xsbs"></el-input>
|
||||
</el-form-item>
|
||||
<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="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 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 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 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 prop="uflag">
|
||||
<el-checkbox value="uflag">停用</el-checkbox>
|
||||
</el-form-item>
|
||||
<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 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 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 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 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 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 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 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 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 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>
|
||||
<span class="text-span">结果参考值计算:</span>
|
||||
<el-divider style="margin: 5px 0;" />
|
||||
<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 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 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-form-item>
|
||||
<el-form-item label="公式" prop="jsgs" label-width="40px">
|
||||
<el-input placeholder="公式" v-model="formData.jsgs"></el-input>
|
||||
<el-button v-show="formData.jsxm === 'Y'" type="primary" @click="calcGuildeClick">向导...</el-button>
|
||||
<el-input placeholder="公式" v-model="modelParam.basicData.jsgs"></el-input>
|
||||
<el-button v-show="modelParam.basicData.jsxm === 'Y'" type="primary" @click="calcGuildeClick">向导...</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox label="参考值与性别有关" v-model="ygxbCheck"></el-checkbox>
|
||||
@ -107,52 +113,55 @@
|
||||
<span class="text-span">医学审核条件:</span>
|
||||
<el-divider style="margin: 5px 0;" />
|
||||
<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 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 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 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>
|
||||
<!--报警条件-->
|
||||
<span class="text-span">报警条件</span>
|
||||
<el-divider style="margin: 5px 0;" />
|
||||
<el-form-item label="危急值">
|
||||
<el-input placeholder="上限极值" v-model="formData.hlimt"></el-input>
|
||||
<el-input placeholder="下限极值" v-model="formData.llimit"></el-input>
|
||||
<el-input placeholder="上限极值" v-model="modelParam.basicData.hlimt"></el-input>
|
||||
<el-input placeholder="下限极值" v-model="modelParam.basicData.llimit"></el-input>
|
||||
<el-button type="primary" @click="conditionClick">特定条件</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="复查">
|
||||
<el-input placeholder="上限极值" v-model="formData.redoxx"></el-input>
|
||||
<el-input placeholder="下限极值" v-model="formData.redosx"></el-input>
|
||||
<el-input placeholder="上限极值" v-model="modelParam.basicData.redoxx"></el-input>
|
||||
<el-input placeholder="下限极值" v-model="modelParam.basicData.redosx"></el-input>
|
||||
</el-form-item>
|
||||
<span class="text-span">其他参数</span>
|
||||
<el-divider style="margin: 5px 0;" />
|
||||
<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 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 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 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 label="外部代码5">
|
||||
<el-input v-model="formData.val5"></el-input>
|
||||
<el-input v-model="modelParam.basicData.val5"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<MultiRef :refData="formData.dyckz" v-model:dialog-table-visible="mulitDialogTableVisible" @closeWithReturn="closeWithReturnMultiRef" />
|
||||
<CalcGuilde v-model="calcDialogTableVisible" :form-data="formData" :text="formData.jsgs" @confirm="handleDialogConfirm"/>
|
||||
<Condition v-model="conditionTabVisible" :form-data="formData"/>
|
||||
<MultiRef :refData="modelParam.basicData.dyckz" v-model:dialog-table-visible="mulitDialogTableVisible"
|
||||
@closeWithReturn="closeWithReturnMultiRef" />
|
||||
<CalcGuilde v-model="calcDialogTableVisible" :form-data="modelParam.basicData" :text="modelParam.basicData.jsgs"
|
||||
@confirm="handleDialogConfirm" />
|
||||
<Condition v-model="conditionTabVisible" :form-data="modelParam.basicData" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@ -163,18 +172,13 @@ import MultiRef from './child/MultiRef.vue';
|
||||
import CalcGuilde from './child/CalcGuilde.vue';
|
||||
import SelectTable from '@/components/SelectTable/index.vue'
|
||||
import Condition from './child/Condition.vue';
|
||||
|
||||
// const props = defineProps({
|
||||
// dataList: {
|
||||
// type: Object , //Object as PropType<XmInfoNew>
|
||||
// required: false
|
||||
// }
|
||||
// });
|
||||
//@ts-ignore
|
||||
import { getFirstLetter } from '@/utils/pinyin.js';
|
||||
|
||||
const modelParam = defineModel<any>()
|
||||
|
||||
const formRef = ref();
|
||||
const formData = ref<any>({});
|
||||
const disabled = ref(true);
|
||||
const mulitDialogTableVisible = ref(false)
|
||||
const calcDialogTableVisible = ref(false)
|
||||
const conditionTabVisible = ref(false)
|
||||
@ -182,120 +186,174 @@ const xmglFields = ref([
|
||||
{ prop: 'value', label: '代号', width: 80, 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(() => {
|
||||
switch(formData.value.jgbz){
|
||||
switch (modelParam.value.basicData.jgbz) {
|
||||
case '1':
|
||||
formData.value.cp_jgz = formData.value.jgz;
|
||||
modelParam.value.basicData.cp_jgz = modelParam.value.basicData.jgz;
|
||||
break;
|
||||
case '2':
|
||||
formData.value.cp_jgz = formData.value.jgz + '%';
|
||||
modelParam.value.basicData.cp_jgz = modelParam.value.basicData.jgz + '%';
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
const jsxmCheck = computed({
|
||||
get() {
|
||||
return formData.value.jsxm === 'Y'
|
||||
return modelParam.value.basicData.jsxm === 'Y'
|
||||
},
|
||||
set(checked: boolean) {
|
||||
formData.value.jsxm = checked ? 'Y' : 'N';
|
||||
modelParam.value.basicData.jsxm = checked ? 'Y' : 'N';
|
||||
}
|
||||
})
|
||||
|
||||
const ygzqCheck = computed({
|
||||
get() {
|
||||
return formData.value.ygzq === 'Y'
|
||||
return modelParam.value.basicData.ygzq === 'Y'
|
||||
},
|
||||
set(checked: boolean) {
|
||||
formData.value.ygzq = checked ? 'Y' : 'N';
|
||||
modelParam.value.basicData.ygzq = checked ? 'Y' : 'N';
|
||||
}
|
||||
})
|
||||
|
||||
const ygzdCheck = computed({
|
||||
get() {
|
||||
return formData.value.ygzd === 'Y'
|
||||
return modelParam.value.basicData.ygzd === 'Y'
|
||||
},
|
||||
set(checked: boolean) {
|
||||
formData.value.ygzd = checked ? 'Y' : 'N';
|
||||
modelParam.value.basicData.ygzd = checked ? 'Y' : 'N';
|
||||
}
|
||||
})
|
||||
|
||||
const ygbbCheck = computed({
|
||||
get() {
|
||||
return formData.value.ygbb === 'Y'
|
||||
return modelParam.value.basicData.ygbb === 'Y'
|
||||
},
|
||||
set(checked: boolean) {
|
||||
formData.value.ygbb = checked ? 'Y' : 'N';
|
||||
modelParam.value.basicData.ygbb = checked ? 'Y' : 'N';
|
||||
}
|
||||
})
|
||||
|
||||
const ygnlCheck = computed({
|
||||
get() {
|
||||
return formData.value.ygnl === 'Y'
|
||||
return modelParam.value.basicData.ygnl === 'Y'
|
||||
},
|
||||
set(checked: boolean) {
|
||||
formData.value.ygnl = checked ? 'Y' : 'N';
|
||||
modelParam.value.basicData.ygnl = checked ? 'Y' : 'N';
|
||||
}
|
||||
})
|
||||
|
||||
const ygxbCheck = computed({
|
||||
get() {
|
||||
return formData.value.ygxb === 'Y'
|
||||
return modelParam.value.basicData.ygxb === 'Y'
|
||||
},
|
||||
set(checked: boolean) {
|
||||
formData.value.ygxb = checked ? 'Y' : 'N';
|
||||
modelParam.value.basicData.ygxb = checked ? 'Y' : 'N';
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => modelParam.value,
|
||||
(newVal:any) => {
|
||||
formData.value = {...newVal.basicData};
|
||||
},
|
||||
{ immediate: true,deep: true }
|
||||
);
|
||||
const updatedyckz = () => {
|
||||
modelParam.value.basicData.dyckz = !modelParam.value.basicData.ckxx && !modelParam.value.basicData.cksx ? '' : `${modelParam.value.basicData.ckxx}--${modelParam.value.basicData.cksx}`;
|
||||
}
|
||||
|
||||
|
||||
//多行参考值
|
||||
const multiRefClick = () => {
|
||||
if(formData.value.dyckz){
|
||||
if (modelParam.value.basicData.dyckz) {
|
||||
mulitDialogTableVisible.value = true
|
||||
}
|
||||
}
|
||||
|
||||
const closeWithReturnMultiRef = (val: string) => {
|
||||
formData.value.dyckz = val;
|
||||
modelParam.value.basicData.dyckz = val;
|
||||
mulitDialogTableVisible.value = false;
|
||||
}
|
||||
|
||||
const handleDialogConfirm = (val: string) => {
|
||||
formData.value.jsgs = val;
|
||||
modelParam.value.basicData.jsgs = val;
|
||||
calcDialogTableVisible.value = false
|
||||
}
|
||||
|
||||
//计算向导
|
||||
const calcGuildeClick = () => {
|
||||
if(formData.value.jsxm){
|
||||
if (modelParam.value.basicData.jsxm) {
|
||||
calcDialogTableVisible.value = true
|
||||
}
|
||||
|
||||
}
|
||||
//危急值特定条件
|
||||
const conditionClick = () => {
|
||||
if(formData.value.xmid){
|
||||
if (modelParam.value.basicData.xmid) {
|
||||
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 () => {
|
||||
await getDictData('XMGL');
|
||||
await getDictData('XMGL', 'UT', 'YQDL', 'MD', 'ITEMCLASS', 'GBDM');
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
// 暴露验证方法(关键步骤)
|
||||
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>
|
||||
|
||||
@ -305,16 +363,19 @@ defineExpose({
|
||||
padding: 10px;
|
||||
background-color: #f5f7fa;
|
||||
height: auto;
|
||||
|
||||
.el-input {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.text-span {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
display: block;
|
||||
}
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
<el-button type="primary" @click="onAddClick">增加</el-button>
|
||||
<el-button type="primary" @click="onDelClick">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="tableList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig" @row-click="rowClick">
|
||||
<CustomTable ref="tableRef" :data="modelParam.commonDescriptionsData" :columns="columns" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowClick">
|
||||
<template #textresult="{ row }">
|
||||
<el-input type="textarea" v-model="row.textresult" class="full-width-input" autosize></el-input>
|
||||
</template>
|
||||
@ -22,18 +22,9 @@ import { ElMessageBox } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { delXmTextresultNew } from '@/api/liswork/labItem/labItemApi';
|
||||
|
||||
|
||||
// const props = defineProps({
|
||||
// formData: {
|
||||
// type: Object,
|
||||
// default: {}
|
||||
// }
|
||||
// });
|
||||
|
||||
const modelParam = defineModel<any>()
|
||||
|
||||
const tableRef = ref();
|
||||
const tableList = ref<Array<XmTextresultNew>>([])
|
||||
const columns = ref([
|
||||
{ prop: 'textresult', label: '文字描述', visible: true, align: 'center', slot: 'textresult', width: 500, showOverflowTooltip: false },
|
||||
]);
|
||||
@ -56,17 +47,9 @@ const emit = defineEmits(['refreshTabData'])
|
||||
|
||||
//序号最大值
|
||||
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) => {
|
||||
selectRow.value = row
|
||||
}
|
||||
@ -78,7 +61,7 @@ const onAddClick = () => {
|
||||
xmdh: modelParam.value.basicData.xmdh,
|
||||
xh: maxXh.value + 1
|
||||
}
|
||||
tableList.value.push(newData)
|
||||
modelParam.value.commonDescriptionsData.push(newData)
|
||||
}
|
||||
|
||||
const onDelClick = async () => {
|
||||
@ -92,11 +75,6 @@ const onDelClick = async ()=> {
|
||||
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
commonDescriptionsData: tableList
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -5,66 +5,46 @@
|
||||
<el-button type="primary" @click="onAddClick">增加</el-button>
|
||||
<el-button type="primary" @click="onDelClick">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRefUp" :data="dataListUp" :columns="columnsUp" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig" @row-click="rowClick">
|
||||
<CustomTable ref="tableRefUp" :data="modelParam.referenceValueDetailsData" :columns="columnsUp"
|
||||
:enable-column-drag="true" @column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowClick">
|
||||
<template #xb="{ row }">
|
||||
<el-select v-model="row.xb" clearable>
|
||||
<el-option
|
||||
v-for="item in optionsXb"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-option v-for="item in optionsXb" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #cp_nl1="{row}">
|
||||
<el-input v-model="row.cp_nl1" class="full-width-input"></el-input>
|
||||
<template #nl1="{ row }">
|
||||
<el-input v-model="row.nl1" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #cp_nldw1="{ row }">
|
||||
<el-select v-model="row.cp_nldw1" clearable>
|
||||
<el-option
|
||||
v-for="item in optionsNLDW"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-select v-model="row.nldw" clearable>
|
||||
<el-option v-for="item in optionsNLDW" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #cp_nl2="{row}">
|
||||
<el-input v-model="row.cp_nl2" class="full-width-input"></el-input>
|
||||
<template #nl2="{ row }">
|
||||
<el-input v-model="row.nl2" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #cp_nldw2="{ row }">
|
||||
<el-select v-model="row.cp_nldw2" clearable>
|
||||
<el-option
|
||||
v-for="item in optionsNLDW"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-select v-model="row.nldw" clearable>
|
||||
<el-option v-for="item in optionsNLDW" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #bblx="{ row }">
|
||||
<SelectTable v-model:data="row.bblx" :fields="fields" :tableData="bblxOptions" label="label"
|
||||
value="label" objKey="label" :border="true" />
|
||||
<SelectTable v-model:data="row.bblx" :fields="fields" :tableData="bblxOptions" label="label" value="label"
|
||||
objKey="label" :border="true" />
|
||||
</template>
|
||||
<template #slzq="{ row }">
|
||||
<el-select v-model="row.slzq" clearable>
|
||||
<el-option
|
||||
v-for="item in optionsSLZQ"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-option v-for="item in optionsSLZQ" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #zd="{ row }">
|
||||
<el-input v-model="row.zd" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<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 #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 #alterxx="{ row }">
|
||||
<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>
|
||||
</template>
|
||||
<template #dyck="{ row }">
|
||||
{{ !row.ckxx && !row.cksx ? '':row.ckxx + '--' + row.cksx }}
|
||||
<el-text class="mx-1">{{ row.dyck }}</el-text>
|
||||
</template>
|
||||
</CustomTable>
|
||||
<el-row>
|
||||
@ -83,8 +63,8 @@
|
||||
<el-button type="primary" @click="">增加</el-button>
|
||||
<el-button type="primary" @click="">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRefDown" :data="dataListDown" :columns="columnsDown" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig"/>
|
||||
<CustomTable ref="tableRefDown" :data="dataListDown" :columns="columnsDown" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -95,14 +75,9 @@ import {getDictData,dictData} from '@/hooks'
|
||||
import SelectTable from '@/components/SelectTable/index.vue'
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
|
||||
// const props = defineProps({
|
||||
// dataList: {
|
||||
// type: Array,
|
||||
// default: []
|
||||
// }
|
||||
// });
|
||||
|
||||
const modelParam = defineModel<any>()
|
||||
const emit = defineEmits(['refreshTabData'])
|
||||
|
||||
const optionsXb = [
|
||||
{ value: '1', label: '男' },
|
||||
@ -128,16 +103,16 @@ const bblxOptions = ref<Array<{ zddh: string; zdmc: string }>>([]);
|
||||
|
||||
const tableRefUp = ref<any>();
|
||||
const tableRefDown = ref<any>();
|
||||
const dataListUp = ref();
|
||||
// const dataListUp = ref();
|
||||
const dataListDown = ref();
|
||||
const columnsUp = ref([
|
||||
{ prop: 'xmid', label: 'xmid', visible: false, align: 'center' },
|
||||
{ prop: 'xh', label: '序号', visible: false, align: 'center' },
|
||||
{ prop: 'xb', label: '性别', visible: true, align: 'center', slot: 'xb', width: 70 },
|
||||
{ prop: 'nl1', label: '年龄下限', visible: true, align: 'center',slot:'cp_nl1', width: 100 },
|
||||
{ prop: 'cp_nldw1', label: '年龄单位', visible: true, align: 'center',slot:'cp_nldw1', width: 70 },
|
||||
{ prop: 'nl2', label: '年龄上限', visible: true, align: 'center',slot: 'cp_nl2', width: 100 },
|
||||
{ prop: 'cp_nldw2', label: '年龄单位', visible: true, align: 'center',slot: 'cp_nldw2', width: 100 },
|
||||
{ prop: 'nl1', label: '年龄下限', visible: true, align: 'center', slot: 'nl1', width: 70 },
|
||||
{ prop: 'nldw', label: '年龄单位', visible: true, align: 'center', slot: 'cp_nldw1', width: 70 },
|
||||
{ prop: 'nl2', label: '年龄上限', visible: true, align: 'center', slot: 'nl2', width: 70 },
|
||||
{ prop: 'nldw', label: '年龄单位', visible: true, align: 'center', slot: 'cp_nldw2', width: 70 },
|
||||
{ prop: 'bblx', label: '标本类型', visible: true, align: 'center', slot: 'bblx', width: 100 },
|
||||
{ prop: 'slzq', label: '生理周期', visible: true, align: 'center', slot: 'slzq', width: 100 },
|
||||
{ prop: 'zd', label: '诊断', visible: true, align: 'center', slot: 'zd', width: 100 },
|
||||
@ -180,16 +155,12 @@ const handleColumnDragEnd = (data: any) => {
|
||||
|
||||
//序号最大值
|
||||
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(
|
||||
() => modelParam.value,
|
||||
(newVal:any) => {
|
||||
dataListUp.value = [...newVal.referenceValueDetailsData];
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
const updateDyck = (row: any) => {
|
||||
row.dyck = !row.ckxx && !row.cksx ? '' : `${row.ckxx}--${row.cksx}`;
|
||||
}
|
||||
|
||||
const onAddClick = () => {
|
||||
const newData = {
|
||||
@ -197,15 +168,14 @@ const onAddClick = () => {
|
||||
yq: '0',
|
||||
xh: maxXh.value + 1
|
||||
}
|
||||
dataListUp.value.push(newData)
|
||||
modelParam.value.referenceValueDetailsData.push(newData)
|
||||
}
|
||||
|
||||
const onDelClick = async () => {
|
||||
console.log('删除',selectRow.value)
|
||||
if (selectRow.value) {
|
||||
await ElMessageBox.confirm('是否要删除选中的数据?', '警告',
|
||||
{ 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 || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
referenceValueDetailsData: dataListUp
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
<el-button type="primary" @click="onClickAdd">新增</el-button>
|
||||
<el-button type="primary" @click="onClickDel">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="yqList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig" @row-click="onRowClick">
|
||||
<CustomTable ref="tableRef" :data="modelParam.userInstrData" :columns="columns" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="onRowClick">
|
||||
<template #yq="{ row }">
|
||||
<YQSelectTable v-model:data="row.yq" placeholder="请输入仪器名称" />
|
||||
</template>
|
||||
@ -37,19 +37,9 @@ import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { deleteXmInfoVs } from '@/api/liswork/labItem/labItemApi';
|
||||
|
||||
// const props = defineProps({
|
||||
// formData: {
|
||||
// type: Object,
|
||||
// required: false,
|
||||
// default: {}
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
const modelParam = defineModel<any>()
|
||||
//const yq = ref<string>('');
|
||||
const tableRef = ref<any>();
|
||||
const yqList = ref<Array<XmInfoVs>>([]);
|
||||
const columns = ref([
|
||||
{ prop: 'vsid', label: '对照编码', visible: false, align: 'center' },
|
||||
{ prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 150 },
|
||||
@ -70,14 +60,6 @@ const selectRow = ref<XmInfoVs>({
|
||||
xmid: 0
|
||||
})
|
||||
|
||||
watch(
|
||||
() => modelParam.value,
|
||||
(newVal:any) => {
|
||||
yqList.value = [...newVal.userInstrData];
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['refreshTabData'])
|
||||
|
||||
//退拽属性
|
||||
@ -87,12 +69,7 @@ const handleColumnDragEnd = (data: any) => {
|
||||
}
|
||||
|
||||
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 = () => {
|
||||
@ -100,7 +77,7 @@ const onClickAdd = () => {
|
||||
yq: '',
|
||||
xmid: modelParam.value.basicData.xmid,
|
||||
}
|
||||
yqList.value.push(newData)
|
||||
modelParam.value.userInstrData.push(newData)
|
||||
}
|
||||
|
||||
const onClickDel = async () => {
|
||||
@ -133,8 +110,4 @@ onActivated(() =>{
|
||||
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
userInstrData: yqList
|
||||
})
|
||||
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user