病例库-功能联调/新增

main
ysn 2 weeks ago
parent 20768dc853
commit e62dd368a0
  1. 96
      src/api/cases/index.js
  2. 367
      src/views/cases/detail.vue
  3. 29
      src/views/cases/index.vue

@ -115,11 +115,19 @@ export function postReportInfo(data) {
}
// 审核人
export function postReportViewers(data) {
return request({ url: '/report/reviewers', method: 'post', data })
return request({
url: '/report/reviewers',
method: 'post',
data
})
}
// <EFBFBD>病例库-修改
export function postReportEdit(data) {
return request({ url: '/report/edit', method: 'post', data })
return request({
url: '/report/edit',
method: 'post',
data
})
}
// 修改预约时间
export function postReportTimeSectionEdit(data) {
@ -131,45 +139,81 @@ export function postReportTimeSectionEdit(data) {
}
// 影像文件-新增
export function postReportImageCompress(data) {
return request({ url: '/common/image/compress', method: 'post', data })
return request({
url: '/common/image/compress',
method: 'post',
data
})
}
// 部位模板-列表
export function postReportTplList(data) {
return request({ url: '/report/tpl/list', method: 'post', data })
return request({
url: '/report/tpl/list',
method: 'post',
data
})
}
// 部位模板-新增
export function postReportTplCreate(data) {
return request({ url: '/report/tpl/create', method: 'post', data })
return request({
url: '/report/tpl/create',
method: 'post',
data
})
}
// 部位模板-修改
export function postReportTplEdit(data) {
return request({ url: '/report/tpl/edit', method: 'post', data })
return request({
url: '/report/tpl/edit',
method: 'post',
data
})
}
// 部位模板-删除
export function postReportTplDelete(data) {
return request({ url: '/report/tpl/delete', method: 'post', data })
return request({
url: '/report/tpl/delete',
method: 'post',
data
})
}
// 部位模板-统计
export function postReportTplCount(data) {
return request({ url: '/report/tpl/count', method: 'post', data })
return request({
url: '/report/tpl/count',
method: 'post',
data
})
}
// 片语-列表
export function postReportPhraseList(data) {
return request({ url: '/report/reviewers', method: 'post', data })
}
// // 片语-新增
// export function postReportPhraseCreate(data) {
// return request({ url: '/report/create', method: 'post', data })
// }
// // 部位模板-修改
// export function postReportTplEdit(data) {
// return request({ url: '/report/tpl/edit', method: 'post', data })
// }
// // 部位模板-删除
// export function postReportTplDelete(data) {
// return request({ url: '/report/tpl/delete', method: 'post', data })
// }
// // 部位模板-统计
// export function postReportTplCount(data) {
// return request({ url: '/report/tpl/count', method: 'post', data })
// }
return request({
url: '/report/reviewers',
method: 'post',
data
})
}
// 片语-新增/修改
export function postReportPhraseEdit(data) {
return request({
url: '/report/phrase/edit',
method: 'post',
data
})
}
// 片语-删除
export function postReportPhraseDelete(data) {
return request({
url: '/report/phrase/delete',
method: 'post',
data
})
}
// 片语-统计
export function postReportPhraseCount(data) {
return request({
url: '/report/phrase_count',
method: 'post',
data
})
}

@ -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 });
//
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("加载模板列表失败");
}
e.target.value = "";
},
handleDeleteImg(row) {
this.$confirm("确定删除该影像?").then(() => {
this.imgList = this.imgList.filter((i) => i.id !== row.id);
this.$message.success("删除成功");
});
},
// ====================== ======================
//
changeTemplate() {
const target = this.templateList.find(
(t) => t.id === this.templateForm.id
@ -698,103 +703,145 @@ 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 };
} else {
const index = this.templateList.findIndex(
(t) => t.id === this.newTemplateForm.id
);
if (index > -1) {
this.templateList.splice(index, 1, { ...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
);
if (index > -1) {
this.templateList.splice(index, 1, { ...this.newTemplateForm });
this.templateForm = { ...this.newTemplateForm };
}
this.$message.success("修改成功");
}
this.templateDialogVisible = false;
} catch (error) {
console.error("保存模板失败:", error);
this.$message.error("保存模板失败");
}
this.$message.success("保存成功");
this.templateDialogVisible = false;
},
// -
deleteTemplate() {
if (this.templateList.length <= 1) {
this.$message.warning("至少保留一个模板");
return;
}
this.$confirm("确定删除当前模板?").then(() => {
const index = this.templateList.findIndex(
(t) => t.id === this.templateForm.id
);
this.templateList.splice(index, 1);
this.templateForm = { ...this.templateList[0] };
this.$message.success("删除成功");
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;
}
if (this.phraseType === "add") {
this.phraseList.push({ ...this.newPhraseForm });
} else {
const index = this.phraseList.findIndex(
(p) => p.id === this.newPhraseForm.id
);
if (index > -1) {
this.phraseList.splice(index, 1, { ...this.newPhraseForm });
try {
if (this.phraseType === "add") {
//
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.phrase_id === this.newPhraseForm.phrase_id
);
if (index > -1) {
this.phraseList.splice(index, 1, { ...this.newPhraseForm });
}
this.$message.success("更新成功");
}
this.phraseDialogVisible = false;
} catch (error) {
console.error("保存片语失败:", error);
this.$message.error("保存片语失败");
}
this.$message.success(
this.phraseType === "add" ? "创建成功" : "更新成功"
);
this.phraseDialogVisible = false;
},
//
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%;

@ -287,7 +287,12 @@
show-overflow-tooltip
>
<template slot-scope="scope">
{{ scope.row.positions.map((item) => item.level2.name).join("|") }}
{{
(scope.row.positions.length
? scope.row.positions.map((item) => item.level2.name).join("|") +
"|"
: "") + scope.row.position_text
}}
</template>
</el-table-column>
<el-table-column
@ -608,17 +613,18 @@
filterable
clearable
>
<el-option-group
v-for="group in templatesList"
:key="group.id"
:label="group.name"
>
<el-option-group v-for="group in templatesList" :key="group.id">
<el-option
v-for="item in group.child"
:key="item.id"
:label="item.name"
:value="item.id"
/>
>
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">
{{ group.name }}
</span>
</el-option>
</el-option-group>
</el-select>
</el-form-item>
@ -968,7 +974,9 @@ export default {
},
//
loadTemplateTree() {
postReportTemplateTree({})
postReportTemplateTree({
owner_id: 0,
})
.then((response) => {
if (response.code === 200 && response.data) {
this.templatesList = response.data;
@ -1177,7 +1185,10 @@ export default {
},
//
handleView(row) {
this.$tab.openPage(row.patient_name + "-" + row.id, "/cases/detail/" + row.id);
this.$tab.openPage(
row.patient_name + "-" + row.id,
"/cases/detail/" + row.id
);
},
},
};

Loading…
Cancel
Save