bug 处理

This commit is contained in:
13405411873 2025-05-12 11:17:17 +08:00
parent 41ac1fd673
commit d5c1936187
18 changed files with 612 additions and 308 deletions

View File

@ -348,7 +348,7 @@
tableType: this.tableAlias
}
})
try{
try {
if (!uni.$u.test.isEmpty(res.data.data)) {
uni.showModal({
content: '您有一份问卷测评未做完,是否继续?\n 时间:' + res.data.data[0].createTime.replace('T', ' ')
@ -357,14 +357,14 @@
cancelColor: '#FF0000',
confirmText: '继续测评',
success: (resModal) => {
if (resModal.confirm) {
this.loadUnOverAnswer(res.data.data[0].answer)
this.recordId = res.data.data[0].recordId
this.timeUse = res.data.data[0].timeUse
this.timeUseStart()
} else {
this.delUnOverAnswer(res.data.data[0].recordId)
this.addRecord()
@ -375,11 +375,11 @@
uni.showLoading()
this.addRecord()
}
}catch(err){
} catch (err) {
uni.showLoading()
this.addRecord()
}
},
//
async delUnOverAnswer(recordId) {
@ -1001,7 +1001,7 @@
<style lang="less">
.top-haed {
width: 60%;
width: 80%;
margin: 0 auto;
display: flex;
align-items: center;
@ -1016,7 +1016,7 @@
.content {
.header {
width: 60%;
width: 80%;
margin: 0 auto;
@ -1029,7 +1029,7 @@
.ques-con {
text-align: left;
width: 60%;
width: 80%;
margin: 0 auto;
margin-top: -20rpx;
line-height: 40rpx;

View File

@ -802,7 +802,7 @@
margin: 15px auto;
}
@media (max-width: 700px) {
@media (max-width: 800px) {
.form-item-label {
font-size: 18rpx !important;
font-weight: bold;

View File

@ -404,7 +404,7 @@
}
.top-haed {
width: 60%;
width: 80%;
margin: 0 auto;
display: flex;
align-items: center;
@ -419,7 +419,7 @@
.content {
.header {
width: 60%;
width: 80%;
margin: 0 auto;
image {
@ -428,7 +428,7 @@
}
.record-con {
width: 60%;
width: 80%;
line-height: 40rpx;
border-radius: 20rpx;
background-color: rgba(255, 255, 255, 1);
@ -464,7 +464,7 @@
}
.device-con {
width: 60%;
width: 80%;
margin: 0 auto;
padding-bottom: 40rpx;
}

View File

@ -47,6 +47,7 @@ import java.util.List;
import java.util.concurrent.Executor;
import static com.ruoyi.script.util.ShellUtil.shUtil;
import static com.ruoyi.script.util.YmlUtil.createDtiFile;
import static com.ruoyi.script.util.YmlUtil.createFile;
import static com.ruoyi.system.util.pdfUtil.PdfUtil.chineseFont;
import static com.ruoyi.system.util.pdfUtil.PdfUtil.getImageFromInputStream;
@ -705,10 +706,20 @@ public class PatientScriptServiceImpl implements PatientScriptService {
public void scanData() throws IOException, InterruptedException, TemplateException {
PatientScript patientScript =new PatientScript();
patientScript.setStatus("生成中");
patientScript.setType("noDti");
List<PatientScript> patientScripts = scriptMapper.selectList(patientScript);
if (CollectionUtil.isNotEmpty(patientScripts)){
return;
}
PatientScript patientScript3 =new PatientScript();
patientScript3.setStatus("生成异常");
List<PatientScript> patientScriptList3 = scriptMapper.selectList(patientScript3);
//获取最后一个
if (CollectionUtil.isNotEmpty(patientScriptList3)){
PatientScript patientScript1 = patientScriptList3.get(patientScriptList3.size() - 1);
this.save(patientScript1);
return;
}
PatientScript patientScript2 =new PatientScript();
patientScript2.setStatus("待生成");
List<PatientScript> patientScriptList = scriptMapper.selectList(patientScript2);
@ -719,6 +730,36 @@ public class PatientScriptServiceImpl implements PatientScriptService {
}
}
@Scheduled(cron = "0 0/3 * * * ?")
public void scanDataDti() throws IOException, InterruptedException, TemplateException {
PatientScript patientScript =new PatientScript();
patientScript.setStatus("生成中");
patientScript.setType("dti");
List<PatientScript> patientScripts = scriptMapper.selectList(patientScript);
if (CollectionUtil.isNotEmpty(patientScripts)){
return;
}
PatientScript patientScript3 =new PatientScript();
patientScript3.setStatus("生成异常");
List<PatientScript> patientScriptList3 = scriptMapper.selectList(patientScript3);
//获取最后一个
if (CollectionUtil.isNotEmpty(patientScriptList3)){
PatientScript patientScript1 = patientScriptList3.get(patientScriptList3.size() - 1);
this.saveDti(patientScript1);
return;
}
PatientScript patientScript2 =new PatientScript();
patientScript2.setStatus("待生成");
List<PatientScript> patientScriptList = scriptMapper.selectList(patientScript2);
//获取最后一个
if (CollectionUtil.isNotEmpty(patientScriptList)){
PatientScript patientScript1 = patientScriptList.get(patientScriptList.size() - 1);
this.saveDti(patientScript1);
}
}
@Override
@ -1240,6 +1281,113 @@ public class PatientScriptServiceImpl implements PatientScriptService {
}
public Boolean saveDti(PatientScript patientScript) throws IOException, InterruptedException, TemplateException {
try {
patientScript.setStatus("生成中");
scriptMapper.updateStatus(patientScript);
patientScript = scriptMapper.getById(Long.valueOf(patientScript.getId()));
// 多任务同时处理
if (!patientScript.getType().equals("dti")){
String unique_id = generateOtp();
String playground = "playground"+unique_id;
String format = DateUtil.format(new Date(), "yyyy-MM-dd");
//判断是zip还是rar
if (patientScript.getFilePath().endsWith(".zip")){
unzip(patientScript.getFilePath(),"/data/" +format+"/"+ playground+"/个体数据");
}else if (patientScript.getFilePath().endsWith(".rar")){
unRar(patientScript.getFilePath(),"/data/" +format+"/"+ playground+"/个体数据",null);
}
Map<String, Object> shMap = new LinkedHashMap<>();
shMap.put("outPath",format+"/output-"+unique_id);
shMap.put("filePath", patientScript.getFilePath());
shMap.put("subId",unique_id);
shMap.put("playground",format+"/"+playground);
shMap.put("fmriFileMb",format+"/"+playground+"/preprocessed/sub-001/func/sub-001_task-rest_space-MNI152NLin2009cAsym_boldref.nii.gz");
shMap.put("fmriRegOutFile",format+"/output-"+unique_id+"/bold_2_struct.mat");
shMap.put("fmriFileDpp",format+"/"+playground+"/preprocessed/sub-001/func/sub-001_task-rest_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz");
shMap.put("fmriR2t1OutFile",format+"/output-"+unique_id+"/reg2_Template.nii.gz");
shMap.put("smriFileMb",format+"/"+playground+"/preprocessed/sub-001/anat/sub-001_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz");
shMap.put("smriOutFile",format+"/output-"+unique_id+"/anat2_Template.nii.gz");
String fmriOutPath = "/data/"+format+"/output-"+unique_id+"/fmriOut/";
shMap.put("fmriOutPath",fmriOutPath);
shMap.put("matrixPath","/data/"+format+"/output-"+unique_id+"/");
String shPath="/data/"+format+"/cpac"+"-"+unique_id+".sh";
String dealDataSh="/data/"+format+"/dealData"+"-"+unique_id+".sh";
String imgPath="/data/"+format+"/img"+"-"+unique_id+".sh";
String alignPath="/data/"+format+"/align"+"-"+unique_id+".py";
shMap.put("alignPath",alignPath);
shMap.put("fucDataPath",format+"/output-"+unique_id+"/reg2_Template.nii.gz");
//创建alignPy
createDtiFile(shMap, alignPath,"align_dti.ftl");
//创建处理数据脚本
createDtiFile(shMap, dealDataSh,"dealData_dti.ftl");
//创建图片生成脚本
createDtiFile(shMap, imgPath,"imgSh_dti.ftl");
//创建路径
File folder = new File(fmriOutPath);
if (!folder.exists()) { // 检查文件夹是否已存在
boolean created = folder.mkdirs(); // 创建文件夹
if (created) {
System.out.println("文件夹创建成功!");
} else {
System.out.println("文件夹创建失败!");
}
} else {
System.out.println("文件夹已存在,无需再次创建!");
}
//处理数据处理格式
ShellUtil.execCmd("dos2unix "+dealDataSh);
shUtil(dealDataSh,patientScript);
if (StringUtils.isEmpty(patientScript.getPatientAge())){
patientScript.setPatientAge("0");
}
shMap.put("tr",patientScript.getRepetitionTime());
shMap.put("age",patientScript.getPatientAge());
//创建总脚本
createDtiFile(shMap, shPath,"cpac-dti.ftl");
scriptMapper.updateStatus(patientScript);
//处理脚本文件格式
ShellUtil.execCmd("dos2unix "+shPath);
ShellUtil.execCmd("dos2unix "+imgPath);
String status=shUtil(shPath,patientScript);
//再处理图片的生成
//处理脚本文件格式
ShellUtil.execCmd("sh "+imgPath);
//处理脑区信息
patientScript.setResImage("/data/"+format+"/output-"+unique_id+"/Net.jpg");
patientScript.setStatus(status);
scriptMapper.updateStatus(patientScript);
}
}catch (Exception e){
log.error(e.getMessage());
patientScript.setStatus("生成异常");
scriptMapper.updateStatus(patientScript);
}finally {
if (patientScript.getStatus().equals("生成中")){
patientScript.setStatus("生成异常");
}
scriptMapper.updateStatus(patientScript);
}
return true;
}
public static void main(String[] args) {
try {
unRar("D:\\elevator-web\\WX-mb.rar", "D:\\elevator-web\\output",null);

View File

@ -39,4 +39,32 @@ public class YmlUtil {
return true;
}
public static Boolean createDtiFile(Map<String, Object> data ,String path,String templateName) throws IOException, TemplateException {
// 创建Freemarker配置
Configuration configuration = new Configuration(Configuration.VERSION_2_3_30);
configuration.setClassForTemplateLoading(YmlUtil.class, "/static/dti");
configuration.setDefaultEncoding("UTF-8");
// 加载模板
Template template = configuration.getTemplate(templateName);
// 设置输出文件
File outputFile = new File(path);
if (!outputFile.exists())
{
if (!outputFile.getParentFile().exists())
{
outputFile.getParentFile().mkdirs();
}
}
// 渲染模板并生成输出文件
FileWriter writer = new FileWriter(outputFile);
template.process(data, writer);
writer.close();
System.out.println("YAML file generated successfully!");
outputFile.setExecutable(true);
return true;
}
}

View File

@ -60,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="scanDoctor != null and scanDoctor != ''"> and scan_doctor like concat('%',#{scanDoctor},'%') </if>
<if test="isAll != null and isAll != ''"> and is_all= #{isAll} </if>
<if test="status != null and status != ''"> and status= #{status} </if>
<if test="type != null and type != ''"> and `type`= #{type} </if>
</where>
order by create_time desc
</select>

View File

@ -0,0 +1,22 @@
import os
# This script can align cpac output and AAL template to the same space
temp_file = '/data/Atlas/AAL_61x73x61_YCG.nii'
fmri_file_mb = '${fmriFileMb}'
fmri_reg_out_file = '${fmriRegOutFile}'
system_str_mb = f"flirt -ref {temp_file} -in {fmri_file_mb} -dof 6 -omat {fmri_reg_out_file}"
print(system_str_mb)
os.system(system_str_mb)
fmri_file_dpp = f"${fmriFileDpp}"
fmri_r2t1_out_file = "${fmriR2t1OutFile}"
system_str_dpp = f"applywarp -i {fmri_file_dpp} -r {temp_file} -o {fmri_r2t1_out_file} --premat={fmri_reg_out_file} --interp=spline"
print(system_str_dpp)
print("***Please wait for a moment***")
os.system(system_str_dpp)
smri_file_mb = '${smriFileMb}'
smri_reg_out_file = '${smriOutFile}'
system_str_mb = f"flirt -ref {temp_file} -in {smri_file_mb} -dof 12 -out {smri_reg_out_file} "
print(system_str_mb)
os.system(system_str_mb)

View File

@ -0,0 +1,24 @@
#!/bin/bash
echo "Hello, output-001!"
cd /data
cp -r ${playground}/BIDS_output/sub-001/dwi ${outPath}/
sh /data/DTI_process.sh ${outPath}/dwi/
python ${alignPath}
python /data/test2_dti.py --sub_id ${subId} --TR ${tr} --root_dir ${fmriR2t1OutFile} --out_dir ${fmriOutPath} --anat_dir ${smriOutFile} --fa_dir ${outPath}/dwi/whole_brain_01.trk.aal.fa.end.connectivity.mat --count_dir ${outPath}/dwi/whole_brain_01.trk.aal.count.end.connectivity.mat
echo "fmri handle end!"
cp Node_AAL116.node config.mat config2.mat config3.mat config4.mat BrainMesh_Ch2withCerebellum.nv main_dti.py modelViewGeneral_dti.py Models_dti.py rtmalbFile.m brain_regions.npy number_change_script.py extract_regions.py ${matrixPath}
cd ${matrixPath}
python main_dti.py --sub_id ${subId} --root_dir ${fmriOutPath} --module_dir /data/config/models_9_9 --matrix_path ${matrixPath}
python number_change_script.py --age ${age}
python extract_regions.py
echo "main handle end!"

View File

@ -0,0 +1,11 @@
#!/bin/bash
cd /data
cd /data
echo "执行源文件处理脚本"
python dealTest_dti.py --base_dir ${playground} --output_dir ${playground}/BIDS_output --json_dir ${playground}/BIDS_output/sub-001/func/
rm -rf ./${playground}/BIDS_output/config.json
cp ./README ${playground}/BIDS_output/
echo "通过源文件进行二次处理"
docker run --rm -e DOCKER_VERSION_8395080871=27.3.1 -v /data/license.txt:/opt/freesurfer/license.txt:ro -v /data/${playground}/BIDS_output:/data:ro -v /data/${playground}/preprocessed:/out nipreps/fmriprep:23.2.3 /data /out participant --participant-label 001 --fs-no-reconall
python scriptAge.py --dicom_folder ${playground}

View File

@ -0,0 +1,7 @@
#!/bin/bash
echo "Hello, output-001!"
cd ${matrixPath}
matlab -nodesktop -nodisplay -r rtmalbFile
echo "main handle end!"

View File

@ -35,7 +35,7 @@ export default {
},
data() {
return {
title: '大脑图层分析管理系统',
title: '孤独症辅助诊断评估系统',
logo: logoImg
}
}

View File

@ -6,10 +6,10 @@
<div class="left-box" >
<div class="logo-size" >
<img src="./../assets/images/logo.png" >
<span style="margin: 0px 10px;width: 110px">大脑图层分析</span>
<span style="margin: 0px 10px;width: 110px">孤独症辅助诊断评估系统</span>
</div>
<div class="tap-box" @click="goCerebrum()" >大脑图层分析</div>
<div class="tap-box" @click="goCerebrum()" >孤独症辅助诊断评估系统</div>
<div class="tap-box" >生态合作</div>
<div class="tap-box" >解决方案</div>
@ -24,7 +24,7 @@
<!-- top 中层 -->
<div class="top-center-box">
<div class="c-left">
<div class="c-max-size">大脑图层分析</div>
<div class="c-max-size">孤独症辅助诊断评估系统</div>
<div class="c-min-size">专业 智能 高效辅助 数字化分析 </div>
</div>
<div class="c-right">
@ -94,7 +94,7 @@
<el-dialog
title="大脑图层分析"
title="孤独症辅助诊断评估系统"
:visible.sync="centerDialogVisible"
top="50vh"
width="30%"

View File

@ -6,10 +6,10 @@
<div class="left-box" >
<div class="logo-size" >
<img src="./../assets/images/logo.png" >
<span style="margin: 0px 10px;width: 110px">大脑图层分析</span>
<span style="margin: 0px 10px;width: 110px">孤独症辅助诊断评估系统</span>
</div>
<div class="tap-box" @click="goCerebrum()" >大脑图层分析</div>
<div class="tap-box" @click="goCerebrum()" >孤独症辅助诊断评估系统</div>
<div class="tap-box" >生态合作</div>
<div class="tap-box" >解决方案</div>
@ -24,7 +24,7 @@
<!-- top 中层 -->
<div class="top-center-box">
<div class="c-left">
<div class="c-max-size">大脑图层分析</div>
<div class="c-max-size">孤独症辅助诊断评估系统</div>
<div class="c-min-size">专业 智能 高效辅助 数字化分析</div>
</div>
<div class="c-right">
@ -102,7 +102,7 @@
<el-dialog
title="大脑图层分析"
title="孤独症辅助诊断评估系统"
:visible.sync="centerDialogVisible"
top="50vh"
width="30%"

View File

@ -55,7 +55,7 @@
<div class="on-box" v-for="(item,index) in routerList" :key="index" @click="gorouter(item.path)">
<!-- <img src="./../assets/images/routers.png" >-->
<div>{{item.title || '大脑图层分析'}}</div>
<div>{{item.title || '孤独症辅助诊断评估系统'}}</div>
</div>
</div>
<el-dialog title="科研申请"

View File

@ -83,7 +83,7 @@
<el-table-column label="儿童姓名" align="center" prop="username" />
<el-table-column label="扫码机构" align="center" prop="scanDeptName" >
<template slot-scope="scope">
<span>{{scope.row.scanDeptName?scope.row.scanDeptName:'大脑图层分析'}}</span>
<span>{{scope.row.scanDeptName?scope.row.scanDeptName:'孤独症辅助诊断评估系统'}}</span>
</template>
</el-table-column>
<el-table-column label="测评问卷" align="center" prop="tableName" />

View File

@ -18,12 +18,11 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:record:add']">新增</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:record:remove']">删除</el-button>
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -43,7 +42,7 @@
<template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.status=='正常'||scope.row.status=='异常'" @click="exportReport(scope.row)">下载报告</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:record:remove']">删除</el-button>
>删除</el-button>
</template>
</el-table-column>
</el-table>
@ -271,6 +270,7 @@ export default {
/** 查询测评记录列表 */
getList() {
this.loading = true;
this.queryParams.type = 'noDti'
listRecord(this.queryParams).then(response => {
this.recordList = response.rows;
this.total = response.total;
@ -311,9 +311,9 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "图形处理";
this.reset();
},
/** 修改按钮操作 */
handleUpdate(row) {

View File

@ -18,12 +18,11 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:record:add']">新增</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:record:remove']">删除</el-button>
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -43,7 +42,7 @@
<template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.status=='正常'||scope.row.status=='异常'" @click="exportReport(scope.row)">下载报告</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:record:remove']">删除</el-button>
>删除</el-button>
</template>
</el-table-column>
</el-table>
@ -78,129 +77,141 @@
</el-table>
</el-dialog>
<!-- 添加或修改测评记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="患者姓名" prop="patientName">
<el-input v-model="form.patientName" placeholder="请输入患者姓名" />
</el-form-item>
<el-form-item label="患者年龄" prop="patientAge">
<el-input-number v-model="form.patientAge" placeholder="患者年龄" />
</el-form-item>
<el-form-item label="性别" prop="patientSex">
<el-radio-group v-model="form.patientSex">
<el-radio label="男"></el-radio>
<el-radio label="女"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="证件信息号" prop="patientCard">
<el-input v-model="form.patientCard" placeholder="证件信息号" />
</el-form-item>
<el-form-item label="扫描时间" prop="scanTime">
<el-date-picker
v-model="form.scanTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="病历号" prop="blOrder">
<el-input v-model="form.blOrder" placeholder="病历号" />
</el-form-item>
<el-form-item label="扫描地点" prop="scanPosition">
<el-input v-model="form.scanPosition" placeholder="扫描地点" />
</el-form-item>
<el-form-item label="扫描医生" prop="scanDoctor">
<el-input v-model="form.scanDoctor" placeholder="扫描医生" />
</el-form-item>
<el-form-item label="诊断医师" prop="zdDoctor">
<el-input v-model="form.zdDoctor" placeholder="扫描医生" />
</el-form-item>
<el-form-item label="审核医生" prop="shDoctor">
<el-input v-model="form.shDoctor" placeholder="扫描医生" />
</el-form-item>
<el-form-item label="TR" prop="repetitionTime">
<el-input v-model="form.repetitionTime" placeholder="TR" />
</el-form-item>
<el-form-item label="扫描顺序" prop="scanningOrder">
<el-select v-model="form.scanningOrder" placeholder="请选择扫描顺序">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="参考切片层数" prop="sliceNumber">
<el-input-number v-model="form.sliceNumber" placeholder="参考切片层数" />
</el-form-item>
<el-form-item label="结构像" prop="structureImage">
<brain-upload :limit="1" v-model="form.structureImage" />
</el-form-item>
<el-form-item label="功能像" prop="featureImage">
<brain-upload :limit="1" v-model="form.featureImage" />
</el-form-item>
</el-form>
<el-dialog :title="title" :visible.sync="open" width="1800px" append-to-body>
<div class="dialog_box">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<div v-for="(item, index) in form" :key="index">
<div class="title_">患者{{index+1}}</div>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="'扫描文件' " :prop="'items.' + index + '.filePath'" :rules="rules.filePath">
<brain-upload :limit="1" v-model="item.filePath" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'患者姓名' " :prop="'items.' + index + '.patientName'" :rules="rules.patientName">
<el-input v-model="item.patientName" placeholder="请输入患者姓名" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'患者年龄' " :prop="'items.' + index + '.patientAge'" :rules="rules.patientAge">
<el-input-number v-model="item.patientAge" placeholder="患者年龄" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'性别' " :prop="'items.' + index + '.patientSex'" :rules="rules.patientSex">
<el-radio-group v-model="item.patientSex">
<el-radio label="男"></el-radio>
<el-radio label="女"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'证件信息号' " :prop="'items.' + index + '.patientCard'" :rules="rules.patientCard">
<el-input v-model="item.patientCard" placeholder="证件信息号" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'扫描时间' " :prop="'items.' + index + '.scanTime'" :rules="rules.scanTime">
<el-date-picker
v-model="item.scanTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'病历号' " :prop="'items.' + index + '.blOrder'" :rules="rules.blOrder">
<el-input v-model="item.blOrder" placeholder="病历号" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'扫描地点' " :prop="'items.' + index + '.scanPosition'" :rules="rules.scanPosition">
<el-input v-model="item.scanPosition" placeholder="扫描地点" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'扫描医生' " :prop="'items.' + index + '.scanDoctor'" :rules="rules.scanDoctor">
<el-input v-model="item.scanDoctor" placeholder="扫描医生" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'诊断医师' " :prop="'items.' + index + '.zdDoctor'" :rules="rules.zdDoctor">
<el-input v-model="item.zdDoctor" placeholder="诊断医师" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'审核医生' " :prop="'items.' + index + '.shDoctor'" :rules="rules.shDoctor">
<el-input v-model="item.shDoctor" placeholder="审核医生" />
</el-form-item>
</el-col>
<div class="right_button">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="removeItem(index)">删除</el-button>
</div>
</el-row>
</div>
<el-form-item>
<el-button type="primary" @click="addItem">添加行</el-button>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listRecord,
getRecord,
delRecord,
addRecord,
updateRecord,
exportReport
} from "./scriptSh";
import request from '@/utils/request'
import {
listRecord,
getRecord,
delRecord,
addRecord,
updateRecord,
exportReport
} from "./scriptSh";
import request from '@/utils/request'
import dayjs from 'dayjs'
export default {
name: "Record",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
recordList: [],
options: [{
value: 'altplus',
label: 'altplus'
}, {
value: 'alt+z',
label: 'alt+z'
}, {
value: 'alt+z2',
label: 'alt+z2'
}, {
value: 'altminus',
label: 'altminus'
}, {
value: 'alt-z',
label: 'alt-z'
}
import dayjs from 'dayjs'
export default {
name: "Record",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
recordList: [],
options: [{
value: 'altplus',
label: 'altplus'
}, {
value: 'alt+z',
label: 'alt+z'
}, {
value: 'alt+z2',
label: 'alt+z2'
}, {
value: 'altminus',
label: 'altminus'
}, {
value: 'alt-z',
label: 'alt-z'
}
, {
value: 'alt-z2',
label: 'alt-z2'
@ -212,171 +223,223 @@
label: 'seqminus'
}
],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {
patientSex:'男',
],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: [
{
patientSex: '男',
scanTime: ''
},
//
rules: {},
jsonOpen: false,
jsonData: {},
jsonType: ''
};
}
],
//
rules: {
filePath: [
{
required: true,
message: "扫描文件不能为空",
trigger: "blur",
},
],
scanPosition: [
{
required: true,
message: "扫描地点不能为空",
trigger: "blur",
},
]
},
jsonOpen: false,
jsonData: {},
jsonType: ''
};
},
created() {
this.getList();
},
methods: {
/** 查询测评记录列表 */
getList() {
this.loading = true;
this.queryParams.type = 'dti'
listRecord(this.queryParams).then(response => {
this.recordList = response.rows;
this.total = response.total;
this.loading = false;
console.log(response);
});
},
created() {
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = [
{
patientSex: '男',
scanTime: ''
}
];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
methods: {
/** 查询测评记录列表 */
getList() {
this.loading = true;
listRecord(this.queryParams).then(response => {
this.recordList = response.rows;
this.total = response.total;
this.loading = false;
console.log(response);
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.open = true;
this.title = "图形处理";
this.reset();
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const recordId = row.id || this.ids
getRecord(recordId).then(response => {
this.form = [response.data];
this.open = true;
this.title = "图形处理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const recordId = row.id || this.ids
getRecord(recordId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改测评记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.scanTime = dayjs(this.form.scanTime).format('YYYY-MM-DD HH:mm:ss')
this.form.type = 'noDti'
if (this.form.recordId != null) {
updateRecord(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRecord(this.form).then(response => {
this.$modal.msgSuccess("提交成功,请耐心等待结果");
this.open = false;
this.getList();
});
}
}
});
},
downImage(data) {
},
/** 删除按钮操作 */
handleDelete(row) {
const recordIds = row.id || this.ids;
this.$modal.confirm('是否确认删除测评记录编号为"' + recordIds + '"的数据项?').then(function() {
return delRecord(recordIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
if (!this.queryParams.tableType||this.queryParams.tableType==null){
this.$message.warning("请先选择类型")
return
this.title = "修改测评记录";
});
},
/** 提交按钮 */
submitForm() {
let flag = false;
this.form.forEach(it=>{
if (!it.filePath){
flag = true
this.$modal.msgError("请上传文件");
}
this.download('system/record/export', {
...this.queryParams
}, `record_${new Date().getTime()}.xls`)
},
exportReport(data){
let id = data.id
exportReport(id).then(response => {
console.log(response)
let blob = new Blob([response], {
type: 'application/pdf' // pdf MIME
})
//console.log(blob)
let fileName = data.patientName+'_'+Date.parse(new Date()) + '.pdf'
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, fileName)
} else {
var link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = fileName
link.click()
//
window.URL.revokeObjectURL(link.href)
}
})
},
handleReview(jsonData, jsonType) {
this.jsonType = jsonType
this.jsonOpen = true
this.jsonData = JSON.parse(jsonData)
},
displayScore(score) {
console.log(typeof score);
console.log(score.length);
// 1
if (typeof score == "object") {
return scoreList
} else {
return score
if (!it.scanPosition){
flag = true
this.$modal.msgError("请输入扫描地点");
}
})
if (flag) return;
const formData = this.form.map(item => ({
...item,
scanTime:item.scanTime? dayjs(item.scanTime).format('YYYY-MM-DD HH:mm:ss'):null,
type: 'dti'
}));
addRecord(formData).then(response => {
this.$modal.msgSuccess("提交成功,请耐心等待结果");
this.open = false;
this.getList();
})
},
downImage(data) {
//
},
/** 删除按钮操作 */
handleDelete(row) {
const recordIds = row.id || this.ids;
this.$modal.confirm('是否确认删除测评记录编号为"' + recordIds + '"的数据项?').then(function() {
return delRecord(recordIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
if (!this.queryParams.tableType || this.queryParams.tableType == null) {
this.$message.warning("请先选择类型")
return
}
this.download('system/record/export', {
...this.queryParams
}, `record_${new Date().getTime()}.xls`)
},
exportReport(data) {
let id = data.id
exportReport(id).then(response => {
console.log(response)
let blob = new Blob([response], {
type: 'application/pdf' // pdf MIME
})
let fileName = data.patientName + '_' + Date.parse(new Date()) + '.pdf'
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, fileName)
} else {
var link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = fileName
link.click()
//
window.URL.revokeObjectURL(link.href)
}
})
},
handleReview(jsonData, jsonType) {
this.jsonType = jsonType
this.jsonOpen = true
this.jsonData = JSON.parse(jsonData)
},
displayScore(score) {
console.log(typeof score);
console.log(score.length);
// 1
if (typeof score == "object") {
return scoreList
} else {
return score
}
},
addItem() {
this.form.push({
patientSex: '男',
scanTime: ''
});
},
removeItem(index) {
this.form.splice(index, 1);
}
};
}
};
</script>
<style scoped>
.dialog_box{
width: 100%;
box-sizing: border-box;
padding: 10px;
}
.right_button{
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
padding-right: 12px;
}
.title_{
font-size: 16px;
font-weight: 600;
margin-left: 45px;
margin-bottom: 10px;
}
</style>

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询测评记录列表
export function listRecord(query) {
return request({
url: '/sys/patientScript2/list',
url: '/sys/patientScript/list',
method: 'get',
params: query
})
@ -20,7 +20,7 @@ export function getRecord(recordId) {
// 新增测评记录
export function addRecord(data) {
return request({
url: '/sys/patientScript2/add',
url: '/sys/patientScript/add',
method: 'post',
data: data
})
@ -31,7 +31,7 @@ export function addRecord(data) {
// 删除测评记录
export function delRecord(recordIds) {
return request({
url: '/sys/patientScript2/del?idList=' + recordIds,
url: '/sys/patientScript/del?idList=' + recordIds,
method: 'delete'
})
}
@ -39,7 +39,7 @@ export function delRecord(recordIds) {
// 删除测评记录
export function exportReport(id) {
return request({
url: '/sys/patientScript2/exportReport?id=' + id,
url: '/sys/patientScript/exportReport?id=' + id,
method: 'post',
responseType: 'blob'
})