Bläddra i källkod

修改新增可选认知任务的选项

plg 3 månader sedan
förälder
incheckning
e62fa092f9
1 ändrade filer med 52 tillägg och 13 borttagningar
  1. 52 13
      src/components/PlanRegister.vue

+ 52 - 13
src/components/PlanRegister.vue

@@ -132,7 +132,7 @@
               </div>
 
               <!-- <el-button @click="getCheckedNodes"> 获取已选 </el-button> -->
-              <el-form-item label="任务选择" class="taskSelect">
+              <el-form-item label="量表选择" class="taskSelect">
                 <el-checkbox-group v-model="ruleForm.checkboxGroup2" size="mini">
                   <el-checkbox
                     v-for="item in scaleList"
@@ -142,6 +142,37 @@
                     :disabled="item.isRequired == '1'"
                     >{{ item.name }}</el-checkbox
                   >
+                  <!-- <el-checkbox
+                    v-for="item in taskList"
+                    :key="item.id"
+                    :label="item.flag"
+                    border
+                    :disabled="item.isRequired == '1'"
+                    >{{ item.name }}</el-checkbox
+                  > -->
+                </el-checkbox-group>
+              </el-form-item>
+
+              <el-form-item label="任务选择" class="taskSelect" prop="taskRadio">
+                <el-select v-model="ruleForm.taskRadio" placeholder="请选择">
+                  <el-option
+                    v-for="item in taskList"
+                    :key="item.flag"
+                    :label="item.name"
+                    :value="item.flag"
+                  >
+                  </el-option>
+                </el-select>
+
+                <!-- <el-radio-group v-model="ruleForm.taskRadio">
+                  <el-radio     v-for="item in taskList" :key="item" :label="item.flag">
+                  {{item.name}}
+                  </el-radio>
+                
+                </el-radio-group> -->
+
+                <!-- <el-checkbox-group v-model="ruleForm.checkboxGroup2" size="mini">
+             
                   <el-checkbox
                     v-for="item in taskList"
                     :key="item.id"
@@ -150,8 +181,7 @@
                     :disabled="item.isRequired == '1'"
                     >{{ item.name }}</el-checkbox
                   >
-                  <!-- <el-checkbox label="2" border>{{ cognitionName }}</el-checkbox> -->
-                </el-checkbox-group>
+                </el-checkbox-group> -->
               </el-form-item>
             </div>
           </el-form>
@@ -203,12 +233,14 @@ export default {
         endTime: "",
         checkboxGroup2: [],
         checkedList: [],
+        taskRadio: "",
       },
       isView: true,
       rules: {
         planName: [{ required: true, message: "请输入计划名称", trigger: "blur" }],
         endTime: [{ required: true, message: "请输入结束时间", trigger: "blur" }],
         checkedList: [{ required: true, message: "请选择组织架构", trigger: "blur" }],
+        taskRadio: [{ required: true, message: "请选择任务", trigger: "blur" }],
       },
       userInfo: {},
 
@@ -321,6 +353,7 @@ export default {
               return item.isRequired == "1";
             });
             this.ruleForm.checkboxGroup2 = [];
+
             for (let i = 0; i < listRequest.length; i++) {
               this.ruleForm.checkboxGroup2.push(listRequest[i].flag);
             }
@@ -696,6 +729,7 @@ export default {
       this.dialogVisible = true;
       this.isView = val;
       //获取渠道信息
+      
       // this.getGradeFun();
       this.getChannel();
       this.getTeacher();
@@ -750,7 +784,13 @@ export default {
           let listTask = [];
           for (let i = 0; i < list.length; i++) {
             //
-            listTask.push(list[i].flag);
+           
+            if(list[i].contentType=='1'){
+              //
+              this.ruleForm.taskRadio=list[i].flag;
+            }else{
+              listTask.push(list[i].flag);
+            }
           }
           this.ruleForm.checkboxGroup2 = listTask;
           //查询到已选任务
@@ -761,7 +801,6 @@ export default {
             //
             listOrg.push(res.data.orgEntityList[i].orgNo);
           }
-          //  debugger;
           this.ruleForm.checkedList = listOrg;
           this.$refs.tree.setCheckedKeys(this.ruleForm.checkedList);
         }
@@ -769,7 +808,6 @@ export default {
     },
     //全选组织架构
     selectAllDataOrg() {
-
       let list = [];
       for (let i = 0; i < this.treeData.length; i++) {
         list.push(this.treeData[i].orgNo);
@@ -804,8 +842,9 @@ export default {
       this.grade = [];
       this.ruleForm.planName = "";
       this.ruleForm.endTime = "";
-
+      this.ruleForm.taskRadio='';
       this.ruleForm.checkedList = [];
+      
       this.$refs.tree.setCheckedKeys([]);
       this.ruleForm.checkboxGroup2 = [];
       this.dialogVisible = false;
@@ -823,9 +862,9 @@ export default {
       this.disableFlag = true;
       let validSp = [];
       if (this.isView) {
-        validSp = ["planName", "endTime", "checkedList"];
+        validSp = ["planName", "endTime", "checkedList", "taskRadio"];
       } else {
-        validSp = ["planName", "endTime", "checkedList"];
+        validSp = ["planName", "endTime", "checkedList", "taskRadio"];
       }
       let aa = [];
       //获取已选项
@@ -836,14 +875,14 @@ export default {
           aa.push(valid);
           //判断是编辑还是新增
           if (this.isView) {
-            if (aa.length == 3) {
+            if (aa.length == 4) {
               this.disableFlag = true;
               this.register();
             } else {
               this.disableFlagStatus();
             }
           } else {
-            if (aa.length == 3) {
+            if (aa.length == 4) {
               this.disableFlag = true;
               this.editUserFun();
             } else {
@@ -865,7 +904,7 @@ export default {
       let listTmp = [];
       let listTmpNo = [];
       listTmp = this.scaleAndTaskList.filter((item) => {
-        return this.ruleForm.checkboxGroup2.includes(item.flag);
+        return this.ruleForm.checkboxGroup2.includes(item.flag)||this.ruleForm.taskRadio==item.flag;
       });
       for (let i = 0; i < listTmp.length; i++) {
         let obj = {
@@ -955,7 +994,7 @@ export default {
       let listTmp = [];
       let listTmpNo = [];
       listTmp = this.scaleAndTaskList.filter((item) => {
-        return this.ruleForm.checkboxGroup2.includes(item.flag);
+        return this.ruleForm.checkboxGroup2.includes(item.flag)||this.ruleForm.taskRadio==item.flag;
       });
       for (let i = 0; i < listTmp.length; i++) {
         let obj = {