Browse Source

修改测试计划

plg 6 months ago
parent
commit
c6dde619ec

BIN
src/assets/img/table/xiafa.png


BIN
src/assets/img/table/xiafa1.png


+ 164 - 14
src/components/PlanRegister.vue

@@ -35,6 +35,13 @@
               </el-date-picker>
             </el-form-item>
 
+            <el-form-item label="任务选择">
+              <el-checkbox-group v-model="checkboxGroup2" size="mini">
+                <el-checkbox label="1" border disabled check>SCL90</el-checkbox>
+                <el-checkbox label="2" border>{{ cognitionName }}</el-checkbox>
+              </el-checkbox-group>
+            </el-form-item>
+
             <div class="dig_button">
               <el-button type="info" round @click="resetData()">重置</el-button>
               <!-- <el-button type="success" round @click="submitForm('ruleForm')"
@@ -76,20 +83,27 @@ export default {
         planName: [{ required: true, message: "请输入计划名称", trigger: "blur" }],
         endTime: [{ required: true, message: "请输结束时间", trigger: "blur" }],
       },
-      userInfo:{}
+      userInfo: {},
+
+      scaleAndCon: [],
+      checkboxGroup2: ["1"],
+      //查看是不是两次都调用完了
+      countList: [],
+      //显示用的认知任务名称
+      cognitionName: "",
+      id: "",
     };
   },
   mounted() {
     this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
-   
 
     //获取渠道信息
 
     // this.ruleForm.type = "3";
   },
   methods: {
-    resetForm(val){
-      this.cancle()
+    resetForm(val) {
+      this.cancle();
     },
     timeChange(val) {
       if (val !== null) {
@@ -115,25 +129,85 @@ export default {
     },
     open(val) {
       this.cancle();
-
+      this.checkboxGroup2 = ["1"];
+      //打开后返回的数组
+      this.scaleAndCon = [];
       this.dialogVisible = true;
       this.isView = val;
+      //添加计划
+      //查询需要选择的量表
+      this.queryScale("scale", 0);
+      //查询需要选择的认知任务
+      this.queryScale("cognition", 0);
 
       this.$nextTick(() => {
         this.$refs.ruleForm.clearValidate();
       });
     },
     edit(val) {
-    
+      this.id = val.id;
       this.dialogVisible = true;
       this.isView = false;
       this.ruleForm.planName = val.planName;
       this.ruleForm.endTime = val.planEndTime;
       this.userDetailData = val;
+      this.queryScale("scale", 1);
+      //查询需要选择的认知任务
+      this.queryScale("cognition", 1);
       //调用查询详情的接口
     },
+    //查询量表
+    queryDetail() {
+      //val 是查询的类型
+      this.$http.get(`/plan/findPlanById?id=${this.id}`, {}, (res) => {
+        if (res.code == 200) {
+          //
+          console.log("res");
+          console.log(res);
+          let list = res.data.contentEntities;
+          let listTmp = list.filter((item) => {
+            return item.contentType == "1";
+          });
+          if (listTmp.length > 0) {
+            this.checkboxGroup2 = ["1", "2"];
+          }
+        }
+      });
+    },
+
+    //查询量表
+    queryScale(val, flag) {
+      //val 是查询的类型
+      this.$http.get(`/param/findAllByType?type=${val}`, {}, (res) => {
+        if (res.code == 200) {
+          this.countList.push(val);
+          for (let i = 0; i < res.data.length; i++) {
+            this.scaleAndCon.push(res.data[i]);
+          }
+
+          //里边有有两个说明量表和认知任务都返回了
+          if (this.countList.length == 2) {
+            //
+            let cogList = [];
+            cogList = this.scaleAndCon.filter((item) => {
+              return item.paramType == "cognition";
+            });
+            let cog = [];
+            for (let i = 0; i < cogList.length; i++) {
+              cog.push(cogList[i].paramName);
+            }
+            console.log(cog);
+            this.cognitionName = cog.join(";");
+
+            if (flag) {
+              this.queryDetail();
+            }
+          }
+        }
+      });
+    },
     //调用查询详情的接口
-    resetData(){
+    resetData() {
       this.$refs["ruleForm"].clearValidate();
       //清空表单
       this.ruleForm.planName = "";
@@ -191,19 +265,57 @@ export default {
     register() {
       console.log(this.ruleForm.endTime);
       let that = this;
-      console.log(this.userInfo)
-   
+      console.log(this.userInfo);
 
+      //判断是选了两个还是一个
+      let list = [];
+      if (this.checkboxGroup2.length == 2) {
+        //开始组装数据
+        for (let i = 0; i < this.scaleAndCon.length; i++) {
+          //
+          if (this.scaleAndCon[i].paramType == "cognition") {
+            let obj = {
+              contentType: "1",
+              description: this.scaleAndCon[i].paramDesc,
+              flag: this.scaleAndCon[i].paramValue,
+              name: this.scaleAndCon[i].paramName,
+            };
+            list.push(obj);
+          }
+          if (this.scaleAndCon[i].paramType == "scale") {
+            let obj = {
+              contentType: "0",
+              description: this.scaleAndCon[i].paramDesc,
+              flag: this.scaleAndCon[i].paramValue,
+              name: this.scaleAndCon[i].paramName,
+            };
+            list.push(obj);
+          }
+        }
+      } else {
+        for (let i = 0; i < this.scaleAndCon.length; i++) {
+          if (this.scaleAndCon[i].paramType == "scale") {
+            let obj = {
+              contentType: "0",
+              description: this.scaleAndCon[i].paramDesc,
+              flag: this.scaleAndCon[i].paramValue,
+              name: this.scaleAndCon[i].paramName,
+            };
+            list.push(obj);
+          }
+        }
+      }
       // this.ruleForm.password = md5(this.ruleForm.password);
       this.$http.post(
         `/plan/addOrUpdate`,
         {
+          contentEntities: list,
           planName: this.ruleForm.planName,
           planEndTime: this.ruleForm.endTime,
-          createUserId:this.userInfo.id,
-          createUserName:this.userInfo.userName,
-          planOrgNo:this.userInfo.orgNo,
-          planOrgName:this.userInfo.orgName,
+          createUserId: this.userInfo.id,
+          createUserName: this.userInfo.userName,
+          planOrgNo: this.userInfo.orgNo,
+          planOrgName: this.userInfo.orgName,
         },
         (res) => {
           this.disableFlagStatus();
@@ -225,9 +337,47 @@ export default {
     },
     editUserFun() {
       let that = this;
-
+      let list = [];
+      if (this.checkboxGroup2.length == 2) {
+        //开始组装数据
+        for (let i = 0; i < this.scaleAndCon.length; i++) {
+          //
+          if (this.scaleAndCon[i].paramType == "cognition") {
+            let obj = {
+              contentType: "1",
+              description: this.scaleAndCon[i].paramDesc,
+              flag: this.scaleAndCon[i].paramValue,
+              name: this.scaleAndCon[i].paramName,
+            };
+            list.push(obj);
+          }
+          if (this.scaleAndCon[i].paramType == "scale") {
+            let obj = {
+              contentType: "0",
+              description: this.scaleAndCon[i].paramDesc,
+              flag: this.scaleAndCon[i].paramValue,
+              name: this.scaleAndCon[i].paramName,
+            };
+            list.push(obj);
+          }
+        }
+      } else {
+        for (let i = 0; i < this.scaleAndCon.length; i++) {
+          if (this.scaleAndCon[i].paramType == "scale") {
+            let obj = {
+              contentType: "0",
+              description: this.scaleAndCon[i].paramDesc,
+              flag: this.scaleAndCon[i].paramValue,
+              name: this.scaleAndCon[i].paramName,
+            };
+            list.push(obj);
+          }
+        }
+      }
       this.userDetailData.planEndTime = this.ruleForm.endTime;
       this.userDetailData.planName = this.ruleForm.planName;
+      this.userDetailData.contentEntities = list;
+
       this.$http.post(
         `/plan/addOrUpdate`,
         {

+ 62 - 73
src/components/manageRegister.vue

@@ -27,12 +27,11 @@
                 placeholder="请选择组织架构"
                 v-model="ruleForm.group"
                 :options="groupData"
-                 :props="{ checkStrictly: true }"
-               
+                :props="{ checkStrictly: true }"
                 clearable
               ></el-cascader>
             </el-form-item>
-            <el-form-item label="号" prop="studentNumber">
+            <el-form-item label="号" prop="studentNumber">
               <el-input v-model="ruleForm.studentNumber"></el-input>
             </el-form-item>
             <el-row>
@@ -42,7 +41,7 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="性别" prop="name">
+                <el-form-item label="性别" prop="sex">
                   <el-radio-group v-model="ruleForm.sex" style="margin-left: 20px">
                     <el-radio label="1">男</el-radio>
                     <el-radio label="0">女</el-radio>
@@ -50,15 +49,15 @@
                 </el-form-item>
               </el-col>
             </el-row>
-        
-            <el-form-item  v-if="isView"  label="密码" prop="password">
+
+            <el-form-item v-if="isView" label="密码" prop="password">
               <el-input
                 type="password"
                 v-model="ruleForm.password"
                 autocomplete="off"
               ></el-input>
             </el-form-item>
-            <el-form-item  v-if="isView"  label="确认密码" prop="comPassword">
+            <el-form-item v-if="isView" label="确认密码" prop="comPassword">
               <el-input
                 type="password"
                 v-model="ruleForm.comPassword"
@@ -70,9 +69,7 @@
               <!-- <el-button type="success" round @click="submitForm('ruleForm')"
                 >提交</el-button
               > -->
-              <el-button type="success" round @click="submitCom()"
-                >提交</el-button
-              >
+              <el-button type="success" round @click="submitCom()">提交</el-button>
             </div>
           </el-form>
         </div>
@@ -119,7 +116,7 @@ export default {
     };
     return {
       //编辑返回的值
-      userDetailData:{},
+      userDetailData: {},
       //组织架构名字
       groupName: "",
       ppData: [],
@@ -159,8 +156,9 @@ export default {
       isView: true,
       rules: {
         group: [{ required: true, message: "请选择组织架构", trigger: "blur" }],
-        studentNumber: [{ required: true, message: "请输入学号", trigger: "blur" }],
-        name: [{ required: true, message: "请输入学号", trigger: "blur" }],
+        studentNumber: [{ required: true, message: "请输入账号", trigger: "blur" }],
+        name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
+        sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
         // password: [{ required: true, message: "请输密码", trigger: "blur" }],
         password: [{ required: true, validator: validatePass, trigger: "blur" }],
         comPassword: [{ required: true, validator: validateComPass, trigger: "blur" }],
@@ -176,7 +174,7 @@ export default {
     // this.ruleForm.type = "3";
   },
   methods: {
-    resetData(){
+    resetData() {
       this.$refs["ruleForm"].clearValidate();
       //清空表单
       this.ruleForm.group = "";
@@ -191,7 +189,6 @@ export default {
       this.$http.get(`/org/findAllOrgByPOrgNo`, {}, (res) => {
         //  this.$toast.success({message:'成功'});
         if (res && res.code == 200) {
-      
           //将值赋值给list
           if (res.data.length > 0) {
             let resAdd = this.addPro(res.data);
@@ -247,7 +244,7 @@ export default {
     },
     queryOrgName() {
       for (let i = 0; i < this.ppData.length; i++) {
-        if (this.ruleForm.group[this.ruleForm.group.length-1] == this.ppData[i].orgNo) {
+        if (this.ruleForm.group[this.ruleForm.group.length - 1] == this.ppData[i].orgNo) {
           this.groupName = this.ppData[i].orgName;
         }
       }
@@ -276,9 +273,9 @@ export default {
       }
     },
     open(val) {
-       this.cancle();
+      this.cancle();
       this.getChannel();
-     
+
       this.dialogVisible = true;
       this.isView = val;
 
@@ -290,41 +287,36 @@ export default {
       this.getChannel();
       this.dialogVisible = true;
       this.isView = false;
-      this.queryUserDetail(val.id)
+      this.queryUserDetail(val.id);
       //调用查询详情的接口
     },
     //调用查询详情的接口
-    queryUserDetail(val){
-      let url = `/user/findUserById?id=${val}`
-      
-      this.$http.get(url,
-        {
-        },
-        (res) => {
-   
-          console.log(res)
-          if (res && res.code == 200) {
-           //获取返回值
-           //根据将数据存储
-           this.userDetailData=res.data;
-           let a =[]
-           for(let i=res.data.orgList.length;i>0;i--){
-                //
-                a.push(res.data.orgList[i-1].orgNo)                      
-           }
-           //回显学号
-           this.ruleForm.studentNumber=res.data.userNo;
-           //回显姓名
-           this.ruleForm.name=res.data.userName
-           //回显性别
-            this.ruleForm.sex=res.data.gender
-           this.ruleForm.group=a;
-          } else {
-            // this.$toast.fail(res.msg);
-            this.$message.error(res.msg);
+    queryUserDetail(val) {
+      let url = `/user/findUserById?id=${val}`;
+
+      this.$http.get(url, {}, (res) => {
+        console.log(res);
+        if (res && res.code == 200) {
+          //获取返回值
+          //根据将数据存储
+          this.userDetailData = res.data;
+          let a = [];
+          for (let i = res.data.orgList.length; i > 0; i--) {
+            //
+            a.push(res.data.orgList[i - 1].orgNo);
           }
+          //回显学号
+          this.ruleForm.studentNumber = res.data.userNo;
+          //回显姓名
+          this.ruleForm.name = res.data.userName;
+          //回显性别
+          this.ruleForm.sex = res.data.gender;
+          this.ruleForm.group = a;
+        } else {
+          // this.$toast.fail(res.msg);
+          this.$message.error(res.msg);
         }
-      );
+      });
     },
     cancle() {
       this.$refs["ruleForm"].clearValidate();
@@ -381,35 +373,34 @@ export default {
     },
     register() {
       this.queryOrgName();
-      if(this.ruleForm.group.length!=2){
+      if (this.ruleForm.group.length != 2) {
         this.$message({
-          message:'院管理员请选择二级组织架构',
-          type:'error'
-        })
-        return 
+          message: "院管理员请选择二级组织架构",
+          type: "error",
+        });
+        return;
       }
-      console.log( this.ruleForm.group)
+      console.log(this.ruleForm.group);
       let that = this;
       // this.ruleForm.password = md5(this.ruleForm.password);
       this.$http.post(
         `/user/addOrUpdateUser`,
         {
-          orgNo:this.ruleForm.group[this.ruleForm.group.length-1] ,
+          orgNo: this.ruleForm.group[this.ruleForm.group.length - 1],
           orgName: this.groupName,
           userNo: this.ruleForm.studentNumber,
           userName: this.ruleForm.name,
           gender: this.ruleForm.sex,
           password: md5(this.ruleForm.password),
-           //roleType     1普通用户    roleType   管理员
-          roleType:'2'
+          //roleType     1普通用户    roleType   管理员
+          roleType: "2",
         },
         (res) => {
-       
           this.disableFlagStatus();
           // this.disableFlag = false;
           if (res && res.code == 200) {
             this.dialogVisible = false;
-       
+
             // this.$toast.success({ message: "成功" });
             //调用父组件的查询方法
             that.$emit("search");
@@ -425,22 +416,22 @@ export default {
     editUserFun() {
       let that = this;
       this.queryOrgName();
-      if(this.ruleForm.group.length!=2){
+      if (this.ruleForm.group.length != 2) {
         this.$message({
-          message:'院管理员请选择二级组织架构',
-          type:'error'
-        })
-        return 
+          message: "院管理员请选择二级组织架构",
+          type: "error",
+        });
+        return;
       }
-      this.userDetailData.orgNo=this.ruleForm.group[this.ruleForm.group.length-1];
-      this.userDetailData.orgName=this.groupName; 
-      this.userDetailData.userName= this.ruleForm.name;
-      this.userDetailData.gender= this.ruleForm.sex;
-      this.userDetailData.userNo= this.ruleForm.studentNumber;
+      this.userDetailData.orgNo = this.ruleForm.group[this.ruleForm.group.length - 1];
+      this.userDetailData.orgName = this.groupName;
+      this.userDetailData.userName = this.ruleForm.name;
+      this.userDetailData.gender = this.ruleForm.sex;
+      this.userDetailData.userNo = this.ruleForm.studentNumber;
       this.$http.post(
-     `/user/addOrUpdateUser`,
+        `/user/addOrUpdateUser`,
         {
-        ...this.userDetailData
+          ...this.userDetailData,
         },
         (res) => {
           this.disableFlagStatus();
@@ -525,6 +516,4 @@ export default {
     font-weight: 700;
   }
 }
-
-
 </style>

+ 2 - 2
src/utils/http.js

@@ -17,8 +17,8 @@ import { router } from "@/router";
 // axios.defaults.baseURL = 'https://child.hhnao.com:8070';
 // axios.defaults.baseURL = 'https://child.hhnao.com:8070';
 //https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx01d1a44906973cf2&redirect_uri=http%3A%2F%2F192.168.18.51%3A8085&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
-// export const basePath='http://10.113.248.4:8089'
-export const basePath = "http://43.143.198.30:8089";
+export const basePath='http://10.113.248.4:8089'
+// export const basePath = "http://43.143.198.30:8089";
 // const base_url = 'http://43.143.198.30:8089/'
 // const base_url = 'http://10.113.248.4:8090/'
 // export const basePath='http://43.143.198.30:8086'

+ 25 - 17
src/views/manage/channelInfo/orderSettlement.vue

@@ -14,10 +14,10 @@
       width="500px"
     >
       <div class="tips">
-        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
-          <el-form-item label="组织名称" prop="orgName">
+        <el-form :model="ruleForm" ref="ruleForm" class="demo-ruleForm">
+          <el-form-item label="组织架构名称" prop="orgName" class="imput_com">
             <el-input
-              placeholder="输入组织名称"
+              placeholder="输入组织架构名称"
               :maxlength="32"
               v-model="ruleForm.orgName"
             ></el-input>
@@ -82,9 +82,6 @@ export default {
       ruleForm: {
         orgName: "",
       },
-      rules: {
-        orgName: [{ required: true, message: "请输入组织名称", trigger: "blur" }],
-      },
       shareholderTypeOptions: [
         {
           labelEn: "Individual",
@@ -110,9 +107,9 @@ export default {
     this.getChannel();
   },
   methods: {
-    changeDir(){
+    changeDir() {
       //改变方向
-      this.isVertical = !this.isVertical
+      this.isVertical = !this.isVertical;
     },
     //获取组织架构方法--------------------开始-----------------------
     getChannel() {
@@ -198,14 +195,18 @@ export default {
       this.currentSelectObj = data.data;
       // console.log(this.currentSelectObj);
       if (data.val) {
+        this.ruleForm.orgName = data.data.orgName;
         // 不使用=赋值,内存相同,改变后,treeData数据也会改变
         // this.ruleForm = data.data;
         // this.ruleForm = Object.assign(this.ruleForm, data.data);
         // this.ruleForm.type = data.data.level;
+      } else {
+        this.ruleForm.orgName = "";
       }
       this.isEdit = data.val;
       // 使用=赋值,编辑时改变currentTreeData, 源数据treeData也会改变
       this.currentTreeData = data.data;
+
       this.dialogVisible = true;
     },
     // 删除
@@ -236,13 +237,12 @@ export default {
     // 保存添加股东
     confirm() {
       // let loading = Loading.service();
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          this.sendData();
-        } else {
-          // loading.close();
-        }
-      });
+      //判断是否输入值了
+      if (this.ruleForm.orgName != "" && this.ruleForm.orgName != null) {
+        this.sendData();
+      } else {
+        this.$message.warning("请输入组织架构名称");
+      }
     },
 
     // 发送添加股东数据
@@ -322,13 +322,21 @@ export default {
   },
 };
 </script>
+<style scoped>
+.imput_com >>> .el-input__inner {
+  width: 400px !important;
+}
+</style>
 <style lang="less" scoped>
-.changeDirection{
+// :deep(.el-input__inner) {
+
+// }
+.changeDirection {
   position: fixed;
   right: 50px;
   bottom: 80px;
   margin: auto;
-  background-color: #48D68E;
+  background-color: #48d68e;
   padding: 10px;
   color: #ffffff;
   cursor: pointer;