|
@@ -39,14 +39,45 @@ export default {
|
|
|
headStuList: [],
|
|
|
assignShow: false,
|
|
|
assignForm: {},
|
|
|
- job_list: [
|
|
|
+ job_list: [],
|
|
|
+
|
|
|
+ job1: [
|
|
|
{
|
|
|
name: '班长',
|
|
|
},
|
|
|
{
|
|
|
name: '学委',
|
|
|
},
|
|
|
+ {
|
|
|
+ name: '普通学生',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ job2: [
|
|
|
+ {
|
|
|
+ name: '班长',
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ name: '普通学生',
|
|
|
+ },
|
|
|
],
|
|
|
+
|
|
|
+ job3: [
|
|
|
+ {
|
|
|
+ name: '学委',
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ name: '普通学生',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+
|
|
|
+ job4: [
|
|
|
+ {
|
|
|
+ name: '普通学生',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+
|
|
|
title: '',
|
|
|
isleftarrow: '',
|
|
|
navShow: true,
|
|
@@ -76,19 +107,64 @@ export default {
|
|
|
async searchInfo() {
|
|
|
let classid = this.id;
|
|
|
const res = await this.list({ classid });
|
|
|
+ console.log(res.data);
|
|
|
+
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `headStuList`, res.data);
|
|
|
}
|
|
|
},
|
|
|
//点击派遣
|
|
|
- async clickAssign(id) {
|
|
|
+ async clickAssign({ id, item }) {
|
|
|
+ var banzhang = this.headStuList.filter(item => item.job == '班长');
|
|
|
+ var xuewei = this.headStuList.filter(item => item.job == '学委');
|
|
|
+ console.log(banzhang);
|
|
|
+ console.log(xuewei.length);
|
|
|
+
|
|
|
+ if (xuewei.length == '1') {
|
|
|
+ if (banzhang.length == '2') {
|
|
|
+ if (item.job == '班长') {
|
|
|
+ this.$set(this, `job_list`, this.job2);
|
|
|
+ } else if (item.job == '学委') {
|
|
|
+ this.$set(this, `job_list`, this.job3);
|
|
|
+ } else {
|
|
|
+ this.$set(this, `job_list`, this.job4);
|
|
|
+ }
|
|
|
+ } else if (banzhang.length < '2') {
|
|
|
+ console.log('cc');
|
|
|
+
|
|
|
+ if (item.job == '学委') {
|
|
|
+ this.$set(this, `job_list`, this.job1);
|
|
|
+ } else {
|
|
|
+ this.$set(this, `job_list`, this.job2);
|
|
|
+ }
|
|
|
+ } else if (xuewei.length == '0') {
|
|
|
+ }
|
|
|
+ } else if (xuewei.length == '0') {
|
|
|
+ console.log('a');
|
|
|
+
|
|
|
+ if (banzhang.length == '0') {
|
|
|
+ this.$set(this, `job_list`, this.job1);
|
|
|
+ } else if (banzhang.length == '2') {
|
|
|
+ if (item.job == '班长') {
|
|
|
+ this.$set(this, `job_list`, this.job1);
|
|
|
+ } else {
|
|
|
+ this.$set(this, `job_list`, this.job3);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$set(this, `job_list`, this.job1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.assignShow = true;
|
|
|
const res = await this.fet(id);
|
|
|
this.$set(this, `assignForm`, res.data);
|
|
|
},
|
|
|
//指派职务
|
|
|
async onAssignShow(assignForm) {
|
|
|
+ console.log(assignForm);
|
|
|
+
|
|
|
let data = this.assignForm;
|
|
|
+
|
|
|
let res = await this.updates(data);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$message({
|