WXL (wul)
18 小时以前 55f9876e876c7ddfcc2a7a2b870dfc224c9467a6
测试完成
已修改8个文件
已添加1个文件
4910 ■■■■■ 文件已修改
src/api/AiCentre/Qtemplate.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Satisfaction/configurationmyd/index.vue 1027 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/js/prototype.js 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/record/detailpage/index copy.vue 3703 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/record/detailpage/index.vue 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/knowledge/questionbank/particulars/index.vue 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/patient/propaganda/QuestionnaireTask.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/AiCentre/Qtemplate.js
@@ -232,3 +232,11 @@
    data: data,
  });
}
// åŒ»æŠ¤ä¿å­˜æ•°æ®
export function savequestiondetail(data) {
  return request({
    url: "/smartor/subtaskAnswer/savequestiondetail",
    method: "post",
    data: data,
  });
}
src/views/Satisfaction/configurationmyd/index.vue
@@ -5,13 +5,149 @@
      <div class="header-content">
        <h2 class="page-title">满意度题目异常处理配置</h2>
        <p class="page-description">
          ä¸ºæ»¡æ„åº¦é¢˜ç›®é…ç½®è´£ä»»ç§‘室和报备科室,优化异常反馈流程
          åŸºäºŽæ¨¡æ¿é…ç½®æ»¡æ„åº¦é¢˜ç›®çš„责任科室和报备科室
        </p>
      </div>
    </div>
    <!-- æœç´¢åŒºåŸŸ -->
    <div class="search-card">
    <!-- æ¨¡æ¿é€‰æ‹©åŒºåŸŸ -->
    <div class="template-section">
      <el-card shadow="never">
        <div class="template-header">
          <h3 class="template-title">模板选择</h3>
          <p class="template-tip">请先选择模板类型和具体模板</p>
        </div>
        <el-form
          :model="templateForm"
          :rules="templateRules"
          ref="templateForm"
          label-width="120px"
          size="medium"
        >
          <el-row :gutter="20">
            <el-col :span="8">
              <el-form-item label="模板类型" prop="templateType">
                <el-select
                  v-model="templateForm.templateType"
                  placeholder="请选择模板类型"
                  clearable
                  @change="handleTemplateTypeChange"
                  style="width: 100%"
                >
                  <el-option label="问卷模板" :value="1" />
                  <el-option label="语音模板" :value="2" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="选择模板"
                prop="templateId"
                :rules="
                  templateForm.templateType
                    ? [
                        {
                          required: true,
                          message: '请选择模板',
                          trigger: 'change',
                        },
                      ]
                    : []
                "
              >
                <el-select
                  v-model="templateForm.templateId"
                  placeholder="请选择模板"
                  clearable
                  filterable
                  :disabled="
                    !templateForm.templateType || templateOptionsLoading
                  "
                  @change="handleTemplateChange"
                  style="width: 100%"
                >
                  <el-option
                    v-for="template in filteredTemplateOptions"
                    :key="template.id"
                    :label="template.templateName"
                    :value="template.id"
                  />
                  <div
                    v-if="templateOptionsLoading"
                    slot="empty"
                    class="select-loading"
                  >
                    <i class="el-icon-loading"></i>
                    <span>加载中...</span>
                  </div>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  @click="handleLoadTemplate"
                  :loading="templateLoading"
                  :disabled="!templateForm.templateId"
                >
                  åŠ è½½æ¨¡æ¿é¢˜ç›®
                </el-button>
                <el-button icon="el-icon-refresh" @click="handleResetTemplate">
                  é‡ç½®
                </el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-card>
    </div>
    <!-- æ¨¡æ¿ä¿¡æ¯ -->
    <div v-if="currentTemplateInfo" class="template-info-section">
      <el-card shadow="never">
        <div class="template-info">
          <div class="info-left">
            <h3 class="template-name">
              {{ currentTemplateInfo.templateName }}
            </h3>
            <div class="template-meta">
              <span class="meta-item">
                <i class="el-icon-s-order"></i>
                æ¨¡æ¿ç±»åž‹ï¼š{{
                  templateForm.templateType === 1 ? "问卷模板" : "语音模板"
                }}
              </span>
              <span class="meta-item">
                <i class="el-icon-s-management"></i>
                é¢˜ç›®æ€»æ•°ï¼š{{ currentTemplateInfo.questionCount || 0 }}
              </span>
              <span class="meta-item">
                <i class="el-icon-star-on"></i>
                æ»¡æ„åº¦é¢˜ç›®ï¼š{{ satisfactionQuestionsCount }}
              </span>
            </div>
          </div>
          <div class="info-right">
            <el-tag
              :type="
                currentTemplateInfo.templateStatus === 1 ? 'success' : 'info'
              "
              size="medium"
            >
              {{ currentTemplateInfo.templateStatus === 1 ? "启用" : "停用" }}
            </el-tag>
          </div>
        </div>
      </el-card>
    </div>
    <!-- æœç´¢åŒºåŸŸï¼ˆé¢˜ç›®ç­›é€‰ï¼‰ -->
    <div v-if="questionList.length > 0" class="search-section">
      <el-card shadow="never" class="search-container">
        <el-form :model="queryParams" :inline="true" size="medium">
          <el-form-item label="问题主题">
@@ -30,30 +166,16 @@
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="是否可用">
            <el-select
              v-model="queryParams.isavailable"
              placeholder="请选择"
              clearable
            >
              <el-option
                v-for="item in qyoptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="handleQuery"
            >
              æœç´¢
              ç­›é€‰é¢˜ç›®
            </el-button>
            <el-button icon="el-icon-refresh" @click="resetQuery">
              é‡ç½®
              é‡ç½®ç­›é€‰
            </el-button>
          </el-form-item>
        </el-form>
@@ -79,7 +201,9 @@
            <span v-if="changedCount > 0" class="change-count">
              æœ‰ {{ changedCount }} é¡¹é…ç½®éœ€è¦ä¿å­˜
            </span>
            <div class="total-count">共 {{ total }} æ¡è®°å½•</div>
            <div class="total-count">
              å…± {{ filteredQuestionList.length }} æ¡è®°å½•
            </div>
          </div>
        </el-card>
      </div>
@@ -91,18 +215,22 @@
        </div>
      </div>
      <div v-else-if="questionList.length === 0" class="empty-wrapper">
        <el-empty description="暂无满意度题目数据">
          <el-button type="primary" @click="getQuestionList"
            >刷新数据</el-button
      <div
        v-else-if="questionList.length === 0 && templateForm.templateId"
        class="empty-wrapper"
          >
        <el-empty description="该模板中暂无满意度题目">
          <p class="empty-tip">
            è¯·é€‰æ‹©å…¶ä»–模板或检查模板中是否包含满意度类型题目(分类ID:
            404,405,406)
          </p>
        </el-empty>
      </div>
      <!-- ä¸€è¡Œä¸€è¡Œçš„卡片列表 -->
      <div v-else class="question-list">
      <div v-else-if="filteredQuestionList.length > 0" class="question-list">
        <div
          v-for="(question, index) in questionList"
          v-for="(question, index) in filteredQuestionList"
          :key="question.id"
          class="question-item"
        >
@@ -124,12 +252,6 @@
                      {{ question.scriptTopic || "无主题" }}
                    </h3>
                    <div class="question-tags">
                      <el-tag
                        :type="question.isavailable == 1 ? 'danger' : 'success'"
                        size="small"
                      >
                        {{ question.isavailable == 1 ? "不可用" : "可用" }}
                      </el-tag>
                      <dict-tag
                        :options="askvaluetype"
                        :value="question.scriptType"
@@ -180,7 +302,7 @@
                class="config-form"
              >
                <div class="config-fields">
                  <!-- è´£ä»»ç§‘室 -->
                  <!-- è´£ä»»ç§‘室(多选) -->
                  <div class="config-field">
                    <el-form-item
                      label="责任科室"
@@ -192,21 +314,25 @@
                        placeholder="请选择责任科室"
                        filterable
                        clearable
                        multiple
                        collapse-tags
                        style="width: 100%"
                        @change="handleConfigChange(question)"
                      >
                        <el-option
                          v-for="dept in deptOptions"
                          :key="dept.id"
                          :label="dept.name"
                          :value="dept.id"
                          :label="dept.label"
                          :value="dept.deptCode"
                        />
                      </el-select>
                      <div class="config-tip">负责处理该题目反馈的科室</div>
                      <div class="config-tip">
                        è´Ÿè´£å¤„理该题目反馈的科室,可多选
                      </div>
                    </el-form-item>
                  </div>
                  <!-- æŠ¥å¤‡ç§‘室 -->
                  <!-- æŠ¥å¤‡ç§‘室(多选) -->
                  <div class="config-field">
                    <el-form-item
                      label="报备科室"
@@ -219,15 +345,14 @@
                        filterable
                        clearable
                        multiple
                        collapse-tags
                        style="width: 100%"
                        @change="handleConfigChange(question)"
                      >
                        <el-option
                          v-for="dept in deptOptions"
                          :key="dept.id"
                          :label="dept.name"
                          :value="dept.id"
                          :label="dept.label"
                          :value="dept.deptCode"
                        />
                      </el-select>
                      <div class="config-tip">
@@ -235,24 +360,31 @@
                      </div>
                    </el-form-item>
                  </div>
                </div>
                  <!-- é€šçŸ¥æ–¹å¼ -->
                  <div class="config-field">
                    <el-form-item
                      label="通知方式"
                      prop="notifyTypes"
                      class="config-item"
                    >
                      <el-checkbox-group
                        v-model="question.exceptionConfig.notifyTypes"
                        @change="handleConfigChange(question)"
                      >
                        <el-checkbox label="system">系统消息</el-checkbox>
                        <el-checkbox label="sms">短信</el-checkbox>
                        <el-checkbox label="email">邮件</el-checkbox>
                        <el-checkbox label="wechat">企业微信</el-checkbox>
                      </el-checkbox-group>
                    </el-form-item>
                <!-- å½“前配置信息 -->
                <div v-if="question.hasChanges" class="current-config">
                  <div class="config-preview">
                    <div class="preview-item">
                      <span class="preview-label">责任科室:</span>
                      <span class="preview-value">
                        {{
                          getDeptNames(
                            question.exceptionConfig.responsibilityDept || []
                          ).join(", ")
                        }}
                      </span>
                    </div>
                    <div class="preview-item">
                      <span class="preview-label">报备科室:</span>
                      <span class="preview-value">
                        {{
                          getDeptNames(
                            question.exceptionConfig.reportDept || []
                          ).join(", ")
                        }}
                      </span>
                    </div>
                  </div>
                </div>
@@ -299,17 +431,6 @@
          </el-card>
        </div>
      </div>
      <!-- åˆ†é¡µ -->
      <div v-if="questionList.length > 0" class="pagination-wrapper">
        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getQuestionList"
        />
      </div>
    </div>
    <!-- é¢˜ç›®é¢„览对话框 -->
@@ -328,19 +449,14 @@
              :value="currentPreview.scriptType"
              size="small"
            />
            <el-tag
              :type="currentPreview.isavailable === 1 ? 'success' : 'danger'"
              size="small"
            >
              {{ currentPreview.isavailable === 1 ? "可用" : "不可用" }}
            </el-tag>
            <el-tag v-if="currentPreview.targetname" size="small" type="info">
              {{ currentPreview.targetname }}
            </el-tag>
          </div>
        </div>
        <!-- æ¨¡æ¿é¢˜ç›®å±•示 -->
        <div class="preview-content">
        <div class="preview-content" v-if="templateForm.templateType == 1">
          <p class="preview-question">{{ currentPreview.scriptContent }}</p>
          <div
@@ -351,13 +467,47 @@
          >
            <el-radio-group v-model="previewAnswer">
              <el-radio
                v-for="(option, idx) in currentPreview.svyLibScriptOptions ||
                []"
                v-for="(
                  option, idx
                ) in currentPreview.svyLibTemplateTargetoptions || []"
                :key="idx"
                :label="option.optioncontent"
                class="option-item"
              >
                {{ option.optioncontent }}
              </el-radio>
            </el-radio-group>
          </div>
          <div v-else class="preview-textarea">
            <el-input
              type="textarea"
              placeholder="请输入回答"
              v-model="previewAnswer"
              :rows="4"
            />
          </div>
        </div>
        <!-- è¯­éŸ³é¢˜ç›®å±•示 -->
        <div class="preview-content" v-else>
          <p class="preview-question">{{ currentPreview.scriptContent }}</p>
          <div
            v-if="
              currentPreview.scriptType != 3 && currentPreview.scriptType != 4
            "
            class="preview-options"
          >
            <el-radio-group v-model="previewAnswer">
              <el-radio
                v-for="(
                  option, idx
                ) in currentPreview.ivrLibaScriptTargetoptionList || []"
                :key="idx"
                :label="option.targetvalue"
                class="option-item"
              >
                {{ option.targetvalue }}
              </el-radio>
            </el-radio-group>
          </div>
@@ -399,10 +549,16 @@
<script>
import {
  getissuelist,
  compileissue,
  getissueclassify,
  compileQtemplate,
  compileFollowup,
  getQtemplatelist,
  getFollowuplist,
  getvFollowup,
  getQtemplateobj,
  selectInfoByConditiony,
} from "@/api/AiCentre/index";
import { deptTreeSelect } from "@/api/system/user";
import store from "@/store";
import Pagination from "@/components/Pagination";
@@ -411,28 +567,40 @@
  components: { Pagination },
  data() {
    return {
      // æ¨¡æ¿è¡¨å•
      templateForm: {
        templateType: "",
        templateId: "",
      },
      templateRules: {
        templateType: [
          { required: true, message: "请选择模板类型", trigger: "change" },
        ],
      },
      // æ¨¡æ¿é€‰é¡¹
      questionnaireTemplates: [], // é—®å·æ¨¡æ¿åˆ—表
      followupTemplates: [], // è¯­éŸ³æ¨¡æ¿åˆ—表
      templateOptionsLoading: false,
      // å½“前模板信息
      currentTemplateInfo: null,
      templateLoading: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        scriptTopic: "",
        scriptContent: "",
        targetname: "",
        isavailable: "",
        categoryids: "404,405,406", // å›ºå®šæŸ¥è¯¢æ»¡æ„åº¦ç±»åž‹
      },
      // æ•°æ®åˆ—表
      questionList: [],
      total: 0,
      loading: false,
      batchSaving: false,
      // å­—典数据
      askvaluetype: store.getters.askvaluetype || [],
      qyoptions: store.getters.usable || [],
      mode: store.getters.mode || [],
      languagelist: store.getters.languagelist || [],
      // ç§‘室选项
      deptOptions: [],
@@ -447,21 +615,21 @@
      hasChanges: false,
      changedCount: 0,
      // æ»¡æ„åº¦åˆ†ç±»ID
      satisfactionCategoryIds: ["404", "405", "406"],
      // è¡¨å•验证规则
      configRules: {
        responsibilityDept: [
          { required: true, message: "请选择责任科室", trigger: "change" },
        ],
        reportDept: [
          {
            required: true,
            message: "请选择至少一个报备科室",
            message: "请至少选择一个责任科室",
            trigger: "change",
          },
          {
            validator: (rule, value, callback) => {
              if (!value || value.length === 0) {
                callback(new Error("请选择至少一个报备科室"));
                callback(new Error("请至少选择一个责任科室"));
              } else {
                callback();
              }
@@ -469,11 +637,16 @@
            trigger: "change",
          },
        ],
        notifyTypes: [
        reportDept: [
          {
            required: true,
            message: "请至少选择一个报备科室",
            trigger: "change",
          },
          {
            validator: (rule, value, callback) => {
              if (!value || value.length === 0) {
                callback(new Error("请至少选择一种通知方式"));
                callback(new Error("请至少选择一个报备科室"));
              } else {
                callback();
              }
@@ -484,17 +657,76 @@
      },
    };
  },
  computed: {
    // æ ¹æ®æ¨¡æ¿ç±»åž‹è¿‡æ»¤æ¨¡æ¿é€‰é¡¹
    filteredTemplateOptions() {
      if (this.templateForm.templateType === 1) {
        return this.questionnaireTemplates;
      } else if (this.templateForm.templateType === 2) {
        return this.followupTemplates;
      }
      return [];
    },
    // æ»¡æ„åº¦é¢˜ç›®æ•°é‡
    satisfactionQuestionsCount() {
      return this.questionList.filter((q) =>
        this.satisfactionCategoryIds.includes(q.categoryid?.toString())
      ).length;
    },
    // ç­›é€‰åŽçš„题目列表
    filteredQuestionList() {
      let filtered = this.questionList;
      // ç­›é€‰æ»¡æ„åº¦é¢˜ç›®
      filtered = filtered.filter((q) =>
        this.satisfactionCategoryIds.includes(q.categoryid?.toString())
      );
      // åº”用搜索条件
      if (this.queryParams.scriptTopic) {
        const keyword = this.queryParams.scriptTopic.toLowerCase();
        filtered = filtered.filter(
          (q) => q.scriptTopic && q.scriptTopic.toLowerCase().includes(keyword)
        );
      }
      if (this.queryParams.scriptContent) {
        const keyword = this.queryParams.scriptContent.toLowerCase();
        filtered = filtered.filter(
          (q) =>
            q.scriptContent && q.scriptContent.toLowerCase().includes(keyword)
        );
      }
      return filtered;
    },
  },
  created() {
    this.getDeptOptions();
    this.getQuestionList();
    this.loadAllTemplates();
  },
  methods: {
    /** åŠ è½½æ‰€æœ‰æ¨¡æ¿åˆ—è¡¨ */
    loadAllTemplates() {
      this.templateOptionsLoading = true;
      // å¹¶è¡ŒåŠ è½½é—®å·æ¨¡æ¿å’Œè¯­éŸ³æ¨¡æ¿
      Promise.all([
        this.loadQuestionnaireTemplates(),
        this.loadFollowupTemplates(),
      ]).finally(() => {
        this.templateOptionsLoading = false;
      });
    },
    /** æŸ¥è¯¢ç§‘室列表 */
    getDeptOptions() {
      getissueclassify({})
      deptTreeSelect()
        .then((res) => {
          if (res.code === 200) {
            this.deptOptions = res.rows || [];
          if (res.code == 200) {
            this.deptOptions = this.flattenArray(res.data) || [];
          }
        })
        .catch((error) => {
@@ -503,39 +735,237 @@
        });
    },
    /** æŸ¥è¯¢æ»¡æ„åº¦é¢˜ç›®åˆ—表 */
    getQuestionList() {
    flattenArray(multiArray) {
      let result = [];
      function flatten(element) {
        if (element.children && element.children.length > 0) {
          element.children.forEach((child) => flatten(child));
        } else {
          let item = JSON.parse(JSON.stringify(element));
          result.push(item);
        }
      }
      multiArray.forEach((element) => flatten(element));
      return result;
    },
    /** æ ¹æ®ç§‘室编码获取科室名称 */
    getDeptName(deptCode) {
      if (!deptCode) return "";
      const dept = this.deptOptions.find((d) => d.deptCode === deptCode);
      return dept ? dept.label : deptCode;
    },
    /** æ ¹æ®ç§‘室编码数组获取科室名称数组 */
    getDeptNames(deptCodes) {
      if (!Array.isArray(deptCodes) || deptCodes.length === 0) return [];
      return deptCodes
        .map((code) => this.getDeptName(code))
        .filter((name) => name && name.trim());
    },
    /** æ¨¡æ¿ç±»åž‹å˜æ›´ */
    handleTemplateTypeChange() {
      this.templateForm.templateId = "";
      this.currentTemplateInfo = null;
      this.questionList = [];
    },
    /** åŠ è½½é—®å·æ¨¡æ¿åˆ—è¡¨ */
    loadQuestionnaireTemplates() {
      return new Promise((resolve) => {
        getQtemplatelist({ pageSize: 1000 })
          .then((res) => {
            if (res.code === 200) {
              this.questionnaireTemplates = (res.rows || []).map((item) => ({
                id: item.svyid,
                templateName: item.svyname,
                isavailable: item.isavailable,
              }));
            } else {
              this.$message.error(res.msg || "加载问卷模板失败");
            }
            resolve();
          })
          .catch((error) => {
            console.error("加载问卷模板失败:", error);
            this.$message.error("加载问卷模板失败");
            resolve();
          });
      });
    },
    /** åŠ è½½è¯­éŸ³æ¨¡æ¿åˆ—è¡¨ */
    loadFollowupTemplates() {
      return new Promise((resolve) => {
        getFollowuplist({ pageSize: 1000 })
          .then((res) => {
            if (res.code === 200) {
              this.followupTemplates = (res.rows || []).map((item) => ({
                id: item.id,
                templateName: item.templateName,
                isavailable: item.isavailable,
              }));
            } else {
              this.$message.error(res.msg || "加载语音模板失败");
            }
            resolve();
          })
          .catch((error) => {
            console.error("加载语音模板失败:", error);
            this.$message.error("加载语音模板失败");
            resolve();
          });
      });
    },
    /** æ¨¡æ¿é€‰æ‹©å˜æ›´ */
    handleTemplateChange(templateId) {
      if (templateId) {
        const selectedTemplate = this.filteredTemplateOptions.find(
          (t) => t.id === templateId
        );
        if (selectedTemplate) {
          this.currentTemplateInfo = {
            templateName: selectedTemplate.templateName,
            templateStatus: selectedTemplate.isavailable,
            questionCount: 0,
          };
        }
      } else {
        this.currentTemplateInfo = null;
        this.questionList = [];
      }
    },
    /** åŠ è½½æ¨¡æ¿è¯¦æƒ…å’Œé¢˜ç›® */
    handleLoadTemplate() {
      this.$refs.templateForm.validate((valid) => {
        if (!valid) {
          this.$message.warning("请先选择模板");
          return;
        }
        this.templateLoading = true;
      this.loading = true;
      this.questionList = [];
      getissuelist(this.queryParams)
        if (this.templateForm.templateType === 1) {
          this.loadQuestionnaireTemplateDetail();
        } else if (this.templateForm.templateType === 2) {
          this.loadFollowupTemplateDetail();
        }
      });
    },
    /** åŠ è½½é—®å·æ¨¡æ¿è¯¦æƒ… */
    loadQuestionnaireTemplateDetail() {
      getQtemplateobj({ svyid: this.templateForm.templateId })
        .then((res) => {
          this.templateLoading = false;
          this.loading = false;
          if (res.code === 200) {
            this.questionList = (res.rows || []).map((item) => {
              // è§£æžå¼‚常处理配置
              let exceptionConfig = {
                responsibilityDept: "",
                reportDept: [],
                notifyTypes: ["system"],
          if (res.code === 200 && res.rows && res.rows.length > 0) {
            const templateDetail = res.rows[0];
            // æ›´æ–°æ¨¡æ¿ä¿¡æ¯
            this.currentTemplateInfo = {
              ...templateDetail,
              templateName: templateDetail.svyname,
              templateStatus: templateDetail.isavailable,
              questionCount: templateDetail.svyTemplateLibScripts?.length || 0,
              };
              try {
                if (item.otherdata) {
                  const otherData = JSON.parse(item.otherdata);
                  if (otherData.exceptionConfig) {
                    exceptionConfig = {
                      ...exceptionConfig,
                      ...otherData.exceptionConfig,
            // æå–题目列表
            const questions = templateDetail.svyTemplateLibScripts || [];
            this.processQuestions(questions);
            this.$message.success(`成功加载 ${questions.length} ä¸ªé¢˜ç›®`);
          } else {
            this.$message.error(res.msg || "加载模板详情失败");
          }
        })
        .catch((error) => {
          this.templateLoading = false;
          this.loading = false;
          console.error("加载问卷模板详情失败:", error);
          this.$message.error("加载模板详情失败");
        });
    },
    /** åŠ è½½è¯­éŸ³æ¨¡æ¿è¯¦æƒ… */
    loadFollowupTemplateDetail() {
      getvFollowup({ id: this.templateForm.templateId })
        .then((res) => {
          this.templateLoading = false;
          this.loading = false;
          if (res.code === 200) {
            const templateDetail = res.data;
            // æ›´æ–°æ¨¡æ¿ä¿¡æ¯
            this.currentTemplateInfo = {
              ...this.currentTemplateInfo,
              templateName: templateDetail.templateName,
              templateStatus: templateDetail.isavailable,
              questionCount:
                templateDetail.ivrLibaTemplateScriptVOList?.length || 0,
                    };
            // æå–题目列表
            const questions = templateDetail.ivrLibaTemplateScriptVOList || [];
            this.processQuestions(questions);
            this.$message.success(`成功加载 ${questions.length} ä¸ªé¢˜ç›®`);
          } else {
            this.$message.error(res.msg || "加载模板详情失败");
                  }
        })
        .catch((error) => {
          this.templateLoading = false;
          this.loading = false;
          console.error("加载语音模板详情失败:", error);
          this.$message.error("加载模板详情失败");
        });
    },
    /** å¤„理题目数据 */
    processQuestions(questions) {
      this.questionList = questions.map((question) => {
        // è§£æžè´£ä»»ç§‘室和报备科室
        let exceptionConfig = {
          responsibilityDept: [], // è´£ä»»ç§‘室编码数组
          reportDept: [], // æŠ¥å¤‡ç§‘室编码数组
        };
        // ä»Žé¢˜ç›®é¡¶å±‚字段读取数据
        if (question.dutyDeptCode) {
          // ä»Žé€—号分隔的字符串转为数组
          exceptionConfig.responsibilityDept = question.dutyDeptCode
            .split(",")
            .map((code) => code.trim())
            .filter((code) => code);
                }
              } catch (error) {
                console.warn("解析异常配置失败:", error);
        if (question.reportDeptCode) {
          exceptionConfig.reportDept = question.reportDeptCode
            .split(",")
            .map((code) => code.trim())
            .filter((code) => code);
              }
              return {
                ...item,
          ...question,
          // ç»Ÿä¸€å­—段名
          id: question.id || question.scriptId,
          scriptTopic: question.scriptTopic || question.scriptTopic,
          scriptContent: question.scriptContent || question.scriptContent,
          scriptType: question.scriptType,
          isavailable: question.isavailable,
          targetname: question.targetname,
          categoryid: question.categoryid || question.categoryid,
                originalConfig: JSON.parse(JSON.stringify(exceptionConfig)),
                exceptionConfig: exceptionConfig,
                hasChanges: false,
@@ -544,17 +974,19 @@
              };
            });
            this.total = res.total || 0;
            this.updateChangedStatus();
          } else {
            this.$message.error(res.msg || "获取数据失败");
          }
        })
        .catch((error) => {
          this.loading = false;
          console.error("查询失败:", error);
          this.$message.error("获取数据失败");
        });
    },
    /** é‡ç½®æ¨¡æ¿é€‰æ‹© */
    handleResetTemplate() {
      this.templateForm = {
        templateType: "",
        templateId: "",
      };
      this.currentTemplateInfo = null;
      this.questionList = [];
      this.resetQuery();
      this.$refs.templateForm?.clearValidate();
    },
    /** é…ç½®å˜æ›´å¤„理 */
@@ -582,16 +1014,24 @@
    isConfigEqual(config1, config2) {
      if (!config1 || !config2) return false;
      const report1 = [...(config1.reportDept || [])].sort().join(",");
      const report2 = [...(config2.reportDept || [])].sort().join(",");
      const notify1 = [...(config1.notifyTypes || [])].sort().join(",");
      const notify2 = [...(config2.notifyTypes || [])].sort().join(",");
      const responsibility1 = [...(config1.responsibilityDept || [])]
        .sort()
        .join(",")
        .toLowerCase();
      const responsibility2 = [...(config2.responsibilityDept || [])]
        .sort()
        .join(",")
        .toLowerCase();
      const report1 = [...(config1.reportDept || [])]
        .sort()
        .join(",")
        .toLowerCase();
      const report2 = [...(config2.reportDept || [])]
        .sort()
        .join(",")
        .toLowerCase();
      return (
        config1.responsibilityDept === config2.responsibilityDept &&
        report1 === report2 &&
        notify1 === notify2
      );
      return responsibility1 === responsibility2 && report1 === report2;
    },
    /** æ›´æ–°å˜æ›´çŠ¶æ€ */
@@ -621,28 +1061,112 @@
      question.saveStatus = null;
      try {
        // æž„建保存数据
        const saveData = {
          id: question.id,
          isoperation: 2, // ä¿®æ”¹æ“ä½œ
          ...question,
        // èŽ·å–å½“å‰æ¨¡æ¿è¯¦æƒ…
        let templateDetail;
        if (this.templateForm.templateType === 1) {
          // é—®å·æ¨¡æ¿
          const res = await getQtemplateobj({
            svyid: this.templateForm.templateId,
          });
          if (res.code !== 200 || !res.rows || res.rows.length === 0) {
            throw new Error(res.msg || "获取模板详情失败");
          }
          templateDetail = res.rows[0];
        } else if (this.templateForm.templateType === 2) {
          // è¯­éŸ³æ¨¡æ¿
          const res = await getvFollowup({ id: this.templateForm.templateId });
          if (res.code !== 200) {
            throw new Error(res.msg || "获取模板详情失败");
          }
          templateDetail = res.data;
        }
        // æ›´æ–°é¢˜ç›®é…ç½®
        let updatedTemplateDetail = { ...templateDetail };
        let questionsField =
          this.templateForm.templateType === 1
            ? "svyTemplateLibScripts"
            : "ivrLibaTemplateScriptVOList";
        const questions = updatedTemplateDetail[questionsField] || [];
        const questionIndex = questions.findIndex((q) => q.id === question.id);
        if (questionIndex === -1) {
          throw new Error("未找到题目");
        }
        // èŽ·å–ç§‘å®¤åç§°
        const responsibilityDeptNames = this.getDeptNames(
          question.exceptionConfig.responsibilityDept
        );
        const reportDeptNames = this.getDeptNames(
          question.exceptionConfig.reportDept
        );
        // ç›´æŽ¥æ›´æ–°é¢˜ç›®é¡¶å±‚字段
        questions[questionIndex] = {
          ...questions[questionIndex],
          // è®¾ç½®Excel要求的字段
          dutyDeptCode: question.exceptionConfig.responsibilityDept.join(","),
          dutyDeptName: responsibilityDeptNames.join(","),
          reportDeptCode: question.exceptionConfig.reportDept.join(","),
          reportDeptName: reportDeptNames.join(","),
        };
        // å°†å¼‚常配置保存到 otherdata
        const otherData = JSON.parse(question.otherdata || "{}");
        otherData.exceptionConfig = question.exceptionConfig;
        saveData.otherdata = JSON.stringify(otherData);
        // æ›´æ–°æ¨¡æ¿
        updatedTemplateDetail[questionsField] = questions;
        // ç§»é™¤ä¸éœ€è¦çš„字段
        delete saveData.originalConfig;
        delete saveData.hasChanges;
        delete saveData.saving;
        delete saveData.saveStatus;
        delete saveData.exceptionConfig;
        const response = await compileissue(saveData);
        // ä¿å­˜æ¨¡æ¿
        let response;
        if (this.templateForm.templateType === 1) {
          response = await compileQtemplate({
            ...updatedTemplateDetail,
            id: this.templateForm.templateId,
            isoperation: 2,
          });
        } else {
          response = await compileFollowup({
            ...updatedTemplateDetail,
            id: this.templateForm.templateId,
            isoperation: 2,
          });
        }
        if (response.code === 200) {
          this.handleSaveSuccess(question);
        } else {
          throw new Error(response.msg || "保存失败");
        }
      } catch (error) {
        console.error("保存失败:", error);
        question.saveStatus = {
          type: "error",
          message: error.message || "保存失败,请稍后重试",
        };
        this.$message.error(error.message || "保存失败,请稍后重试");
      } finally {
        question.saving = false;
      }
    },
    /** å¤„理保存成功 */
    /** å¤„理保存成功 */
    handleSaveSuccess(question) {
      // åŒæ—¶æ›´æ–°é¢˜ç›®é¡¶å±‚字段
      const responsibilityDeptNames = this.getDeptNames(
        question.exceptionConfig.responsibilityDept
      );
      const reportDeptNames = this.getDeptNames(
        question.exceptionConfig.reportDept
      );
      // æ›´æ–°é¢˜ç›®æœ¬èº«çš„字段
      question.dutyDeptCode =
        question.exceptionConfig.responsibilityDept.join(",");
      question.dutyDeptName = responsibilityDeptNames.join(",");
      question.reportDeptCode = question.exceptionConfig.reportDept.join(",");
      question.reportDeptName = reportDeptNames.join(",");
          // æ›´æ–°åŽŸå§‹é…ç½®
          question.originalConfig = JSON.parse(
            JSON.stringify(question.exceptionConfig)
@@ -660,25 +1184,9 @@
          setTimeout(() => {
            question.saveStatus = null;
          }, 5000);
        } else {
          question.saveStatus = {
            type: "error",
            message: response.msg || "保存失败",
          };
          this.$message.error(response.msg || "保存失败");
        }
      } catch (error) {
        console.error("保存失败:", error);
        question.saveStatus = {
          type: "error",
          message: "保存失败,请稍后重试",
        };
        this.$message.error("保存失败,请稍后重试");
      } finally {
        question.saving = false;
      }
    },
    /** é‡ç½®å•个题目配置 */
    /** é‡ç½®å•个题目配置 */
    resetSingleConfig(question) {
      this.$confirm("确定要重置当前题目的配置吗?", "提示", {
@@ -690,6 +1198,21 @@
          question.exceptionConfig = JSON.parse(
            JSON.stringify(question.originalConfig)
          );
          // åŒæ—¶é‡ç½®é¢˜ç›®é¡¶å±‚字段
          const responsibilityDeptNames = this.getDeptNames(
            question.exceptionConfig.responsibilityDept
          );
          const reportDeptNames = this.getDeptNames(
            question.exceptionConfig.reportDept
          );
          question.dutyDeptCode =
            question.exceptionConfig.responsibilityDept.join(",");
          question.dutyDeptName = responsibilityDeptNames.join(",");
          question.reportDeptCode =
            question.exceptionConfig.reportDept.join(",");
          question.reportDeptName = reportDeptNames.join(",");
          question.hasChanges = false;
          question.saveStatus = null;
          this.updateChangedStatus();
@@ -760,22 +1283,15 @@
    /** æœç´¢ */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getQuestionList();
      // ä»…筛选显示,不需要重新加载
    },
    /** é‡ç½®æœç´¢ */
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        scriptTopic: "",
        scriptContent: "",
        targetname: "",
        isavailable: "",
        categoryids: "404,405,406",
      };
      this.getQuestionList();
    },
  },
};
@@ -809,7 +1325,76 @@
    }
  }
  .search-card {
  .template-section {
    margin-bottom: 20px;
    .template-header {
      margin-bottom: 20px;
      .template-title {
        margin: 0 0 8px 0;
        font-size: 16px;
        font-weight: 600;
        color: #303133;
      }
      .template-tip {
        margin: 0;
        color: #909399;
        font-size: 13px;
      }
    }
    .select-loading {
      text-align: center;
      padding: 10px;
      color: #909399;
      i {
        margin-right: 8px;
      }
    }
  }
  .template-info-section {
    margin-bottom: 20px;
    .template-info {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 5px 0;
      .info-left {
        .template-name {
          margin: 0 0 10px 0;
          font-size: 18px;
          font-weight: 600;
          color: #303133;
        }
        .template-meta {
          display: flex;
          gap: 20px;
          flex-wrap: wrap;
          .meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 13px;
            color: #606266;
            i {
              font-size: 14px;
            }
          }
        }
      }
    }
  }
  .search-section {
    margin-bottom: 20px;
    .search-container {
@@ -872,8 +1457,16 @@
    .empty-wrapper {
      min-height: 400px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      .empty-tip {
        margin-top: 10px;
        color: #909399;
        font-size: 13px;
        text-align: center;
      }
    }
    .question-list {
@@ -1035,6 +1628,40 @@
              }
            }
            .current-config {
              margin-bottom: 20px;
              padding: 15px;
              background: #f0f9ff;
              border-radius: 6px;
              border: 1px solid #d0ebff;
              .config-preview {
                .preview-item {
                  display: flex;
                  align-items: flex-start;
                  margin-bottom: 8px;
                  &:last-child {
                    margin-bottom: 0;
                  }
                  .preview-label {
                    font-size: 13px;
                    color: #606266;
                    font-weight: 500;
                    min-width: 80px;
                  }
                  .preview-value {
                    font-size: 13px;
                    color: #303133;
                    line-height: 1.5;
                    flex: 1;
                  }
                }
              }
            }
            .config-footer {
              display: flex;
              justify-content: space-between;
@@ -1066,15 +1693,6 @@
          }
        }
      }
    }
    .pagination-wrapper {
      margin-top: 20px;
      padding: 20px;
      background: white;
      border-radius: 8px;
      display: flex;
      justify-content: center;
    }
  }
@@ -1161,6 +1779,12 @@
      margin-bottom: 16px;
    }
    .template-info {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
    }
    .search-card {
      margin-bottom: 16px;
    }
@@ -1205,6 +1829,10 @@
                gap: 16px;
              }
              .current-config {
                padding: 12px;
              }
              .config-footer {
                flex-direction: column;
                align-items: stretch;
@@ -1220,27 +1848,6 @@
        }
      }
    }
  }
}
</style>
<style lang="scss">
.config-form {
  .el-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  .el-checkbox {
    margin: 0;
  }
}
.option-item {
  .el-radio__label {
    display: block;
    padding-left: 8px;
  }
}
</style>
src/views/followvisit/discharge/index.vue
@@ -1250,6 +1250,10 @@
          value: 8,
          label: "应随访日期(倒序)",
        },
         {
          value: 9,
          label: "按照患者排序",
        },
      ],
      // æŸ¥è¯¢å‚æ•°
      topqueryParams: {
src/views/followvisit/discharge/js/prototype.js
src/views/followvisit/record/detailpage/index copy.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,3703 @@
<template>
  <!-- èŠè¿žé¡µé¢è®°å½• -->
  <div class="Followupdetailspage" id="app-container">
    <div class="Followuserinfo">
      <div>
        <div class="userinfo-text">
          <!-- <span>患者服务详情</span> -->
          <div class="headline">
            <div>患者服务详情</div>
            <div style="margin-left: 20px">
              <el-button
                v-if="!Whetherall"
                type="primary"
                @click="getTaskservelist()"
                >查看患者全部服务</el-button
              >
              <el-button v-else type="success" @click="getTaskservelist(id)"
                >只展示本次服务信息</el-button
              >
            </div>
            <!-- <div style="margin-left: 20px; color: #59a0f0">
              <el-link
                href="https://9.208.2.207:6060/search-homepage"
                target="_blank"
                :underline="true"
              >
                å‰å¾€CDSS查询
              </el-link>
            </div> -->
            <div class="merge-controls" v-if="Whetherall">
              <el-button
                type="primary"
                @click="toggleMergeMode"
                :disabled="selectedServices.length < 2"
              >
                {{ isMergeMode ? "取消合并" : "合并编辑问卷" }}
              </el-button>
              <el-button
                v-if="isMergeMode"
                type="success"
                @click="openMergeDialog"
                :disabled="selectedServices.length < 2"
              >
                å¼€å§‹åˆå¹¶ (已选 {{ selectedServices.length }} ä¸ªæœåŠ¡)
              </el-button>
            </div>
          </div>
          <!-- <el-button type="success">随访后短信</el-button> -->
        </div>
      </div>
      <div>
        <el-table
          :data="logsheetlist"
          :row-class-name="tableRowClassName"
          :max-height="350"
          style="width: 100%"
          @selection-change="handleSelectionChange"
        >
          <el-table-column
            type="selection"
            width="55"
            :selectable="checkSelectable"
            v-if="Whetherall"
          ></el-table-column>
          <el-table-column
            prop="sendname"
            align="center"
            label="姓名"
            width="100"
          >
            <template slot-scope="scope">
              <el-button
                size="medium"
                type="text"
                @click="
                  gettoken360(
                    scope.row.sfzh,
                    scope.row.drcode,
                    scope.row.drname
                  )
                "
                ><span class="button-textsc">{{
                  scope.row.sendname
                }}</span></el-button
              >
            </template>
          </el-table-column>
          <el-table-column
            prop="taskName"
            align="center"
            width="200"
            show-overflow-tooltip
            label="任务名称"
          >
          </el-table-column>
          <el-table-column
            prop="sendstate"
            align="center"
            width="200"
            label="任务状态"
          >
            <template slot-scope="scope">
              <div v-if="scope.row.sendstate == 1">
                <el-tag type="primary" :disable-transitions="false"
                  >表单已领取</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 2">
                <el-tag type="primary" :disable-transitions="false"
                  >待随访</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 3">
                <el-tag type="success" :disable-transitions="false"
                  >表单已发送</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 4">
                <el-tag type="info" :disable-transitions="false">不执行</el-tag>
              </div>
              <div v-if="scope.row.sendstate == 5">
                <el-tag type="danger" :disable-transitions="false"
                  >发送失败</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 6">
                <el-tag type="success" :disable-transitions="false"
                  >已完成</el-tag
                >
              </div>
              <div v-if="scope.row.sendstate == 7">
                <el-tag type="danger" :disable-transitions="false">超时</el-tag>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="finishtime"
            align="center"
            label="随访完成时间"
            width="200"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            label="出院日期"
            width="200"
            align="center"
            key="endtime"
            prop="endtime"
          >
            <template slot-scope="scope">
              <span>{{ formatTime(scope.row.endtime) }}</span>
            </template></el-table-column
          >
          <el-table-column
            label="责任护士"
            width="120"
            align="center"
            key="nurseName"
            prop="nurseName"
          />
          <el-table-column
            label="主治医生"
            width="120"
            align="center"
            key="drname"
            prop="drname"
          />
          <el-table-column
            label="结果状态"
            align="center"
            key="excep"
            prop="excep"
            width="120"
          >
            <template slot-scope="scope">
              <dict-tag
                :options="dict.type.sys_yujing"
                :value="scope.row.excep"
              />
            </template>
          </el-table-column>
          <el-table-column
            label="处理意见"
            align="center"
            key="suggest"
            prop="suggest"
            width="120"
          >
            <template slot-scope="scope">
              <dict-tag
                :options="dict.type.sys_suggest"
                :value="scope.row.suggest"
              />
            </template>
          </el-table-column>
          <el-table-column
            prop="templatename"
            align="center"
            label="服务模板"
            width="200"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="remark"
            align="center"
            label="服务记录"
            width="200"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="bankcardno"
            align="center"
            label="呼叫状态"
            width="210"
          >
          </el-table-column>
          <el-table-column
            label="操作"
            fixed="right"
            align="center"
            width="200"
            class-name="small-padding fixed-width"
          >
            <template slot-scope="scope">
              <el-button
                size="medium"
                type="text"
                @click="Seedetails(scope.row)"
                ><span class="button-zx"
                  ><i class="el-icon-s-order"></i>查看</span
                ></el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <!-- æ·»åŠ åˆå¹¶ç¼–è¾‘å¯¹è¯æ¡† -->
    <el-dialog
      title="合并编辑问卷"
      :visible.sync="mergeDialogVisible"
      width="80%"
      top="5vh"
      v-dialogDrag
    >
      <MergeAndModify
        v-if="mergeDialogVisible"
        :selected-services="selectedServices"
        :patid="patid"
        @save="handleMergeSave"
        @cancel="mergeDialogVisible = false"
      />
    </el-dialog>
    <div class="action-container">
      <!-- éšè®¿å†…容 -->
      <div class="call-action">
        <div class="call-container">
          <!-- <div class="call-header">
            <h2>一键呼叫功能</h2>
          </div> -->
          <div class="headline">
            <div>随访内容</div>
          </div>
          <div>
            <el-tabs v-model="activeName" type="border-card">
              <el-tab-pane name="wj">
                <span class="mulsz" 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">
                            <el-radio
                              v-for="(
                                items, indexs
                              ) in item.svyTaskTemplateTargetoptions"
                              :class="getOptionClass(items)"
                              :key="indexs"
                              :label="items.optioncontent"
                              @click.native.prevent="
                                handleRadioToggle(
                                  item,
                                  index,
                                  item.svyTaskTemplateTargetoptions,
                                  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"
                            clearable
                          ></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"
                            @change="updateScore($event, index, item)"
                          >
                            <el-checkbox
                              :class="items.isabnormal ? 'red-star' : ''"
                              @change="$forceUpdate()"
                              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"
                            v-numeric-only
                            placeholder="请输入答案"
                            v-model="item.scriptResult"
                          >
                          </el-input>
                        </div>
                        <div class="dev-xx" v-else>
                          <el-input
                            type="textarea"
                            :rows="2"
                            placeholder="请输入答案"
                            v-model="item.scriptResult"
                            clearable
                          >
                          </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"
                            @change="
                              handleOptionChange(
                                $event,
                                index,
                                item.ivrTaskScriptTargetoptionList,
                                item
                              )
                            "
                          >
                            <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"
                            v-numeric-only
                            placeholder="请输入答案"
                            v-model="item.scriptResult"
                          >
                          </el-input>
                        </div>
                        <div class="dev-xx" v-else>
                          <el-input
                            type="textarea"
                            :rows="2"
                            placeholder="请输入答案"
                            v-model="item.scriptResult"
                            clearable
                          >
                          </el-input>
                        </div>
                      </div>
                    </div>
                  </div>
                  <el-button
                    v-if="Voicetype"
                    type="primary"
                    @click="yuyingetdetail"
                    >保存服务详情</el-button
                  >
                  <el-button v-else type="primary" @click="getdetail"
                    >保存服务详情</el-button
                  >
                </div>
              </el-tab-pane>
              <el-tab-pane name="yy">
                <span class="mulsz" slot="label"
                  ><i class="el-icon-headset"></i> è¯­éŸ³éšè®¿è¯¦æƒ…</span
                >
                <div class="borderdiv">
                  <div class="title">{{ taskname ? taskname : "问卷" }}</div>
                  <div
                    style="
                      display: flex;
                      text-align: center;
                      align-items: center;
                      color: #59a0f0;
                    "
                  >
                    å®Œæ•´è¯­éŸ³ï¼š
                    <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"
                          ></el-input>
                          <div>
                            <mini-audio
                              :audio-source="
                                item.questionvoice
                                  ? item.questionvoice
                                  : '@assets/order/example.mp3'
                              "
                            ></mini-audio>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <el-button
                    v-if="Voicetype"
                    type="primary"
                    @click="yuyingetdetail"
                    >保存随访详情</el-button
                  >
                  <el-button v-else type="primary" @click="getdetail"
                    >保存随访详情</el-button
                  >
                </div>
              </el-tab-pane>
            </el-tabs>
          </div>
        </div>
      </div>
      <!-- äººå·¥å¤„理 -->
      <div class="manual-action">
        <div class="Followuserinfos">
          <!-- é¡¶éƒ¨æ“ä½œåŒºåŸŸ -->
          <div class="section-header">
            <h3><i class="el-icon-s-operation"></i> äººå·¥å¤„理</h3>
            <div class="header-actions">
              <!-- åŸºç¡€æ“ä½œæŒ‰é’®ç»„ -->
              <div class="action-group basic-actions">
                <el-button
                  type="primary"
                  plain
                  @click="Editsingletasksonyic('')"
                >
                  ä¿å­˜åŸºç¡€ä¿¡æ¯
                </el-button>
                <!-- æ–°å¢žï¼šå»¶ç»­æŠ¤ç†æŒ‰é’® -->
                <el-button
                  type="success"
                  plain
                  @click="handleContinuationCare"
                  v-if="showContinuationCareBtn"
                >
                  å»¶ç»­æŠ¤ç†
                </el-button>
                <el-button
                  type="primary"
                  round
                  @click="sendAgain"
                  v-if="form.isVisitAgain != 2"
                >
                  å†æ¬¡éšè®¿
                </el-button>
              </div>
              <!-- å¼‚常状态选择器 -->
              <div class="action-group tag-selector">
                <el-select
                  v-model="selectedTag"
                  placeholder="请选择异常状态"
                  clearable
                  style="width: 150px; margin-right: 10px"
                >
                  <el-option
                    v-for="item in tagOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                    <span style="display: flex; align-items: center">
                      <span
                        class="color-indicator"
                        :style="{ backgroundColor: item.color }"
                      ></span>
                      <span>{{ item.label }}</span>
                    </span>
                  </el-option>
                </el-select>
                <!-- å½“前选择的颜色指示器 -->
                <div
                  v-if="selectedTag"
                  class="color-indicator selected-indicator"
                  :style="{ backgroundColor: getSelectedTagColor() }"
                ></div>
                <!-- æ ‡è®°è¯´æ˜Žæç¤º -->
                <el-tooltip
                  v-if="selectedTag"
                  effect="light"
                  :content="getSelectedDescription()"
                  placement="top"
                >
                  <i class="el-icon-info tag-info-icon"></i>
                </el-tooltip>
              </div>
            </div>
          </div>
          <!-- è¡¨å•区域 -->
          <div class="form-content">
            <el-form
              ref="userform"
              :model="form"
              :rules="userrules"
              label-width="100px"
            >
              <!-- è”系信息行 -->
              <el-row>
                <el-col :span="14">
                  <el-form-item label="联系电话">
                    <el-input
                      placeholder="联系电话缺失"
                      v-model="userform.telcode"
                    >
                      <el-button
                        slot="append"
                        icon="el-icon-phone"
                        @click="handleCall(userform.telcode, 'tel')"
                        :disabled="!isValidPhone(userform.telcode)"
                      ></el-button>
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="10">
                  <el-form-item
                    label="短号电话"
                    v-if="orgname == '景宁畲族自治县人民医院'"
                  >
                    <el-input
                      placeholder="联系电话缺失"
                      v-model="userform.telshortcode"
                    >
                      <el-button
                        slot="append"
                        icon="el-icon-phone"
                        @click="handleCall(userform.telshortcode, 'tel', true)"
                      ></el-button>
                    </el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <!-- è”系人信息行 -->
              <el-row>
                <el-col :span="14">
                  <el-form-item label="联系人电话">
                    <el-input
                      placeholder="联系人电话缺失"
                      v-model="userform.relativetelcode"
                    >
                      <el-button
                        slot="append"
                        icon="el-icon-phone"
                        @click="
                          handleCall(userform.relativetelcode, 'relative')
                        "
                        :disabled="!isValidPhone(userform.relativetelcode)"
                      ></el-button>
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="9">
                  <el-form-item label="关系">
                    <el-input
                      placeholder="联系人关系缺失"
                      v-model="userform.relation"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <!-- é€šè¯æŽ§åˆ¶åŒºåŸŸ -->
              <div class="call-controls">
                <CallButton
                  ref="callButton"
                  :phoneNumber="currentPhoneNumber"
                  style="display: none"
                />
                <!-- æŒ‚断按钮样式优化 -->
                <div v-if="callStatus === 'connected'" class="hangup-container">
                  <el-button
                    type="danger"
                    icon="el-icon-phone"
                    @click="endCurrentCall"
                    :loading="isEndingCall"
                    class="hangup-btn"
                    size="medium"
                  >
                    {{ isEndingCall ? "挂断中..." : "挂断电话" }}
                  </el-button>
                  <!-- é€šè¯è®¡æ—¶æ˜¾ç¤º -->
                  <div class="call-timer" v-if="callStartTime">
                    é€šè¯æ—¶é•¿: {{ formatCallTime }}
                  </div>
                </div>
                <!-- çŠ¶æ€æç¤ºä¼˜åŒ– -->
                <div class="call-status-container" v-if="callStatus !== 'idle'">
                  <el-alert
                    :title="callStatusText"
                    :type="callStatusType"
                    :closable="false"
                    show-icon
                    :class="['status-alert', `status-${callStatus}`]"
                  />
                </div>
                <!-- SIP注册状态提示 -->
                <div
                  v-if="isSipRegistering && orgname == '丽水市中医院'"
                  class="sip-registering"
                >
                  <el-alert
                    title="呼叫座机初始化中,请稍候..."
                    type="info"
                    :closable="false"
                    show-icon
                    class="registering-alert"
                  />
                </div>
              </div>
              <!-- éšè®¿å†…容/记录 -->
              <el-form-item
                :label="orgname == '丽水市中医院' ? '随访内容' : '随访记录'"
              >
                <el-input type="textarea" v-model="form.remark"></el-input>
              </el-form-item>
              <!-- éšè®¿æƒ…况 -->
              <el-form-item label="随访情况" v-if="orgname == '丽水市中医院'">
                <el-radio-group v-model="form.taskSituation">
                  <el-radio
                    v-for="city in cities"
                    :label="city.value"
                    :value="city.value"
                    :key="city.value"
                  >
                    {{ city.label }}
                  </el-radio>
                </el-radio-group>
              </el-form-item>
              <!-- å¤„理意见 -->
              <el-form-item label="处理意见">
                <div class="opinion-buttons">
                  <el-button
                    plain
                    type="warning"
                    @click="Editsingletaskson('1')"
                  >
                    æš‚不处理
                  </el-button>
                  <el-button
                    plain
                    type="success"
                    @click="Editsingletaskson('2')"
                  >
                    ç—…情稳定
                  </el-button>
                  <el-button
                    plain
                    type="primary"
                    @click="Editsingletaskson('3')"
                  >
                    é€šçŸ¥å°±è¯Š
                  </el-button>
                  <el-button plain type="info" @click="Editsingletaskson('5')">
                    äººå·¥éšè®¿
                  </el-button>
                  <el-button type="primary" round @click="sendAgainmsg">
                    çŸ­ä¿¡å‘送
                  </el-button>
                </div>
              </el-form-item>
            </el-form>
          </div>
          <!-- æ‚£è€…档案信息 -->
          <div class="detailed">
            <h3>患者档案信息</h3>
            <el-form ref="userform" :model="userform" label-width="100px">
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="患者姓名" prop="name">
                    <el-input
                      v-model="userform.name"
                      placeholder="请输入姓名"
                      maxlength="30"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="性别" prop="sex">
                    <el-select v-model="userform.sex" placeholder="请选择">
                      <el-option label="男" :value="1"> </el-option>
                      <el-option label="女" :value="2"> </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="年龄" prop="age">
                    <el-input
                      v-model="userform.age"
                      placeholder="请输入年龄"
                      maxlength="20"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="联系方式" prop="telcode">
                    <el-input
                      v-model="userform.telcode"
                      placeholder="请输入联系方式"
                      maxlength="20"
                    />
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="亲属联系方式" prop="relativetelcode">
                    <el-input
                      v-model="userform.relativetelcode"
                      placeholder="请输入亲属联系方式"
                      maxlength="20"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="诊断名称" prop="leavediagname">
                    <el-input
                      v-model="form.leavediagname"
                      placeholder="请输入诊断"
                      maxlength="50"
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="出生地" prop="birthplace">
                    <el-input
                      v-model="userform.birthplace"
                      placeholder="国、省、地市、区县、街道等详细信息"
                      maxlength="50"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="居住地" prop="placeOfResidence">
                    <el-input
                      v-model="userform.placeOfResidence"
                      placeholder="国、省、地市、区县、街道等详细信息"
                      maxlength="50"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </div>
        </div>
      </div>
    </div>
    <!-- çŸ­ä¿¡å‘送对话框 -->
    <el-dialog title="短信发送" :visible.sync="smsDialogVisible">
      <!-- æ³¨æ„è¿™é‡Œä½¿ç”¨äº† smsDialogVisible ä»¥åŒºåˆ†å·²æœ‰çš„ dialogFormVisible -->
      <el-form ref="smsForm" :model="form" label-width="80px">
        <el-form-item label="患者名称">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.sendname"
          ></el-input>
        </el-form-item>
        <el-form-item label="年龄">
          <el-input style="width: 400px" disabled v-model="form.age"></el-input>
        </el-form-item>
        <el-form-item label="电话">
          <el-input
            style="width: 400px"
            disabled
            v-model="userform.telcode"
          ></el-input>
          <!-- æ³¨æ„è¿™é‡Œå¯èƒ½ä½¿ç”¨ userform.telcode -->
        </el-form-item>
        <el-form-item label="科室">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.deptname"
          ></el-input>
        </el-form-item>
        <el-form-item label="病区">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.leavehospitaldistrictname"
          ></el-input>
        </el-form-item>
        <el-form-item label="短信内容">
          <el-input type="textarea" v-model="smsContent"></el-input>
          <!-- å»ºè®®ä½¿ç”¨ç‹¬ç«‹çš„ smsContent å˜é‡ -->
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="smsDialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="sendSms">确认发送</el-button>
        <!-- æ³¨æ„æ–¹æ³•名改为 sendSms -->
      </div>
    </el-dialog>
    <el-dialog
      title="患者再次随访"
      v-dialogDrags
      :visible.sync="dialogFormVisible"
    >
      <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px">
        <el-form-item label="任务名称">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.taskName"
          ></el-input>
        </el-form-item>
        <el-form-item label="患者名称">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.sendname"
          ></el-input>
        </el-form-item>
        <el-form-item label="年龄">
          <el-input style="width: 400px" disabled v-model="form.age"></el-input>
        </el-form-item>
        <el-form-item label="科室">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.deptname"
          ></el-input>
        </el-form-item>
        <el-form-item label="病区">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.leavehospitaldistrictname"
          ></el-input>
        </el-form-item>
        <el-form-item label="出院时间">
          <el-input
            style="width: 400px"
            disabled
            v-model="form.endtime"
          ></el-input>
        </el-form-item>
        <div class="headline">上次随访</div>
        <el-divider></el-divider>
        <el-row>
          <el-col :span="12">
            <el-form-item label="随访方式">
              <el-select
                v-model="form.visitType2"
                filterable
                allow-create
                default-first-option
                disabled
                placeholder="请选择随访方式"
                class="custom-disabled"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="随访时间">
              <el-date-picker
                type="date"
                disabled
                placeholder="选择日期"
                :picker-options="pickerOptions"
                align="right"
                v-model="form.date2"
                class="custom-disabled"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="随访记录">
          <el-input
            class="custom-disabled"
            type="textarea"
            disabled
            v-model="form.remark2"
          ></el-input>
        </el-form-item>
        <div class="headline">下次随访</div>
        <el-divider></el-divider>
        <el-row>
          <el-col :span="12">
            <el-form-item label="随访方式" prop="visitType">
              <el-select
                v-model="form.visitType"
                filterable
                allow-create
                default-first-option
                @change="visitChange"
                placeholder="请选择随访方式(依出院时间计算)"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="随访时间" prop="date1">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                :picker-options="pickerOptions"
                align="right"
                v-model="form.date1"
                class="custom-disabled"
                value-format="yyyy-MM-dd hh:mm:ss"
                @change="checkFollowupDate"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="随访类型" prop="resource">
          <el-radio-group v-model="form.resource">
            <el-radio label="1">本病区随访</el-radio>
            <el-radio label="2">随访中心随访</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="随访记录" :required="form.resource == '2'">
          <el-input type="textarea" v-model="form.remark"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="warning" @click="dialogFormVisible = false"
          >取 æ¶ˆ</el-button
        >
        <el-button type="primary" @click="setupsubtask">确认创建服务</el-button>
      </div>
    </el-dialog>
    <div class="main-content" v-if="orgname == '景宁畲族自治县人民医院'">
      <!-- <el-button @click="CaldialogVisible = true">打开弹框</el-button> -->
      <!-- å¼¹æ¡†è°ƒç”¨ -->
      <el-dialog
        title="呼叫功能框"
        :visible.sync="CaldialogVisible"
        width="60%"
      >
        <CallCenterLs ref="CallCenterLs" :initial-phone="currentPhoneNumber" />
      </el-dialog>
    </div>
  </div>
</template>
<script>
import {
  getsearchrResults,
  getPersonVoices,
  addserviceSubtask,
  getTaskservelist,
  getTaskFollowup,
  Editsingletaskson,
  serviceSubtaskDetailedit,
  serviceSubtaskDetailadd,
  updatePersonVoices,
  addPersonVoices,
  query360PatInfo,
  sendMsg,
} from "@/api/AiCentre/index";
import {
  messagelistpatient,
  alterpatient,
  listcontactinformation,
} from "@/api/patient/homepage";
import CallButton from "@/components/CallButton";
import MergeAndModify from "./MergeAndModify.vue";
import CallCenterLs from "@/components/CallCenterLs";
export default {
  components: {
    CallButton,
    MergeAndModify,
    CallCenterLs,
  },
  directives: {
    numericOnly: {
      bind(el, binding, vnode) {
        // å°è¯•获取实际的input元素
        const input = el.tagName === "INPUT" ? el : el.querySelector("input");
        if (!input) {
          console.warn("v-numeric-only: æœªæ‰¾åˆ°input元素");
          return;
        }
        const handleInput = function (event) {
          const oldValue = input.value;
          const newValue = oldValue.replace(/[^\d]/g, "");
          if (newValue !== oldValue) {
            input.value = newValue;
            // è§¦å‘input事件,通知v-model更新
            input.dispatchEvent(new Event("input", { bubbles: true })); // æ³¨æ„bubbles
          }
        };
        const handlePaste = function (event) {
          event.preventDefault();
          const clipboardData = event.clipboardData || window.clipboardData;
          const pastedData = clipboardData.getData("text");
          const numericValue = pastedData.replace(/[^\d]/g, "");
          // æ¨¡æ‹Ÿåœ¨å…‰æ ‡ä½ç½®æ’入纯数字文本
          const start = input.selectionStart;
          const end = input.selectionEnd;
          input.value =
            input.value.substring(0, start) +
            numericValue +
            input.value.substring(end);
          // è°ƒæ•´å…‰æ ‡ä½ç½®
          const newCursorPos = start + numericValue.length;
          input.setSelectionRange(newCursorPos, newCursorPos);
          // è§¦å‘input事件
          input.dispatchEvent(new Event("input", { bubbles: true }));
        };
        input.addEventListener("input", handleInput);
        input.addEventListener("paste", handlePaste);
        // å­˜å‚¨å¼•用以便解绑
        el._numericOnly = {
          inputHandle: handleInput,
          pasteHandle: handlePaste,
          inputEl: input,
        };
      },
      unbind(el) {
        if (el._numericOnly) {
          const { inputHandle, pasteHandle, inputEl } = el._numericOnly;
          inputEl.removeEventListener("input", inputHandle);
          inputEl.removeEventListener("paste", pasteHandle);
          delete el._numericOnly;
        }
      },
    },
  },
  dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
  data() {
    const validatePhone = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("请输入联系电话"));
      }
      setTimeout(() => {
        if (!/^1[3-9]\d{9}$/.test(value)) {
          callback(new Error("请输入正确的11位手机号码"));
        } else {
          callback();
        }
      }, 300);
    };
    return {
      userid: "",
      currentPhoneNumber: "",
      callType: "", // ç”¨äºŽåŒºåˆ†æ˜¯å“ªä¸ªç”µè¯
      isSipRegistering: true, // SIP注册状态
      // å·²æœ‰æ•°æ®...
      customCallStatus: "", // ç”¨äºŽå­˜å‚¨è‡ªå®šä¹‰çŠ¶æ€æ–‡æœ¬
      callStatus: "idle", // idle, calling, connected, ended, failed
      isEndingCall: false,
      CaldialogVisible: false,
      currentCall: null, // å½“前通话对象
      // æ–°å¢žåŠŸèƒ½æ•°æ®
      showPatientInfo: true,
      showContinuationCareBtn: false, // æŽ§åˆ¶å»¶ç»­æŠ¤ç†æŒ‰é’®æ˜¾ç¤º
      // è·¯ç”±ç›‘听相关
      routeWatcher: null,
      lastRoutePath: this.$route.path,
      input: "今天身体还不错",
      radio: "2",
      taskname: "",
      activeName: "wj",
      voice: "",
      templateid: "",
      again: "",
      orgname: "",
      zcform: {},
      form: {},
      cities: [
        {
          label: "正常语音",
          value: "1",
        },
        {
          label: "患者拒接或拒访",
          value: "2",
        },
        {
          label: "面访或者接诊",
          value: "3",
        },
        {
          label: "微信随访",
          value: "4",
        },
        {
          label: "随访电话不正确",
          value: "5",
        },
        {
          label: "不宜随访被过滤",
          value: "6",
        },
        {
          label: "其他",
          value: "7",
        },
      ],
      tableDatatop: [], //题目表
      voiceDatatop: [], //题目表
      dynamicTags: [],
      isMergeMode: false,
      mergeDialogVisible: false,
      selectedServices: [], // é€‰ä¸­çš„æœåŠ¡åˆ—è¡¨
      selectedTag: "",
      tagOptions: [
        {
          value: "0",
          label: "正常",
          type: "normal",
          color: "#7ff5e1",
          description: "患者情况正常,无需特别关注",
        },
        {
          value: "1",
          label: "异常",
          type: "abnormal",
          color: "#f75c5c",
          description: "患者存在异常情况,需要重点关注",
        },
        {
          value: "2",
          label: "警告",
          type: "warning",
          color: "#fbfb4a",
          description: "患者情况需要警告注意,可能存在风险",
        },
      ],
      zcrules: {
        resource: [
          { required: true, message: "请选择随访方式", trigger: "change" },
        ],
        date1: [
          { required: true, message: "请选择随访时间", trigger: "blur" },
          {
            validator: (rule, value, callback) => {
              if (!value) {
                return callback(new Error("请选择随访时间"));
              }
              const selectedDate = new Date(value);
              const now = new Date();
              if (selectedDate < now) {
                return callback(new Error("随访时间不能早于当前日期"));
              }
              callback();
            },
            trigger: "change",
          },
        ],
      },
      userrules: {
        telcode: [{ validator: validatePhone, trigger: "blur" }],
        relativetelcode: [{ validator: validatePhone, trigger: "blur" }],
      },
      url: "http://9.208.2.190:8090/smartor/serviceExternal/query360PatInfo",
      postData: {
        XiaoXiTou: {
          FaSongFCSJC: "ZJHES",
          FaSongJGID: localStorage.getItem("orgid"),
          FaSongJGMC: localStorage.getItem("orgname"),
          FaSongSJ: "2025-01-09 17:29:36",
          FaSongXTJC: "SUIFANGXT",
          FaSongXTMC: "随访系统",
          XiaoXiID: "5FA92AFB-9833-4608-87C7-F56A654AC171",
          XiaoXiLX: "SC_LC_360STCX",
          XiaoXiMC: "360 视图查询",
          ZuHuID: localStorage.getItem("ZuHuID"),
          ZuHuMC: localStorage.getItem("orgname"),
        },
        YeWuXX: {
          BingRenXX: {
            ZhengJianHM: "",
            ZhengJianLXDM: "01",
            ZhengJianLXMC: "居民身份证",
            ZuZhiJGID: localStorage.getItem("orgid"),
            ZuZhiJGMC: localStorage.getItem("orgname"),
          },
          YongHuXX: {
            XiTongID: "SUIFANGXT",
            XiTongMC: "随访系统",
            YongHuID: localStorage.getItem("YongHuID"),
            YongHuXM: localStorage.getItem("YongHuXM"),
            ZuZhiJGID: localStorage.getItem("orgid"),
            ZuZhiJGMC: localStorage.getItem("orgname"),
            idp: "lyra",
          },
        },
      },
      pickerOptions: {
        disabledDate(time) {
          // ç¦ç”¨ä»Šå¤©åŠä¹‹å‰çš„æ—¥æœŸ
          return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
        },
        // shortcuts: [
        //   {
        //     text: "七天后",
        //     onClick(picker) {
        //       const date = new Date();
        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
        //       picker.$emit("pick", date);
        //     },
        //   },
        //   {
        //     text: "15天后",
        //     onClick(picker) {
        //       const date = new Date();
        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 15);
        //       picker.$emit("pick", date);
        //     },
        //   },
        //   {
        //     text: "一个月后",
        //     onClick(picker) {
        //       const date = new Date();
        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 30);
        //       picker.$emit("pick", date);
        //     },
        //   },
        //   {
        //     text: "三个月后",
        //     onClick(picker) {
        //       const date = new Date();
        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 90);
        //       picker.$emit("pick", date);
        //     },
        //   },
        //   {
        //     text: "六个月后",
        //     onClick(picker) {
        //       const date = new Date();
        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 180);
        //       picker.$emit("pick", date);
        //     },
        //   },
        //   {
        //     text: "一年后",
        //     onClick(picker) {
        //       const date = new Date();
        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 365);
        //       picker.$emit("pick", date);
        //     },
        //   },
        // ],
      },
      options: [
        {
          value: "七天后",
          label: "七天后",
        },
        {
          value: "15天后",
          label: "15天后",
        },
        {
          value: "一个月后",
          label: "一个月后",
        },
        {
          value: "三个月后",
          label: "三个月后",
        },
        {
          value: "六个月后",
          label: "六个月后",
        },
        {
          value: "一年后",
          label: "一年后",
        },
      ],
      statusTimer: null,
      userform: {},
      smsDialogVisible: false, // æŽ§åˆ¶çŸ­ä¿¡å¯¹è¯æ¡†æ˜¾ç¤º
      smsContent: "", // å­˜å‚¨çŸ­ä¿¡å†…容
      Whetherall: true, //是否全部记录展示
      dialogFormVisible: false,
      Voicetype: 0, //是否为语音服务
      visitCount: null,
      logsheetlist: [],
      topicobj: {},
      sendname: null,
      serviceType: null,
      id: null,
      taskid: null,
      patid: null,
    };
  },
  // åœ¨ç»„件中添加销毁前的清理
  beforeUnmount() {
    if (this.statusTimer) {
      clearTimeout(this.statusTimer);
      this.statusTimer = null;
    }
  },
  computed: {
    callStatusText() {
      if (this.customCallStatus) {
        return this.customCallStatus;
      }
      const statusMap = {
        idle: "准备呼叫",
        calling: `正在呼叫 ${this.currentPhoneNumber}...`,
        connected: `已接通 ${this.currentPhoneNumber}`,
        ended: "通话已结束",
        failed: "呼叫失败",
      };
      return statusMap[this.callStatus];
    },
    callStatusType() {
      const typeMap = {
        idle: "info",
        calling: "warning",
        connected: "success",
        ended: "info",
        failed: "error",
      };
      return typeMap[this.callStatus];
    },
  },
  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.again = this.$route.query.again;
    this.Voicetype = this.$route.query.Voicetype;
    this.visitCount = this.$route.query.visitCount;
    this.serviceType = this.$route.query.serviceType;
    this.orgname = localStorage.getItem("orgname");
    if (this.orgname == "省立同德翠苑院区") {
      this.showContinuationCareBtn = true;
    }
    if (this.orgname == "缙云县中医医院") {
      this.options = [
        {
          value: "半个月后",
          label: "半个月后",
        },
        {
          value: "一个月后",
          label: "一个月后",
        },
        {
          value: "两个月后",
          label: "两个月后",
        },
        {
          value: "三个月后",
          label: "三个月后",
        },
        {
          value: "六个月后",
          label: "六个月后",
        },
        {
          value: "12个月后",
          label: "12个月后",
        },
      ];
    }
    this.getTaskservelist();
  },
  mounted() {
    // ç›‘听子组件的sipStatus属性变化
    if (this.$refs.callButton) {
      this.$watch(
        () => this.$refs.callButton.sipStatus,
        (newStatus) => {
          if (this.statusTimer) {
            clearTimeout(this.statusTimer);
            this.statusTimer = null;
          }
          if (newStatus === "已注册") {
            this.statusTimer = setTimeout(() => {
              this.isSipRegistering = false;
              this.customCallStatus = ""; // æ³¨å†ŒæˆåŠŸåŽæ¸…ç©ºè‡ªå®šä¹‰æç¤º
              console.log("SIP注册成功,状态已更新");
            }, 2000);
            this.isSipRegistering = false;
          } else if (newStatus === "注册失败" || newStatus === "未连接") {
            this.isSipRegistering = true;
            this.customCallStatus = "呼叫中断,资源重新加载中请稍等3s重新。";
          }
        },
        { immediate: true } // ç«‹å³æ‰§è¡Œä¸€æ¬¡ä»¥èŽ·å–åˆå§‹å€¼
      );
    }
  },
  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) {
          // é’ˆå¯¹å†æ¬¡éšè®¿æœåŠ¡è¿›è¡Œåˆ é™¤ç»“æžœèµ‹å€¼
          // if (this.again && res.data.upScriptResult) {
          //   res.data.upScriptResult.forEach((itemA) => {
          //     const itemB = res.data.scriptResult.find(
          //       (item) => item.scriptContent === itemA.scriptContent
          //     );
          //     if (itemB) {
          //       itemB.scriptResult = itemA.scriptResult;
          //     }
          //   });
          // }
          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();
        }
      });
    },
    //患者360跳转
    gettoken360(sfzh, drcode, drname) {
      // this.$modal.msgWarning("360功能暂未开通");
      this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh;
      query360PatInfo(this.postData).then((res) => {
        if (res.data.url) {
          window.open(res.data.url, "_blank");
          // this.linkUrl = res.data.url;
        } else {
          this.$modal.msgWarning("360查询无结果");
        }
      });
    },
    // èŽ·å–åŸºç¡€ä¿¡æ¯
    getuserinfo() {
      const queryParams = {
        pid: Number(this.patid),
        allhosp: "0", //1住院2门诊3体检4出院
      };
      // æ‚£è€…基础信息
      messagelistpatient(queryParams).then((response) => {
        if (response.rows[0]) {
          this.userform = response.rows[0];
          // this.dynamicTags = response.rows[0].tagList.map(this.processElement);
        }
      });
      listcontactinformation({ patid: this.patid }).then((response) => {
        this.tableData = response.rows;
        if (this.tableData.length) {
          this.userform.relativetelcode = this.tableData[0].contactway;
          this.userform.relation = this.tableData[0].relation;
        }
      });
    },
    // å†æ¬¡éšè®¿æ—¶é—´é€‰å–
    visitChange(value) {
      if (!this.form.endtime) {
        this.$message.warning("请先确认出院时间");
        this.form.visitType = "";
        this.$refs.zcform.clearValidate(["visitType"]);
        return;
      }
      const dischargeDate = new Date(this.form.endtime);
      const now = new Date();
      let followupDate = new Date(dischargeDate);
      // æ ¹æ®é€‰æ‹©çš„随访方式计算随访日期
      if (value.includes("七天后")) {
        followupDate.setDate(dischargeDate.getDate() + 7);
      } else if (value.includes("15天后") || value.includes("半个月后")) {
        followupDate.setDate(dischargeDate.getDate() + 15);
      } else if (value.includes("一个月后")) {
        followupDate.setMonth(dischargeDate.getMonth() + 1);
      } else if (value.includes("两个月后")) {
        followupDate.setMonth(dischargeDate.getMonth() + 2);
      } else if (value.includes("三个月后")) {
        followupDate.setMonth(dischargeDate.getMonth() + 3);
      } else if (value.includes("六个月后")) {
        followupDate.setMonth(dischargeDate.getMonth() + 6);
      } else if (value.includes("一年后") || value.includes("12个月后")) {
        followupDate.setFullYear(dischargeDate.getFullYear() + 1);
      }
      if (followupDate < now) {
        this.$message.warning(
          `计算出的随访时间 ${this.formatTime(followupDate)} å·²è¿‡æœŸ`
        );
        this.form.visitType = "";
        this.$refs.zcform.clearValidate(["visitType", "date1"]);
        return;
      }
      this.form.date1 = this.formatTime(followupDate);
      this.$refs.zcform.clearValidate(["date1"]);
    },
    // æ£€æŸ¥éšè®¿æ—¥æœŸæ˜¯å¦æœ‰æ•ˆ
    checkFollowupDate(date) {
      if (!date) {
        this.form.date1 = "";
        this.$refs.zcform.clearValidate(["date1"]);
        return;
      }
      const selectedDate = new Date(date);
      const now = new Date();
      if (selectedDate < now) {
        this.$message.warning("随访时间不能早于当前日期");
        this.form.date1 = "";
        this.$refs.zcform.validateField("date1"); // è§¦å‘验证
      }
    },
    // èŽ·å–è¯­éŸ³æ•°æ®
    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 = [];
            }
          });
          if (!this.tableDatatop.length) {
            this.puttaskid(this.templateid);
          }
        }
      });
    },
    // èŽ·å–é—®å·å®Œæ•´æ•°æ®æ¯”å¯¹
    puttaskid(id) {
      getTaskFollowup(id).then((res) => {
        if (res.code == 200) {
          this.tableDatatop = res.data.ivrTaskTemplateScriptVOList;
          this.tableDatatop.forEach((item) => {
            item.id = null;
            // ç±»åž‹åˆ¤æ–­èµ‹å€¼
            if (item.ivrTaskScriptTargetoptionList) {
              item.targetvalue = 1;
              item.questiontext = item.scriptContent;
              item.targetvalue = item.ivrTaskScriptTargetoptionList
                .map((obj) => obj.targetvalue)
                .join("&");
            }
            if (item.targetvalue) {
              item.scriptResult = item.targetvalue.split("&");
            } else {
              item.scriptResult = [];
            }
          });
        }
      });
    },
    // åŒ»æŠ¤äººå‘˜å­˜å‚¨æ•°æ®
    getdetail() {
      let excep = "";
      const promises = [];
      this.tableDatatop.forEach((item) => {
        if (item.valueType == 3 && item.scriptResult) {
          // éªŒè¯æ˜¯å¦ä¸ºæœ‰æ•ˆæ•°å­—
          if (!/^\d+$/.test(item.scriptResult)) {
            this.$message.error(`问题 "${item.scriptContent}" å¿…须输入数字`);
            return;
          }
        }
        var objs = item.svyTaskTemplateTargetoptions.find(
          (items) => items.optioncontent == item.scriptResult
        );
        if (objs) {
          if (excep != 1 && objs.isabnormal) {
            excep = objs.isabnormal;
            this.selectedTag = objs.isabnormal;
          }
        }
        console.log(excep, "excep");
        let obj = {
          asrtext: null,
          patid: this.patid,
          subId: this.id,
          taskid: this.taskid,
          scriptid: item.id,
          excep: excep,
          questiontext: item.scriptContent,
          categoryid: item.categoryid,
          answerps: item.answerps || null, // æ·»åŠ é™„åŠ ä¿¡æ¯
        };
        if (item.scriptType == 2 && item.scriptResult[0]) {
          obj.asrtext = item.scriptResult.join("&");
        } else if (item.scriptType != 2 && item.scriptResult) {
          obj.asrtext = item.scriptResult;
        }
        if (item.isoption == 3) {
          promises.push(serviceSubtaskDetailedit(obj));
        } else {
          promises.push(serviceSubtaskDetailadd(obj));
        }
      });
      // ä½¿ç”¨ Promise.all ç­‰å¾…所有异步操作完成
      Promise.all(promises)
        .then((results) => {
          // æ‰€æœ‰å¼‚步操作成功完成后的逻辑
          results.forEach((res) => {
            if (res.code !== 200) {
              this.$modal.error("修改失败");
            }
          });
          this.Editsingletasksonyic(6);
          const orgName = localStorage.getItem("orgname");
          console.log(orgName, "orgName");
          if (this.form.isVisitAgain != 1 || orgName == "丽水市中医院") {
            this.Torouter();
            return;
          }
          this.$modal
            .confirm(
              '任务保存成功是否针对患者:"' +
                this.userform.name +
                '"再次随访?',
              "确认",
              {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                showCancelButton: true,
                dangerouslyUseHTMLString: true,
                confirmButtonClass: "custom-confirm-button", // è‡ªå®šä¹‰ç¡®è®¤æŒ‰é’®çš„类名
                cancelButtonClass: "custom-cancel-button", // è‡ªå®šä¹‰å–消按钮的类名
              }
            )
            .then(() => {
              document.querySelector("#app").scrollTo(0, 0);
              this.formtidy();
              this.dialogFormVisible = true;
            })
            .catch(() => {
              this.Torouter();
            });
        })
        .catch((error) => {
          // å¦‚果有任何一个异步操作失败,会进入这里
          console.error("发生错误:", error);
        });
    },
    Torouter() {
      if (this.form.serviceType == 13) {
        if (this.visitCount != 1) {
          this.$router.push({
            path: "/logisticsservice/zbAgain",
          });
        } else {
          this.$router.push({
            path: "/logisticsservice/record",
          });
        }
      } else if (this.form.serviceType == 2) {
        if (this.visitCount != 1) {
          this.$router.push({
            path: "/logisticsservice/again",
          });
        } else {
          this.$router.push({
            path: "/followvisit/discharge",
          });
        }
      }
    },
    // ç”µè¯============================
    // éªŒè¯ç”µè¯å·ç æ ¼å¼å¹¶è¿”回错误信息
    validatePhoneNumber(phone) {
      if (!phone) {
        return { isValid: false, message: "请输入电话号码" };
      }
      // æ‰‹æœºå·æ­£åˆ™
      const mobileRegex = /^1[3-9]\d{9}$/;
      // å¸¦åŒºå·çš„固定电话(完整格式)
      const landlineFullRegex = /^0\d{2,3}-?\d{7,8}$/;
      // ä¸å¸¦åŒºå·çš„固定电话(仅本地号码)
      const landlineLocalRegex = /^\d{7,8}$/;
      if (mobileRegex.test(phone)) {
        return { isValid: true, type: "mobile" };
      } else if (landlineFullRegex.test(phone)) {
        return { isValid: true, type: "landline" };
      } else if (landlineLocalRegex.test(phone)) {
        return {
          isValid: false,
          message: "本地号码请添加区号(如028-1234567)",
        };
      } else {
        return {
          isValid: false,
          message: "请输入正确的电话号码(手机号或带区号的固定电话)",
        };
      }
    },
    // ä½¿ç”¨ç¤ºä¾‹
    isValidPhone(phone) {
      return this.validatePhoneNumber(phone).isValid;
    },
    handleCall(phone, type, dh) {
      if (!this.isValidPhone(phone) && !dh) {
        this.$message.error("请输入正确的手机号码");
        return;
      }
      // æ£€æŸ¥SIP是否已注册
      this.currentPhoneNumber = phone;
      // æ˜¯å¦æ™¯å®å‘¼å«
      if (this.orgname == "景宁畲族自治县人民医院") {
        this.CaldialogVisible = true;
        return;
      }
      // ä¸‹æ–¹æ˜¯ä¸­åŒ»é™¢å‘¼å«
      if (this.isSipRegistering) {
        this.$message.warning("系统正在初始化,请稍候...");
        return;
      }
      this.callType = type;
      this.callStatus = "calling";
      this.$nextTick(() => {
        this.$refs.callButton.startCall();
        this.$refs.callButton.$on("call-status-change", (status) => {
          this.handleCallStatusChange(status);
          // ç›‘听注册状态变化
          if (status.type === "registered") {
            this.isSipRegistering = false;
          }
          if (status.type === "failed" || status.type === "disconnected") {
            this.isSipRegistering = true;
          }
        });
      });
    },
    // å¤„理通话状态变化
    handleCallStatusChange(status) {
      console.log(status, "status");
      this.callStatus = status.type;
      if (status.type === "connected") {
        this.currentCall = {
          phone: this.currentPhoneNumber,
          type: this.callType,
          startTime: new Date(),
        };
      } else if (status.type === "ended" || status.type === "failed") {
        this.currentCall = null;
      }
      // å¯ä»¥æ ¹æ®çŠ¶æ€æ‰§è¡Œå…¶ä»–æ“ä½œ
      if (status.type === "failed") {
        this.$message.error(`呼叫失败: ${status.text}`);
      }
    },
    // ç»“束当前通话
    endCurrentCall() {
      if (!this.currentCall) return;
      this.isEndingCall = true;
      this.$refs.callButton.endCall();
      // 3秒后重置状态
      setTimeout(() => {
        this.isEndingCall = false;
      }, 3000);
    },
    yuyingetdetail() {
      const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
      console.log(dataToSubmit, "dataToSubmit");
      // return;
      dataToSubmit.forEach((item, index) => {
        // å¯¹æ‹·è´çš„æ•°æ®è¿›è¡Œæ“ä½œï¼Œä¸å½±å“åŽŸå§‹çš„ scriptResult æ•°ç»„
        item.scriptResult = item.scriptResult.join("&");
        item.templatequestionnum = index + 1;
        item.subId = this.id;
        item.taskid = this.taskid;
        item.asrtext = item.matchedtext;
        if (!item.id) {
          item.isoperation = 1;
        }
        item.patid = this.patid;
        item.templateid = item.templateID;
      });
      let obj = {
        serviceSubtaskDetailList: dataToSubmit, // æäº¤å¤„理后的副本
        param1: this.taskid,
        param2: this.patid,
        subId: this.id,
      };
      const orgName = localStorage.getItem("orgname");
      console.log(orgName, "orgName");
      if (this.form.isVisitAgain != 1 || orgName == "丽水市中医院") {
        this.Torouter();
        return;
      }
      addPersonVoices(obj).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务保存成功");
          this.$modal
            .confirm(
              '任务保存成功是否针对患者:"' +
                this.userform.name +
                '"再次随访?',
              "确认",
              {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                showCancelButton: true,
                dangerouslyUseHTMLString: true,
                confirmButtonClass: "custom-confirm-button", // è‡ªå®šä¹‰ç¡®è®¤æŒ‰é’®çš„类名
                cancelButtonClass: "custom-cancel-button", // è‡ªå®šä¹‰å–消按钮的类名
              }
            )
            .then(() => {
              document.querySelector("#app").scrollTo(0, 0);
              this.formtidy();
              this.dialogFormVisible = true;
            })
            .catch(() => {
              this.Torouter();
            });
        }
      });
    },
    // å†æ¬¡éšè®¿æ•°æ®æ›´æ›¿
    formtidy() {
      this.form.visitType2 = this.form.visitType;
      this.form.date2 = this.form.visitTime;
      // this.form.date1 = this.setCurrentDate();
      this.form.remark2 = this.form.remark;
    },
    setCurrentDate() {
      // èŽ·å–å½“å‰æ—¥æœŸå¹¶æ ¼å¼åŒ–ä¸º yyyy-MM-dd
      const today = new Date();
      const year = today.getFullYear();
      const month = String(today.getMonth() + 1).padStart(2, "0");
      const day = String(today.getDate()).padStart(2, "0");
      return `${year}-${month}-${day}`;
    },
    // èŽ·å–æ‚£è€…è®°å½•
    getTaskservelist(id) {
      if (id) {
        this.Whetherall = false;
      } else {
        this.Whetherall = true;
      }
      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
          );
          console.log(this.form, "serviceType");
          this.logsheetlist = res.rows[0].serviceSubtaskList;
          this.templateid = this.form.templateid;
          this.selectedTag = this.form.excep;
          const targetDate = new Date(this.form.visitTime); // ç›®æ ‡æ—¥æœŸ
          const now = new Date(); // å½“前时间
          if (now < targetDate && this.form.sendstate == 2) {
            this.$confirm("当前服务未到发送时间请谨慎修改", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            })
              .then(() => {})
              .catch(() => {});
          }
          this.getuserinfo();
        }
        if (this.Voicetype) {
          this.getPersonVoices();
        } else {
          this.getsearchrResults();
        }
      });
    },
    // è°ƒèµ·çŸ­ä¿¡å‘送对话框
    sendAgainmsg() {
      this.smsDialogVisible = true;
      // å¯ä»¥åœ¨è¿™é‡Œåˆå§‹åŒ– smsContent,例如 this.smsContent = '';
    },
    // å‘送短信的方法
    sendSms() {
      // è¿™é‡Œè°ƒç”¨ä½ çš„短信发送 API
      // å‡è®¾ API ä¸º sendMsg,参数可能需要根据实际情况调整
      sendMsg({
        phone: this.userform.telcode, // ç¡®ä¿ç”µè¯å·ç å­—段正确
        content: this.smsContent,
      })
        .then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("发送成功");
            this.smsDialogVisible = false; // å…³é—­å¯¹è¯æ¡†
            this.smsContent = ""; // æ¸…空内容
          } else {
            this.$modal.msgError("发送失败");
          }
        })
        .catch((error) => {
          console.error("发送短信失败:", error);
          this.$modal.msgError("发送失败");
        });
    },
    Editsingletaskson(son) {
      let objson = {};
      getTaskservelist({
        patid: this.patid,
        subId: this.id,
      }).then((res) => {
        if (res.code == 200) {
          objson = res.rows[0].serviceSubtaskList[0];
          objson.suggest = son;
          Editsingletaskson(objson).then((res) => {
            if (res.code) {
              this.$modal.msgSuccess("服务记录成功");
              this.getTaskservelist();
            }
          });
        }
      });
    },
    Editsingletasksonyic(sendstate) {
      let objson = {};
      getTaskservelist({
        patid: this.patid,
        subId: this.id,
      }).then((res) => {
        if (res.code == 200) {
          objson = res.rows[0].serviceSubtaskList.find(
            (item) => item.id == this.id
          );
          objson.remark = this.form.remark;
          objson.taskSituation = this.form.taskSituation;
          objson.excep = this.selectedTag;
          if (sendstate) objson.sendstate = sendstate;
          Editsingletaskson(objson).then((res) => {
            if (res.code) {
              this.$modal.msgSuccess("服务修改成功");
              alterpatient(this.userform).then((res) => {
                if (res.code == 200) {
                  this.$modal.msgSuccess("基础信息保存成功");
                } else {
                  this.$modal.msgError("基础信息修改失败");
                }
              });
              this.getTaskservelist();
            }
          });
        }
      });
    },
    // å¼‚常列渲染
    tableRowClassName({ row, rowIndex }) {
      if (row.id == this.id) {
        return "warning-row";
      }
      return "";
    },
    getSelectedTagType() {
      if (!this.selectedTag) return "";
      const tag = this.tagOptions.find(
        (item) => item.value === this.selectedTag
      );
      return tag ? tag.type : "";
    },
    getSelectedTagColor() {
      if (!this.selectedTag) return "";
      const tag = this.tagOptions.find(
        (item) => item.value === this.selectedTag
      );
      return tag ? tag.color : "";
    },
    getSelectedDescription() {
      if (!this.selectedTag) return "";
      const tag = this.tagOptions.find(
        (item) => item.value === this.selectedTag
      );
      return tag ? tag.description : "";
    },
    // è°ƒèµ·å†æ¬¡å‘送
    sendAgain() {
      getTaskservelist({
        patid: this.patid,
        visitCount: 2,
        leaveldeptcodes: [this.form.deptcode],
      }).then((res) => {
        if (res.rows[0].serviceSubtaskList.length) {
          if (
            res.rows[0].serviceSubtaskList[0].sendstate != 5 &&
            res.rows[0].serviceSubtaskList[0].sendstate != 6
          ) {
            this.$modal
              .confirm(
                '本患者在"' +
                  res.rows[0].serviceSubtaskList[0].deptname +
                  '"科室下已有再次随访服务进行中是否继续创建?'
              )
              .then(() => {
                document.querySelector("#app").scrollTo(0, 0);
                this.formtidy();
                this.dialogFormVisible = true;
              });
          } else {
            document.querySelector("#app").scrollTo(0, 0);
            this.formtidy();
            this.dialogFormVisible = true;
          }
        } else {
          document.querySelector("#app").scrollTo(0, 0);
          this.formtidy();
          this.dialogFormVisible = true;
        }
      });
    },
    // æŸ¥çœ‹è¯¦æƒ…
    Seedetails(row) {
      this.$modal
        .confirm('是否查看任务为"' + row.taskName + '"的服务详情数据?')
        .then(() => {
          let type = "";
          console.log(row, "rwo");
          if (row.type == 1) {
            type = 1;
          }
          this.taskid = row.taskid;
          this.id = row.id;
          this.patid = row.patid;
          this.serviceType = row.serviceType;
          this.getTaskservelist();
        })
        .catch(() => {});
    },
    aahandleOptionChange(a, b, c) {
      const result = c.find((item) => item.optioncontent == a);
      if (result.nextQuestion == 0) {
        this.tableDatatop = this.tableDatatop.reduce((acc, item, i) => {
          acc.push(i > b ? { ...item, astrict: 1 } : item);
          return acc;
        }, []);
      } else {
        this.tableDatatop = this.tableDatatop.reduce((acc, item, i) => {
          acc.push(i > b ? { ...item, astrict: 0 } : item);
          return acc;
        }, []);
      }
      if (this.Voicetype) {
        var obj = this.tableDatatop[b].ivrTaskScriptTargetoptionList.find(
          (item) => item.optioncontent == a
        );
      } else {
        var obj = this.tableDatatop[b].svyTaskTemplateTargetoptions.find(
          (item) => item.optioncontent == a
        );
      }
      if (obj.isabnormal) {
        this.tableDatatop[b].isabnormal = true;
      } else {
        this.tableDatatop[b].isabnormal = false;
      }
      this.$forceUpdate();
    },
    handleRadioToggles(questionItem, optionValue) {
      if (!questionItem.matchedtext) {
        questionItem.matchedtext == "";
      }
      // å¦‚果点击的是当前已选中的选项,则取消选中
      if (questionItem.matchedtext == optionValue) {
        this.$set(questionItem, "matchedtext", "");
        // åŒæ—¶é‡ç½®ä¸Žé€‰é¡¹ç›¸å…³çš„状态
        // questionItem.isabnormal = false;
        questionItem.showAppendInput = false;
        // æ³¨æ„ï¼šå–消选中时,我们通常不希望触发题目跳转逻辑,所以直接返回
        // å¦‚果需要,可以在这里添加取消选中后的特定逻辑,例如重置题目序列
      } else {
        // å¦‚果点击的是未选中的选项,则通过更改绑定值来触发原始的 handleOptionChange æ–¹æ³•
        // è¿™é‡Œåªéœ€è¦æ”¹å˜ v-model ç»‘定的值,change事件会自动触发
        this.$set(questionItem, "matchedtext", optionValue); // åŽç»­çš„跳转等复杂逻辑会在 handleOptionChange ä¸­æ­£å¸¸æ‰§è¡Œ
      }
    },
    // æ–°å¢žçš„切换选中/取消选中方法
    handleRadioToggle(questionItem, index, options, optionValue) {
      // å¦‚果点击的是当前已选中的选项,则取消选中
      if (questionItem.scriptResult === optionValue) {
        questionItem.scriptResult = ""; // æ¸…空选中值
        // åŒæ—¶é‡ç½®ä¸Žé€‰é¡¹ç›¸å…³çš„状态
        // questionItem.isabnormal = false;
        questionItem.showAppendInput = false;
        // æ³¨æ„ï¼šå–消选中时,我们通常不希望触发题目跳转逻辑,所以直接返回
        // å¦‚果需要,可以在这里添加取消选中后的特定逻辑,例如重置题目序列
      } else {
        // å¦‚果点击的是未选中的选项,则通过更改绑定值来触发原始的 handleOptionChange æ–¹æ³•
        // è¿™é‡Œåªéœ€è¦æ”¹å˜ v-model ç»‘定的值,change事件会自动触发
        questionItem.scriptResult = optionValue;
        this.handleOptionChange(optionValue, index, options, questionItem);
        // åŽç»­çš„跳转等复杂逻辑会在 handleOptionChange ä¸­æ­£å¸¸æ‰§è¡Œ
      }
    },
    // åœ¨methods部分,修改handleOptionChange方法:
    handleOptionChange(selectedOption, questionIndex, options, a) {
      console.log(selectedOption, questionIndex, options, a, "888");
      if (document.activeElement) {
        document.activeElement.blur();
      }
      // æ‰¾åˆ°è¢«é€‰ä¸­çš„选项对象
      const selectedOptionObj = options.find(
        (item) => item.optioncontent == selectedOption
      );
      // å¤„理异常状态高亮
      this.tableDatatop[questionIndex].isabnormal =
        selectedOptionObj.isabnormal;
      // å¤„理附加输入框显示
      this.tableDatatop[questionIndex].showAppendInput =
        selectedOptionObj.appendflag == 1;
      console.log(this.tableDatatop);
      // if (!this.tableDatatop[questionIndex].showAppendInput) {
      //   this.tableDatatop[questionIndex].answerps = ""; // æ¸…除附加信息
      // }
      // ä¿å­˜å½“前题目之前已经隐藏的题目状态
      const previouslyHiddenBeforeCurrent = this.tableDatatop
        .slice(0, questionIndex)
        .map((item, index) => (item.astrict ? index : -1))
        .filter((index) => index !== -1);
      // ä¿å­˜ä¹‹å‰å› nextQuestion=0而隐藏的题目范围
      const previouslyHiddenByEnd = this.tableDatatop
        .map((item, index) => (item.hiddenByEnd ? index : -1))
        .filter((index) => index !== -1);
      // å¦‚æžœbranchFlag为1,处理题目跳转
      if (a.branchFlag == 1) {
        if (selectedOptionObj.nextQuestion == 0) {
          // ç»“束问答 - éšè—åŽé¢æ‰€æœ‰é¢˜ç›®å¹¶æ ‡è®°
          this.tableDatatop = this.tableDatatop.map((item, index) => ({
            ...item,
            astrict: index > questionIndex,
            hiddenByEnd: index > questionIndex, // æ ‡è®°è¿™äº›é¢˜ç›®æ˜¯è¢«ç»“束问答隐藏的
          }));
        } else {
          // æ­£å¸¸è·³è½¬é€»è¾‘
          const nextQuestionIndex = selectedOptionObj.nextQuestion - 1;
          this.tableDatatop = this.tableDatatop.map((item, index) => {
            // ä¿ç•™å½“前题目之前的隐藏状态
            if (index < questionIndex) {
              return {
                ...item,
                astrict: previouslyHiddenBeforeCurrent.includes(index),
                hiddenByEnd: false, // æ¸…除结束标记
              };
            }
            // å½“前题目总是可见
            if (index === questionIndex) {
              return { ...item, astrict: 0, hiddenByEnd: false };
            }
            // æ˜¾ç¤ºç›®æ ‡ä¸‹ä¸€é¢˜
            if (index === nextQuestionIndex) {
              return { ...item, astrict: 0, hiddenByEnd: false };
            }
            // å¦‚果是之前被结束问答隐藏的题目,现在应该恢复显示
            if (item.hiddenByEnd) {
              return { ...item, astrict: 0, hiddenByEnd: false };
            }
            // éšè—å½“前题和目标题之间的题目
            if (index > questionIndex && index < nextQuestionIndex) {
              return { ...item, astrict: 1, hiddenByEnd: false };
            }
            // å…¶ä»–情况保持原状
            return item;
          });
        }
      } else {
        // å¦‚果没有跳转,只需确保下一题可见
        this.tableDatatop = this.tableDatatop.map((item, index) => ({
          ...item,
          astrict: index === questionIndex + 1 ? 0 : item.astrict,
          hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
        }));
      }
      2;
      this.$forceUpdate();
    },
    overdata() {
      this.tableDatatop.forEach((item, index) => {
        var obj = item.svyTaskTemplateTargetoptions.find(
          (items) => items.optioncontent == item.scriptResult
        );
        if (obj) {
          if (obj.isabnormal) {
            this.tableDatatop[index].isabnormal = obj.isabnormal;
          }
          this.$forceUpdate();
        }
      });
    },
    // åˆ›å»ºå†æ¬¡éšè®¿æœåŠ¡
    setupsubtask() {
      this.$refs["zcform"].validate((valid) => {
        if (valid) {
          if (this.form.date1 && new Date(this.form.date1) < new Date()) {
            this.$message.error("随访时间不能小于当前时间");
            return false;
          }
          if (this.form.resource == "2" && !this.form.remark) {
            this.$message.error("当前选择为随访中心随访需输入随访记录");
            return false;
          }
          this.form.remark =
            this.form.remark + "【" + this.getCurrentTime() + "】";
          let form = structuredClone(this.form);
          form.visitTime = this.parseTime(form.date1);
          form.finishtime = "";
          if (form.resource) {
            if (form.resource == 2) {
              form.visitDeptCode = localStorage.getItem("deptCode")
                ? localStorage.getItem("deptCode")
                : form.deptcode;
              form.visitDeptName = "随访中心";
            } else {
              form.visitDeptCode = form.deptcode;
              form.visitDeptName = form.deptname;
            }
          } else {
            this.$modal.msgError("未选择随访方式");
            return;
          }
          // form.id = null;
          form.sendstate = 2;
          console.log(form.serviceType, "form.serviceType");
          addserviceSubtask(form).then((res) => {
            if (res.code == 200) {
              this.$modal.msgSuccess("创建成功");
              if (form.serviceType == 13) {
                this.$router.push({
                  path: "/logisticsservice/zbAgain",
                });
              } else if (form.serviceType == 2) {
                this.$router.push({
                  path: "/logisticsservice/again",
                });
              }
            } else {
              this.$modal.msgError("创建失败");
            }
            document.querySelector("#app").scrollTo(0, 0);
            this.dialogFormVisible = false;
          });
        }
      });
    },
    getCurrentTime() {
      const now = new Date();
      const year = now.getFullYear();
      const month = String(now.getMonth() + 1).padStart(2, "0");
      const day = String(now.getDate()).padStart(2, "0");
      const hours = String(now.getHours()).padStart(2, "0");
      const minutes = String(now.getMinutes()).padStart(2, "0");
      const seconds = String(now.getSeconds()).padStart(2, "0");
      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    },
    updateScore(a, b, c) {},
    // åˆå¹¶ä¿®æ”¹ç›¸å…³=============================
    toggleMergeMode() {
      this.isMergeMode = !this.isMergeMode;
      if (!this.isMergeMode) {
        this.selectedServices = [];
      }
    },
    handleSelectionChange(selection) {
      this.selectedServices = selection
        .filter(
          (item) => !item.preachformson || !item.preachformson.includes("3")
        )
        .map((item) => ({
          id: item.id,
          taskid: item.taskid,
          taskName: item.taskName,
          sendname: item.sendname,
        }));
    },
    checkSelectable(row, index) {
      // å½“ sendstate ä¸º 6 æ—¶ä¸å¯é€‰
      return row.sendstate !== 6;
    },
    openMergeDialog() {
      if (this.selectedServices.length < 2) {
        this.$message.warning("请至少选择2个问卷服务进行合并");
        return;
      }
      this.mergeDialogVisible = true;
    },
    handleMergeSave(mergedData) {
      // å¤„理合并保存逻辑
      this.mergeDialogVisible = false;
      this.isMergeMode = false;
      this.selectedServices = [];
      // æ˜¾ç¤ºä¿å­˜ç»“æžœ
      if (mergedData.successCount == mergedData.totalCount) {
        this.$message.success(`成功保存 ${mergedData.successCount} ä¸ªé—®å·`);
      } else if (mergedData.successCount > 0) {
        this.$message.warning(
          `成功保存 ${mergedData.successCount} ä¸ªé—®å·ï¼Œå¤±è´¥ ${
            mergedData.totalCount - mergedData.successCount
          } ä¸ª`
        );
      } else {
        this.$message.error("所有问卷保存失败");
      }
      // åˆ·æ–°æ•°æ®
      this.getTaskservelist();
    },
    // å»¶ç»­æŠ¤ç†
    handleContinuationCare() {
      if (this.form.continueFlag != 2) {
        this.$modal.confirm("是否为本次服务创建延续护理?").then(() => {
          this.$router.push({
            path: "/followvisit/ContinueFordetails/",
            query: {
              taskid: this.taskid,
              patid: this.patid,
              id: this.id,
              Voicetype: this.Voicetype,
              visitCount: this.visitCount,
            },
          });
        });
      } else {
        this.$router.push({
          path: "/followvisit/ContinueFordetails/",
          query: {
            taskid: this.taskid,
            patid: this.patid,
            id: this.id,
            Voicetype: this.Voicetype,
            visitCount: this.visitCount,
          },
        });
      }
    },
  },
  // deactivated() {
  //   console.log(11);
  // },
  beforeRouteLeave(to, from, next) {
    this.$refs.callButton.cleanupResources();
    if (this.$refs.CallCenterLs) {
      console.log(1);
      this.$refs.CallCenterLs.handleSeatLogout();
    }
    next(); // ç¡®ä¿è°ƒç”¨ nex
  },
  // beforeRouteUpdate() {
  //   console.log(33);
  // },
};
</script>
<style lang="scss" scoped>
.Followupdetailspage {
  margin: 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.action-container {
  display: flex;
  gap: 20px;
  margin: 0 10px 20px 10px;
  .manual-action {
    flex: 1;
    min-width: 0;
    height: 100%;
    /* ç¡®ä¿é«˜åº¦ç»§æ‰¿ */
  }
  .call-action {
    width: 60%;
    min-width: 0;
    height: 100%;
    /* ç¡®ä¿é«˜åº¦ç»§æ‰¿ */
  }
}
.numeric-input {
  position: relative;
}
.numeric-input::after {
  content: "只能输入数字";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #999;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
}
.call-container {
  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;
  height: 100%;
  .call-header {
    margin-bottom: 20px;
    h2 {
      font-size: 20px;
      color: #333;
      margin: 0;
      padding-bottom: 10px;
      border-bottom: 1px solid #eee;
    }
  }
  .call-status {
    margin-bottom: 20px;
  }
  .hangup-btn {
    text-align: center;
    margin-top: 20px;
  }
}
.merge-controls {
  background: #f5f7fa;
  border-radius: 4px;
  margin-left: 20px;
}
.Followuserinfo {
  margin: 10px 10px 0 10px;
  align-items: center;
  padding: 30px;
  background: #ffff;
  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);
  .userinfo-text {
    font-size: 20px;
    margin-right: 20px;
    margin-bottom: 10px;
  }
  .userinfo-value {
    color: rgb(15, 139, 211);
    span {
      margin-right: 20px;
    }
  }
}
::v-deep.el-table .warning-row {
  background: #c4e2ee;
}
.Followuserinfos {
  align-items: center;
  padding: 30px;
  background: #ffff;
  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);
  height: 100%;
  /* ç¡®ä¿é«˜åº¦ç»§æ‰¿ */
  min-height: 880px;
  /* æœ€å°é«˜åº¦ä¸Žéšè®¿å†…容一致 */
  display: flex;
  flex-direction: column;
  .userinfo-text {
    font-size: 20px;
    margin-right: 20px;
    margin-bottom: 10px;
  }
  .userinfo-value {
    color: rgb(15, 139, 211);
    span {
      margin-right: 20px;
    }
  }
  .el-form {
    flex: 1;
    overflow-y: auto;
    /* å†…容超过高度时显示滚动条 */
    max-height: calc(880px - 60px);
    /* å‡åŽ»padding */
    padding-right: 10px;
    /* é˜²æ­¢æ»šåŠ¨æ¡é®æŒ¡å†…å®¹ */
  }
}
.append-input-container {
  margin-top: 15px;
  padding: 10px;
  background-color: #f5f7fa;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
}
.borderdiv {
  min-height: 60vh;
  font-size: 20px;
  padding: 30px;
  .title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
  }
  .leftside {
    margin: 30px 0;
    span {
      width: 400px;
      margin-left: 20px;
      padding: 10px;
      color: #fff;
      background: rgb(110, 196, 247);
      border-radius: 10px;
    }
  }
  .offside {
    display: flex;
    flex-direction: row-reverse;
    .offside-value {
      padding: 10px;
      background: rgb(217, 173, 253);
      border-radius: 10px;
      color: #fff;
      margin-right: 20px;
    }
  }
}
.topic-dev[inert] {
  opacity: 0.5;
  pointer-events: none;
}
/* æŒ‚断容器样式 */
.hangup-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
}
.hangup-btn {
  width: 120px;
  height: 40px;
  font-size: 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
  transition: all 0.3s ease;
}
.hangup-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}
/* é€šè¯è®¡æ—¶å™¨ */
.call-timer {
  font-size: 12px;
  color: #666;
  background: #f5f5f5;
  padding: 4px 12px;
  border-radius: 12px;
  font-family: "Courier New", monospace;
}
/* çŠ¶æ€æç¤ºå®¹å™¨ */
.call-status-container {
  margin: 10px 0;
}
.status-alert {
  border-radius: 8px;
  transition: all 0.3s ease;
}
.status-alert.status-calling {
  border-left: 4px solid #e6a23c;
}
.status-alert.status-connected {
  border-left: 4px solid #67c23a;
  animation: pulse 2s infinite;
}
.status-alert.status-ended {
  border-left: 4px solid #909399;
}
/* SIP注册提示 */
.sip-registering {
  margin: 10px 0;
}
.registering-alert {
  border-radius: 8px;
  background-color: #f4f4f5;
  border-left: 4px solid #909399;
}
/* åŠ¨ç”»æ•ˆæžœ */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}
/* å“åº”式设计 */
@media (max-width: 768px) {
  .hangup-container {
    margin: 10px 0;
  }
  .hangup-btn {
    width: 100%;
    max-width: 200px;
  }
  .status-alert {
    font-size: 12px;
  }
}
.CONTENT {
  padding: 10px;
  height: 100%;
  min-height: 738px;
  /* è®¾ç½®æœ€å°é«˜åº¦ */
  .title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
  }
}
.preview-left {
  margin: 20px;
  padding: 30px;
  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);
  max-height: 716px;
  /* è®¾ç½®æœ€å¤§é«˜åº¦ */
  overflow-y: auto;
  /* å†…容超过高度时显示滚动条 */
  .topic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
    .dev-text {
      margin-bottom: 10px;
    }
  }
}
.scriptTopic-isabnormal {
  color: red;
}
.detailed {
  width: 88%;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 30px;
  background-color: #ddf0f8;
  .bg-purple {
    margin-bottom: 20px;
  }
  .spanvalue {
    display: inline-block;
    min-width: 200px;
    border-bottom: 1px solid rgb(172, 172, 172);
  }
}
.headline {
  font-size: 24px;
  height: 40px;
  border-left: 5px solid #41a1be;
  padding-left: 5px;
  margin-bottom: 10px;
  display: flex;
  .Add-details {
    font-size: 18px;
    color: #02a7f0;
    cursor: pointer;
  }
}
/* å¼‚常状态样式 - çº¢è‰² (保持不变) */
.scriptTopic-isabnormal {
  color: red;
}
/* æ–°å¢žï¼šè­¦å‘ŠçŠ¶æ€æ ·å¼ - é»„色 */
.scriptTopic-warning {
  color: #d4be00;
  /* æ‚¨æŒ‡å®šçš„黄色 */
}
/* å¼‚常选项样式 - çº¢è‰²æ˜Ÿå· (保持不变) */
.red-star {
  ::v-deep.el-radio__label {
    position: relative;
    padding-right: 10px;
  }
  ::v-deep.el-radio__label::after {
    content: "*";
    color: red;
    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: #ffe202;
    /* é»„色星号 */
    position: absolute;
    right: -5px;
    top: 0;
    font-weight: bold;
  }
}
/* å…±ç”¨æ ·å¼ä¿æŒä¸å˜ */
::v-deep.el-input-group__textarea {
  white-space: pre-wrap;
  word-break: break-all;
}
::v-deep.el-checkbox__label {
  position: relative;
  padding-right: 10px;
}
::v-deep.el-checkbox__label::after {
  content: "*";
  color: red;
  position: absolute;
  right: -5px;
  top: 0;
}
.tag-selector-container {
  display: flex;
  align-items: center;
  margin: 0 30px;
}
.color-indicator {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 8px;
  display: inline-block;
}
.selected-indicator {
  margin-left: 10px;
  width: 20px;
  height: 20px;
}
.tag-info-icon {
  margin-left: 10px;
  color: #909399;
  cursor: pointer;
  font-size: 16px;
}
/* ç¡®ä¿é€‰æ‹©å™¨é€‰é¡¹ä¸­ä¹Ÿæ˜¾ç¤ºé¢œè‰²å— */
.el-select-dropdown__item {
  display: flex;
  align-items: center;
}
.tag-normal {
  background-color: #7ff5e1;
}
.tag-abnormal {
  background-color: #f75c5c;
}
.tag-warning {
  background-color: #fbfb4a;
}
.tag-info {
  margin-left: 10px;
  color: #909399;
  cursor: pointer;
}
::v-deep.offside-value .el-radio__label {
  color: #fff;
}
::v-deep.el-link.el-link--default {
  color: #02a7f0 !important;
}
.el-message-box__btns button:nth-child(2) {
  margin-left: 10px;
  background-color: #f57676;
  border-color: #f57676;
}
.el-icon-phone {
  transition: all 0.3s;
}
.el-button[disabled] .el-icon-phone {
  color: #c0c4cc;
}
.el-button:not([disabled]) .el-icon-phone {
  color: #409eff;
}
.el-button:not([disabled]):hover .el-icon-phone {
  color: #66b1ff;
  transform: scale(1.1);
}
.mulsz {
  font-size: 25px;
  margin-top: 20px;
}
.el-input.is-disabled .el-input__inner {
  background-color: #fff;
  border-color: #dcdfe6;
  color: #080808 !important;
  cursor: not-allowed;
}
.el-textarea.is-disabled .el-textarea__inner {
  background-color: #fff;
  border-color: #dcdfe6;
  color: #080808 !important;
  cursor: not-allowed;
}
/* åŽŸæœ‰çš„æ ·å¼ä¿æŒä¸å˜ï¼Œæ·»åŠ ä»¥ä¸‹å“åº”å¼ä»£ç  */
.Followupdetailspage {
  margin: 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.action-container {
  display: flex;
  flex-direction: row;
  /* é»˜è®¤æ¨ªå‘排列 */
  gap: 20px;
  margin: 0 10px 20px 10px;
  /* å½“缩放比例大于100%或屏幕宽度较小时改为上下排列 */
  @media screen and (min-resolution: 1.5dppx) {
    flex-direction: column;
    .call-action,
    .manual-action {
      width: 100% !important;
    }
  }
}
.call-action {
  width: 65%;
  min-width: 0;
}
.manual-action {
  flex: 1;
  min-width: 0;
}
/* è°ƒæ•´å†…部元素的响应式布局 */
.Followuserinfos {
  .el-form {
    /* è¡¨å•响应式调整 */
    .el-row {
      margin: 0 -10px;
    }
    .el-col {
      padding: 0 10px;
    }
    @media screen and (max-width: 768px) {
      .el-col {
        width: 100%;
        margin-bottom: 15px;
        &:last-child {
          margin-bottom: 0;
        }
      }
    }
  }
}
/* è°ƒæ•´è¡¨æ ¼çš„响应式表现 */
.el-table {
  ::v-deep .el-table__body-wrapper {
    overflow-x: auto;
  }
  /* åœ¨å°å±å¹•上调整表格列宽 */
  @media screen and (max-width: 992px) {
    .el-table-column {
      min-width: 120px;
    }
  }
}
/* è°ƒæ•´æ ‡ç­¾é€‰æ‹©å™¨çš„响应式布局 */
.tag-selector-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  @media screen and (max-width: 576px) {
    flex-direction: column;
    align-items: flex-start;
    .el-select {
      width: 100%;
      margin-right: 0 !important;
    }
  }
}
/* è°ƒæ•´æŒ‰é’®ç»„的响应式布局 */
.el-form-item.label-processing-opinion {
  .el-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    .el-button {
      flex: 1;
      min-width: 120px;
    }
  }
}
/* è°ƒæ•´é€‰é¡¹å¡çš„响应式表现 */
.el-tabs {
  ::v-deep .el-tabs__nav-wrap {
    overflow-x: auto;
    white-space: nowrap;
    &::after {
      display: none;
    }
  }
}
/* è°ƒæ•´é¢„览区域的响应式表现 */
.preview-left {
  @media screen and (max-width: 768px) {
    margin: 10px;
    padding: 15px;
    .topic-dev,
    .scriptTopic-dev {
      margin-bottom: 15px;
    }
  }
}
/* è°ƒæ•´å¯¹è¯æ¡†çš„响应式表现 */
.el-dialog {
  @media screen and (max-width: 992px) {
    width: 90% !important;
    margin-top: 5vh !important;
    .el-dialog__body {
      padding: 15px;
    }
  }
  @media screen and (max-width: 576px) {
    width: 95% !important;
    .el-form-item {
      margin-bottom: 15px;
    }
  }
}
/* ç¡®ä¿å†…容在缩放时保持可读性 */
.headline {
  font-size: clamp(18px, 2vw, 24px);
  /* ä½¿ç”¨clamp函数确保字体大小在合理范围内 */
}
/* ä¸ºç§»åŠ¨è®¾å¤‡ä¼˜åŒ–æ»šåŠ¨ä½“éªŒ */
@media screen and (max-width: 768px) {
  .Followuserinfo,
  .Followuserinfos {
    padding: 15px;
    margin: 5px;
  }
  .CONTENT {
    min-height: auto;
    padding: 5px;
  }
}
/* ç¼©æ”¾æ£€æµ‹æ ·å¼ */
@media screen and (min-resolution: 1.5dppx),
  screen and (-webkit-min-device-pixel-ratio: 1.5) {
  .action-container {
    flex-direction: column;
  }
  .call-action,
  .manual-action {
    width: 100%;
  }
  /* è°ƒæ•´å†…部元素间距 */
  .call-container,
  .Followuserinfos {
    margin-bottom: 20px;
  }
}
/* äººå·¥å¤„理部分样式 */
.manual-action {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  .Followuserinfos {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    height: 100%;
    overflow-y: auto;
  }
}
/* å¤´éƒ¨åŒºåŸŸ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
  h3 {
    margin: 0;
    color: #409eff;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    i {
      font-size: 20px;
    }
  }
  .header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    .action-group {
      display: flex;
      align-items: center;
      gap: 10px;
    }
  }
}
/* åŸºç¡€æ“ä½œæŒ‰é’® */
.basic-actions {
  .el-button {
    min-width: 100px;
  }
}
/* å¼‚常状态选择器 */
.tag-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  .current-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s;
    &:hover {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
  }
}
.color-indicator {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 8px;
  display: inline-block;
}
.selected-indicator {
  margin-left: 10px;
  width: 20px;
  height: 20px;
}
.tag-info-icon {
  margin-left: 10px;
  color: #909399;
  cursor: pointer;
  font-size: 16px;
}
/* è¡¨å•区域 */
.form-content {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  .el-form {
    .el-row {
      margin: 0 -10px;
    }
    .el-col {
      padding: 0 10px;
    }
  }
}
/* é€šè¯æŽ§åˆ¶åŒºåŸŸ */
.call-controls {
  margin: 15px 0;
  .hangup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
  }
  .hangup-btn {
    width: 120px;
    height: 40px;
    font-size: 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
    transition: all 0.3s ease;
  }
  .hangup-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
  }
  .call-timer {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 12px;
    font-family: "Courier New", monospace;
  }
  .call-status-container {
    margin: 10px 0;
  }
  .status-alert {
    border-radius: 8px;
    transition: all 0.3s ease;
  }
  .status-alert.status-calling {
    border-left: 4px solid #e6a23c;
  }
  .status-alert.status-connected {
    border-left: 4px solid #67c23a;
    animation: pulse 2s infinite;
  }
  .status-alert.status-ended {
    border-left: 4px solid #909399;
  }
  .sip-registering {
    margin: 10px 0;
  }
  .registering-alert {
    border-radius: 8px;
    background-color: #f4f4f5;
    border-left: 4px solid #909399;
  }
}
/* å¤„理意见按钮组 */
.opinion-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  .el-button {
    flex: 1;
    min-width: 120px;
  }
}
/* æ‚£è€…档案信息 */
.detailed {
  width: 100%;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background-color: #ddf0f8;
  border: 1px solid #b3e0f2;
  h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    &:before {
      content: "";
      display: block;
      width: 4px;
      height: 16px;
      background: #409eff;
      border-radius: 2px;
    }
  }
  .el-form {
    .el-row {
      margin: 0 -10px;
    }
    .el-col {
      padding: 0 10px;
      margin-bottom: 15px;
    }
  }
}
/* åŠ¨ç”»æ•ˆæžœ */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}
/* å“åº”式设计 */
@media screen and (max-width: 1200px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .opinion-buttons {
    .el-button {
      min-width: calc(50% - 8px);
    }
  }
}
@media screen and (max-width: 768px) {
  .Followuserinfos {
    padding: 15px;
  }
  .form-content,
  .detailed {
    padding: 15px;
  }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
    .action-group {
      flex-direction: column;
      align-items: stretch;
      .el-select {
        width: 100%;
        margin-right: 0;
      }
    }
  }
  .opinion-buttons {
    flex-direction: column;
    .el-button {
      width: 100%;
    }
  }
  .detailed {
    .el-form {
      .el-col {
        width: 100%;
      }
    }
  }
}
/* æ»šåŠ¨æ¡ç¾ŽåŒ– */
.Followuserinfos {
  &::-webkit-scrollbar {
    width: 6px;
  }
  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    &:hover {
      background: #a8a8a8;
    }
  }
}
/* æŒ‰é’®å›¾æ ‡ä¼˜åŒ– */
.el-icon-phone {
  transition: all 0.3s;
}
.el-button[disabled] .el-icon-phone {
  color: #c0c4cc;
}
.el-button:not([disabled]) .el-icon-phone {
  color: #409eff;
}
.el-button:not([disabled]):hover .el-icon-phone {
  color: #66b1ff;
  transform: scale(1.1);
}
</style>
src/views/followvisit/record/detailpage/index.vue
@@ -656,7 +656,10 @@
                  </el-form-item>
                </el-col>
                 <el-col :span="10">
                  <el-form-item label="短号电话">
                  <el-form-item
                    label="短号电话"
                    v-if="orgname == '景宁畲族自治县人民医院'"
                  >
                    <el-input
                      placeholder="联系电话缺失"
                      v-model="userform.telshortcode"
@@ -664,7 +667,7 @@
                      <el-button
                        slot="append"
                        icon="el-icon-phone"
                        @click="handleCall(userform.telshortcode, 'tel')"
                        @click="handleCall(userform.telshortcode, 'tel', true)"
                      ></el-button>
                    </el-input>
                  </el-form-item>
@@ -1122,6 +1125,7 @@
  serviceSubtaskDetailedit,
  serviceSubtaskDetailadd,
  updatePersonVoices,
  savequestiondetail,
  addPersonVoices,
  query360PatInfo,
  sendMsg,
@@ -1815,25 +1819,25 @@
          obj.asrtext = item.scriptResult;
        }
        if (item.isoption == 3) {
          promises.push(serviceSubtaskDetailedit(obj));
        } else {
          promises.push(serviceSubtaskDetailadd(obj));
        }
        // if (item.isoption == 3) {
        //   promises.push(serviceSubtaskDetailedit(obj));
        // } else {
        //   promises.push(serviceSubtaskDetailadd(obj));
        // }
      });
      // ä½¿ç”¨ Promise.all ç­‰å¾…所有异步操作完成
      Promise.all(promises)
        .then((results) => {
          // æ‰€æœ‰å¼‚步操作成功完成后的逻辑
          results.forEach((res) => {
            if (res.code !== 200) {
              this.$modal.error("修改失败");
            }
          });
      console.log(this.tableDatatop);
      let obj = {
        svyTaskTemplateScriptVOS: this.tableDatatop, // æäº¤å¤„理后的副本
        param1: this.taskid,
        param2: this.patid,
        param6: this.id,
        type: 2,
      };
      savequestiondetail(obj).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务保存成功");
          this.Editsingletasksonyic(6);
          const orgName = localStorage.getItem("orgname");
          console.log(orgName, "orgName");
          if (this.form.isVisitAgain != 1 || orgName == "丽水市中医院") {
            this.Torouter();
@@ -1862,11 +1866,53 @@
            .catch(() => {
              this.Torouter();
            });
        })
        .catch((error) => {
          // å¦‚果有任何一个异步操作失败,会进入这里
          console.error("发生错误:", error);
        }
        });
      // ä½¿ç”¨ Promise.all ç­‰å¾…所有异步操作完成
      // Promise.all(promises)
      //   .then((results) => {
      //     // æ‰€æœ‰å¼‚步操作成功完成后的逻辑
      //     results.forEach((res) => {
      //       if (res.code !== 200) {
      //         this.$modal.error("修改失败");
      //       }
      //     });
      //     this.Editsingletasksonyic(6);
      //     const orgName = localStorage.getItem("orgname");
      //     console.log(orgName, "orgName");
      //     if (this.form.isVisitAgain != 1 || orgName == "丽水市中医院") {
      //       this.Torouter();
      //       return;
      //     }
      //     this.$modal
      //       .confirm(
      //         '任务保存成功是否针对患者:"' +
      //           this.userform.name +
      //           '"再次随访?',
      //         "确认",
      //         {
      //           confirmButtonText: "确定",
      //           cancelButtonText: "取消",
      //           showCancelButton: true,
      //           dangerouslyUseHTMLString: true,
      //           confirmButtonClass: "custom-confirm-button", // è‡ªå®šä¹‰ç¡®è®¤æŒ‰é’®çš„类名
      //           cancelButtonClass: "custom-cancel-button", // è‡ªå®šä¹‰å–消按钮的类名
      //         }
      //       )
      //       .then(() => {
      //         document.querySelector("#app").scrollTo(0, 0);
      //         this.formtidy();
      //         this.dialogFormVisible = true;
      //       })
      //       .catch(() => {
      //         this.Torouter();
      //       });
      //   })
      //   .catch((error) => {
      //     // å¦‚果有任何一个异步操作失败,会进入这里
      //     console.error("发生错误:", error);
      //   });
    },
    Torouter() {
      if (this.form.serviceType == 13) {
@@ -1927,8 +1973,8 @@
    isValidPhone(phone) {
      return this.validatePhoneNumber(phone).isValid;
    },
    handleCall(phone, type) {
      if (!this.isValidPhone(phone)) {
    handleCall(phone, type, dh) {
      if (!this.isValidPhone(phone) && !dh) {
        this.$message.error("请输入正确的手机号码");
        return;
      }
@@ -2015,10 +2061,11 @@
      });
      let obj = {
        serviceSubtaskDetailList: dataToSubmit, // æäº¤å¤„理后的副本
        ivrTaskTemplateScriptVOList: dataToSubmit, // æäº¤å¤„理后的副本
        param1: this.taskid,
        param2: this.patid,
        subId: this.id,
        param6: this.id,
        type: 1,
      };
      const orgName = localStorage.getItem("orgname");
      console.log(orgName, "orgName");
@@ -2027,7 +2074,7 @@
        this.Torouter();
        return;
      }
      addPersonVoices(obj).then((res) => {
      savequestiondetail(obj).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("服务保存成功");
          this.$modal
src/views/knowledge/questionbank/particulars/index.vue
@@ -23,7 +23,13 @@
      </div>
      <div v-if="Editprogress == 1">
        <el-card class="box-card">
          <el-form :inline="true" ref="topicobj" :model="topicobj" :rules="rules" class="demo-form-inline">
          <el-form
            :inline="true"
            ref="topicobj"
            :model="topicobj"
            :rules="rules"
            class="demo-form-inline"
          >
            <div class="headline">
              åŸºç¡€ä¿¡æ¯é…ç½®
              <span style="margin-left: 30px"
@@ -65,6 +71,7 @@
                      v-model="topicobj.categoryid"
                      size="medium"
                      filterable
                      @change="categoryidChange"
                      placeholder="请选择分类"
                    >
                      <el-option-group
@@ -87,7 +94,7 @@
                  <el-form-item label="评价类型" prop="scoretype">
                    <el-select
                      v-model="topicobj.scoretype"
                      placeholder="请选择分类"
                      placeholder="请选择类型"
                    >
                      <el-option
                        v-for="group in appraiselist"
@@ -143,7 +150,6 @@
                </el-col> -->
              </el-row>
              <el-row :gutter="10">
                <el-col :span="8"
                  ><el-form-item label="问题类型" prop="scriptType">
                    <el-select
@@ -151,7 +157,7 @@
                      @change="changefn"
                      size="medium"
                      filterable
                      placeholder="请选择分类"
                      placeholder="请选择类型"
                    >
                      <el-option
                        class="topicobjaa"
@@ -185,7 +191,7 @@
                      v-model="topicobj.language"
                      size="medium"
                      filterable
                      placeholder="请选择分类"
                      placeholder="请选择"
                    >
                      <el-option
                        class="topicobjaa"
@@ -245,7 +251,6 @@
                </el-form-item>
              </el-col>
            </el-row> -->
              <!-- <el-form-item label="选中指标:">
                <span style="margin-left: 30px"
@@ -342,7 +347,12 @@
      </div>
      <div v-if="Editprogress == 2">
        <el-card class="box-card">
          <el-form :inline="true" ref="topicobj" :model="topicobj" class="demo-form-inline">
          <el-form
            :inline="true"
            ref="topicobj"
            :model="topicobj"
            class="demo-form-inline"
          >
            <div class="headline">
              æŒ‡æ ‡è®¾ç½®è¯¦æƒ…
              <span v-if="topicobj.targetname" style="margin-left: 30px"
@@ -731,8 +741,8 @@
        svyLibScriptOptions: [],
        svyLibScriptTagList: [],
        suitway: "1",
        scoretype:'4',
        language:'普通话',
        scoretype: "4",
        language: "普通话",
      },
      headers: {
        Authorization: "Bearer " + getToken(),
@@ -873,7 +883,6 @@
    getissueinfo() {
      this.id = this.$route.query.id;
      // åˆ†ç±»
      getissueclassify({}).then((res) => {
        this.classifylist = res.rows;
@@ -919,18 +928,39 @@
        this.drawer = true;
      });
    },
    //     categoryidChange(id) {
    //   // éåŽ†æ‰€æœ‰åˆ†ç»„ï¼Œåœ¨æ¯ä¸ªåˆ†ç»„çš„ svyLibScriptCategoryList ä¸­æŸ¥æ‰¾
    //   let targetOption = null;
    //   for (const group of this.classifylist) {
    //     targetOption = group.svyLibScriptCategoryList.find(item => item.id == id);
    //     if (targetOption) break;
    //   }
    //   if (targetOption) {
    //     console.log('选中的选项:', targetOption);
    //     // æ³¨æ„ï¼šè¿™é‡Œ targetOption.name æ˜¯é€‰é¡¹åï¼Œå¦‚“住院满意度调查”
    //     if (targetOption.name.includes('住院')) {
    //       this.topicobj.type = "zymyd";
    //     } else if (targetOption.name.includes('门诊')) {
    //       this.topicobj.type = "mzmyd";
    //     } else if (targetOption.name.includes('出院')) {
    //       this.topicobj.type = "cymyd";
    //     } else if (targetOption.name.includes('常用')) {
    //       this.topicobj.type = "cymyd"; // æ³¨æ„ï¼šè¿™é‡Œå’Œâ€œå‡ºé™¢â€é‡å¤äº†ï¼Œç¡®è®¤æ˜¯å¦éœ€åŒºåˆ†
    //     }
    //   }
    // },
    // æ–°å¢žæˆ–修改详情
    compileissue() {
      this.$refs["topicobj"].validate((valid) => {
        if (valid) {
          this.topicobj.svyLibScriptOptions = this.topicobj.svyLibScriptOptions.map(
        (item) => {
          this.topicobj.svyLibScriptOptions =
            this.topicobj.svyLibScriptOptions.map((item) => {
          if (item.isoperation != 1 && item.isoperation != 3) {
            item.isoperation = 2;
          }
          return item;
        }
      );
            });
      this.topicobj.targetoptions = this.topicobj.svyLibScriptOptions
        .filter((item) => item.isoperation != 3)
        .map((item) => item.optioncontent)
@@ -978,9 +1008,7 @@
        deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
      }
        }
      })
      });
    },
    // åˆ¤æ–­åˆ†å€¼
    Scorejudgment() {
src/views/patient/propaganda/QuestionnaireTask.vue
@@ -1797,6 +1797,7 @@
          item.patid = item.id;
          item.hospType = this.patientqueryParams.allhosp;
          item.sfzh = item.idcardno;
          item.telshortcode = item.telshortcode;
          item.deptCode = item.deptcode;
          item.deptName = item.dept;
          item.admindate = item.inhosptime;
vue.config.js
@@ -36,8 +36,8 @@
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      [process.env.VUE_APP_BASE_API]: {
        // target: `https://www.health-y.cn/lssf`,
        target: `http://192.168.100.10:8096`,
        // target: `http://192.168.100.10:8094`,//省立同德
        // target: `http://192.168.100.10:8096`,
        target: `http://192.168.100.10:8094`,//省立同德
        // target: `http://192.168.100.10:8095`,//新华
        // target:`http://localhost:8095`,
        // target:`http://35z1t16164.qicp.vip`,