Merge branch 'main' of http://47.97.125.165:8902/jiangs/lis8.0-vue3
This commit is contained in:
commit
13d09216b1
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@ -68,9 +68,6 @@ importers:
|
|||||||
pinia:
|
pinia:
|
||||||
specifier: 2.1.7
|
specifier: 2.1.7
|
||||||
version: 2.1.7(typescript@5.9.3)(vue@3.5.23(typescript@5.9.3))
|
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:
|
pinyin-pro:
|
||||||
specifier: ^3.26.0
|
specifier: ^3.26.0
|
||||||
version: 3.27.0
|
version: 3.27.0
|
||||||
@ -1139,9 +1136,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==}
|
resolution: {integrity: sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
|
|
||||||
defu@6.1.4:
|
|
||||||
resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}
|
|
||||||
|
|
||||||
delayed-stream@1.0.0:
|
delayed-stream@1.0.0:
|
||||||
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
|
||||||
engines: {node: '>=0.4.0'}
|
engines: {node: '>=0.4.0'}
|
||||||
@ -2134,20 +2128,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
|
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
|
||||||
engines: {node: '>=12'}
|
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:
|
pinia@2.1.7:
|
||||||
resolution: {integrity: sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ==}
|
resolution: {integrity: sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -3780,8 +3760,6 @@ snapshots:
|
|||||||
is-descriptor: 1.0.3
|
is-descriptor: 1.0.3
|
||||||
isobject: 3.0.1
|
isobject: 3.0.1
|
||||||
|
|
||||||
defu@6.1.4: {}
|
|
||||||
|
|
||||||
delayed-stream@1.0.0: {}
|
delayed-stream@1.0.0: {}
|
||||||
|
|
||||||
delegate@3.2.0: {}
|
delegate@3.2.0: {}
|
||||||
@ -4907,12 +4885,6 @@ snapshots:
|
|||||||
|
|
||||||
picomatch@4.0.2: {}
|
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)):
|
pinia@2.1.7(typescript@5.9.3)(vue@3.5.23(typescript@5.9.3)):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vue/devtools-api': 6.6.4
|
'@vue/devtools-api': 6.6.4
|
||||||
|
|||||||
@ -106,68 +106,4 @@ export function querySjcs(data?: Object) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: data
|
params: data
|
||||||
});
|
});
|
||||||
}
|
|
||||||
// 查询检验项目排序
|
|
||||||
export function getitemsort(data?: Object) {
|
|
||||||
return request({
|
|
||||||
url: '/xminfo/getitemsort',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 保存检验项目排序
|
|
||||||
export function saveitemsort(data?: Object) {
|
|
||||||
return request({
|
|
||||||
url: '/xminfo/saveitemsort',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 查询检验项目通道号
|
|
||||||
export function getitemtdh(data?: Object) {
|
|
||||||
return request({
|
|
||||||
url: '/xminfo/getitemtdh',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 保存检验项目通道号
|
|
||||||
export function saveitemtdh(data?: Object) {
|
|
||||||
return request({
|
|
||||||
url: '/xminfo/saveitemtdh',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 删除检验项目通道号
|
|
||||||
export function delitemtdh(data?: Object) {
|
|
||||||
return request({
|
|
||||||
url: '/xminfo/delitemtdh',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 获取仪器参数
|
|
||||||
export function querydouble(data?: Object) {
|
|
||||||
return request({
|
|
||||||
url: '/xminfo/querydouble',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 保存仪器参数
|
|
||||||
export function savedouble(data?: Object) {
|
|
||||||
return request({
|
|
||||||
url: '/xminfo/savedouble',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 获取参数默认模板
|
|
||||||
export function querymbmc(data?: Object) {
|
|
||||||
return request({
|
|
||||||
url: '/xminfo/querymbmc',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
54
src/api/liswork/xtwh/reportdictApi.ts
Normal file
54
src/api/liswork/xtwh/reportdictApi.ts
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
//参数设置字典
|
||||||
|
// @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'
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -124,7 +124,7 @@ aside {
|
|||||||
//main-container全局样式
|
//main-container全局样式
|
||||||
.app-container {
|
.app-container {
|
||||||
padding: 10px 10px 0 10px;
|
padding: 10px 10px 0 10px;
|
||||||
height: calc(100vh - 5.25rem);
|
min-height: calc(100vh - 5.25rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.components-container {
|
.components-container {
|
||||||
@ -133,7 +133,7 @@ aside {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.pagination-container {
|
.pagination-container {
|
||||||
margin-top: 10px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-center {
|
.text-center {
|
||||||
|
|||||||
@ -4,10 +4,18 @@
|
|||||||
<template v-if="values.includes(item.value)">
|
<template v-if="values.includes(item.value)">
|
||||||
<span
|
<span
|
||||||
v-if="(item.elTagType == 'default' || item.elTagType == '') && (item.elTagClass == '' || item.elTagClass == null)"
|
v-if="(item.elTagType == 'default' || item.elTagType == '') && (item.elTagClass == '' || item.elTagClass == null)"
|
||||||
:key="item.value" :index="index" :class="item.elTagClass">{{ item.label + " " }}</span>
|
:key="item.value"
|
||||||
<el-tag v-else :disable-transitions="true" :key="item.value + ''" :index="index"
|
:index="index"
|
||||||
:type="item.elTagType === 'primary' ? 'primary' : item.elTagType" :class="item.elTagClass">{{ item.label + " "
|
:class="item.elTagClass"
|
||||||
}}</el-tag>
|
>{{ item.label + " " }}</span>
|
||||||
|
<el-tag
|
||||||
|
v-else
|
||||||
|
:disable-transitions="true"
|
||||||
|
:key="item.value + ''"
|
||||||
|
:index="index"
|
||||||
|
:type="item.elTagType === 'primary' ? '' : item.elTagType"
|
||||||
|
:class="item.elTagClass"
|
||||||
|
>{{ item.label + " " }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="unmatch && showValue">
|
<template v-if="unmatch && showValue">
|
||||||
@ -68,7 +76,7 @@ function handleArray(array) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-tag+.el-tag {
|
.el-tag + .el-tag {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<SelectTable v-model:data="modelValue" :fields="fields" :tableData="instrOptions" label="yqmc" :size="props.size"
|
<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"
|
value="yq" objKey="yq" :border="true" :width="props.width" placeholder="请选择仪器" :clearable="props.clearable"
|
||||||
@getDataValue="getDataValue" v-bind="$attrs" />
|
@getDataValue="getDataValue" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@ -61,7 +61,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
dictType: '',
|
dictType: '',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
objKey: 'value',
|
objKey: 'value',
|
||||||
keyValue: false,
|
|
||||||
fields: () => [
|
fields: () => [
|
||||||
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
|
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
|
||||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||||
@ -117,7 +116,7 @@ const visibleChange = (val: any) => {
|
|||||||
currentIndex.value = filterData.value.findIndex(item => item[props.value!] === props.data);
|
currentIndex.value = filterData.value.findIndex(item => item[props.value!] === props.data);
|
||||||
if (currentIndex.value >= 0) {
|
if (currentIndex.value >= 0) {
|
||||||
tableRef.value.setCurrentRow(filterData.value[currentIndex.value]);
|
tableRef.value.setCurrentRow(filterData.value[currentIndex.value]);
|
||||||
tableRef.value.setScrollTop(currentIndex.value * 30);
|
tableRef.value.setScrollTop(currentIndex.value);
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
@ -141,7 +140,7 @@ const handleDataEcho = () => {
|
|||||||
} else if (props.tableData) {
|
} else if (props.tableData) {
|
||||||
row = props.tableData?.find((item: any) => props.objKey && item[props.objKey] === props.data)
|
row = props.tableData?.find((item: any) => props.objKey && item[props.objKey] === props.data)
|
||||||
}
|
}
|
||||||
selectShowValue.value = row ? (props.keyValue ? `${row[props.value]} ${row[props.label]}` : (props.label ? row[props.label] : (props.value ? row[props.value] : ''))) : '';
|
selectShowValue.value = row ? (props.label ? row[props.label] : (props.value ? row[props.value] : '')) : '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -239,7 +238,7 @@ const handleKeydown = (e: any) => {
|
|||||||
tableRef.value.setCurrentRow(filterData.value[currentIndex.value]);
|
tableRef.value.setCurrentRow(filterData.value[currentIndex.value]);
|
||||||
|
|
||||||
// 滚动到当前行
|
// 滚动到当前行
|
||||||
tableRef.value.setScrollTop(currentIndex.value * 30);
|
tableRef.value.setScrollTop(currentIndex.value);
|
||||||
|
|
||||||
// 回车确认
|
// 回车确认
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
@ -302,8 +301,6 @@ const setLabel = (val: any) => {
|
|||||||
selectShowValue.value = val[props.label];
|
selectShowValue.value = val[props.label];
|
||||||
} else if (props.value) {
|
} else if (props.value) {
|
||||||
selectShowValue.value = val[props.value];
|
selectShowValue.value = val[props.value];
|
||||||
} else if (props.keyValue) {
|
|
||||||
selectShowValue.value = `${val[props.value]} ${val[props.label]}`;
|
|
||||||
}
|
}
|
||||||
if (props.objKey) {
|
if (props.objKey) {
|
||||||
// 返回值objKey对应的对象数据
|
// 返回值objKey对应的对象数据
|
||||||
|
|||||||
@ -33,12 +33,12 @@ export const getDictData = async (...args: string[]) => {
|
|||||||
//字典数据格式化方法
|
//字典数据格式化方法
|
||||||
export const formatDict = (v: string, dictType: string) => {
|
export const formatDict = (v: string, dictType: string) => {
|
||||||
if (v == undefined) return;
|
if (v == undefined) return;
|
||||||
return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label || v;
|
return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label;
|
||||||
}
|
}
|
||||||
|
|
||||||
//仪器格式化方法
|
//仪器格式化方法
|
||||||
export const formatInstr = (v: string) => {
|
export const formatInstr = (v: string) => {
|
||||||
return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc || v;
|
return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { dictData, instrOptions }
|
export { dictData, instrOptions }
|
||||||
1
src/types/SelectTable.d.ts
vendored
1
src/types/SelectTable.d.ts
vendored
@ -18,7 +18,6 @@ export interface Props {
|
|||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
dictType?: string;
|
dictType?: string;
|
||||||
clearable?: boolean;
|
clearable?: boolean;
|
||||||
keyValue?: boolean; //是否使用键值对模式
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -171,7 +171,13 @@ service.interceptors.response.use(res => {
|
|||||||
})
|
})
|
||||||
return Promise.reject('error');
|
return Promise.reject('error');
|
||||||
} else if (code === 1) {
|
} else if (code === 1) {
|
||||||
//提示并返回数据
|
//提示并失败
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: msg,
|
||||||
|
type: 'error',
|
||||||
|
duration: 0,
|
||||||
|
})
|
||||||
return Promise.resolve(res.data)
|
return Promise.resolve(res.data)
|
||||||
} else if (code === 4) {
|
} else if (code === 4) {
|
||||||
//返回特定值,需要后续处理,表示当前操作需要处理后再调用,problemId是步骤关键参数,需要再次调用时引入
|
//返回特定值,需要后续处理,表示当前操作需要处理后再调用,problemId是步骤关键参数,需要再次调用时引入
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true"
|
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig">
|
:config="tableConfig">
|
||||||
<template #reserve="{ row }">
|
<template #reserve="{row}">
|
||||||
{{ reserve(row.reserve) }}
|
{{ reserve(row.reserve) }}
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CustomTable from '@/components/elTable/index.vue'
|
import CustomTable from '@/components/elTable/index.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dataList: {
|
dataList:{
|
||||||
type: Array,
|
type: Array,
|
||||||
required: false,
|
required: false,
|
||||||
default: []
|
default: []
|
||||||
@ -23,17 +23,17 @@ const props = defineProps({
|
|||||||
reserveWidth: 50,
|
reserveWidth: 50,
|
||||||
textresultWidth: 200,
|
textresultWidth: 200,
|
||||||
zdWidth: 100,
|
zdWidth: 100,
|
||||||
tableHeight: '100%'
|
tableHeight: '85vh'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//const dataListRight = ref([]);
|
//const dataListRight = ref([]);
|
||||||
const columnsRight = ref([
|
const columnsRight = ref([
|
||||||
{ prop: 'reserve', label: '类别', visible: true, align: 'center', slot: 'reserve', },
|
{ prop: 'reserve', label: '类别', visible: true, align: 'center',slot: 'reserve', width: props.styleConfig.reserveWidth },
|
||||||
{ prop: 'textresult', label: '说明', visible: true, align: 'center', showOverflowTooltip: false },
|
{ prop: 'textresult', label: '说明', visible: true, align: 'center', width: props.styleConfig.textresultWidth ,showOverflowTooltip: false},
|
||||||
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', showOverflowTooltip: false },
|
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', width: props.styleConfig.zdWidth,showOverflowTooltip: false },
|
||||||
])
|
])
|
||||||
|
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
@ -50,13 +50,13 @@ const handleColumnDragEnd = (data: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const reserve = (reserve: string) => {
|
const reserve = (reserve:string) => {
|
||||||
switch (reserve) {
|
switch(reserve){
|
||||||
case '1':
|
case '1':
|
||||||
return '综述'
|
return '综述'
|
||||||
case 'H':
|
case 'H':
|
||||||
return '偏高'
|
return '偏高'
|
||||||
case 'L':
|
case 'L':
|
||||||
return '偏低'
|
return '偏低'
|
||||||
case 'P':
|
case 'P':
|
||||||
return '阳性'
|
return '阳性'
|
||||||
@ -72,4 +72,5 @@ const reserve = (reserve: string) => {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
|
|||||||
@ -1,54 +1,46 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="topForm">
|
||||||
<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-form-item label="检索" prop="js">
|
<el-input placeholder="项目代号,名称,简拼" v-model="formData.js" style="width: 200px;" @keyup.enter="getList"></el-input>
|
||||||
<el-input placeholder="项目代号,名称,简拼" v-model="formData.js" style="width: 200px;"
|
</el-form-item>
|
||||||
@keyup.enter="getList"></el-input>
|
</el-form>
|
||||||
</el-form-item>
|
</div>
|
||||||
<el-form-item>
|
<el-row>
|
||||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||||
</el-form-item>
|
<el-button type="primary" @click="onAddClick">新增</el-button>
|
||||||
</el-form>
|
<el-button type="primary" @click="onDelClick">删除</el-button>
|
||||||
</div>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="primary" @click="onAddClick">新增</el-button>
|
<el-col :span="17">
|
||||||
<el-button type="danger" @click="onDelClick">删除</el-button>
|
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||||
</el-row>
|
:config="tableConfig" @row-dblclick="onDBClick" @row-click="onClick" :pagination="pagination" @size-change="sizeChange" @page-change="currentChange">
|
||||||
<el-row :gutter="20" class="table-row">
|
<template #xsbz="{row}">
|
||||||
<el-col :span="17" class="table-col">
|
<el-checkbox :model-value="row.xsbz === '1'"/>
|
||||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true"
|
</template>
|
||||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClick" @row-click="onClick"
|
</CustomTable>
|
||||||
:pagination="pagination" @size-change="sizeChange" @page-change="currentChange">
|
</el-col>
|
||||||
<template #xsbz="{ row }">
|
<el-col :span="7">
|
||||||
<el-checkbox :model-value="row.xsbz === '1'" />
|
<TableRight :data-list="dataListRight"/>
|
||||||
</template>
|
</el-col>
|
||||||
</CustomTable>
|
</el-row>
|
||||||
</el-col>
|
|
||||||
<el-col :span="7" class="table-col">
|
|
||||||
<TableRight :data-list="dataListRight" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<Modify ref="modifyRef" v-model="modifyVisible" :title="modifyTitle" :type="modifyType"
|
|
||||||
@close-with-return="closeWithReturn" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<Modify ref="modifyRef" v-model="modifyVisible" :title="modifyTitle" :type="modifyType" @close-with-return="closeWithReturn"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CustomTable from '@/components/elTable/index.vue'
|
import CustomTable from '@/components/elTable/index.vue'
|
||||||
import { queryService, queryDetailService, delService } from '@/api/liswork/xmKnowledge/xmKnowledgeApi'
|
import {queryService,queryDetailService,delService} from '@/api/liswork/xmKnowledge/xmKnowledgeApi'
|
||||||
import TableRight from './TableData.vue'
|
import TableRight from './TableData.vue'
|
||||||
import Modify from './Modify.vue'
|
import Modify from './Modify.vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage,ElMessageBox } from 'element-plus';
|
||||||
|
|
||||||
const dataListLeft = ref([]);
|
const dataListLeft = ref([]);
|
||||||
const dataListRight = ref([]);
|
const dataListRight = ref([]);
|
||||||
const columnsLeft = ref([
|
const columnsLeft = ref([
|
||||||
{ prop: 'xmid', label: '知识库ID', visible: true, align: 'center', width: 100 },
|
{ prop: 'xmid', label: '知识库ID', visible: true, align: 'center', width: 100 },
|
||||||
{ prop: 'xmdh', label: '项目代号', visible: true, align: 'center', width: 100 },
|
{ prop: 'xmdh', label: '项目代号', visible: true, align: 'center', width: 100 },
|
||||||
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center', width: 200 },
|
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center', width: 200 },
|
||||||
{ prop: 'xsbz', label: '显示标志', visible: true, align: 'center', slot: 'xsbz', width: 100 },
|
{ prop: 'xsbz', label: '显示标志', visible: true, align: 'center', slot: 'xsbz', width: 100 },
|
||||||
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', width: 100 },
|
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', width: 100 },
|
||||||
{ prop: 'xmz', label: '所属组', visible: true, align: 'center', width: 100 },
|
{ prop: 'xmz', label: '所属组', visible: true, align: 'center', width: 100 },
|
||||||
@ -65,7 +57,7 @@ const columnsLeft = ref([
|
|||||||
|
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '100%', // 高度
|
height: '85vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
// cellStyle: cellStyleHd
|
// cellStyle: cellStyleHd
|
||||||
})
|
})
|
||||||
@ -104,7 +96,7 @@ const formData = ref({
|
|||||||
js: ''
|
js: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const closeWithReturn = () => {
|
const closeWithReturn = () =>{
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,17 +104,17 @@ const handleSubmit = (event: any) => {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClick = async (row: any) => {
|
const onClick = async (row:any) => {
|
||||||
const res = await queryDetailService(row.xmid);
|
const res = await queryDetailService(row.xmid);
|
||||||
dataListRight.value = res.data
|
dataListRight.value = res.data
|
||||||
selectRow.value = row
|
selectRow.value = row
|
||||||
}
|
}
|
||||||
|
|
||||||
const onDBClick = () => {
|
const onDBClick = ()=>{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onAddClick = () => {
|
const onAddClick = ()=> {
|
||||||
modifyVisible.value = true
|
modifyVisible.value = true
|
||||||
modifyTitle.value = '新增'
|
modifyTitle.value = '新增'
|
||||||
modifyType.value = '新增'
|
modifyType.value = '新增'
|
||||||
@ -130,12 +122,12 @@ const onAddClick = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onDelClick = async () => {
|
const onDelClick = async () => {
|
||||||
if (selectRow.value) {
|
if(selectRow.value){
|
||||||
await ElMessageBox.confirm('是否要删除选中的数据?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', });
|
await ElMessageBox.confirm('是否要删除选中的数据?','警告',{confirmButtonText: '确定',cancelButtonText: '取消',});
|
||||||
await delService(selectRow.value.xmid)
|
await delService(selectRow.value.xmid)
|
||||||
ElMessage.success('删除成功!')
|
ElMessage.success('删除成功!')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onQueryClick = () => {
|
const onQueryClick = () => {
|
||||||
@ -143,29 +135,29 @@ const onQueryClick = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
const data = { pageSize: pagination.value.pageSize, pageNum: pagination.value.currentPage, inputData: formData.value.js }
|
const data = {pageSize: pagination.value.pageSize, pageNum: pagination.value.currentPage,inputData: formData.value.js }
|
||||||
const res = await queryService(data);
|
const res = await queryService(data);
|
||||||
dataListLeft.value = res.rows
|
dataListLeft.value = res.rows
|
||||||
pagination.value.total = res.total
|
pagination.value.total = res.total
|
||||||
|
|
||||||
dataListRight.value = []
|
dataListRight.value = []
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(()=>{
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.table-row {
|
.el-row {
|
||||||
height: calc(100% - 150px);
|
margin-top: 5px;
|
||||||
margin-top: 10px;
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.table-col {
|
.topForm {
|
||||||
height: 100%;
|
margin-top: 10px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -11,114 +11,70 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" @click="delItem">删除</el-button>
|
<el-button type="danger" plain icon="Delete" @click="delItem">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="Delete" @click="allClear">清除所有项目接口号</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<div class="table-row">
|
<el-row :gutter="10" class="table-row">
|
||||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
<el-col :span="12" class="table-box">
|
||||||
@row-click="handleRowClick">
|
<el-table :data="tableData" height="100%" border highlight-current-row>
|
||||||
<template #tdh="{ row }">
|
<el-table-column label="通道号" align="center">
|
||||||
<el-input v-model="row.tdh" placeholder="请输入通道号" class="full-width-input" />
|
<template #default="scope">
|
||||||
</template>
|
<el-input v-model="scope.row.channel" placeholder="请输入通道号" class="full-width-input" />
|
||||||
<template #xmmc="{ row }">
|
</template>
|
||||||
<SelectTable v-model:data="row.xmdh" :tableData="xmList" class="full-width-input" />
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="项目" align="center">
|
||||||
</CustomTable>
|
<template #default="scope">
|
||||||
</div>
|
<SelectTable v-model:data="scope.row.xmid" :tableData="xmList" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="tips">
|
||||||
|
说明:
|
||||||
|
“通道号”又称“接口代号”,是指仪器向电脑传送结果时项目的
|
||||||
|
标识符
|
||||||
|
接口代号对于一个仪器不可重复。
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { queryXmInfo, } from '@/api/liswork/work/LisWork';
|
import { queryXmInfoNewService } from '@/api/liswork/labItem/labItemApi';
|
||||||
import { getitemtdh, saveitemtdh, delitemtdh } from '@/api/liswork/xtwh/ComOpt';
|
|
||||||
import { ElMessage } from 'element-plus';
|
|
||||||
const yq = defineModel<string>();
|
const yq = defineModel<string>();
|
||||||
const loading = ref(false);
|
|
||||||
const tableRef = ref();
|
|
||||||
const tableData = ref<Array<{ tdh: string, xmdh: string }>>([]);
|
|
||||||
const columns = [
|
|
||||||
{ label: '序号', type: 'index', visible: true, width: 50, align: 'center' },
|
|
||||||
{ label: '通道号', prop: 'tdh', visible: true, align: 'center', slot: 'tdh' },
|
|
||||||
{ label: '项目代号', prop: 'xmdh', visible: true, align: 'center' },
|
|
||||||
{ label: '项目', prop: 'xmmc', visible: true, align: 'center', slot: 'xmmc', showOverflowTooltip: false, width: 250 },
|
|
||||||
{ label: '项目id', prop: 'xmid', visible: true, align: 'center' },
|
|
||||||
];
|
|
||||||
const tableConfig = {
|
|
||||||
border: true,
|
|
||||||
height: '100%',
|
|
||||||
highlightCurrentRow: true,
|
|
||||||
}
|
|
||||||
const handleSave = () => {
|
|
||||||
const flag = tableData.value.every(item => item.tdh)
|
|
||||||
if (!flag) return ElMessage.error('请检查填写参数,通道号不能为空!')
|
|
||||||
let index = -1;
|
|
||||||
tableData.value.forEach((item, i) => {
|
|
||||||
const tdhLower = item.tdh.trim().toUpperCase();
|
|
||||||
index = tableData.value.findIndex(i => i.tdh.trim().toUpperCase() === tdhLower && i.tdh !== item.tdh);
|
|
||||||
if (index !== -1) {
|
|
||||||
return ElMessage.error(`通道号 ${item.tdh} ${i + 1}行已存在!`)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (index !== -1) return
|
|
||||||
const arr = tableData.value.map(item => {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
tdh: item.tdh.trim().toUpperCase(),
|
|
||||||
yq: yq.value
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
saveitemtdh(arr).then((res: any) => {
|
const tableData = ref<Array<{ channel: string }>>([]);
|
||||||
if (res.code == 0) {
|
const handleSave = () => {
|
||||||
ElMessage.success('保存成功!')
|
|
||||||
getChannel()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
const selectedRow = ref<any>(null);
|
|
||||||
const handleRowClick = (row: any) => {
|
|
||||||
selectedRow.value = row;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const addItem = () => {
|
const addItem = () => {
|
||||||
tableData.value.push({ tdh: '', xmdh: '' })
|
tableData.value.push({ channel: '' })
|
||||||
nextTick(() => {
|
|
||||||
tableRef.value.setScrollTop(tableData.value.length)
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const delItem = () => {
|
const delItem = () => {
|
||||||
if (!selectedRow.value) return ElMessage.error('请选择要删除的行!')
|
|
||||||
delitemtdh({ yq: yq.value, tdh: selectedRow.value.tdh })
|
|
||||||
tableData.value = tableData.value.filter(item => item.xmdh !== selectedRow.value.xmdh)
|
|
||||||
getChannel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const allClear = () => {
|
const allClear = () => {
|
||||||
}
|
}
|
||||||
const xmList = ref<Array<{ xmmc: string, xmdh: string }>>([]);
|
const xmList = ref<Array<{ xmmc: string, xmid: string }>>([]);
|
||||||
const getXmList = () => {
|
const getXmList = () => {
|
||||||
loading.value = true;
|
queryXmInfoNewService({ yq: yq.value }).then((res: any) => {
|
||||||
queryXmInfo({ yq: yq.value }).then((res: any) => {
|
xmList.value = res.rows.map((item: any) => {
|
||||||
loading.value = false;
|
|
||||||
xmList.value = res.data.map((item: any) => {
|
|
||||||
return {
|
return {
|
||||||
label: item.xmmc,
|
label: item.xmmc,
|
||||||
value: item.xmdh,
|
value: item.xmid.toString(),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
const getChannel = () => {
|
watch(() => yq.value, (val) => {
|
||||||
getitemtdh({ yq: yq.value }).then((res: any) => {
|
|
||||||
tableData.value = res.data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(yq, (val) => {
|
|
||||||
if (val) {
|
if (val) {
|
||||||
getXmList();
|
getXmList();
|
||||||
getChannel();
|
|
||||||
}
|
}
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,169 +1,159 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 参数列表 -->
|
<!-- 参数列表 -->
|
||||||
<div>
|
<div>
|
||||||
<template v-if="paramsFlag">
|
<el-row :gutter="10" class="table-toolbar">
|
||||||
<el-row :gutter="10" class="table-toolbar">
|
<el-col :span="1.5">
|
||||||
<el-col :span="1.5">
|
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
|
||||||
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="1.5">
|
||||||
<!-- <el-col :span="1.5">
|
|
||||||
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
|
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
|
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
|
||||||
</el-col> -->
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-form ref="form" :model="formData" :rules="rules" label-width="120px" class="form-inline" inline>
|
||||||
|
<div class="title">说明:公式中阴阳对照请用NC,PC表示</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="测试波长" prop="csbc">
|
||||||
|
<el-select v-model="formData.csbc" style="width: 12rem;">
|
||||||
|
<el-option v-for="item in dzList" :key="item.lgph" :value="item.lgph" :label="item.bc" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" style="display: flex;">
|
||||||
|
<el-form-item label="参考波长" prop="ckbc">
|
||||||
|
<el-select v-model="formData.ckbc" style="width: 12rem;">
|
||||||
|
<el-option v-for="item in dzList" :key="item.lgph" :value="item.lgph" :label="item.bc" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button type="primary" @click="openDz">滤光片波长对照表</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="阳性判断公式" prop="yxgs">
|
||||||
|
<el-input v-model="formData.yxgs" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-form ref="form" :model="formData" :rules="rules" label-width="120px" class="form-inline" inline>
|
<el-row>
|
||||||
<div style="display: flex;">
|
<el-col :span="8">
|
||||||
<el-form-item label="项目" prop="xmdh">
|
<el-form-item label="上灰区" prop="shq">
|
||||||
<SelectTable v-model:data="xmdh" :tableData="xmList" style="width: 12rem;" @getDataValue='getXmInfo' />
|
<el-input v-model="formData.shq">
|
||||||
|
<template #append>% </template>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="title">说明:公式中阴阳对照请用NC,PC表示</div>
|
</el-col>
|
||||||
</div>
|
<el-col :span="8">
|
||||||
<el-row>
|
<el-form-item label="下灰区" prop="xhq">
|
||||||
<el-col :span="8">
|
<el-input v-model="formData.xhq">
|
||||||
<el-form-item label="测试波长" prop="csbc">
|
<template #append>% </template>
|
||||||
<el-select v-model="formData.csbc" style="width: 12rem;">
|
</el-input>
|
||||||
<el-option v-for="item in dzList" :key="item.lgph" :value="item.lgph" :label="item.bc" />
|
</el-form-item>
|
||||||
</el-select>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-col>
|
<el-form-item label="阴性对照下限" prop="negxx">
|
||||||
<el-col :span="8" style="display: flex;">
|
<el-input v-model="formData.negxx" />
|
||||||
<el-form-item label="参考波长" prop="ckbc">
|
</el-form-item>
|
||||||
<el-select v-model="formData.ckbc" style="width: 12rem;">
|
</el-col>
|
||||||
<el-option v-for="item in dzList" :key="item.lgph" :value="item.lgph" :label="item.bc" />
|
</el-row>
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-button type="primary" @click="openDz">滤光片波长对照表</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="阳性判断公式" prop="yxgs">
|
|
||||||
<el-input v-model="formData.yxgs" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="上灰区" prop="shq">
|
<el-form-item label="阳性对照下限" prop="posxx">
|
||||||
<el-input v-model="formData.shq">
|
<el-input v-model="formData.posxx" />
|
||||||
<template #append>% </template>
|
</el-form-item>
|
||||||
</el-input>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-col>
|
<el-form-item label="阴性对照上限" prop="negsx">
|
||||||
<el-col :span="8">
|
<el-input v-model="formData.negsx" />
|
||||||
<el-form-item label="下灰区" prop="xhq">
|
</el-form-item>
|
||||||
<el-input v-model="formData.xhq">
|
</el-col>
|
||||||
<template #append>% </template>
|
<el-col :span="8">
|
||||||
</el-input>
|
<el-form-item label="阳性对照上限" prop="possx">
|
||||||
</el-form-item>
|
<el-input v-model="formData.possx" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="阴性对照下限" prop="negxx">
|
<el-col :span="6">
|
||||||
<el-input v-model="formData.negxx" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row>
|
</el-col>
|
||||||
<el-col :span="8">
|
</el-row>
|
||||||
<el-form-item label="阳性对照下限" prop="posxx">
|
|
||||||
<el-input v-model="formData.posxx" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="阴性对照上限" prop="negsx">
|
|
||||||
<el-input v-model="formData.negsx" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="阳性对照上限" prop="possx">
|
|
||||||
<el-input v-model="formData.possx" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
|
|
||||||
</el-col>
|
<el-divider></el-divider>
|
||||||
</el-row>
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="项目性质" prop="xmxz">
|
||||||
|
<el-radio-group v-model="formData.xmxz">
|
||||||
|
<el-radio value="1">定性</el-radio>
|
||||||
|
<el-radio value="2">定量</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="移动模式" prop="ydfs">
|
||||||
|
<el-radio-group v-model="formData.ydfs">
|
||||||
|
<el-radio value="1">连续</el-radio>
|
||||||
|
<el-radio value="2">步进</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
|
||||||
<el-divider></el-divider>
|
<el-form-item label="测试模式" prop="csms">
|
||||||
<el-row>
|
<el-radio-group v-model="formData.csms">
|
||||||
<el-col :span="8">
|
<el-radio value="1">终点法</el-radio>
|
||||||
<el-form-item label="项目性质" prop="xmxz">
|
<el-radio value="2">两点法</el-radio>
|
||||||
<el-radio-group v-model="formData.xmxz">
|
</el-radio-group>
|
||||||
<el-radio value="1">定性</el-radio>
|
</el-form-item>
|
||||||
<el-radio value="2">定量</el-radio>
|
</el-col>
|
||||||
</el-radio-group>
|
</el-row>
|
||||||
</el-form-item>
|
<el-row>
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
<el-col :span="8">
|
<el-form-item label="振板频率" prop="zbpl">
|
||||||
<el-form-item label="移动模式" prop="ydfs">
|
<el-radio-group v-model="formData.zbpl">
|
||||||
<el-radio-group v-model="formData.ydfs">
|
<el-radio value="1">高</el-radio>
|
||||||
<el-radio value="1">连续</el-radio>
|
<el-radio value="2">中</el-radio>
|
||||||
<el-radio value="2">步进</el-radio>
|
<el-radio value="3">低</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
<el-form-item label="空白形式" prop="kbms">
|
||||||
<el-form-item label="测试模式" prop="csms">
|
<el-radio-group v-model="formData.kbms">
|
||||||
<el-radio-group v-model="formData.csms">
|
<el-radio value="1">空气</el-radio>
|
||||||
<el-radio value="1">终点法</el-radio>
|
<el-radio value="2">试剂</el-radio>
|
||||||
<el-radio value="2">两点法</el-radio>
|
</el-radio-group>
|
||||||
</el-radio-group>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
</el-row>
|
<el-form-item label="振板时间" prop="zbsj">
|
||||||
<el-row>
|
<el-input v-model="formData.zbsj">
|
||||||
<el-col :span="8">
|
<template #append>秒</template>
|
||||||
<el-form-item label="振板频率" prop="zbpl">
|
</el-input>
|
||||||
<el-radio-group v-model="formData.zbpl">
|
</el-form-item>
|
||||||
<el-radio value="1">高</el-radio>
|
</el-col>
|
||||||
<el-radio value="2">中</el-radio>
|
</el-row>
|
||||||
<el-radio value="3">低</el-radio>
|
<el-divider></el-divider>
|
||||||
</el-radio-group>
|
<el-row>
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-col>
|
<el-form-item label="默认模板" prop="mrmb">
|
||||||
<el-col :span="8">
|
<el-select v-model="formData.mrmb" style="width: 12rem;">
|
||||||
<el-form-item label="空白形式" prop="kbms">
|
<!-- <el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" /> -->
|
||||||
<el-radio-group v-model="formData.kbms">
|
</el-select>
|
||||||
<el-radio value="1">空气</el-radio>
|
</el-form-item>
|
||||||
<el-radio value="2">试剂</el-radio>
|
</el-col>
|
||||||
</el-radio-group>
|
<el-col :span="8" style="display: flex;">
|
||||||
</el-form-item>
|
<el-form-item label="默认试剂" prop="mrsjph">
|
||||||
</el-col>
|
<el-select v-model="formData.mrsjph" style="width: 12rem;">
|
||||||
<el-col :span="8">
|
<el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" />
|
||||||
<el-form-item label="振板时间" prop="zbsj">
|
</el-select>
|
||||||
<el-input v-model="formData.zbsj">
|
</el-form-item>
|
||||||
<template #append>秒</template>
|
<el-button type="primary" @click="sjHandle">试剂维护</el-button>
|
||||||
</el-input>
|
</el-col>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
</el-col>
|
</el-form>
|
||||||
</el-row>
|
|
||||||
<el-divider></el-divider>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="默认模板" prop="mrmb">
|
|
||||||
<el-select v-model="formData.mrmb" style="width: 12rem;">
|
|
||||||
<el-option v-for="item in mbList" :key="item.no" :value="item.no" :label="item.na" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" style="display: flex;">
|
|
||||||
<el-form-item label="默认试剂" prop="mrsjph">
|
|
||||||
<el-select v-model="formData.mrsjph" style="width: 12rem;">
|
|
||||||
<el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-button type="primary" @click="sjHandle">试剂维护</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<el-empty :image-size="200" description="暂无参数配置" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<!-- 波长对照表 -->
|
<!-- 波长对照表 -->
|
||||||
<el-dialog v-model="dialogVisible" title="滤光波长对照表" draggable :close-on-click-modal="false" width="500px">
|
<el-dialog v-model="dialogVisible" title="滤光波长对照表" draggable :close-on-click-modal="false" width="500px">
|
||||||
@ -227,16 +217,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { queryFilter, addXmFilter, delXmFilter, addXmLot, delXmLot, queryXmLot, querySjcs, querydouble, savedouble, querymbmc } from '@/api/liswork/xtwh/ComOpt'
|
import { queryFilter, addXmFilter, delXmFilter, addXmLot, delXmLot, queryXmLot, querySjcs } from '@/api/liswork/xtwh/ComOpt'
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { formatDict, dictData } from '@/hooks'
|
import { formatDict, dictData } from '@/hooks'
|
||||||
import { queryXmInfo } from '@/api/liswork/work/LisWork';
|
import { get } from 'lodash';
|
||||||
|
|
||||||
|
|
||||||
const yq = defineModel<string>()
|
const yq = defineModel<string>()
|
||||||
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const xmdh = ref('');
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
csbc: '',
|
csbc: '',
|
||||||
ckbc: '',
|
ckbc: '',
|
||||||
@ -254,8 +242,7 @@ const formData = ref({
|
|||||||
kbms: '1',
|
kbms: '1',
|
||||||
zbsj: '',
|
zbsj: '',
|
||||||
mrmb: '',
|
mrmb: '',
|
||||||
mrsjph: '',
|
mrsjph: ''
|
||||||
xmdh: '',
|
|
||||||
});
|
});
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
csbc: [
|
csbc: [
|
||||||
@ -266,18 +253,11 @@ const rules = ref({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
const paramsFlag = ref(true);
|
|
||||||
|
|
||||||
const form = ref();
|
const form = ref();
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
form.value.validate((valid: boolean) => {
|
form.value.validate((valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
savedouble(formData.value).then((res: any) => {
|
console.log('submit!')
|
||||||
if (res.code == 0) {
|
|
||||||
ElMessage.success('保存成功!')
|
|
||||||
getXmInfo()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -330,7 +310,6 @@ interface sjList {
|
|||||||
sjcs: string, sjph: string, yq: string, yxq: string, csff: string
|
sjcs: string, sjph: string, yq: string, yxq: string, csff: string
|
||||||
}
|
}
|
||||||
const sjShow = ref(false)
|
const sjShow = ref(false)
|
||||||
const mbList = ref<Array<{ na: string, no: string }>>([])
|
|
||||||
const sjtableData = ref<sjList[]>([])
|
const sjtableData = ref<sjList[]>([])
|
||||||
const sjHandle = () => {
|
const sjHandle = () => {
|
||||||
getSjList()
|
getSjList()
|
||||||
@ -384,38 +363,9 @@ const getSjcjList = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getXmInfo = () => {
|
|
||||||
querydouble({ yq: yq.value, xmdh: xmdh.value }).then((res: any) => {
|
|
||||||
paramsFlag.value = res.code == 1 ? false : true;
|
|
||||||
formData.value = res.data || {}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const xmList = ref<Array<{ label: string, value: string }>>([])
|
|
||||||
const getXmList = () => {
|
|
||||||
queryXmInfo({ yq: yq.value }).then((res: any) => {
|
|
||||||
xmList.value = res.data.map((item: any) => {
|
|
||||||
return {
|
|
||||||
label: item.xmmc,
|
|
||||||
value: item.xmdh,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
querymbmc().then((res: any) => {
|
|
||||||
mbList.value = res.data || []
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(yq, (newVal) => {
|
watch(yq, (newVal) => {
|
||||||
if (newVal) {
|
getDzList()
|
||||||
getXmInfo()
|
getSjList()
|
||||||
getDzList()
|
|
||||||
getSjList()
|
|
||||||
getXmList()
|
|
||||||
}
|
|
||||||
xmdh.value = ''
|
|
||||||
}, {
|
}, {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true
|
deep: true
|
||||||
|
|||||||
@ -1,28 +1,44 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 整体排序 -->
|
<!-- 整体排序 -->
|
||||||
<div class="sort_box">
|
<div class="sort_box">
|
||||||
<el-row :gutter="10" class="table-toolbar">
|
<el-row :gutter="10" class="table-row">
|
||||||
<el-col :span="1.5">
|
<el-col :span="20" class="table-box">
|
||||||
<el-button type="primary" @click="refresh">刷新</el-button>
|
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :config="tableConfig"
|
||||||
|
@row-click="handleRowClick">
|
||||||
|
<template #sort="{ row }">
|
||||||
|
<el-input v-model="row.sort" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</CustomTable>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="4">
|
||||||
<el-button type="primary" @click="cpHandle">存盘</el-button>
|
<el-row :gutter="10" class="table-toolbar">
|
||||||
</el-col>
|
<!-- <el-col :span="1.5">
|
||||||
<el-col :span="1.5">
|
<el-radio-group v-model="radio" @change="radioChange">
|
||||||
<el-button type="primary" @click="firstHandle">首位</el-button>
|
<el-radio value="1">上下移动调整</el-radio>
|
||||||
</el-col>
|
<el-radio value="2">手工输入工号</el-radio>
|
||||||
<el-col :span="1.5">
|
</el-radio-group>
|
||||||
<el-button type="primary" @click="lastHadnle">末位</el-button>
|
</el-col> -->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" @click="refresh">刷新</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" @click="cpHandle">存盘</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" :disabled="radio == '2'" @click="firstHandle">首位</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-button type="primary" icon="top" :disabled="radio == '2'" @click="prevHandle">上移</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" icon="bottom" :disabled="radio == '2'" @click="nextHandle">下移</el-button>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" :disabled="radio == '2'" @click="lastHadnle">末位</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="table-row">
|
|
||||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :config="tableConfig" :enableRowDrag="true"
|
|
||||||
@row-drag-end="handleRowDragEnd" @row-click="handleRowClick">
|
|
||||||
<!-- <template #dyxh="{ row }">
|
|
||||||
<el-input v-model="row.dyxh" class="full-width-input" />
|
|
||||||
</template> -->
|
|
||||||
</CustomTable>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -30,21 +46,28 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { formatDict, dictData } from '@/hooks';
|
import { formatDict, dictData } from '@/hooks';
|
||||||
import { getitemsort, saveitemsort } from '@/api/liswork/xtwh/ComOpt';
|
|
||||||
|
|
||||||
const yq = defineModel<string>()
|
|
||||||
|
const props = defineProps({
|
||||||
|
dataList: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
interface DataItem {
|
interface DataItem {
|
||||||
xmid: string | number;
|
xmid: string | number;
|
||||||
xmmc: string | number;
|
xmmc: string | number;
|
||||||
dyxh: string | number;
|
sort: string | number;
|
||||||
}
|
}
|
||||||
const selectedRow = ref<DataItem | null>(null)
|
const currentIndex = ref(0);
|
||||||
|
const radio = ref('1');
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const dataList = ref<DataItem[]>([]);
|
const dataList = ref<DataItem[]>([]);
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{ prop: 'xmid', label: '项目ID', visible: true, align: 'center' },
|
{ prop: 'xmid', label: '项目ID', visible: true, align: 'center', },
|
||||||
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center' },
|
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center', },
|
||||||
{ prop: 'dyxh', label: '排序', visible: true, align: 'center', },
|
{ prop: 'sort', label: '整体排序', visible: true, align: 'center', slot: "sort" },
|
||||||
]);
|
]);
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
@ -55,26 +78,19 @@ const tableConfig = ref({
|
|||||||
|
|
||||||
|
|
||||||
//退拽属性
|
//退拽属性
|
||||||
const handleRowDragEnd = (data: any) => {
|
const handleColumnDragEnd = (data: any) => {
|
||||||
// 更新行顺序
|
// 更新列配置
|
||||||
dataList.value = data.list.map((item: any) => {
|
dataList.value = data.list;
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
dyxh: item.sort,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRowClick = (row: DataItem) => {
|
const handleRowClick = (row: DataItem) => {
|
||||||
selectedRow.value = row
|
currentIndex.value = dataList.value.indexOf(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
getitemsort({ yq: yq.value }).then((res: any) => {
|
|
||||||
dataList.value = res.data;
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const refresh = () => {
|
const refresh = () => {
|
||||||
@ -82,59 +98,56 @@ const refresh = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cpHandle = () => {
|
const cpHandle = () => {
|
||||||
saveitemsort(dataList.value).then(() => {
|
|
||||||
getList();
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const firstHandle = () => {
|
const firstHandle = () => {
|
||||||
if (!selectedRow.value) return
|
currentIndex.value = 0;
|
||||||
const currentIndex = dataList.value.findIndex(item => item.xmid === selectedRow.value!.xmid)
|
tableRef.value.setCurrentRow(dataList.value[0]);
|
||||||
if (currentIndex === 0) return
|
|
||||||
const [movedRow] = dataList.value.splice(currentIndex, 1)
|
|
||||||
dataList.value.unshift(movedRow)
|
|
||||||
resetSortNumber()
|
|
||||||
tableRef.value.setScrollTop(0)
|
tableRef.value.setScrollTop(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
const lastHadnle = () => {
|
const lastHadnle = () => {
|
||||||
if (!selectedRow.value) return
|
currentIndex.value = dataList.value.length - 1;
|
||||||
const currentIndex = dataList.value.findIndex(item => item.xmid === selectedRow.value!.xmid)
|
tableRef.value.setCurrentRow(dataList.value[currentIndex.value]);
|
||||||
if (currentIndex === dataList.value.length - 1) return
|
|
||||||
const [movedRow] = dataList.value.splice(currentIndex, 1)
|
|
||||||
dataList.value.push(movedRow)
|
|
||||||
resetSortNumber()
|
|
||||||
tableRef.value.setScrollTop(dataList.value.length)
|
tableRef.value.setScrollTop(dataList.value.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
const resetSortNumber = () => {
|
onMounted(() => {
|
||||||
dataList.value.forEach((item, index) => {
|
for (let index = 0; index < 20; index++) {
|
||||||
item.dyxh = index + 1
|
dataList.value.push(
|
||||||
})
|
{ xmid: 'ID' + index, xmmc: 'xmmc' + index, sort: '', }
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
watch(yq, (newVal) => {
|
|
||||||
getList();
|
|
||||||
}, { immediate: true })
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.sort_box {
|
.sort_box {
|
||||||
height: calc(100% - 56px);
|
height: calc(100% - 58px);
|
||||||
|
padding-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-toolbar {
|
.table-toolbar {
|
||||||
margin-bottom: 8px;
|
flex: 1;
|
||||||
height: 36px;
|
display: flex;
|
||||||
line-height: 36px;
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.el-col {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
width: 80%;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.table-row {
|
.table-row {
|
||||||
width: 50%;
|
height: 100%;
|
||||||
height: calc(100% - 45px);
|
flex: 3;
|
||||||
|
|
||||||
|
|
||||||
.table-box {
|
.table-box {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@ -112,7 +112,7 @@ const tabList = [
|
|||||||
{ key: 'SysSort', label: '项目排序', component: SysSort },
|
{ key: 'SysSort', label: '项目排序', component: SysSort },
|
||||||
{ key: 'SysReport', label: '报告单设置', component: SysReport },
|
{ key: 'SysReport', label: '报告单设置', component: SysReport },
|
||||||
]
|
]
|
||||||
const activeName = ref('SysGlobal')
|
const activeName = ref('SysSort')
|
||||||
|
|
||||||
// 计算当前要渲染的组件
|
// 计算当前要渲染的组件
|
||||||
const currentComponent = computed(() => {
|
const currentComponent = computed(() => {
|
||||||
|
|||||||
@ -1,23 +1,48 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||||
<el-form-item :label="menuname + '类别'" prop="configType">
|
<el-form-item :label="menuname + '类别'" prop="configType">
|
||||||
<el-select v-model="queryParams.configType" :placeholder="`请选择${menuname}类别`" clearable style="width: 200px"
|
<el-select
|
||||||
@change="handleQuery">
|
v-model="queryParams.configType"
|
||||||
<el-option v-for="item in configTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
:placeholder="`请选择${menuname}类别`"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@change="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in configTypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="menuname + '编码'" prop="configCode">
|
<el-form-item :label="menuname + '编码'" prop="configCode">
|
||||||
<el-input v-model="queryParams.configCode" :placeholder="`请输入${menuname}编码`" clearable style="width: 200px"
|
<el-input
|
||||||
@keyup.enter="handleQuery" />
|
v-model="queryParams.configCode"
|
||||||
|
:placeholder="`请输入${menuname}编码`"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="`${menuname}名称`" prop="configName">
|
<el-form-item :label="`${menuname}名称`" prop="configName">
|
||||||
<el-input v-model="queryParams.configName" :placeholder="`请输入${menuname}名称`" clearable style="width: 200px"
|
<el-input
|
||||||
@keyup.enter="handleQuery" />
|
v-model="queryParams.configName"
|
||||||
|
:placeholder="`请输入${menuname}名称`"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 200px">
|
<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-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -28,81 +53,111 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="table-container">
|
<el-row :gutter="5" class="table-container">
|
||||||
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="config-table"
|
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="config-table" height="100%">
|
||||||
height="100%">
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column :label="`${menuname}编号`" align="center" prop="configId" v-if="false"/>
|
||||||
<el-table-column :label="`${menuname}编号`" align="center" prop="configId" v-if="false" />
|
<el-table-column :label="`${menuname}类别`" align="center" prop="configType" width="100" show-overflow-tooltip>
|
||||||
<el-table-column :label="`${menuname}类别`" align="center" prop="configType" width="100" show-overflow-tooltip>
|
<template #default="scope">
|
||||||
<template #default="scope">
|
<span
|
||||||
<span class="config-type-cell" :style="{
|
class="config-type-cell"
|
||||||
|
:style="{
|
||||||
backgroundColor: getConfigTypeColor(scope.row.configType),
|
backgroundColor: getConfigTypeColor(scope.row.configType),
|
||||||
color: '#fff' // 文字白色,保证对比
|
color: '#fff' // 文字白色,保证对比
|
||||||
}">
|
}"
|
||||||
{{configTypeOptions.find(item => item.value === scope.row.configType)?.label || scope.row.configType}}
|
>
|
||||||
</span>
|
{{ configTypeOptions.find(item => item.value === scope.row.configType)?.label || scope.row.configType }}
|
||||||
</template>
|
</span>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column :label="`${menuname}编码`" align="center" prop="configCode" width="150" show-overflow-tooltip />
|
</el-table-column>
|
||||||
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip />
|
<el-table-column :label="`${menuname}编码`" align="center" prop="configCode" width="150" show-overflow-tooltip />
|
||||||
<el-table-column label="选项类型" align="center" prop="configOptiontype" width="100">
|
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip />
|
||||||
<template #default="scope">
|
<el-table-column label="选项类型" align="center" prop="configOptiontype"width="100">
|
||||||
<span class="config-type-cell" :style="{
|
<template #default="scope">
|
||||||
|
<span
|
||||||
|
class="config-type-cell"
|
||||||
|
:style="{
|
||||||
backgroundColor: getconfigOptionTypeColor(scope.row.configOptiontype),
|
backgroundColor: getconfigOptionTypeColor(scope.row.configOptiontype),
|
||||||
color: '#fff' // 文字白色,保证对比
|
color: '#fff' // 文字白色,保证对比
|
||||||
}">
|
}"
|
||||||
{{configOptiontypeOptions.find(item => item.value === scope.row.configOptiontype)?.label ||
|
>
|
||||||
scope.row.configOptiontype}}
|
{{ configOptiontypeOptions.find(item => item.value === scope.row.configOptiontype)?.label || scope.row.configOptiontype }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="默认值" align="center" prop="configDefvalue" width="200" show-overflow-tooltip>
|
</el-table-column>
|
||||||
<template #default="scope">
|
<el-table-column label="默认值" align="center" prop="configDefvalue" show-overflow-tooltip />
|
||||||
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
<el-table-column label="值域规则" align="left" prop="remark" show-overflow-tooltip />
|
||||||
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
|
<el-table-column label="排序" align="center" prop="configSort" width="80" />
|
||||||
</template>
|
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||||
</el-table-column>
|
<template #default="scope">
|
||||||
<el-table-column label="值域规则" align="left" prop="remark" show-overflow-tooltip />
|
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
||||||
<el-table-column label="排序" align="center" prop="configSort" width="80" />
|
</template>
|
||||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
</el-table-column>
|
||||||
<template #default="scope">
|
<el-table-column label="创建时间" align="center" prop="createTime" width="150" show-overflow-tooltip>
|
||||||
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
|
<template #default="scope">
|
||||||
</template>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="150" show-overflow-tooltip>
|
</el-table-column>
|
||||||
<template #default="scope">
|
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<template #default="scope">
|
||||||
</template>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" >修改</el-button>
|
||||||
</el-table-column>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" >删除</el-button>
|
||||||
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
</template>
|
||||||
<template #default="scope">
|
</el-table-column>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
</el-table>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
</el-row>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<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">
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
|
|
||||||
<el-form ref="configdictRef" :model="form" :rules="rules" label-width="150px">
|
<el-form ref="configdictRef" :model="form" :rules="rules" label-width="150px">
|
||||||
<el-form-item :label="`${menuname}类别`" prop="configType">
|
<el-form-item :label="`${menuname}类别`" prop="configType">
|
||||||
<el-select v-model="form.configType" :placeholder="`请选择${menuname}类别`" style="width: 100%">
|
<el-select
|
||||||
<el-option v-for="item in configTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
v-model="form.configType"
|
||||||
|
:placeholder="`请选择${menuname}类别`"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in configTypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="`${menuname}编码`" prop="configCode">
|
<el-form-item :label="`${menuname}编码`" prop="configCode">
|
||||||
@ -112,9 +167,17 @@
|
|||||||
<el-input v-model="form.configName" :placeholder="`请输入${menuname}名称`" />
|
<el-input v-model="form.configName" :placeholder="`请输入${menuname}名称`" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="`${menuname}选项类型`" prop="configOptiontype">
|
<el-form-item :label="`${menuname}选项类型`" prop="configOptiontype">
|
||||||
<el-select v-model="form.configOptiontype" :placeholder="`请选择${menuname}选项类型`" style="width: 100%">
|
<el-select
|
||||||
<el-option v-for="item in configOptiontypeOptions" :key="item.value" :label="item.label"
|
v-model="form.configOptiontype"
|
||||||
:value="item.value" />
|
:placeholder="`请选择${menuname}选项类型`"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in configOptiontypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="`${menuname}默认值`" prop="configDefvalue">
|
<el-form-item :label="`${menuname}默认值`" prop="configDefvalue">
|
||||||
@ -126,8 +189,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-radio-group v-model="form.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>
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>{{ dict.label }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="值域参数JSON" prop="remark">
|
<el-form-item label="值域参数JSON" prop="remark">
|
||||||
@ -151,14 +217,13 @@ import {
|
|||||||
listconfigdict,
|
listconfigdict,
|
||||||
updateconfigdict
|
updateconfigdict
|
||||||
} from "@/api/liswork/xtwh/configdictApi.ts";
|
} from "@/api/liswork/xtwh/configdictApi.ts";
|
||||||
import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue"
|
|
||||||
// 1. 定义类别下拉选项(根据实际业务调整)
|
// 1. 定义类别下拉选项(根据实际业务调整)
|
||||||
const configTypeOptions = ref([
|
const configTypeOptions = ref([
|
||||||
{ label: "仪器全局设置", value: "SYSTEM", color: "#E6A23C" },
|
{ label: "仪器全局设置", value: "SYSTEM",color: "#E6A23C" },
|
||||||
{ label: "仪器界面设置", value: "INPUT", color: "#67C23A" },
|
{ label: "仪器界面设置", value: "INPUT", color: "#67C23A" },
|
||||||
{ label: "本地选项设置", value: "LOCAL", color: "#409EFF" },
|
{ label: "本地选项设置", value: "LOCAL" , color: "#409EFF" },
|
||||||
{ label: "本院特殊设置", value: "HISOPT", color: "#909399" },
|
{ label: "本院特殊设置", value: "HISOPT", color: "#909399" },
|
||||||
{ label: "门诊采血设置", value: "_MZCX_", color: "#C74127" }
|
{ label: "门诊采血设置", value: "_MZCX_", color: "#C74127" }
|
||||||
]);
|
]);
|
||||||
// 2. 定义获取类别对应颜色的方法
|
// 2. 定义获取类别对应颜色的方法
|
||||||
function getConfigTypeColor(type) {
|
function getConfigTypeColor(type) {
|
||||||
@ -168,15 +233,15 @@ function getConfigTypeColor(type) {
|
|||||||
}
|
}
|
||||||
// 2. 定义参数类别下拉选项(根据实际业务调整)
|
// 2. 定义参数类别下拉选项(根据实际业务调整)
|
||||||
const configOptiontypeOptions = ref([
|
const configOptiontypeOptions = ref([
|
||||||
{ label: "单选框", value: "0", color: "#56BBBD" },
|
{ label: "单选框", value: "0",color: "#56BBBD" },
|
||||||
{ label: "下拉框", value: "1", color: "#67C23A" },
|
{ label: "下拉框", value: "1",color: "#67C23A" },
|
||||||
{ label: "字典单选", value: "2", color: "#FF443F" },
|
{ label: "字典单选", value: "2",color: "#FF443F" },
|
||||||
{ label: "字典多选", value: "3", color: "#F08784" },
|
{ label: "字典多选", value: "3",color: "#F08784" },
|
||||||
{ label: "特殊", value: "4", color: "#909399" },
|
{ label: "特殊", value: "4",color: "#909399" },
|
||||||
{ label: "文本框", value: "5", color: "#3282F6" },
|
{ label: "文本框", value: "5",color: "#3282F6" },
|
||||||
{ label: "数字框", value: "6", color: "#507F80" },
|
{ label: "数字框", value: "6",color: "#507F80" },
|
||||||
{ label: "日期框", value: "7", color: "#7E84F7" },
|
{ label: "日期框", value: "7",color: "#7E84F7" },
|
||||||
{ label: "时间框", value: "8", color: "#377D22" },
|
{ label: "时间框", value: "8",color: "#377D22" },
|
||||||
]);
|
]);
|
||||||
function getconfigOptionTypeColor(type) {
|
function getconfigOptionTypeColor(type) {
|
||||||
// 匹配对应类别的颜色,无匹配时用默认色
|
// 匹配对应类别的颜色,无匹配时用默认色
|
||||||
@ -200,26 +265,26 @@ const data = reactive({
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
configCode: undefined,
|
configCode: undefined,
|
||||||
configName: undefined,
|
configName: undefined,
|
||||||
configType: undefined,
|
configType:undefined,
|
||||||
status: undefined,
|
status: undefined
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 30
|
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
configType: [{ required: true, message: menuname.value + "类别不能为空", trigger: "blur" }],
|
configType: [{ required: true, message: menuname.value+"类别不能为空", trigger: "blur" }],
|
||||||
configName: [{ required: true, message: menuname.value + "名称不能为空", trigger: "blur" }],
|
configName: [{ required: true, message: menuname.value+"名称不能为空", trigger: "blur" }],
|
||||||
configCode: [{ required: true, message: menuname.value + "编码不能为空", trigger: "blur" }],
|
configCode: [{ required: true, message: menuname.value+"编码不能为空", trigger: "blur" }],
|
||||||
configSort: [{ required: true, message: menuname.value + "顺序不能为空", trigger: "blur" }],
|
configSort: [{ required: true, message: menuname.value+"顺序不能为空", trigger: "blur" }],
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
/** 查询字典列表 */
|
/** 查询字典列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listconfigdict(queryParams.value).then(response => {
|
listconfigdict(queryParams.value).then(response => {
|
||||||
regdictList.value = response.rows;
|
console.log('response:', response);
|
||||||
total.value = response.total;
|
regdictList.value = response.data;
|
||||||
|
total.value = response.data.length;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -236,7 +301,7 @@ function reset() {
|
|||||||
configName: undefined,
|
configName: undefined,
|
||||||
configType: configTypeOptions.value[0]?.value || "",
|
configType: configTypeOptions.value[0]?.value || "",
|
||||||
configOptiontype: configOptiontypeOptions.value[0]?.value || "",
|
configOptiontype: configOptiontypeOptions.value[0]?.value || "",
|
||||||
configDefvalue: undefined,
|
configDefvalue:undefined,
|
||||||
configSort: 0,
|
configSort: 0,
|
||||||
status: "0",
|
status: "0",
|
||||||
remark: undefined
|
remark: undefined
|
||||||
@ -263,7 +328,7 @@ function handleSelectionChange(selection) {
|
|||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加" + menuname.value;
|
title.value = "添加"+menuname.value;
|
||||||
}
|
}
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
@ -272,28 +337,25 @@ function handleUpdate(row) {
|
|||||||
getconfigdict(configId).then(response => {
|
getconfigdict(configId).then(response => {
|
||||||
form.value = response.data;
|
form.value = response.data;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "修改" + menuname.value;
|
title.value = "修改"+menuname.value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["configdictRef"].validate(valid => {
|
proxy.$refs["configdictRef"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
if (form.value.configId != undefined) {
|
if (form.value.configId != undefined) {
|
||||||
updateconfigdict(form.value).then(response => {
|
updateconfigdict(form.value).then(response => {
|
||||||
if (response.code == 0) {
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
open.value = false;
|
||||||
open.value = false;
|
getList();
|
||||||
getList();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addconfigdict(form.value).then(response => {
|
addconfigdict(form.value).then(response => {
|
||||||
if (response.code == 0) {
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
proxy.$modal.msgSuccess("新增成功");
|
open.value = false;
|
||||||
open.value = false;
|
getList();
|
||||||
getList();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,12 +364,13 @@ function submitForm() {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const configIds = row.configId || ids.value;
|
const configIds = row.configId || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除"' + menuname.value + '"编号为"' + configIds + '"的数据项?').then(function () {
|
proxy.$modal.confirm('是否确认删除"' + menuname.value + '"编号为"' + configIds + '"的数据项?').then(function() {
|
||||||
|
|
||||||
return delconfigdict(configIds);
|
return delconfigdict(configIds);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
getList();
|
getList();
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => { });
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
@ -318,40 +381,42 @@ function handleExport() {
|
|||||||
getList();
|
getList();
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.app-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 90vh;
|
||||||
|
/* 容器高度等于窗口高度 */
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
.mb8 {
|
.mb8 {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
/* 固定高度 */
|
/* 固定高度 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-container {
|
.table-container {
|
||||||
height: calc(100% - 150px);
|
flex: 1;
|
||||||
|
/* 占满剩余高度 */
|
||||||
|
overflow: hidden;
|
||||||
|
/* 避免表格超出容器 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 1. 减小表格行高(核心) */
|
/* 1. 减小表格行高(核心) */
|
||||||
:deep(.config-table .el-table__row) {
|
:deep(.config-table .el-table__row) {
|
||||||
height: 30px !important;
|
height: 30px !important; /* 原默认行高约40px,按需调整(建议28-35px) */
|
||||||
/* 原默认行高约40px,按需调整(建议28-35px) */
|
line-height: 30px !important; /* 行高与height一致,保证垂直居中 */
|
||||||
line-height: 30px !important;
|
|
||||||
/* 行高与height一致,保证垂直居中 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 2. 减小单元格内边距(配合行高优化) */
|
/* 2. 减小单元格内边距(配合行高优化) */
|
||||||
:deep(.config-table .el-table__cell) {
|
:deep(.config-table .el-table__cell) {
|
||||||
padding: 2px 4px !important;
|
padding: 2px 4px !important;
|
||||||
height: 30px !important;
|
height: 30px !important; /* 单元格高度与行高一致 */
|
||||||
/* 单元格高度与行高一致 */
|
line-height: 1.2 !important; /* 文字行高适配矮行 */
|
||||||
line-height: 1.2 !important;
|
vertical-align: middle !important; /* 强制垂直居中 */
|
||||||
/* 文字行高适配矮行 */
|
|
||||||
vertical-align: middle !important;
|
|
||||||
/* 强制垂直居中 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 3. 类别单元格适配矮行高 */
|
/* 3. 类别单元格适配矮行高 */
|
||||||
.config-type-cell {
|
.config-type-cell {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
min-height: 26px;
|
min-height: 26px; /* 适配30px行高,略小一点 */
|
||||||
/* 适配30px行高,略小一点 */
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@ -1,54 +1,135 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dynamic-input-container">
|
<div class="dynamic-input-container">
|
||||||
<!-- 1. 开关组件(替代原单选框 type=0:是/否 → 开启/关闭) -->
|
<!-- 1. 开关组件(替代原单选框 type=0:是/否 → 开启/关闭) -->
|
||||||
<el-switch class="custom-switch" v-if="type === '0'" v-model="innerValue" active-color="#13ce66"
|
<el-switch
|
||||||
inactive-color="#ff4949" active-value="1" inactive-value="0" @change="handleSwitchChange" />
|
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 -->
|
<!-- 2. 下拉框(1):直接绑定value -->
|
||||||
<el-select v-else-if="type === '1'" v-model="innerValue" size="small" clearable @change="handleValueChange">
|
<el-select
|
||||||
<el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value" />
|
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>
|
</el-select>
|
||||||
|
|
||||||
<!-- 3. 字典单选(2):绑定zddh(value),显示zdmc(label) -->
|
<!-- 3. 字典单选(2):绑定zddh(value),显示zdmc(label) -->
|
||||||
<el-select v-else-if="type === '2'" v-model="innerValue" size="small" clearable @change="handleValueChange"
|
<el-select
|
||||||
v-loading="dictLoading">
|
v-else-if="type === '2'"
|
||||||
<el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value" />
|
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>
|
</el-select>
|
||||||
|
|
||||||
<!-- 4. 字典多选(3):数组↔逗号分隔字符串 → 修复核心:仅绑定multipleValue,移除冗余逻辑 -->
|
<!-- 4. 字典多选(3):数组↔逗号分隔字符串 → 修复核心:仅绑定multipleValue,移除冗余逻辑 -->
|
||||||
<el-select v-else-if="type === '3'" v-model="multipleValue" size="small" multiple @change="handleMultipleChange"
|
<el-select
|
||||||
v-loading="dictLoading" clearable>
|
v-else-if="type === '3'"
|
||||||
<el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value" />
|
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>
|
</el-select>
|
||||||
|
|
||||||
<!-- 5. 特殊(4) -->
|
<!-- 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) -->
|
<!-- 6. 文本框(5) -->
|
||||||
<el-input v-else-if="type === '5'" v-model="innerValue" size="small" :placeholder="placeholder"
|
<el-input
|
||||||
@change="handleValueChange" />
|
v-else-if="type === '5'"
|
||||||
|
v-model="innerValue"
|
||||||
|
size="small"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
@change="handleValueChange"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 7. 数字框(6):支持dictData定义小数位数,空值初始化 -->
|
<!-- 7. 数字框(6):支持dictData定义小数位数,空值初始化 -->
|
||||||
<el-input-number v-else-if="type === '6'" v-model="innerValue" size="small" :min="minNum"
|
<el-input-number
|
||||||
:precision="finalPrecision" controls-position="right" @change="handleValueChange"
|
v-else-if="type === '6'"
|
||||||
:placeholder="placeholder || '请输入数字'" />
|
v-model="innerValue"
|
||||||
|
size="small"
|
||||||
|
:min="minNum"
|
||||||
|
:precision="finalPrecision"
|
||||||
|
controls-position="right"
|
||||||
|
@change="handleValueChange"
|
||||||
|
:placeholder="placeholder || '请输入数字'"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 8. 日期框(7):适配yyyy/mm/dd -->
|
<!-- 8. 日期框(7):适配yyyy/mm/dd -->
|
||||||
<el-date-picker v-else-if="type === '7'" v-model="innerValue" size="small" type="date" format="YYYY/MM/DD"
|
<el-date-picker
|
||||||
value-format="YYYY-MM-DD" :placeholder="placeholder" @change="handleValueChange" />
|
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(修复标签闭合问题) -->
|
<!-- 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"
|
<el-time-picker
|
||||||
:placeholder="placeholder" @change="handleValueChange"
|
v-else-if="type === '8'"
|
||||||
:picker-options="{ selectableRange: '00:00:00 - 23:59:59' }" />
|
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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DynamicInput">
|
<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 { ElMessage } from "element-plus";
|
||||||
import { getoptionselect } from "@/api/liswork/xtwh/localconfigApi.ts";
|
import { getoptionselect } from "@/api/liswork/xtwh/localconfigApi.ts";
|
||||||
|
|
||||||
@ -96,18 +177,18 @@ const finalPrecision = computed(() => {
|
|||||||
watch(() => props.modelValue, (newVal) => {
|
watch(() => props.modelValue, (newVal) => {
|
||||||
const val = newVal; // 移除兜底空值,保留原始值
|
const val = newVal; // 移除兜底空值,保留原始值
|
||||||
switch (props.type) {
|
switch (props.type) {
|
||||||
// 开关组件(替代原单选框):后端1/0 → 前端"1"/"0"
|
// 开关组件(替代原单选框):后端1/0 → 前端"1"/"0"
|
||||||
case "0":
|
case "0":
|
||||||
innerValue.value = (val === 1 || val === "1" || val === true) ? "1" : "0";
|
innerValue.value = (val === 1 || val === "1" || val === true) ? "1" : "0";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 下拉框/字典单选:直接绑定value(zddh)
|
// 下拉框/字典单选:直接绑定value(zddh)
|
||||||
case "1":
|
case "1":
|
||||||
case "2":
|
case "2":
|
||||||
innerValue.value = val === null || val === undefined ? "" : String(val);
|
innerValue.value = val === null || val === undefined ? "" : String(val);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 字典多选:核心修复 → 严格过滤空值/无效值,杜绝默认0
|
// 字典多选:核心修复 → 严格过滤空值/无效值,杜绝默认0
|
||||||
case "3":
|
case "3":
|
||||||
// 1. 空值/0/空字符串 → 空数组
|
// 1. 空值/0/空字符串 → 空数组
|
||||||
if (val === null || val === undefined || val === "" || val === 0) {
|
if (val === null || val === undefined || val === "" || val === 0) {
|
||||||
@ -128,7 +209,7 @@ watch(() => props.modelValue, (newVal) => {
|
|||||||
// 移除innerValue同步(避免干扰多选)
|
// 移除innerValue同步(避免干扰多选)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 数字框:空值处理,支持小数位数
|
// 数字框:空值处理,支持小数位数
|
||||||
case "6":
|
case "6":
|
||||||
// 空值/非数字 → 空(null),否则转为数字
|
// 空值/非数字 → 空(null),否则转为数字
|
||||||
if (val === null || val === undefined || val === "" || isNaN(Number(val))) {
|
if (val === null || val === undefined || val === "" || isNaN(Number(val))) {
|
||||||
@ -138,21 +219,21 @@ watch(() => props.modelValue, (newVal) => {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 日期框:后端 yyyy/mm/dd → 前端 yyyy-MM-dd
|
// 日期框:后端 yyyy/mm/dd → 前端 yyyy-MM-dd
|
||||||
case "7":
|
case "7":
|
||||||
innerValue.value = typeof val === "string" && val.includes("/")
|
innerValue.value = typeof val === "string" && val.includes("/")
|
||||||
? val.replace(/\//g, "-")
|
? val.replace(/\//g, "-")
|
||||||
: val || null;
|
: val || null;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 时间框:后端 hh:mm → 前端 hh:mm:ss
|
// 时间框:后端 hh:mm → 前端 hh:mm:ss
|
||||||
case "8":
|
case "8":
|
||||||
innerValue.value = typeof val === "string" && val.includes(":") && val.split(":").length === 2
|
innerValue.value = typeof val === "string" && val.includes(":") && val.split(":").length === 2
|
||||||
? `${val}:00`
|
? `${val}:00`
|
||||||
: val || null;
|
: val || null;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 其他类型:保留原始值(空值则为null)
|
// 其他类型:保留原始值(空值则为null)
|
||||||
default:
|
default:
|
||||||
innerValue.value = val === null || val === undefined ? "" : val;
|
innerValue.value = val === null || val === undefined ? "" : val;
|
||||||
break;
|
break;
|
||||||
@ -299,21 +380,16 @@ onMounted(() => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.dynamic-input-container {
|
.dynamic-input-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%; /* 关键:占满表格单元格高度 */
|
||||||
/* 关键:占满表格单元格高度 */
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center; /* 垂直居中 */
|
||||||
/* 垂直居中 */
|
justify-content: center; /* 水平居中 */
|
||||||
justify-content: center;
|
padding: 0 2px; /* 轻微内边距,避免贴边 */
|
||||||
/* 水平居中 */
|
|
||||||
padding: 0 2px;
|
|
||||||
/* 轻微内边距,避免贴边 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 开关组件样式优化 */
|
/* 开关组件样式优化 */
|
||||||
:deep(.el-switch) {
|
:deep(.el-switch) {
|
||||||
margin: 0 auto;
|
margin: 0 auto; /* 开关水平居中 */
|
||||||
/* 开关水平居中 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 深度选择器强制覆盖激活颜色 */
|
/* 深度选择器强制覆盖激活颜色 */
|
||||||
@ -360,7 +436,6 @@ onMounted(() => {
|
|||||||
/* 多选下拉样式优化:避免高度溢出 */
|
/* 多选下拉样式优化:避免高度溢出 */
|
||||||
:deep(.el-select--multiple .el-select__tags) {
|
:deep(.el-select--multiple .el-select__tags) {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
min-height: 32px;
|
min-height: 32px; /* 匹配small尺寸高度 */
|
||||||
/* 匹配small尺寸高度 */
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -1,18 +1,16 @@
|
|||||||
<template>
|
<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-form-item label="项目代号" prop="xmdh">
|
<el-input placeholder="项目代号" v-model="formData.xmdh"></el-input>
|
||||||
<el-input placeholder="项目代号" v-model="formData.xmdh"></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="项目名称" prop="xmmc">
|
||||||
<el-form-item label="项目名称" prop="xmmc">
|
<el-input placeholder="项目名称" v-model="formData.xmmc"></el-input>
|
||||||
<el-input placeholder="项目名称" v-model="formData.xmmc"></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-form>
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true"
|
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" />
|
:config="tableConfig"/>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -42,4 +40,5 @@ const handleColumnDragEnd = (data: any) => {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
|
|||||||
@ -1,11 +1,493 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="app-container">
|
||||||
reportdict
|
<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>
|
</div>
|
||||||
</template>
|
</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>
|
</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,59 +1,52 @@
|
|||||||
<template>
|
<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="yq">
|
||||||
<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-form-item>
|
||||||
<el-form-item>
|
<el-button type="primary" @click="handAdd" size="default">新增</el-button>
|
||||||
<el-button type="primary" @click="handAdd" size="default">新增</el-button>
|
<el-button type="primary" @click="handDelete" size="default">删除</el-button>
|
||||||
<el-button type="primary" @click="handDelete" size="default">删除</el-button>
|
<el-button type="primary" @click="handSave" size="default">保存</el-button>
|
||||||
<el-button type="primary" @click="handSave" size="default">保存</el-button>
|
</el-form-item>
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-form>
|
|
||||||
<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">
|
|
||||||
<template #default="scope">
|
|
||||||
<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-option label="默认" value="1"></el-option>
|
|
||||||
<el-option label="参数" value="2"></el-option>
|
|
||||||
<el-option label="根据项目来判断" value="3"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</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>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<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" >
|
||||||
|
<template #default="scope">
|
||||||
|
<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-option label="默认" value="1"></el-option>
|
||||||
|
<el-option label="参数" value="2"></el-option>
|
||||||
|
<el-option label="根据项目来判断" value="3"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</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>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<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 { LabReportInstr } from '@/types/index';
|
||||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage,ElMessageBox } from 'element-plus';
|
||||||
import { formatInstr, getYqData } from '@/hooks/index';
|
import { formatInstr,getYqData } from '@/hooks/index';
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
yq: ''
|
yq: ''
|
||||||
@ -70,10 +63,10 @@ const maxXh = computed(() => {
|
|||||||
|
|
||||||
//新增数据
|
//新增数据
|
||||||
const handAdd = () => {
|
const handAdd = () => {
|
||||||
if (formData.value.yq === '') {
|
if(formData.value.yq === ''){
|
||||||
ElMessage.warning('请先选择仪器');
|
ElMessage.warning('请先选择仪器');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const newReport: LabReportInstr = {
|
const newReport: LabReportInstr = {
|
||||||
yq: formData.value.yq,
|
yq: formData.value.yq,
|
||||||
xh: maxXh.value + 1,
|
xh: maxXh.value + 1,
|
||||||
@ -88,14 +81,14 @@ const handAdd = () => {
|
|||||||
|
|
||||||
//删除数据
|
//删除数据
|
||||||
const handDelete = async () => {
|
const handDelete = async () => {
|
||||||
await ElMessageBox.confirm('是否要删除选中的数据?', 'Warning',
|
await ElMessageBox.confirm('是否要删除选中的数据?','Warning',
|
||||||
{
|
{
|
||||||
confirmButtonText: 'OK',
|
confirmButtonText: 'OK',
|
||||||
cancelButtonText: 'Cancel',
|
cancelButtonText: 'Cancel',
|
||||||
type: 'warning',
|
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('删除成功');
|
ElMessage.success('删除成功');
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
@ -103,12 +96,12 @@ const handDelete = async () => {
|
|||||||
//保存数据
|
//保存数据
|
||||||
const handSave = async () => {
|
const handSave = async () => {
|
||||||
let updateReports = tableData.value.filter(item => item.type === '1');
|
let updateReports = tableData.value.filter(item => item.type === '1');
|
||||||
if (updateReports.length > 1) {
|
if(updateReports.length > 1){
|
||||||
ElMessage.error('默认的报告单类型不能有两个,请修改后再保存');
|
ElMessage.error('默认的报告单类型不能有两个,请修改后再保存');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
updateReports = tableData.value.filter(item => item.type === '2' && item.condition.trim() === '');
|
updateReports = tableData.value.filter(item => item.type === '2' && item.condition.trim() === '');
|
||||||
if (updateReports.length > 0) {
|
if(updateReports.length > 0){
|
||||||
ElMessage.error('参数类型的使用条件不能为空,请修改后再保存');
|
ElMessage.error('参数类型的使用条件不能为空,请修改后再保存');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -116,7 +109,7 @@ const handSave = async () => {
|
|||||||
let newReports = tableData.value.filter(item => item.status === 'new');
|
let newReports = tableData.value.filter(item => item.status === 'new');
|
||||||
let res = await addReportService(newReports);
|
let res = await addReportService(newReports);
|
||||||
newReports = tableData.value.filter(item => item.status === 'update');
|
newReports = tableData.value.filter(item => item.status === 'update');
|
||||||
console.log('更新的数据', newReports);
|
console.log('更新的数据',newReports);
|
||||||
res = await updateReportService(newReports);
|
res = await updateReportService(newReports);
|
||||||
ElMessage.success('保存成功');
|
ElMessage.success('保存成功');
|
||||||
getList();
|
getList();
|
||||||
@ -130,8 +123,8 @@ const getList = async () => {
|
|||||||
|
|
||||||
//监听数据是否发生改变
|
//监听数据是否发生改变
|
||||||
const handleRowChange = (row: LabReportInstr, index: number) => {
|
const handleRowChange = (row: LabReportInstr, index: number) => {
|
||||||
if (row.status !== 'new') {
|
if(row.status !== 'new') {
|
||||||
tableData.value[index].status = 'update';
|
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>
|
||||||
@ -1,34 +1,31 @@
|
|||||||
<!--仪器收费项目对照-->
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<!--仪器收费项目对照-->
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form ref="form" :model="formData" label-width="80px" inline>
|
<el-form ref="form" :model="formData" label-width="80px" inline>
|
||||||
<el-form-item label="仪器" prop="yq">
|
<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-form-item label="项目检索" prop="item">
|
<el-form-item label="项目检索" prop="item">
|
||||||
<el-input placeholder="名称,简拼" v-model="formData.item" @change="getList"></el-input>
|
<el-input placeholder="名称,简拼" v-model="formData.item" @change="getList"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span class="tips">说明:双击左侧列表,能删除对照数据,双击右边列表能新增数据到对照当中</span>
|
<span>说明:双击左侧列表,能删除对照数据,双击右边列表能新增数据到对照当中</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20" class="table-row">
|
<el-row>
|
||||||
<el-col :span="6" class="table-col">
|
<el-col :span="5">
|
||||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :config="tableConfig"
|
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||||
@row-dblclick="onDBClickLeft" />
|
:config="tableConfig" @row-dblclick="onDBClickLeft"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18" class="table-col">
|
<el-col :span="19">
|
||||||
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true"
|
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClickRight" />
|
:config="tableConfig" @row-dblclick="onDBClickRight"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@ -36,97 +33,88 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CustomTable from '@/components/elTable/index.vue'
|
import CustomTable from '@/components/elTable/index.vue'
|
||||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||||
import { queryService, queryXmService, addService, delService } from '@/api/liswork/xtwh/xmFeeinstrApi';
|
import { queryService,queryXmService,addService,delService } from '@/api/liswork/xtwh/xmFeeinstrApi';
|
||||||
import { queryOneService } from '@/api/system/parameter'
|
import { queryOneService } from '@/api/system/parameter'
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '100%', // 高度
|
height: '76vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
|
// cellStyle: cellStyleHd
|
||||||
})
|
})
|
||||||
|
|
||||||
//退拽属性
|
//退拽属性
|
||||||
const handleColumnDragEnd = (data: any) => {
|
const handleColumnDragEnd = (data: any) => {
|
||||||
|
// 更新列配置
|
||||||
|
columnsLeft.value = data.columns;
|
||||||
columnsRight.value = data.columns;
|
columnsRight.value = data.columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
const columnsLeft = ref([
|
const columnsLeft = ref([
|
||||||
{ prop: 'sfxmmc', label: '当前仪器对应的收费项目', visible: true, },
|
{ prop: 'sfxmmc', label: '当前仪器对应的收费项目', visible: true, align: 'center', width: 300 },
|
||||||
{ prop: 'yq', label: '仪器', visible: false, align: 'center', width: 100 },
|
{ prop: 'yq', label: '仪器', visible: false, align: 'center', width: 100 },
|
||||||
]);
|
]);
|
||||||
const columnsRight = ref([
|
const columnsRight = ref([
|
||||||
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', },
|
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', width: 100 },
|
||||||
{ prop: 'sfxmdh', label: '收费项目代号', visible: true, align: 'center', },
|
{ prop: 'sfxmdh', label: '收费项目代号', visible: true, align: 'center', width: 200 },
|
||||||
{ prop: 'sfxmmc', label: '收费项目名称', visible: true, align: 'center', },
|
{ prop: 'sfxmmc', label: '收费项目名称', visible: true, align: 'center', width: 300 },
|
||||||
{ prop: 'dj', label: '单价', visible: true, align: 'center', },
|
{ prop: 'dj', label: '单价', visible: true, align: 'center', width: 100 },
|
||||||
{ prop: 'cp_yq', label: '分配了仪器', visible: true, align: 'center', }
|
{ prop: 'cp_yq', label: '分配了仪器', visible: true, align: 'center', width: 400 }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const dataListLeft = ref([])
|
const dataListLeft = ref([
|
||||||
|
{'sfxmdh':'','yq':''}
|
||||||
|
])
|
||||||
const dataListRight = ref([])
|
const dataListRight = ref([])
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
yq: '46',
|
yq: '',
|
||||||
item: ''
|
item: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
//刷新数据
|
//刷新数据
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
if (!formData.value.yq) formData.value.yq = ''
|
if(!formData.value.yq) formData.value.yq = ''
|
||||||
let res = await queryService({ yq: formData.value.yq });
|
let res = await queryService({yq: formData.value.yq});
|
||||||
dataListLeft.value = res.data;
|
dataListLeft.value = res.data;
|
||||||
// res = await queryOneService('HISOPT', 'sp_gyxmyljg')
|
res = await queryOneService('HISOPT','sp_gyxmyljg')
|
||||||
// let param = res.data.value
|
let param = res.data.value
|
||||||
//先写固定值,后面再改
|
//先写固定值,后面再改
|
||||||
let param = '1'
|
if(param && param !== ''){
|
||||||
if (param && param !== '') {
|
param = '1'
|
||||||
param = '1'
|
}else{
|
||||||
} else {
|
param = '1'
|
||||||
param = '1'
|
}
|
||||||
}
|
res = await queryXmService({yljg: param,yq: formData.value.yq,queryValue: formData.value.item});
|
||||||
res = await queryXmService({ yljg: param, yq: formData.value.yq, queryValue: formData.value.item });
|
dataListRight.value = res.data;
|
||||||
dataListRight.value = res.data;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDBClickRight = async (row: any) => {
|
const onDBClickRight = async (row:any)=> {
|
||||||
//新增数据
|
//新增数据
|
||||||
await addService({ sfxmdh: row.sfxmdh, yq: formData.value.yq })
|
await addService({sfxmdh:row.sfxmdh,yq: formData.value.yq})
|
||||||
ElMessage.success('新增成功!')
|
ElMessage.success('新增成功!')
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onDBClickLeft = async (row: any) => {
|
const onDBClickLeft = async (row:any) => {
|
||||||
//删除数据
|
//删除数据
|
||||||
await delService({ yq: formData.value.yq, sfxmdh: row.sfxmdh })
|
await delService({yq: formData.value.yq,sfxmdh: row.sfxmdh})
|
||||||
ElMessage.success('删除成功!')
|
ElMessage.success('删除成功!')
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onQueryClick = () => {
|
const onQueryClick = () => {
|
||||||
if (!formData.value.yq) {
|
if(!formData.value.yq) {
|
||||||
ElMessage.error('请先选择仪器!')
|
ElMessage.error('请先选择仪器!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
getList()
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<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>
|
</style>
|
||||||
|
|||||||
@ -71,20 +71,20 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||||
@size-change="sizeChange" @page-change="currentChange" @row-click="rowHandle">
|
@size-change="sizeChange" @page-change="currentChange" @row-click="rowHandle">
|
||||||
<template #patAge="{ row }">
|
<template #patAge="{ row }">
|
||||||
{{ row.patAge }}{{ row.ageUnit }}
|
{{ row.patAge }}{{ row.ageUnit }}
|
||||||
</template>
|
</template>
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
{{ formatDict(row.status, regdictList) }}
|
{{ formatDict(row.status, regdictList) }}
|
||||||
</template>
|
</template>
|
||||||
<template #patSex="{ row }">
|
<template #patSex="{ row }">
|
||||||
{{ row.patSex == 1 ? '男' : '女' }}
|
{{ row.patSex == 1 ? '男' : '女' }}
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
</div>
|
|
||||||
<!-- 样本流程 -->
|
<!-- 样本流程 -->
|
||||||
<div class="time-line-box">
|
<div class="time-line-box">
|
||||||
<div v-for="(item, i) in timelineItems" :key="i" class="time-line-item">
|
<div v-for="(item, i) in timelineItems" :key="i" class="time-line-item">
|
||||||
|
|||||||
@ -60,20 +60,20 @@
|
|||||||
<el-button type="primary" @click="qsHandle(110)">标本拒签</el-button>
|
<el-button type="primary" @click="qsHandle(110)">标本拒签</el-button>
|
||||||
<el-button type="primary" plain @click="bbThHandle">标本退回</el-button>
|
<el-button type="primary" plain @click="bbThHandle">标本退回</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: calc(100% - 180px)">
|
|
||||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||||
<template #patAge="{ row }">
|
<template #patAge="{ row }">
|
||||||
{{ row.patAge }}{{ row.ageUnit }}
|
{{ row.patAge }}{{ row.ageUnit }}
|
||||||
</template>
|
</template>
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
{{ formatDict(row.status, regdictList) }}
|
{{ formatDict(row.status, regdictList) }}
|
||||||
</template>
|
</template>
|
||||||
<template #patSex="{ row }">
|
<template #patSex="{ row }">
|
||||||
{{ row.patSex == 1 ? '男' : '女' }}
|
{{ row.patSex == 1 ? '男' : '女' }}
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ const columns: any = ref([
|
|||||||
])
|
])
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '100%', // 高度
|
height: '68vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
// fit: true, // 列宽自适应
|
// fit: true, // 列宽自适应
|
||||||
})
|
})
|
||||||
|
|||||||
@ -60,20 +60,18 @@
|
|||||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
|
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="height: calc(100% - 180px)">
|
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
<template #patAge="{ row }">
|
||||||
<template #patAge="{ row }">
|
{{ row.patAge }}{{ row.ageUnit }}
|
||||||
{{ row.patAge }}{{ row.ageUnit }}
|
</template>
|
||||||
</template>
|
<template #status="{ row }">
|
||||||
<template #status="{ row }">
|
{{ formatDict(row.status, regdictList) }}
|
||||||
{{ formatDict(row.status, regdictList) }}
|
</template>
|
||||||
</template>
|
<template #patSex="{ row }">
|
||||||
<template #patSex="{ row }">
|
{{ row.patSex == 1 ? '男' : '女' }}
|
||||||
{{ row.patSex == 1 ? '男' : '女' }}
|
</template>
|
||||||
</template>
|
</CustomTable>
|
||||||
</CustomTable>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -111,7 +109,7 @@ const columns: any = ref([
|
|||||||
])
|
])
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '100%', // 高度
|
height: '68vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
// fit: true, // 列宽自适应
|
// fit: true, // 列宽自适应
|
||||||
})
|
})
|
||||||
|
|||||||
@ -69,20 +69,20 @@
|
|||||||
<el-col :span="1.5"> <el-button type="primary" :size="aotuSize" @click="sjHandle(20)">取消送检</el-button></el-col>
|
<el-col :span="1.5"> <el-button type="primary" :size="aotuSize" @click="sjHandle(20)">取消送检</el-button></el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: calc(100% - 180px);">
|
|
||||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||||
<template #patAge="{ row }">
|
<template #patAge="{ row }">
|
||||||
{{ row.patAge }}{{ row.ageUnit }}
|
{{ row.patAge }}{{ row.ageUnit }}
|
||||||
</template>
|
</template>
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
{{ formatDict(row.status, regdictList) }}
|
{{ formatDict(row.status, regdictList) }}
|
||||||
</template>
|
</template>
|
||||||
<template #patSex="{ row }">
|
<template #patSex="{ row }">
|
||||||
{{ row.patSex == 1 ? '男' : '女' }}
|
{{ row.patSex == 1 ? '男' : '女' }}
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ const columns: any = ref([
|
|||||||
])
|
])
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '100%', // 高度
|
height: '70vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
// fit: true, // 列宽自适应
|
// fit: true, // 列宽自适应
|
||||||
})
|
})
|
||||||
|
|||||||
@ -35,12 +35,10 @@
|
|||||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
<div style="height: calc(100% - 100px)">
|
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
@size-change="sizeChange" @page-change="currentChange">
|
||||||
@size-change="sizeChange" @page-change="currentChange">
|
|
||||||
|
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -72,7 +70,7 @@ const columns: any = ref([
|
|||||||
])
|
])
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '100%', // 高度
|
height: '75vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
summary: true,
|
summary: true,
|
||||||
summaryField: ['sl'],//计算列总和
|
summaryField: ['sl'],//计算列总和
|
||||||
@ -158,8 +156,6 @@ const formatDict = (v: string, arr: Array<any>) => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.compact-form {
|
.compact-form {
|
||||||
height: 40px;
|
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,12 +35,10 @@
|
|||||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
<div style="height: calc(100% - 100px);">
|
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
@size-change="sizeChange" @page-change="currentChange">
|
||||||
@size-change="sizeChange" @page-change="currentChange">
|
|
||||||
|
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -73,7 +71,7 @@ const columns: any = ref([
|
|||||||
])
|
])
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '100%', // 高度
|
height: '75vh', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
summary: true,
|
summary: true,
|
||||||
summaryField: ['sl', 'cost'],//计算列总和
|
summaryField: ['sl', 'cost'],//计算列总和
|
||||||
@ -167,8 +165,6 @@ const formatDict = (v: string, arr: Array<any>) => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.compact-form {
|
.compact-form {
|
||||||
height: 40px;
|
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user