|
@@ -0,0 +1,262 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="医生建议及处置"
|
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
|
+ width="800px"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ @close="handleClose"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form :model="formData" :rules="formRules" ref="adviceForm" label-width="150px">
|
|
|
|
|
+ <!-- 诊断 -->
|
|
|
|
|
+ <el-form-item label="诊断" prop="diagnose">
|
|
|
|
|
+ <el-input v-model="formData.diagnose" type="textarea" :rows="2" placeholder="请输入诊断信息" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <!-- 舌诊、面诊、手诊 -->
|
|
|
|
|
+ <el-form-item label="舌诊、面诊、手诊" prop="facialDiagnosis">
|
|
|
|
|
+ <el-input v-model="formData.facialDiagnosis" type="textarea" :rows="2" placeholder="请输入舌诊、面诊、手诊结果" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <!-- 治疗方面(动态表格) -->
|
|
|
|
|
+ <el-form-item label="治疗方面" prop="healingList" required>
|
|
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-plus" @click="addHealingRow">新增一行</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-table :data="formData.healingList" border stripe>
|
|
|
|
|
+ <el-table-column label="诊断内容" prop="diagnosisContent" min-width="200">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input v-model="scope.row.diagnosisContent" placeholder="请输入诊断内容" size="small" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="建议治疗" prop="suggestTreatment" min-width="200">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input v-model="scope.row.suggestTreatment" placeholder="请输入建议治疗" size="small" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" width="80" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button type="text" icon="el-icon-delete" style="color: #f56c6c;" @click="removeHealingRow(scope.$index)">删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <!-- 注意禁忌 -->
|
|
|
|
|
+ <el-form-item label="注意禁忌" prop="noteTaboos">
|
|
|
|
|
+ <el-input v-model="formData.noteTaboos" type="textarea" :rows="2" placeholder="请输入注意事项及禁忌" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-divider content-position="left">医生及药师信息</el-divider>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="医生职称">
|
|
|
|
|
+ <el-input v-model="signInfo.doctorPosition" readonly disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="执业医师证号">
|
|
|
|
|
+ <el-input :value="displayLicenseNumber" readonly disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="药师签字">
|
|
|
|
|
+ <div v-if="signInfo.drugDoctorSignUrl" style="display: flex; align-items: center;">
|
|
|
|
|
+ <el-image :src="signInfo.drugDoctorSignUrl" style="width: 100px; height: 40px;" fit="contain" />
|
|
|
|
|
+ <span style="margin-left: 8px; color: #909399;">(药师:{{ signInfo.drugDoctorName || '' }})</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-input v-else :value="signInfo.drugDoctorName || '暂无药师签名'" readonly disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="执业医师签字">
|
|
|
|
|
+ <div v-if="signInfo.doctorSignUrl" style="display: flex; align-items: center;">
|
|
|
|
|
+ <el-image :src="signInfo.doctorSignUrl" style="width: 100px; height: 40px;" fit="contain" />
|
|
|
|
|
+ <span style="margin-left: 8px; color: #909399;">(医生:{{ signInfo.doctorName || '' }})</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-input v-else :value="signInfo.doctorName || '暂无医生签名'" readonly disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" :loading="submitLoading" @click="submitAdvice">确 定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import { getDoctorSignInfo, submitDoctorAdvice } from "@/api/his/scrmPrescribe";
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: "DoctorAdviceDialog",
|
|
|
|
|
+ props: {
|
|
|
|
|
+ visible: {
|
|
|
|
|
+ type: Boolean,
|
|
|
|
|
+ default: false
|
|
|
|
|
+ },
|
|
|
|
|
+ prescribeId: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: null
|
|
|
|
|
+ },
|
|
|
|
|
+ doctorId: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: null
|
|
|
|
|
+ },
|
|
|
|
|
+ drugDoctorId: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: null
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ dialogVisible: false,
|
|
|
|
|
+ submitLoading: false,
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ diagnose: '',
|
|
|
|
|
+ facialDiagnosis: '',
|
|
|
|
|
+ healingList: [],
|
|
|
|
|
+ noteTaboos: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ formRules: {
|
|
|
|
|
+ diagnose: [{ required: true, message: '请输入诊断', trigger: 'blur' }],
|
|
|
|
|
+ facialDiagnosis: [{ required: true, message: '请输入舌诊、面诊、手诊信息', trigger: 'blur' }],
|
|
|
|
|
+ noteTaboos: [{ required: true, message: '请输入注意禁忌', trigger: 'blur' }],
|
|
|
|
|
+ healingList: [{ validator: (rule, value, callback) => {
|
|
|
|
|
+ if (!value || value.length === 0) {
|
|
|
|
|
+ callback(new Error('请至少添加一行治疗方面数据'));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const invalid = value.some(item => !item.diagnosisContent || !item.suggestTreatment);
|
|
|
|
|
+ if (invalid) {
|
|
|
|
|
+ callback(new Error('请完整填写治疗方面每行的诊断内容和建议治疗'));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }, trigger: 'change' }]
|
|
|
|
|
+ },
|
|
|
|
|
+ signInfo: {
|
|
|
|
|
+ doctorPosition: '', // 职称
|
|
|
|
|
+ doctorPractiseCode: '', // 执业证号
|
|
|
|
|
+ doctorCertificateCode: '', // 医师证号
|
|
|
|
|
+ doctorName: '',
|
|
|
|
|
+ drugDoctorName: '',
|
|
|
|
|
+ doctorSignUrl: '',
|
|
|
|
|
+ drugDoctorSignUrl: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ // 优先显示执业证号,若为空则显示医师证号
|
|
|
|
|
+ displayLicenseNumber() {
|
|
|
|
|
+ return this.signInfo.doctorPractiseCode || this.signInfo.doctorCertificateCode || '暂无证号';
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ visible(val) {
|
|
|
|
|
+ this.dialogVisible = val;
|
|
|
|
|
+ if (val) {
|
|
|
|
|
+ if (!this.prescribeId) {
|
|
|
|
|
+ this.$message.error('处方ID无效,请刷新页面重试');
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
|
+ this.$emit('update:visible', false);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.resetFormData();
|
|
|
|
|
+ this.fetchSignInfo();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ resetFormData() {
|
|
|
|
|
+ this.formData = {
|
|
|
|
|
+ diagnose: '',
|
|
|
|
|
+ facialDiagnosis: '',
|
|
|
|
|
+ healingList: [],
|
|
|
|
|
+ noteTaboos: ''
|
|
|
|
|
+ };
|
|
|
|
|
+ this.addHealingRow();
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ if (this.$refs.adviceForm) {
|
|
|
|
|
+ this.$refs.adviceForm.clearValidate();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ addHealingRow() {
|
|
|
|
|
+ this.formData.healingList.push({
|
|
|
|
|
+ diagnosisContent: '',
|
|
|
|
|
+ suggestTreatment: ''
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ removeHealingRow(index) {
|
|
|
|
|
+ if (this.formData.healingList.length === 1) {
|
|
|
|
|
+ this.$message.warning('至少保留一行治疗数据');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.formData.healingList.splice(index, 1);
|
|
|
|
|
+ },
|
|
|
|
|
+ fetchSignInfo() {
|
|
|
|
|
+ const ids = [];
|
|
|
|
|
+ if (this.doctorId) ids.push(this.doctorId);
|
|
|
|
|
+ if (this.drugDoctorId) ids.push(this.drugDoctorId);
|
|
|
|
|
+ if (ids.length === 0) {
|
|
|
|
|
+ this.$message.warning('缺少医生或药师信息,无法获取签名');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ getDoctorSignInfo(ids).then(response => {
|
|
|
|
|
+ const data = response.data;
|
|
|
|
|
+ this.signInfo = {
|
|
|
|
|
+ doctorPosition: data.position || '',
|
|
|
|
|
+ doctorPractiseCode: data.PractiseCode || '',
|
|
|
|
|
+ doctorCertificateCode: data.certificateCode || '',
|
|
|
|
|
+ doctorName: data.doctorName || '',
|
|
|
|
|
+ drugDoctorName: data.drugDoctorName || '',
|
|
|
|
|
+ doctorSignUrl: data.doctorSignUrl || '',
|
|
|
|
|
+ drugDoctorSignUrl: data.drugDoctorSignUrl || ''
|
|
|
|
|
+ };
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ console.error('获取签名信息失败', error);
|
|
|
|
|
+ this.$message.error('获取医生签名信息失败');
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ submitAdvice() {
|
|
|
|
|
+ if (!this.prescribeId) {
|
|
|
|
|
+ this.$message.error('处方ID无效,无法提交');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$refs.adviceForm.validate((valid) => {
|
|
|
|
|
+ if (!valid) return;
|
|
|
|
|
+ const healingAreaJson = JSON.stringify(this.formData.healingList);
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ prescribeId: this.prescribeId,
|
|
|
|
|
+ diagnose: this.formData.diagnose,
|
|
|
|
|
+ facialDiagnosis: this.formData.facialDiagnosis,
|
|
|
|
|
+ healingAreaJson: healingAreaJson,
|
|
|
|
|
+ noteTaboos: this.formData.noteTaboos
|
|
|
|
|
+ };
|
|
|
|
|
+ this.submitLoading = true;
|
|
|
|
|
+ submitDoctorAdvice(params).then(() => {
|
|
|
|
|
+ this.$message.success('处方建议提交成功');
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
|
+ this.$emit('success');
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ console.error('提交失败', error);
|
|
|
|
|
+ this.$message.error('提交失败,请重试');
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.submitLoading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleClose() {
|
|
|
|
|
+ this.$emit('update:visible', false);
|
|
|
|
|
+ this.$emit('close');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+.dialog-footer {
|
|
|
|
|
+ text-align: right;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|