| | |
| | | <div v-if="showDeptSelect" class="dept-select-container"> |
| | | <el-form> |
| | | <el-form> |
| | | <el-form-item label="选择课题组"> |
| | | <el-form-item label="选择科室"> |
| | | <el-select |
| | | v-model="selectedDept" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择课题组或输入关键词搜索" |
| | | placeholder="请选择科室或输入关键词搜索" |
| | | @change="handleDeptChange" |
| | | popper-class="dept-select-dropdown" |
| | | > |
| | |
| | | |
| | | // 加载问卷数据 |
| | | this.loadSurveyData(); |
| | | // 获取课题组列表 |
| | | // 获取科室列表 |
| | | this.WLgetDept(); |
| | | }, |
| | | WLgetDept() { |
| | | // 调用接口获取课题组数据 |
| | | // 调用接口获取科室数据 |
| | | WLgetDept(this.encryptedParams.param6).then((res) => { |
| | | this.deptList = Object.entries(res.data).map(([code, name]) => ({ |
| | | code, |
| | |
| | | |
| | | // 准备提交数据 |
| | | prepareSubmitData() { |
| | | // 创建课题组选择问题对象 |
| | | // 创建科室选择问题对象 |
| | | const deptQuestion = { |
| | | scriptId: "dept_selection", // 自定义ID |
| | | scriptType: 4, // 4表示问答类型 |
| | | scriptContent: "选择的课题组", |
| | | scriptResult: this.selectedDept || "", // 存储选择的课题组名称 |
| | | scriptContent: "选择的科室", |
| | | scriptResult: this.selectedDept || "", // 存储选择的科室名称 |
| | | required: false, // 非必填 |
| | | sort: 999, |
| | | nextScriptno: "1", |
| | |
| | | serialnum: this.encryptedParams.param2 || this.encryptedParams.param3, |
| | | mzzy: this.surveyType, |
| | | svyLibTemplateScriptVOS: [ |
| | | deptQuestion, // 将课题组选择作为第一个问题 |
| | | deptQuestion, // 将科室选择作为第一个问题 |
| | | ...this.questionList.map((item) => { |
| | | return { |
| | | scriptId: item.scriptId, |