修改分检增加业务表操作内容

This commit is contained in:
lxd 2024-08-13 17:20:50 +08:00
parent 9281dadf57
commit ef53e538ae
27 changed files with 240 additions and 94 deletions

View File

@ -16,7 +16,7 @@
"build:prod": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode prod",
"serve:dev": "vite preview --mode dev",
"serve:prod": "vite preview --mode prod",
"preview": "pnpm build:local && vite preview",
"preview": "pnpm build:dev && vite preview",
"clean": "npx rimraf node_modules",
"clean:cache": "npx rimraf node_modules/.cache",
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -33,6 +33,22 @@ export interface UPFJApplyformVO {
id: string // 主键
device: string // 设备内容
sortDoctor:string//分检医生 也就是当前登录人
worklist:DicomworklistVO[]
}
// 分检业务表 VO
export interface DicomworklistVO {
accessionN: string // 唯一的号
patientID: string // 患者ID
patientNam: string // 姓名
patientBir: string // 日期
patientSex: string // 性别
studyInsta: string // 1
modality: string // 1
scheduledA: string // 1
startDate: string // 1
startTime: string // 1
orgId: string // 1
registrant: string // 登记医生
}
// 申请登记记录 API

View File

@ -2,24 +2,28 @@
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model=formData
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="当前患者" v-if="false" >
<el-input v-model="name" />
<el-form-item label="当前患者" v-if="false">
<el-input v-model="name" />
</el-form-item>
<el-form-item label="分诊设备" >
<el-form-item label="分诊设备">
<el-select
v-model="fordevicemValue"
placeholder="请选择分诊设备"
clearable
class="!w-300px"
>
<el-option v-for="item in fordevicemData" :key="item.deviceId" :label="item.deviceName+'|'+item.deviceType+'|'+item.deviceId" :value="item.deviceName+'|'+item.deviceId" />
>
<el-option
v-for="item in fordevicemData"
:key="item.deviceId"
:label="item.deviceName + '|' + item.deviceType + '|' + item.deviceId+'|'+item.ScheduledAET"
:value="item.deviceName + '|' + item.deviceId + '|' + item.deviceType+'|'+item.ScheduledAET"
/>
</el-select>
</el-form-item>
</el-form>
@ -30,14 +34,19 @@
</Dialog>
</template>
<script setup lang="ts">
import { ApplyformApi, ApplyformVO,UPFJApplyformVO } from '@/api/applyregistration/applyform'
import {
ApplyformApi,
ApplyformVO,
UPFJApplyformVO,
DicomworklistVO
} from '@/api/applyregistration/applyform'
/** 申请登记记录 表单 */
defineOptions({ name: 'ApplyformForm' })
const { t } = useI18n() //
const message = useMessage() //
const upFJApplyformVO = ref<UPFJApplyformVO[]>([]);
const upFJApplyformVO = ref<UPFJApplyformVO[]>([])
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
@ -63,100 +72,220 @@ const formData = ref({
createDate: undefined,
examItemCode: undefined,
orgId: undefined,
sortDoctor: undefined,
sortDoctor: undefined
})
const fordevicemValue = ref('')
const name = ref('')
let ID:number=0//ID
let Username:string=""//
let ID: number = 0 //ID
let Username: string = '' //
const fordevicemData = ref<any[]>([])
const selectedRows = ref<any[]>([]); //
const formRules = reactive({
})
const selectedRows = ref<any[]>([]) //
const formRules = reactive({})
const formRef = ref() // Ref
const uprow = ref<any[]>([]) //
//
const worklistarrayvo = ref<DicomworklistVO[]>([])
const worklistvo = ref({} as DicomworklistVO)
/** 打开弹窗 */
const open = async (type: string, orgId: string,pname:string,id:number,username:string,list:any[]) => {
const open = async (
type: string,
orgId: string,
pname: string,
id: number,
username: string,
list: any[],
Row: any[]
) => {
dialogVisible.value = true
dialogTitle.value = type
// formType.value = type
name.value=pname
ID=id
Username=username
// formType.value = type
name.value = pname
ID = id
Username = username
resetForm()
if(type=="批量")
{
selectedRows.value=list
console.log("批量"+list.length)
}
if (type == '批量') {
selectedRows.value = list
console.log('批量' + list.length)
} else {
uprow.value = Row
}
//
formLoading.value = true
try {
formLoading.value = true
try {
fordevicemData.value = await ApplyformApi.getDevicelist(orgId)
} finally {
formLoading.value = false
}
} finally {
formLoading.value = false
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if(!fordevicemValue.value)
{
await message.alert("请选择分检设备")
}
else
{
if (!fordevicemValue.value) {
await message.alert('请选择分检设备')
} else {
//
let devtype = fordevicemValue.value.split('|')[2]
// AET
let devAET = fordevicemValue.value.split('|')[3]
//
formLoading.value = true
try {
if(dialogTitle.value=="批量")
{
/* // 批量分检的二次确
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})
});
selectedRows.value.forEach((item) => {
console.log(`selectedRows ${Username} was unselected.`)
//
let Random = generateUniqueTimeRandomNumber()
// --------------
const date = new Date(item.birthday)
const isoString = date.toISOString().substring(0, 10)
let formattedDate = computed(() => isoString.replace(/-/g, ''))
// -----------------------------------------
//
const datatime = new Date(item.examDate)
const [datePart, timePart] = datatime
.toISOString()
.substring(0, 19)
.replace('T', ' ')
.split(' ')
//
let array = [] as DicomworklistVO[]
let worklistvo: DicomworklistVO = {
accessionN: Random,
patientID: item.regId,
patientNam: item.pname,
patientBir: formattedDate.value,
patientSex: getGenderCode(item.gender),
studyInsta: Random,
modality: devtype,
scheduledA: devAET,
startDate: formatDate(datePart),
startTime: formatDate(datePart),
orgId: '',
registrant: ''
}
array.push(worklistvo)
upFJApplyformVO.value.push({
id: item.id,
device: item.deviceName + '|' + item.deviceId,
sortDoctor: Username,
worklist: array
})
})
await ApplyformApi.batchupdateFJApplyform(upFJApplyformVO.value)
}
else{
await ApplyformApi.updateFJApplyform({ id: ID.toString(), device:fordevicemValue.value.toString(),sortDoctor: Username})
}
} else {
//
let Random = generateUniqueTimeRandomNumber()
// --------------
const date = new Date(uprow.value.birthday)
const isoString = date.toISOString().substring(0, 10)
let formattedDate = computed(() => isoString.replace(/-/g, ''))
// -----------------------------------------
//
const datatime = new Date(uprow.value.examDate)
const [datePart, timePart] = datatime
.toISOString()
.substring(0, 19)
.replace('T', ' ')
.split(' ')
console.log('datePart' + datePart)
console.log('timePart' + timePart)
worklistarrayvo.value.push({
accessionN: Random,
patientID: uprow.value.regId,
patientNam: uprow.value.pname,
patientBir: formattedDate.value,
patientSex: getGenderCode(uprow.value.gender),
studyInsta: Random,
modality: devtype,
scheduledA: devAET,
startDate: formatDate(datePart),
startTime: formatTime(timePart),
orgId: '',
registrant: ''
})
console.log(worklistarrayvo.value)
await ApplyformApi.updateFJApplyform({
id: ID.toString(),
device: fordevicemValue.value.toString(),
sortDoctor: Username,
worklist: worklistarrayvo.value
})
}
message.success("分检成功")
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
message.success('分检成功')
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
}
// 6
function generateUniqueTimeRandomNumber() {
//
const now = new Date()
//
const year = now.getFullYear().toString().slice(-2)
// JavaScript0+1
const month = String(now.getMonth() + 1).padStart(2, '0')
//
const day = String(now.getDate()).padStart(2, '0')
// "yyMMdd"
const timePart = `${year}${month}${day}`
// 099
const randomPart = Math.floor(Math.random() * 100)
.toString()
.padStart(2, '0')
//
return `${timePart}${randomPart}`
}
//
function getGenderCode(gender) {
const genderCode = {
: 'M',
: 'F'
}
// undefined
return genderCode[gender]
}
// "YYYYMMDD"
function formatDate(dateString) {
const dateParts = dateString.split('-').map((part) => part.padStart(2, '0'))
return dateParts.join('')
}
//
function formatTime(timeString) {
const timeParts = timeString.split(':').map((part) => parseInt(part, 10))
return timeParts.reduce((acc, value) => acc * 100 + value, 0)
}
/** 重置表单 */
const resetForm = () => {
fordevicemData.value =[]
fordevicemValue.value=''
upFJApplyformVO.value=[]
selectedRows.value=[]
fordevicemData.value = []
fordevicemValue.value = ''
upFJApplyformVO.value = []
selectedRows.value = []
uprow.value = [] //
//
worklistvo.value = {} as DicomworklistVO
worklistarrayvo.value = []
formRef.value?.resetFields()
}
</script>

View File

@ -236,7 +236,7 @@
link
type="primary"
@click="
openForm('分检', scope.row.pname, scope.row.orgId, scope.row.id, scope.row.examStatus)
openForm('分检', scope.row.pname, scope.row.orgId, scope.row.id, scope.row.examStatus,scope.row)
"
v-hasPermi="['applyregistration:applyform:update']"
>
@ -355,9 +355,10 @@ const Sync = async () => {
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, pname: string, orgid: string, ID: number, status: string) => {
const openForm = (type: string, pname: string, orgid: string, ID: number, status: string,row:any[]) => {
console.log(row);
if (status == '未分检') {
formRef.value.open(type, orgid, pname, ID, Profilevo.value.username, [])
formRef.value.open(type, orgid, pname, ID, Profilevo.value.username, [],row)
} else {
message.warning('只有未分检才可以进行分检操作')
}
@ -410,7 +411,7 @@ const batchhandle = async (username: string) => {
}
console.log(`orgid ${orgid} was unselected.`)
console.log(`username ${username} was unselected.`)
formRef.value.open('批量', orgid, '', 0, username, previouslySelectedRows.value)
formRef.value.open('批量', orgid, '', 0, username, previouslySelectedRows.value,[])
} catch {}
}

View File

@ -322,11 +322,11 @@
</el-tab-pane>
<el-tab-pane label="报告" name="report" >
<!--报告区域-->
<div class="flex-center" id="printMe" style="height: calc(100% - 15px)">
<div class="ultrasound-report" id="PDF">
<div id="my-printMe" style="height: calc(100% - 15px)">
<div class="my-ultrasound-report1" id="PDF">
<h2>超声检查报告单</h2>
<hr />
<div class="patient-info">
<div class="my-patient-info">
<p class="info-item">姓名{{ applyFormVO.pname }}</p>
<p class="info-item">送检科室{{ applyFormVO.billDoctorDepartment }}</p>
<p class="info-item">门诊号{{ applyFormVO.examId }}</p>
@ -339,8 +339,8 @@
<hr />
<!-- 图片展示区域 -->
<h3>超声图像</h3>
<div class="image-gallery">
<div class="image-item-container" v-for="image in reportimages" :key="image.id">
<div class="my-image-gallery1">
<div v-for="image in reportimages" :key="image.id">
<img :src="image.imgUrl" alt="" style="width: 180px; height: 180px" />
</div>
</div>
@ -365,7 +365,7 @@
style="width: 100px; float: right"
class="ignore-print"
:disabled="formLoading"
v-print="'printMe'"
v-print="'my-printMe'"
>打印</el-button
>
<el-button
@ -755,14 +755,14 @@ const handleTabChange = async () => {
//
function hideDiv() {
var div = document.getElementById('printMe')
var div = document.getElementById('my-printMe')
if (div) {
div.style.display = 'none'
}
}
//
function showDiv() {
var div = document.getElementById('printMe')
var div = document.getElementById('my-printMe')
if (div) {
div.style.display = 'block'
}
@ -1111,7 +1111,7 @@ const chooseImage = (event, id: number) => {
}
/* 报告样式 */
.ultrasound-report {
.my-ultrasound-report1 {
font-family: Arial, sans-serif;
width: 90%;
margin: 20px auto;
@ -1122,12 +1122,12 @@ const chooseImage = (event, id: number) => {
height: 800px;
}
.ultrasound-report h1,
.ultrasound-report h2 {
.my-ultrasound-report1 h1,
.my-ultrasound-report1 h2 {
text-align: center;
}
.patient-info p,
.my-patient-info p,
.ultrasound-findings p,
.ultrasound-recommendation p {
margin: 5px 0;
@ -1137,13 +1137,13 @@ const chooseImage = (event, id: number) => {
.ultrasound-recommendation h3 {
margin-top: 20px;
}
.image-gallery {
.my-image-gallery1 {
display: flex;
justify-content: space-around;
margin: 20px 0;
}
.image-gallery img {
.my-image-gallery1 img {
max-width: 100%;
height: auto;
border: 1px solid #ccc;
@ -1158,7 +1158,7 @@ const chooseImage = (event, id: number) => {
}
/* 报告的P标签 */
.patient-info {
.my-patient-info {
display: flex;
flex-wrap: wrap;
}