新增申请单记录相关功能
This commit is contained in:
parent
377ea7fb2b
commit
aafee59826
@ -66,6 +66,7 @@
|
||||
"vue-i18n": "9.10.2",
|
||||
"vue-router": "^4.3.0",
|
||||
"vue-types": "^5.1.1",
|
||||
"vue3-print-nb": "^0.1.4",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"web-storage-cache": "^1.1.1",
|
||||
"xml-js": "^1.6.11"
|
||||
@ -83,8 +84,8 @@
|
||||
"@types/qs": "^6.9.12",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
||||
"@typescript-eslint/parser": "^7.1.0",
|
||||
"@unocss/transformer-variant-group": "^0.58.5",
|
||||
"@unocss/eslint-config": "^0.57.4",
|
||||
"@unocss/transformer-variant-group": "^0.58.5",
|
||||
"@vitejs/plugin-legacy": "^5.3.1",
|
||||
"@vitejs/plugin-vue": "^5.0.4",
|
||||
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
||||
|
11251
pnpm-lock.yaml
11251
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -32,6 +32,7 @@ export interface UPFJApplyformVO {
|
||||
|
||||
id: string // 主键
|
||||
device: string // 设备内容
|
||||
sortDoctor:string//分检医生 也就是当前登录人
|
||||
}
|
||||
|
||||
// 申请登记记录 API
|
||||
@ -86,4 +87,8 @@ export const ApplyformApi = {
|
||||
return await request.get({ url: `/applyregistration/applyform/applfmdeptlist?orgId=` + orgId })
|
||||
},
|
||||
|
||||
//批量分检
|
||||
batchupdateFJApplyform: async (data:UPFJApplyformVO[]) => {
|
||||
return await request.post({ url: `/applyregistration/applyform/batchupdateFJ`, data})
|
||||
},
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import '@/plugins/tongji' // 百度统计
|
||||
import Logger from '@/utils/Logger'
|
||||
|
||||
import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患
|
||||
|
||||
import print from "vue3-print-nb";//打印的
|
||||
// 创建实例
|
||||
const setupAll = async () => {
|
||||
const app = createApp(App)
|
||||
@ -63,7 +63,7 @@ const setupAll = async () => {
|
||||
await router.isReady()
|
||||
|
||||
app.use(VueDOMPurifyHTML)
|
||||
|
||||
app.use(print);
|
||||
app.mount('#app')
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
v-loading="formLoading"
|
||||
>
|
||||
|
||||
<el-form-item label="当前患者" >
|
||||
<el-form-item label="当前患者" v-if="false" >
|
||||
<el-input v-model="name" />
|
||||
</el-form-item>
|
||||
|
||||
@ -66,48 +66,46 @@ const formData = ref({
|
||||
sortDoctor: undefined,
|
||||
})
|
||||
|
||||
//设备列表
|
||||
/* const fordevicemData = ref({
|
||||
ID: undefined,
|
||||
deviceName: undefined,
|
||||
deviceId: undefined,
|
||||
deviceDepartment: undefined,
|
||||
departmentCode: undefined,
|
||||
orgId: undefined,
|
||||
deviceModel: undefined,
|
||||
deviceMaker: undefined,
|
||||
deviceType: undefined,
|
||||
deviceStatus: undefined,
|
||||
createDate: undefined,
|
||||
}) */
|
||||
|
||||
|
||||
const fordevicemValue = ref('')
|
||||
const name = ref('')
|
||||
let ID:number=0
|
||||
let ID:number=0//表单ID
|
||||
let Username:string=""//分检医生
|
||||
const fordevicemData = ref<any[]>([])
|
||||
|
||||
const selectedRows = ref<any[]>([]); // 存储当前选中的行
|
||||
const formRules = reactive({
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, orgId: string,pname:string,id:number) => {
|
||||
const open = async (type: string, orgId: string,pname:string,id:number,username:string,list:any[]) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
|
||||
dialogTitle.value = type
|
||||
// formType.value = type
|
||||
name.value=pname
|
||||
ID=id
|
||||
console.log("ID:"+id)
|
||||
Username=username
|
||||
resetForm()
|
||||
if(type=="批量")
|
||||
{
|
||||
selectedRows.value=list
|
||||
console.log("批量"+list.length)
|
||||
}
|
||||
|
||||
|
||||
// 修改时,设置数据
|
||||
if (orgId) {
|
||||
|
||||
formLoading.value = true
|
||||
try {
|
||||
|
||||
|
||||
fordevicemData.value = await ApplyformApi.getDevicelist(orgId)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
@ -126,8 +124,20 @@ const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if(dialogTitle.value=="批量")
|
||||
{
|
||||
/* // 批量分检的二次确
|
||||
await message.delConfirm("是否批量分检选择内容") */
|
||||
selectedRows.value.forEach((item) => {
|
||||
console.log(`selectedRows ${Username} was unselected.`);
|
||||
upFJApplyformVO.value.push({ id: item.id, device:item.deviceName+'|'+item.deviceId,sortDoctor: Username})
|
||||
});
|
||||
await ApplyformApi.batchupdateFJApplyform(upFJApplyformVO.value)
|
||||
}
|
||||
else{
|
||||
await ApplyformApi.updateFJApplyform({ id: ID.toString(), device:fordevicemValue.value.toString(),sortDoctor: Username})
|
||||
}
|
||||
|
||||
await ApplyformApi.updateFJApplyform({ id: ID.toString(), device:fordevicemValue.value.toString() })
|
||||
message.success("分检成功")
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
@ -146,6 +156,7 @@ const resetForm = () => {
|
||||
fordevicemData.value =[]
|
||||
fordevicemValue.value=''
|
||||
upFJApplyformVO.value=[]
|
||||
selectedRows.value=[]
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
162
src/views/applyregistration/applyform/GuidePrint.vue
Normal file
162
src/views/applyregistration/applyform/GuidePrint.vue
Normal file
@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<!-- <el-form
|
||||
ref="Print"
|
||||
:model=applyFormVO
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
> -->
|
||||
<div class="flex-center" id="printMe">
|
||||
<div>
|
||||
<h2 style="width: 500px;text-align: center;text-decoration: underline;">导引单</h2>
|
||||
<table width="500px" border="1" style="border-collapse: collapse;">
|
||||
<tr>
|
||||
<td>姓名</td>
|
||||
<td>{{applyFormVO?.pname}}</td>
|
||||
<td>来源</td>
|
||||
<td>{{applyFormVO?.regSource}}</td>
|
||||
<td>性别</td>
|
||||
<td>{{applyFormVO?.gender}}</td>
|
||||
<td>登记单号</td>
|
||||
<td>{{applyFormVO?.regId}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">执行科室</td>
|
||||
<td colspan="2">{{applyFormVO?.deviceDepartment}}</td>
|
||||
<td colspan="2" style="text-align: center;">检查项目</td>
|
||||
<td colspan="3" >{{applyFormVO?.examItemName}}</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">检查设备</td>
|
||||
<td colspan="6">{{applyFormVO?.deviceName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">分检时间</td>
|
||||
<td colspan="6">{{applyFormVO?.sortDate}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">检查状态</td>
|
||||
<td colspan="6">{{applyFormVO?.examStatus}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">开单医生</td>
|
||||
<td colspan="3">{{applyFormVO?.billgDoctor}}</td>
|
||||
<td colspan="2" style="text-align: center;">分检医生</td>
|
||||
<td colspan="3">{{applyFormVO?.sortDoctor}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" rowspan="3">备注</td>
|
||||
<td colspan="6" rowspan="3" align="left"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- </el-form> -->
|
||||
<template #footer>
|
||||
<el-button type="primary" :disabled="formLoading" v-print="'printMe'">打印</el-button>
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ApplyformApi, ApplyformVO,UPFJApplyformVO } from '@/api/applyregistration/applyform'
|
||||
import print from "vue3-print-nb";
|
||||
/** 申请登记记录 打印表单 */
|
||||
defineOptions({ name: 'GuidePrint' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const upFJApplyformVO = ref<UPFJApplyformVO[]>([]);
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
regId: undefined,
|
||||
regSource: undefined,
|
||||
examId: undefined,
|
||||
pname: undefined,
|
||||
gender: undefined,
|
||||
birthday: undefined,
|
||||
examDate: undefined,
|
||||
examItemName: undefined,
|
||||
deviceId: undefined,
|
||||
deviceName: undefined,
|
||||
contactTel: undefined,
|
||||
regDate: undefined,
|
||||
sortDate: undefined,
|
||||
billgDoctor: undefined,
|
||||
examStatus: undefined,
|
||||
billDoctorDepartment: undefined,
|
||||
createDate: undefined,
|
||||
examItemCode: undefined,
|
||||
orgId: undefined,
|
||||
sortDoctor: undefined,
|
||||
deviceDepartment:undefined,
|
||||
})
|
||||
|
||||
const applyFormVO = ref<ApplyformVO>({} as ApplyformVO);
|
||||
|
||||
|
||||
const fordevicemValue = ref('')
|
||||
|
||||
const fordevicemData = ref<any[]>([])
|
||||
|
||||
const formRules = reactive({
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (id:number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value ="打印导引单"
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
|
||||
applyFormVO.value= await ApplyformApi.getApplyform(id)
|
||||
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
//打印方法 暂时不需要 使用v-print
|
||||
const PrintForm = () => {
|
||||
|
||||
|
||||
// window.print()
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
fordevicemData.value =[]
|
||||
fordevicemValue.value=''
|
||||
upFJApplyformVO.value=[]
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.flex-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
@ -150,9 +150,8 @@
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['applyregistration:applyform:export']"
|
||||
@click="batchhandle(Profilevo.username)"
|
||||
v-hasPermi="['applyregistration:applyform:update']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 批量分检
|
||||
</el-button>
|
||||
@ -162,10 +161,10 @@
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @selection-change="handleSelectionChange" >
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="主键" align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="登记单号" align="center" prop="regId" />
|
||||
<el-table-column label="登记单号" align="center" prop="regId" width="100px" />
|
||||
<el-table-column label="登记来源" align="center" prop="regSource" width="100px"/>
|
||||
<el-table-column label="检查单号" align="center" prop="examId" />
|
||||
<el-table-column label="患者姓名" align="center" prop="pname" width="100px"/>
|
||||
@ -185,9 +184,9 @@
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="检查项目名称" align="center" prop="examItemName" />
|
||||
<el-table-column label="检查项目名称" align="center" prop="examItemName" width="140px"/>
|
||||
<el-table-column label="检查设备ID" align="center" prop="deviceId" v-if="false"/>
|
||||
<el-table-column label="检查设备" align="center" prop="deviceName" />
|
||||
<el-table-column label="检查设备" align="center" prop="deviceName" width="130px"/>
|
||||
<el-table-column label="联系电话" align="center" prop="contactTel" />
|
||||
<el-table-column
|
||||
label="登记时间"
|
||||
@ -222,7 +221,7 @@
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.pname,scope.row.orgId,scope.row.id,scope.row.examStatus)"
|
||||
@click="openForm('分检', scope.row.pname,scope.row.orgId,scope.row.id,scope.row.examStatus)"
|
||||
v-hasPermi="['applyregistration:applyform:update']"
|
||||
>
|
||||
分检
|
||||
@ -230,16 +229,16 @@
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
@click="handleDelete(scope.row.id,scope.row.examStatus)"
|
||||
v-hasPermi="['applyregistration:applyform:delete']"
|
||||
>
|
||||
作废
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['applyregistration:applyform:delete']"
|
||||
@click="openPrintForm(scope.row.id)"
|
||||
>
|
||||
导引单
|
||||
</el-button>
|
||||
@ -257,21 +256,26 @@
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ApplyformForm ref="formRef" @success="getList" />
|
||||
<!-- 表单弹窗:打印导引单 -->
|
||||
<GuidePrint ref="Print" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { ApplyformApi, ApplyformVO } from '@/api/applyregistration/applyform'
|
||||
import { ApplyformApi, ApplyformVO,UPFJApplyformVO } from '@/api/applyregistration/applyform'
|
||||
import ApplyformForm from './ApplyformForm.vue'
|
||||
import { fa } from 'element-plus/es/locale';
|
||||
import GuidePrint from './GuidePrint.vue';
|
||||
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
|
||||
|
||||
/** 申请登记记录 列表 */
|
||||
defineOptions({ name: 'Applyform' })
|
||||
|
||||
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<ApplyformVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
@ -303,7 +307,7 @@ const queryParams = reactive({
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
const Profilevo = ref<ProfileVO>({} as ProfileVO); //当前登录人信息
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
@ -314,6 +318,7 @@ const getList = async () => {
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@ -333,7 +338,7 @@ const formRef = ref()
|
||||
const openForm = (type: string,pname:string ,orgid: string,ID:number,status:string) => {
|
||||
if(status=="未分检")
|
||||
{
|
||||
formRef.value.open(type, orgid,pname,ID)
|
||||
formRef.value.open(type, orgid,pname,ID,Profilevo.value.username,[])
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -342,12 +347,76 @@ const openForm = (type: string,pname:string ,orgid: string,ID:number,status:stri
|
||||
|
||||
}
|
||||
|
||||
/** 作废按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
/** 打印导引单 */
|
||||
const Print = ref();
|
||||
const openPrintForm = (ID:number) => {
|
||||
|
||||
Print.value.open(ID)
|
||||
}
|
||||
|
||||
//批量相关
|
||||
const selectedRows = ref<any[]>([]); // 存储当前选中的行
|
||||
const previouslySelectedRows = ref<any[]>([]); // 存储先前选中的行
|
||||
const handleSelectionChange = (selection) => {
|
||||
// 更新当前选中的行
|
||||
selectedRows.value = selection;
|
||||
|
||||
// 检查哪些行被取消勾选
|
||||
const unselectedRows = previouslySelectedRows.value.filter(prevRow => !selection.some(newRow => newRow.id === prevRow.id));
|
||||
|
||||
// 输出取消勾选的行
|
||||
unselectedRows.forEach(row => {
|
||||
console.log(`Row ${row.id} was unselected.`);
|
||||
// 这里可以添加你的逻辑来处理取消勾选的行
|
||||
});
|
||||
|
||||
// 更新先前选中的行为当前选中的行,以备下次比较
|
||||
previouslySelectedRows.value = selection;
|
||||
console.log(previouslySelectedRows.value)
|
||||
}
|
||||
|
||||
/** 批量分检按钮操作 */
|
||||
const batchhandle = async (username:string) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
let orgid:string=""
|
||||
|
||||
previouslySelectedRows.value.forEach(row => {
|
||||
|
||||
if(row.examStatus!="未分检")
|
||||
{
|
||||
message.warning("存在已经分检数据,重新选择")
|
||||
throw new Error('End Loop')
|
||||
}
|
||||
orgid=row.orgId
|
||||
|
||||
});
|
||||
|
||||
console.log(`orgid ${orgid} was unselected.`);
|
||||
console.log(`username ${username} was unselected.`);
|
||||
formRef.value.open("批量", orgid,'',0,username,previouslySelectedRows.value)
|
||||
|
||||
} catch {}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 作废按钮操作 */
|
||||
const handleDelete = async (id: number,status:string) => {
|
||||
try {
|
||||
|
||||
if(status=="已检查")
|
||||
{
|
||||
message.warning("已进行检查,不允许进行作废操作")
|
||||
return
|
||||
}
|
||||
if(status=="已放弃")
|
||||
{
|
||||
message.warning("已作废,无需再次作废")
|
||||
return
|
||||
}
|
||||
// 作废的二次确认
|
||||
await message.delConfirm("是否作废选择内容")
|
||||
// 发起删除
|
||||
// 发起作废
|
||||
await ApplyformApi.cancelApplyform(id)
|
||||
message.success("作废成功")
|
||||
// 刷新列表
|
||||
@ -369,9 +438,16 @@ const handleExport = async () => {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
//获取当前登录人信息
|
||||
const getlogininfo = async () => {
|
||||
|
||||
Profilevo.value= await getUserProfile()
|
||||
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getlogininfo()
|
||||
getList()
|
||||
})
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user