项目模板
This commit is contained in:
parent
c3b89a01ab
commit
6f1770fd35
20
src/api/liswork/xmmb/index.ts
Normal file
20
src/api/liswork/xmmb/index.ts
Normal file
@ -0,0 +1,20 @@
|
||||
//@ts-ignore js语法检查忽略
|
||||
import request from '@/utils/request';
|
||||
|
||||
|
||||
// 查询模板列表
|
||||
export function queryMbList(query?: Object) {
|
||||
return request({
|
||||
url: '/labInputmdl/query',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 查询明细数据
|
||||
export function queryDetail(query?: Object) {
|
||||
return request({
|
||||
url: '/labInputmdl/queryDetail',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@ -19,3 +19,36 @@ export function queryDetailService(params: any) {
|
||||
params,
|
||||
});
|
||||
}
|
||||
//查询项目明细 old
|
||||
export function queryOldxminfo(params: any) {
|
||||
return request({
|
||||
url: "/oldxminfo/query",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
//搜索项目
|
||||
export function searchxminfo(params: any) {
|
||||
return request({
|
||||
url: "/vsReportitem/search",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
//添加收费项目报告项目对照
|
||||
export function addXminfo(data: Object) {
|
||||
return request({
|
||||
url: "/vsReportitem/add",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
//删除收费项目报告项目对照
|
||||
export function delXminfo(data: Object) {
|
||||
return request({
|
||||
url: "/vsReportitem/del",
|
||||
method: "delete",
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
dictType: '',
|
||||
clearable: true,
|
||||
objKey: 'value',
|
||||
keyValue: false,
|
||||
fields: () => [
|
||||
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
@ -116,7 +117,7 @@ const visibleChange = (val: any) => {
|
||||
currentIndex.value = filterData.value.findIndex(item => item[props.value!] === props.data);
|
||||
if (currentIndex.value >= 0) {
|
||||
tableRef.value.setCurrentRow(filterData.value[currentIndex.value]);
|
||||
tableRef.value.setScrollTop(currentIndex.value);
|
||||
tableRef.value.setScrollTop(currentIndex.value * 30);
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
@ -140,7 +141,7 @@ const handleDataEcho = () => {
|
||||
} else if (props.tableData) {
|
||||
row = props.tableData?.find((item: any) => props.objKey && item[props.objKey] === props.data)
|
||||
}
|
||||
selectShowValue.value = row ? (props.label ? row[props.label] : (props.value ? row[props.value] : '')) : '';
|
||||
selectShowValue.value = row ? (props.keyValue ? `${row[props.value]} ${row[props.label]}` : (props.label ? row[props.label] : (props.value ? row[props.value] : ''))) : '';
|
||||
}
|
||||
};
|
||||
|
||||
@ -238,7 +239,7 @@ const handleKeydown = (e: any) => {
|
||||
tableRef.value.setCurrentRow(filterData.value[currentIndex.value]);
|
||||
|
||||
// 滚动到当前行
|
||||
tableRef.value.setScrollTop(currentIndex.value);
|
||||
tableRef.value.setScrollTop(currentIndex.value * 30);
|
||||
|
||||
// 回车确认
|
||||
if (e.key === "Enter") {
|
||||
@ -301,6 +302,8 @@ const setLabel = (val: any) => {
|
||||
selectShowValue.value = val[props.label];
|
||||
} else if (props.value) {
|
||||
selectShowValue.value = val[props.value];
|
||||
} else if (props.keyValue) {
|
||||
selectShowValue.value = `${val[props.value]} ${val[props.label]}`;
|
||||
}
|
||||
if (props.objKey) {
|
||||
// 返回值objKey对应的对象数据
|
||||
|
||||
@ -33,12 +33,12 @@ export const getDictData = async (...args: string[]) => {
|
||||
//字典数据格式化方法
|
||||
export const formatDict = (v: string, dictType: string) => {
|
||||
if (v == undefined) return;
|
||||
return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label;
|
||||
return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label || v;
|
||||
}
|
||||
|
||||
//仪器格式化方法
|
||||
export const formatInstr = (v: string) => {
|
||||
return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc;
|
||||
return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc || v;
|
||||
}
|
||||
|
||||
export { dictData, instrOptions }
|
||||
1
src/types/SelectTable.d.ts
vendored
1
src/types/SelectTable.d.ts
vendored
@ -18,6 +18,7 @@ export interface Props {
|
||||
disabled?: boolean;
|
||||
dictType?: string;
|
||||
clearable?: boolean;
|
||||
keyValue?: boolean; //是否使用键值对模式
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig">
|
||||
<template #reserve="{row}">
|
||||
{{ reserve(row.reserve) }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig">
|
||||
<template #reserve="{ row }">
|
||||
{{ reserve(row.reserve) }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
|
||||
const props = defineProps({
|
||||
dataList:{
|
||||
dataList: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: []
|
||||
@ -23,7 +23,7 @@ const props = defineProps({
|
||||
reserveWidth: 50,
|
||||
textresultWidth: 200,
|
||||
zdWidth: 100,
|
||||
tableHeight: '85vh'
|
||||
tableHeight: '100%'
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,9 +31,9 @@ const props = defineProps({
|
||||
|
||||
//const dataListRight = ref([]);
|
||||
const columnsRight = ref([
|
||||
{ prop: 'reserve', label: '类别', visible: true, align: 'center',slot: 'reserve', width: props.styleConfig.reserveWidth },
|
||||
{ prop: 'textresult', label: '说明', visible: true, align: 'center', width: props.styleConfig.textresultWidth ,showOverflowTooltip: false},
|
||||
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', width: props.styleConfig.zdWidth,showOverflowTooltip: false },
|
||||
{ prop: 'reserve', label: '类别', visible: true, align: 'center', slot: 'reserve', },
|
||||
{ prop: 'textresult', label: '说明', visible: true, align: 'center', showOverflowTooltip: false },
|
||||
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', showOverflowTooltip: false },
|
||||
])
|
||||
|
||||
const tableConfig = ref({
|
||||
@ -50,8 +50,8 @@ const handleColumnDragEnd = (data: any) => {
|
||||
}
|
||||
|
||||
|
||||
const reserve = (reserve:string) => {
|
||||
switch(reserve){
|
||||
const reserve = (reserve: string) => {
|
||||
switch (reserve) {
|
||||
case '1':
|
||||
return '综述'
|
||||
case 'H':
|
||||
@ -72,5 +72,4 @@ const reserve = (reserve:string) => {
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@ -1,20 +1,22 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="topForm">
|
||||
<el-form ref="formRef" :model="formData" inline label-width="80px" class="mb8" @submit.prevent="handleSubmit">
|
||||
<el-form ref="formRef" :model="formData" inline label-width="80px" @submit.prevent="handleSubmit">
|
||||
<el-form-item label="检索" prop="js">
|
||||
<el-input placeholder="项目代号,名称,简拼" v-model="formData.js" style="width: 200px;"
|
||||
@keyup.enter="getList"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||
<el-button type="primary" @click="onAddClick">新增</el-button>
|
||||
<el-button type="primary" @click="onDelClick">删除</el-button>
|
||||
<el-button type="danger" @click="onDelClick">删除</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="17">
|
||||
<el-row :gutter="20" class="table-row">
|
||||
<el-col :span="17" class="table-col">
|
||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClick" @row-click="onClick"
|
||||
:pagination="pagination" @size-change="sizeChange" @page-change="currentChange">
|
||||
@ -23,7 +25,7 @@
|
||||
</template>
|
||||
</CustomTable>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-col :span="7" class="table-col">
|
||||
<TableRight :data-list="dataListRight" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -63,7 +65,7 @@ const columnsLeft = ref([
|
||||
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '85vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// cellStyle: cellStyleHd
|
||||
})
|
||||
@ -158,12 +160,12 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-row {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.topForm {
|
||||
.table-row {
|
||||
height: calc(100% - 150px);
|
||||
margin-top: 10px;
|
||||
|
||||
.table-col {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
192
src/views/liswork/xmmb/index.vue
Normal file
192
src/views/liswork/xmmb/index.vue
Normal file
@ -0,0 +1,192 @@
|
||||
/**
|
||||
* @file index.vue
|
||||
* @author: w
|
||||
* @since: 2025-12-24
|
||||
*/
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" @click="handleAdd">新增</el-button>
|
||||
<el-button type="danger" @click="handleDel">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="table-row" style="margin-top: 10px;">
|
||||
<el-col :span="24" class="table-col">
|
||||
<CustomTable ref="tableRef" v-model:data="tableData" :columns="columns" :config="tableConfig"
|
||||
@row-dblclick="handleRowDblclick">
|
||||
<template #yq="{ row }">
|
||||
{{ formatInstr(row.yq) }}
|
||||
</template>
|
||||
<template #yblx="{ row }">
|
||||
{{ formatYblx(row.yblx) }}
|
||||
</template>
|
||||
<template #zdsr="{ row }">
|
||||
<el-checkbox :model-value="row.zdsr == 'Y'" />
|
||||
</template>
|
||||
</CustomTable>
|
||||
</el-col>
|
||||
<el-dialog :title="title" v-model="visible" width="50vw" :close-on-click-modal="false" :draggable="true">
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="10">
|
||||
<el-form ref="formRef" :model="formData" label-width="150px">
|
||||
<el-form-item label="仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="formData.yq" :disabled="disabled" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模板名称" prop="mbmc">
|
||||
<el-input v-model="formData.mbmc" />
|
||||
</el-form-item>
|
||||
<el-form-item label="输入编号" prop="srbh">
|
||||
<el-input v-model="formData.srbh" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标本类型" prop="yblx">
|
||||
<SelectTable v-model:data="formData.yblx" :tableData="regdictList" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="zdsr">
|
||||
<el-checkbox v-model="formData.zdsr" label="自动输入" true-value="Y" false-value="N" />
|
||||
</el-form-item>
|
||||
<el-form-item label="自动输入起始标本号" prop="qsybh">
|
||||
<el-input v-model="formData.qsybh" />
|
||||
</el-form-item>
|
||||
<el-form-item label="自动输入结束标本号" prop="jsybh">
|
||||
<el-input v-model="formData.jsybh" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="mb10">
|
||||
<el-button type="primary" @click="handleSave">保存</el-button>
|
||||
<el-button type="primary" @click="handleAdd">新增</el-button>
|
||||
<el-button type="danger" @click="handleDel">删除</el-button>
|
||||
</div>
|
||||
<div style="height: 400px">
|
||||
<CustomTable ref="tableRefRight" :data="rightTableData" :columns="rightColumns" :config="tableConfig">
|
||||
<template #xmdh="{ row }">
|
||||
{{ row.xmdh }} {{ row.xmmc }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||
// @ts-ignore
|
||||
import { listregdict } from "@/api/regional/dict/regdict.js";
|
||||
import { queryMbList, queryDetail } from '@/api/liswork/xmmb';
|
||||
import { formatInstr, getYqData } from '@/hooks'
|
||||
|
||||
const disabled = ref(false)
|
||||
const formData = ref({
|
||||
yq: '',
|
||||
mbmc: '',
|
||||
srbh: '',
|
||||
yblx: '',
|
||||
zdsr: '',
|
||||
qsybh: '',
|
||||
jsybh: '',
|
||||
})
|
||||
const title = ref('')
|
||||
const visible = ref(false)
|
||||
const tableData = ref([])
|
||||
const columns = ref([
|
||||
{ prop: 'yq', label: '仪器', visible: true, align: 'center', slot: 'yq' },
|
||||
{ prop: 'mbmc', label: '输入模板', visible: true, align: 'center', },
|
||||
{ prop: 'srbh', label: '输入编号', visible: true, align: 'center', },
|
||||
{ prop: 'yblx', label: '样本类型', visible: true, align: 'center', slot: 'yblx' },
|
||||
{ prop: 'zdsr', label: '自动输入', visible: true, align: 'center', slot: 'zdsr' },
|
||||
{ prop: 'qsybh', label: '起始号', visible: true, align: 'center', },
|
||||
{ prop: 'jsybh', label: '结束号', visible: true, align: 'center', },
|
||||
])
|
||||
|
||||
const tableConfig = ref({
|
||||
height: '100%', // 高度
|
||||
border: true, // 边框
|
||||
highlightCurrentRow: true, // 当前行高亮
|
||||
})
|
||||
|
||||
const regdictList = ref<Array<{ value: string, label: string }>>([])
|
||||
const rightTableData = ref([])
|
||||
const rightColumns = ref([
|
||||
{ prop: 'xmdh', label: '检验项目', visible: true, align: 'center', slot: 'xmdh' },
|
||||
{ prop: 'mrz', label: '默认值', visible: true, align: 'center', },
|
||||
])
|
||||
|
||||
const handleAdd = () => {
|
||||
formData.value = {
|
||||
yq: '',
|
||||
mbmc: '',
|
||||
srbh: '',
|
||||
yblx: '',
|
||||
zdsr: '',
|
||||
qsybh: '',
|
||||
jsybh: '',
|
||||
}
|
||||
disabled.value = false
|
||||
rightTableData.value = []
|
||||
title.value = '新增模板'
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
const handleRowDblclick = (row: any) => {
|
||||
queryDetail(row).then((res: any) => {
|
||||
rightTableData.value = res.data
|
||||
})
|
||||
row.yq = row.yq.trim()
|
||||
formData.value = row
|
||||
disabled.value = true
|
||||
title.value = '编辑模板'
|
||||
visible.value = true
|
||||
}
|
||||
const handleSave = () => { }
|
||||
const handleDel = () => { }
|
||||
const getList = () => {
|
||||
queryMbList().then((res: any) => {
|
||||
tableData.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
getList()
|
||||
onMounted(() => {
|
||||
getYqData()
|
||||
// 获取标本类型
|
||||
listregdict({ pageSize: 100, pageNum: 1, dictType: 'BT' }).then((res: any) => {
|
||||
regdictList.value = res.rows.map((item: any) => {
|
||||
return {
|
||||
label: item.dictName,
|
||||
value: item.dictCode
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const formatYblx = (v: string) => {
|
||||
return regdictList.value.find((item: any) => item.value == v)?.label || v
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.table-row {
|
||||
height: calc(100% - 60px);
|
||||
|
||||
.table-col {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.right-col {
|
||||
padding-top: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@ -13,16 +13,16 @@
|
||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span>说明:双击左侧列表,能删除对照数据,双击右边列表能新增数据到对照当中</span>
|
||||
<span class="tips">说明:双击左侧列表,能删除对照数据,双击右边列表能新增数据到对照当中</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClickLeft" />
|
||||
<el-row :gutter="20" class="table-row">
|
||||
<el-col :span="6" class="table-col">
|
||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :config="tableConfig"
|
||||
@row-dblclick="onDBClickLeft" />
|
||||
</el-col>
|
||||
<el-col :span="19">
|
||||
<el-col :span="18" class="table-col">
|
||||
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClickRight" />
|
||||
</el-col>
|
||||
@ -42,36 +42,31 @@ import { ElMessage } from 'element-plus';
|
||||
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '76vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// cellStyle: cellStyleHd
|
||||
})
|
||||
|
||||
//退拽属性
|
||||
const handleColumnDragEnd = (data: any) => {
|
||||
// 更新列配置
|
||||
columnsLeft.value = data.columns;
|
||||
columnsRight.value = data.columns;
|
||||
}
|
||||
|
||||
const columnsLeft = ref([
|
||||
{ prop: 'sfxmmc', label: '当前仪器对应的收费项目', visible: true, align: 'center', width: 300 },
|
||||
{ prop: 'sfxmmc', label: '当前仪器对应的收费项目', visible: true, },
|
||||
{ prop: 'yq', label: '仪器', visible: false, align: 'center', width: 100 },
|
||||
]);
|
||||
const columnsRight = ref([
|
||||
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', width: 100 },
|
||||
{ prop: 'sfxmdh', label: '收费项目代号', visible: true, align: 'center', width: 200 },
|
||||
{ prop: 'sfxmmc', label: '收费项目名称', visible: true, align: 'center', width: 300 },
|
||||
{ prop: 'dj', label: '单价', visible: true, align: 'center', width: 100 },
|
||||
{ prop: 'cp_yq', label: '分配了仪器', visible: true, align: 'center', width: 400 }
|
||||
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', },
|
||||
{ prop: 'sfxmdh', label: '收费项目代号', visible: true, align: 'center', },
|
||||
{ prop: 'sfxmmc', label: '收费项目名称', visible: true, align: 'center', },
|
||||
{ prop: 'dj', label: '单价', visible: true, align: 'center', },
|
||||
{ prop: 'cp_yq', label: '分配了仪器', visible: true, align: 'center', }
|
||||
]);
|
||||
|
||||
const dataListLeft = ref([
|
||||
{ 'sfxmdh': '', 'yq': '' }
|
||||
])
|
||||
const dataListLeft = ref([])
|
||||
const dataListRight = ref([])
|
||||
const formData = ref({
|
||||
yq: '',
|
||||
yq: '46',
|
||||
item: ''
|
||||
})
|
||||
|
||||
@ -115,9 +110,23 @@ const onQueryClick = () => {
|
||||
getList()
|
||||
}
|
||||
|
||||
|
||||
|
||||
getList()
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
<style scoped lang="scss">
|
||||
.tips {
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
font-size: 16px;
|
||||
color: #409eff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
height: calc(100% - 58px);
|
||||
|
||||
.table-col {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="formData" label-width="80px" inline>
|
||||
<el-form-item label="仪器" prop="yq">
|
||||
<YQSelectTable v-model:data="formData.yq" width="200px" placeholder="请输入仪器名称" @get-data-value="getList" />
|
||||
<YQSelectTable v-model:data="formData.yq" width="200px" placeholder="请输入仪器名称" @get-data-value="getDataValue" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目" prop="xmdh">
|
||||
<el-input placeholder="请输入项目名称" v-model="formData.xmdh" style="width: 200px;"></el-input>
|
||||
<el-input placeholder="请输入项目名称" v-model="formData.sqxmmc" style="width: 200px;" @keyup.enter="getList" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="formData.sl" label="只看仪器对照收费项目" true-value="1" false-value="" @change="getList" />
|
||||
@ -15,7 +15,8 @@
|
||||
|
||||
<el-row>
|
||||
<el-button type="primary" icon="Plus" @click="onClickAdd">新增</el-button>
|
||||
<el-button type="primary" icon="Delete" @click="onClickDel">删除</el-button>
|
||||
<el-button type="danger" icon="Delete" @click="onClickDel">删除</el-button>
|
||||
<el-button type="primary" icon="Edit" @click="searchHandle">搜索申请项目</el-button>
|
||||
<el-button type="primary" icon="Edit" @click="onClickSave">保存</el-button>
|
||||
</el-row>
|
||||
|
||||
@ -26,10 +27,9 @@
|
||||
</el-col>
|
||||
<el-col :span="16" class="table-col">
|
||||
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true"
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig">
|
||||
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowHandle">
|
||||
<template #xmdh="{ row }">
|
||||
{{ row.xmdh }} {{ row.xmmc }}
|
||||
<!-- <SelectTable v-model:data="row.xmdh" :tableData="dataListLeft" class="full-width-input" /> -->
|
||||
<SelectTable v-model:data="row.xmdh" :tableData="xmList" class="full-width-input" :keyValue="true" />
|
||||
</template>
|
||||
<template #tdh="{ row }">
|
||||
<el-input placeholder="" v-model="row.tdh" class="full-width-input"></el-input>
|
||||
@ -37,6 +37,9 @@
|
||||
<template #mrz="{ row }">
|
||||
<el-input v-model="row.mrz" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #seq="{ row }">
|
||||
<el-input v-model="row.seq" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #def="{ row }">
|
||||
<el-checkbox v-model="row.def" true-value="1" false-value="0" />
|
||||
</template>
|
||||
@ -48,17 +51,28 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { queryListService, queryDetailService } from '@/api/liswork/xtwh/xmReqItemVsApi';
|
||||
import { queryListService, queryDetailService, queryOldxminfo, addXminfo, delXminfo, searchxminfo } from '@/api/liswork/xtwh/xmReqItemVsApi';
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
const formData = ref({
|
||||
yq: '46',
|
||||
xmdh: '',
|
||||
sqxmmc: '',
|
||||
sl: ''
|
||||
})
|
||||
|
||||
interface tableItem {
|
||||
xmdh: string;
|
||||
tdh: string;
|
||||
mrz: string;
|
||||
seq: number;
|
||||
def: string;
|
||||
}
|
||||
const dataListLeft = ref([])
|
||||
const dataListRight = ref([])
|
||||
const dataListRight = ref<tableItem[]>([])
|
||||
const xmList = ref([])
|
||||
const selectRow = ref<any>(null)
|
||||
|
||||
//退拽属性
|
||||
const handleColumnDragEnd = (data: any) => {
|
||||
@ -81,34 +95,95 @@ const columnsRight = ref([
|
||||
{ prop: 'xmdh', label: '报告项目', visible: true, align: 'center', width: 250, slot: 'xmdh', showOverflowTooltip: false },
|
||||
{ prop: 'tdh', label: '双工代号', visible: true, align: 'center', slot: 'tdh' },
|
||||
{ prop: 'mrz', label: '默认值', visible: true, align: 'center', slot: 'mrz' },
|
||||
{ prop: 'seq', label: '序号', visible: true, align: 'center', },
|
||||
{ prop: 'seq', label: '序号', visible: true, align: 'center', slot: 'seq' },
|
||||
{ prop: 'def', label: '非必做', visible: true, align: 'center', slot: 'def' },
|
||||
]);
|
||||
|
||||
const tableRefLeft = ref()
|
||||
// 获取数据列表
|
||||
const getList = async () => {
|
||||
const res = await queryListService(formData.value)
|
||||
dataListLeft.value = res.data
|
||||
rowClickLeft(dataListLeft.value[0] || { sqxmdh: '', sqxmmc: '' })
|
||||
if (dataListLeft.value.length) {
|
||||
rowClickLeft(dataListLeft.value[0])
|
||||
tableRefLeft.value?.setCurrentRow(dataListLeft.value[0])
|
||||
} else {
|
||||
dataListRight.value = []
|
||||
selectRow.value = null
|
||||
}
|
||||
}
|
||||
|
||||
const rowHandle = (row: any) => {
|
||||
selectRow.value = row
|
||||
}
|
||||
|
||||
const onClickAdd = () => {
|
||||
// TODO 新增
|
||||
dataListRight.value.push({
|
||||
xmdh: '',
|
||||
tdh: '',
|
||||
mrz: '',
|
||||
seq: dataListRight.value.length + 1,
|
||||
def: '0',
|
||||
})
|
||||
}
|
||||
|
||||
const onClickDel = () => {
|
||||
// TODO 删除
|
||||
if (!selectRow.value) return ElMessage.warning('请选择要删除的行!')
|
||||
|
||||
if (selectRow.value.sqxmdh) {
|
||||
delXminfo(selectRow.value)
|
||||
rowClickLeft(xmInfo.value)
|
||||
} else {
|
||||
dataListRight.value = dataListRight.value.filter(item => item.xmdh != selectRow.value.xmdh)
|
||||
}
|
||||
selectRow.value = null
|
||||
}
|
||||
|
||||
const onClickSave = () => {
|
||||
// TODO 保存
|
||||
dataListRight.value = dataListRight.value.filter(item => item.xmdh)
|
||||
const arr = dataListRight.value.map(item => {
|
||||
return {
|
||||
...item,
|
||||
sqxmdh: xmInfo.value.sqxmdh,
|
||||
sqxmmc: xmInfo.value.sqxmmc,
|
||||
yq: formData.value.yq,
|
||||
}
|
||||
})
|
||||
|
||||
addXminfo(arr).then(() => {
|
||||
ElMessage.success('保存成功')
|
||||
rowClickLeft(xmInfo.value)
|
||||
})
|
||||
}
|
||||
|
||||
const searchHandle = () => {
|
||||
searchxminfo({ yq: formData.value.yq })
|
||||
}
|
||||
const getDataValue = (value: any) => {
|
||||
getOldXminfoList()
|
||||
getList()
|
||||
}
|
||||
|
||||
const xmInfo: any = ref({})
|
||||
//点击事件
|
||||
const rowClickLeft = async (row: any) => {
|
||||
selectRow.value = null
|
||||
xmInfo.value = row
|
||||
const res = await queryDetailService({ sqxmdh: row.sqxmdh, sqxmmc: row.sqxmmc, yq: formData.value.yq })
|
||||
dataListRight.value = res.rows
|
||||
}
|
||||
|
||||
const getOldXminfoList = async () => {
|
||||
const res = await queryOldxminfo({ yq: formData.value.yq })
|
||||
xmList.value = res.data.map((item: any) => {
|
||||
return {
|
||||
label: item.xmmc,
|
||||
value: item.xmdh,
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getOldXminfoList()
|
||||
getList()
|
||||
</script>
|
||||
|
||||
|
||||
@ -71,20 +71,20 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange" @row-click="rowHandle">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
<div>
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange" @row-click="rowHandle">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
<!-- 样本流程 -->
|
||||
<div class="time-line-box">
|
||||
<div v-for="(item, i) in timelineItems" :key="i" class="time-line-item">
|
||||
@ -258,6 +258,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 80px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -60,20 +60,20 @@
|
||||
<el-button type="primary" @click="qsHandle(110)">标本拒签</el-button>
|
||||
<el-button type="primary" plain @click="bbThHandle">标本退回</el-button>
|
||||
</div>
|
||||
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
<div style="height: calc(100% - 180px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -113,7 +113,7 @@ const columns: any = ref([
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '68vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
@ -228,6 +228,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 80px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -60,18 +60,20 @@
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button>
|
||||
|
||||
</div>
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
<div style="height: calc(100% - 180px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -109,7 +111,7 @@ const columns: any = ref([
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '68vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
@ -200,6 +202,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 80px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -69,20 +69,20 @@
|
||||
<el-col :span="1.5"> <el-button type="primary" :size="aotuSize" @click="sjHandle(20)">取消送检</el-button></el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
|
||||
<div style="height: calc(100% - 180px);">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@selection-change="handleSelectionChange" @size-change="sizeChange" @page-change="currentChange">
|
||||
<template #patAge="{ row }">
|
||||
{{ row.patAge }}{{ row.ageUnit }}
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
{{ formatDict(row.status, regdictList) }}
|
||||
</template>
|
||||
<template #patSex="{ row }">
|
||||
{{ row.patSex == 1 ? '男' : '女' }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -121,7 +121,7 @@ const columns: any = ref([
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '70vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// fit: true, // 列宽自适应
|
||||
})
|
||||
@ -229,6 +229,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 80px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -35,10 +35,12 @@
|
||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
||||
</div>
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange">
|
||||
<div style="height: calc(100% - 100px)">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange">
|
||||
|
||||
</CustomTable>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -70,7 +72,7 @@ const columns: any = ref([
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '75vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
summary: true,
|
||||
summaryField: ['sl'],//计算列总和
|
||||
@ -156,6 +158,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 40px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@ -35,10 +35,12 @@
|
||||
<el-button type="primary" @click="thHandle(50)">撤销退回</el-button>
|
||||
<el-button type="primary" @click="thHandle(90)">申请作废</el-button> -->
|
||||
</div>
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange">
|
||||
<div style="height: calc(100% - 100px);">
|
||||
<CustomTable ref="tableRefs" :data="tableData" :columns="columns" :config="tableConfig" :pagination="pagination"
|
||||
@size-change="sizeChange" @page-change="currentChange">
|
||||
|
||||
</CustomTable>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -71,7 +73,7 @@ const columns: any = ref([
|
||||
])
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
height: '75vh', // 高度
|
||||
height: '100%', // 高度
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
summary: true,
|
||||
summaryField: ['sl', 'cost'],//计算列总和
|
||||
@ -165,6 +167,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.compact-form {
|
||||
height: 40px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user