|
|
@@ -216,12 +216,43 @@
|
|
|
<el-form-item label="过敏史" prop="historyAllergic">
|
|
|
<el-input v-model="form.historyAllergic" placeholder="请输入过敏史" />
|
|
|
</el-form-item>
|
|
|
+ <!-- 诊断 -->
|
|
|
<el-form-item label="诊断" prop="diagnose">
|
|
|
- <el-input v-model="form.diagnose" placeholder="请输入诊断" />
|
|
|
+ <el-input v-model="form.diagnose" placeholder="请输入诊断">
|
|
|
+ <i
|
|
|
+ slot="suffix"
|
|
|
+ class="el-icon-search el-input__icon"
|
|
|
+ style="cursor: pointer;"
|
|
|
+ @click="handlePrescribeCommonWorlds('diagnose', 1)"
|
|
|
+ ></i>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <!-- 备注 -->
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <el-input
|
|
|
+ v-model="form.remark"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入备注"
|
|
|
+ style="flex: 1;"
|
|
|
+ ></el-input>
|
|
|
+ <i
|
|
|
+ class="el-icon-search"
|
|
|
+ style="margin-left: 8px; cursor: pointer; font-size: 18px; color: #909399;"
|
|
|
+ @click="handlePrescribeCommonWorlds('remark', 2)"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
+ <!-- 定位在右下角的按钮 -->
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ style="position: absolute; bottom: 5px; right: 20px;"
|
|
|
+ @click="openCollectionInfo"
|
|
|
+ >
|
|
|
+ 查看采集信息
|
|
|
+ </el-button>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
<!-- Tab 2: 处方药品信息 -->
|
|
|
@@ -290,7 +321,22 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
+ <!-- Tab 3: 用户信息采集 -->
|
|
|
+ <el-tab-pane label="采集信息详情" name="userCollection">
|
|
|
+ <collectionDetail
|
|
|
+ :userId="form.userId"
|
|
|
+ :prescribeId="form.prescribeId"
|
|
|
+ v-if="form.userId"
|
|
|
+ />
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
+ <!-- 查看采集信息的弹窗 -->
|
|
|
+ <el-dialog :visible.sync="collectionDialogVisible" title="用户信息采集详情" width="800px" append-to-body>
|
|
|
+ <collectionDetail :userId="form.userId" :prescribeId="form.prescribeId" v-if="collectionDialogVisible"/>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="collectionDialogVisible = false">关 闭</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="open = false">关 闭</el-button>
|
|
|
<el-button type="primary" @click="submitForm" v-if="currentConfirm === 0">保 存</el-button>
|
|
|
@@ -315,31 +361,82 @@
|
|
|
<el-form-item label="每次用药数量" prop="usagePerUseCount">
|
|
|
<el-input v-model="drugForm.usagePerUseCount" placeholder="请输入每次用药数量" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="drugOpen = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitDrugForm">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- ✅ 新增:常用语选择对话框 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="suggestDialogTitle"
|
|
|
+ :visible.sync="showSuggestDialog"
|
|
|
+ width="600px"
|
|
|
+ append-to-body
|
|
|
+ @closed="clearSuggestList"
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ :data="suggestList"
|
|
|
+ height="300"
|
|
|
+ border
|
|
|
+ @row-click="handleSuggestRowClick"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" width="50" />
|
|
|
+ <el-table-column label="内容" prop="textContent" show-overflow-tooltip />
|
|
|
+ <el-table-column label="操作" width="80" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" size="small" @click.stop="handleAddSuggest(scope.row)">
|
|
|
+ 添加
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="suggestTotal > 0"
|
|
|
+ :total="suggestTotal"
|
|
|
+ :page.sync="suggestQuery.pageNum"
|
|
|
+ :limit.sync="suggestQuery.pageSize"
|
|
|
+ @pagination="getSuggestList"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {
|
|
|
- listPrescribe,
|
|
|
+import collectionDetail from '@/views/components/collection/collectionDetail.vue';
|
|
|
+import {listPrescribe,
|
|
|
getPrescribe,
|
|
|
delPrescribe,
|
|
|
addPrescribe,
|
|
|
updatePrescribe,
|
|
|
exportPrescribe,
|
|
|
exportMessageFeedback,
|
|
|
- confirmPrescribe
|
|
|
+ confirmPrescribe,
|
|
|
+ getPrescribeCommonList
|
|
|
} from '@/api/his/prescribe'
|
|
|
import { listPrescribeDrug, addPrescribeDrug, updatePrescribeDrug, deletePrescribeDrug } from "@/api/his/prescribeDrug";
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ collectionDetail // 注册引入的组件
|
|
|
+ },
|
|
|
name: "Prescribe",
|
|
|
data() {
|
|
|
return {
|
|
|
+ collectionDialogVisible: false, // 控制采集信息弹窗显示
|
|
|
+ searchTimer: null, // 防抖定时器
|
|
|
+ suggestList: [], // 常用语建议列表
|
|
|
+ suggestTotal: 0, // 分页总数
|
|
|
+ showSuggestDialog: false, // 是否显示建议对话框
|
|
|
+ suggestQuery: { // 建议查询参数
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ commonType: null,
|
|
|
+ textContent: ''
|
|
|
+ },
|
|
|
+ suggestSource: '', // 记录来源字段 'diagnose' 或 'remark'
|
|
|
+ suggestRow: null, // 如果是备注,记录具体行
|
|
|
// 原有数据保持不变
|
|
|
loading: false,
|
|
|
ids: [],
|
|
|
@@ -419,6 +516,14 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ // 动态标题
|
|
|
+ suggestDialogTitle() {
|
|
|
+ if (this.suggestSource === 'diagnose') return '选择常用诊断内容';
|
|
|
+ if (this.suggestSource === 'remark') return '选择常用备注内容';
|
|
|
+ return '选择常用内容';
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getList();
|
|
|
},
|
|
|
@@ -431,6 +536,82 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 搜索关键词常用语方法 - 支持不同来源和类型
|
|
|
+ * @param {string} type - 字段类型: 'diagnose' | 'remark'
|
|
|
+ * @param {number} commonType - 1=病情诊断,2=备注
|
|
|
+ */
|
|
|
+ handlePrescribeCommonWorlds(type, commonType) {
|
|
|
+ const value = type === 'diagnose' ? this.form.diagnose : this.form.remark;
|
|
|
+ if (!value || !value.trim()) {
|
|
|
+ this.showSuggestDialog = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.suggestQuery.commonType = commonType;
|
|
|
+ this.suggestQuery.textContent = value.trim();
|
|
|
+ this.suggestQuery.pageNum = 1;
|
|
|
+ this.suggestSource = type;
|
|
|
+
|
|
|
+ this.getSuggestList().then(() => {
|
|
|
+ this.showSuggestDialog = this.suggestList.length > 0;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取常用语列表(支持分页)
|
|
|
+ */
|
|
|
+ async getSuggestList() {
|
|
|
+ try {
|
|
|
+ const response = await getPrescribeCommonList(this.suggestQuery);
|
|
|
+ if (response && response.data && Array.isArray(response.data.list)) {
|
|
|
+ this.suggestList = response.data.list;
|
|
|
+ this.suggestTotal = response.data.total;
|
|
|
+ } else {
|
|
|
+ this.suggestList = [];
|
|
|
+ this.suggestTotal = 0;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取常用语失败:", error);
|
|
|
+ this.$message.warning("获取常用语失败");
|
|
|
+ this.suggestList = [];
|
|
|
+ this.suggestTotal = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 点击建议行(双击或点击添加)
|
|
|
+ */
|
|
|
+ handleSuggestRowClick(row) {
|
|
|
+ this.handleAddSuggest(row);
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加建议内容到对应字段
|
|
|
+ */
|
|
|
+ handleAddSuggest(row) {
|
|
|
+ const text = row.textContent;
|
|
|
+ console.log("当前入参suggestSource:", this.suggestSource)
|
|
|
+ if (this.suggestSource === 'diagnose') {
|
|
|
+ this.form.diagnose = text;
|
|
|
+ } else if (this.suggestSource === 'remark') {
|
|
|
+ this.form.remark = text;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 关闭对话框
|
|
|
+ this.showSuggestDialog = false;
|
|
|
+ this.clearSuggestList();
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 清空建议数据
|
|
|
+ */
|
|
|
+ clearSuggestList() {
|
|
|
+ this.suggestList = [];
|
|
|
+ this.suggestTotal = 0;
|
|
|
+ this.suggestQuery.pageNum = 1;
|
|
|
+ this.suggestQuery.textContent = '';
|
|
|
+ },
|
|
|
/** 查询处方列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
@@ -518,7 +699,7 @@ export default {
|
|
|
} else {
|
|
|
this.title = "查看处方";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.activeTab = 'basic';
|
|
|
// 如果有prescribeId,则可以查询药品列表
|
|
|
if (this.form.prescribeId) {
|
|
|
@@ -662,6 +843,14 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /** 患者信息采集详情页面 */
|
|
|
+ openCollectionInfo() {
|
|
|
+ if (!this.form.userId) {
|
|
|
+ this.$message.warning("患者ID未填写!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.collectionDialogVisible = true;
|
|
|
+ },
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
@@ -672,6 +861,7 @@ export default {
|
|
|
storeOrderId: undefined,
|
|
|
orderCode: undefined,
|
|
|
patientId: undefined,
|
|
|
+ userId: undefined,
|
|
|
patientName: undefined,
|
|
|
patientAge: undefined,
|
|
|
patientGender: "1",
|