Compare commits
No commits in common. "fe03afe5698bc4df580f6324e0e9506017750bf3" and "8a03e58f0442182440bfeb8220b71f4203c42d66" have entirely different histories.
fe03afe569
...
8a03e58f04
@ -2,8 +2,6 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
//检验项目界面
|
||||
|
||||
|
||||
//获取列表数据
|
||||
export function queryXmInfoNewService(query: any){
|
||||
return request({
|
||||
@ -67,21 +65,3 @@ export function delXmAlarmdetailNew(xmid:number,seq:number){
|
||||
})
|
||||
}
|
||||
|
||||
//保存数据
|
||||
export function saveDataService(query:any){
|
||||
return request({
|
||||
url: '/xminfo/update',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
//删除常用取值
|
||||
export function delXmValNewService(query:any){
|
||||
return request({
|
||||
url: '/xminfo/delXmValNew',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
|
||||
|
||||
// export function getArrayMaxXh(tableList: Array<any>) {
|
||||
// return tableList.length > 0 ? Math.max(...tableList.map((item:any) => item.xh || 0)) : 0;
|
||||
// }
|
||||
@ -75,7 +75,7 @@
|
||||
<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" :is="activeTabN" :dataList="tabDataList" :formData="selectRow"></component>
|
||||
</KeepAlive>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -94,13 +94,12 @@ 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 } 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';
|
||||
|
||||
const xmlbList = ref<Array<any>>([
|
||||
{ label: '数值型', value: '1' },
|
||||
@ -201,16 +200,6 @@ const tabDataList = ref<any>([]);
|
||||
const selectRow = ref();
|
||||
//明细数据
|
||||
const selectDetailRow = ref()
|
||||
const tableTabRef = ref()
|
||||
const modelParam = ref<any>({
|
||||
basicData: {},
|
||||
commonlyValuesData: [],
|
||||
userInstrData: [],
|
||||
commonDescriptionsData: [],
|
||||
referenceValueDetailsData: []
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 仪器
|
||||
const getYqConfig = () => {
|
||||
@ -255,20 +244,8 @@ const handleDelCorr = () => {
|
||||
}
|
||||
|
||||
//保存
|
||||
const handleSave = async () => {
|
||||
await saveDataService({
|
||||
xmInfoNew: modelParam.value.basicData,
|
||||
xmDoubleRows: [],
|
||||
xmValRows: [],
|
||||
xmInterRows: [],
|
||||
xmRefRows: [],
|
||||
xmTextResultRows: [],
|
||||
xmValNewRows: modelParam.value.commonlyValuesData,
|
||||
xmRefNewRows: modelParam.value.referenceValueDetailsData,
|
||||
xmInfoVsRows: modelParam.value.userInstrData,
|
||||
xmTextresultNewRows: modelParam.value.commonDescriptionsData
|
||||
})
|
||||
ElMessage.success('保存成功!')
|
||||
const handleSave = () => {
|
||||
console.log('保存')
|
||||
}
|
||||
//退拽属性
|
||||
const handleColumnDragEnd = (data: any) => {
|
||||
@ -302,44 +279,22 @@ const updateActive = () => {
|
||||
const changeActiveTab = () => {
|
||||
switch(activeTab.value){
|
||||
case 'Basic':
|
||||
if(selectDetailRow.value.xmInfoNew){
|
||||
modelParam.value = toRaw(selectDetailRow.value.xmInfoNew || {});
|
||||
// basicData.value = tableTabRef.value.basicData || []
|
||||
}else{
|
||||
//basicData.value = []
|
||||
}
|
||||
tabDataList.value = selectDetailRow.value.xmInfoNewRows[0] || [];
|
||||
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 = []
|
||||
}
|
||||
tabDataList.value = selectDetailRow.value.xmValNewRows[0] || [];
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<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"
|
||||
<CustomTable ref="tableRef" :data="dataList" :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>
|
||||
@ -27,21 +27,22 @@
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { dictData,getDictData } from '@/hooks';
|
||||
import { DictData, XmValNew } from '@/types';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import {delXmValNewService} from '@/api/liswork/labItem/labItemApi'
|
||||
|
||||
const props = defineProps({
|
||||
dataList: {
|
||||
type: Object,
|
||||
default: []
|
||||
},
|
||||
formData: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
});
|
||||
|
||||
const modelParam = defineModel<any>()
|
||||
const emit = defineEmits(['refreshTabData'])
|
||||
|
||||
const tableRef = ref<any>();
|
||||
const tableList = ref<any>();
|
||||
const tableRef = ref<any>(null);
|
||||
const dataList = ref<Array<XmValNew>>([]);
|
||||
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,42 +64,27 @@ 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;
|
||||
});
|
||||
|
||||
const bClickAdd = () => {
|
||||
const newData = {
|
||||
const newData: XmValNew = {
|
||||
xmid: props.formData.xmid,
|
||||
qz: '',
|
||||
srm: '',
|
||||
jgbz: '',
|
||||
xh: maxXh.value + 1
|
||||
jgbz: ''
|
||||
}
|
||||
tableList.value.push(newData);
|
||||
dataList.value?.push(newData);
|
||||
|
||||
}
|
||||
|
||||
const bClickDel = async () => {
|
||||
if(selectRow.value){
|
||||
await ElMessageBox.confirm('是否要删除选中的数据?','警告',
|
||||
{confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'});
|
||||
//删掉界面上面的数据
|
||||
//tableList.value = tableList.value?.filter((item:any) => item.xh != selectRow.value.xh );
|
||||
await delXmValNewService({xmid:props.formData.xmid,xh:selectRow.value.xh})
|
||||
emit('refreshTabData',props.formData)
|
||||
await ElMessageBox.confirm('是否要删除选中的数据?','Warning',
|
||||
{
|
||||
confirmButtonText: 'OK',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning',
|
||||
}
|
||||
|
||||
|
||||
);
|
||||
//删掉界面上面的数据
|
||||
dataList.value = dataList.value?.filter(item => item.xh != selectRow.value.xh );
|
||||
}
|
||||
|
||||
|
||||
@ -111,11 +97,6 @@ onActivated(async ()=>{
|
||||
await getDictData('VA','LF')
|
||||
qzOptions.value = dictData.value.VA
|
||||
jgbzOptions.value = dictData.value.LF
|
||||
tableList.value = modelParam.value.commonlyValuesData || []
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@ -45,7 +45,7 @@
|
||||
<el-input placeholder="英文名称" v-model="formData.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" v-model="formData.xmid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="uflag">
|
||||
<el-checkbox value="uflag">停用</el-checkbox>
|
||||
@ -171,7 +171,6 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
|
||||
const modelParam = defineModel<any>()
|
||||
|
||||
const formRef = ref();
|
||||
const formData = ref<any>({});
|
||||
@ -249,11 +248,10 @@ const ygxbCheck = computed({
|
||||
})
|
||||
|
||||
watch(
|
||||
() => modelParam.value,
|
||||
() => props.dataList,
|
||||
(newVal:any) => {
|
||||
formData.value = {...newVal };
|
||||
},
|
||||
{ immediate: true,deep: true }
|
||||
formData.value = newVal;
|
||||
}
|
||||
);
|
||||
|
||||
//多行参考值
|
||||
@ -292,6 +290,7 @@ onActivated(async () => {
|
||||
await getDictData('XMGL');
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -90,9 +90,6 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
commonDescriptionsData: tableList
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -208,10 +208,6 @@ onActivated( async ()=>{
|
||||
optionsSLZQ.value = dictData.value.SLZQ || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
referenceValueDetailsData: dataListUp
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -117,9 +117,4 @@ const onRowClick = (row: any) => {
|
||||
onActivated(() =>{
|
||||
yqList.value = Array.isArray(props.dataList) ? props.dataList : [];
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
userInstrData: yqList
|
||||
})
|
||||
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user