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

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", "build:prod": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode prod",
"serve:dev": "vite preview --mode dev", "serve:dev": "vite preview --mode dev",
"serve:prod": "vite preview --mode prod", "serve:prod": "vite preview --mode prod",
"preview": "pnpm build:local && vite preview", "preview": "pnpm build:dev && vite preview",
"clean": "npx rimraf node_modules", "clean": "npx rimraf node_modules",
"clean:cache": "npx rimraf node_modules/.cache", "clean:cache": "npx rimraf node_modules/.cache",
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src", "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 // 主键 id: string // 主键
device: string // 设备内容 device: string // 设备内容
sortDoctor: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 // 申请登记记录 API

View File

@ -2,12 +2,11 @@
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model=formData :model="formData"
:rules="formRules" :rules="formRules"
label-width="100px" label-width="100px"
v-loading="formLoading" v-loading="formLoading"
> >
<el-form-item label="当前患者" v-if="false"> <el-form-item label="当前患者" v-if="false">
<el-input v-model="name" /> <el-input v-model="name" />
</el-form-item> </el-form-item>
@ -19,7 +18,12 @@
clearable clearable
class="!w-300px" 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-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -30,14 +34,19 @@
</Dialog> </Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ApplyformApi, ApplyformVO,UPFJApplyformVO } from '@/api/applyregistration/applyform' import {
ApplyformApi,
ApplyformVO,
UPFJApplyformVO,
DicomworklistVO
} from '@/api/applyregistration/applyform'
/** 申请登记记录 表单 */ /** 申请登记记录 表单 */
defineOptions({ name: 'ApplyformForm' }) defineOptions({ name: 'ApplyformForm' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const upFJApplyformVO = ref<UPFJApplyformVO[]>([]); const upFJApplyformVO = ref<UPFJApplyformVO[]>([])
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
@ -63,23 +72,31 @@ const formData = ref({
createDate: undefined, createDate: undefined,
examItemCode: undefined, examItemCode: undefined,
orgId: undefined, orgId: undefined,
sortDoctor: undefined, sortDoctor: undefined
}) })
const fordevicemValue = ref('') const fordevicemValue = ref('')
const name = ref('') const name = ref('')
let ID: number = 0 //ID let ID: number = 0 //ID
let Username:string=""// let Username: string = '' //
const fordevicemData = ref<any[]>([]) const fordevicemData = ref<any[]>([])
const selectedRows = ref<any[]>([]); // const selectedRows = ref<any[]>([]) //
const formRules = reactive({ const formRules = reactive({})
})
const formRef = ref() // Ref 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 dialogVisible.value = true
dialogTitle.value = type dialogTitle.value = type
@ -88,67 +105,175 @@ const open = async (type: string, orgId: string,pname:string,id:number,username:
ID = id ID = id
Username = username Username = username
resetForm() resetForm()
if(type=="批量") if (type == '批量') {
{
selectedRows.value = list selectedRows.value = list
console.log("批量"+list.length) console.log('批量' + list.length)
} else {
uprow.value = Row
} }
// //
formLoading.value = true formLoading.value = true
try { try {
fordevicemData.value = await ApplyformApi.getDevicelist(orgId) fordevicemData.value = await ApplyformApi.getDevicelist(orgId)
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
defineExpose({ open }) // open defineExpose({ open }) // open
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
// //
if(!fordevicemValue.value) if (!fordevicemValue.value) {
{ await message.alert('请选择分检设备')
await message.alert("请选择分检设备") } else {
} //
else let devtype = fordevicemValue.value.split('|')[2]
{ // AET
let devAET = fordevicemValue.value.split('|')[3]
// //
formLoading.value = true formLoading.value = true
try { try {
if(dialogTitle.value=="批量") if (dialogTitle.value == '批量') {
{
/* // 批量分检的二次确 /* // 批量分检的二次确
await message.delConfirm("是否批量分检选择内容") */ await message.delConfirm("是否批量分检选择内容") */
selectedRows.value.forEach((item) => { selectedRows.value.forEach((item) => {
console.log(`selectedRows ${Username} was unselected.`); console.log(`selectedRows ${Username} was unselected.`)
upFJApplyformVO.value.push({ id: item.id, device:item.deviceName+'|'+item.deviceId,sortDoctor: Username}) //
}); let Random = generateUniqueTimeRandomNumber()
await ApplyformApi.batchupdateFJApplyform(upFJApplyformVO.value) // --------------
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: ''
} }
else{ array.push(worklistvo)
await ApplyformApi.updateFJApplyform({ id: ID.toString(), device:fordevicemValue.value.toString(),sortDoctor: Username})
upFJApplyformVO.value.push({
id: item.id,
device: item.deviceName + '|' + item.deviceId,
sortDoctor: Username,
worklist: array
})
})
await ApplyformApi.batchupdateFJApplyform(upFJApplyformVO.value)
} 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("分检成功") message.success('分检成功')
dialogVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {
formLoading.value = false 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)
} }
/** 重置表单 */ /** 重置表单 */
@ -157,6 +282,10 @@ const resetForm = () => {
fordevicemValue.value = '' fordevicemValue.value = ''
upFJApplyformVO.value = [] upFJApplyformVO.value = []
selectedRows.value = [] selectedRows.value = []
uprow.value = [] //
//
worklistvo.value = {} as DicomworklistVO
worklistarrayvo.value = []
formRef.value?.resetFields() formRef.value?.resetFields()
} }
</script> </script>

View File

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

View File

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