| | |
| | | handleOptionChange( |
| | | $event, |
| | | index, |
| | | item.svyLibTemplateTargetoptions, |
| | | item.svyTaskTemplateTargetoptions, |
| | | item |
| | | ) |
| | | " |
| | |
| | | <el-radio |
| | | v-for="( |
| | | items, indexs |
| | | ) in item.svyLibTemplateTargetoptions" |
| | | ) in item.svyTaskTemplateTargetoptions" |
| | | :class="items.isabnormal ? 'red-star' : ''" |
| | | :key="indexs" |
| | | :label="items.optioncontent" |
| | |
| | | @change="$forceUpdate()" |
| | | v-for="( |
| | | items, indexs |
| | | ) in item.svyLibTemplateTargetoptions" |
| | | ) in item.svyTaskTemplateTargetoptions" |
| | | :key="indexs" |
| | | :label="items.optioncontent" |
| | | > |
| | |
| | | > |
| | | <el-radio |
| | | v-for="(items, index) in item.scriptResult" |
| | | :key="items" |
| | | :key="index" |
| | | :label="items" |
| | | :class="items.isabnormal ? 'red-star' : ''" |
| | | @click.native.prevent=" |
| | | handleRadioToggle(item, items.optioncontent) |
| | | handleRadioToggles(item, items) |
| | | " |
| | | >{{ items }}</el-radio |
| | | > |
| | |
| | | console.log(date); |
| | | |
| | | if (!date) { |
| | | this.form.date1 = ''; |
| | | this.form.date1 = ""; |
| | | this.$refs.zcform.clearValidate(["date1"]); |
| | | return; |
| | | } |
| | |
| | | |
| | | if (selectedDate < now) { |
| | | this.$message.warning("随访时间不能早于当前日期"); |
| | | this.form.date1 = ''; |
| | | this.form.date1 = ""; |
| | | this.$refs.zcform.validateField("date1"); // 触发验证 |
| | | } |
| | | }, |
| | |
| | | return; |
| | | } |
| | | } |
| | | var objs = item.svyLibTemplateTargetoptions.find( |
| | | var objs = item.svyTaskTemplateTargetoptions.find( |
| | | (items) => items.optioncontent == item.scriptResult |
| | | ); |
| | | if (obj) { |
| | |
| | | .confirm('是否查看任务为"' + row.taskName + '"的服务详情数据?') |
| | | .then(() => { |
| | | let type = ""; |
| | | console.log(row, "rwo"); |
| | | if (row.type == 1) { |
| | | type = 1; |
| | | } |
| | | console.log(row, "rwo"); |
| | | if (row.type == 1) { |
| | | type = 1; |
| | | } |
| | | this.taskid = row.taskid; |
| | | this.id = row.id; |
| | | this.patid = row.patid; |
| | |
| | | (item) => item.optioncontent == a |
| | | ); |
| | | } else { |
| | | var obj = this.tableDatatop[b].svyLibTemplateTargetoptions.find( |
| | | var obj = this.tableDatatop[b].svyTaskTemplateTargetoptions.find( |
| | | (item) => item.optioncontent == a |
| | | ); |
| | | } |
| | |
| | | }, |
| | | // 新增的切换选中/取消选中方法 |
| | | handleRadioToggle(questionItem, optionValue) { |
| | | console.log(questionItem, optionValue, 999); |
| | | |
| | | // 如果点击的是当前已选中的选项,则取消选中 |
| | | if (questionItem.scriptResult === optionValue) { |
| | | questionItem.scriptResult = ""; // 清空选中值 |
| | |
| | | // 后续的跳转等复杂逻辑会在 handleOptionChange 中正常执行 |
| | | } |
| | | }, |
| | | 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 中正常执行 |
| | | } |
| | | }, |
| | | // 在methods部分,修改handleOptionChange方法: |
| | | handleOptionChange(selectedOption, questionIndex, options, a) { |
| | | console.log(selectedOption, questionIndex, options, a, "888"); |
| | | |
| | | if (document.activeElement) { |
| | | document.activeElement.blur(); |
| | | } |
| | |
| | | }, |
| | | overdata() { |
| | | this.tableDatatop.forEach((item, index) => { |
| | | var obj = item.svyLibTemplateTargetoptions.find( |
| | | var obj = item.svyTaskTemplateTargetoptions.find( |
| | | (items) => items.optioncontent == item.scriptResult |
| | | ); |
| | | if (obj) { |