|
|
@@ -50,11 +50,7 @@
|
|
|
v-hasPermi="['his:prescribe:edit']">修改
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click=""-->
|
|
|
-<!-- v-hasPermi="['his:prescribe:remove']">删除-->
|
|
|
-<!-- </el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
+
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
|
v-hasPermi="['his:prescribe:export']">导出
|
|
|
@@ -92,6 +88,16 @@
|
|
|
<span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- 处方图片 医生确认过的处方过才展示 否则都展示为空 v-if="scope.row.doctorConfirm == 1" -->
|
|
|
+ <el-table-column label="处方图片" align="center" prop="prescribePic">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-image v-if="scope.row.doctorConfirm == 1"
|
|
|
+ style="width: 100px; height: 100px"
|
|
|
+ :src="scope.row.prescribeImgUrl"
|
|
|
+ :preview-src-list="[scope.row.prescribeImgUrl]">
|
|
|
+ </el-image>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
@@ -566,10 +572,6 @@ export default {
|
|
|
{dictValue: '2', dictLabel: "中药"},
|
|
|
{dictValue: '3', dictLabel: "OTC"}
|
|
|
],
|
|
|
- statusOptions: [
|
|
|
- {dictValue: '0', dictLabel: "未开"},
|
|
|
- {dictValue: '1', dictLabel: "已开"}
|
|
|
- ],
|
|
|
// 常用药品弹窗相关
|
|
|
commonPrescribeDialogVisible: false,
|
|
|
commonPrescribeLoading: false,
|
|
|
@@ -639,19 +641,6 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
prescribeId: undefined
|
|
|
- },
|
|
|
- drugRules: {
|
|
|
- drugName: [{required: true, message: "药品名称不能为空", trigger: "blur"}],
|
|
|
- drugSpec: [{required: true, message: "规格不能为空", trigger: "blur"}],
|
|
|
- usageMethod: [{required: true, message: "使用方法不能为空", trigger: "blur"}],
|
|
|
- usageFrequencyUnit: [{required: true, message: "药品频次不能为空", trigger: "blur"}],
|
|
|
- usagePerUseCount: [{required: true, message: "每次用药数量不能为空", trigger: "blur"}],
|
|
|
- usagePerUseUnit: [{required: true, message: "每次用药单位不能为空", trigger: "blur"}],
|
|
|
- usageDays: [{required: true, message: "天数不能为空", trigger: "blur"}],
|
|
|
- drugPrice: [{required: true, message: "药品单价不能为空", trigger: "blur"}],
|
|
|
- drugNum: [{required: true, message: "药品数量不能为空", trigger: "blur"}],
|
|
|
- drugUnit: [{required: true, message: "药品数量单位不能为空", trigger: "blur"}],
|
|
|
- instructions: [{required: true, message: "药品说明书不能为空", trigger: "blur"}]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
@@ -992,27 +981,55 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- confirmPrescribe() {
|
|
|
- // 检查必填字段
|
|
|
+ async confirmPrescribe() {
|
|
|
+ // 1. 检查必填字段
|
|
|
const missingField = this.getFirstMissingField();
|
|
|
if (missingField) {
|
|
|
this.$message.error(`请填写${missingField}`);
|
|
|
return;
|
|
|
}
|
|
|
- //确认处方的同时保存处方
|
|
|
- this.savePrescribe();
|
|
|
- confirmPrescribe(this.form).then(response => {
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 2. 先保存处方(确保有 prescribeId)
|
|
|
+ await this.savePrescribeOnly(); // 注意:这里不关闭弹窗、不刷新列表
|
|
|
+
|
|
|
+ // 3. 再确认处方
|
|
|
+ const response = await confirmPrescribe(this.form);
|
|
|
if (response.code === 200) {
|
|
|
this.$message.success("确认成功!");
|
|
|
this.open = false;
|
|
|
+ this.getList(); // 只在这里刷新一次
|
|
|
} else {
|
|
|
- this.$message.error(response.message);
|
|
|
+ this.$message.error(response.message || "确认失败");
|
|
|
}
|
|
|
- }).finally(() => {
|
|
|
- this.getList();
|
|
|
- })
|
|
|
+ } catch (error) {
|
|
|
+ console.error('确认处方过程中出错:', error);
|
|
|
+ this.$message.error("操作失败,请重试");
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
+ /** 仅保存处方,不关闭弹窗,不刷新列表 */
|
|
|
+ savePrescribeOnly() {
|
|
|
+ const request = this.form.prescribeId != null
|
|
|
+ ? updatePrescribe(this.form)
|
|
|
+ : addPrescribe(this.form);
|
|
|
+
|
|
|
+ return request.then(response => {
|
|
|
+ // 更新 form 中的 prescribeId(如果是新增)
|
|
|
+ if (!this.form.prescribeId && response.data?.prescribeId) {
|
|
|
+ this.form.prescribeId = response.data.prescribeId;
|
|
|
+ }
|
|
|
+ // 不提示、不关闭、不刷新
|
|
|
+ return response;
|
|
|
+ }).catch(error => {
|
|
|
+ console.error('保存失败:', error);
|
|
|
+ this.$message.error("保存失败,请先保存处方");
|
|
|
+ throw error; // 抛出错误,中断后续确认
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/** 提交按钮操作 */
|
|
|
submitForm() {
|
|
|
// 检查必填字段
|
|
|
@@ -1032,7 +1049,7 @@ export default {
|
|
|
'patientName': '患者姓名',
|
|
|
'patientAge': '患者年龄',
|
|
|
'patientGender': '患者性别',
|
|
|
- // 'weight': '患者体重',
|
|
|
+ 'weight': '患者体重',
|
|
|
'isHistoryAllergic': '是否有过敏史',
|
|
|
'diagnose': '诊断',
|
|
|
'remark': '医嘱'
|