From fbb61549bf96e9e0910b676a5524b0760d29c4be Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 07 四月 2026 15:16:54 +0800
Subject: [PATCH] 测试完成
---
src/views/followvisit/Continue/ContinueFordetails.vue | 2389 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 2,389 insertions(+), 0 deletions(-)
diff --git a/src/views/followvisit/Continue/ContinueFordetails.vue b/src/views/followvisit/Continue/ContinueFordetails.vue
new file mode 100644
index 0000000..c07bcef
--- /dev/null
+++ b/src/views/followvisit/Continue/ContinueFordetails.vue
@@ -0,0 +1,2389 @@
+<template>
+ <!-- 寤剁画鎶ょ悊椤甸潰 -->
+ <div class="ContinuityCarePage" id="app-container">
+ <!-- 绗竴閮ㄥ垎锛氭偅鑰呭熀纭�淇℃伅 -->
+ <div class="patient-info-section">
+ <div class="headline">
+ <div>鎮h�呭熀纭�淇℃伅</div>
+ </div>
+ <div class="patient-info-form">
+ <el-form
+ ref="patientForm"
+ :model="patientForm"
+ :rules="patientRules"
+ label-width="120px"
+ >
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鎮h�呭鍚�" prop="name">
+ <el-input
+ v-model="patientForm.name"
+ placeholder="璇疯緭鍏ユ偅鑰呭鍚�"
+ maxlength="30"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鎬у埆" prop="sex">
+ <el-select
+ v-model="patientForm.sex"
+ placeholder="璇烽�夋嫨"
+ clearable
+ >
+ <el-option label="鐢�" :value="1"></el-option>
+ <el-option label="濂�" :value="2"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="骞撮緞" prop="age">
+ <el-input
+ v-model="patientForm.age"
+ placeholder="璇疯緭鍏ュ勾榫�"
+ maxlength="3"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鑱旂郴鐢佃瘽" prop="telcode">
+ <el-input
+ v-model="patientForm.telcode"
+ placeholder="璇疯緭鍏ヨ仈绯荤數璇�"
+ maxlength="20"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="浣忛櫌鍙�" prop="hospitalNumber">
+ <el-input
+ v-model="patientForm.hospitalNumber"
+ placeholder="璇疯緭鍏ヤ綇闄㈠彿"
+ maxlength="50"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍑洪櫌鏃ユ湡" prop="dischargeDate">
+ <el-date-picker
+ v-model="patientForm.dischargeDate"
+ type="date"
+ placeholder="閫夋嫨鍑洪櫌鏃ユ湡"
+ value-format="yyyy-MM-dd"
+ style="width: 100%"
+ >
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="璇婃柇鍚嶇О" prop="diagnosis">
+ <el-input
+ v-model="patientForm.diagnosis"
+ placeholder="璇疯緭鍏ヨ瘖鏂悕绉�"
+ maxlength="100"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璐d换鎶ゅ+" prop="nurseName">
+ <el-input
+ v-model="patientForm.nurseName"
+ placeholder="璇疯緭鍏ヨ矗浠绘姢澹�"
+ maxlength="50"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="24">
+ <el-form-item label="灞呬綇鍦板潃" prop="address">
+ <el-input
+ v-model="patientForm.address"
+ placeholder="璇疯緭鍏ヨ缁嗗眳浣忓湴鍧�"
+ maxlength="200"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="浜插睘濮撳悕" prop="relativeName">
+ <el-input
+ v-model="patientForm.relativeName"
+ placeholder="璇疯緭鍏ヤ翰灞炲鍚�"
+ maxlength="30"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="浜插睘鐢佃瘽" prop="relativeTel">
+ <el-input
+ v-model="patientForm.relativeTel"
+ placeholder="璇疯緭鍏ヤ翰灞炵數璇�"
+ maxlength="20"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 寤剁画鎶ょ悊姹囨�讳俊鎭� -->
+ <el-row :gutter="20" v-if="continuitySummary.continueCount > 0">
+ <el-col :span="24">
+ <el-form-item label="寤剁画鎶ょ悊姹囨��">
+ <div class="continuity-summary">
+ <div class="summary-item">
+ <span class="label">寤剁画娆℃暟锛�</span>
+ <span class="value"
+ >{{ continuitySummary.continueCount }} 娆�</span
+ >
+ </div>
+ <div class="summary-item">
+ <span class="label">鏈�鏂版湇鍔★細</span>
+ <span class="value">{{
+ formatDisplayTime(continuitySummary.continueTimeNow)
+ }}</span>
+ </div>
+ <div class="summary-item">
+ <span class="label">涓嬫鏈嶅姟锛�</span>
+ <span class="value">{{
+ formatDisplayTime(continuitySummary.continueTimeNext)
+ }}</span>
+ </div>
+ </div>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <el-form-item>
+ <el-button
+ type="primary"
+ @click="savePatientInfo"
+ :loading="savingPatientInfo"
+ >
+ 淇濆瓨鎮h�呬俊鎭�
+ </el-button>
+ <el-button @click="resetPatientInfo">閲嶇疆</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ </div>
+ <!-- 绗簩閮ㄥ垎锛氭湇鍔″熀纭�淇℃伅 -->
+ <div class="basic-info-section">
+ <div class="headline">
+ <div>鏈嶅姟鍩虹淇℃伅</div>
+ </div>
+ <div class="basic-info-container">
+ <!-- 宸﹀崐閮ㄥ垎锛氬綋鍓嶆湇鍔¢殢璁垮唴瀹癸紙鍙锛� -->
+ <div class="followup-content readonly-content">
+ <div class="sub-headline">
+ <i class="el-icon-document"></i> 褰撳墠鏈嶅姟闅忚鍐呭锛堝彧璇伙級
+ <el-button
+ type="text"
+ size="small"
+ @click="toggleQuestionSelection"
+ style="margin-left: 10px"
+ >
+ {{ showQuestionSelector ? "闅愯棌闂閫夊彇" : "閫夊彇寤剁画闂" }}
+ </el-button>
+ </div>
+
+ <!-- 闂閫夊彇闈㈡澘 -->
+ <div v-if="showQuestionSelector" class="question-selector-panel">
+ <div class="selector-header">
+ <span>璇烽�夋嫨寤剁画闂锛堝彲澶氶�夛級锛�</span>
+ <el-button
+ type="primary"
+ size="small"
+ @click="confirmQuestionSelection"
+ >
+ 纭閫夊彇
+ </el-button>
+ </div>
+ <div class="question-list">
+ <el-checkbox-group v-model="selectedQuestionIds">
+ <div
+ v-for="(question, index) in availableQuestions"
+ :key="question.id"
+ class="question-item"
+ >
+ <el-checkbox :label="question.id">
+ <div class="question-content">
+ <span class="question-index"
+ >{{ question.index + 1 }}.</span
+ >
+ <span class="question-text">{{ question.text }}</span>
+ </div>
+ </el-checkbox>
+ </div>
+ </el-checkbox-group>
+ </div>
+ </div>
+ <div class="content-container">
+ <el-tabs v-model="activeName" type="border-card">
+ <el-tab-pane name="wj">
+ <span slot="label"
+ ><i class="el-icon-notebook-1"></i> 闂嵎闅忚缁撴灉</span
+ >
+ <div class="CONTENT">
+ <div class="title">{{ taskname ? taskname : "闂嵎" }}</div>
+ <div class="preview-left" v-if="!Voicetype">
+ <div
+ class="topic-dev"
+ v-for="(item, index) in tableDatatop"
+ :key="item.id"
+ >
+ <!-- 鍗曢�� -->
+ <div
+ :class="getTopicClass(item)"
+ :key="index"
+ v-if="item.scriptType == 1 && !item.astrict"
+ >
+ <div class="dev-text">
+ {{ index + 1 }}銆乕鍗曢�塢<span>{{
+ item.scriptContent
+ }}</span>
+ </div>
+ <div class="dev-xx">
+ <el-radio-group v-model="item.scriptResult" disabled>
+ <el-radio
+ v-for="(
+ items, indexs
+ ) in item.svyTaskTemplateTargetoptions"
+ :class="getOptionClass(items)"
+ :key="indexs"
+ :label="items.optioncontent"
+ >{{ items.optioncontent }}</el-radio
+ >
+ </el-radio-group>
+ </div>
+ <div
+ v-if="item.showAppendInput || item.answerps"
+ class="append-input-container"
+ >
+ <el-input
+ type="textarea"
+ :rows="2"
+ placeholder="璇疯緭鍏ュ叿浣撲俊鎭�"
+ v-model="item.answerps"
+ readonly
+ ></el-input>
+ </div>
+ <div v-show="item.prompt">
+ <el-alert :title="item.prompt" type="warning">
+ </el-alert>
+ </div>
+ </div>
+ <!-- 澶氶�� -->
+ <div
+ :class="
+ item.isabnormal
+ ? 'scriptTopic-isabnormal'
+ : 'scriptTopic-dev'
+ "
+ :key="index"
+ v-if="item.scriptType == 2 && !item.astrict"
+ >
+ <div class="dev-text">
+ {{ index + 1 }}銆乕澶氶�塢<span>{{
+ item.scriptContent
+ }}</span>
+ </div>
+ <div class="dev-xx">
+ <el-checkbox-group
+ v-model="item.scriptResult"
+ disabled
+ >
+ <el-checkbox
+ :class="items.isabnormal ? 'red-star' : ''"
+ v-for="(
+ items, indexs
+ ) in item.svyTaskTemplateTargetoptions"
+ :key="indexs"
+ :label="items.optioncontent"
+ >
+ {{ items.optioncontent }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </div>
+ <div v-show="item.prompt && item.scriptResult[0]">
+ <el-alert :title="item.prompt" type="warning">
+ </el-alert>
+ </div>
+ </div>
+ <!-- 濉┖ -->
+ <div
+ class="scriptTopic-dev"
+ :key="index"
+ v-if="item.scriptType == 4 && !item.astrict"
+ >
+ <div class="dev-text">
+ {{ index + 1 }}銆乕闂瓟]<span>{{
+ item.scriptContent
+ }}</span>
+ <span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span>
+ </div>
+ <div class="dev-xx" v-if="item.valueType == 3">
+ <el-input
+ type="text"
+ placeholder="璇疯緭鍏ョ瓟妗�"
+ v-model="item.scriptResult"
+ readonly
+ >
+ </el-input>
+ </div>
+ <div class="dev-xx" v-else>
+ <el-input
+ type="textarea"
+ :rows="2"
+ placeholder="璇疯緭鍏ョ瓟妗�"
+ v-model="item.scriptResult"
+ readonly
+ >
+ </el-input>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="preview-left" v-else>
+ <div
+ class="topic-dev"
+ v-for="(item, index) in tableDatatop"
+ :key="item.id"
+ >
+ <div v-if="item.targetvalue">
+ <div class="dev-text">
+ {{ index + 1 }}銆乕鍗曢�塢<span>{{
+ item.questiontext
+ }}</span>
+ </div>
+ <div class="dev-xx">
+ <el-radio-group v-model="item.matchedtext" disabled>
+ <el-radio
+ v-for="(items, index) in item.scriptResult"
+ :key="index"
+ :label="items"
+ :class="items.isabnormal ? 'red-star' : ''"
+ >{{ items }}</el-radio
+ >
+ </el-radio-group>
+ </div>
+ <div v-show="item.prompt">
+ <el-alert :title="item.prompt" type="warning">
+ </el-alert>
+ </div>
+ </div>
+ <div class="scriptTopic-dev" :key="index" v-else>
+ <div class="dev-text">
+ {{ index + 1 }}銆乕闂瓟]<span>{{
+ item.scriptContent
+ }}</span>
+ <span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span>
+ </div>
+ <div class="dev-xx" v-if="item.valueType == 3">
+ <el-input
+ type="text"
+ placeholder="璇疯緭鍏ョ瓟妗�"
+ v-model="item.scriptResult"
+ readonly
+ >
+ </el-input>
+ </div>
+ <div class="dev-xx" v-else>
+ <el-input
+ type="textarea"
+ :rows="2"
+ placeholder="璇疯緭鍏ョ瓟妗�"
+ v-model="item.scriptResult"
+ readonly
+ >
+ </el-input>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </el-tab-pane>
+ <el-tab-pane name="yy">
+ <span slot="label"
+ ><i class="el-icon-headset"></i> 璇煶闅忚璇︽儏</span
+ >
+ <div class="borderdiv">
+ <div class="title">{{ taskname ? taskname : "闂嵎" }}</div>
+ <div class="voice-audio">
+ 瀹屾暣璇煶锛�
+ <mini-audio
+ :audio-source="
+ voice ? voice : '@assets/order/example.mp3'
+ "
+ ></mini-audio>
+ </div>
+ <div class="preview-left">
+ <div v-for="item in voiceDatatop">
+ <div class="leftside">
+ <i class="el-icon-phone-outline"></i
+ ><span>{{ item.questiontext }}</span>
+ </div>
+ <div class="offside">
+ <i class="el-icon-user"></i>
+ <div class="offside-value">
+ <el-input
+ type="textarea"
+ :autosize="{ minRows: 1 }"
+ v-model="item.asrtext"
+ readonly
+ ></el-input>
+ <div>
+ <mini-audio
+ :audio-source="
+ item.questionvoice
+ ? item.questionvoice
+ : '@assets/order/example.mp3'
+ "
+ ></mini-audio>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+ </div>
+
+ <!-- 鍙冲崐閮ㄥ垎锛氬巻娆″欢缁姢鐞嗘湇鍔� -->
+ <!-- 鍙冲崐閮ㄥ垎锛氬巻娆″欢缁姢鐞嗘湇鍔� -->
+ <div class="continuity-history">
+ <div class="sub-headline">
+ <i class="el-icon-time"></i> 鍘嗘寤剁画鎶ょ悊鏈嶅姟
+ <el-button
+ type="primary"
+ size="small"
+ icon="el-icon-plus"
+ @click="addContinuityTab"
+ style="margin-left: 10px"
+ >鏂板寤剁画鎶ょ悊</el-button
+ >
+ </div>
+ <div class="history-content">
+ <el-tabs
+ v-model="activeContinuityTab"
+ type="card"
+ closable
+ @tab-remove="removeContinuityTab"
+ @tab-click="handleTabClick"
+ >
+ <el-tab-pane
+ v-for="(item, index) in continuityTabs"
+ :key="item.name"
+ :label="item.title"
+ :name="item.name"
+ >
+ <div class="continuity-form">
+ <el-form
+ :ref="'continuityForm' + index"
+ :model="item.form"
+ :rules="continuityRules"
+ label-width="120px"
+ >
+ <!-- 寤剁画闂琛ㄥ崟 -->
+ <el-form-item label="寤剁画闂" prop="continuityProblems">
+ <div class="continuity-problems-form">
+ <div class="problems-header">
+ <span>宸查�夊彇鐨勫欢缁棶棰橈細</span>
+ <el-button
+ type="text"
+ size="small"
+ icon="el-icon-plus"
+ @click="addContinuityProblem(index)"
+ >
+ 鏂板闂
+ </el-button>
+ </div>
+
+ <!-- 宸查�夊彇鐨勯棶棰樺垪琛� -->
+ <div
+ v-if="
+ item.form.continuityProblems &&
+ item.form.continuityProblems.length > 0
+ "
+ class="problems-list-container"
+ >
+ <div
+ v-for="(problem, problemIndex) in item.form
+ .continuityProblems"
+ :key="problemIndex"
+ class="problem-item"
+ >
+ <div class="problem-content">
+ <div class="problem-meta">
+ <span class="problem-index"
+ >闂 {{ problemIndex + 1 }}</span
+ >
+ <el-select
+ v-model="problem.questionId"
+ placeholder="閫夋嫨闂"
+ size="small"
+ style="width: 300px; margin: 0 10px"
+ @change="
+ handleProblemChange(
+ index,
+ problemIndex,
+ $event
+ )
+ "
+ >
+ <el-option
+ v-for="q in availableQuestions"
+ :key="q.id"
+ :label="q.text"
+ :value="q.id"
+ >
+ <span
+ >{{ q.index + 1 }}.
+ {{ truncateText(q.text, 40) }}</span
+ >
+ </el-option>
+ </el-select>
+ <!-- 淇锛氫紶閫掓纭殑绱㈠紩 -->
+ <el-button
+ type="danger"
+ icon="el-icon-delete"
+ size="mini"
+ circle
+ @click="
+ removeContinuityProblem(index, problemIndex)
+ "
+ >
+ </el-button>
+ </div>
+
+ <!-- 闂嵎寮忛棶棰樺睍绀哄尯鍩� -->
+ <div
+ v-if="problem.questionId"
+ class="question-display-area"
+ >
+ <!-- 鏍规嵁闂绫诲瀷鍔ㄦ�佹覆鏌� -->
+ <div
+ v-if="
+ getQuestionOriginalData(problem.questionId)
+ "
+ class="question-render"
+ >
+ <!-- 鍗曢�夌被鍨� -->
+ <div
+ v-if="
+ getQuestionOriginalData(
+ problem.questionId
+ ).scriptType == 1
+ "
+ class="question-item-render"
+ >
+ <div class="question-text">
+ <strong>[鍗曢�塢</strong>
+ <span>{{
+ getQuestionOriginalData(
+ problem.questionId
+ ).scriptContent
+ }}</span>
+ </div>
+ <div class="question-options">
+ <el-radio-group
+ v-model="problem.selectedOption"
+ >
+ <el-radio
+ v-for="option in getQuestionOriginalData(
+ problem.questionId
+ ).svyTaskTemplateTargetoptions"
+ :key="option.optioncontent"
+ :label="option.optioncontent"
+ :class="getOptionClass(option)"
+ >
+ {{ option.optioncontent }}
+ </el-radio>
+ </el-radio-group>
+ </div>
+ <!-- 闄勫姞杈撳叆妗� -->
+ <div
+ v-if="problem.showAppendInput"
+ class="append-input"
+ style="margin-top: 10px"
+ >
+ <el-input
+ type="textarea"
+ :rows="2"
+ placeholder="璇疯緭鍏ュ叿浣撲俊鎭�"
+ v-model="problem.appendInput"
+ ></el-input>
+ </div>
+ </div>
+
+ <!-- 澶氶�夌被鍨� -->
+ <div
+ v-else-if="
+ getQuestionOriginalData(
+ problem.questionId
+ ).scriptType == 2
+ "
+ class="question-item-render"
+ >
+ <div class="question-text">
+ <strong>[澶氶�塢</strong>
+ <span>{{
+ getQuestionOriginalData(
+ problem.questionId
+ ).scriptContent
+ }}</span>
+ </div>
+ <div class="question-options">
+ <el-checkbox-group
+ v-model="problem.selectedOptions"
+ >
+ <el-checkbox
+ v-for="option in getQuestionOriginalData(
+ problem.questionId
+ ).svyTaskTemplateTargetoptions"
+ :key="option.optioncontent"
+ :label="option.optioncontent"
+ :class="
+ option.isabnormal ? 'red-star' : ''
+ "
+ >
+ {{ option.optioncontent }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </div>
+ </div>
+
+ <!-- 濉┖/闂瓟绫诲瀷 -->
+ <div
+ v-else-if="
+ getQuestionOriginalData(
+ problem.questionId
+ ).scriptType == 4
+ "
+ class="question-item-render"
+ >
+ <div class="question-text">
+ <strong>[闂瓟]</strong>
+ <span>{{
+ getQuestionOriginalData(
+ problem.questionId
+ ).scriptContent
+ }}</span>
+ <span
+ v-if="
+ getQuestionOriginalData(
+ problem.questionId
+ ).valueType == 3
+ "
+ >(鍙兘杈撳叆鏁板瓧)</span
+ >
+ </div>
+ <div class="question-options">
+ <el-input
+ v-if="
+ getQuestionOriginalData(
+ problem.questionId
+ ).valueType == 3
+ "
+ type="text"
+ placeholder="璇疯緭鍏ョ瓟妗�"
+ v-model="problem.answer"
+ style="width: 200px"
+ ></el-input>
+ <el-input
+ v-else
+ type="textarea"
+ :rows="2"
+ placeholder="璇疯緭鍏ョ瓟妗�"
+ v-model="problem.answer"
+ style="width: 100%"
+ ></el-input>
+ </div>
+ </div>
+ </div>
+ <div v-else class="no-question-data">
+ 闂鏁版嵁鍔犺浇涓�...
+ </div>
+ </div>
+
+ <!-- 鍘熸湁鐨勯棶棰樻弿杩扮瓑瀛楁 -->
+ <div class="problem-detail">
+ <div class="detail-row">
+ <span class="detail-label">褰撳墠鐘舵�侊細</span>
+ <el-select
+ v-model="problem.status"
+ placeholder="閫夋嫨鐘舵��"
+ size="small"
+ style="width: 120px; margin-right: 20px"
+ >
+ <el-option
+ label="鏈鐞�"
+ value="pending"
+ ></el-option>
+ <el-option
+ label="澶勭悊涓�"
+ value="processing"
+ ></el-option>
+ <el-option
+ label="宸茶В鍐�"
+ value="resolved"
+ ></el-option>
+ <el-option
+ label="鎸佺画鍏虫敞"
+ value="watching"
+ ></el-option>
+ </el-select>
+
+ <span
+ class="detail-label"
+ v-if="problem.status === 'resolved'"
+ style="margin-left: 20px"
+ >
+ 瑙e喅鏃ユ湡锛�
+ </span>
+ <el-date-picker
+ v-if="problem.status === 'resolved'"
+ v-model="problem.resolvedDate"
+ type="date"
+ placeholder="閫夋嫨瑙e喅鏃ユ湡"
+ value-format="yyyy-MM-dd"
+ size="small"
+ style="width: 150px; margin-left: 10px"
+ ></el-date-picker>
+ </div>
+
+ <!-- <div class="detail-row">
+ <span class="detail-label">闂鎻忚堪锛�</span>
+ <el-input
+ type="textarea"
+ :rows="2"
+ v-model="problem.description"
+ placeholder="璇疯缁嗘弿杩拌寤剁画闂锛堝彲璁板綍璇勪及缁撴灉銆佸鐞嗗缓璁瓑锛�"
+ size="small"
+ style="flex: 1"
+ ></el-input>
+ </div> -->
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </el-form-item>
+
+ <!-- 寤剁画鎬ф姢鐞嗚褰� -->
+ <el-form-item label="鎶ょ悊璁板綍" prop="careRecord">
+ <el-input
+ type="textarea"
+ :rows="4"
+ v-model="item.form.careRecord"
+ placeholder="璇疯緭鍏ュ欢缁�ф姢鐞嗚褰�"
+ clearable
+ ></el-input>
+ </el-form-item>
+
+ <!-- 璐d换鎶ゅ+銆佸洖璁垮舰寮忋�佹湇鍔℃椂闂� -->
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="璐d换鎶ゅ+" prop="dutyNurse">
+ <el-input
+ v-model="item.form.dutyNurse"
+ placeholder="璇疯緭鍏ヨ矗浠绘姢澹�"
+ clearable
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍥炶褰㈠紡" prop="visitType">
+ <el-select
+ v-model="item.form.visitType"
+ placeholder="璇烽�夋嫨鍥炶褰㈠紡"
+ style="width: 100%"
+ clearable
+ >
+ <el-option
+ label="鐢佃瘽鍥炶"
+ value="phone"
+ ></el-option>
+ <el-option
+ label="涓婇棬鍥炶"
+ value="home"
+ ></el-option>
+ <el-option
+ label="闂ㄨ瘖鍥炶"
+ value="clinic"
+ ></el-option>
+ <el-option
+ label="寰俊鍥炶"
+ value="wechat"
+ ></el-option>
+ <el-option label="鍏朵粬" value="other"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item
+ label="涓嬫鏈嶅姟鏃堕棿"
+ prop="nextServiceTime"
+ >
+ <el-date-picker
+ v-model="item.form.nextServiceTime"
+ type="datetime"
+ placeholder="閫夋嫨涓嬫寤剁画鏈嶅姟鏃堕棿"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ style="width: 100%"
+ >
+ </el-date-picker>
+ <div
+ class="time-tip"
+ v-if="item.form.nextServiceTime"
+ >
+ 璺濅笅娆℃湇鍔¤繕鏈�
+ {{ calculateDaysLeft(item.form.nextServiceTime) }}
+ 澶�
+ </div>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏈嶅姟鏃堕棿" prop="serviceTime">
+ <el-date-picker
+ v-model="item.form.serviceTime"
+ type="datetime"
+ placeholder="閫夋嫨鏈嶅姟鏃堕棿"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ style="width: 100%"
+ >
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 涓嬫寤剁画鏈嶅姟鏃堕棿 -->
+
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <el-form-item>
+ <el-button
+ type="primary"
+ @click="saveContinuityTab(index)"
+ :loading="item.saving"
+ >
+ 淇濆瓨
+ </el-button>
+ <el-button @click="resetContinuityTab(index)">
+ 閲嶇疆
+ </el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+<script>
+import {
+ getsearchrResults,
+ getPersonVoices,
+ getTaskservelist,
+ Editsingletaskson,
+} from "@/api/AiCentre/index";
+import {
+ messagelistpatient,
+ alterpatient,
+ listcontactinformation,
+} from "@/api/patient/homepage";
+
+export default {
+ dicts: ["sys_yujing"],
+ data() {
+ return {
+ // 璺敱鍙傛暟
+ taskid: "",
+ id: "",
+ sendname: "",
+ patid: "",
+ Voicetype: 0,
+ serviceType: "",
+
+ // 闅忚鍐呭鐩稿叧
+ activeName: "wj",
+ taskname: "",
+ voice: "",
+ tableDatatop: [],
+ voiceDatatop: [],
+ form: {},
+ userform: {},
+ // 鏂板锛氶棶棰橀�夋嫨鐩稿叧
+ showQuestionSelector: false,
+ selectedQuestionIds: [],
+ // 鎮h�呭熀纭�淇℃伅琛ㄥ崟
+ patientForm: {
+ name: "",
+ sex: "",
+ age: "",
+ telcode: "",
+ hospitalNumber: "",
+ dischargeDate: "",
+ diagnosis: "",
+ nurseName: "",
+ address: "",
+ relativeName: "",
+ relativeTel: "",
+ },
+ patientRules: {
+ name: [{ required: true, message: "璇疯緭鍏ユ偅鑰呭鍚�", trigger: "blur" }],
+ age: [
+ { required: true, message: "璇疯緭鍏ュ勾榫�", trigger: "blur" },
+ { pattern: /^\d+$/, message: "骞撮緞蹇呴』涓烘暟瀛�", trigger: "blur" },
+ ],
+ telcode: [
+ { required: true, message: "璇疯緭鍏ヨ仈绯荤數璇�", trigger: "blur" },
+ {
+ pattern: /^1[3-9]\d{9}$/,
+ message: "璇疯緭鍏ユ纭殑鎵嬫満鍙风爜",
+ trigger: "blur",
+ },
+ ],
+ },
+ savingPatientInfo: false,
+
+ // 寤剁画鎶ょ悊鐩稿叧
+ activeContinuityTab: "continuity-0",
+ continuityTabs: [],
+ continuityTabIndex: 0,
+ continuityRules: {
+ // 绉婚櫎continuityProblems鐨勯獙璇佽鍒�
+ careRecord: [
+ { required: true, message: "璇疯緭鍏ユ姢鐞嗚褰�", trigger: "blur" },
+ ],
+ dutyNurse: [
+ { required: true, message: "璇疯緭鍏ヨ矗浠绘姢澹�", trigger: "blur" },
+ ],
+ visitType: [
+ { required: true, message: "璇烽�夋嫨鍥炶褰㈠紡", trigger: "change" },
+ ],
+ serviceTime: [
+ { required: true, message: "璇烽�夋嫨鏈嶅姟鏃堕棿", trigger: "change" },
+ ],
+ nextServiceTime: [
+ { required: true, message: "璇烽�夋嫨涓嬫鏈嶅姟鏃堕棿", trigger: "change" },
+ ],
+ },
+
+ // 鍙�夌殑寤剁画闂锛堜粠宸︿晶闂嵎涓彁鍙栵級
+ availableQuestions: [],
+
+ // 寤剁画鎶ょ悊姹囨�讳俊鎭�
+ continuitySummary: {
+ continueCount: 0,
+ continueTimeNow: "",
+ continueTimeNext: "",
+ continueContent: "",
+ },
+
+ // 鍏朵粬
+ logsheetlist: [],
+ };
+ },
+ created() {
+ this.taskid = this.$route.query.taskid;
+ this.id = this.$route.query.id;
+ this.sendname = this.$route.query.sendname;
+ this.patid = this.$route.query.patid;
+ this.Voicetype = this.$route.query.Voicetype || 0;
+ this.serviceType = this.$route.query.serviceType;
+
+ this.getTaskservelist(this.id);
+ },
+ methods: {
+ // 鑾峰彇涓婚鏍峰紡绫�
+ getTopicClass(item) {
+ console.log(item.isabnormal, "getTopicClass");
+
+ if (item.isabnormal == 1) {
+ return "scriptTopic-isabnormal";
+ } else if (item.isabnormal == 2) {
+ return "scriptTopic-warning";
+ } else {
+ return "scriptTopic-dev";
+ }
+ },
+
+ // 鑾峰彇閫夐」鏍峰紡绫�
+ getOptionClass(items) {
+ if (items.isabnormal == 1) {
+ return "red-star";
+ } else if (items.isabnormal == 2) {
+ return "yellow-star";
+ }
+ return "";
+ },
+
+ // 鑾峰彇闂嵎鏁版嵁
+ getsearchrResults(id) {
+ getsearchrResults({
+ taskid: this.taskid,
+ patid: this.patid,
+ subId: id ? id : this.id,
+ isFinish: false,
+ }).then((res) => {
+ if (res.code === 200) {
+ this.tableDatatop = res.data.scriptResult;
+
+ this.tableDatatop.forEach((item) => {
+ if (item.scriptType == 2) item.scriptResult = [];
+ if (item.scriptResultId && item.scriptType != 2) {
+ item.isoption = 3;
+ item.scriptResult = item.scriptResult;
+ } else if (item.scriptResultId && item.scriptType == 2) {
+ item.scriptResult = item.scriptResult.split("&");
+ item.isoption = 3;
+ }
+ });
+ this.taskname = res.data.taskName;
+ this.overdata();
+ // 鎻愬彇鍙�夌殑寤剁画闂
+ this.extractAvailableQuestions();
+ }
+ });
+ },
+ overdata() {
+ this.tableDatatop.forEach((item, index) => {
+ var obj = item.svyTaskTemplateTargetoptions.find(
+ (items) => items.optioncontent == item.scriptResult
+ );
+ if (obj) {
+ console.log(obj, "obj");
+ if (obj.isabnormal) {
+ this.tableDatatop[index].isabnormal = obj.isabnormal;
+ }
+ this.$forceUpdate();
+ }
+ });
+ },
+ // 鎻愬彇鍙�夌殑寤剁画闂
+ extractAvailableQuestions() {
+ this.availableQuestions = this.tableDatatop
+ .filter(
+ (item) => item.scriptContent && item.scriptContent.trim() !== ""
+ )
+ .map((item, index) => ({
+ id: `question-${index}`,
+ index: index,
+ text: item.scriptContent,
+ originalIndex: index,
+ }));
+ }, // 鍒囨崲闂閫夋嫨闈㈡澘鏄剧ず
+ toggleQuestionSelection() {
+ this.showQuestionSelector = !this.showQuestionSelector;
+ if (this.showQuestionSelector) {
+ // 閲嶇疆閫夋嫨
+ this.selectedQuestionIds = [];
+ }
+ },
+ // 娣诲姞寤剁画闂
+ addContinuityProblem(tabIndex) {
+ this.continuityTabs[tabIndex].form.continuityProblems.push({
+ questionId: "",
+ status: "pending",
+ description: "",
+ resolvedDate: "",
+ createTime: new Date().toISOString(),
+ // 鏂板瀛楁锛岀敤浜庨棶鍗峰紡浜や簰
+ selectedOption: "", // 鍗曢�夌瓟妗�
+ selectedOptions: [], // 澶氶�夌瓟妗�
+ answer: "", // 濉┖绛旀
+ showAppendInput: false, // 鏄惁鏄剧ず闄勫姞杈撳叆妗�
+ appendInput: "", // 闄勫姞杈撳叆鍐呭
+ });
+ },
+ // 鏍规嵁闂ID鑾峰彇鍘熷闂鏁版嵁
+ getQuestionOriginalData(questionId) {
+ if (!questionId) return null;
+ const originalIndex = this.availableQuestions.find(
+ (q) => q.id === questionId
+ )?.originalIndex;
+ if (originalIndex !== undefined && this.tableDatatop[originalIndex]) {
+ return this.tableDatatop[originalIndex];
+ }
+ return null;
+ },
+ // 绉婚櫎寤剁画闂
+ removeContinuityProblem(tabIndex, problemIndex) {
+ this.continuityTabs[tabIndex].form.continuityProblems.splice(
+ problemIndex,
+ 1
+ );
+ },
+
+ // 澶勭悊闂閫夋嫨鍙樻洿
+ handleProblemChange(tabIndex, problemIndex, questionId) {
+ const problem =
+ this.continuityTabs[tabIndex].form.continuityProblems[problemIndex];
+
+ if (!questionId) {
+ problem.description = "";
+ // 娓呯┖绛旀瀛楁
+ problem.selectedOption = "";
+ problem.selectedOptions = [];
+ problem.answer = "";
+ problem.showAppendInput = false;
+ problem.appendInput = "";
+ return;
+ }
+
+ // 鑷姩濉厖闂鎻忚堪
+ const question = this.availableQuestions.find((q) => q.id === questionId);
+ if (question) {
+ problem.description = `闂锛�${question.text}`;
+ }
+
+ // 鏍规嵁闂绫诲瀷鍒濆鍖栫瓟妗堝瓧娈�
+ const originalData = this.getQuestionOriginalData(questionId);
+ if (originalData) {
+ // 鍒濆鍖栧崟閫夌瓟妗�
+ if (originalData.scriptType === 1) {
+ problem.selectedOption = originalData.scriptResult || "";
+ // 妫�鏌ユ槸鍚﹂渶瑕佹樉绀洪檮鍔犺緭鍏ユ
+ problem.showAppendInput = originalData.showAppendInput || false;
+ problem.appendInput = originalData.answerps || "";
+ }
+ // 鍒濆鍖栧閫夌瓟妗�
+ else if (originalData.scriptType === 2) {
+ problem.selectedOptions = Array.isArray(originalData.scriptResult)
+ ? [...originalData.scriptResult]
+ : originalData.scriptResult
+ ? originalData.scriptResult.split("&")
+ : [];
+ }
+ // 鍒濆鍖栧~绌虹瓟妗�
+ else if (originalData.scriptType === 4) {
+ problem.answer = originalData.scriptResult || "";
+ }
+ }
+ },
+
+ // 鏍规嵁闂ID鑾峰彇闂鏂囨湰
+ getQuestionText(questionId) {
+ if (!questionId) return "鏈�夋嫨闂";
+ const question = this.availableQuestions.find((q) => q.id === questionId);
+ return question
+ ? `${question.index + 1}. ${question.text}`
+ : "闂宸插垹闄�";
+ },
+
+ // 鎴柇鏂囨湰
+ truncateText(text, length) {
+ if (!text) return "";
+ return text.length > length ? text.substring(0, length) + "..." : text;
+ },
+ // 纭闂閫夋嫨
+ confirmQuestionSelection() {
+ if (this.selectedQuestionIds.length === 0) {
+ this.$modal.msgWarning("璇疯嚦灏戦�夋嫨涓�涓欢缁棶棰�");
+ return;
+ }
+
+ // 鑾峰彇褰撳墠婵�娲荤殑鏍囩椤电储寮�
+ const activeTabIndex = this.continuityTabs.findIndex(
+ (tab) => tab.name === this.activeContinuityTab
+ );
+
+ if (activeTabIndex === -1) {
+ this.$modal.msgError("鏈壘鍒版縺娲荤殑寤剁画鎶ょ悊鏍囩椤�");
+ return;
+ }
+
+ // 娣诲姞閫変腑鐨勯棶棰樺埌褰撳墠鏍囩椤�
+ this.selectedQuestionIds.forEach((questionId) => {
+ // 妫�鏌ユ槸鍚﹀凡瀛樺湪鐩稿悓闂
+ const exists = this.continuityTabs[
+ activeTabIndex
+ ].form.continuityProblems.some(
+ (problem) => problem.questionId === questionId
+ );
+
+ if (!exists) {
+ this.continuityTabs[activeTabIndex].form.continuityProblems.push({
+ questionId: questionId,
+ status: "pending",
+ description: "",
+ resolvedDate: "",
+ createTime: new Date().toISOString(),
+ });
+ }
+ });
+
+ // 鍏抽棴閫夋嫨闈㈡澘
+ this.showQuestionSelector = false;
+ this.selectedQuestionIds = [];
+
+ this.$modal.msgSuccess(
+ `宸叉坊鍔� ${this.selectedQuestionIds.length} 涓欢缁棶棰榒
+ );
+ },
+
+ // 绉婚櫎寤剁画闂
+ removeContinuityProblem(tabIndex, problemIndex) {
+ this.continuityTabs[tabIndex].form.continuityProblems.splice(
+ problemIndex,
+ 1
+ );
+ },
+
+ // 鑾峰彇璇煶鏁版嵁
+ getPersonVoices(id) {
+ let obj = {
+ taskid: this.taskid,
+ patid: this.patid,
+ subId: id ? id : this.id,
+ };
+
+ getPersonVoices(obj).then((res) => {
+ if (res.code == 200) {
+ this.voiceDatatop = res.data.serviceSubtaskDetails;
+ this.voice = res.data.voice;
+ this.activeName = "yy";
+ this.taskname = res.data.taskName;
+ this.tableDatatop = res.data.filteredDetails;
+ this.tableDatatop.forEach((item) => {
+ if (item.targetvalue) {
+ item.scriptResult = item.targetvalue.split("&");
+ } else {
+ item.scriptResult = [];
+ }
+ });
+
+ // 鎻愬彇鍙�夌殑寤剁画闂
+ this.extractAvailableQuestions();
+ }
+ });
+ },
+
+ // 鑾峰彇鍩虹淇℃伅
+ getuserinfo() {
+ const queryParams = {
+ pid: Number(this.patid),
+ allhosp: "0",
+ };
+
+ messagelistpatient(queryParams).then((response) => {
+ if (response.rows[0]) {
+ this.userform = response.rows[0];
+ this.initPatientForm();
+ }
+ });
+
+ listcontactinformation({ patid: this.patid }).then((response) => {
+ this.tableData = response.rows;
+ if (this.tableData.length) {
+ this.patientForm.relativeName = this.tableData[0].relation || "";
+ this.patientForm.relativeTel = this.tableData[0].contactway || "";
+ }
+ });
+ },
+
+ // 鍒濆鍖栨偅鑰呰〃鍗�
+ initPatientForm() {
+ if (this.userform) {
+ this.patientForm.name = this.userform.name || "";
+ this.patientForm.sex = this.userform.sex || "";
+ this.patientForm.age = this.userform.age || "";
+ this.patientForm.telcode = this.userform.telcode || "";
+ this.patientForm.address = this.userform.placeOfResidence || "";
+ this.patientForm.hospitalNumber = this.userform.medicalRecordNo || "";
+ }
+
+ if (this.form) {
+ this.patientForm.dischargeDate =
+ this.formatTime(this.form.endtime) || "";
+ this.patientForm.diagnosis = this.form.leavediagname || "";
+ this.patientForm.nurseName = this.form.nurseName || "";
+ }
+ },
+
+ // 鑾峰彇鎮h�呰褰�
+ getTaskservelist(id) {
+ getTaskservelist({
+ patid: this.patid,
+ subId: id,
+ pageSize: 100,
+ }).then((res) => {
+ if (res.code == 200) {
+ this.form = res.rows[0].serviceSubtaskList.find(
+ (item) => item.id == this.id
+ );
+ this.logsheetlist = res.rows[0].serviceSubtaskList;
+
+ // 鍒濆鍖栨偅鑰呬俊鎭�
+ this.initPatientForm();
+
+ // 鍔犺浇鍘嗗彶寤剁画鎶ょ悊鏁版嵁
+ this.loadContinuityHistory();
+ this.getuserinfo();
+ }
+
+ if (this.Voicetype) {
+ this.getPersonVoices();
+ } else {
+ this.getsearchrResults();
+ }
+ });
+ },
+
+ // 鍔犺浇鍘嗗彶寤剁画鎶ょ悊鏁版嵁
+ loadContinuityHistory() {
+ if (this.form && this.form.continueContent) {
+ try {
+ const historyData = JSON.parse(this.form.continueContent);
+ this.continuityTabs = historyData.map((item, index) => ({
+ name: `continuity-${index}`,
+ title: `寤剁画鎶ょ悊${index + 1}`,
+ form: {
+ continuityProblems: item.continuityProblems || [],
+ careRecord: item.careRecord || "",
+ dutyNurse: item.dutyNurse || "",
+ visitType: item.visitType || "",
+ serviceTime: item.serviceTime || "",
+ nextServiceTime: item.nextServiceTime || "",
+ },
+ saving: false,
+ }));
+
+ if (this.continuityTabs.length > 0) {
+ this.activeContinuityTab = this.continuityTabs[0].name;
+ }
+
+ // 鏇存柊姹囨�讳俊鎭�
+ this.updateContinuitySummary();
+ } catch (error) {
+ console.error("瑙f瀽寤剁画鎶ょ悊鍘嗗彶鏁版嵁澶辫触:", error);
+ }
+ }
+ },
+
+ // 鏇存柊寤剁画鎶ょ悊姹囨�讳俊鎭�
+ updateContinuitySummary() {
+ if (this.form) {
+ this.continuitySummary.continueCount = this.form.continueCount || 0;
+ this.continuitySummary.continueTimeNow =
+ this.form.continueTimeNow || "";
+ this.continuitySummary.continueTimeNext =
+ this.form.continueTimeNext || "";
+ this.continuitySummary.continueContent =
+ this.form.continueContent || "";
+ }
+ },
+
+ // 娣诲姞寤剁画鎶ょ悊鏍囩椤�
+ addContinuityTab() {
+ console.log(this.continuityTabs.length);
+ if (this.continuityTabs.length) {
+ this.continuityTabIndex = this.continuityTabs.length;
+ }
+ const newIndex = this.continuityTabIndex + 1;
+ const newTab = {
+ name: `continuity-${newIndex}`,
+ title: `寤剁画鎶ょ悊${newIndex}`,
+ form: {
+ continuityProblems: [],
+ careRecord: "",
+ dutyNurse: "",
+ visitType: "",
+ serviceTime: "",
+ nextServiceTime: "",
+ },
+ saving: false,
+ };
+
+ this.continuityTabs.push(newTab);
+ this.continuityTabIndex = newIndex;
+ this.activeContinuityTab = newTab.name;
+ },
+
+ // 绉婚櫎寤剁画鎶ょ悊鏍囩椤�
+ removeContinuityTab(targetName) {
+ const tabs = this.continuityTabs;
+ let activeName = this.activeContinuityTab;
+
+ if (activeName === targetName) {
+ tabs.forEach((tab, index) => {
+ if (tab.name === targetName) {
+ const nextTab = tabs[index + 1] || tabs[index - 1];
+ if (nextTab) {
+ activeName = nextTab.name;
+ }
+ }
+ });
+ }
+
+ this.activeContinuityTab = activeName;
+ this.continuityTabs = tabs.filter((tab) => tab.name !== targetName);
+ },
+
+ // 澶勭悊鏍囩椤电偣鍑�
+ handleTabClick(tab) {
+ this.activeContinuityTab = tab.name;
+ },
+
+ // 璁$畻璺濈涓嬫鏈嶅姟杩樻湁澶氬皯澶�
+ calculateDaysLeft(nextServiceTime) {
+ if (!nextServiceTime) return 0;
+
+ const nextTime = new Date(nextServiceTime);
+ const now = new Date();
+ const diffTime = nextTime - now;
+ const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
+
+ return diffDays > 0 ? diffDays : 0;
+ },
+
+ // 淇濆瓨寤剁画鎶ょ悊鏍囩椤�
+ saveContinuityTab(index) {
+ const formRef = this.$refs[`continuityForm${index}`];
+ if (!formRef) return;
+
+ // 楠岃瘉鍩烘湰琛ㄥ崟
+ formRef[0].validate((valid) => {
+ if (valid) {
+ // 楠岃瘉寤剁画闂鏄惁瀹屾暣
+ const problems = this.continuityTabs[index].form.continuityProblems;
+ let hasError = false;
+
+ problems.forEach((problem, problemIndex) => {
+ if (!problem.questionId) {
+ hasError = true;
+ this.$modal.msgError(`绗�${problemIndex + 1}涓欢缁棶棰樻湭閫夋嫨`);
+ }
+ });
+
+ if (hasError) {
+ return false;
+ }
+
+ this.continuityTabs[index].saving = true;
+
+ // 鏇存柊姹囨�讳俊鎭�
+ this.updateContinuitySummaryFromTabs();
+
+ // 璋冪敤淇濆瓨API
+ this.saveContinuityData();
+ } else {
+ this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�");
+ return false;
+ }
+ });
+ },
+
+ // 鏇存柊寤剁画鎶ょ悊姹囨�讳俊鎭�
+ updateContinuitySummaryFromTabs() {
+ if (this.continuityTabs.length === 0) return;
+
+ // 鎵惧埌鏈�鏂扮殑鏈嶅姟鏃堕棿
+ let latestTime = "";
+ let nextTime = "";
+ let totalProblems = 0;
+
+ this.continuityTabs.forEach((tab) => {
+ if (tab.form.serviceTime) {
+ if (
+ !latestTime ||
+ new Date(tab.form.serviceTime) > new Date(latestTime)
+ ) {
+ latestTime = tab.form.serviceTime;
+ }
+ }
+ if (tab.form.nextServiceTime) {
+ if (
+ !nextTime ||
+ new Date(tab.form.nextServiceTime) < new Date(nextTime)
+ ) {
+ nextTime = tab.form.nextServiceTime;
+ }
+ }
+
+ // 缁熻闂鏁伴噺
+ totalProblems += tab.form.continuityProblems.length;
+ });
+
+ this.continuitySummary.continueCount = this.continuityTabs.length;
+ this.continuitySummary.continueTimeNow = latestTime;
+ this.continuitySummary.continueTimeNext = nextTime;
+
+ // 鏋勫缓瀹屾暣鐨勫欢缁姢鐞嗘暟鎹�
+ const continuityData = this.continuityTabs.map((tab) => ({
+ ...tab.form,
+ tabTitle: tab.title,
+ tabName: tab.name,
+ }));
+
+ this.continuitySummary.continueContent = JSON.stringify(continuityData);
+ this.continuitySummary.totalProblems = totalProblems;
+ },
+
+ // 淇濆瓨寤剁画鎶ょ悊鏁版嵁
+ saveContinuityData() {
+ const vm = this;
+
+ // 楠岃瘉姣忎釜闂鐨剄uestionId鏄惁宸查�夋嫨
+ let hasEmptyQuestion = false;
+ this.continuityTabs.forEach((tab, tabIndex) => {
+ tab.form.continuityProblems.forEach((problem, problemIndex) => {
+ if (!problem.questionId) {
+ hasEmptyQuestion = true;
+ vm.$modal.msgError(
+ `绗�${tabIndex + 1}涓爣绛鹃〉鐨勭${problemIndex + 1}涓棶棰樻湭閫夋嫨`
+ );
+ }
+ });
+ });
+
+ if (hasEmptyQuestion) {
+ return;
+ }
+
+ const formData = {
+ id: vm.id,
+ patid: vm.patid,
+ taskid: vm.taskid,
+ continueFlag: 2,
+ continueCount: vm.continuitySummary.continueCount,
+ continueTimeNow: vm.continuitySummary.continueTimeNow,
+ continueTimeNext: vm.continuitySummary.continueTimeNext,
+ continueContent: vm.continuitySummary.continueContent,
+ // 鍙互娣诲姞闂嵎绛旀鐨勬暣鍚�
+ // questionnaireAnswers: vm.continuityTabs.map((tab) => ({
+ // tabName: tab.name,
+ // problems: tab.form.continuityProblems.map((problem) => ({
+ // questionId: problem.questionId,
+ // answer:
+ // problem.selectedOption ||
+ // problem.selectedOptions ||
+ // problem.answer,
+ // status: problem.status,
+ // description: problem.description,
+ // })),
+ // })),
+ };
+
+ Editsingletaskson(formData)
+ .then((res) => {
+ if (res.code === 200) {
+ vm.$modal.msgSuccess("寤剁画鎶ょ悊璁板綍淇濆瓨鎴愬姛");
+ // 閲嶇疆淇濆瓨鐘舵��
+ vm.continuityTabs.forEach((tab) => {
+ tab.saving = false;
+ });
+ } else {
+ vm.$modal.msgError("淇濆瓨澶辫触");
+ }
+ })
+ .catch((error) => {
+ console.error("淇濆瓨澶辫触:", error);
+ vm.$modal.msgError("淇濆瓨澶辫触");
+ vm.continuityTabs.forEach((tab) => {
+ tab.saving = false;
+ });
+ });
+ },
+
+ // 閲嶇疆寤剁画鎶ょ悊鏍囩椤�
+ resetContinuityTab(index) {
+ this.continuityTabs[index].form = {
+ continuityProblems: [],
+ careRecord: "",
+ dutyNurse: "",
+ visitType: "",
+ serviceTime: "",
+ nextServiceTime: "",
+ };
+ this.$refs[`continuityForm${index}`][0].clearValidate();
+ },
+
+ // 淇濆瓨鎮h�呬俊鎭�
+ savePatientInfo() {
+ this.$refs.patientForm.validate((valid) => {
+ if (valid) {
+ this.savingPatientInfo = true;
+
+ // 鏇存柊userform鏁版嵁
+ const updatedUserform = {
+ ...this.userform,
+ name: this.patientForm.name,
+ sex: this.patientForm.sex,
+ age: this.patientForm.age,
+ telcode: this.patientForm.telcode,
+ placeOfResidence: this.patientForm.address,
+ medicalRecordNo: this.patientForm.hospitalNumber,
+ };
+
+ alterpatient(updatedUserform)
+ .then((res) => {
+ if (res.code == 200) {
+ this.$modal.msgSuccess("鎮h�呬俊鎭繚瀛樻垚鍔�");
+ this.userform = updatedUserform;
+ } else {
+ this.$modal.msgError("鎮h�呬俊鎭慨鏀瑰け璐�");
+ }
+ this.savingPatientInfo = false;
+ })
+ .catch((error) => {
+ console.error("淇濆瓨澶辫触:", error);
+ this.$modal.msgError("淇濆瓨澶辫触");
+ this.savingPatientInfo = false;
+ });
+ } else {
+ this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�");
+ return false;
+ }
+ });
+ },
+
+ // 閲嶇疆鎮h�呬俊鎭�
+ resetPatientInfo() {
+ this.initPatientForm();
+ this.$refs.patientForm.clearValidate();
+ },
+
+ // 鏃堕棿鏍煎紡鍖�
+ formatTime(time) {
+ if (!time) return "";
+ return time.split(" ")[0];
+ },
+
+ // 鏍煎紡鍖栨樉绀烘椂闂�
+ formatDisplayTime(time) {
+ if (!time) return "鏈缃�";
+ return time.replace(" ", " ");
+ },
+
+ // 寮傚父鍒楁覆鏌�
+ tableRowClassName({ row }) {
+ if (row.id == this.id) {
+ return "warning-row";
+ }
+ return "";
+ },
+ },
+};
+</script>
+<style lang="scss" scoped>
+.ContinuityCarePage {
+ margin: 10px;
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+}
+
+.headline {
+ font-size: 20px;
+ height: 40px;
+ border-left: 5px solid #41a1be;
+ padding-left: 10px;
+ margin-bottom: 20px;
+ display: flex;
+ align-items: center;
+ color: #333;
+ font-weight: 600;
+}
+
+.sub-headline {
+ font-size: 16px;
+ height: 36px;
+ padding-left: 8px;
+ margin-bottom: 15px;
+ display: flex;
+ align-items: center;
+ color: #409eff;
+ font-weight: 500;
+ border-bottom: 2px solid #e4e7ed;
+ padding-bottom: 8px;
+
+ i {
+ margin-right: 8px;
+ font-size: 18px;
+ }
+}
+
+/* 绗竴閮ㄥ垎锛氭湇鍔″熀纭�淇℃伅 */
+.basic-info-section {
+ margin: 0 10px;
+ padding: 20px;
+ background: #fff;
+ border: 1px solid #dcdfe6;
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
+ border-radius: 4px;
+
+ .basic-info-container {
+ display: flex;
+ gap: 20px;
+ min-height: 1000px;
+
+ @media screen and (max-width: 1200px) {
+ flex-direction: column;
+ }
+ }
+
+ .followup-content {
+ flex: 1;
+ min-width: 0;
+
+ &.readonly-content {
+ background: #f8f9fa;
+ border-radius: 8px;
+ padding: 15px;
+ border: 1px solid #e4e7ed;
+ }
+
+ .content-container {
+ height: calc(1000px - 60px);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+
+ ::v-deep .el-tabs {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+
+ .el-tabs__content {
+ flex: 1;
+ overflow: hidden;
+
+ .el-tab-pane {
+ height: 100%;
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ }
+ }
+ }
+ }
+ }
+
+ .continuity-history {
+ flex: 1;
+ min-width: 0;
+ background: #fff;
+ border-radius: 8px;
+ padding: 15px;
+ border: 1px solid #e4e7ed;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+
+ .history-content {
+ height: calc(1000px - 60px);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+
+ ::v-deep .el-tabs {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+
+ .el-tabs__content {
+ flex: 1;
+ overflow-y: auto;
+ padding: 15px 0;
+
+ .continuity-form {
+ padding: 0 10px;
+
+ .el-form {
+ .selected-problems {
+ margin-top: 10px;
+ padding: 10px;
+ background: #f5f7fa;
+ border-radius: 4px;
+ border: 1px solid #e4e7ed;
+ }
+
+ .time-tip {
+ margin-top: 5px;
+ font-size: 12px;
+ color: #67c23a;
+ font-style: italic;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+.patient-info-section {
+ margin: 0 10px 20px 10px;
+ padding: 20px;
+ background: #fff;
+ border: 1px solid #dcdfe6;
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
+ border-radius: 4px;
+
+ .patient-info-form {
+ .continuity-summary {
+ padding: 15px;
+ background: #ddf0f8;
+ border-radius: 8px;
+ border: 1px solid #b3e0f2;
+
+ .summary-item {
+ display: inline-block;
+ margin-right: 30px;
+ margin-bottom: 8px;
+
+ .label {
+ font-weight: 500;
+ color: #333;
+ }
+
+ .value {
+ color: #409eff;
+ font-weight: 500;
+ }
+ }
+ }
+ }
+}
+
+/* 鍏变韩鏍峰紡 */
+.CONTENT {
+ padding: 10px;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+
+ .title {
+ font-size: 18px;
+ font-weight: bold;
+ margin-bottom: 20px;
+ text-align: center;
+ color: #333;
+ }
+}
+
+.preview-left {
+ margin: 10px;
+ padding: 20px;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ max-height: 800px;
+ overflow-y: auto;
+ background: #fff;
+ flex: 1;
+
+ .topic-dev {
+ margin-bottom: 20px;
+ font-size: 16px;
+
+ .dev-text {
+ margin-bottom: 10px;
+ font-weight: 500;
+ color: #333;
+ }
+ }
+}
+
+.scriptTopic-dev {
+ padding: 15px;
+ border-radius: 4px;
+ background: #fafafa;
+ border: 1px solid #e4e7ed;
+ margin-bottom: 15px;
+}
+
+.scriptTopic-isabnormal {
+ padding: 15px;
+ border-radius: 4px;
+ background: #fff5f5;
+ border: 1px solid #f56c6c;
+ color: #f56c6c;
+ margin-bottom: 15px;
+}
+
+.scriptTopic-warning {
+ padding: 15px;
+ border-radius: 4px;
+ background: #fff9e6;
+ border: 1px solid #e6a23c;
+ color: #e6a23c;
+ margin-bottom: 15px;
+}
+
+.red-star {
+ ::v-deep.el-radio__label {
+ position: relative;
+ padding-right: 10px;
+ }
+
+ ::v-deep.el-radio__label::after {
+ content: "*";
+ color: #f56c6c;
+ position: absolute;
+ right: -5px;
+ top: 0;
+ }
+}
+
+.yellow-star {
+ ::v-deep.el-radio__label {
+ position: relative;
+ padding-right: 10px;
+ }
+
+ ::v-deep.el-radio__label::after {
+ content: "*";
+ color: #e6a23c;
+ position: absolute;
+ right: -5px;
+ top: 0;
+ font-weight: bold;
+ }
+}
+
+.borderdiv {
+ height: 100%;
+ padding: 10px;
+ display: flex;
+ flex-direction: column;
+
+ .title {
+ font-size: 18px;
+ font-weight: bold;
+ margin-bottom: 20px;
+ text-align: center;
+ }
+
+ .voice-audio {
+ display: flex;
+ align-items: center;
+ color: #59a0f0;
+ margin-bottom: 20px;
+ padding: 10px;
+ background: #f5f7fa;
+ border-radius: 4px;
+ }
+
+ .preview-left {
+ flex: 1;
+ margin: 0;
+
+ .leftside {
+ margin: 15px 0;
+
+ span {
+ display: inline-block;
+ padding: 8px 12px;
+ background: #409eff;
+ color: #fff;
+ border-radius: 8px;
+ max-width: 80%;
+ margin-left: 10px;
+ }
+ }
+
+ .offside {
+ display: flex;
+ flex-direction: row-reverse;
+ margin: 15px 0;
+
+ .offside-value {
+ padding: 8px 12px;
+ background: #67c23a;
+ color: #fff;
+ border-radius: 8px;
+ max-width: 80%;
+ margin-right: 10px;
+ }
+ }
+ }
+}
+
+/* 鍝嶅簲寮忚璁� */
+@media (max-width: 768px) {
+ .ContinuityCarePage {
+ margin: 5px;
+ gap: 10px;
+ }
+
+ .basic-info-section,
+ .patient-info-section {
+ margin: 0 5px;
+ padding: 10px;
+ }
+
+ .basic-info-container {
+ gap: 10px !important;
+ }
+
+ .patient-info-form {
+ .el-row {
+ flex-direction: column;
+ }
+
+ .el-col {
+ width: 100% !important;
+ margin-bottom: 10px;
+ }
+ }
+
+ .preview-left {
+ margin: 5px;
+ padding: 10px;
+ }
+}
+/* 闂閫夋嫨鍣ㄩ潰鏉� */
+.question-selector-panel {
+ margin-bottom: 20px;
+ padding: 15px;
+ background: #f8f9fa;
+ border: 1px solid #e4e7ed;
+ border-radius: 8px;
+
+ .selector-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 15px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #e4e7ed;
+
+ span {
+ font-weight: 500;
+ color: #333;
+ }
+ }
+
+ .question-list {
+ max-height: 200px;
+ overflow-y: auto;
+ padding-right: 10px;
+
+ .question-item {
+ margin-bottom: 10px;
+ padding: 8px 12px;
+ background: #fff;
+ border-radius: 6px;
+ border: 1px solid #e4e7ed;
+ transition: all 0.3s;
+
+ &:hover {
+ border-color: #409eff;
+ background: #f0f7ff;
+ }
+
+ .question-content {
+ display: flex;
+ align-items: flex-start;
+
+ .question-index {
+ font-weight: 600;
+ color: #409eff;
+ min-width: 30px;
+ }
+
+ .question-text {
+ flex: 1;
+ line-height: 1.5;
+ }
+ }
+ }
+ }
+}
+
+/* 寤剁画闂琛ㄥ崟 */
+.continuity-problems-form {
+ .problems-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 15px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #e4e7ed;
+
+ span {
+ font-weight: 500;
+ color: #333;
+ }
+ }
+
+ .problems-list {
+ .problem-item {
+ margin-bottom: 20px;
+ padding: 15px;
+ background: #f8f9fa;
+ border-radius: 8px;
+ border: 1px solid #e4e7ed;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .problem-content {
+ .problem-meta {
+ display: flex;
+ align-items: center;
+ margin-bottom: 15px;
+ padding-bottom: 10px;
+ border-bottom: 1px dashed #e4e7ed;
+
+ .problem-index {
+ font-weight: 500;
+ color: #409eff;
+ min-width: 80px;
+ }
+ }
+
+ .problem-detail {
+ .detail-row {
+ display: flex;
+ align-items: flex-start;
+ margin-bottom: 10px;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .detail-label {
+ font-weight: 500;
+ color: #666;
+ min-width: 100px;
+ line-height: 32px;
+ }
+
+ .detail-value {
+ flex: 1;
+ line-height: 1.5;
+ color: #333;
+ padding: 5px 0;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ .empty-problems {
+ text-align: center;
+ padding: 30px 0;
+ background: #fafafa;
+ border-radius: 8px;
+ border: 1px dashed #e4e7ed;
+ }
+}
+/* 寤剁画闂鍒楄〃瀹瑰櫒 - 娣诲姞婊氬姩 */
+.problems-list-container {
+ max-height: 400px; /* 鎺у埗鏈�澶ч珮搴� */
+ overflow-y: auto;
+ padding-right: 10px;
+ margin-bottom: 15px;
+
+ &::-webkit-scrollbar {
+ width: 6px;
+ }
+
+ &::-webkit-scrollbar-track {
+ background: #f1f1f1;
+ border-radius: 3px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background: #c1c1c1;
+ border-radius: 3px;
+
+ &:hover {
+ background: #a8a8a8;
+ }
+ }
+}
+
+/* 闂嵎寮忛棶棰樺睍绀� */
+.question-display-area {
+ margin: 15px 0;
+ padding: 15px;
+ background: #fff;
+ border-radius: 8px;
+ border: 1px solid #e4e7ed;
+
+ .question-item-render {
+ .question-text {
+ margin-bottom: 15px;
+ font-size: 14px;
+ line-height: 1.5;
+ color: #333;
+
+ strong {
+ color: #409eff;
+ margin-right: 5px;
+ }
+
+ span {
+ color: #666;
+ }
+ }
+
+ .question-options {
+ margin-left: 20px;
+
+ .el-radio,
+ .el-checkbox {
+ display: block;
+ margin-bottom: 8px;
+ margin-right: 20px;
+ }
+ }
+
+ .append-input {
+ margin-left: 20px;
+ margin-top: 10px;
+ }
+ }
+
+ .no-question-data {
+ text-align: center;
+ color: #999;
+ padding: 20px;
+ font-style: italic;
+ }
+}
+
+/* 璋冩暣闂璇︽儏甯冨眬 */
+.problem-detail {
+ margin-top: 5px;
+ padding-top: 5px;
+ padding-bottom: 20px;
+ margin-bottom: 10px;
+ border-bottom: 1px dashed #6e9af4;
+
+ .detail-row {
+ display: flex;
+ align-items: center;
+ margin-bottom: 15px;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .detail-label {
+ font-weight: 500;
+ color: #666;
+ min-width: 80px;
+ white-space: nowrap;
+ }
+ }
+}
+
+/* 鍝嶅簲寮忚皟鏁� */
+@media (max-width: 768px) {
+ .problems-list-container {
+ max-height: 300px;
+ }
+
+ .problem-detail {
+ .detail-row {
+ flex-direction: column;
+ align-items: flex-start;
+
+ .detail-label {
+ margin-bottom: 5px;
+ min-width: auto;
+ }
+
+ .el-select,
+ .el-date-picker {
+ width: 100% !important;
+ margin: 5px 0 !important;
+ }
+ }
+ }
+}
+/* 鍝嶅簲寮忚皟鏁� */
+@media (max-width: 768px) {
+ .question-selector-panel {
+ padding: 10px;
+
+ .question-list {
+ .question-item {
+ padding: 6px 8px;
+ }
+ }
+ }
+
+ .continuity-problems-form {
+ .problems-list {
+ .problem-item {
+ padding: 10px;
+
+ .problem-content {
+ .problem-meta {
+ flex-direction: column;
+ align-items: flex-start;
+
+ .el-select {
+ width: 100% !important;
+ margin: 10px 0;
+ }
+ }
+
+ .problem-detail {
+ .detail-row {
+ flex-direction: column;
+ align-items: flex-start;
+
+ .detail-label {
+ margin-bottom: 5px;
+ min-width: auto;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+/* 婊氬姩鏉$編鍖� */
+.preview-left,
+.history-content .el-tabs__content,
+.content-container .el-tabs__content {
+ &::-webkit-scrollbar {
+ width: 6px;
+ }
+
+ &::-webkit-scrollbar-track {
+ background: #f1f1f1;
+ border-radius: 3px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background: #c1c1c1;
+ border-radius: 3px;
+
+ &:hover {
+ background: #a8a8a8;
+ }
+ }
+}
+</style>
--
Gitblit v1.9.3