|
|
|
|
@ -63,7 +63,7 @@ |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-check" |
|
|
|
|
@click="handleSave" |
|
|
|
|
v-if="caseStatus !== 'submitted'" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
暂存 |
|
|
|
|
</el-button> |
|
|
|
|
@ -71,7 +71,7 @@ |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-check" |
|
|
|
|
@click="handleSubmit" |
|
|
|
|
v-if="caseStatus !== 'submitted'" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
提交 |
|
|
|
|
</el-button> |
|
|
|
|
@ -79,7 +79,7 @@ |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-print" |
|
|
|
|
@click="handlePrint" |
|
|
|
|
v-if="caseStatus == 'submitted'" |
|
|
|
|
v-if="form.status != 1 && form.status != 5" |
|
|
|
|
> |
|
|
|
|
打印 |
|
|
|
|
</el-button> |
|
|
|
|
@ -170,7 +170,13 @@ |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="检查部位" prop="positions"> |
|
|
|
|
{{ form.positions.map((item) => item.level2.name).join("|") }} |
|
|
|
|
{{ |
|
|
|
|
(form.positions.length |
|
|
|
|
? form.positions |
|
|
|
|
.map((item) => item.level2.name) |
|
|
|
|
.join("|") + "|" |
|
|
|
|
: "") + form.position_text |
|
|
|
|
}} |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
@ -270,7 +276,7 @@ |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-checkbox |
|
|
|
|
v-model="form.isPositive" |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
:disabled="form.status != 1 && form.status != 5" |
|
|
|
|
> |
|
|
|
|
阳性 |
|
|
|
|
</el-checkbox> |
|
|
|
|
@ -290,8 +296,8 @@ |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
@click="openTemplateDialog('add')" |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
@click="openTemplateDialog({})" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
新增 |
|
|
|
|
</el-button> |
|
|
|
|
@ -299,15 +305,15 @@ |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
@click="deleteTemplate" |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
@click="openTemplateDialog('edit')" |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
@click="openTemplateDialog(form)" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
编辑 |
|
|
|
|
</el-button> |
|
|
|
|
@ -326,7 +332,7 @@ |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in templateList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.title" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
@ -334,16 +340,16 @@ |
|
|
|
|
|
|
|
|
|
<el-form-item label="超声所见"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="templateForm.text_comment" |
|
|
|
|
v-model="templateForm.comment" |
|
|
|
|
type="textarea" |
|
|
|
|
readonly |
|
|
|
|
:rows="6" |
|
|
|
|
/> |
|
|
|
|
<el-button |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-check" |
|
|
|
|
@click="applytext_comment" |
|
|
|
|
@click="handleComment" |
|
|
|
|
style="float: right; margin-top: 6px" |
|
|
|
|
> |
|
|
|
|
应用 |
|
|
|
|
@ -352,7 +358,7 @@ |
|
|
|
|
|
|
|
|
|
<el-form-item label="结论" style="margin-top: 20px"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="templateForm.text_conclusion" |
|
|
|
|
v-model="templateForm.conclusion" |
|
|
|
|
type="textarea" |
|
|
|
|
readonly |
|
|
|
|
:rows="6" |
|
|
|
|
@ -360,9 +366,9 @@ |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-check" |
|
|
|
|
@click="applytext_conclusion" |
|
|
|
|
@click="handleCnclusion" |
|
|
|
|
style="float: right; margin-top: 6px" |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
应用 |
|
|
|
|
</el-button> |
|
|
|
|
@ -376,8 +382,8 @@ |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
@click="openPhraseDialog('add')" |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
@click="openPhraseDialog({})" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
新增 |
|
|
|
|
</el-button> |
|
|
|
|
@ -388,21 +394,21 @@ |
|
|
|
|
:show-header="false" |
|
|
|
|
height="calc(100vh - 265px)" |
|
|
|
|
> |
|
|
|
|
<el-table-column prop="content" label="内容" /> |
|
|
|
|
<el-table-column prop="phrase" label="内容" /> |
|
|
|
|
<el-table-column label="操作" width="80"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
@click="openPhraseDialog('edit', scope.row)" |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
@click="openPhraseDialog(scope.row)" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
@click="deletePhrase(scope.row)" |
|
|
|
|
:disabled="caseStatus === 'submitted'" |
|
|
|
|
v-if="form.status == 1 || form.status == 5" |
|
|
|
|
> |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
@ -447,7 +453,7 @@ |
|
|
|
|
<el-input |
|
|
|
|
type="textarea" |
|
|
|
|
:rows="6" |
|
|
|
|
v-model="newTemplateForm.text_conclusion" |
|
|
|
|
v-model="newTemplateForm.conclusion" |
|
|
|
|
placeholder="请输入检查结论内容" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
@ -469,7 +475,7 @@ |
|
|
|
|
<el-input |
|
|
|
|
type="textarea" |
|
|
|
|
:rows="10" |
|
|
|
|
v-model="newPhraseForm.content" |
|
|
|
|
v-model="newPhraseForm.phrase" |
|
|
|
|
placeholder="请输入片语内容" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
@ -494,8 +500,6 @@ |
|
|
|
|
<CreateGroupDialog |
|
|
|
|
:visible.sync="shareDialogVisible" |
|
|
|
|
title="分享给" |
|
|
|
|
:recent-contacts="recentContacts" |
|
|
|
|
:recent-groups="recentGroups" |
|
|
|
|
:min-select-count="1" |
|
|
|
|
confirm-text="分享" |
|
|
|
|
@create-success="handleShareToContacts" |
|
|
|
|
@ -514,18 +518,39 @@ import { |
|
|
|
|
postReportInfo, |
|
|
|
|
postReportViewers, |
|
|
|
|
postReportEdit, |
|
|
|
|
postReportTplList, |
|
|
|
|
postReportTplCreate, |
|
|
|
|
postReportTplEdit, |
|
|
|
|
postReportTplDelete, |
|
|
|
|
postReportTplCount, |
|
|
|
|
postReportPhraseList, |
|
|
|
|
postReportPhraseEdit, |
|
|
|
|
postReportPhraseDelete, |
|
|
|
|
postReportPhraseCount, |
|
|
|
|
} from "@/api/cases/index.js"; |
|
|
|
|
// 导入打印组件 |
|
|
|
|
import UltrasoundReportPrint from "./components/UltrasoundReportPrint.vue"; |
|
|
|
|
import CreateGroupDialog from "@/views/message/components/CreateGroupDialog"; |
|
|
|
|
export default { |
|
|
|
|
name: "UltrasoundReport", |
|
|
|
|
name: "CaseDetail", |
|
|
|
|
components: { |
|
|
|
|
UltrasoundReportPrint, |
|
|
|
|
CreateGroupDialog, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
// 图片上传 |
|
|
|
|
imgList: [ |
|
|
|
|
{ |
|
|
|
|
id: Date.now(), |
|
|
|
|
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
// 新增:控制打印弹窗显隐 |
|
|
|
|
printDialogVisible: false, |
|
|
|
|
// ================== 分享相关 ================== |
|
|
|
|
shareDialogVisible: false, // 分享弹窗 |
|
|
|
|
shareItem: null, // 当前分享的病例 |
|
|
|
|
// 主报告表单 |
|
|
|
|
form: {}, |
|
|
|
|
// 字典 |
|
|
|
|
@ -552,63 +577,59 @@ export default { |
|
|
|
|
statusList: statusList(), |
|
|
|
|
// 审核人 |
|
|
|
|
reviewersList: [], |
|
|
|
|
|
|
|
|
|
// 部位模板/片语 |
|
|
|
|
activeTab: "template", |
|
|
|
|
// 病例状态: pending-暂存, submitted-已提交 |
|
|
|
|
caseStatus: "submitted", |
|
|
|
|
// 图片上传 |
|
|
|
|
imgList: [ |
|
|
|
|
{ |
|
|
|
|
id: Date.now(), |
|
|
|
|
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
// ====================== 部位模板核心 ====================== |
|
|
|
|
templateType: "add", |
|
|
|
|
dialogTitle: "模板创建", |
|
|
|
|
templateDialogVisible: false, |
|
|
|
|
templateList: [], |
|
|
|
|
templateForm: { |
|
|
|
|
id: 1, |
|
|
|
|
type: "abdomen-liver", |
|
|
|
|
title: "腹部(肝、胆、胰、脾)", |
|
|
|
|
text_comment: "", |
|
|
|
|
text_conclusion: "", |
|
|
|
|
}, |
|
|
|
|
templateForm: {}, |
|
|
|
|
newTemplateForm: { |
|
|
|
|
id: null, |
|
|
|
|
type: "abdomen-liver", |
|
|
|
|
title: "", |
|
|
|
|
text_comment: "", |
|
|
|
|
text_conclusion: "", |
|
|
|
|
conclusion: "", |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// ====================== ✅ 片语核心(新增) ====================== |
|
|
|
|
phraseType: "add", // add / edit |
|
|
|
|
phraseDialogTitle: "片语创建", |
|
|
|
|
phraseDialogVisible: false, |
|
|
|
|
phraseList: [{ id: 1, content: "片语示例:未见明显异常" }], |
|
|
|
|
phraseList: [], |
|
|
|
|
newPhraseForm: { |
|
|
|
|
id: null, |
|
|
|
|
content: "", |
|
|
|
|
phrase: "", |
|
|
|
|
}, |
|
|
|
|
// 新增:控制打印弹窗显隐 |
|
|
|
|
printDialogVisible: false, |
|
|
|
|
|
|
|
|
|
// ================== 分享相关 ================== |
|
|
|
|
shareDialogVisible: false, // 分享弹窗 |
|
|
|
|
shareItem: null, // 当前分享的病例 |
|
|
|
|
recentContacts: [], // 最近联系人 |
|
|
|
|
recentGroups: [], // 最近群组 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
const id = this.$route.params && this.$route.params.id; |
|
|
|
|
this.getReportInfo(id); |
|
|
|
|
this.getReviewers(); |
|
|
|
|
this.loadTemplateList(); |
|
|
|
|
this.loadPhraseList(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 图片操作 |
|
|
|
|
handleOpenFile() { |
|
|
|
|
this.$refs.fileInput.click(); |
|
|
|
|
}, |
|
|
|
|
handleFileChange(e) { |
|
|
|
|
const files = e.target.files || []; |
|
|
|
|
for (let file of files) { |
|
|
|
|
if (!file.type.startsWith("image/")) continue; |
|
|
|
|
const url = URL.createObjectURL(file); |
|
|
|
|
this.imgList.push({ id: Date.now(), url }); |
|
|
|
|
} |
|
|
|
|
e.target.value = ""; |
|
|
|
|
}, |
|
|
|
|
handleDeleteImg(row) { |
|
|
|
|
this.$confirm("确定删除该影像?").then(() => { |
|
|
|
|
this.imgList = this.imgList.filter((i) => i.id !== row.id); |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 根据路由参数获取病例数据 |
|
|
|
|
getReportInfo(id) { |
|
|
|
|
if (id) { |
|
|
|
|
@ -625,7 +646,7 @@ export default { |
|
|
|
|
getReviewers() { |
|
|
|
|
postReportViewers().then((res) => { |
|
|
|
|
if (res.code === 200) { |
|
|
|
|
this.form.reviewersList = res.data; |
|
|
|
|
this.reviewersList = res.data; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
@ -633,18 +654,6 @@ export default { |
|
|
|
|
handlePrint() { |
|
|
|
|
this.printDialogVisible = true; // 打开打印预览弹窗 |
|
|
|
|
}, |
|
|
|
|
// 病例操作 |
|
|
|
|
handleSave() { |
|
|
|
|
this.$confirm("您确定暂存病例吗?").then(() => { |
|
|
|
|
this.$message.success("暂存成功"); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleSubmit() { |
|
|
|
|
this.$confirm("提交后不可修改,确定提交?").then(() => { |
|
|
|
|
this.$message.success("提交成功"); |
|
|
|
|
this.caseStatus = "submitted"; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleClose() { |
|
|
|
|
this.$confirm("未保存内容将丢失,确定退出?").then(() => { |
|
|
|
|
this.$router.back(); |
|
|
|
|
@ -655,7 +664,7 @@ export default { |
|
|
|
|
patientName: this.form.patientName, |
|
|
|
|
medicalNo: this.form.medicalNo, |
|
|
|
|
text_comment: this.form.text_comment, |
|
|
|
|
text_conclusion: this.form.text_conclusion, |
|
|
|
|
conclusion: this.form.conclusion, |
|
|
|
|
}; |
|
|
|
|
this.shareDialogVisible = true; |
|
|
|
|
}, |
|
|
|
|
@ -666,30 +675,26 @@ export default { |
|
|
|
|
console.log("分享病例:", this.shareItem, "给:", shareTarget); |
|
|
|
|
} |
|
|
|
|
this.shareDialogVisible = false; |
|
|
|
|
ss; |
|
|
|
|
this.shareItem = null; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 图片操作 |
|
|
|
|
handleOpenFile() { |
|
|
|
|
this.$refs.fileInput.click(); |
|
|
|
|
}, |
|
|
|
|
handleFileChange(e) { |
|
|
|
|
const files = e.target.files || []; |
|
|
|
|
for (let file of files) { |
|
|
|
|
if (!file.type.startsWith("image/")) continue; |
|
|
|
|
const url = URL.createObjectURL(file); |
|
|
|
|
this.imgList.push({ id: Date.now(), url }); |
|
|
|
|
} |
|
|
|
|
e.target.value = ""; |
|
|
|
|
}, |
|
|
|
|
handleDeleteImg(row) { |
|
|
|
|
this.$confirm("确定删除该影像?").then(() => { |
|
|
|
|
this.imgList = this.imgList.filter((i) => i.id !== row.id); |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
// 部位模板列表 |
|
|
|
|
async loadTemplateList() { |
|
|
|
|
try { |
|
|
|
|
const response = await postReportTplList({ |
|
|
|
|
keyword: "", |
|
|
|
|
part_ids: this.form.positions.map((item) => item.level2.id), |
|
|
|
|
}); |
|
|
|
|
this.templateList = response.data || []; |
|
|
|
|
if (this.templateList.length > 0) { |
|
|
|
|
this.templateForm = { ...this.templateList[0] }; |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
console.error("加载模板列表失败:", error); |
|
|
|
|
this.$message.error("加载模板列表失败"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// ====================== 模板核心方法 ====================== |
|
|
|
|
// 部位模板切换 |
|
|
|
|
changeTemplate() { |
|
|
|
|
const target = this.templateList.find( |
|
|
|
|
(t) => t.id === this.templateForm.id |
|
|
|
|
@ -698,31 +703,28 @@ export default { |
|
|
|
|
this.templateForm = { ...target }; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
openTemplateDialog(type) { |
|
|
|
|
this.templateType = type; |
|
|
|
|
this.dialogTitle = type === "add" ? "模板创建" : "模板编辑"; |
|
|
|
|
if (type === "add") { |
|
|
|
|
this.newTemplateForm = { |
|
|
|
|
id: Date.now(), |
|
|
|
|
type: "abdomen-liver", |
|
|
|
|
title: "", |
|
|
|
|
text_comment: "", |
|
|
|
|
text_conclusion: "", |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
this.newTemplateForm = { ...this.templateForm }; |
|
|
|
|
} |
|
|
|
|
// 部位模板-新增/编辑 |
|
|
|
|
openTemplateDialog(form) { |
|
|
|
|
this.newTemplateForm = { ...form }; |
|
|
|
|
this.templateDialogVisible = true; |
|
|
|
|
}, |
|
|
|
|
saveTemplate() { |
|
|
|
|
// 部位模板-保存或编辑 |
|
|
|
|
async saveTemplate() { |
|
|
|
|
if (!this.newTemplateForm.title) { |
|
|
|
|
this.$message.warning("请输入模板标题"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (this.templateType === "add") { |
|
|
|
|
this.templateList.push({ ...this.newTemplateForm }); |
|
|
|
|
this.templateForm = { ...this.newTemplateForm }; |
|
|
|
|
try { |
|
|
|
|
if (this.newTemplateForm.id === null) { |
|
|
|
|
// 新增模板 |
|
|
|
|
const response = await postReportTplCreate(this.newTemplateForm); |
|
|
|
|
const newTemplate = response.data; |
|
|
|
|
this.templateList.unshift(newTemplate); |
|
|
|
|
this.templateForm = { ...newTemplate }; |
|
|
|
|
this.$message.success("创建成功"); |
|
|
|
|
} else { |
|
|
|
|
// 编辑模板 |
|
|
|
|
await postReportTplEdit(this.newTemplateForm); |
|
|
|
|
const index = this.templateList.findIndex( |
|
|
|
|
(t) => t.id === this.newTemplateForm.id |
|
|
|
|
); |
|
|
|
|
@ -730,71 +732,116 @@ export default { |
|
|
|
|
this.templateList.splice(index, 1, { ...this.newTemplateForm }); |
|
|
|
|
this.templateForm = { ...this.newTemplateForm }; |
|
|
|
|
} |
|
|
|
|
this.$message.success("修改成功"); |
|
|
|
|
} |
|
|
|
|
this.$message.success("保存成功"); |
|
|
|
|
this.templateDialogVisible = false; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.error("保存模板失败:", error); |
|
|
|
|
this.$message.error("保存模板失败"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 部位模板-删除 |
|
|
|
|
deleteTemplate() { |
|
|
|
|
if (this.templateList.length <= 1) { |
|
|
|
|
this.$message.warning("至少保留一个模板"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm("确定删除当前模板?").then(() => { |
|
|
|
|
this.$confirm("确定删除当前模板?").then(async () => { |
|
|
|
|
try { |
|
|
|
|
await postReportTplDelete({ id: this.templateForm.id }); |
|
|
|
|
const index = this.templateList.findIndex( |
|
|
|
|
(t) => t.id === this.templateForm.id |
|
|
|
|
); |
|
|
|
|
this.templateList.splice(index, 1); |
|
|
|
|
this.templateForm = { ...this.templateList[0] }; |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.error("删除模板失败:", error); |
|
|
|
|
this.$message.error("删除模板失败"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
applytext_comment() { |
|
|
|
|
this.form.text_comment = this.templateForm.text_comment; |
|
|
|
|
this.$message.success("已应用超声所见"); |
|
|
|
|
// 部位模板-超声所见 |
|
|
|
|
handleComment() { |
|
|
|
|
postReportTplCount({ tpl_id: this.templateForm.id }).then((res) => { |
|
|
|
|
if (res.data) { |
|
|
|
|
this.form.text_comment += this.templateForm.comment; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
applytext_conclusion() { |
|
|
|
|
this.form.text_conclusion = this.templateForm.text_conclusion; |
|
|
|
|
this.$message.success("已应用检查结论"); |
|
|
|
|
// 部位模板-超声结论 |
|
|
|
|
handleCnclusion() { |
|
|
|
|
this.form.text_conclusion += this.templateForm.conclusion; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// ====================== ✅ 片语核心方法(新增) ====================== |
|
|
|
|
// 打开片语弹窗:创建/更新 |
|
|
|
|
openPhraseDialog(type, row) { |
|
|
|
|
this.phraseType = type; |
|
|
|
|
this.phraseDialogTitle = type === "add" ? "片语创建" : "片语更新"; |
|
|
|
|
if (type === "add") { |
|
|
|
|
this.newPhraseForm = { id: Date.now(), content: "" }; |
|
|
|
|
} else { |
|
|
|
|
this.newPhraseForm = { ...row }; |
|
|
|
|
// 片语列表 |
|
|
|
|
async loadPhraseList() { |
|
|
|
|
try { |
|
|
|
|
const response = await postReportPhraseList({}); |
|
|
|
|
this.phraseList = response.data || []; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.error("加载片语列表失败:", error); |
|
|
|
|
this.$message.error("加载片语列表失败"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 片语-新增/修改 |
|
|
|
|
openPhraseDialog(row) { |
|
|
|
|
this.phraseDialogTitle = row.id === null ? "片语创建" : "片语更新"; |
|
|
|
|
this.newPhraseForm = { ...row }; |
|
|
|
|
this.phraseDialogVisible = true; |
|
|
|
|
}, |
|
|
|
|
// 保存片语 |
|
|
|
|
savePhrase() { |
|
|
|
|
if (!this.newPhraseForm.content) { |
|
|
|
|
async savePhrase() { |
|
|
|
|
if (!this.newPhraseForm.phrase) { |
|
|
|
|
this.$message.warning("请输入片语内容"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
if (this.phraseType === "add") { |
|
|
|
|
this.phraseList.push({ ...this.newPhraseForm }); |
|
|
|
|
// 新增片语 |
|
|
|
|
const response = await postReportPhraseEdit(this.newPhraseForm); |
|
|
|
|
const newPhrase = response.data; |
|
|
|
|
this.phraseList.unshift(newPhrase); |
|
|
|
|
this.$message.success("创建成功"); |
|
|
|
|
} else { |
|
|
|
|
// 编辑片语 |
|
|
|
|
await postReportPhraseEdit(this.newPhraseForm); |
|
|
|
|
const index = this.phraseList.findIndex( |
|
|
|
|
(p) => p.id === this.newPhraseForm.id |
|
|
|
|
(p) => p.phrase_id === this.newPhraseForm.phrase_id |
|
|
|
|
); |
|
|
|
|
if (index > -1) { |
|
|
|
|
this.phraseList.splice(index, 1, { ...this.newPhraseForm }); |
|
|
|
|
} |
|
|
|
|
this.$message.success("更新成功"); |
|
|
|
|
} |
|
|
|
|
this.$message.success( |
|
|
|
|
this.phraseType === "add" ? "创建成功" : "更新成功" |
|
|
|
|
); |
|
|
|
|
this.phraseDialogVisible = false; |
|
|
|
|
} catch (error) { |
|
|
|
|
console.error("保存片语失败:", error); |
|
|
|
|
this.$message.error("保存片语失败"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 删除片语 |
|
|
|
|
deletePhrase(row) { |
|
|
|
|
this.$confirm("确定删除该片语?").then(() => { |
|
|
|
|
this.phraseList = this.phraseList.filter((p) => p.id !== row.id); |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
this.$modal |
|
|
|
|
.confirm("是否确认删除当前片语?") |
|
|
|
|
.then(function () { |
|
|
|
|
return postReportPhraseDelete({ phrase_id: row.id }); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.loadPhraseList(); |
|
|
|
|
this.$modal.msgSuccess("删除成功"); |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 病例操作 |
|
|
|
|
handleSave() { |
|
|
|
|
this.$confirm("您确定暂存病例吗?").then(() => { |
|
|
|
|
this.$message.success("暂存成功"); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleSubmit() { |
|
|
|
|
this.$confirm("提交后不可修改,确定提交?").then(() => { |
|
|
|
|
this.$message.success("提交成功"); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
@ -804,7 +851,7 @@ export default { |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
/* 内部滚动区域高度自适应 */ |
|
|
|
|
.report-form { |
|
|
|
|
height: calc(100vh - 285px); |
|
|
|
|
height: calc(100vh - 218px); |
|
|
|
|
overflow-y: auto; |
|
|
|
|
overflow-x: hidden; |
|
|
|
|
width: 100%; |
|
|
|
|
|