完成检查项目模块
This commit is contained in:
parent
6f9d054cec
commit
c35c310221
51
src/api/system/examitems/index.ts
Normal file
51
src/api/system/examitems/index.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 检查部位 VO
|
||||
export interface examitemsVO {
|
||||
id: string // ID
|
||||
examItemName: string // 检查项目
|
||||
createDate: Date // 创建时间
|
||||
createPerson: string // 创建人
|
||||
isdelete: string // 删除标记:删除为 1
|
||||
orgId: string // 机构ID
|
||||
deletePerson: string // 删除人
|
||||
deleteDate: Date // 删除时间
|
||||
examItemCode: string // 检查项目代号
|
||||
examPartCode: string // 检查部位代码
|
||||
thirdPartyExamItemCode: string // 第三方系统的检查项目的CODE
|
||||
thirdPartyExamItemName: string // 第三方系统的检查项目名称
|
||||
thirdPartyExamItemPrice: string // 第三方系统的检查项目的收费价格
|
||||
}
|
||||
|
||||
// 检查部位 API
|
||||
export const examitemsApi = {
|
||||
// 查询检查部位分页
|
||||
getexamitemsPage: async (params: any) => {
|
||||
return await request.get({ url: `/examitems/examitems/page`, params })
|
||||
},
|
||||
|
||||
// 查询检查部位详情
|
||||
getexamitems: async (id: number) => {
|
||||
return await request.get({ url: `/examitems/examitems/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增检查部位
|
||||
createexamitems: async (data: examitemsVO) => {
|
||||
return await request.post({ url: `/examitems/examitems/create`, data })
|
||||
},
|
||||
|
||||
// 修改检查部位
|
||||
updateexamitems: async (data: examitemsVO) => {
|
||||
return await request.put({ url: `/examitems/examitems/update`, data })
|
||||
},
|
||||
|
||||
// 删除检查部位
|
||||
deleteexamitems: async (id: number,username:string) => {
|
||||
return await request.delete({ url: `/examitems/examitems/delete?id=${id}&&username=${username}`})
|
||||
},
|
||||
|
||||
// 导出检查部位 Excel
|
||||
exportexamitems: async (params) => {
|
||||
return await request.download({ url: `/examitems/examitems/export-excel`, params })
|
||||
},
|
||||
}
|
@ -199,6 +199,7 @@ const getlogininfo = async () => {
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getlogininfo()
|
||||
getList()
|
||||
})
|
||||
</script>
|
169
src/views/system/examitems/examitemsForm.vue
Normal file
169
src/views/system/examitems/examitemsForm.vue
Normal file
@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="检查项目编码" prop="examItemCode" label-width="111px" >
|
||||
<el-input v-model="formData.examItemCode" placeholder="请输入检查项目编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检查项目名称" prop="examItemName" label-width="111px">
|
||||
<el-input v-model="formData.examItemName" placeholder="请输入检查项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createDate" v-if="false">
|
||||
<el-date-picker
|
||||
v-model="formData.createDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择创建时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createPerson" v-if="false">
|
||||
<el-input v-model="formData.createPerson" placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标记:删除为 1 " prop="isdelete" v-if="false">
|
||||
<el-input v-model="formData.isdelete" placeholder="请输入删除标记:删除为 1 " />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="删除人" prop="deletePerson" v-if="false">
|
||||
<el-input v-model="formData.deletePerson" placeholder="请输入删除人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="删除时间" prop="deleteDate" v-if="false">
|
||||
<el-date-picker
|
||||
v-model="formData.deleteDate"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择删除时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查部位代码" prop="examPartCode" label-width="111px">
|
||||
<el-input v-model="formData.examPartCode" placeholder="请选择检查部位代码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构编号" prop="orgId" label-width="111px">
|
||||
<el-input v-model="formData.orgId" placeholder="请输入机构编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="第三方系统的检查项目的CODE" prop="thirdPartyExamItemCode" v-if="false">
|
||||
<el-input v-model="formData.thirdPartyExamItemCode" placeholder="请输入第三方系统的检查项目的CODE" />
|
||||
</el-form-item>
|
||||
<el-form-item label="第三方系统的检查项目名称" prop="thirdPartyExamItemName" v-if="false">
|
||||
<el-input v-model="formData.thirdPartyExamItemName" placeholder="请输入第三方系统的检查项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="第三方系统的检查项目的收费价格" prop="thirdPartyExamItemPrice" v-if="false">
|
||||
<el-input v-model="formData.thirdPartyExamItemPrice" placeholder="请输入第三方系统的检查项目的收费价格" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { examitemsApi, examitemsVO } from '@/api/system/examitems'
|
||||
|
||||
/** 检查部位 表单 */
|
||||
defineOptions({ name: 'ExamitemsForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
examItemName: undefined,
|
||||
createDate: undefined,
|
||||
createPerson: undefined,
|
||||
isdelete: undefined,
|
||||
orgId: undefined,
|
||||
deletePerson: undefined,
|
||||
deleteDate: undefined,
|
||||
examItemCode: undefined,
|
||||
examPartCode: undefined,
|
||||
thirdPartyExamItemCode: undefined,
|
||||
thirdPartyExamItemName: undefined,
|
||||
thirdPartyExamItemPrice: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
examItemCode: [
|
||||
{ required: true, message: '请输入检查项目编号', trigger: 'blur' }
|
||||
],
|
||||
examItemName: [
|
||||
{ required: true, message: '请输入检查项目名称', trigger: 'blur' }
|
||||
],
|
||||
examPartCode: [
|
||||
{ required: true, message: '请选择检查部位编号', trigger: 'blur' }
|
||||
],
|
||||
orgId: [
|
||||
{ required: true, message: '请选择机构编号', trigger: 'blur' }
|
||||
]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await examitemsApi.getexamitems(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as examitemsVO
|
||||
if (formType.value === 'create') {
|
||||
await examitemsApi.createexamitems(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await examitemsApi.updateexamitems(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
examItemName: undefined,
|
||||
createDate: undefined,
|
||||
createPerson: undefined,
|
||||
isdelete: undefined,
|
||||
orgId: undefined,
|
||||
deletePerson: undefined,
|
||||
deleteDate: undefined,
|
||||
examItemCode: undefined,
|
||||
examPartCode: undefined,
|
||||
thirdPartyExamItemCode: undefined,
|
||||
thirdPartyExamItemName: undefined,
|
||||
thirdPartyExamItemPrice: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
227
src/views/system/examitems/examitemscompareForm.vue
Normal file
227
src/views/system/examitems/examitemscompareForm.vue
Normal file
@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 1050px;">
|
||||
<div class="container">
|
||||
<div class="top">
|
||||
<!-- 列表 -->
|
||||
<p style="font-weight: bold">本地列表</p>
|
||||
<ContentWrap>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="list"
|
||||
:stripe="true"
|
||||
:show-overflow-tooltip="true"
|
||||
@row-dblclick="handleRowDblclick"
|
||||
>
|
||||
<el-table-column label="ID" align="center" prop="id" v-if="false" />
|
||||
<el-table-column label="检查项目" align="center" prop="examItemName" />
|
||||
<el-table-column label="机构ID" align="center" prop="orgId" v-if="false" />
|
||||
<el-table-column label="检查项目代号" align="center" prop="examItemCode" />
|
||||
<el-table-column label="检查部位代码" align="center" prop="examPartCode" />
|
||||
<el-table-column
|
||||
label="第三方检查项目编号"
|
||||
align="center"
|
||||
prop="thirdPartyExamItemCode"
|
||||
/>
|
||||
<el-table-column
|
||||
label="第三方检查项目名称"
|
||||
align="center"
|
||||
prop="thirdPartyExamItemName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="第三方检查项目价格"
|
||||
align="center"
|
||||
prop="thirdPartyExamItemPrice"
|
||||
/>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
</div>
|
||||
<div class="middle">
|
||||
<div>
|
||||
<p style="font-weight: bold">本地列表选择:检查项目:{{ bdrow.examItemName }} </p>
|
||||
<div>
|
||||
<el-button type="success"><Icon icon="ep:refresh" class="mr-5px" /> 对照</el-button>
|
||||
</div>
|
||||
<div> <p style="font-weight: bold">对照列表选择:第三方检查项目名称:{{}}</p></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<p style="font-weight: bold">对照信息列表</p>
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="ID" align="center" prop="id" v-if="false" />
|
||||
<el-table-column label="检查项目" align="center" prop="examItemName" v-if="false" />
|
||||
<el-table-column label="机构ID" align="center" prop="orgId" v-if="false" />
|
||||
<el-table-column label="检查项目代号" align="center" prop="examItemCode" v-if="false" />
|
||||
<el-table-column label="检查部位代码" align="center" prop="examPartCode" v-if="false" />
|
||||
<el-table-column
|
||||
label="第三方检查项目编号"
|
||||
align="center"
|
||||
prop="thirdPartyExamItemCode"
|
||||
/>
|
||||
<el-table-column
|
||||
label="第三方检查项目名称"
|
||||
align="center"
|
||||
prop="thirdPartyExamItemName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="第三方检查项目价格"
|
||||
align="center"
|
||||
prop="thirdPartyExamItemPrice"
|
||||
/>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
</div>
|
||||
</div>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { examitemsApi, examitemsVO } from '@/api/system/examitems'
|
||||
|
||||
/** 检查部位 表单 */
|
||||
defineOptions({ name: 'ExamitemscompareForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<examitemsVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
examItemName: undefined,
|
||||
createDate: undefined,
|
||||
createPerson: undefined,
|
||||
isdelete: undefined,
|
||||
orgId: undefined,
|
||||
deletePerson: undefined,
|
||||
deleteDate: undefined,
|
||||
examItemCode: undefined,
|
||||
examPartCode: undefined,
|
||||
thirdPartyExamItemCode: undefined,
|
||||
thirdPartyExamItemName: undefined,
|
||||
thirdPartyExamItemPrice: undefined
|
||||
})
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
examItemName: undefined,
|
||||
examItemCode: undefined,
|
||||
examPartCode: undefined
|
||||
})
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await examitemsApi.getexamitemsPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 双击本地列表信息
|
||||
const bdrow = ref({
|
||||
id: undefined,
|
||||
examItemName: undefined,
|
||||
examItemCode: undefined,
|
||||
examPartCode: undefined
|
||||
})
|
||||
const handleRowDblclick = (row) => {
|
||||
bdrow.value = row
|
||||
console.log(bdrow.value)
|
||||
}
|
||||
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async () => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '字典对照'
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
|
||||
formLoading.value = true
|
||||
try {
|
||||
getList()
|
||||
//formData.value = await examitemsApi.getexamitems(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
examItemName: undefined,
|
||||
createDate: undefined,
|
||||
createPerson: undefined,
|
||||
isdelete: undefined,
|
||||
orgId: undefined,
|
||||
deletePerson: undefined,
|
||||
deleteDate: undefined,
|
||||
examItemCode: undefined,
|
||||
examPartCode: undefined,
|
||||
thirdPartyExamItemCode: undefined,
|
||||
thirdPartyExamItemName: undefined,
|
||||
thirdPartyExamItemPrice: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
bdrow.value = {
|
||||
id: undefined,
|
||||
examItemName: undefined,
|
||||
examItemCode: undefined,
|
||||
examPartCode: undefined
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 800px; /* 使用视口高度确保撑满整个屏幕 */
|
||||
width: 1000px;
|
||||
}
|
||||
|
||||
.top,
|
||||
.bottom {
|
||||
flex-grow: 1; /* 使上下部分平分剩余空间 */
|
||||
background-color: #f0f0f0; /* 为了视觉效果 */
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.middle {
|
||||
height: 80px; /* 中间部分固定高度 */
|
||||
background-color: #fff; /* 为了视觉效果 */
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: center; /* 水平居中 */
|
||||
align-items: center; /* 垂直居中 */
|
||||
}
|
||||
</style>
|
221
src/views/system/examitems/index.vue
Normal file
221
src/views/system/examitems/index.vue
Normal file
@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<!-- <el-form-item label="检查项目" prop="examItemName">
|
||||
<el-select
|
||||
v-model="queryParams.examItemName"
|
||||
placeholder="请选择检查项目"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="检查项目" prop="examItemName" label-width="111px">
|
||||
<el-input
|
||||
v-model="queryParams.examItemName"
|
||||
placeholder="请输入检查项目"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查项目编码" prop="examItemCode" label-width="111px">
|
||||
<el-input
|
||||
v-model="queryParams.examItemCode"
|
||||
placeholder="请输入检查项目编码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查部位编码" prop="examPartCode" label-width="111px">
|
||||
<el-input
|
||||
v-model="queryParams.examPartCode"
|
||||
placeholder="请输入检查部位编码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button @click="opencompare()"><Icon icon="ep:search" class="mr-5px" /> 字典对照</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['examitems:examitems:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['examitems:examitems:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="ID" align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="检查项目" align="center" prop="examItemName" />
|
||||
<el-table-column label="检查项目编号" align="center" prop="examItemCode" />
|
||||
<el-table-column label="检查部位编号" align="center" prop="examPartCode" />
|
||||
<el-table-column label="第三方检查项目编号" align="center" prop="thirdPartyExamItemCode" />
|
||||
<el-table-column label="第三方检查项目名称" align="center" prop="thirdPartyExamItemName" />
|
||||
<el-table-column label="第三方检查项目价格" align="center" prop="thirdPartyExamItemPrice" />
|
||||
<el-table-column label="机构编号" align="center" prop="orgId" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['examitems:examitems:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id,Profilevo.username)"
|
||||
v-hasPermi="['examitems:examitems:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<examitemsForm ref="formRef" @success="getList" />
|
||||
<!-- 表单弹窗:对照 -->
|
||||
<examitemscompareForm ref="formcompare" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import download from '@/utils/download'
|
||||
import { examitemsApi, examitemsVO } from '@/api/system/examitems'
|
||||
import examitemsForm from './examitemsForm.vue'
|
||||
import examitemscompareForm from './examitemscompareForm.vue'
|
||||
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
|
||||
|
||||
/** 检查部位 列表 */
|
||||
defineOptions({ name: 'Examitems' })
|
||||
|
||||
//当前登录人信息
|
||||
const Profilevo = ref<ProfileVO>({} as ProfileVO)
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<examitemsVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
examItemName: undefined,
|
||||
examItemCode: undefined,
|
||||
examPartCode: undefined,
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await examitemsApi.getexamitemsPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
// 对照操作
|
||||
const formcompare=ref()
|
||||
const opencompare=()=>
|
||||
{
|
||||
formcompare.value.open()
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number,username:string) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await examitemsApi.deleteexamitems(id,username)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await examitemsApi.exportexamitems(queryParams)
|
||||
download.excel(data, '检查部位.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
//获取当前登录人信息
|
||||
const getlogininfo = async () => {
|
||||
Profilevo.value = await getUserProfile()
|
||||
}
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getlogininfo()
|
||||
getList()
|
||||
})
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user