From dacfc42199eaeed64738201411d0b37153f7bf76 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 12 十一月 2025 15:02:01 +0800
Subject: [PATCH] 测试完成
---
src/views/outsideChainwtnew.vue | 123 +++++++++++++++++++++++++++++-----------
1 files changed, 89 insertions(+), 34 deletions(-)
diff --git a/src/views/outsideChainwtnew.vue b/src/views/outsideChainwtnew.vue
index c149057..3b5a39e 100644
--- a/src/views/outsideChainwtnew.vue
+++ b/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 : "浜茬埍鐨勬偅鑰�-瀹跺睘锛屾垜浠槸鍖婚櫌鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�" }}
+ {{
+ kcb
+ ? kcb
+ : "浜茬埍鐨勬偅鑰�-瀹跺睘锛屾垜浠槸鍖婚櫌鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�"
+ }}
</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 =
--
Gitblit v1.9.3