| | |
| | | v-model="queryParams.scopetype" |
| | | placeholder="默认全部科室" |
| | | :options="sourcetype" |
| | | filterable |
| | | clearable |
| | | filterable |
| | | clearable |
| | | :props="{ expandTrigger: 'hover' }" |
| | | @change="handleChange" |
| | | ></el-cascader> |
| | |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="床号排序" prop="bedSort"> |
| | | <el-select |
| | | v-model="queryParams.bedSort" |
| | | placeholder="不按床号排序" |
| | | style="width: 160px" |
| | | > |
| | | <el-option label="不按床号排序" :value="null"></el-option> |
| | | <el-option label="按床号正序" :value="1"></el-option> |
| | | <el-option label="按床号倒序" :value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-row> |
| | |
| | | 添加延续护理任务 |
| | | </el-button> |
| | | </el-col> |
| | | <!-- 语音服务转人工按钮 --> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-refresh-right" |
| | | size="medium" |
| | | :disabled="multiple" |
| | | v-if="orgname === '第一人民医院湖滨院区'||orgname === '第一人民医院吴山院区'||orgname === '第一人民医院城东院区'" |
| | | @click="handleManualVisit" |
| | | > |
| | | 语音服务转人工 |
| | | </el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-folder-add" |
| | | size="medium" |
| | | :disabled="multiple" |
| | | @click="handleCreateArchive" |
| | | > |
| | | 患者建档</el-button |
| | | > |
| | | </el-col> --> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | |
| | | scope.row.idcardno, |
| | | scope.row.drcode, |
| | | scope.row.drname, |
| | | scope.row.patid, |
| | | scope.row.patid |
| | | ) |
| | | " |
| | | ><span class="button-textsc">{{ |
| | |
| | | <!-- 批量添加延续护理任务弹窗 --> |
| | | <!-- 批量添加延续护理任务弹窗 --> |
| | | <el-dialog |
| | | title="批量添加延续护理" |
| | | :title="batchMode === 'manual' ? '语音服务转人工' : '批量添加延续护理'" |
| | | :visible.sync="batchTaskVisible" |
| | | width="90%" |
| | | append-to-body |
| | |
| | | <el-col :span="12"> |
| | | <div class="batch-task-section"> |
| | | <div class="section-header"> |
| | | <h4>延续护理任务</h4> |
| | | <h4> |
| | | {{ batchMode === "manual" ? "人工随访任务" : "延续护理任务" }} |
| | | </h4> |
| | | <div v-if="selectedTask" class="task-selected-hint selected"> |
| | | <i class="el-icon-success"></i> |
| | | <span>已选择:{{ selectedTask.taskName }}</span> |
| | |
| | | <template #empty> |
| | | <div class="empty-message"> |
| | | <i class="el-icon-document"></i> |
| | | <span>暂无可用延续护理任务</span> |
| | | <span>{{ |
| | | batchMode === "manual" |
| | | ? "暂无可用人工随访任务" |
| | | : "暂无可用延续护理任务" |
| | | }}</span> |
| | | <span class="empty-tips">请联系管理员创建任务</span> |
| | | </div> |
| | | </template> |
| | |
| | | @click="submitBatchTask" |
| | | :disabled="!selectedTask || batchLoading" |
| | | > |
| | | {{ batchLoading ? "创建中..." : "创建延续护理任务" }} |
| | | {{ |
| | | batchLoading |
| | | ? batchMode === "manual" |
| | | ? "转换中..." |
| | | : "创建中..." |
| | | : batchMode === "manual" |
| | | ? "确认转人工" |
| | | : "创建延续护理任务" |
| | | }} |
| | | </el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | <el-button @click="submitclose">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 患者建档弹窗 --> |
| | | <ArchiveDialog |
| | | :visible.sync="archiveDialogVisible" |
| | | :patients="archivePatients" |
| | | source-page="inpatient" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { delUser } from "@/api/system/user"; |
| | | import formatTime from "@/filters/index"; |
| | | |
| | | import { listpatient } from "@/api/patient/record"; |
| | | import { listpatient, addManualVisit } from "@/api/patient/record"; |
| | | import { |
| | | messagelistpatient, |
| | | alterpatient, |
| | |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import { listDept } from "@/api/system/dept"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | import { query360PatInfo,query360PatInfonh, getTasklist, addSubtask } from "@/api/AiCentre/index"; |
| | | import { |
| | | query360PatInfo, |
| | | query360PatInfonh, |
| | | getTasklist, |
| | | addSubtask, |
| | | } from "@/api/AiCentre/index"; |
| | | |
| | | import store from "@/store"; |
| | | import ArchiveDialog from "@/views/patient/archives/components/ArchiveDialog.vue"; |
| | | |
| | | export default { |
| | | name: "behospitalized", |
| | | dicts: ["sys_normal_disable", "sys_user_sex", "nursinggrade"], |
| | | components: { Treeselect }, |
| | | components: { Treeselect, ArchiveDialog }, |
| | | data() { |
| | | return { |
| | | // 遮罩层 |
| | |
| | | initPassword: undefined, |
| | | amendtag: false, //是否修改 |
| | | // 批量任务相关数据 |
| | | batchMode: "continue", // 弹窗模式:continue 延续护理 / manual 语音服务转人工 |
| | | batchTaskVisible: false, // 弹窗可见性 |
| | | selectedPatients: [], // 选中的患者列表 |
| | | taskList: [], // 任务列表 |
| | | selectedTask: null, // 选中的任务 |
| | | batchLoading: false, // 批量提交加载状态 |
| | | // 患者建档 |
| | | archiveDialogVisible: false, |
| | | archivePatients: [], |
| | | // 日期范围 |
| | | dateRange: [], |
| | | paperstypes: [ |
| | |
| | | label: "病区患者", |
| | | }, |
| | | ], |
| | | orgname: localStorage.getItem("orgname"), |
| | | |
| | | postData: { |
| | | XiaoXiTou: { |
| | | FaSongFCSJC: "ZJHES", |
| | |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | cry: 0, |
| | | bedSort: null, |
| | | searchscope: 3, |
| | | scopetype: [], |
| | | leaveldeptcodes: [], |
| | |
| | | this.queryParams.leavehospitaldistrictcodes = store.getters.belongWards.map( |
| | | (obj) => obj.districtCode |
| | | ); |
| | | console.log(this.orgname); |
| | | |
| | | this.getList(); |
| | | // this.listDept(); |
| | | this.gettabList(); |
| | |
| | | /** 查询患者列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listpatient(this.queryParams).then((response) => { |
| | | listpatient(this.buildListQueryParams()).then((response) => { |
| | | console.log(response); |
| | | this.userList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** |
| | | * 组装 listpatient 入参: |
| | | * cry = 0 且登录机构为「省立同德翠苑院区 / 南华大学附属第一医院」时, |
| | | * 科室/病区字段 leaveldeptcodes、leavehospitaldistrictcodes 需换成 |
| | | * deptcodeList、hospitaldistrictcodeList。 |
| | | */ |
| | | buildListQueryParams() { |
| | | const params = { ...this.queryParams }; |
| | | const orgname = localStorage.getItem("orgname"); |
| | | const needRename = |
| | | params.cry === 0 && |
| | | (orgname === "省立同德翠苑院区" || |
| | | orgname === "南华大学附属第一医院"); |
| | | if (needRename) { |
| | | params.deptcodeList = params.leaveldeptcodes; |
| | | params.hospitaldistrictcodeList = params.leavehospitaldistrictcodes; |
| | | delete params.leaveldeptcodes; |
| | | delete params.leavehospitaldistrictcodes; |
| | | } |
| | | return params; |
| | | }, |
| | | /** 表格行样式 */ |
| | | tableRowClassName({ row, rowIndex }) { |
| | |
| | | this.queryParams.leaveldeptcodes.push(code); |
| | | this.queryParams.leavehospitaldistrictcodes = []; |
| | | this.queryParams.searchscope = 1; |
| | | } else if (type == 2) { |
| | | this.queryParams.leavehospitaldistrictcodes.push(code); |
| | | this.queryParams.leaveldeptcodes = []; |
| | | this.queryParams.searchscope = 2; |
| | | } else if (type == 3) { |
| | | this.queryParams.leaveldeptcodes = store.getters.belongDepts.map( |
| | | (obj) => obj.deptCode |
| | |
| | | return; |
| | | } |
| | | |
| | | // 获取选中患者的科室信息 |
| | | const patientDepts = new Set(); |
| | | let deptcode = ""; |
| | | this.ids.forEach((patId) => { |
| | | const patient = this.userList.find((item) => item.patid === patId); |
| | | if (patient) { |
| | | patientDepts.add(patient.deptname); |
| | | deptcode = patient.deptcode; |
| | | } |
| | | }); |
| | | |
| | | this.batchMode = "continue"; |
| | | // 获取选中患者列表 |
| | | this.selectedPatients = this.userList.filter((item) => |
| | | this.ids.includes(item.patid) |
| | | ); |
| | | this.selectedTask = null; |
| | | |
| | | // 显示弹窗 |
| | | this.batchTaskVisible = true; |
| | | |
| | | // 获取任务列表 |
| | | this.loadTaskList(deptcode); |
| | | this.loadTaskList(); |
| | | }, |
| | | |
| | | /** 语音服务转人工按钮点击 */ |
| | | handleManualVisit() { |
| | | // 校验是否选中患者 |
| | | if (this.ids.length === 0) { |
| | | this.$modal.msgWarning("请至少选中1名患者"); |
| | | return; |
| | | } |
| | | |
| | | this.batchMode = "manual"; |
| | | // 获取选中患者列表 |
| | | this.selectedPatients = this.userList.filter((item) => |
| | | this.ids.includes(item.patid) |
| | | ); |
| | | this.selectedTask = null; |
| | | |
| | | // 显示弹窗 |
| | | this.batchTaskVisible = true; |
| | | |
| | | // 获取任务列表 |
| | | this.loadTaskList(); |
| | | }, |
| | | |
| | | /** 加载任务列表 */ |
| | | loadTaskList(deptcode) { |
| | | loadTaskList() { |
| | | this.batchLoading = true; |
| | | let topqueryParams = { |
| | | pageNum: 1, |
| | | pageSize: 100, // 设置较大的分页获取更多任务 |
| | | type: 2, // 延续护理任务类型 |
| | | pageSize: 1000, // 设置较大的分页获取更多任务 |
| | | }; |
| | | |
| | | if (this.batchMode !== "manual") { |
| | | topqueryParams.type = 2; // 延续护理任务类型 |
| | | } |
| | | topqueryParams.deptcodes = store.getters.belongDepts.map( |
| | | (obj) => obj.deptCode |
| | | ); |
| | | topqueryParams.hospitaldistrictcodes = store.getters.belongWards.map( |
| | | (obj) => obj.districtCode |
| | | ); |
| | | getTasklist(topqueryParams) |
| | | .then((response) => { |
| | | this.taskList = response.rows; |
| | | this.taskList = response.rows || []; |
| | | if (this.batchMode === "manual") { |
| | | // 只保留「人工」任务形式(preachform 含 1) |
| | | this.taskList = this.taskList.filter((task) => |
| | | this.isManualTask(task) |
| | | ); |
| | | } |
| | | this.batchLoading = false; |
| | | |
| | | if (this.taskList.length === 0) { |
| | | this.$modal.msgWarning("当前科室无可用延续护理任务"); |
| | | this.$modal.msgWarning( |
| | | this.batchMode === "manual" |
| | | ? "当前科室无可用人工随访任务" |
| | | : "当前科室无可用延续护理任务" |
| | | ); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | |
| | | }); |
| | | }, |
| | | |
| | | /** 判断是否为「人工」任务形式(preachform 含 1) */ |
| | | isManualTask(task) { |
| | | if (task.preachform != null && task.preachform !== "") { |
| | | const forms = String(task.preachform) |
| | | .split(",") |
| | | .map((s) => s.trim()); |
| | | if (forms.includes("1")) return true; |
| | | } |
| | | if (Array.isArray(task.preachformList)) { |
| | | return task.preachformList.some( |
| | | (item) => String(item.preachform) === "1" |
| | | ); |
| | | } |
| | | return false; |
| | | }, |
| | | |
| | | /** 处理任务选择变化 */ |
| | | handleTaskSelectionChange(currentRow) { |
| | | this.selectedTask = currentRow; |
| | | }, |
| | | |
| | | /** 批量提交延续护理任务 */ |
| | | /** 批量提交(延续护理 / 语音服务转人工) */ |
| | | async submitBatchTask() { |
| | | // 校验是否选中任务 |
| | | if (!this.selectedTask) { |
| | | this.$modal.msgWarning("请选择1个任务"); |
| | | return; |
| | | } |
| | | |
| | | // 语音服务转人工:走新接口 |
| | | if (this.batchMode === "manual") { |
| | | this.submitManualVisit(); |
| | | return; |
| | | } |
| | | |
| | |
| | | templateid: this.selectedTask.templateid, |
| | | libtemplateid: this.selectedTask.libtemplateid, |
| | | sendstate: 2, // 发送状态 |
| | | continueFlag: 1, // 延续护理标志(在院患者) |
| | | continueFlag: 2, // 延续护理标志(在院患者) |
| | | hospType: 6, // 患者类型:6=住院 |
| | | ...patient, |
| | | sendname: patient.patname, |
| | | // 在院患者使用当前时间作为任务开始时间 |
| | |
| | | } |
| | | |
| | | this.batchTaskVisible = false; |
| | | this.$router.push({ |
| | | path: "/followvisit/Continue", |
| | | }); |
| | | this.getList(); // 刷新患者列表 |
| | | } catch (error) { |
| | | this.$modal.msgError("批量添加任务过程中出错:" + error.message); |
| | | } finally { |
| | | this.batchLoading = false; |
| | | } |
| | | }, |
| | | |
| | | /** 语音服务转人工:删除未完成随访任务并重新生成人工随访任务 */ |
| | | async submitManualVisit() { |
| | | this.batchLoading = true; |
| | | try { |
| | | const params = { |
| | | patids: this.selectedPatients.map((item) => item.patid), |
| | | taskid: this.selectedTask.taskid, |
| | | }; |
| | | const response = await addManualVisit(params); |
| | | if (response.code === 200) { |
| | | const data = response.data || {}; |
| | | const generated = data.generatedCount || 0; |
| | | const noDischarge = (data.noDischargeRecordPatids || []).length; |
| | | const noArchive = (data.noArchivePatids || []).length; |
| | | const failed = (data.generateFailedPatids || []).length; |
| | | let msg = `成功生成 ${generated} 个人工随访任务`; |
| | | if (noDischarge) msg += `,${noDischarge} 人无出院记录`; |
| | | if (noArchive) msg += `,${noArchive} 人无患者档案`; |
| | | if (failed) msg += `,${failed} 人生成失败`; |
| | | this.$modal.msgSuccess(msg); |
| | | this.batchTaskVisible = false; |
| | | this.getList(); // 刷新患者列表 |
| | | } else { |
| | | this.$modal.msgError(response.msg || "语音服务转人工失败"); |
| | | } |
| | | } catch (error) { |
| | | this.$modal.msgError( |
| | | "语音服务转人工失败:" + (error.message || "网络错误") |
| | | ); |
| | | } finally { |
| | | this.batchLoading = false; |
| | | } |
| | |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | cry: 0, |
| | | bedSort: null, |
| | | searchscope: 3, |
| | | scopetype: [], |
| | | leaveldeptcodes: [], |
| | |
| | | this.upload.open = false; |
| | | this.dractive = 1; |
| | | }, |
| | | /** 患者建档 */ |
| | | handleCreateArchive() { |
| | | if (this.ids.length === 0) { |
| | | this.$modal.msgWarning("请至少选中1名患者"); |
| | | return; |
| | | } |
| | | this.archivePatients = this.userList.filter((item) => |
| | | this.ids.includes(item.patid) |
| | | ); |
| | | this.archiveDialogVisible = true; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |