wuhongyu 4 年之前
父節點
當前提交
40e60a3a2d
共有 2 個文件被更改,包括 50 次插入37 次删除
  1. 38 34
      src/layout/class/nameList/stuNameList.vue
  2. 12 3
      src/views/user/chuanzuoye.vue

+ 38 - 34
src/layout/class/nameList/stuNameList.vue

@@ -124,42 +124,44 @@ export default {
     },
 
     submitinfo(item) {
-      // this.value = item.job;
+      if (this.user.job == '班长') {
+        // this.value = item.job;
 
-      var wenyi = this.stuNameList.filter(item => item.job == '文艺委员');
-      var anquan = this.stuNameList.filter(item => item.job == '安全委员');
+        var wenyi = this.stuNameList.filter(item => item.job == '文艺委员');
+        var anquan = this.stuNameList.filter(item => item.job == '安全委员');
 
-      // this.value = item.job;
-      // this.columns = this.column1;
-      if (wenyi.length == '1') {
-        if (anquan.length == '0') {
-          if (item.job == '文艺委员') {
-            this.columns = this.column1;
-          } else {
-            this.columns = this.column3;
-          }
-        } else if (anquan.length == '1') {
-          if (item.job == '普通学生') {
-            this.columns = this.column4;
-          } else if (item.job == '安全委员') {
-            this.columns = this.column3;
-          } else if (item.job == '文艺委员') {
-            this.columns = this.column2;
+        // this.value = item.job;
+        // this.columns = this.column1;
+        if (wenyi.length == '1') {
+          if (anquan.length == '0') {
+            if (item.job == '文艺委员') {
+              this.columns = this.column1;
+            } else {
+              this.columns = this.column3;
+            }
+          } else if (anquan.length == '1') {
+            if (item.job == '普通学生') {
+              this.columns = this.column4;
+            } else if (item.job == '安全委员') {
+              this.columns = this.column3;
+            } else if (item.job == '文艺委员') {
+              this.columns = this.column2;
+            }
           }
-        }
-      } else if (wenyi.length == '0') {
-        if (anquan.length == '0') {
-          this.columns = this.column1;
-        } else if (anquan.length == 1) {
-          if (item.job == '安全委员') {
+        } else if (wenyi.length == '0') {
+          if (anquan.length == '0') {
             this.columns = this.column1;
-          } else {
-            this.columns = this.column2;
+          } else if (anquan.length == 1) {
+            if (item.job == '安全委员') {
+              this.columns = this.column1;
+            } else {
+              this.columns = this.column2;
+            }
           }
         }
+        this.show = true;
+        this.newform = item;
       }
-      this.show = true;
-      this.newform = item;
     },
 
     //设置优秀学员
@@ -168,11 +170,13 @@ export default {
     },
 
     async showPopup(item) {
-      if (item.job == '普通学生') {
-        console.log(item);
-        this.psform = item;
-        const res = await this.modelFetch({ model: 'bedroom', code: item.bedroom });
-        this.newshow = true;
+      if (this.user.job == '班长') {
+        if (item.job == '普通学生') {
+          console.log(item);
+          this.psform = item;
+          const res = await this.modelFetch({ model: 'bedroom', code: item.bedroom });
+          this.newshow = true;
+        }
       }
     },
 

+ 12 - 3
src/views/user/chuanzuoye.vue

@@ -74,9 +74,18 @@ export default {
       this.form.lessonid = this.id;
       this.form.lessonname = this.name;
       let data = this.form;
-
-      let res = await this.add(data);
-      this.$checkRes(res, '提交成功', res.errmsg);
+      console.log();
+      if (data.picrul) {
+        let res = await this.add(data);
+        this.$checkRes(res, '提交成功', res.errmsg);
+      } else {
+        this.$message({
+          showClose: true,
+          message: '请上传图片',
+          type: 'error',
+        });
+      }
+      //
     },
   },
 };