|
@@ -1,10 +1,18 @@
|
|
|
<template>
|
|
<template>
|
|
|
<el-dialog title="医生开方" :visible.sync="dialogVisible" width="95%" top="5vh" :close-on-click-modal="false" @close="handleClose" append-to-body>
|
|
<el-dialog title="医生开方" :visible.sync="dialogVisible" width="95%" top="5vh" :close-on-click-modal="false" @close="handleClose" append-to-body>
|
|
|
- <!-- 步骤导航 -->
|
|
|
|
|
|
|
+ <!-- 步骤导航,带类型提示 -->
|
|
|
<el-steps :active="activeStep" finish-status="success" align-center style="margin-bottom: 30px;">
|
|
<el-steps :active="activeStep" finish-status="success" align-center style="margin-bottom: 30px;">
|
|
|
<el-step title="选择处方类型" />
|
|
<el-step title="选择处方类型" />
|
|
|
- <el-step title="填写处方内容" />
|
|
|
|
|
- <el-step v-if="isCombined && secondPartActive" title="填写另一部分处方" />
|
|
|
|
|
|
|
+ <el-step title="填写处方内容">
|
|
|
|
|
+ <template slot="title" v-if="isCombined && activeStep === 1">
|
|
|
|
|
+ <span>填写处方内容(<span style="color: #409EFF;">西药处方</span>)</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-step>
|
|
|
|
|
+ <el-step v-if="isCombined && secondPartActive" title="填写中药处方">
|
|
|
|
|
+ <template slot="title">
|
|
|
|
|
+ <span>填写中药处方(<span style="color: #67C23A;">中药处方</span>)</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-step>
|
|
|
</el-steps>
|
|
</el-steps>
|
|
|
|
|
|
|
|
<!-- 步骤1:选择处方类型 -->
|
|
<!-- 步骤1:选择处方类型 -->
|
|
@@ -96,7 +104,7 @@
|
|
|
<pagination v-show="drugTotal > 0" :total="drugTotal" :page.sync="drugQuery.pageNum" :limit.sync="drugQuery.pageSize" @pagination="getDrugList" />
|
|
<pagination v-show="drugTotal > 0" :total="drugTotal" :page.sync="drugQuery.pageNum" :limit.sync="drugQuery.pageSize" @pagination="getDrugList" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 右侧处方图片渲染(支持滚动,采用绝对定位样式) -->
|
|
|
|
|
|
|
+ <!-- 右侧处方图片渲染 -->
|
|
|
<div class="drug-right-panel">
|
|
<div class="drug-right-panel">
|
|
|
<div class="prescription-scroll-wrapper">
|
|
<div class="prescription-scroll-wrapper">
|
|
|
<div v-if="prescribeForm.prescribeImgUrl" class="real-prescription-wrapper">
|
|
<div v-if="prescribeForm.prescribeImgUrl" class="real-prescription-wrapper">
|
|
@@ -105,7 +113,7 @@
|
|
|
<div v-else class="prescription-preview-container">
|
|
<div v-else class="prescription-preview-container">
|
|
|
<img src="/ysy_prescribe.jpg" class="prescription-bg-image" alt="处方背景" />
|
|
<img src="/ysy_prescribe.jpg" class="prescription-bg-image" alt="处方背景" />
|
|
|
<div class="prescription-overlay">
|
|
<div class="prescription-overlay">
|
|
|
- <div class="prescribe-code">{{ prescribeForm.prescribeCode}}</div>
|
|
|
|
|
|
|
+ <div class="prescribe-code">{{ prescribeForm.prescribeCode }}</div>
|
|
|
<div class="patient-info">
|
|
<div class="patient-info">
|
|
|
<div class="prescribe-patientName">{{ prescribeForm.patientName }}</div>
|
|
<div class="prescribe-patientName">{{ prescribeForm.patientName }}</div>
|
|
|
<div class="prescribe-patientGender">{{ patientGenderText }}</div>
|
|
<div class="prescribe-patientGender">{{ patientGenderText }}</div>
|
|
@@ -128,10 +136,10 @@
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 步骤3(组合处方专用) -->
|
|
|
|
|
|
|
+ <!-- 步骤3(组合处方专用:中药处方) -->
|
|
|
<div v-show="activeStep === 2 && isCombined">
|
|
<div v-show="activeStep === 2 && isCombined">
|
|
|
<el-tabs v-model="secondActiveTab" type="border-card">
|
|
<el-tabs v-model="secondActiveTab" type="border-card">
|
|
|
- <el-tab-pane label="另一部分处方" name="drugSecond">
|
|
|
|
|
|
|
+ <el-tab-pane label="中药处方" name="drugSecond">
|
|
|
<div class="drug-split-layout">
|
|
<div class="drug-split-layout">
|
|
|
<div class="drug-left-panel">
|
|
<div class="drug-left-panel">
|
|
|
<el-form label-width="80px">
|
|
<el-form label-width="80px">
|
|
@@ -193,8 +201,9 @@
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
|
<el-button v-if="activeStep === 0" type="primary" @click="nextStep" :disabled="!selectedPrescribeType">下一步</el-button>
|
|
<el-button v-if="activeStep === 0" type="primary" @click="nextStep" :disabled="!selectedPrescribeType">下一步</el-button>
|
|
|
- <el-button v-if="activeStep === 1" type="primary" @click="submitCurrentPart" :loading="submitLoading">确认处方</el-button>
|
|
|
|
|
- <el-button v-if="activeStep === 2 && isCombined" type="primary" @click="submitSecondPart" :loading="submitLoading">确认另一部分处方</el-button>
|
|
|
|
|
|
|
+ <el-button v-if="activeStep === 1 && isCombined" type="primary" @click="goToSecondPart" :loading="submitLoading">下一步</el-button>
|
|
|
|
|
+ <el-button v-if="activeStep === 1 && !isCombined" type="primary" @click="submitCurrentPart" :loading="submitLoading">确认处方</el-button>
|
|
|
|
|
+ <el-button v-if="activeStep === 2 && isCombined" type="primary" @click="submitSecondPart" :loading="submitLoading">确认中药处方</el-button>
|
|
|
<el-button v-if="activeStep > 0" @click="prevStep">上一步</el-button>
|
|
<el-button v-if="activeStep > 0" @click="prevStep">上一步</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -246,8 +255,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getPrescribeScrmDetail, updatePrescribeScrm, submitPrescribeScrm } from "@/api/his/scrmPrescribe";
|
|
|
|
|
-import { listPrescribeDrug, addPrescribeDrug, updatePrescribeDrug, deletePrescribeDrug } from "@/api/his/prescribeDrug";
|
|
|
|
|
|
|
+import { getPrescribeScrmDetail, submitBasicInfo, submitPrescribeScrm } from "@/api/his/scrmPrescribe";
|
|
|
|
|
+import { listScrmPrescribeDrug,addScrmPrescribeDrug,updateScrmPrescribeDrug,deleteScrmPrescribeDrug } from "@/api/his/scrmPrescribeDrug";
|
|
|
import { getCommonDrugList } from "@/api/commonlyDrug";
|
|
import { getCommonDrugList } from "@/api/commonlyDrug";
|
|
|
import { getCommonDiagnoseList } from '@/api/commonlyDiagnose';
|
|
import { getCommonDiagnoseList } from '@/api/commonlyDiagnose';
|
|
|
|
|
|
|
@@ -284,21 +293,21 @@ export default {
|
|
|
prescribeImgStoreUrl: ''
|
|
prescribeImgStoreUrl: ''
|
|
|
},
|
|
},
|
|
|
basicRules: {
|
|
basicRules: {
|
|
|
- patientName: [{required: true, message: '请输入患者姓名', trigger: 'blur'}],
|
|
|
|
|
- patientAge: [{required: true, message: '请输入患者年龄', trigger: 'blur'}],
|
|
|
|
|
- patientGender: [{required: true, message: '请选择患者性别', trigger: 'change'}],
|
|
|
|
|
- isHistoryAllergic: [{required: true, message: '请选择是否有过敏史', trigger: 'change'}]
|
|
|
|
|
|
|
+ patientName: [{ required: true, message: '请输入患者姓名', trigger: 'blur' }],
|
|
|
|
|
+ patientAge: [{ required: true, message: '请输入患者年龄', trigger: 'blur' }],
|
|
|
|
|
+ patientGender: [{ required: true, message: '请选择患者性别', trigger: 'change' }],
|
|
|
|
|
+ isHistoryAllergic: [{ required: true, message: '请选择是否有过敏史', trigger: 'change' }]
|
|
|
},
|
|
},
|
|
|
drugRules: {
|
|
drugRules: {
|
|
|
- diagnose: [{required: true, message: '请输入诊断', trigger: 'blur'}],
|
|
|
|
|
- remark: [{required: true, message: '请输入医嘱', trigger: 'blur'}]
|
|
|
|
|
|
|
+ diagnose: [{ required: true, message: '请输入诊断', trigger: 'blur' }],
|
|
|
|
|
+ remark: [{ required: true, message: '请输入医嘱', trigger: 'blur' }]
|
|
|
},
|
|
},
|
|
|
drugList: [],
|
|
drugList: [],
|
|
|
drugTotal: 0,
|
|
drugTotal: 0,
|
|
|
- drugQuery: {pageNum: 1, pageSize: 10, prescribeId: null},
|
|
|
|
|
|
|
+ drugQuery: { pageNum: 1, pageSize: 10, prescribeId: null, drugType: null },
|
|
|
secondDrugList: [],
|
|
secondDrugList: [],
|
|
|
secondDrugTotal: 0,
|
|
secondDrugTotal: 0,
|
|
|
- secondDrugQuery: {pageNum: 1, pageSize: 10, prescribeId: null},
|
|
|
|
|
|
|
+ secondDrugQuery: { pageNum: 1, pageSize: 10, prescribeId: null, drugType: 2 },
|
|
|
drugDialogVisible: false,
|
|
drugDialogVisible: false,
|
|
|
drugDialogTitle: '',
|
|
drugDialogTitle: '',
|
|
|
currentDrug: {},
|
|
currentDrug: {},
|
|
@@ -306,11 +315,11 @@ export default {
|
|
|
diagnoseDialogVisible: false,
|
|
diagnoseDialogVisible: false,
|
|
|
commonDiagnoseList: [],
|
|
commonDiagnoseList: [],
|
|
|
diagnoseTotal: 0,
|
|
diagnoseTotal: 0,
|
|
|
- diagnoseQuery: {pageNum: 1, pageSize: 10},
|
|
|
|
|
|
|
+ diagnoseQuery: { pageNum: 1, pageSize: 10 },
|
|
|
commonDrugDialogVisible: false,
|
|
commonDrugDialogVisible: false,
|
|
|
commonDrugList: [],
|
|
commonDrugList: [],
|
|
|
commonDrugTotal: 0,
|
|
commonDrugTotal: 0,
|
|
|
- commonDrugQuery: {pageNum: 1, pageSize: 10, drugName: '', doctorId: null},
|
|
|
|
|
|
|
+ commonDrugQuery: { pageNum: 1, pageSize: 10, drugName: '', doctorId: null },
|
|
|
commonDrugForSecond: false,
|
|
commonDrugForSecond: false,
|
|
|
submitLoading: false,
|
|
submitLoading: false,
|
|
|
isViewMode: false
|
|
isViewMode: false
|
|
@@ -367,6 +376,22 @@ export default {
|
|
|
this.$message.error('获取处方信息失败');
|
|
this.$message.error('获取处方信息失败');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 获取当前步骤对应的药品类型(1:西药, 2:中药)
|
|
|
|
|
+ getCurrentDrugType() {
|
|
|
|
|
+ if (this.commonDrugForSecond) {
|
|
|
|
|
+ return 2; // 组合处方的第二部分(中药)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.isCombined && !this.secondPartActive && this.activeStep === 1) {
|
|
|
|
|
+ return 1; // 组合处方第一步(西药)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.isCombined && this.secondPartActive && this.activeStep === 2) {
|
|
|
|
|
+ return 2; // 组合处方第二步(中药)
|
|
|
|
|
+ }
|
|
|
|
|
+ // 非组合处方
|
|
|
|
|
+ if (this.selectedPrescribeType === 1) return 1;
|
|
|
|
|
+ if (this.selectedPrescribeType === 2) return 2;
|
|
|
|
|
+ return 1; // 默认西药
|
|
|
|
|
+ },
|
|
|
onPrescribeTypeChange(val) {
|
|
onPrescribeTypeChange(val) {
|
|
|
this.isCombined = (val === 3);
|
|
this.isCombined = (val === 3);
|
|
|
if (!this.isCombined) this.secondPartActive = false;
|
|
if (!this.isCombined) this.secondPartActive = false;
|
|
@@ -384,7 +409,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
prevStep() {
|
|
prevStep() {
|
|
|
- if (this.activeStep > 0) this.activeStep--;
|
|
|
|
|
|
|
+ if (this.activeStep > 0) {
|
|
|
|
|
+ this.activeStep--;
|
|
|
|
|
+ if (this.activeStep === 1 && this.isCombined) {
|
|
|
|
|
+ this.loadDrugsForCurrentPart();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
loadDrugsForCurrentPart() {
|
|
loadDrugsForCurrentPart() {
|
|
|
if (!this.prescribeId) return;
|
|
if (!this.prescribeId) return;
|
|
@@ -395,35 +425,82 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getDrugList() {
|
|
getDrugList() {
|
|
|
|
|
+ // 确定当前要查询的药品类型
|
|
|
|
|
+ let drugType = null;
|
|
|
|
|
+ if (this.isCombined && !this.secondPartActive) {
|
|
|
|
|
+ drugType = 1; // 组合处方第一步,西药
|
|
|
|
|
+ } else if (this.selectedPrescribeType === 1) {
|
|
|
|
|
+ drugType = 1;
|
|
|
|
|
+ } else if (this.selectedPrescribeType === 2) {
|
|
|
|
|
+ drugType = 2;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ drugType = this.selectedPrescribeType;
|
|
|
|
|
+ }
|
|
|
this.drugQuery.prescribeId = this.prescribeId;
|
|
this.drugQuery.prescribeId = this.prescribeId;
|
|
|
- listPrescribeDrug(this.drugQuery).then(res => {
|
|
|
|
|
|
|
+ this.drugQuery.drugType = drugType;
|
|
|
|
|
+ listScrmPrescribeDrug(this.drugQuery).then(res => {
|
|
|
this.drugList = res.rows || [];
|
|
this.drugList = res.rows || [];
|
|
|
this.drugTotal = res.total || 0;
|
|
this.drugTotal = res.total || 0;
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message.error('获取药品列表失败');
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
getSecondDrugList() {
|
|
getSecondDrugList() {
|
|
|
- if (this.secondDrugQuery.prescribeId !== this.prescribeId) {
|
|
|
|
|
- this.secondDrugQuery.prescribeId = this.prescribeId;
|
|
|
|
|
|
|
+ this.secondDrugQuery.prescribeId = this.prescribeId;
|
|
|
|
|
+ this.secondDrugQuery.drugType = 2;
|
|
|
|
|
+ listScrmPrescribeDrug(this.secondDrugQuery).then(res => {
|
|
|
|
|
+ this.secondDrugList = res.rows || [];
|
|
|
|
|
+ this.secondDrugTotal = res.total || 0;
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message.error('获取中药列表失败');
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ async goToSecondPart() {
|
|
|
|
|
+ let valid = true;
|
|
|
|
|
+ await this.$refs.basicForm.validate().catch(() => valid = false);
|
|
|
|
|
+ await this.$refs.drugForm.validate().catch(() => valid = false);
|
|
|
|
|
+ if (!valid) return;
|
|
|
|
|
+ if (this.drugList.length === 0) {
|
|
|
|
|
+ this.$message.warning('请至少添加一种西药药品');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.submitLoading = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ await submitBasicInfo(this.prescribeId, {
|
|
|
|
|
+ diagnose: this.prescribeForm.diagnose,
|
|
|
|
|
+ remark: this.prescribeForm.remark,
|
|
|
|
|
+ isHistoryAllergic: this.prescribeForm.isHistoryAllergic,
|
|
|
|
|
+ historyAllergic: this.prescribeForm.historyAllergic
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$message.success('西药处方信息已保存');
|
|
|
|
|
+ this.secondPartActive = true;
|
|
|
|
|
+ this.activeStep = 2;
|
|
|
|
|
+ this.getSecondDrugList();
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.$message.error('保存失败');
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ this.submitLoading = false;
|
|
|
}
|
|
}
|
|
|
- // TODO: 实际应调用带 drugType 参数的接口,此处简化
|
|
|
|
|
},
|
|
},
|
|
|
handleAddDrug() {
|
|
handleAddDrug() {
|
|
|
this.isEditingSecond = false;
|
|
this.isEditingSecond = false;
|
|
|
- this.currentDrug = {drugType: this.selectedPrescribeType === 1 ? 1 : 2};
|
|
|
|
|
- this.drugDialogTitle = '新增药品';
|
|
|
|
|
|
|
+ this.currentDrug = { drugType: 1 };
|
|
|
|
|
+ this.drugDialogTitle = '新增药品(西药)';
|
|
|
this.drugDialogVisible = true;
|
|
this.drugDialogVisible = true;
|
|
|
},
|
|
},
|
|
|
handleEditDrug(row) {
|
|
handleEditDrug(row) {
|
|
|
this.isEditingSecond = false;
|
|
this.isEditingSecond = false;
|
|
|
- this.currentDrug = {...row};
|
|
|
|
|
|
|
+ this.currentDrug = { ...row };
|
|
|
this.drugDialogTitle = '编辑药品';
|
|
this.drugDialogTitle = '编辑药品';
|
|
|
this.drugDialogVisible = true;
|
|
this.drugDialogVisible = true;
|
|
|
},
|
|
},
|
|
|
handleDeleteDrug(row) {
|
|
handleDeleteDrug(row) {
|
|
|
this.$confirm('确认删除该药品吗?').then(() => {
|
|
this.$confirm('确认删除该药品吗?').then(() => {
|
|
|
- deletePrescribeDrug(row.drugId).then(() => {
|
|
|
|
|
|
|
+ deleteScrmPrescribeDrug(row.drugId).then(() => {
|
|
|
this.$message.success('删除成功');
|
|
this.$message.success('删除成功');
|
|
|
this.getDrugList();
|
|
this.getDrugList();
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message.error('删除失败');
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -433,7 +510,7 @@ export default {
|
|
|
this.$message.warning('请填写药品名称');
|
|
this.$message.warning('请填写药品名称');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const request = this.currentDrug.drugId ? updatePrescribeDrug(this.currentDrug) : addPrescribeDrug(this.currentDrug);
|
|
|
|
|
|
|
+ const request = this.currentDrug.drugId ? updateScrmPrescribeDrug(this.currentDrug) : addScrmPrescribeDrug(this.currentDrug);
|
|
|
request.then(() => {
|
|
request.then(() => {
|
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
|
this.drugDialogVisible = false;
|
|
this.drugDialogVisible = false;
|
|
@@ -448,21 +525,23 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleAddDrugSecond() {
|
|
handleAddDrugSecond() {
|
|
|
this.isEditingSecond = true;
|
|
this.isEditingSecond = true;
|
|
|
- this.currentDrug = {drugType: 2};
|
|
|
|
|
- this.drugDialogTitle = '新增药品(另一部分)';
|
|
|
|
|
|
|
+ this.currentDrug = { drugType: 2 };
|
|
|
|
|
+ this.drugDialogTitle = '新增药品(中药)';
|
|
|
this.drugDialogVisible = true;
|
|
this.drugDialogVisible = true;
|
|
|
},
|
|
},
|
|
|
handleEditDrugSecond(row) {
|
|
handleEditDrugSecond(row) {
|
|
|
this.isEditingSecond = true;
|
|
this.isEditingSecond = true;
|
|
|
- this.currentDrug = {...row};
|
|
|
|
|
|
|
+ this.currentDrug = { ...row };
|
|
|
this.drugDialogTitle = '编辑药品';
|
|
this.drugDialogTitle = '编辑药品';
|
|
|
this.drugDialogVisible = true;
|
|
this.drugDialogVisible = true;
|
|
|
},
|
|
},
|
|
|
handleDeleteDrugSecond(row) {
|
|
handleDeleteDrugSecond(row) {
|
|
|
this.$confirm('确认删除该药品吗?').then(() => {
|
|
this.$confirm('确认删除该药品吗?').then(() => {
|
|
|
- deletePrescribeDrug(row.drugId).then(() => {
|
|
|
|
|
|
|
+ deleteScrmPrescribeDrug(row.drugId).then(() => {
|
|
|
this.$message.success('删除成功');
|
|
this.$message.success('删除成功');
|
|
|
this.getSecondDrugList();
|
|
this.getSecondDrugList();
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message.error('删除失败');
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -504,26 +583,32 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
applyCommonDrug(drug) {
|
|
applyCommonDrug(drug) {
|
|
|
|
|
+ // 明确当前药品类型
|
|
|
|
|
+ const drugType = this.getCurrentDrugType();
|
|
|
const newDrug = {
|
|
const newDrug = {
|
|
|
drugName: drug.drugName,
|
|
drugName: drug.drugName,
|
|
|
drugSpec: drug.drugSpec,
|
|
drugSpec: drug.drugSpec,
|
|
|
usageMethod: drug.usageMethod,
|
|
usageMethod: drug.usageMethod,
|
|
|
usageFrequencyUnit: drug.usageFrequencyUnit,
|
|
usageFrequencyUnit: drug.usageFrequencyUnit,
|
|
|
usagePerUseCount: drug.usagePerUseCount,
|
|
usagePerUseCount: drug.usagePerUseCount,
|
|
|
- usagePerUseUnit: '',
|
|
|
|
|
|
|
+ usagePerUseUnit: drug.usagePerUseUnit || '',
|
|
|
prescribeId: this.prescribeId,
|
|
prescribeId: this.prescribeId,
|
|
|
- drugType: this.selectedPrescribeType === 1 ? 1 : 2
|
|
|
|
|
|
|
+ drugType: drugType
|
|
|
};
|
|
};
|
|
|
- addPrescribeDrug(newDrug).then(() => {
|
|
|
|
|
|
|
+ addScrmPrescribeDrug(newDrug).then(() => {
|
|
|
this.$message.success('添加成功');
|
|
this.$message.success('添加成功');
|
|
|
|
|
+ // 添加成功后重置分页为第一页并刷新对应列表
|
|
|
if (!this.commonDrugForSecond) {
|
|
if (!this.commonDrugForSecond) {
|
|
|
|
|
+ this.drugQuery.pageNum = 1;
|
|
|
this.getDrugList();
|
|
this.getDrugList();
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ this.secondDrugQuery.pageNum = 1;
|
|
|
this.getSecondDrugList();
|
|
this.getSecondDrugList();
|
|
|
}
|
|
}
|
|
|
this.commonDrugDialogVisible = false;
|
|
this.commonDrugDialogVisible = false;
|
|
|
- }).catch(() => {
|
|
|
|
|
- this.$message.error('添加失败');
|
|
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ console.error('添加常用药品失败', error);
|
|
|
|
|
+ this.$message.error('添加药品失败,请重试');
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
async submitCurrentPart() {
|
|
async submitCurrentPart() {
|
|
@@ -535,31 +620,11 @@ export default {
|
|
|
this.$message.warning('请至少添加一种药品');
|
|
this.$message.warning('请至少添加一种药品');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (this.isCombined && !this.secondPartActive) {
|
|
|
|
|
- this.submitLoading = true;
|
|
|
|
|
- try {
|
|
|
|
|
- await updatePrescribeScrm(this.prescribeId, {
|
|
|
|
|
- diagnose: this.prescribeForm.diagnose,
|
|
|
|
|
- remark: this.prescribeForm.remark,
|
|
|
|
|
- isHistoryAllergic: this.prescribeForm.isHistoryAllergic,
|
|
|
|
|
- historyAllergic: this.prescribeForm.historyAllergic
|
|
|
|
|
- });
|
|
|
|
|
- this.$message.success('第一部分信息已保存,请继续填写第二部分');
|
|
|
|
|
- this.secondPartActive = true;
|
|
|
|
|
- this.activeStep = 2;
|
|
|
|
|
- this.getSecondDrugList();
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- this.$message.error('保存失败');
|
|
|
|
|
- } finally {
|
|
|
|
|
- this.submitLoading = false;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.submitFullPrescribe();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.submitFullPrescribe();
|
|
|
},
|
|
},
|
|
|
submitSecondPart() {
|
|
submitSecondPart() {
|
|
|
if (this.secondDrugList.length === 0) {
|
|
if (this.secondDrugList.length === 0) {
|
|
|
- this.$message.warning('请至少添加一种药品');
|
|
|
|
|
|
|
+ this.$message.warning('请至少添加一种中药药品');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.submitFullPrescribe(true);
|
|
this.submitFullPrescribe(true);
|
|
@@ -576,9 +641,16 @@ export default {
|
|
|
isHistoryAllergic: this.prescribeForm.isHistoryAllergic,
|
|
isHistoryAllergic: this.prescribeForm.isHistoryAllergic,
|
|
|
historyAllergic: this.prescribeForm.historyAllergic,
|
|
historyAllergic: this.prescribeForm.historyAllergic,
|
|
|
diagnose: this.prescribeForm.diagnose,
|
|
diagnose: this.prescribeForm.diagnose,
|
|
|
- remark: this.prescribeForm.remark,
|
|
|
|
|
- drugs: this.isCombined ? [...this.drugList, ...this.secondDrugList] : this.drugList
|
|
|
|
|
|
|
+ remark: this.prescribeForm.remark
|
|
|
};
|
|
};
|
|
|
|
|
+ if (this.isCombined) {
|
|
|
|
|
+ params.mapDrugs = {
|
|
|
|
|
+ 1: this.drugList,
|
|
|
|
|
+ 2: this.secondDrugList
|
|
|
|
|
+ };
|
|
|
|
|
+ } else {
|
|
|
|
|
+ params.drugs = this.drugList;
|
|
|
|
|
+ }
|
|
|
await submitPrescribeScrm(params);
|
|
await submitPrescribeScrm(params);
|
|
|
this.$message.success('处方提交成功');
|
|
this.$message.success('处方提交成功');
|
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
@@ -598,7 +670,6 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
-/* 左右分栏布局 */
|
|
|
|
|
.drug-split-layout {
|
|
.drug-split-layout {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
gap: 20px;
|
|
gap: 20px;
|
|
@@ -613,17 +684,25 @@ export default {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
max-height: 70vh;
|
|
max-height: 70vh;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.prescription-scroll-wrapper {
|
|
.prescription-scroll-wrapper {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- min-height: 100%;
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.prescription-preview-container {
|
|
.prescription-preview-container {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
|
+ max-width: 500px;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
background: #f5f5f5;
|
|
background: #f5f5f5;
|
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
@@ -632,9 +711,9 @@ export default {
|
|
|
.prescription-bg-image {
|
|
.prescription-bg-image {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
display: block;
|
|
display: block;
|
|
|
|
|
+ height: auto;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 覆盖层 - 绝对定位所有文字内容 */
|
|
|
|
|
.prescription-overlay {
|
|
.prescription-overlay {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
top: 0;
|
|
top: 0;
|
|
@@ -646,7 +725,6 @@ export default {
|
|
|
pointer-events: none;
|
|
pointer-events: none;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 处方编号 */
|
|
|
|
|
.prescription-overlay .prescribe-code {
|
|
.prescription-overlay .prescribe-code {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
top: 5.6%;
|
|
top: 5.6%;
|
|
@@ -662,15 +740,15 @@ export default {
|
|
|
color: #000;
|
|
color: #000;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 患者信息 */
|
|
|
|
|
.patient-info {
|
|
.patient-info {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- top: 10%; /* 相对于容器高度 */
|
|
|
|
|
|
|
+ top: 10%;
|
|
|
left: 0;
|
|
left: 0;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- height: 4%; /* 估算高度 */
|
|
|
|
|
|
|
+ height: 4%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.prescribe-patientName {
|
|
.prescribe-patientName {
|
|
|
flex: 2;
|
|
flex: 2;
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -693,11 +771,10 @@ export default {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: flex-start;
|
|
justify-content: flex-start;
|
|
|
- padding-left: 5%; /* 相对于容器宽度 */
|
|
|
|
|
|
|
+ padding-left: 5%;
|
|
|
font-size: clamp(10px, 1.5vw, 14px);
|
|
font-size: clamp(10px, 1.5vw, 14px);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 诊断字段 */
|
|
|
|
|
.prescription-overlay .diagnose {
|
|
.prescription-overlay .diagnose {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
top: 19%;
|
|
top: 19%;
|
|
@@ -711,7 +788,6 @@ export default {
|
|
|
line-height: 1.4;
|
|
line-height: 1.4;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 药品列表字段 - 可滚动 */
|
|
|
|
|
.prescription-overlay .drugs {
|
|
.prescription-overlay .drugs {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
top: 27%;
|
|
top: 27%;
|
|
@@ -733,7 +809,6 @@ export default {
|
|
|
color: #666;
|
|
color: #666;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 医嘱字段 */
|
|
|
|
|
.prescription-overlay .remark {
|
|
.prescription-overlay .remark {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
top: 52%;
|
|
top: 52%;
|
|
@@ -747,15 +822,16 @@ export default {
|
|
|
line-height: 1.4;
|
|
line-height: 1.4;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 真实处方图片容器 */
|
|
|
|
|
.real-prescription-wrapper {
|
|
.real-prescription-wrapper {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- overflow: auto;
|
|
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.real-prescription-wrapper img {
|
|
.real-prescription-wrapper img {
|
|
|
max-width: 100%;
|
|
max-width: 100%;
|
|
|
height: auto;
|
|
height: auto;
|
|
|
|
|
+ object-fit: contain;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.dialog-footer {
|
|
.dialog-footer {
|