This commit is contained in:
wyuu 2025-12-03 18:06:17 +08:00
commit c484ddb42f
8 changed files with 164 additions and 115 deletions

View File

@ -85,3 +85,22 @@ export function delXmValNewService(query:any){
}) })
} }
//删除常见描述
export function delXmTextresultNew(query:any){
return request({
url: '/xminfo/delXmTextresultNew',
method: 'get',
params: query
})
}
//删除仪器对照
export function deleteXmInfoVs(query:any){
return request({
url: '/xminfo/delvs',
method: 'delete',
params: query
})
}

View File

@ -120,6 +120,7 @@ export class XmValNew {
} }
export class XmInfoVs { export class XmInfoVs {
vsid?: number;
yq: string; yq: string;
xmid: number; xmid: number;
xs?: number; xs?: number;

View File

@ -101,6 +101,7 @@ import tabView from '@/components/tabViews/index.vue';
import { LabInstr,XmInfoNew } from '@/types'; import { LabInstr,XmInfoNew } from '@/types';
import { formatDict,getDictData,dictData } from '@/hooks'; import { formatDict,getDictData,dictData } from '@/hooks';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { datalink } from '../../../api/liswork/work/LisWork';
const xmlbList = ref<Array<any>>([ const xmlbList = ref<Array<any>>([
{ label: '数值型', value: '1' }, { label: '数值型', value: '1' },
@ -209,6 +210,7 @@ const modelParam = ref<any>({
commonDescriptionsData: [], commonDescriptionsData: [],
referenceValueDetailsData: [] referenceValueDetailsData: []
}) })
const basic = ref<boolean>(false)
@ -256,6 +258,25 @@ const handleDelCorr = () => {
//保存 //保存
const handleSave = async () => { const handleSave = async () => {
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;
}
await saveDataService({ await saveDataService({
xmInfoNew: modelParam.value.basicData, xmInfoNew: modelParam.value.basicData,
xmDoubleRows: [], xmDoubleRows: [],
@ -268,7 +289,14 @@ const handleSave = async () => {
xmInfoVsRows: modelParam.value.userInstrData, xmInfoVsRows: modelParam.value.userInstrData,
xmTextresultNewRows: modelParam.value.commonDescriptionsData xmTextresultNewRows: modelParam.value.commonDescriptionsData
}) })
rowChange(selectRow.value)
if(basic.value){
await getList();
basic.value = false
}
ElMessage.success('保存成功!') ElMessage.success('保存成功!')
} }
//退拽属性 //退拽属性
const handleColumnDragEnd = (data: any) => { const handleColumnDragEnd = (data: any) => {
@ -289,59 +317,22 @@ const rowChange = async (row: any) => {
selectRow.value = row; selectRow.value = row;
const res = await queryXmInfoNewDetailService(row.xmid,row.yq,row.xmdh) const res = await queryXmInfoNewDetailService(row.xmid,row.yq,row.xmdh)
selectDetailRow.value = res.data selectDetailRow.value = res.data
console.log('明细数据:', res); console.log('选中行明细数据:',selectDetailRow.value)
changeActiveTab() changeActiveTab()
} }
//tab变化 //tab变化
const updateActive = () => { const updateActive = () => {
changeActiveTab() changeActiveTab()
} }
const changeActiveTab = () => { const changeActiveTab = () => {
switch(activeTab.value){ modelParam.value.basicData = toRaw(selectDetailRow.value.xmInfoNew || {});
case 'Basic': modelParam.value.commonlyValuesData = toRaw(selectDetailRow.value.xmValNewRows || []);
if(selectDetailRow.value.xmInfoNew){ modelParam.value.userInstrData = toRaw(selectDetailRow.value.xmInfoVsRows || []);
modelParam.value = toRaw(selectDetailRow.value.xmInfoNew || {}); modelParam.value.commonDescriptionsData = toRaw(selectDetailRow.value.xmTextresultNewRows || []);
// basicData.value = tableTabRef.value.basicData || [] modelParam.value.referenceValueDetailsData = toRaw(selectDetailRow.value.xmRefNewRows || []);
}else{
//basicData.value = []
}
break;
case 'CommonlyValues':
if(selectDetailRow.value.xmValNewRows){
console.log('selectDetailRow.value.xmValNewRows',selectDetailRow.value.xmValNewRows)
modelParam.value.commonlyValuesData = toRaw(selectDetailRow.value.xmValNewRows || []);
}else{
modelParam.value.commonlyValuesData = []
}
break;
case 'UseInstr':
if(selectDetailRow.value.xmInfoVsRows.length){
tabDataList.value = selectDetailRow.value.xmInfoVsRows[0] || [];
}else{
tabDataList.value = []
}
break;
case 'Knowledge':
//tabDataList.value = res.data.xmInfoVsRows[0];
case 'Sort':
case 'CommonDescriptions':
if(selectDetailRow.value.xmTextresultNewRows.length){
tabDataList.value = selectDetailRow.value.xmTextresultNewRows[0] || [];
}else{
tabDataList.value = []
}
break;
case 'ReferenceValueDetails':
if(selectDetailRow.value.xmRefNewRows.length){
tabDataList.value = selectDetailRow.value.xmRefNewRows[0] || [];
}else{
tabDataList.value = []
}
break;
}
} }
</script> </script>

View File

@ -30,12 +30,12 @@ import { dictData,getDictData } from '@/hooks';
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
import {delXmValNewService} from '@/api/liswork/labItem/labItemApi' import {delXmValNewService} from '@/api/liswork/labItem/labItemApi'
const props = defineProps({ // const props = defineProps({
formData: { // formData: {
type: Object, // type: Object,
default: {} // default: {}
} // }
}); // });
const modelParam = defineModel<any>() const modelParam = defineModel<any>()
const emit = defineEmits(['refreshTabData']) const emit = defineEmits(['refreshTabData'])
@ -78,7 +78,7 @@ const maxXh = computed(() => {
const bClickAdd = () => { const bClickAdd = () => {
const newData = { const newData = {
xmid: props.formData.xmid, xmid: modelParam.value.basicData.xmid,
qz: '', qz: '',
srm: '', srm: '',
jgbz: '', jgbz: '',
@ -94,8 +94,8 @@ const bClickDel = async () => {
{confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}); {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'});
//删掉界面上面的数据 //删掉界面上面的数据
//tableList.value = tableList.value?.filter((item:any) => item.xh != selectRow.value.xh ); //tableList.value = tableList.value?.filter((item:any) => item.xh != selectRow.value.xh );
await delXmValNewService({xmid:props.formData.xmid,xh:selectRow.value.xh}) await delXmValNewService({xmid:modelParam.value.basicData.xmid,xh:selectRow.value.xh})
emit('refreshTabData',props.formData) emit('refreshTabData',modelParam.value.basicData)
} }
@ -114,6 +114,10 @@ onActivated(async ()=>{
tableList.value = modelParam.value.commonlyValuesData || [] tableList.value = modelParam.value.commonlyValuesData || []
}) })
defineExpose({
commonlyValuesData: tableList
})
</script> </script>

View File

@ -164,12 +164,12 @@ import CalcGuilde from './child/CalcGuilde.vue';
import SelectTable from '@/components/SelectTable/index.vue' import SelectTable from '@/components/SelectTable/index.vue'
import Condition from './child/Condition.vue'; import Condition from './child/Condition.vue';
const props = defineProps({ // const props = defineProps({
dataList: { // dataList: {
type: Object , //Object as PropType<XmInfoNew> // type: Object , //Object as PropType<XmInfoNew>
required: false // required: false
} // }
}); // });
const modelParam = defineModel<any>() const modelParam = defineModel<any>()
@ -251,7 +251,7 @@ const ygxbCheck = computed({
watch( watch(
() => modelParam.value, () => modelParam.value,
(newVal:any) => { (newVal:any) => {
formData.value = {...newVal }; formData.value = {...newVal.basicData};
}, },
{ immediate: true,deep: true } { immediate: true,deep: true }
); );
@ -292,6 +292,11 @@ onActivated(async () => {
await getDictData('XMGL'); await getDictData('XMGL');
}) })
defineExpose({
basicData: formData
})
</script> </script>

View File

@ -20,18 +20,17 @@ import CustomTable from '@/components/elTable/index.vue'
import { XmTextresultNew } from '@/types'; import { XmTextresultNew } from '@/types';
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
import { ref } from 'vue'; import { ref } from 'vue';
import { delXmTextresultNew } from '@/api/liswork/labItem/labItemApi';
const props = defineProps({ // const props = defineProps({
dataList: { // formData: {
type: Array, // type: Object,
default: () => [] // default: {}
}, // }
formData: { // });
type: Object,
default: {} const modelParam = defineModel<any>()
}
});
const tableRef = ref(); const tableRef = ref();
const tableList = ref<Array<XmTextresultNew>>([]) const tableList = ref<Array<XmTextresultNew>>([])
@ -53,12 +52,21 @@ const handleColumnDragEnd = (data: any) => {
} }
const selectRow = ref() const selectRow = ref()
const emit = defineEmits(['refreshTabData'])
//序号最大值 //序号最大值
const maxXh = computed(() => { const maxXh = computed(() => {
return tableList.value.length > 0 ? Math.max(...tableList.value.map((item:any) => item.xh || 0)) : 0; return tableList.value.length > 0 ? Math.max(...tableList.value.map((item:any) => item.xh || 0)) : 0;
}); });
watch(
() => modelParam.value,
(newVal:any) => {
tableList.value = [...newVal.commonDescriptionsData];
},
{ immediate: true, deep: true }
);
const rowClick = (row:any) => { const rowClick = (row:any) => {
selectRow.value = row selectRow.value = row
} }
@ -66,8 +74,8 @@ const rowClick = (row:any) => {
const onAddClick = () => { const onAddClick = () => {
const newData: XmTextresultNew = { const newData: XmTextresultNew = {
xmid: props.formData.xmid, xmid: modelParam.value.basicData.xmid,
xmdh: props.formData.xmdh, xmdh: modelParam.value.basicData.xmdh,
xh: maxXh.value + 1 xh: maxXh.value + 1
} }
tableList.value.push(newData) tableList.value.push(newData)
@ -77,19 +85,13 @@ const onDelClick = async ()=> {
if(selectRow.value){ if(selectRow.value){
await ElMessageBox.confirm('是否要删除选中的数据?','警告', await ElMessageBox.confirm('是否要删除选中的数据?','警告',
{ confirmButtonText: 'OK',cancelButtonText: 'Cancel',type: 'warning',}); { confirmButtonText: 'OK',cancelButtonText: 'Cancel',type: 'warning',});
tableList.value = tableList.value.filter((item:any) => item.xh != selectRow.value.xh) //tableList.value = tableList.value.filter((item:any) => item.xh != selectRow.value.xh)
await delXmTextresultNew({xmid:modelParam.value.basicData.xmid,xh:selectRow.value.xh})
emit('refreshTabData',modelParam.value.basicData)
} }
} }
watch(
() => props.dataList,
(newVal:any) => {
tableList.value = newVal;
}
);
defineExpose({ defineExpose({
commonDescriptionsData: tableList commonDescriptionsData: tableList
}) })

View File

@ -73,7 +73,7 @@
<el-input v-model="row.altersx" class="full-width-input"></el-input> <el-input v-model="row.altersx" class="full-width-input"></el-input>
</template> </template>
<template #dyck="{row}"> <template #dyck="{row}">
{{ row.ckxx + '--' + row.cksx }} {{ !row.ckxx && !row.cksx ? '':row.ckxx + '--' + row.cksx }}
</template> </template>
</CustomTable> </CustomTable>
<el-row> <el-row>
@ -95,12 +95,14 @@ import {getDictData,dictData} from '@/hooks'
import SelectTable from '@/components/SelectTable/index.vue' import SelectTable from '@/components/SelectTable/index.vue'
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
const props = defineProps({ // const props = defineProps({
dataList: { // dataList: {
type: Array, // type: Array,
default: [] // default: []
} // }
}); // });
const modelParam = defineModel<any>()
const optionsXb = [ const optionsXb = [
{value: '1' ,label: '男'}, {value: '1' ,label: '男'},
@ -126,14 +128,15 @@ const bblxOptions = ref<Array<{ zddh: string; zdmc: string }>>([]);
const tableRefUp = ref<any>(); const tableRefUp = ref<any>();
const tableRefDown = ref<any>(); const tableRefDown = ref<any>();
const dataListUp = ref(props.dataList); const dataListUp = ref();
const dataListDown = ref(); const dataListDown = ref();
const columnsUp = ref([ const columnsUp = ref([
{ prop: 'xh', label: '序号', visible: false, align: 'center', width: 70 }, { 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: 'xb', label: '性别', visible: true, align: 'center',slot: 'xb', width: 70 },
{ prop: 'cp_nl1', label: '年龄下限', visible: true, align: 'center',slot:'cp_nl1', width: 100 }, { 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: 'cp_nldw1', label: '年龄单位', visible: true, align: 'center',slot:'cp_nldw1', width: 70 },
{ prop: 'cp_nl2', label: '年龄上限', visible: true, align: 'center',slot: 'cp_nl2', width: 100 }, { 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: 'cp_nldw2', label: '年龄单位', visible: true, align: 'center',slot: 'cp_nldw2', width: 100 },
{ prop: 'bblx', label: '标本类型', visible: true, align: 'center',slot: 'bblx', width: 100 }, { prop: 'bblx', label: '标本类型', visible: true, align: 'center',slot: 'bblx', width: 100 },
{ prop: 'slzq', label: '生理周期', visible: true, align: 'center',slot: 'slzq', width: 100 }, { prop: 'slzq', label: '生理周期', visible: true, align: 'center',slot: 'slzq', width: 100 },
@ -180,9 +183,18 @@ const maxXh = computed(() => {
return dataListUp.value.length > 0 ? Math.max(...dataListUp.value.map((item:any) => item.xh || 0)) : 0; return dataListUp.value.length > 0 ? Math.max(...dataListUp.value.map((item:any) => item.xh || 0)) : 0;
}); });
watch(
() => modelParam.value,
(newVal:any) => {
dataListUp.value = [...newVal.referenceValueDetailsData];
},
{ immediate: true, deep: true }
);
const onAddClick = () => { const onAddClick = () => {
const newData = { const newData = {
xmid: modelParam.value.basicData.xmid,
yq: '0',
xh: maxXh.value + 1 xh: maxXh.value + 1
} }
dataListUp.value.push(newData) dataListUp.value.push(newData)

View File

@ -14,16 +14,16 @@
<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 v-model="row.zkxm" /> <el-checkbox :checked="row.zkxm === '1'" @change="(val:any) => row.zkxm = val ? 1 : 0" />
</template>
<template #cksx="{row}">
<el-input v-model="row.cksx" class="full-width-input"></el-input>
</template> </template>
<template #ckxx="{row}"> <template #ckxx="{row}">
<el-input v-model="row.ckxx" class="full-width-input"></el-input> <el-input v-model="row.ckxx" class="full-width-input"></el-input>
</template> </template>
<template #cksx="{row}">
<el-input v-model="row.cksx" class="full-width-input"></el-input>
</template>
<template #dyckz="{row}"> <template #dyckz="{row}">
<el-input v-model="row.dyckz" class="full-width-input"></el-input> <el-input :model-value="getDyckz(row)" disabled class="full-width-input"></el-input>
</template> </template>
</CustomTable> </CustomTable>
</div> </div>
@ -35,32 +35,28 @@ import CustomTable from '@/components/elTable/index.vue'
import { XmInfoVs } from '@/types'; import { XmInfoVs } from '@/types';
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue' import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
import {ElMessageBox} from 'element-plus' import {ElMessageBox} from 'element-plus'
import { deleteXmInfoVs } from '@/api/liswork/labItem/labItemApi';
const props = defineProps({ // const props = defineProps({
// 显示数据 // formData: {
dataList: { // type: Object,
type: Array<XmInfoVs>, // required: false,
required: true, // default: {}
default: () => [] // }
}, // });
formData: {
type: Object,
required: false,
default: {}
}
});
const modelParam = defineModel<any>()
//const yq = ref<string>(''); //const yq = ref<string>('');
const tableRef = ref<any>(); const tableRef = ref<any>();
const yqList = ref<Array<XmInfoVs>>([]); const yqList = ref<Array<XmInfoVs>>([]);
const columns = ref([ const columns = ref([
{ prop: 'vsid', label: '对照编码', visible: false, align: 'center' },
{ prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 150 }, { prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 150 },
{ prop: 'xs', label: '调整系数', visible: true, align: 'center', slot: 'xs', width: 100 }, { prop: 'xs', label: '调整系数', visible: true, align: 'center', slot: 'xs', width: 100 },
{ prop: 'zkxm', label: '质控', visible: true, align: 'center', slot: 'zkxm', width: 40 }, { prop: 'zkxm', label: '质控', visible: true, align: 'center', slot: 'zkxm', width: 40 },
{ prop: 'cksx', label: '参考上限', visible: true, align: 'center',slot: 'cksx', width: 100 },
{ prop: 'ckxx', label: '参考下限', visible: true, align: 'center',slot: 'ckxx', width: 100 }, { prop: 'ckxx', label: '参考下限', visible: true, align: 'center',slot: 'ckxx', width: 100 },
{ prop: 'cksx', label: '参考上限', visible: true, align: 'center',slot: 'cksx', width: 100 },
{ prop: 'dyckz', label: '打印参考值', visible: true, align: 'center',slot: 'dyckz', width: 100 }, { prop: 'dyckz', label: '打印参考值', visible: true, align: 'center',slot: 'dyckz', width: 100 },
]); ]);
const tableConfig = ref({ const tableConfig = ref({
@ -74,6 +70,15 @@ const selectRow = ref<XmInfoVs>({
xmid: 0 xmid: 0
}) })
watch(
() => modelParam.value,
(newVal:any) => {
yqList.value = [...newVal.userInstrData];
},
{ immediate: true, deep: true }
);
const emit = defineEmits(['refreshTabData'])
//退拽属性 //退拽属性
const handleColumnDragEnd = (data: any) => { const handleColumnDragEnd = (data: any) => {
@ -93,7 +98,7 @@ const handInputChange = () => {
const onClickAdd = () => { const onClickAdd = () => {
const newData: XmInfoVs = { const newData: XmInfoVs = {
yq: '', yq: '',
xmid: props.formData.xmid, xmid: modelParam.value.basicData.xmid,
} }
yqList.value.push(newData) yqList.value.push(newData)
} }
@ -106,7 +111,8 @@ const onClickDel = async () => {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}); });
yqList.value = yqList.value.filter(item => item.yq != selectRow.value.yq); await deleteXmInfoVs({vsid:selectRow.value.vsid || 0})
emit('refreshTabData',modelParam.value.basicData)
} }
} }
@ -114,8 +120,17 @@ const onRowClick = (row: any) => {
selectRow.value = row selectRow.value = row
} }
const getDyckz = (row: XmInfoVs) => {
if(!row.cksx && !row.ckxx){
return '';
}else{
return `${row.ckxx || ''}--${row.cksx || ''}`;
}
}
onActivated(() =>{ onActivated(() =>{
yqList.value = Array.isArray(props.dataList) ? props.dataList : [];
}) })
defineExpose({ defineExpose({