Merge branch 'main' of http://47.97.125.165:8902/jiangs/lis8.0-vue3
This commit is contained in:
commit
1b7d44ee19
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@ -68,9 +68,6 @@ importers:
|
||||
pinia:
|
||||
specifier: 2.1.7
|
||||
version: 2.1.7(typescript@5.9.3)(vue@3.5.23(typescript@5.9.3))
|
||||
pinia-plugin-persistedstate:
|
||||
specifier: ^4.0.0
|
||||
version: 4.7.1(pinia@2.1.7(typescript@5.9.3)(vue@3.5.23(typescript@5.9.3)))
|
||||
pinyin-pro:
|
||||
specifier: ^3.26.0
|
||||
version: 3.27.0
|
||||
@ -1139,9 +1136,6 @@ packages:
|
||||
resolution: {integrity: sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
defu@6.1.4:
|
||||
resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}
|
||||
|
||||
delayed-stream@1.0.0:
|
||||
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
@ -2134,20 +2128,6 @@ packages:
|
||||
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
pinia-plugin-persistedstate@4.7.1:
|
||||
resolution: {integrity: sha512-WHOqh2esDlR3eAaknPbqXrkkj0D24h8shrDPqysgCFR6ghqP/fpFfJmMPJp0gETHsvrh9YNNg6dQfo2OEtDnIQ==}
|
||||
peerDependencies:
|
||||
'@nuxt/kit': '>=3.0.0'
|
||||
'@pinia/nuxt': '>=0.10.0'
|
||||
pinia: '>=3.0.0'
|
||||
peerDependenciesMeta:
|
||||
'@nuxt/kit':
|
||||
optional: true
|
||||
'@pinia/nuxt':
|
||||
optional: true
|
||||
pinia:
|
||||
optional: true
|
||||
|
||||
pinia@2.1.7:
|
||||
resolution: {integrity: sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ==}
|
||||
peerDependencies:
|
||||
@ -3780,8 +3760,6 @@ snapshots:
|
||||
is-descriptor: 1.0.3
|
||||
isobject: 3.0.1
|
||||
|
||||
defu@6.1.4: {}
|
||||
|
||||
delayed-stream@1.0.0: {}
|
||||
|
||||
delegate@3.2.0: {}
|
||||
@ -4907,12 +4885,6 @@ snapshots:
|
||||
|
||||
picomatch@4.0.2: {}
|
||||
|
||||
pinia-plugin-persistedstate@4.7.1(pinia@2.1.7(typescript@5.9.3)(vue@3.5.23(typescript@5.9.3))):
|
||||
dependencies:
|
||||
defu: 6.1.4
|
||||
optionalDependencies:
|
||||
pinia: 2.1.7(typescript@5.9.3)(vue@3.5.23(typescript@5.9.3))
|
||||
|
||||
pinia@2.1.7(typescript@5.9.3)(vue@3.5.23(typescript@5.9.3)):
|
||||
dependencies:
|
||||
'@vue/devtools-api': 6.6.4
|
||||
|
||||
12
src/api/liswork/advancedReview/index.ts
Normal file
12
src/api/liswork/advancedReview/index.ts
Normal file
@ -0,0 +1,12 @@
|
||||
//@ts-ignore js语法检查忽略
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
//获取报告列表
|
||||
export function queryList(query?: Object) {
|
||||
return request({
|
||||
url: '/labCheckrules/queryList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
54
src/api/liswork/xmmb/index.ts
Normal file
54
src/api/liswork/xmmb/index.ts
Normal file
@ -0,0 +1,54 @@
|
||||
//@ts-ignore js语法检查忽略
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
// 查询模板列表
|
||||
export function queryMbList(query?: Object) {
|
||||
return request({
|
||||
url: '/labInputmdl/query',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 查询明细数据
|
||||
export function queryDetail(query?: Object) {
|
||||
return request({
|
||||
url: '/labInputmdl/queryDetail',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 新增模板
|
||||
export function addXmInfo(query?: Object) {
|
||||
return request({
|
||||
url: '/labInputmdl/add',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 修改模板
|
||||
export function updateXmInfo(query?: Object) {
|
||||
return request({
|
||||
url: '/labInputmdl/update',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除模板
|
||||
export function deleteXmInfo(query?: Object) {
|
||||
return request({
|
||||
url: '/labInputmdl/delete',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 删除明细数据
|
||||
export function deleteDetail(query?: Object) {
|
||||
return request({
|
||||
url: '/labInputmdl/deleteDetail',
|
||||
method: 'post',
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
|
||||
63
src/api/liswork/xtwh/reportdictApi.ts
Normal file
63
src/api/liswork/xtwh/reportdictApi.ts
Normal file
@ -0,0 +1,63 @@
|
||||
//参数设置字典
|
||||
// @ts-ignore
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询字典列表
|
||||
export function listreportdict(params:any) {
|
||||
return request({
|
||||
url: '/reportdict/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典详细
|
||||
export function getreportdict(id:number) {
|
||||
return request({
|
||||
url: `/reportdict/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典
|
||||
export function addreportdict(params:any) {
|
||||
return request({
|
||||
url: '/reportdict',
|
||||
method: 'post',
|
||||
data:params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典
|
||||
export function updatereportdict(params:any) {
|
||||
return request({
|
||||
url: '/reportdict',
|
||||
method: 'put',
|
||||
data:params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典
|
||||
export function delreportdict(id:any) {
|
||||
return request({
|
||||
url: `/reportdict/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
|
||||
}
|
||||
// 自动加载
|
||||
export function autoload() {
|
||||
return request({
|
||||
url: '/reportdict/autoload',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典列表
|
||||
export function optionselect(params:any) {
|
||||
return request({
|
||||
url: '/reportdict/optionselect',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
47
src/api/liswork/xtwh/reportinstrApi.ts
Normal file
47
src/api/liswork/xtwh/reportinstrApi.ts
Normal file
@ -0,0 +1,47 @@
|
||||
//参数设置字典
|
||||
// @ts-ignore
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询字典列表
|
||||
export function listreportinstr(params:any) {
|
||||
return request({
|
||||
url: '/reportinstr/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典详细
|
||||
export function getreportinstr(id:number) {
|
||||
return request({
|
||||
url: `/reportinstr/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典
|
||||
export function addreportinstr(params:any) {
|
||||
return request({
|
||||
url: '/reportinstr',
|
||||
method: 'post',
|
||||
data:params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典
|
||||
export function updatereportinstr(params:any) {
|
||||
return request({
|
||||
url: '/reportinstr',
|
||||
method: 'put',
|
||||
data:params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典
|
||||
export function delreportinstr(id:any) {
|
||||
return request({
|
||||
url: `/reportinstr/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
|
||||
}
|
||||
@ -19,3 +19,36 @@ export function queryDetailService(params: any) {
|
||||
params,
|
||||
});
|
||||
}
|
||||
//查询项目明细 old
|
||||
export function queryOldxminfo(params: any) {
|
||||
return request({
|
||||
url: "/oldxminfo/query",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
//搜索项目
|
||||
export function searchxminfo(params: any) {
|
||||
return request({
|
||||
url: "/vsReportitem/search",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
//添加收费项目报告项目对照
|
||||
export function addXminfo(data: Object) {
|
||||
return request({
|
||||
url: "/vsReportitem/add",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
//删除收费项目报告项目对照
|
||||
export function delXminfo(data: Object) {
|
||||
return request({
|
||||
url: "/vsReportitem/del",
|
||||
method: "delete",
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<SelectTable v-model:data="modelValue" :fields="fields" :tableData="instrOptions" label="yqmc" :size="props.size"
|
||||
value="yq" objKey="yq" :border="true" :width="props.width" placeholder="请选择仪器" :clearable="props.clearable"
|
||||
@getDataValue="getDataValue" v-bind="$attrs" />
|
||||
@getDataValue="getDataValue" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -54,8 +54,8 @@ const getYqConfig = () => {
|
||||
}
|
||||
|
||||
const getDataValue = (val: any) => {
|
||||
emits('update:data', val.yq);
|
||||
emits('getDataValue', val);
|
||||
emits('update:data', val?.yq || null);
|
||||
emits('getDataValue', val || null);
|
||||
};
|
||||
|
||||
watch(() => props.data, (val) => {
|
||||
|
||||
@ -171,7 +171,13 @@ service.interceptors.response.use(res => {
|
||||
})
|
||||
return Promise.reject('error');
|
||||
} else if (code === 1) {
|
||||
//提示并返回数据
|
||||
//提示并失败
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: msg,
|
||||
type: 'error',
|
||||
duration: 0,
|
||||
})
|
||||
return Promise.resolve(res.data)
|
||||
} else if (code === 4) {
|
||||
//返回特定值,需要后续处理,表示当前操作需要处理后再调用,problemId是步骤关键参数,需要再次调用时引入
|
||||
|
||||
75
src/views/liswork/advancedReview/index.vue
Normal file
75
src/views/liswork/advancedReview/index.vue
Normal file
@ -0,0 +1,75 @@
|
||||
/**
|
||||
* @file index.vue 高级审核条件
|
||||
* @author: w
|
||||
* @since: 2025-12-25
|
||||
*/
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="queryParams" label-width="80px" inline>
|
||||
<el-form-item label="仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="queryParams.yq" width="200px" clearable @get-data-value="getList" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="mb10">
|
||||
<el-button type="primary" @click="handleAdd">新增</el-button>
|
||||
<el-button type="primary" @click="handleSave">保存</el-button>
|
||||
<el-button type="danger" @click="handleDel">删除</el-button>
|
||||
</div>
|
||||
<div style="height: calc(100% - 110px);">
|
||||
<CustomTable ref="tableRef" v-model:data="tableData" :columns="columns" :config="tableConfig">
|
||||
<template #yq="{ row }">
|
||||
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||
import { queryList } from '@/api/liswork/advancedReview';
|
||||
|
||||
const queryParams = ref({
|
||||
yq: '46',
|
||||
});
|
||||
|
||||
const tableData = ref<Array<any>>([]);
|
||||
const columns = ref([
|
||||
{ label: '规则ID', prop: 'ruleid', visible: true, align: 'center', width: '80' },
|
||||
{ label: '条件类型', prop: 'checktype', visible: true, align: 'center', width: '150' },
|
||||
{ label: '审核启用', prop: 'logflag', visible: true, align: 'center', width: '80' },
|
||||
{ label: '组合条件(双击弹窗编辑)', prop: 'ruledisplay', visible: true, align: 'center', },
|
||||
{ label: '记录备注信息', prop: 'logcontent', visible: true, align: 'center', width: '300' },
|
||||
{ label: '组合条件', prop: 'checkrules', visible: true, align: 'center', },
|
||||
{ label: '自动审核', prop: 'autocheck', visible: true, align: 'center', width: '80' },
|
||||
]);
|
||||
|
||||
const tableConfig = ref({
|
||||
highlightCurrentRow: true,
|
||||
border: true,
|
||||
height: '100%'
|
||||
});
|
||||
|
||||
const options = [
|
||||
{ label: '审核条件', value: '0' },
|
||||
{ label: '绝对禁止审核', value: '3' },
|
||||
{ label: '审核生成报告备注', value: '4' },
|
||||
]
|
||||
|
||||
const handleAdd = () => {
|
||||
};
|
||||
const handleSave = () => {
|
||||
};
|
||||
const handleDel = () => {
|
||||
};
|
||||
const getList = () => {
|
||||
queryList(queryParams.value).then((res: any) => {
|
||||
tableData.value = res.data;
|
||||
});
|
||||
};
|
||||
getList()
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@ -1,11 +1,11 @@
|
||||
<!-- 修改界面 -->
|
||||
<template>
|
||||
<!-- 修改界面 -->
|
||||
<el-dialog v-model="visible" width="600px" @open="open">
|
||||
<el-dialog v-model="visible" width="600px" @open="open">
|
||||
<template #header>
|
||||
{{ title }}
|
||||
</template>
|
||||
<span class="text-span">项目信息:</span>
|
||||
<el-divider style="margin: 5px 0;"/>
|
||||
<el-divider style="margin: 5px 0;" />
|
||||
<el-form ref="form" :model="formData" size="small" class="form-inline" inline label-width="70px">
|
||||
<el-form-item label="项目代号" prop="xmdh">
|
||||
<el-input placeholder="项目代号" v-model="formData.xmdh"></el-input>
|
||||
@ -51,16 +51,16 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span class="text-span">知识库条目:</span>
|
||||
<el-divider style="margin: 5px 0;"/>
|
||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig" :show-overflow-tooltip="true">
|
||||
<template #reserve="{row}">
|
||||
<el-divider style="margin: 5px 0;" />
|
||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" :show-overflow-tooltip="true">
|
||||
<template #reserve="{ row }">
|
||||
{{ reserve(row.reserve) }}
|
||||
</template>
|
||||
<template #textresult="{row}">
|
||||
<template #textresult="{ row }">
|
||||
<el-input v-model="row.textresult" type="textarea" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #zd="{row}">
|
||||
<template #zd="{ row }">
|
||||
<el-input v-model="row.zd" type="textarea" class="full-width-input"></el-input>
|
||||
</template>
|
||||
</CustomTable>
|
||||
@ -70,7 +70,7 @@
|
||||
<el-button type="primary" @click="handleOk">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
@ -80,7 +80,7 @@ import { addService } from '@/api/liswork/xmKnowledge/xmKnowledgeApi'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const props = defineProps({
|
||||
title:{
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
@ -96,7 +96,7 @@ const formData = ref({
|
||||
xmdh: '',
|
||||
xmmc: '',
|
||||
zjf: '',
|
||||
xmlb: '' ,
|
||||
xmlb: '',
|
||||
xmz: '',
|
||||
dw: '',
|
||||
cksx: '',
|
||||
@ -105,15 +105,15 @@ const formData = ref({
|
||||
dyxh: '',
|
||||
jsgs: '',
|
||||
lcyy: '',
|
||||
bz:'',
|
||||
bz: '',
|
||||
xsbz: ''
|
||||
})
|
||||
|
||||
|
||||
const columnsRight = ref([
|
||||
{ prop: 'reserve', label: '类别', visible: true, align: 'center',slot: 'reserve', width: 50 ,showOverflowTooltip: false},
|
||||
{ prop: 'textresult', label: '说明', visible: true, align: 'center',slot: 'textresult', width: 300,showOverflowTooltip: false},
|
||||
{ prop: 'zd', label: '指导建议', visible: true, align: 'center',slot: 'zd', width: 200,showOverflowTooltip: false },
|
||||
{ prop: 'reserve', label: '类别', visible: true, align: 'center', slot: 'reserve', width: 50, showOverflowTooltip: false },
|
||||
{ prop: 'textresult', label: '说明', visible: true, align: 'center', slot: 'textresult', width: 300, showOverflowTooltip: false },
|
||||
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', slot: 'zd', width: 200, showOverflowTooltip: false },
|
||||
])
|
||||
|
||||
const tableConfig = ref({
|
||||
@ -127,7 +127,7 @@ const xsbzCheck = computed({
|
||||
get() {
|
||||
return formData.value.xsbz === '1'
|
||||
},
|
||||
set(checked){
|
||||
set(checked) {
|
||||
formData.value.xsbz = checked ? '1' : '0';
|
||||
}
|
||||
})
|
||||
@ -142,8 +142,8 @@ const handleColumnDragEnd = (data: any) => {
|
||||
const dataList = ref<any>([])
|
||||
|
||||
|
||||
const reserve = (reserve:string) => {
|
||||
switch(reserve){
|
||||
const reserve = (reserve: string) => {
|
||||
switch (reserve) {
|
||||
case '1':
|
||||
return '综述'
|
||||
case 'H':
|
||||
@ -175,17 +175,17 @@ const handleOk = async () => {
|
||||
}
|
||||
|
||||
const open = () => {
|
||||
if(props.type === '新增'){
|
||||
if (props.type === '新增') {
|
||||
dataList.value = [
|
||||
{reserve:'1',textresult:'',yxjs:'',cjyy:'',zd:''},
|
||||
{reserve:'H',textresult:'',yxjs:'',cjyy:'',zd:''},
|
||||
{reserve:'L',textresult:'',yxjs:'',cjyy:'',zd:''},
|
||||
{reserve:'P',textresult:'',yxjs:'',cjyy:'',zd:''},
|
||||
{reserve:'Q',textresult:'',yxjs:'',cjyy:'',zd:''},
|
||||
{reserve:'J',textresult:'',yxjs:'',cjyy:'',zd:''},
|
||||
{reserve:'N',textresult:'',yxjs:'',cjyy:'',zd:''},
|
||||
{ reserve: '1', textresult: '', yxjs: '', cjyy: '', zd: '' },
|
||||
{ reserve: 'H', textresult: '', yxjs: '', cjyy: '', zd: '' },
|
||||
{ reserve: 'L', textresult: '', yxjs: '', cjyy: '', zd: '' },
|
||||
{ reserve: 'P', textresult: '', yxjs: '', cjyy: '', zd: '' },
|
||||
{ reserve: 'Q', textresult: '', yxjs: '', cjyy: '', zd: '' },
|
||||
{ reserve: 'J', textresult: '', yxjs: '', cjyy: '', zd: '' },
|
||||
{ reserve: 'N', textresult: '', yxjs: '', cjyy: '', zd: '' },
|
||||
]
|
||||
}else{
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
@ -198,9 +198,11 @@ const open = () => {
|
||||
padding: 10px;
|
||||
background-color: #f5f7fa;
|
||||
height: auto;
|
||||
|
||||
.el-input {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 2px;
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig">
|
||||
<template #reserve="{row}">
|
||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig">
|
||||
<template #reserve="{ row }">
|
||||
{{ reserve(row.reserve) }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</CustomTable>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
|
||||
const props = defineProps({
|
||||
dataList:{
|
||||
dataList: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: []
|
||||
@ -23,7 +23,7 @@ const props = defineProps({
|
||||
reserveWidth: 50,
|
||||
textresultWidth: 200,
|
||||
zdWidth: 100,
|
||||
tableHeight: '85vh'
|
||||
tableHeight: '100%'
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,9 +31,9 @@ const props = defineProps({
|
||||
|
||||
//const dataListRight = ref([]);
|
||||
const columnsRight = ref([
|
||||
{ prop: 'reserve', label: '类别', visible: true, align: 'center',slot: 'reserve', width: props.styleConfig.reserveWidth },
|
||||
{ prop: 'textresult', label: '说明', visible: true, align: 'center', width: props.styleConfig.textresultWidth ,showOverflowTooltip: false},
|
||||
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', width: props.styleConfig.zdWidth,showOverflowTooltip: false },
|
||||
{ prop: 'reserve', label: '类别', visible: true, align: 'center', slot: 'reserve', },
|
||||
{ prop: 'textresult', label: '说明', visible: true, align: 'center', showOverflowTooltip: false },
|
||||
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', showOverflowTooltip: false },
|
||||
])
|
||||
|
||||
const tableConfig = ref({
|
||||
@ -50,8 +50,8 @@ const handleColumnDragEnd = (data: any) => {
|
||||
}
|
||||
|
||||
|
||||
const reserve = (reserve:string) => {
|
||||
switch(reserve){
|
||||
const reserve = (reserve: string) => {
|
||||
switch (reserve) {
|
||||
case '1':
|
||||
return '综述'
|
||||
case 'H':
|
||||
@ -72,5 +72,4 @@ const reserve = (reserve:string) => {
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -1,20 +1,22 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="topForm">
|
||||
<el-form ref="formRef" :model="formData" inline label-width="80px" class="mb8" @submit.prevent="handleSubmit">
|
||||
<el-form ref="formRef" :model="formData" inline label-width="80px" @submit.prevent="handleSubmit">
|
||||
<el-form-item label="检索" prop="js">
|
||||
<el-input placeholder="项目代号,名称,简拼" v-model="formData.js" style="width: 200px;"
|
||||
@keyup.enter="getList"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||
<el-button type="primary" @click="onAddClick">新增</el-button>
|
||||
<el-button type="primary" @click="onDelClick">删除</el-button>
|
||||
<el-button type="danger" @click="onDelClick">删除</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-row :gutter="20" class="table-row">
|
||||
<el-col :span="17" class="table-col">
|
||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClick" @row-click="onClick"
|
||||
:pagination="pagination" @size-change="sizeChange" @page-change="currentChange">
|
||||
@ -23,7 +25,7 @@
|
||||
</template>
|
||||
</CustomTable>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-col :span="7" class="table-col">
|
||||
<TableRight :data-list="dataListRight" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -63,7 +65,7 @@ const columnsLeft = ref([
|
||||
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '85vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// cellStyle: cellStyleHd
|
||||
})
|
||||
@ -158,12 +160,12 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-row {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.topForm {
|
||||
.table-row {
|
||||
height: calc(100% - 150px);
|
||||
margin-top: 10px;
|
||||
|
||||
.table-col {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
301
src/views/liswork/xmmb/index.vue
Normal file
301
src/views/liswork/xmmb/index.vue
Normal file
@ -0,0 +1,301 @@
|
||||
/**
|
||||
* @file index.vue
|
||||
* @author: w
|
||||
* @since: 2025-12-24
|
||||
*/
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="queryParams" label-width="80px" inline>
|
||||
<el-form-item label="仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="queryParams.yq" width="200px" clearable @get-data-value="getList" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板名称" prop="xmdh">
|
||||
<el-input placeholder="请输入模板名称" v-model="queryParams.mbmc" style="width: 200px;" clearable
|
||||
@keyup.enter="getList" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" @click="handleAdd">新增</el-button>
|
||||
<el-button type="danger" @click="handleDel">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="table-row" style="margin-top: 10px;">
|
||||
<el-col :span="24" class="table-col">
|
||||
<CustomTable ref="tableRef" v-model:data="tableData" :columns="columns" :config="tableConfig"
|
||||
@row-dblclick="handleRowDblclick" @row-click="selectedRows = $event">
|
||||
<template #yq="{ row }">
|
||||
{{ formatInstr(row.yq) }}
|
||||
</template>
|
||||
<template #yblx="{ row }">
|
||||
{{ formatYblx(row.yblx) }}
|
||||
</template>
|
||||
<template #zdsr="{ row }">
|
||||
<el-checkbox :model-value="row.zdsr == 'Y'" />
|
||||
</template>
|
||||
</CustomTable>
|
||||
</el-col>
|
||||
<el-dialog :title="title" v-model="visible" width="50vw" :close-on-click-modal="false" :draggable="true">
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="10">
|
||||
<el-form ref="formRef" :model="formData" label-width="150px">
|
||||
<el-form-item label="仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="formData.yq" :disabled="disabled" @get-data-value="getOldXminfoList()" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板名称" prop="mbmc">
|
||||
<el-input v-model="formData.mbmc" />
|
||||
</el-form-item>
|
||||
<el-form-item label="输入编号" prop="srbh">
|
||||
<el-input v-model="formData.srbh" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标本类型" prop="yblx">
|
||||
<SelectTable v-model:data="formData.yblx" :tableData="regdictList" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="zdsr">
|
||||
<el-checkbox v-model="formData.zdsr" label="自动输入" true-value="Y" false-value="N" />
|
||||
</el-form-item>
|
||||
<el-form-item label="自动输入起始标本号" prop="qsybh">
|
||||
<el-input v-model="formData.qsybh" />
|
||||
</el-form-item>
|
||||
<el-form-item label="自动输入结束标本号" prop="jsybh">
|
||||
<el-input v-model="formData.jsybh" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="mb10">
|
||||
<el-button type="primary" @click="handleSave">保存</el-button>
|
||||
<el-button type="primary" @click="addItem">新增</el-button>
|
||||
<el-button type="danger" @click="delItem">删除</el-button>
|
||||
</div>
|
||||
<div style="height: 400px">
|
||||
<CustomTable ref="tableRefRight" :data="rightTableData" :columns="rightColumns" :config="tableConfig"
|
||||
@row-click="xmrowHandle">
|
||||
<template #xmdh="{ row, $index }">
|
||||
<SelectTable v-model:data="row.xmdh" :tableData="xmList" class="full-width-input" :keyValue="true"
|
||||
@get-data-value="getXmInfo(row, $index)" />
|
||||
</template>
|
||||
<template #mrz="{ row }">
|
||||
<el-input v-model="row.mrz" class="full-width-input" />
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||
// @ts-ignore
|
||||
import { listregdict } from "@/api/regional/dict/regdict.js";
|
||||
import { queryMbList, queryDetail, addXmInfo, deleteDetail, updateXmInfo, deleteXmInfo } from '@/api/liswork/xmmb';
|
||||
import { formatInstr, getYqData } from '@/hooks'
|
||||
import { queryOldxminfo } from '@/api/liswork/xtwh/xmReqItemVsApi'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
|
||||
|
||||
const queryParams = ref({
|
||||
yq: '',
|
||||
mbmc: '',
|
||||
})
|
||||
const disabled = ref(false)
|
||||
const formData = ref({
|
||||
yq: '',
|
||||
mbmc: '',
|
||||
srbh: '',
|
||||
yblx: '',
|
||||
zdsr: '',
|
||||
qsybh: '',
|
||||
jsybh: '',
|
||||
oldMbmc: '',
|
||||
})
|
||||
const xmList = ref([])
|
||||
const title = ref('')
|
||||
const visible = ref(false)
|
||||
const tableData = ref([])
|
||||
const columns = ref([
|
||||
{ prop: 'yq', label: '仪器', visible: true, align: 'center', slot: 'yq' },
|
||||
{ prop: 'mbmc', label: '输入模板', visible: true, align: 'center', },
|
||||
{ prop: 'srbh', label: '输入编号', visible: true, align: 'center', },
|
||||
{ prop: 'yblx', label: '样本类型', visible: true, align: 'center', slot: 'yblx' },
|
||||
{ prop: 'zdsr', label: '自动输入', visible: true, align: 'center', slot: 'zdsr' },
|
||||
{ prop: 'qsybh', label: '起始号', visible: true, align: 'center', },
|
||||
{ prop: 'jsybh', label: '结束号', visible: true, align: 'center', },
|
||||
])
|
||||
|
||||
const tableConfig = ref({
|
||||
height: '100%', // 高度
|
||||
border: true, // 边框
|
||||
highlightCurrentRow: true, // 当前行高亮
|
||||
})
|
||||
const selectedRows: any = ref(null)
|
||||
const regdictList = ref<Array<{ value: string, label: string }>>([])
|
||||
const rightTableData = ref<Array<{ xmdh: string, mrz: string }>>([])
|
||||
const rightColumns = ref([
|
||||
{ prop: 'xmdh', label: '检验项目', visible: true, align: 'center', slot: 'xmdh', showOverflowTooltip: false },
|
||||
{ prop: 'mrz', label: '默认值', visible: true, align: 'center', slot: 'mrz', showOverflowTooltip: false },
|
||||
])
|
||||
const getOldXminfoList = async () => {
|
||||
const res = await queryOldxminfo({ yq: formData.value.yq })
|
||||
xmList.value = res.data.map((item: any) => {
|
||||
return {
|
||||
label: item.xmmc,
|
||||
value: item.xmdh,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
formData.value = {
|
||||
yq: '',
|
||||
mbmc: '',
|
||||
srbh: '',
|
||||
yblx: '',
|
||||
zdsr: '',
|
||||
qsybh: '',
|
||||
jsybh: '',
|
||||
oldMbmc: '',
|
||||
}
|
||||
disabled.value = false
|
||||
rightTableData.value = []
|
||||
title.value = '新增模板'
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
const handleRowDblclick = (row: any) => {
|
||||
getDetailsList(row)
|
||||
row.yq = row.yq.trim()
|
||||
row.oldMbmc = row.mbmc
|
||||
formData.value = row
|
||||
getOldXminfoList()
|
||||
disabled.value = true
|
||||
title.value = '编辑模板'
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
const getDetailsList = (row: any) => {
|
||||
queryDetail({ yq: row.yq, mbmc: row.mbmc }).then((res: any) => {
|
||||
rightTableData.value = res.data
|
||||
})
|
||||
}
|
||||
const handleSave = () => {
|
||||
rightTableData.value = rightTableData.value.filter((item: any) => item.xmdh)
|
||||
const arr = rightTableData.value.map((item: any, index: number) => {
|
||||
return {
|
||||
...item,
|
||||
mbmc: formData.value.mbmc,
|
||||
oldMbmc: formData.value.oldMbmc,
|
||||
yq: formData.value.yq,
|
||||
xh: item.xh ? item.xh : index + 1,
|
||||
}
|
||||
})
|
||||
if (disabled.value) {
|
||||
updateXmInfo({ labInputmdl: formData.value, labInputmdlDetailList: arr }).then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
getList()
|
||||
visible.value = false
|
||||
})
|
||||
} else {
|
||||
addXmInfo({ labInputmdl: formData.value, labInputmdlDetailList: arr }).then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
getList()
|
||||
visible.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
const xmInfo = ref<any>(null)
|
||||
const xmrowHandle = (row: any) => {
|
||||
xmInfo.value = row
|
||||
}
|
||||
|
||||
const getXmInfo = (row: any, currentIndex: any) => {
|
||||
const prevXmdhList = rightTableData.value
|
||||
.filter((_, index) => index < currentIndex)
|
||||
.map(row => row.xmdh)
|
||||
.filter(xmdh => !!xmdh);
|
||||
|
||||
|
||||
if (prevXmdhList.includes(row.xmdh)) {
|
||||
ElMessage.error(`当前项目编号【${row.xmdh}】与前面行重复,请重新选择!`);
|
||||
rightTableData.value[currentIndex].xmdh = '';
|
||||
}
|
||||
}
|
||||
|
||||
const addItem = () => {
|
||||
rightTableData.value.push({ xmdh: '', mrz: '', })
|
||||
}
|
||||
const delItem = () => {
|
||||
if (!xmInfo.value) return ElMessage.warning('请选择要删除的行!')
|
||||
if (xmInfo.value.yq) {
|
||||
deleteDetail([xmInfo.value]).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
getDetailsList(formData.value)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
rightTableData.value = rightTableData.value.filter(item => item.xmdh != xmInfo.value.xmdh)
|
||||
}
|
||||
xmInfo.value = null
|
||||
}
|
||||
const handleDel = () => {
|
||||
if (!selectedRows.value) return ElMessage.warning('请选择要删除的记录')
|
||||
ElMessageBox.confirm('确定要删除选中的数据吗?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteXmInfo(selectedRows.value).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
getList()
|
||||
selectedRows.value = null
|
||||
})
|
||||
})
|
||||
}
|
||||
const getList = () => {
|
||||
queryMbList(queryParams.value).then((res: any) => {
|
||||
tableData.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
getList()
|
||||
onMounted(() => {
|
||||
getYqData()
|
||||
// 获取标本类型
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'BT' }).then((res: any) => {
|
||||
regdictList.value = res.rows.map((item: any) => {
|
||||
return {
|
||||
label: item.dictName,
|
||||
value: item.dictCode
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const formatYblx = (v: string) => {
|
||||
return regdictList.value.find((item: any) => item.value == v)?.label || v
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.table-row {
|
||||
height: calc(100% - 100px);
|
||||
|
||||
.table-col {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.right-col {
|
||||
padding-top: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@ -1,12 +1,510 @@
|
||||
<!-- 报告界面参数 -->
|
||||
<template>
|
||||
<div>
|
||||
报告界面参数
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdateBatch">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDeleteBatch">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" icon="Refresh" @click="handleQuery">刷新</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="5" class="table-container">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="reportinstrList"
|
||||
@selection-change="handleSelectionChange"
|
||||
class="report-table"
|
||||
height="100%"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="编号" align="center" prop="reportId" v-if="false"/>
|
||||
<el-table-column label="仪器" align="center" prop="reportYq" v-if="false" show-overflow-tooltip />
|
||||
<el-table-column label="模板ID" align="left" prop="reportBgdh" width="50" show-overflow-tooltip />
|
||||
<el-table-column label="模板名称" align="left" prop="reportName" show-overflow-tooltip />
|
||||
<el-table-column label="类别" align="center" prop="reportType" width="50" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>
|
||||
{{ reportTypeOptions.find(item => item.value === scope.row.reportType)?.label || scope.row.reportType }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="纸张" align="center" prop="reportSize" width="50">
|
||||
<template #default="scope">
|
||||
<span>
|
||||
{{ reportSizeOptions.find(item => item.value === scope.row.reportSize)?.label || scope.row.reportSize }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="固定行数" align="center" prop="reportRows" width="80"show-overflow-tooltip />
|
||||
<el-table-column label="最小行数" align="center" prop="reportMinrows" width="80"show-overflow-tooltip />
|
||||
<el-table-column label="最大行数" align="center" prop="reportMaxrows" width="80"show-overflow-tooltip />
|
||||
<el-table-column label="指定项目" align="center" prop="reportItems" show-overflow-tooltip />
|
||||
<el-table-column label="排序" align="center" prop="reportSort" width="80" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<!-- 修正:dict-tag 若为自定义组件需确保引入,否则替换为普通文本 -->
|
||||
<span :class="scope.row.status === '0' ? 'status-normal' : 'status-disable'">
|
||||
{{ scope.row.status === '0' ? '正常' : '禁用' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="150" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改字典对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="reportinstrRef" :model="form" :rules="rules" label-width="150px">
|
||||
|
||||
<el-form-item :label="`${menuname}模板`" prop="reportBgdh">
|
||||
<el-select
|
||||
v-model="form.reportBgdh"
|
||||
:placeholder="`请选择${menuname}模板`"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dictOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}类别`" prop="reportType">
|
||||
<el-select
|
||||
v-model="form.reportType"
|
||||
:placeholder="`请选择${menuname}类别`"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in reportTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}纸张类型`" prop="reportSize">
|
||||
<el-select
|
||||
v-model="form.reportSize"
|
||||
:placeholder="`请选择${menuname}纸张类型`"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in reportSizeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}固定行数`" prop="reportRows">
|
||||
<el-input v-model.number="form.reportRows" :placeholder="`请输入${menuname}固定行数`" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}最小行数`" prop="reportMinrows">
|
||||
<el-input v-model.number="form.reportMinrows" :placeholder="`请输入${menuname}最小行数`" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}最大行数`" prop="reportMaxrows">
|
||||
<el-input v-model.number="form.reportMaxrows" :placeholder="`请输入${menuname}最大行数`" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}指定项目`" prop="reportItems">
|
||||
<el-input v-model="form.reportItems" :placeholder="`请输入${menuname}指定项目`" />
|
||||
</el-form-item>
|
||||
<el-form-item label="顺序" prop="reportSort">
|
||||
<el-input-number v-model="form.reportSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="0">正常</el-radio>
|
||||
<el-radio label="1">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup name="reportinstr" lang="ts">
|
||||
import { ref, reactive, toRefs, watch, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox, ElForm } from 'element-plus';
|
||||
// 导入类型定义(若项目有axios封装,需补充AxiosResponse类型)
|
||||
// 导入API(确保API返回Promise<AxiosResponse>)
|
||||
import {
|
||||
addreportinstr,
|
||||
delreportinstr,
|
||||
getreportinstr,
|
||||
listreportinstr,
|
||||
updatereportinstr
|
||||
} from "@/api/liswork/xtwh/reportinstrApi";
|
||||
import {optionselect} from "@/api/liswork/xtwh/reportdictApi";
|
||||
// 导入时间格式化工具(确保存在)
|
||||
import { parseTime } from "@/utils/ruoyi.js";
|
||||
// ========== 1. 修正:TypeScript 类型定义 ==========
|
||||
interface ReportItem {
|
||||
reportId: number;
|
||||
reportYq: string;
|
||||
reportBgdh: string;
|
||||
reportType: string;
|
||||
reportSize: string;
|
||||
reportRows: number;
|
||||
reportMinrows: number;
|
||||
reportMaxrows: number;
|
||||
reportItems: string;
|
||||
reportSort: number;
|
||||
status: string;
|
||||
remark: string;
|
||||
createTime?: string; // 可选属性
|
||||
reportName: string;
|
||||
}
|
||||
// ========== 2. 修正:响应式变量定义 ==========
|
||||
// 下拉选项
|
||||
const reportTypeOptions = ref([
|
||||
{ label: "常规报告", value: "0" },
|
||||
{ label: "细菌阴性", value: "1" },
|
||||
{ label: "细菌阳性", value: "2" },
|
||||
{ label: "初步报告", value: "3" },
|
||||
{ label: "二级报告", value: "4" }
|
||||
]);
|
||||
const reportSizeOptions = ref([
|
||||
{ label: "默认", value: "0" },
|
||||
{ label: "A5", value: "1" },
|
||||
{ label: "A4", value: "2" }
|
||||
]);
|
||||
|
||||
// 父组件传值
|
||||
const yq = defineModel<string>();
|
||||
// 列表数据
|
||||
const reportinstrList = ref<ReportItem[]>([]);
|
||||
// 弹窗状态
|
||||
const open = ref(false);
|
||||
const loading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<number[]>([]); // 修正:明确类型为number[]
|
||||
const single = ref(true); // 批量修改禁用:true=禁用(选中数!=1)
|
||||
const multiple = ref(true); // 批量删除禁用:true=禁用(选中数=0)
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const menuname = ref("仪器报告模板");
|
||||
|
||||
// 表单相关(修正:响应式定义 + 初始值类型)
|
||||
const data = reactive({
|
||||
form: {
|
||||
reportId: undefined as number | undefined,
|
||||
reportYq: "",
|
||||
reportBgdh: "",
|
||||
reportType: "",
|
||||
reportSize: "2",
|
||||
reportRows: undefined,
|
||||
reportMinrows: undefined,
|
||||
reportMaxrows: undefined,
|
||||
reportItems: "",
|
||||
reportSort: 0,
|
||||
status: "0", // 默认正常
|
||||
remark: ""
|
||||
},
|
||||
queryParams: {
|
||||
reportYq: undefined as string | undefined,
|
||||
reportBgdh: undefined as string | undefined,
|
||||
status: undefined as string | undefined,
|
||||
},
|
||||
// 修正:表单校验规则(动态文本需用函数)
|
||||
rules: {
|
||||
reportBgdh: [{
|
||||
required: true,
|
||||
message: () => `${menuname.value}名称不能为空`,
|
||||
trigger: "blur"
|
||||
}],
|
||||
reportYq: [{
|
||||
required: true,
|
||||
message: () => `${menuname.value}仪器不能为空`,
|
||||
trigger: "blur"
|
||||
}],
|
||||
reportSort: [{
|
||||
required: true,
|
||||
message: () => `${menuname.value}顺序不能为空`,
|
||||
trigger: "blur"
|
||||
}],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
interface SelectOption {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
// 修正:获取表单Ref(Vue3 + TS 正确写法)
|
||||
const reportinstrRef = ref<InstanceType<typeof ElForm>>();
|
||||
const queryRef = ref<InstanceType<typeof ElForm>>();
|
||||
const dictOptions = ref<SelectOption[]>([]); // 下拉/字典选项列表
|
||||
const dictLoading = ref(false); // 字典加载状态
|
||||
async function loadApiDict() {
|
||||
const dictType ="0";
|
||||
try {
|
||||
dictLoading.value = true;
|
||||
const response = await optionselect({ reportType: dictType })
|
||||
if (response.code === 200 && Array.isArray(response.data)) {
|
||||
dictOptions.value = response.data.map(item => ({
|
||||
label: item.reportName || "",
|
||||
value: item.reportId || ""
|
||||
}));
|
||||
} else {
|
||||
ElMessage.warning("模板无有效数据");
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error("字典请求失败");
|
||||
console.error("字典API异常:", { dictType, error });
|
||||
} finally {
|
||||
dictLoading.value = false;
|
||||
}
|
||||
}
|
||||
// ========== 3. 修正:核心方法 ==========
|
||||
/** 查询列表 */
|
||||
const getList = async (): Promise<void> => {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 修正:API入参格式(确保和后端一致)
|
||||
queryParams.value.reportYq=yq.value
|
||||
const response = await listreportinstr(queryParams.value)
|
||||
reportinstrList.value = JSON.parse(JSON.stringify(response.data));
|
||||
total.value = response.data.length;
|
||||
} catch (error) {
|
||||
ElMessage.error(`获取列表异常:${(error as Error).message}`);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
open.value = false;
|
||||
reset();
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
reportId: undefined,
|
||||
reportYq: yq.value||"",
|
||||
reportBgdh: "",
|
||||
reportType: "",
|
||||
reportSize: "2",
|
||||
reportRows: undefined,
|
||||
reportMinrows: undefined,
|
||||
reportMaxrows: undefined,
|
||||
reportItems: "",
|
||||
reportSort: 0,
|
||||
status: "0",
|
||||
remark: ""
|
||||
};
|
||||
// 修正:重置表单校验状态
|
||||
if (reportinstrRef.value) {
|
||||
reportinstrRef.value.clearValidate();
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
// 修正:重置搜索表单
|
||||
if (queryRef.value) {
|
||||
queryRef.value.resetFields();
|
||||
}
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: ReportItem[]) => {
|
||||
ids.value = selection.map(item => item.reportId);
|
||||
// 修正:批量按钮禁用逻辑
|
||||
single.value = selection.length !== 1; // 选中数!=1 → 批量修改禁用
|
||||
multiple.value = selection.length === 0; // 选中数=0 → 批量删除禁用
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
loadApiDict();
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = `添加${menuname.value}`;
|
||||
};
|
||||
|
||||
/** 批量修改按钮(原handleUpdate重名,拆分) */
|
||||
const handleUpdateBatch = () => {
|
||||
if (ids.value.length !== 1) {
|
||||
ElMessage.warning("请选择一条数据进行修改");
|
||||
return;
|
||||
}
|
||||
handleUpdate({ reportId: ids.value[0] } as ReportItem);
|
||||
};
|
||||
|
||||
/** 单行修改按钮 */
|
||||
const handleUpdate = async (row: ReportItem) => {
|
||||
reset();
|
||||
const reportId = row.reportId;
|
||||
try {
|
||||
const response = await getreportinstr(reportId)
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = `修改${menuname.value}`;
|
||||
} catch (error) {
|
||||
ElMessage.error(`获取详情失败:${(error as Error).message}`);
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = async () => {
|
||||
if (!reportinstrRef.value) return;
|
||||
|
||||
// 修正:Vue3 表单校验写法
|
||||
try {
|
||||
await reportinstrRef.value.validate();
|
||||
|
||||
if (form.value.reportId !== undefined) {
|
||||
// 修改
|
||||
await updatereportinstr(form.value);
|
||||
ElMessage.success("修改成功");
|
||||
} else {
|
||||
// 新增
|
||||
await addreportinstr(form.value);
|
||||
ElMessage.success("新增成功");
|
||||
}
|
||||
open.value = false;
|
||||
getList();
|
||||
} catch (error) {
|
||||
ElMessage.error("表单校验失败,请检查必填项");
|
||||
}
|
||||
};
|
||||
|
||||
/** 批量删除按钮(原handleDelete重名,拆分) */
|
||||
const handleDeleteBatch = () => {
|
||||
if (ids.value.length === 0) {
|
||||
ElMessage.warning("请选择至少一条数据进行删除");
|
||||
return;
|
||||
}
|
||||
handleDelete({ reportId: ids.value } as unknown as ReportItem);
|
||||
};
|
||||
|
||||
/** 单行删除按钮 */
|
||||
const handleDelete = async (row: ReportItem) => {
|
||||
const reportIds = Array.isArray(row.reportId) ? row.reportId : [row.reportId];
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`是否确认删除${menuname.value}编号为${reportIds.join(",")}的数据项?`,
|
||||
"确认删除",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
);
|
||||
await delreportinstr(reportIds);
|
||||
ElMessage.success("删除成功");
|
||||
getList();
|
||||
} catch (error) {
|
||||
// 取消删除不提示
|
||||
if (error !== "cancel") {
|
||||
ElMessage.error(`删除失败:${(error as Error).message}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 导出按钮操作(修正:参数传递 + 接口路径) */
|
||||
const handleExport = () => {
|
||||
};
|
||||
|
||||
// ========== 4. 修正:生命周期 + 监听 ==========
|
||||
// 补充:获取当前实例(用于proxy)
|
||||
import { getCurrentInstance } from 'vue';
|
||||
|
||||
// 监听yq变化
|
||||
watch(yq, (newVal) => {
|
||||
if (newVal !== undefined) {
|
||||
getList();
|
||||
}
|
||||
}, { immediate: true, deep: true });
|
||||
|
||||
// 修正:初始化调用(避免重复调用)
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 90vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
.mb8 {
|
||||
height: 30px;
|
||||
margin-bottom: 8px; /* 补充margin,避免按钮重叠 */
|
||||
}
|
||||
.table-container {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
/* 状态样式(替换dict-tag) */
|
||||
.status-normal {
|
||||
color: #67c23a;
|
||||
font-weight: 500;
|
||||
}
|
||||
.status-disable {
|
||||
color: #f56c6c;
|
||||
font-weight: 500;
|
||||
}
|
||||
/* 减小表格行高 */
|
||||
:deep(.report-table .el-table__row) {
|
||||
height: 30px !important;
|
||||
line-height: 30px !important;
|
||||
}
|
||||
/* 减小单元格内边距 */
|
||||
:deep(.report-table .el-table__cell) {
|
||||
padding: 2px 4px !important;
|
||||
height: 30px !important;
|
||||
line-height: 1.2 !important;
|
||||
vertical-align: middle !important;
|
||||
font-size: 12px; /* 补充字体大小,适配矮行 */
|
||||
}
|
||||
/* 优化操作列按钮 */
|
||||
:deep(.report-table .el-button--link) {
|
||||
padding: 0 4px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
/* 对话框按钮间距 */
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@ -281,7 +281,7 @@ function submitForm() {
|
||||
if (valid) {
|
||||
if (form.value.configId != undefined) {
|
||||
updateconfigdict(form.value).then(response => {
|
||||
if (response.code == 0) {
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
@ -289,7 +289,7 @@ function submitForm() {
|
||||
});
|
||||
} else {
|
||||
addconfigdict(form.value).then(response => {
|
||||
if (response.code == 0) {
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
|
||||
@ -1,54 +1,135 @@
|
||||
<template>
|
||||
<div class="dynamic-input-container">
|
||||
<!-- 1. 开关组件(替代原单选框 type=0:是/否 → 开启/关闭) -->
|
||||
<el-switch class="custom-switch" v-if="type === '0'" v-model="innerValue" active-color="#13ce66"
|
||||
inactive-color="#ff4949" active-value="1" inactive-value="0" @change="handleSwitchChange" />
|
||||
<el-switch
|
||||
class="custom-switch"
|
||||
v-if="type === '0'"
|
||||
v-model="innerValue"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="handleSwitchChange"
|
||||
/>
|
||||
|
||||
<!-- 2. 下拉框(1):直接绑定value -->
|
||||
<el-select v-else-if="type === '1'" v-model="innerValue" size="small" clearable @change="handleValueChange">
|
||||
<el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-select
|
||||
v-else-if="type === '1'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
clearable
|
||||
@change="handleValueChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dictOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<!-- 3. 字典单选(2):绑定zddh(value),显示zdmc(label) -->
|
||||
<el-select v-else-if="type === '2'" v-model="innerValue" size="small" clearable @change="handleValueChange"
|
||||
v-loading="dictLoading">
|
||||
<el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-select
|
||||
v-else-if="type === '2'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
clearable
|
||||
@change="handleValueChange"
|
||||
v-loading="dictLoading"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dictOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<!-- 4. 字典多选(3):数组↔逗号分隔字符串 → 修复核心:仅绑定multipleValue,移除冗余逻辑 -->
|
||||
<el-select v-else-if="type === '3'" v-model="multipleValue" size="small" multiple @change="handleMultipleChange"
|
||||
v-loading="dictLoading" clearable>
|
||||
<el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-select
|
||||
v-else-if="type === '3'"
|
||||
v-model="multipleValue"
|
||||
size="small"
|
||||
multiple
|
||||
@change="handleMultipleChange"
|
||||
v-loading="dictLoading"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dictOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<!-- 5. 特殊(4) -->
|
||||
<el-input v-else-if="type === '4'" v-model="innerValue" size="small" disabled @change="handleValueChange" />
|
||||
<el-input
|
||||
v-else-if="type === '4'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
disabled
|
||||
@change="handleValueChange"
|
||||
/>
|
||||
|
||||
<!-- 6. 文本框(5) -->
|
||||
<el-input v-else-if="type === '5'" v-model="innerValue" size="small" :placeholder="placeholder"
|
||||
@change="handleValueChange" />
|
||||
<el-input
|
||||
v-else-if="type === '5'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
:placeholder="placeholder"
|
||||
@change="handleValueChange"
|
||||
/>
|
||||
|
||||
<!-- 7. 数字框(6):支持dictData定义小数位数,空值初始化 -->
|
||||
<el-input-number v-else-if="type === '6'" v-model="innerValue" size="small" :min="minNum"
|
||||
:precision="finalPrecision" controls-position="right" @change="handleValueChange"
|
||||
:placeholder="placeholder || '请输入数字'" />
|
||||
<el-input-number
|
||||
v-else-if="type === '6'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
:min="minNum"
|
||||
:precision="finalPrecision"
|
||||
controls-position="right"
|
||||
@change="handleValueChange"
|
||||
:placeholder="placeholder || '请输入数字'"
|
||||
/>
|
||||
|
||||
<!-- 8. 日期框(7):适配yyyy/mm/dd -->
|
||||
<el-date-picker v-else-if="type === '7'" v-model="innerValue" size="small" type="date" format="YYYY/MM/DD"
|
||||
value-format="YYYY-MM-DD" :placeholder="placeholder" @change="handleValueChange" />
|
||||
<el-date-picker
|
||||
v-else-if="type === '7'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
type="date"
|
||||
format="YYYY/MM/DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:placeholder="placeholder"
|
||||
@change="handleValueChange"
|
||||
/>
|
||||
|
||||
<!-- 9. 时间框(8):适配hh:mm(修复标签闭合问题) -->
|
||||
<el-time-picker v-else-if="type === '8'" v-model="innerValue" size="small" format="HH:mm" value-format="HH:mm:ss"
|
||||
:placeholder="placeholder" @change="handleValueChange"
|
||||
:picker-options="{ selectableRange: '00:00:00 - 23:59:59' }" />
|
||||
<el-time-picker
|
||||
v-else-if="type === '8'"
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm:ss"
|
||||
:placeholder="placeholder"
|
||||
@change="handleValueChange"
|
||||
:picker-options="{ selectableRange: '00:00:00 - 23:59:59' }"
|
||||
/>
|
||||
|
||||
<!-- 兜底:默认文本框 -->
|
||||
<el-input v-else v-model="innerValue" size="small" :placeholder="placeholder" @change="handleValueChange" />
|
||||
<el-input
|
||||
v-else
|
||||
v-model="innerValue"
|
||||
size="small"
|
||||
:placeholder="placeholder"
|
||||
@change="handleValueChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="DynamicInput">
|
||||
//import { ref, watch, defineProps, defineEmits, onMounted, computed } from "vue";
|
||||
import { ref, watch, defineProps, defineEmits, onMounted, computed } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { getoptionselect } from "@/api/liswork/xtwh/localconfigApi.ts";
|
||||
|
||||
@ -299,21 +380,16 @@ onMounted(() => {
|
||||
<style scoped>
|
||||
.dynamic-input-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
/* 关键:占满表格单元格高度 */
|
||||
height: 100%; /* 关键:占满表格单元格高度 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* 垂直居中 */
|
||||
justify-content: center;
|
||||
/* 水平居中 */
|
||||
padding: 0 2px;
|
||||
/* 轻微内边距,避免贴边 */
|
||||
align-items: center; /* 垂直居中 */
|
||||
justify-content: center; /* 水平居中 */
|
||||
padding: 0 2px; /* 轻微内边距,避免贴边 */
|
||||
}
|
||||
|
||||
/* 开关组件样式优化 */
|
||||
:deep(.el-switch) {
|
||||
margin: 0 auto;
|
||||
/* 开关水平居中 */
|
||||
margin: 0 auto; /* 开关水平居中 */
|
||||
}
|
||||
|
||||
/* 深度选择器强制覆盖激活颜色 */
|
||||
@ -360,7 +436,6 @@ onMounted(() => {
|
||||
/* 多选下拉样式优化:避免高度溢出 */
|
||||
:deep(.el-select--multiple .el-select__tags) {
|
||||
flex-wrap: wrap;
|
||||
min-height: 32px;
|
||||
/* 匹配small尺寸高度 */
|
||||
min-height: 32px; /* 匹配small尺寸高度 */
|
||||
}
|
||||
</style>
|
||||
@ -1,18 +1,16 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 报告项目维护 -->
|
||||
<el-form ref="form" :model="formData" label-width="80px">
|
||||
<el-form ref="form" :model="formData" label-width="80px">
|
||||
<el-form-item label="项目代号" prop="xmdh">
|
||||
<el-input placeholder="项目代号" v-model="formData.xmdh"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="xmmc">
|
||||
<el-input placeholder="项目名称" v-model="formData.xmmc"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-form>
|
||||
|
||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" />
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig"/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -42,4 +40,5 @@ const handleColumnDragEnd = (data: any) => {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
||||
@ -1,11 +1,493 @@
|
||||
<template>
|
||||
<div>
|
||||
reportdict
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item :label="menuname + '类别'" prop="reportType">
|
||||
<el-select
|
||||
v-model="queryParams.reportType"
|
||||
:placeholder="`请选择${menuname}类别`"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in reportTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板文件名(.jrxml)" prop="reportCode">
|
||||
<el-input
|
||||
v-model="queryParams.reportCode"
|
||||
:placeholder="`请输入${menuname}编码`"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}名称`" prop="reportName">
|
||||
<el-input
|
||||
v-model="queryParams.reportName"
|
||||
:placeholder="`请输入${menuname}名称`"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
>新增模板</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除模板</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="autoloading"
|
||||
>自动加载</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-row :gutter="5" class="table-container">
|
||||
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="report-table" height="100%">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="`${menuname}类别`" align="center" prop="reportType" width="100" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span
|
||||
class="report-type-cell"
|
||||
:style="{
|
||||
backgroundColor: getreportTypeColor(scope.row.reportType),
|
||||
color: '#fff' // 文字白色,保证对比
|
||||
}"
|
||||
>
|
||||
{{ reportTypeOptions.find(item => item.value === scope.row.reportType)?.label || scope.row.reportType }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="编号" align="center" prop="reportId" width="50" show-overflow-tooltip/>
|
||||
<el-table-column label="模板文件名" align="center" prop="reportCode" width="150" show-overflow-tooltip />
|
||||
<el-table-column :label="`${menuname}名称`" align="left" prop="reportName" show-overflow-tooltip />
|
||||
<el-table-column label="排版类别" align="center" prop="reportOptiontype"width="80">
|
||||
<template #default="scope">
|
||||
<span>
|
||||
{{ reportOptiontypeOptions.find(item => item.value === scope.row.reportOptiontype)?.label || scope.row.reportOptiontype }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="参数" align="center" prop="reportDefvalue" show-overflow-tooltip />
|
||||
<el-table-column label="备注" align="left" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="排序" align="center" prop="reportSort" width="80" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="150" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="400" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" >修改</el-button>
|
||||
<el-button link type="primary" icon="Link" @click="handleDelete(scope.row)" >预览模板</el-button>
|
||||
<el-button link type="primary" icon="Upload" @click="uploadfile(scope.row)" >更替模板</el-button>
|
||||
<el-button link type="primary" icon="Download" @click="downloadfile(scope.row)" >下载模板</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!-- 添加或修改模板对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
|
||||
<el-form ref="reportdictRef" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item :label="`${menuname}类别`" prop="reportType">
|
||||
<el-select
|
||||
v-model="form.reportType"
|
||||
:placeholder="`请选择${menuname}类别`"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in reportTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板文件名(.jrxml)" prop="reportCode">
|
||||
<el-input v-model="form.reportCode" :placeholder="`请输入${menuname}编码`" disabled class="disabled-input-gray"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}名称`" prop="reportName">
|
||||
<el-input v-model="form.reportName" :placeholder="`请输入${menuname}名称`" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}排版类别`" prop="reportOptiontype">
|
||||
<el-select
|
||||
v-model="form.reportOptiontype"
|
||||
:placeholder="`请选择${menuname}排版类别`"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in reportOptiontypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${menuname}参数`" prop="reportDefvalue">
|
||||
<el-input v-model="form.reportDefvalue" :placeholder="`请输入${menuname}参数`" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="顺序" prop="reportSort">
|
||||
<el-input-number v-model="form.reportSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="uploadRef" :limit="1" accept=".jrxml" :headers="upload.headers"
|
||||
:action="upload.url + '?reportId=' + upload.reportId" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span>仅允许导入jrxml格式文件。</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup name="reportdict">
|
||||
import { getToken } from "@/utils/auth";
|
||||
import {
|
||||
addreportdict, delreportdict,
|
||||
getreportdict,
|
||||
listreportdict,
|
||||
updatereportdict,autoload
|
||||
} from "@/api/liswork/xtwh/reportdictApi.ts";
|
||||
// 1. 定义类别下拉选项(根据实际业务调整)
|
||||
const reportTypeOptions = ref([
|
||||
{ label: "检验报告", value: "0",color: "#56BBBD" },
|
||||
{ label: "条码标签", value: "1",color: "#67C23A" },
|
||||
{ label: "回单标签", value: "2",color: "#7E84F7" },
|
||||
{ label: "统计报表", value: "3",color: "#F08784" },
|
||||
{ label: "其他报表", value: "4",color: "#909399" },
|
||||
]);
|
||||
// 2. 定义获取类别对应颜色的方法
|
||||
function getreportTypeColor(type) {
|
||||
// 匹配对应类别的颜色,无匹配时用默认色
|
||||
const item = reportTypeOptions.value.find(item => item.value === type);
|
||||
return item?.color || "#909399"; // 默认灰色
|
||||
}
|
||||
// 2. 定义参数类别下拉选项(根据实际业务调整)
|
||||
const reportOptiontypeOptions = ref([
|
||||
{ label: "默认", value: "0",color: "#56BBBD" },
|
||||
{ label: "单列", value: "1",color: "#67C23A" },
|
||||
{ label: "双列", value: "2",color: "#FF443F" },
|
||||
{ label: "单列带图", value: "3",color: "#F08784" },
|
||||
{ label: "双列带图", value: "4",color: "#909399" },
|
||||
{ label: "细菌阳性", value: "5",color: "#3282F6" },
|
||||
{ label: "细菌阴性", value: "6",color: "#507F80" },
|
||||
{ label: "标签", value: "7",color: "#7E84F7" },
|
||||
{ label: "回单", value: "8",color: "#377D22" },
|
||||
]);
|
||||
function getreportOptionTypeColor(type) {
|
||||
// 匹配对应类别的颜色,无匹配时用默认色
|
||||
const item = reportOptiontypeOptions.value.find(item => item.value === type);
|
||||
return item?.color || "#909399"; // 默认灰色
|
||||
}
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive({
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 更新的模板号
|
||||
reportId: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/reportdict/importfile"
|
||||
});
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
const regdictList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const menuname = ref("报表模板");
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
reportCode: undefined,
|
||||
reportName: undefined,
|
||||
reportType:"0",
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
reportType: [{ required: true, message: menuname.value+"类别不能为空", trigger: "blur" }],
|
||||
reportName: [{ required: true, message: menuname.value+"名称不能为空", trigger: "blur" }],
|
||||
reportCode: [{ required: true, message: menuname.value+"编码不能为空", trigger: "blur" }],
|
||||
reportSort: [{ required: true, message: menuname.value+"顺序不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询模板列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listreportdict(queryParams.value).then(response => {
|
||||
console.log('response:', response);
|
||||
regdictList.value = response.data;
|
||||
total.value = response.data.length;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
reportId: undefined,
|
||||
reportCode: undefined,
|
||||
reportName: undefined,
|
||||
reportType: reportTypeOptions.value[0]?.value || "",
|
||||
reportOptiontype: reportOptiontypeOptions.value[0]?.value || "",
|
||||
reportDefvalue:undefined,
|
||||
reportSort: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("reportdictRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.reportId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
upload.reportId=0;
|
||||
upload.title = "新增模板";
|
||||
upload.open = true;
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const reportId = row.reportId || ids.value;
|
||||
getreportdict(reportId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改"+menuname.value;
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["reportdictRef"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
if (form.value.reportId != undefined) {
|
||||
updatereportdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addreportdict(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
proxy.$refs["uploadRef"].handleRemove(file);
|
||||
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||
handleQuery()
|
||||
};
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
proxy.$refs["uploadRef"].submit();
|
||||
};
|
||||
/** 导入按钮操作 */
|
||||
function uploadfile(row) {
|
||||
upload.reportId= row.reportId;
|
||||
upload.title = "模板上传";
|
||||
upload.open = true;
|
||||
};
|
||||
/** 下载模板操作 */
|
||||
function downloadfile(row) {
|
||||
const params = {
|
||||
filename: row.reportCode
|
||||
};
|
||||
proxy.download("reportdict/downloadfile", params, `${row.reportCode}.jrxml`);
|
||||
};
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const reportIds = row.reportId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除"' + menuname.value + '"编号为"' + reportIds + '"的数据项?').then(function() {
|
||||
|
||||
return delreportdict(reportIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("delreportdict/export", {
|
||||
...queryParams.value
|
||||
}, `dict_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
function autoloading(){
|
||||
loading.value = true;
|
||||
autoload().then(response => {
|
||||
getList();
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
getList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 90vh;
|
||||
/* 容器高度等于窗口高度 */
|
||||
overflow: hidden;
|
||||
}
|
||||
.mb8 {
|
||||
height: 30px;
|
||||
/* 固定高度 */
|
||||
}
|
||||
.table-container {
|
||||
flex: 1;
|
||||
/* 占满剩余高度 */
|
||||
overflow: hidden;
|
||||
/* 避免表格超出容器 */
|
||||
}
|
||||
/* 1. 减小表格行高(核心) */
|
||||
:deep(.report-table .el-table__row) {
|
||||
height: 30px !important; /* 原默认行高约40px,按需调整(建议28-35px) */
|
||||
line-height: 30px !important; /* 行高与height一致,保证垂直居中 */
|
||||
}
|
||||
|
||||
<style scoped></style>
|
||||
/* 2. 减小单元格内边距(配合行高优化) */
|
||||
:deep(.report-table .el-table__cell) {
|
||||
padding: 2px 4px !important;
|
||||
height: 30px !important; /* 单元格高度与行高一致 */
|
||||
line-height: 1.2 !important; /* 文字行高适配矮行 */
|
||||
vertical-align: middle !important; /* 强制垂直居中 */
|
||||
}
|
||||
|
||||
/* 3. 类别单元格适配矮行高 */
|
||||
.report-type-cell {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 26px; /* 适配30px行高,略小一点 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 可选:优化操作列按钮大小,适配矮行 */
|
||||
:deep(.report-table .el-button--link) {
|
||||
padding: 0 4px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
.disabled-input-gray :deep(.el-input__inner){
|
||||
background-color: #e9e9e9 !important; /* 灰色底色(可根据需求调整色值) */
|
||||
color: #666 !important; /* 文字颜色加深,提升可读性 */
|
||||
cursor: not-allowed !important; /* 鼠标悬浮显示禁止图标 */
|
||||
}
|
||||
</style>
|
||||
@ -1,9 +1,8 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--报告单设定-->
|
||||
<el-form ref="form" :model="formData" label-width="80px">
|
||||
<el-form-item label="仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="formData.yq" width="200px" @getDataValue="getList" />
|
||||
<YQSelectTable v-model:data="formData.yq" width="200px" @getDataValue="getList"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handAdd" size="default">新增</el-button>
|
||||
@ -12,25 +11,22 @@
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<el-table ref="reportTable" :data="tableData" border width="100%" height="700px" @row-click="onRowClick"
|
||||
highlight-current-row>
|
||||
<el-table ref="reportTable" :data="tableData" border width="100%" height="700px" @row-click="onRowClick" highlight-current-row>
|
||||
<el-table-column label="仪器" prop="yq" align="center">
|
||||
<template #default="scope">
|
||||
{{ formatInstr(scope.row.yq) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" prop="xh" align="center"></el-table-column>
|
||||
<el-table-column label="报告单号" prop="bgdh" align="center">
|
||||
<el-table-column label="报告单号" prop="bgdh" align="center" >
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.bgdh" placeholder="请输入报告单号" class="full-width-input"
|
||||
@change="handleRowChange(scope.row, scope.$index)"></el-input>
|
||||
<el-input v-model="scope.row.bgdh" placeholder="请输入报告单号" class="full-width-input" @change="handleRowChange(scope.row, scope.$index)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="医疗机构" prop="yljg" align="center"></el-table-column>
|
||||
<el-table-column label="使用类型" prop="type" align="center">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.type" placeholder="请选择" class="full-width-input"
|
||||
@change="handleRowChange(scope.row, scope.$index)">
|
||||
<el-select v-model="scope.row.type" placeholder="请选择" class="full-width-input" @change="handleRowChange(scope.row, scope.$index)">
|
||||
<el-option label="默认" value="1"></el-option>
|
||||
<el-option label="参数" value="2"></el-option>
|
||||
<el-option label="根据项目来判断" value="3"></el-option>
|
||||
@ -39,21 +35,18 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="使用条件" prop="condition" align="center">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.condition" placeholder="请输入使用条件" class="full-width-input"
|
||||
@change="handleRowChange(scope.row, scope.$index)"></el-input>
|
||||
<el-input v-model="scope.row.condition" placeholder="请输入使用条件" class="full-width-input" @change="handleRowChange(scope.row, scope.$index)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { addReportService, queryReportService, updateReportService, deleteReportService } from '@/api/liswork/xtwh/reportSettingApi';
|
||||
import {addReportService,queryReportService,updateReportService,deleteReportService} from '@/api/liswork/xtwh/reportSettingApi';
|
||||
import { LabReportInstr } from '@/types/index';
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { formatInstr, getYqData } from '@/hooks/index';
|
||||
import { ElMessage,ElMessageBox } from 'element-plus';
|
||||
import { formatInstr,getYqData } from '@/hooks/index';
|
||||
|
||||
const formData = ref({
|
||||
yq: ''
|
||||
@ -70,7 +63,7 @@ const maxXh = computed(() => {
|
||||
|
||||
//新增数据
|
||||
const handAdd = () => {
|
||||
if (formData.value.yq === '') {
|
||||
if(formData.value.yq === ''){
|
||||
ElMessage.warning('请先选择仪器');
|
||||
return;
|
||||
}
|
||||
@ -88,14 +81,14 @@ const handAdd = () => {
|
||||
|
||||
//删除数据
|
||||
const handDelete = async () => {
|
||||
await ElMessageBox.confirm('是否要删除选中的数据?', 'Warning',
|
||||
await ElMessageBox.confirm('是否要删除选中的数据?','Warning',
|
||||
{
|
||||
confirmButtonText: 'OK',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning',
|
||||
}
|
||||
);
|
||||
await deleteReportService({ yq: selectedRows.value?.yq, xh: selectedRows.value?.xh, bgdh: selectedRows.value?.bgdh });
|
||||
await deleteReportService({yq: selectedRows.value?.yq, xh: selectedRows.value?.xh,bgdh: selectedRows.value?.bgdh});
|
||||
ElMessage.success('删除成功');
|
||||
getList();
|
||||
};
|
||||
@ -103,12 +96,12 @@ const handDelete = async () => {
|
||||
//保存数据
|
||||
const handSave = async () => {
|
||||
let updateReports = tableData.value.filter(item => item.type === '1');
|
||||
if (updateReports.length > 1) {
|
||||
if(updateReports.length > 1){
|
||||
ElMessage.error('默认的报告单类型不能有两个,请修改后再保存');
|
||||
return;
|
||||
}
|
||||
updateReports = tableData.value.filter(item => item.type === '2' && item.condition.trim() === '');
|
||||
if (updateReports.length > 0) {
|
||||
if(updateReports.length > 0){
|
||||
ElMessage.error('参数类型的使用条件不能为空,请修改后再保存');
|
||||
return;
|
||||
}
|
||||
@ -116,7 +109,7 @@ const handSave = async () => {
|
||||
let newReports = tableData.value.filter(item => item.status === 'new');
|
||||
let res = await addReportService(newReports);
|
||||
newReports = tableData.value.filter(item => item.status === 'update');
|
||||
console.log('更新的数据', newReports);
|
||||
console.log('更新的数据',newReports);
|
||||
res = await updateReportService(newReports);
|
||||
ElMessage.success('保存成功');
|
||||
getList();
|
||||
@ -130,7 +123,7 @@ const getList = async () => {
|
||||
|
||||
//监听数据是否发生改变
|
||||
const handleRowChange = (row: LabReportInstr, index: number) => {
|
||||
if (row.status !== 'new') {
|
||||
if(row.status !== 'new') {
|
||||
tableData.value[index].status = 'update';
|
||||
}
|
||||
};
|
||||
|
||||
272
src/views/liswork/xtwh/reportsetting/reportlist.vue
Normal file
272
src/views/liswork/xtwh/reportsetting/reportlist.vue
Normal file
@ -0,0 +1,272 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="模板编码" prop="zddh">
|
||||
<el-input
|
||||
v-model="queryParams.zddh"
|
||||
placeholder="请输入模板编码"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板名称" prop="zdmc">
|
||||
<el-input
|
||||
v-model="queryParams.zdmc"
|
||||
placeholder="请输入模板名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="userflag">
|
||||
<el-select v-model="queryParams.userflag" placeholder="模板状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="diagnosisList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="模板编码" align="center" prop="zddh" />
|
||||
<el-table-column label="模板名称" align="center" prop="zdmc" />
|
||||
<el-table-column label="模板排序" align="center" prop="diagSort" />
|
||||
<el-table-column label="状态" align="center" prop="userflag">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_normal_disable" :value="scope.row.userflag" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" >修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改模板对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="diagnosisRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="模板名称" prop="diagName">
|
||||
<el-input v-model="form.diagName" placeholder="请输入模板名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板编码" prop="diagCode">
|
||||
<el-input v-model="form.diagCode" placeholder="请输入编码名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板顺序" prop="diagSort">
|
||||
<el-input-number v-model="form.diagSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="diagnosis">
|
||||
import { listdiagnosis, adddiagnosis, deldiagnosis, getdiagnosis, updatediagnosis } from "@/api/regional/dict/diagnosis";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
const diagnosisList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 15,
|
||||
diagCode: undefined,
|
||||
diagName: undefined,
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
diagName: [{ required: true, message: "模板名称不能为空", trigger: "blur" }],
|
||||
diagCode: [{ required: true, message: "模板编码不能为空", trigger: "blur" }],
|
||||
diagSort: [{ required: true, message: "模板顺序不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询模板列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listdiagnosis(queryParams.value).then(response => {
|
||||
diagnosisList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
diagId: undefined,
|
||||
diagCode: undefined,
|
||||
diagName: undefined,
|
||||
diagSort: 0,
|
||||
status: "0",
|
||||
remark: undefined
|
||||
};
|
||||
proxy.resetForm("diagnosisRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.diagId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加模板";
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const diagId = row.diagId || ids.value;
|
||||
getdiagnosis(diagId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改模板";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["diagnosisRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.diagId != undefined) {
|
||||
updatediagnosis(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
adddiagnosis(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const diagIds = row.diagId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除模板编号为"' + diagIds + '"的数据项?').then(function() {
|
||||
return deldiagnosis(diagIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/diagnosis/export", {
|
||||
...queryParams.value
|
||||
}, `diag_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
@ -13,16 +13,16 @@
|
||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span>说明:双击左侧列表,能删除对照数据,双击右边列表能新增数据到对照当中</span>
|
||||
<span class="tips">说明:双击左侧列表,能删除对照数据,双击右边列表能新增数据到对照当中</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClickLeft" />
|
||||
<el-row :gutter="20" class="table-row">
|
||||
<el-col :span="6" class="table-col">
|
||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :config="tableConfig"
|
||||
@row-dblclick="onDBClickLeft" />
|
||||
</el-col>
|
||||
<el-col :span="19">
|
||||
<el-col :span="18" class="table-col">
|
||||
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClickRight" />
|
||||
</el-col>
|
||||
@ -42,36 +42,31 @@ import { ElMessage } from 'element-plus';
|
||||
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '76vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// cellStyle: cellStyleHd
|
||||
})
|
||||
|
||||
//退拽属性
|
||||
const handleColumnDragEnd = (data: any) => {
|
||||
// 更新列配置
|
||||
columnsLeft.value = data.columns;
|
||||
columnsRight.value = data.columns;
|
||||
}
|
||||
|
||||
const columnsLeft = ref([
|
||||
{ prop: 'sfxmmc', label: '当前仪器对应的收费项目', visible: true, align: 'center', width: 300 },
|
||||
{ prop: 'sfxmmc', label: '当前仪器对应的收费项目', visible: true, },
|
||||
{ prop: 'yq', label: '仪器', visible: false, align: 'center', width: 100 },
|
||||
]);
|
||||
const columnsRight = ref([
|
||||
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', width: 100 },
|
||||
{ prop: 'sfxmdh', label: '收费项目代号', visible: true, align: 'center', width: 200 },
|
||||
{ prop: 'sfxmmc', label: '收费项目名称', visible: true, align: 'center', width: 300 },
|
||||
{ prop: 'dj', label: '单价', visible: true, align: 'center', width: 100 },
|
||||
{ prop: 'cp_yq', label: '分配了仪器', visible: true, align: 'center', width: 400 }
|
||||
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', },
|
||||
{ prop: 'sfxmdh', label: '收费项目代号', visible: true, align: 'center', },
|
||||
{ prop: 'sfxmmc', label: '收费项目名称', visible: true, align: 'center', },
|
||||
{ prop: 'dj', label: '单价', visible: true, align: 'center', },
|
||||
{ prop: 'cp_yq', label: '分配了仪器', visible: true, align: 'center', }
|
||||
]);
|
||||
|
||||
const dataListLeft = ref([
|
||||
{ 'sfxmdh': '', 'yq': '' }
|
||||
])
|
||||
const dataListLeft = ref([])
|
||||
const dataListRight = ref([])
|
||||
const formData = ref({
|
||||
yq: '',
|
||||
yq: '46',
|
||||
item: ''
|
||||
})
|
||||
|
||||
@ -115,9 +110,23 @@ const onQueryClick = () => {
|
||||
getList()
|
||||
}
|
||||
|
||||
|
||||
|
||||
getList()
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
<style scoped lang="scss">
|
||||
.tips {
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
font-size: 16px;
|
||||
color: #409eff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
height: calc(100% - 58px);
|
||||
|
||||
.table-col {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="formData" label-width="80px" inline>
|
||||
<el-form-item label="仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="formData.yq" width="200px" placeholder="请输入仪器名称" @get-data-value="getList" />
|
||||
<YQSelectTable v-model:data="formData.yq" width="200px" placeholder="请输入仪器名称" @get-data-value="getDataValue" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目" prop="xmdh">
|
||||
<el-input placeholder="请输入项目名称" v-model="formData.xmdh" style="width: 200px;"></el-input>
|
||||
<el-input placeholder="请输入项目名称" v-model="formData.sqxmmc" style="width: 200px;" @keyup.enter="getList" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="formData.sl" label="只看仪器对照收费项目" true-value="1" false-value="" @change="getList" />
|
||||
@ -15,7 +15,8 @@
|
||||
|
||||
<el-row>
|
||||
<el-button type="primary" icon="Plus" @click="onClickAdd">新增</el-button>
|
||||
<el-button type="primary" icon="Delete" @click="onClickDel">删除</el-button>
|
||||
<el-button type="danger" icon="Delete" @click="onClickDel">删除</el-button>
|
||||
<el-button type="primary" icon="Edit" @click="searchHandle">搜索申请项目</el-button>
|
||||
<el-button type="primary" icon="Edit" @click="onClickSave">保存</el-button>
|
||||
</el-row>
|
||||
|
||||
@ -26,10 +27,9 @@
|
||||
</el-col>
|
||||
<el-col :span="16" class="table-col">
|
||||
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig">
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowHandle">
|
||||
<template #xmdh="{ row }">
|
||||
{{ row.xmdh }} {{ row.xmmc }}
|
||||
<!-- <SelectTable v-model:data="row.xmdh" :tableData="dataListLeft" class="full-width-input" /> -->
|
||||
<SelectTable v-model:data="row.xmdh" :tableData="xmList" class="full-width-input" :keyValue="true" />
|
||||
</template>
|
||||
<template #tdh="{ row }">
|
||||
<el-input placeholder="" v-model="row.tdh" class="full-width-input"></el-input>
|
||||
@ -37,6 +37,9 @@
|
||||
<template #mrz="{ row }">
|
||||
<el-input v-model="row.mrz" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #seq="{ row }">
|
||||
<el-input v-model="row.seq" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #def="{ row }">
|
||||
<el-checkbox v-model="row.def" true-value="1" false-value="0" />
|
||||
</template>
|
||||
@ -48,17 +51,28 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { queryListService, queryDetailService } from '@/api/liswork/xtwh/xmReqItemVsApi';
|
||||
import { queryListService, queryDetailService, queryOldxminfo, addXminfo, delXminfo, searchxminfo } from '@/api/liswork/xtwh/xmReqItemVsApi';
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
const formData = ref({
|
||||
yq: '46',
|
||||
xmdh: '',
|
||||
sqxmmc: '',
|
||||
sl: ''
|
||||
})
|
||||
|
||||
interface tableItem {
|
||||
xmdh: string;
|
||||
tdh: string;
|
||||
mrz: string;
|
||||
seq: number;
|
||||
def: string;
|
||||
}
|
||||
const dataListLeft = ref([])
|
||||
const dataListRight = ref([])
|
||||
const dataListRight = ref<tableItem[]>([])
|
||||
const xmList = ref([])
|
||||
const selectRow = ref<any>(null)
|
||||
|
||||
//退拽属性
|
||||
const handleColumnDragEnd = (data: any) => {
|
||||
@ -81,34 +95,95 @@ const columnsRight = ref([
|
||||
{ prop: 'xmdh', label: '报告项目', visible: true, align: 'center', width: 250, slot: 'xmdh', showOverflowTooltip: false },
|
||||
{ prop: 'tdh', label: '双工代号', visible: true, align: 'center', slot: 'tdh' },
|
||||
{ prop: 'mrz', label: '默认值', visible: true, align: 'center', slot: 'mrz' },
|
||||
{ prop: 'seq', label: '序号', visible: true, align: 'center', },
|
||||
{ prop: 'seq', label: '序号', visible: true, align: 'center', slot: 'seq' },
|
||||
{ prop: 'def', label: '非必做', visible: true, align: 'center', slot: 'def' },
|
||||
]);
|
||||
|
||||
const tableRefLeft = ref()
|
||||
// 获取数据列表
|
||||
const getList = async () => {
|
||||
const res = await queryListService(formData.value)
|
||||
dataListLeft.value = res.data
|
||||
rowClickLeft(dataListLeft.value[0] || { sqxmdh: '', sqxmmc: '' })
|
||||
if (dataListLeft.value.length) {
|
||||
rowClickLeft(dataListLeft.value[0])
|
||||
tableRefLeft.value?.setCurrentRow(dataListLeft.value[0])
|
||||
} else {
|
||||
dataListRight.value = []
|
||||
selectRow.value = null
|
||||
}
|
||||
}
|
||||
|
||||
const rowHandle = (row: any) => {
|
||||
selectRow.value = row
|
||||
}
|
||||
|
||||
const onClickAdd = () => {
|
||||
// TODO 新增
|
||||
dataListRight.value.push({
|
||||
xmdh: '',
|
||||
tdh: '',
|
||||
mrz: '',
|
||||
seq: dataListRight.value.length + 1,
|
||||
def: '0',
|
||||
})
|
||||
}
|
||||
|
||||
const onClickDel = () => {
|
||||
// TODO 删除
|
||||
if (!selectRow.value) return ElMessage.warning('请选择要删除的行!')
|
||||
|
||||
if (selectRow.value.sqxmdh) {
|
||||
delXminfo(selectRow.value)
|
||||
rowClickLeft(xmInfo.value)
|
||||
} else {
|
||||
dataListRight.value = dataListRight.value.filter(item => item.xmdh != selectRow.value.xmdh)
|
||||
}
|
||||
selectRow.value = null
|
||||
}
|
||||
|
||||
const onClickSave = () => {
|
||||
// TODO 保存
|
||||
dataListRight.value = dataListRight.value.filter(item => item.xmdh)
|
||||
const arr = dataListRight.value.map(item => {
|
||||
return {
|
||||
...item,
|
||||
sqxmdh: xmInfo.value.sqxmdh,
|
||||
sqxmmc: xmInfo.value.sqxmmc,
|
||||
yq: formData.value.yq,
|
||||
}
|
||||
})
|
||||
|
||||
addXminfo(arr).then(() => {
|
||||
ElMessage.success('保存成功')
|
||||
rowClickLeft(xmInfo.value)
|
||||
})
|
||||
}
|
||||
|
||||
const searchHandle = () => {
|
||||
searchxminfo({ yq: formData.value.yq })
|
||||
}
|
||||
const getDataValue = (value: any) => {
|
||||
getOldXminfoList()
|
||||
getList()
|
||||
}
|
||||
|
||||
const xmInfo: any = ref({})
|
||||
//点击事件
|
||||
const rowClickLeft = async (row: any) => {
|
||||
selectRow.value = null
|
||||
xmInfo.value = row
|
||||
const res = await queryDetailService({ sqxmdh: row.sqxmdh, sqxmmc: row.sqxmmc, yq: formData.value.yq })
|
||||
dataListRight.value = res.rows
|
||||
}
|
||||
|
||||
const getOldXminfoList = async () => {
|
||||
const res = await queryOldxminfo({ yq: formData.value.yq })
|
||||
xmList.value = res.data.map((item: any) => {
|
||||
return {
|
||||
label: item.xmmc,
|
||||
value: item.xmdh,
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getOldXminfoList()
|
||||
getList()
|
||||
</script>
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange" @row-click="rowHandle">
|
||||
<template #patAge="{ row }">
|
||||
@ -84,7 +84,7 @@
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
</div>
|
||||
<!-- 样本流程 -->
|
||||
<div class="time-line-box">
|
||||
<div v-for="(item, i) in timelineItems" :key="i" class="time-line-item">
|
||||
@ -258,6 +258,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
<el-button type="primary" @click="qsHandle(110)">标本拒签</el-button>
|
||||
<el-button type="primary" plain @click="bbThHandle">标本退回</el-button>
|
||||
</div>
|
||||
|
||||
<div style="height: calc(100% - 180px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
@ -73,7 +73,7 @@
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -113,7 +113,7 @@ const columns: any = ref([
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '68vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
@ -228,6 +228,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -60,6 +60,7 @@
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
|
||||
|
||||
</div>
|
||||
<div style="height: calc(100% - 180px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
@ -73,6 +74,7 @@
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -109,7 +111,7 @@ const columns: any = ref([
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '68vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
@ -200,6 +202,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -229,6 +229,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -4,15 +4,39 @@
|
||||
<el-form :model="queryParams" ref="queryRef" label-width="5rem" style="width: 100%;" :size="aotuSize">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="所属医院:" prop="DstHospName">
|
||||
<el-form-item label="委托机构:" prop="SrcHospName">
|
||||
<SelectTable v-model:data="queryParams.SrcHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="value" objKey="value" :border="true" placeholder="请选择委托机构" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="检测医院:" prop="DstHospName">
|
||||
<SelectTable v-model:data="queryParams.DstHospName" :fields="ksdhFields" :tableData="hosList"
|
||||
label="label" :size="aotuSize" value="label" objKey="label" :border="true" placeholder="请选择" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="标本类型:" prop="SampleTypeName">
|
||||
<el-select v-model="queryParams.SampleTypeName" placeholder="请选择" clearable>
|
||||
<el-option v-for="item in regdictList" :label="item.dictName" :value="item.dictCode" />
|
||||
<el-form-item label="条码号:" prop="Barcode">
|
||||
<el-input v-model="queryParams.Barcode" placeholder="请输入条码号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名:" prop="PatName">
|
||||
<el-input v-model="queryParams.PatName" placeholder="请输入姓名" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="申请项目:" prop="checkPUR">
|
||||
<el-input v-model="queryParams.checkPUR" placeholder="请输入申请项目" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="时间类型:" prop="DateType">
|
||||
<el-select v-model="queryParams.DateType" placeholder="请选择">
|
||||
<el-option label="登记时间" value="登记时间" />
|
||||
<el-option label="采样时间" value="采样时间" />
|
||||
<el-option label="送出时间" value="送出时间" />
|
||||
<el-option label="签收时间" value="签收时间" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -31,20 +55,31 @@
|
||||
</div>
|
||||
|
||||
<div class="mb10">
|
||||
<!-- <el-button type="primary" @click="thHandle(20)">重新采集</el-button>
|
||||
<el-button type="primary" @click="thHandle(20)">重新采集</el-button>
|
||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
||||
</div>
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange">
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
|
||||
|
||||
</div>
|
||||
<div style="height: calc(100% - 180px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { sampleTypeCount } from '@/api/regional/index'
|
||||
import { querySampleSignBack, sampleSign } from '@/api/regional/index'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { classCom } from '@/utils/classCom';
|
||||
// @ts-ignore
|
||||
@ -53,28 +88,32 @@ import { listhospital } from "@/api/regional/dict/hospital.js";
|
||||
import { listregdict } from "@/api/regional/dict/regdict.js";
|
||||
import { ElMessage } from 'element-plus';
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const today = dayjs().format('YYYY-MM-DD');
|
||||
const queryParams: any = ref({
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
times: [today, today]
|
||||
})
|
||||
const tableData: any = ref([])
|
||||
const columns: any = ref([
|
||||
{ prop: 'srchospname', label: '所属医院', align: 'center', visible: true, },
|
||||
{ prop: 'sampletypecode', label: '标本代码', align: 'center', visible: true, },
|
||||
{ prop: 'sampletypename', label: '标本类别', align: 'center', visible: true, },
|
||||
{ prop: 'sl', label: '数量(份)', align: 'center', visible: true, },
|
||||
{ type: 'selection', align: 'center', visible: true, width: 40 },
|
||||
{ prop: 'barcode', label: '条码号', align: 'center', visible: true, },
|
||||
{ prop: 'patName', label: '姓名', align: 'center', visible: true, width: 60 },
|
||||
{ prop: 'patSex', label: '性别', align: 'center', visible: true, width: 60, slot: "patSex" },
|
||||
{ prop: 'patAge', label: '年龄', align: 'center', visible: true, slot: "patAge", width: 60 },
|
||||
{ prop: 'checkPUR', label: '申请项目', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'srcHospName', label: '委托机构', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'srcHospName', label: '检测机构', align: 'center', visible: true, width: 200 },
|
||||
{ prop: 'Status', label: '标本状态', align: 'center', visible: true, slot: "status" },
|
||||
{ prop: 'backReasons', label: '退回理由', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'affirmTime', label: '采样时间', align: 'center', visible: true, width: 150 },
|
||||
{ prop: 'backUserName', label: '操作人', align: 'center', visible: true, },
|
||||
{ prop: 'backTime', label: '操作时间', align: 'center', visible: true, width: 150 },
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '75vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
summary: true,
|
||||
summaryField: ['sl'],//计算列总和
|
||||
sumText: '合计'
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
|
||||
const pagination = ref({
|
||||
@ -91,7 +130,15 @@ const ksdhFields = ref([
|
||||
const barcodes = ref([])
|
||||
const tableRefs = ref(null)
|
||||
|
||||
|
||||
const thHandle = (val: number) => {
|
||||
if (!barcodes.value.length) return ElMessage.warning('请选择数据!')
|
||||
sampleSign({ status: val, barcode: barcodes.value }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('操作成功!')
|
||||
handleQuery()
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleSelectionChange = (val: any) => {
|
||||
barcodes.value = val.map((item: any) => item.barcode)
|
||||
}
|
||||
@ -121,12 +168,11 @@ const resetHandle = () => {
|
||||
queryParams.value = {
|
||||
pageSize: 50,
|
||||
pageNum: 1,
|
||||
times: [today, today]
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
const getList = () => {
|
||||
sampleTypeCount(queryParams.value).then((res: any) => {
|
||||
querySampleSignBack(queryParams.value).then((res: any) => {
|
||||
tableData.value = res.rows
|
||||
pagination.value.total = res.total
|
||||
})
|
||||
@ -134,7 +180,7 @@ const getList = () => {
|
||||
const hosList = ref([])
|
||||
const regdictList: any = ref([])
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
getList()
|
||||
listhospital().then((res: any) => {
|
||||
hosList.value = res.rows.map((item: any) => {
|
||||
return {
|
||||
@ -144,8 +190,8 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'BT' }).then((res: any) => {
|
||||
regdictList.value = res.rows
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'ZT' }).then((res: any) => {
|
||||
regdictList.value = res.rows;
|
||||
})
|
||||
})
|
||||
|
||||
@ -156,6 +202,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -35,11 +35,13 @@
|
||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
||||
</div>
|
||||
<div style="height: calc(100% - 100px);">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange">
|
||||
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -71,7 +73,7 @@ const columns: any = ref([
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '75vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
summary: true,
|
||||
summaryField: ['sl', 'cost'],//计算列总和
|
||||
@ -165,6 +167,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 2.5rem;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user