Compare commits
2 Commits
f699dc636f
...
13d09216b1
| Author | SHA1 | Date | |
|---|---|---|---|
| 13d09216b1 | |||
| 5f0d568cb7 |
12
src/api/liswork/advancedReview/index.ts
Normal file
12
src/api/liswork/advancedReview/index.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
//@ts-ignore js语法检查忽略
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
|
||||||
|
//获取报告列表
|
||||||
|
export function queryList(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/labCheckrules/queryList',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
54
src/api/liswork/xmmb/index.ts
Normal file
54
src/api/liswork/xmmb/index.ts
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
//@ts-ignore js语法检查忽略
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
|
||||||
|
// 查询模板列表
|
||||||
|
export function queryMbList(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/labInputmdl/query',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 查询明细数据
|
||||||
|
export function queryDetail(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/labInputmdl/queryDetail',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 新增模板
|
||||||
|
export function addXmInfo(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/labInputmdl/add',
|
||||||
|
method: 'post',
|
||||||
|
data: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 修改模板
|
||||||
|
export function updateXmInfo(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/labInputmdl/update',
|
||||||
|
method: 'post',
|
||||||
|
data: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除模板
|
||||||
|
export function deleteXmInfo(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/labInputmdl/delete',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 删除明细数据
|
||||||
|
export function deleteDetail(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/labInputmdl/deleteDetail',
|
||||||
|
method: 'post',
|
||||||
|
data: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
54
src/api/liswork/xtwh/xmReqItemVsApi.ts
Normal file
54
src/api/liswork/xtwh/xmReqItemVsApi.ts
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
//收费项目报告项目对照
|
||||||
|
// @ts-ignore
|
||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
//查询申请信息列表
|
||||||
|
export function queryListService(params: any) {
|
||||||
|
return request({
|
||||||
|
url: "/vsReportitem/queryList",
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询项目明细
|
||||||
|
export function queryDetailService(params: any) {
|
||||||
|
return request({
|
||||||
|
url: "/vsReportitem/query",
|
||||||
|
method: "get",
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -54,8 +54,8 @@ const getYqConfig = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getDataValue = (val: any) => {
|
const getDataValue = (val: any) => {
|
||||||
emits('update:data', val.yq);
|
emits('update:data', val?.yq || null);
|
||||||
emits('getDataValue', val);
|
emits('getDataValue', val || null);
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(() => props.data, (val) => {
|
watch(() => props.data, (val) => {
|
||||||
|
|||||||
75
src/views/liswork/advancedReview/index.vue
Normal file
75
src/views/liswork/advancedReview/index.vue
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
/**
|
||||||
|
* @file index.vue 高级审核条件
|
||||||
|
* @author: w
|
||||||
|
* @since: 2025-12-25
|
||||||
|
*/
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form ref="form" :model="queryParams" label-width="80px" inline>
|
||||||
|
<el-form-item label="仪器" prop="yq">
|
||||||
|
<YQSelectTable v-model:data="queryParams.yq" width="200px" clearable @get-data-value="getList" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="mb10">
|
||||||
|
<el-button type="primary" @click="handleAdd">新增</el-button>
|
||||||
|
<el-button type="primary" @click="handleSave">保存</el-button>
|
||||||
|
<el-button type="danger" @click="handleDel">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<div style="height: calc(100% - 110px);">
|
||||||
|
<CustomTable ref="tableRef" v-model:data="tableData" :columns="columns" :config="tableConfig">
|
||||||
|
<template #yq="{ row }">
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</CustomTable>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||||
|
import { queryList } from '@/api/liswork/advancedReview';
|
||||||
|
|
||||||
|
const queryParams = ref({
|
||||||
|
yq: '46',
|
||||||
|
});
|
||||||
|
|
||||||
|
const tableData = ref<Array<any>>([]);
|
||||||
|
const columns = ref([
|
||||||
|
{ label: '规则ID', prop: 'ruleid', visible: true, align: 'center', width: '80' },
|
||||||
|
{ label: '条件类型', prop: 'checktype', visible: true, align: 'center', width: '150' },
|
||||||
|
{ label: '审核启用', prop: 'logflag', visible: true, align: 'center', width: '80' },
|
||||||
|
{ label: '组合条件(双击弹窗编辑)', prop: 'ruledisplay', visible: true, align: 'center', },
|
||||||
|
{ label: '记录备注信息', prop: 'logcontent', visible: true, align: 'center', width: '300' },
|
||||||
|
{ label: '组合条件', prop: 'checkrules', visible: true, align: 'center', },
|
||||||
|
{ label: '自动审核', prop: 'autocheck', visible: true, align: 'center', width: '80' },
|
||||||
|
]);
|
||||||
|
|
||||||
|
const tableConfig = ref({
|
||||||
|
highlightCurrentRow: true,
|
||||||
|
border: true,
|
||||||
|
height: '100%'
|
||||||
|
});
|
||||||
|
|
||||||
|
const options = [
|
||||||
|
{ label: '审核条件', value: '0' },
|
||||||
|
{ label: '绝对禁止审核', value: '3' },
|
||||||
|
{ label: '审核生成报告备注', value: '4' },
|
||||||
|
]
|
||||||
|
|
||||||
|
const handleAdd = () => {
|
||||||
|
};
|
||||||
|
const handleSave = () => {
|
||||||
|
};
|
||||||
|
const handleDel = () => {
|
||||||
|
};
|
||||||
|
const getList = () => {
|
||||||
|
queryList(queryParams.value).then((res: any) => {
|
||||||
|
tableData.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
getList()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
301
src/views/liswork/xmmb/index.vue
Normal file
301
src/views/liswork/xmmb/index.vue
Normal file
@ -0,0 +1,301 @@
|
|||||||
|
/**
|
||||||
|
* @file index.vue
|
||||||
|
* @author: w
|
||||||
|
* @since: 2025-12-24
|
||||||
|
*/
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form ref="form" :model="queryParams" label-width="80px" inline>
|
||||||
|
<el-form-item label="仪器" prop="yq">
|
||||||
|
<YQSelectTable v-model:data="queryParams.yq" width="200px" clearable @get-data-value="getList" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="模板名称" prop="xmdh">
|
||||||
|
<el-input placeholder="请输入模板名称" v-model="queryParams.mbmc" style="width: 200px;" clearable
|
||||||
|
@keyup.enter="getList" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="getList">查询</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-button type="primary" @click="handleAdd">新增</el-button>
|
||||||
|
<el-button type="danger" @click="handleDel">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="table-row" style="margin-top: 10px;">
|
||||||
|
<el-col :span="24" class="table-col">
|
||||||
|
<CustomTable ref="tableRef" v-model:data="tableData" :columns="columns" :config="tableConfig"
|
||||||
|
@row-dblclick="handleRowDblclick" @row-click="selectedRows = $event">
|
||||||
|
<template #yq="{ row }">
|
||||||
|
{{ formatInstr(row.yq) }}
|
||||||
|
</template>
|
||||||
|
<template #yblx="{ row }">
|
||||||
|
{{ formatYblx(row.yblx) }}
|
||||||
|
</template>
|
||||||
|
<template #zdsr="{ row }">
|
||||||
|
<el-checkbox :model-value="row.zdsr == 'Y'" />
|
||||||
|
</template>
|
||||||
|
</CustomTable>
|
||||||
|
</el-col>
|
||||||
|
<el-dialog :title="title" v-model="visible" width="50vw" :close-on-click-modal="false" :draggable="true">
|
||||||
|
<el-row :gutter="15">
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="150px">
|
||||||
|
<el-form-item label="仪器" prop="yq">
|
||||||
|
<YQSelectTable v-model:data="formData.yq" :disabled="disabled" @get-data-value="getOldXminfoList()" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="模板名称" prop="mbmc">
|
||||||
|
<el-input v-model="formData.mbmc" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="输入编号" prop="srbh">
|
||||||
|
<el-input v-model="formData.srbh" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="标本类型" prop="yblx">
|
||||||
|
<SelectTable v-model:data="formData.yblx" :tableData="regdictList" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="" prop="zdsr">
|
||||||
|
<el-checkbox v-model="formData.zdsr" label="自动输入" true-value="Y" false-value="N" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="自动输入起始标本号" prop="qsybh">
|
||||||
|
<el-input v-model="formData.qsybh" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="自动输入结束标本号" prop="jsybh">
|
||||||
|
<el-input v-model="formData.jsybh" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="14">
|
||||||
|
<div class="mb10">
|
||||||
|
<el-button type="primary" @click="handleSave">保存</el-button>
|
||||||
|
<el-button type="primary" @click="addItem">新增</el-button>
|
||||||
|
<el-button type="danger" @click="delItem">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<div style="height: 400px">
|
||||||
|
<CustomTable ref="tableRefRight" :data="rightTableData" :columns="rightColumns" :config="tableConfig"
|
||||||
|
@row-click="xmrowHandle">
|
||||||
|
<template #xmdh="{ row, $index }">
|
||||||
|
<SelectTable v-model:data="row.xmdh" :tableData="xmList" class="full-width-input" :keyValue="true"
|
||||||
|
@get-data-value="getXmInfo(row, $index)" />
|
||||||
|
</template>
|
||||||
|
<template #mrz="{ row }">
|
||||||
|
<el-input v-model="row.mrz" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</CustomTable>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
|
||||||
|
// @ts-ignore
|
||||||
|
import { listregdict } from "@/api/regional/dict/regdict.js";
|
||||||
|
import { queryMbList, queryDetail, addXmInfo, deleteDetail, updateXmInfo, deleteXmInfo } from '@/api/liswork/xmmb';
|
||||||
|
import { formatInstr, getYqData } from '@/hooks'
|
||||||
|
import { queryOldxminfo } from '@/api/liswork/xtwh/xmReqItemVsApi'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
|
|
||||||
|
|
||||||
|
const queryParams = ref({
|
||||||
|
yq: '',
|
||||||
|
mbmc: '',
|
||||||
|
})
|
||||||
|
const disabled = ref(false)
|
||||||
|
const formData = ref({
|
||||||
|
yq: '',
|
||||||
|
mbmc: '',
|
||||||
|
srbh: '',
|
||||||
|
yblx: '',
|
||||||
|
zdsr: '',
|
||||||
|
qsybh: '',
|
||||||
|
jsybh: '',
|
||||||
|
oldMbmc: '',
|
||||||
|
})
|
||||||
|
const xmList = ref([])
|
||||||
|
const title = ref('')
|
||||||
|
const visible = ref(false)
|
||||||
|
const tableData = ref([])
|
||||||
|
const columns = ref([
|
||||||
|
{ prop: 'yq', label: '仪器', visible: true, align: 'center', slot: 'yq' },
|
||||||
|
{ prop: 'mbmc', label: '输入模板', visible: true, align: 'center', },
|
||||||
|
{ prop: 'srbh', label: '输入编号', visible: true, align: 'center', },
|
||||||
|
{ prop: 'yblx', label: '样本类型', visible: true, align: 'center', slot: 'yblx' },
|
||||||
|
{ prop: 'zdsr', label: '自动输入', visible: true, align: 'center', slot: 'zdsr' },
|
||||||
|
{ prop: 'qsybh', label: '起始号', visible: true, align: 'center', },
|
||||||
|
{ prop: 'jsybh', label: '结束号', visible: true, align: 'center', },
|
||||||
|
])
|
||||||
|
|
||||||
|
const tableConfig = ref({
|
||||||
|
height: '100%', // 高度
|
||||||
|
border: true, // 边框
|
||||||
|
highlightCurrentRow: true, // 当前行高亮
|
||||||
|
})
|
||||||
|
const selectedRows: any = ref(null)
|
||||||
|
const regdictList = ref<Array<{ value: string, label: string }>>([])
|
||||||
|
const rightTableData = ref<Array<{ xmdh: string, mrz: string }>>([])
|
||||||
|
const rightColumns = ref([
|
||||||
|
{ prop: 'xmdh', label: '检验项目', visible: true, align: 'center', slot: 'xmdh', showOverflowTooltip: false },
|
||||||
|
{ prop: 'mrz', label: '默认值', visible: true, align: 'center', slot: 'mrz', showOverflowTooltip: false },
|
||||||
|
])
|
||||||
|
const getOldXminfoList = async () => {
|
||||||
|
const res = await queryOldxminfo({ yq: formData.value.yq })
|
||||||
|
xmList.value = res.data.map((item: any) => {
|
||||||
|
return {
|
||||||
|
label: item.xmmc,
|
||||||
|
value: item.xmdh,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleAdd = () => {
|
||||||
|
formData.value = {
|
||||||
|
yq: '',
|
||||||
|
mbmc: '',
|
||||||
|
srbh: '',
|
||||||
|
yblx: '',
|
||||||
|
zdsr: '',
|
||||||
|
qsybh: '',
|
||||||
|
jsybh: '',
|
||||||
|
oldMbmc: '',
|
||||||
|
}
|
||||||
|
disabled.value = false
|
||||||
|
rightTableData.value = []
|
||||||
|
title.value = '新增模板'
|
||||||
|
visible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRowDblclick = (row: any) => {
|
||||||
|
getDetailsList(row)
|
||||||
|
row.yq = row.yq.trim()
|
||||||
|
row.oldMbmc = row.mbmc
|
||||||
|
formData.value = row
|
||||||
|
getOldXminfoList()
|
||||||
|
disabled.value = true
|
||||||
|
title.value = '编辑模板'
|
||||||
|
visible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const getDetailsList = (row: any) => {
|
||||||
|
queryDetail({ yq: row.yq, mbmc: row.mbmc }).then((res: any) => {
|
||||||
|
rightTableData.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const handleSave = () => {
|
||||||
|
rightTableData.value = rightTableData.value.filter((item: any) => item.xmdh)
|
||||||
|
const arr = rightTableData.value.map((item: any, index: number) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
mbmc: formData.value.mbmc,
|
||||||
|
oldMbmc: formData.value.oldMbmc,
|
||||||
|
yq: formData.value.yq,
|
||||||
|
xh: item.xh ? item.xh : index + 1,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (disabled.value) {
|
||||||
|
updateXmInfo({ labInputmdl: formData.value, labInputmdlDetailList: arr }).then(() => {
|
||||||
|
ElMessage.success('修改成功')
|
||||||
|
getList()
|
||||||
|
visible.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addXmInfo({ labInputmdl: formData.value, labInputmdlDetailList: arr }).then(() => {
|
||||||
|
ElMessage.success('新增成功')
|
||||||
|
getList()
|
||||||
|
visible.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const xmInfo = ref<any>(null)
|
||||||
|
const xmrowHandle = (row: any) => {
|
||||||
|
xmInfo.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
const getXmInfo = (row: any, currentIndex: any) => {
|
||||||
|
const prevXmdhList = rightTableData.value
|
||||||
|
.filter((_, index) => index < currentIndex)
|
||||||
|
.map(row => row.xmdh)
|
||||||
|
.filter(xmdh => !!xmdh);
|
||||||
|
|
||||||
|
|
||||||
|
if (prevXmdhList.includes(row.xmdh)) {
|
||||||
|
ElMessage.error(`当前项目编号【${row.xmdh}】与前面行重复,请重新选择!`);
|
||||||
|
rightTableData.value[currentIndex].xmdh = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const addItem = () => {
|
||||||
|
rightTableData.value.push({ xmdh: '', mrz: '', })
|
||||||
|
}
|
||||||
|
const delItem = () => {
|
||||||
|
if (!xmInfo.value) return ElMessage.warning('请选择要删除的行!')
|
||||||
|
if (xmInfo.value.yq) {
|
||||||
|
deleteDetail([xmInfo.value]).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
getDetailsList(formData.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
rightTableData.value = rightTableData.value.filter(item => item.xmdh != xmInfo.value.xmdh)
|
||||||
|
}
|
||||||
|
xmInfo.value = null
|
||||||
|
}
|
||||||
|
const handleDel = () => {
|
||||||
|
if (!selectedRows.value) return ElMessage.warning('请选择要删除的记录')
|
||||||
|
ElMessageBox.confirm('确定要删除选中的数据吗?', '提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
deleteXmInfo(selectedRows.value).then(() => {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
getList()
|
||||||
|
selectedRows.value = null
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const getList = () => {
|
||||||
|
queryMbList(queryParams.value).then((res: any) => {
|
||||||
|
tableData.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getList()
|
||||||
|
onMounted(() => {
|
||||||
|
getYqData()
|
||||||
|
// 获取标本类型
|
||||||
|
listregdict({ pageSize: 100, pageNum: 1, dictType: 'BT' }).then((res: any) => {
|
||||||
|
regdictList.value = res.rows.map((item: any) => {
|
||||||
|
return {
|
||||||
|
label: item.dictName,
|
||||||
|
value: item.dictCode
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const formatYblx = (v: string) => {
|
||||||
|
return regdictList.value.find((item: any) => item.value == v)?.label || v
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.table-row {
|
||||||
|
height: calc(100% - 100px);
|
||||||
|
|
||||||
|
.table-col {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-col {
|
||||||
|
padding-top: 5px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
199
src/views/liswork/xtwh/xmReqItemVsApi/index.vue
Normal file
199
src/views/liswork/xtwh/xmReqItemVsApi/index.vue
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
<!-- 收费项目,报告项目对照 -->
|
||||||
|
<template>
|
||||||
|
<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="getDataValue" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目" prop="xmdh">
|
||||||
|
<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" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-button type="primary" icon="Plus" @click="onClickAdd">新增</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>
|
||||||
|
|
||||||
|
<el-row :gutter="20" class="table-row">
|
||||||
|
<el-col :span="8" class="table-col">
|
||||||
|
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :config="tableConfig"
|
||||||
|
@row-click="rowClickLeft" />
|
||||||
|
</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" @row-click="rowHandle">
|
||||||
|
<template #xmdh="{ row }">
|
||||||
|
<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>
|
||||||
|
</template>
|
||||||
|
<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>
|
||||||
|
</CustomTable>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
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',
|
||||||
|
sqxmmc: '',
|
||||||
|
sl: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
interface tableItem {
|
||||||
|
xmdh: string;
|
||||||
|
tdh: string;
|
||||||
|
mrz: string;
|
||||||
|
seq: number;
|
||||||
|
def: string;
|
||||||
|
}
|
||||||
|
const dataListLeft = ref([])
|
||||||
|
const dataListRight = ref<tableItem[]>([])
|
||||||
|
const xmList = ref([])
|
||||||
|
const selectRow = ref<any>(null)
|
||||||
|
|
||||||
|
//退拽属性
|
||||||
|
const handleColumnDragEnd = (data: any) => {
|
||||||
|
// 更新列配置
|
||||||
|
columnsRight.value = data.columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableConfig = ref({
|
||||||
|
border: true, // 边框
|
||||||
|
height: '100%', // 高度
|
||||||
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
|
})
|
||||||
|
|
||||||
|
const columnsLeft = ref([
|
||||||
|
{ prop: 'sqxmmc', label: '申请/收费项目名称', visible: true, align: 'center', },
|
||||||
|
{ prop: 'sqxmdh', label: '申请/收费项目代号', visible: true, align: 'center', },
|
||||||
|
]);
|
||||||
|
|
||||||
|
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', 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
|
||||||
|
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 = () => {
|
||||||
|
dataListRight.value.push({
|
||||||
|
xmdh: '',
|
||||||
|
tdh: '',
|
||||||
|
mrz: '',
|
||||||
|
seq: dataListRight.value.length + 1,
|
||||||
|
def: '0',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const onClickDel = () => {
|
||||||
|
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 = () => {
|
||||||
|
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>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.table-row {
|
||||||
|
height: calc(100% - 90px);
|
||||||
|
padding-top: 10px;
|
||||||
|
|
||||||
|
.table-col {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -258,6 +258,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.compact-form {
|
.compact-form {
|
||||||
|
height: 5rem;
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -228,6 +228,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.compact-form {
|
.compact-form {
|
||||||
|
height: 5rem;
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -200,6 +200,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.compact-form {
|
.compact-form {
|
||||||
|
height: 5rem;
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,6 +229,8 @@ const formatDict = (v: string, arr: Array<any>) => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.compact-form {
|
.compact-form {
|
||||||
|
height: 5rem;
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user