| | |
| | | > |
| | | <el-option |
| | | class="ruleFormaa" |
| | | v-for="item in belongDepts" |
| | | v-for="item in flatArray" |
| | | :key="item.deptCode" |
| | | :label="item.deptName" |
| | | :label="item.label" |
| | | :value="item.deptCode" |
| | | > |
| | | </el-option> |
| | |
| | | > |
| | | <el-option |
| | | class="ruleFormaa" |
| | | v-for="item in belongWards" |
| | | :key="item.districtCode" |
| | | :label="item.districtName" |
| | | :value="item.districtCode" |
| | | v-for="item in flatArray" |
| | | :key="item.deptCode" |
| | | :label="item.label" |
| | | :value="item.deptCode" |
| | | > |
| | | </el-option> |
| | | </el-select> </el-form-item |
| | |
| | | >下一步</el-button |
| | | > |
| | | <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button> |
| | | <el-button @click="Departmenttreatment('ruleForm')" |
| | | <el-button @click="toExamine('ruleForm')" |
| | | >保存问卷基础信息</el-button |
| | | > |
| | | </el-form-item> |
| | |
| | | align="center" |
| | | key="nextScriptno" |
| | | prop="nextScriptno" |
| | | :show-overflow-tooltip="true" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="问题分值" |
| | | v-if="topicobj.scoretype == 1" |
| | | v-if="ruleForm.scoreType == 1" |
| | | > |
| | | <el-input |
| | | v-model="topicobj.score" |
| | |
| | | v-for="item in topicobj.svyLibTemplateTargetoptions" |
| | | > |
| | | <el-row :gutter="5"> |
| | | <el-col :span="16" |
| | | <el-col :span="12" |
| | | ><el-form-item label="选项名称"> |
| | | <el-input |
| | | type="text" |
| | |
| | | > |
| | | </el-input> </el-form-item |
| | | ></el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | v-if="topicobj.scoretype == 1" |
| | | v-if="ruleForm.scoreType == 1" |
| | | label="选项分值" |
| | | > |
| | | <el-input |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="topicobj.scoretype == 2" |
| | | v-else-if="ruleForm.scoreType == 2" |
| | | label="ABC等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | | <el-radio label="A">A</el-radio> |
| | | <el-radio label="B">B</el-radio> |
| | | <el-radio label="C">C</el-radio> |
| | | <el-radio :label="1">A</el-radio> |
| | | <el-radio :label="2">B</el-radio> |
| | | <el-radio :label="3">C</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="topicobj.scoretype == 3" |
| | | v-else-if="ruleForm.scoreType == 3" |
| | | label="优良等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | |
| | | > |
| | | <el-button type="primary" @click="laststep()">上一步</el-button> |
| | | <el-button type="info" @click="closeFm('ruleForm')">关闭</el-button> |
| | | <el-button @click="Departmenttreatment('ruleForm')" |
| | | <el-button @click="toExamine('ruleForm')" |
| | | >保存问题数据</el-button |
| | | > |
| | | </div> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="评价类型"> |
| | | <el-select |
| | | v-model="indexform.scoretype" |
| | | v-model="indexform.scoreType" |
| | | placeholder="请选择分类" |
| | | > |
| | | <el-option |
| | |
| | | ></el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item |
| | | v-if="indexform.scoretype == 1" |
| | | v-if="indexform.scoreType == 1" |
| | | label="分值" |
| | | > |
| | | <el-input |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="indexform.scoretype == 2" |
| | | v-else-if="indexform.scoreType == 2" |
| | | label="ABC等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | | <el-radio label="A">A</el-radio> |
| | | <el-radio label="B">B</el-radio> |
| | | <el-radio label="C">C</el-radio> |
| | | <el-radio :label="1">A</el-radio> |
| | | <el-radio :label="2">B</el-radio> |
| | | <el-radio :label="3">C</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="indexform.scoretype == 3" |
| | | v-else-if="indexform.scoreType == 3" |
| | | label="优良等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | |
| | | |
| | | <el-col |
| | | :span="2" |
| | | :offsset="indexform.scoretype == 4 ? 11 : 0" |
| | | :offsset="indexform.scoreType == 4 ? 11 : 0" |
| | | > |
| | | <el-button |
| | | type="danger" |
| | |
| | | } from "@/api/AiCentre/index"; |
| | | import OptionalForm from "@/components/OptionalForm"; //正则组件 |
| | | import { getToken } from "@/utils/auth"; |
| | | import { deptTreeSelect } from "@/api/system/user"; |
| | | |
| | | export default { |
| | | name: "Questionnaireinfo", |
| | |
| | | illnessVisible: false, //指标疾病弹框 |
| | | Operateit: true, |
| | | deptOptions: [], |
| | | flatArray: [], |
| | | optionsillness: [], |
| | | delScriptVOList: [], |
| | | illnesslistapi: [], |
| | |
| | | created() { |
| | | this.getissueinfo(); |
| | | this.gettabList(); |
| | | this.getDeptTree(); |
| | | this.mode = store.getters.Askmode; |
| | | this.languagelist = store.getters.languagelist; |
| | | this.usable = store.getters.usable; |
| | |
| | | }); |
| | | this.tempDetpRelevanceslist = []; |
| | | this.tempbelongWards = []; |
| | | |
| | | depthospgetsonlist(this.queryParamsdept).then((res) => { |
| | | if (res.code == 200) { |
| | | let arr = res.rows; |
| | | arr.forEach((item) => { |
| | | if (item.deptType == 1) { |
| | | this.deptlist.push(item); |
| | | this.tempDetpRelevanceslist.push(item.deptCode); |
| | | } else if (item.deptType == 2) { |
| | | this.hosplist.push(item); |
| | | this.tempbelongWards.push(item.deptCode); |
| | | } |
| | | }); |
| | | } |
| | | if (this.queryParamsdept.tempid) { |
| | | depthospgetsonlist(this.queryParamsdept).then((res) => { |
| | | if (res.code == 200) { |
| | | let arr = res.rows; |
| | | arr.forEach((item) => { |
| | | if (item.deptType == 1) { |
| | | this.deptlist.push(item); |
| | | this.tempDetpRelevanceslist.push(item.deptCode); |
| | | } else if (item.deptType == 2) { |
| | | this.hosplist.push(item); |
| | | this.tempbelongWards.push(item.deptCode); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | // 获取科室树 |
| | | getDeptTree() { |
| | | // 科室列表 |
| | | deptTreeSelect().then((response) => { |
| | | this.deptOptions = response.data; |
| | | this.flatArray = this.flattenArray(response.data); |
| | | }); |
| | | }, |
| | | 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; // 返回只包含最底层元素的一维数组 |
| | | }, |
| | | submitForm(formName) { |
| | | this.$modal.loading("正在修正保存数据,请稍候..."); |
| | |
| | | this.ruleForm.categoryid = -1; |
| | | } |
| | | // 题目保存处理 |
| | | // 提交 |
| | | this.ruleForm.svyTemplateLibScripts.forEach((res) => { |
| | | // 提交 |
| | | this.ruleForm.svyTemplateLibScripts.forEach((res) => { |
| | | if (!res.isoperation) { |
| | | res.isoperation = 2; |
| | | } |
| | | res.ivrLibaScriptTargetoptionList = |
| | | res.svyLibTemplateTargetoptions.map((item) => { |
| | | res.ivrLibaScriptTargetoptionList = res.svyLibTemplateTargetoptions.map( |
| | | (item) => { |
| | | if (!item.isoperation) { |
| | | item.isoperation = 2; |
| | | item.templateID = this.ruleForm.id; |
| | | } |
| | | return item; |
| | | }); |
| | | } |
| | | ); |
| | | }); |
| | | this.delScriptVOList.forEach((item)=>{ |
| | | this.ruleForm.svyTemplateLibScripts.push(item) |
| | | }) |
| | | this.delScriptVOList.forEach((item) => { |
| | | this.ruleForm.svyTemplateLibScripts.push(item); |
| | | }); |
| | | if (this.id) { |
| | | this.ruleForm.isoperation = 2; |
| | | this.ruleForm.tempDetpRelevances = null; |
| | |
| | | }); |
| | | } |
| | | }, |
| | | // 题目校验 |
| | | toExamine() { |
| | | // 遍历题目集合 |
| | | for (let i = 0; i < this.ruleForm.svyTemplateLibScripts.length; i++) { |
| | | const question = this.ruleForm.svyTemplateLibScripts[i]; |
| | | |
| | | // 如果 scriptType 为 4,则跳过当前题目 |
| | | if (question.scriptType === 4) { |
| | | continue; |
| | | } |
| | | // 获取当前题目的选项集合 |
| | | const options = question.svyLibTemplateTargetoptions; |
| | | |
| | | // 创建一个 Set 来存储选项名称,用于检测重复 |
| | | const optionNames = new Set(); |
| | | |
| | | // 遍历选项集合 |
| | | for (let j = 0; j < options.length; j++) { |
| | | const option = options[j]; |
| | | const optionContent = option.optioncontent; |
| | | |
| | | // 如果选项名称已经存在于 Set 中,说明重复 |
| | | if (optionNames.has(optionContent)) { |
| | | this.$message.error( |
| | | `题目 ${question.id} 的选项名称 "${optionContent}" 重复` |
| | | ); |
| | | return false; // 返回 false 表示校验失败 |
| | | } |
| | | // 将选项名称添加到 Set 中 |
| | | optionNames.add(optionContent); |
| | | } |
| | | } |
| | | |
| | | // 如果所有题目都校验通过,返回 true |
| | | console.log("所有题目校验通过,选项名称无重复"); |
| | | this.Departmenttreatment(); |
| | | }, |
| | | |
| | | // 科室/院区处理 |
| | | Departmenttreatment() { |
| | | this.tempDetpRelevanceslist.forEach((item) => { |
| | |
| | | // 获取问题列表 |
| | | getaddtopiclist() { |
| | | this.drawer = true; |
| | | this.queryParams.scoretype = this.ruleForm.scoreType; |
| | | this.queryParams.scoreType = this.ruleForm.scoreType; |
| | | getissuelist(this.queryParams).then((res) => { |
| | | this.loading = false; |
| | | this.userList = res.rows; |
| | |
| | | }, |
| | | // 保存科室/病区 |
| | | putbelongDepts(id) { |
| | | this.tempDetpRelevanceslistform.forEach((item) => { |
| | | if (!item.tempid) item.tempid = id; |
| | | }); |
| | | this.tempbelongWardsform.forEach((item) => { |
| | | if (!item.tempid) item.tempid = id; |
| | | }); |
| | | if (this.tempDetpRelevanceslistform.length > 0) { |
| | | depthospgetson(this.tempDetpRelevanceslistform).then((res) => { |
| | | if (res.code == 200) { |