新增申请单记录相关功能

This commit is contained in:
lxd 2024-07-15 16:16:07 +08:00
parent 377ea7fb2b
commit aafee59826
7 changed files with 6812 additions and 5328 deletions

View File

@ -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",

File diff suppressed because it is too large Load Diff

View File

@ -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})
},
}

View File

@ -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')
}

View File

@ -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)
fordevicemData.value = await ApplyformApi.getDevicelist(orgId)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
@ -126,8 +124,20 @@ const submitForm = async () => {
//
formLoading.value = true
try {
await ApplyformApi.updateFJApplyform({ id: ID.toString(), device:fordevicemValue.value.toString() })
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})
}
message.success("分检成功")
dialogVisible.value = false
//
@ -146,6 +156,7 @@ const resetForm = () => {
fordevicemData.value =[]
fordevicemValue.value=''
upFJApplyformVO.value=[]
selectedRows.value=[]
formRef.value?.resetFields()
}
</script>

View 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) // 12
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>

View File

@ -112,7 +112,7 @@
<el-form-item label="执行科室" prop="deviceDepartment">
<el-select
v-model="queryParams.deviceDepartment"
v-model="queryParams.deviceDepartment"
placeholder="请选择执行科室"
clearable
class="!w-200px"
@ -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 {
//
await message.delConfirm("是否作废选择内容")
//
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>