WXL (wul)
11 小时以前 dacfc42199eaeed64738201411d0b37153f7bf76
src/views/outsideChainwtnew.vue
@@ -4,9 +4,15 @@
      <div class="questionnaire-container">
        <!-- 问卷标题区域 -->
        <div class="questionnaire-header">
          <h1 class="questionnaire-title">{{ taskname ? taskname : "问卷" }}</h1>
          <h1 class="questionnaire-title">
            {{ taskname ? taskname : "问卷" }}
          </h1>
          <div class="questionnaire-description">
            {{ kcb ? kcb : "亲爱的患者-家属,我们是医院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,完成这份随访问卷。" }}
            {{
              kcb
                ? kcb
                : "亲爱的患者-家属,我们是医院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,完成这份随访问卷。"
            }}
          </div>
        </div>
@@ -18,51 +24,81 @@
            class="question-item"
            v-for="(item, index) in visibleQuestions"
            :key="item.id"
            :class="{ 'has-warning': item.prompt && (item.scriptResult && (item.scriptType !== 2 || item.scriptResult.length > 0)) }"
            :class="{
              'has-warning':
                item.prompt &&
                item.scriptResult &&
                (item.scriptType !== 2 || item.scriptResult.length > 0),
            }"
          >
            <!-- 题目题干 -->
            <div class="question-stem">
              <span class="question-number">{{ getVisibleQuestionIndex(index) }}.</span>
              <span class="question-number"
                >{{ getVisibleQuestionIndex(index) }}.</span
              >
              <span class="question-text">{{ item.scriptContent }}</span>
              <span class="question-type-tag">
                {{ item.scriptType === 1 ? '[单选]' : item.scriptType === 2 ? '[多选]' : '[问答]' }}
                {{
                  item.scriptType === 1
                    ? "[单选]"
                    : item.scriptType === 2
                    ? "[多选]"
                    : "[问答]"
                }}
              </span>
            </div>
            <!-- 单选题目 -->
            <div class="question-options" v-if="item.scriptType == 1 && !item.ishide">
            <div
              class="question-options"
              v-if="item.scriptType == 1 && !item.ishide"
            >
              <el-radio-group class="options-group" v-model="item.scriptResult">
                <el-radio
                  v-for="(option, optionIndex) in item.svyTaskTemplateTargetoptions"
                  v-for="(
                    option, optionIndex
                  ) in item.svyTaskTemplateTargetoptions"
                  :key="optionIndex"
                  :label="option.optioncontent"
                  :class="{
                    'abnormal-option': option.isabnormal && item.scriptResult == option.optioncontent
                    'abnormal-option':
                      option.isabnormal &&
                      item.scriptResult == option.optioncontent,
                  }"
                  @click.native.prevent="handleRadioToggle(item, index, item.svyTaskTemplateTargetoptions, option.optioncontent)"
                  @click.native.prevent="
                    handleRadioToggle(
                      item,
                      index,
                      item.svyTaskTemplateTargetoptions,
                      option.optioncontent
                    )
                  "
                  class="option-radio"
                >
                  <span class="option-text">{{ option.optioncontent }}</span>
                  <span v-if="option.isabnormal" class="abnormal-indicator">*</span>
                </el-radio>
              </el-radio-group>
            </div>
            <!-- 多选题目 -->
            <div class="question-options" v-if="item.scriptType == 2">
              <el-checkbox-group class="options-group" v-model="item.scriptResult">
              <el-checkbox-group
                class="options-group"
                v-model="item.scriptResult"
              >
                <el-checkbox
                  v-for="(option, optionIndex) in item.svyTaskTemplateTargetoptions"
                  v-for="(
                    option, optionIndex
                  ) in item.svyTaskTemplateTargetoptions"
                  :key="optionIndex"
                  :label="option.optioncontent"
                  :class="{
                    'abnormal-option': option.isabnormal
                    'abnormal-option': option.isabnormal,
                  }"
                  @change="$forceUpdate()"
                  class="option-checkbox"
                >
                  <span class="option-text">{{ option.optioncontent }}</span>
                  <span v-if="option.isabnormal" class="abnormal-indicator">*</span>
                </el-checkbox>
              </el-checkbox-group>
            </div>
@@ -80,19 +116,27 @@
            </div>
            <!-- 提示信息 -->
            <div class="question-warning" v-show="item.prompt && item.scriptResult && (item.scriptType !== 2 || item.scriptResult.length > 0)">
              <el-alert :title="item.prompt" type="warning" :closable="false" class="warning-alert"></el-alert>
            <div
              class="question-warning"
              v-show="
                item.prompt &&
                item.scriptResult &&
                (item.scriptType !== 2 || item.scriptResult.length > 0)
              "
            >
              <el-alert
                :title="item.prompt"
                type="warning"
                :closable="false"
                class="warning-alert"
              ></el-alert>
            </div>
          </div>
        </div>
        <!-- 提交按钮 -->
        <div class="submit-section">
          <el-button
            type="primary"
            @click="cache(true)"
            class="submit-button"
          >
          <el-button type="primary" @click="cache(true)" class="submit-button">
            提交问卷
          </el-button>
        </div>
@@ -105,7 +149,11 @@
        <div class="completion-icon">✓</div>
        <h2 class="completion-title">感谢您的配合!</h2>
        <p class="completion-message">
          {{ jsy ? jsy : "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次回访就到这里,祝您身体健康!" }}
          {{
            jsy
              ? jsy
              : "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次回访就到这里,祝您身体健康!"
          }}
        </p>
      </div>
    </div>
@@ -127,7 +175,8 @@
      taskid: 355,
      patid: 265823,
      kcb: "",
      excep: "",
      excep: 0,
      isabnormal: 0,
      taskname: "",
      questionList: [],
      jsy: null,
@@ -268,9 +317,11 @@
        param1: this.taskid,
        param2: this.patid,
        excep: this.excep,
        isabnormal: this.excep,
        isabnormal: this.isabnormal,
        serviceSubtaskDetailList: [],
      };
      console.log(form.isabnormal, "formisabnormal");
      const arr = structuredClone(this.questionList);
      // arr.forEach((item) => {
      //   item.asrtext = JSON.stringify(item.scriptResult);
@@ -298,7 +349,9 @@
        svyTaskTemplateScriptVOS: [],
      };
      const arr = structuredClone(this.questionList);
      console.log(arr, "srr");
      arr.forEach((item) => {
        item.ishide = item.ishide ? 1 : 0;
      });
      arr.forEach((item, index) => {
        if (item.scriptType == 1 && item.scriptResult) {
          var obj = item.svyTaskTemplateTargetoptions.find(
@@ -314,11 +367,13 @@
            item.sendTaskids = String(obj.sendTaskid).split(",");
          }
          if (obj) {
            if (obj.isabnormal) {
              console.log(obj.isabnormal);
              form.excep = obj.isabnormal;
            form.excep = obj.isabnormal;
            form.isabnormal = obj.isabnormal;
            if (this.isabnormal != 1 && obj.isabnormal) {
              this.excep = obj.isabnormal;
              this.isabnormal = obj.isabnormal;
            }
            console.log(obj.isabnormal);
          }
        }
      });
@@ -352,7 +407,7 @@
      // 原有的处理逻辑
      if (questionItem.scriptResult === optionValue) {
        questionItem.scriptResult = "";
        questionItem.isabnormal = false;
        questionItem.isabnormal = 0;
        questionItem.showAppendInput = false;
      } else {
        questionItem.scriptResult = optionValue;
@@ -375,15 +430,15 @@
      const selectedOptionObj = options.find(
        (item) => item.optioncontent == selectedOption
      );
      if (selectedOption) {
      if (selectedOptionObj) {
        this.questionList[questionIndex].nextScriptno =
          selectedOption.nextQuestion;
        this.questionList[questionIndex].score = selectedOption.score;
        this.questionList[questionIndex].prompt = selectedOption.prompt;
          selectedOptionObj.nextQuestion;
        this.questionList[questionIndex].score = selectedOptionObj.score;
        this.questionList[questionIndex].prompt = selectedOptionObj.prompt;
      }
      // 处理异常状态高亮
      this.questionList[questionIndex].isabnormal =
        !!selectedOptionObj.isabnormal;
        selectedOptionObj.isabnormal;
      // 处理附加输入框显示
      this.questionList[questionIndex].showAppendInput =