“dzb”
2022-10-08 ce87e7746d6399c5a38a7f4fe10447d911b06051
src/views/systemSetting/baseSetting/department/createUser/index.vue
@@ -36,7 +36,7 @@
                                </div>
                                <div class="scrollWrap">
                                    <el-checkbox-group :max="3" v-model="checkedUser" @change="handleCheckedUserChange">
                                        <el-checkbox v-for="user in userList" :label="user.username" :key="user.id" :value="user.id">
                                        <el-checkbox v-for="user in userList" :label="user.id" :key="user.id">
                                            {{user.username}}
                                        </el-checkbox>
                                    </el-checkbox-group>
@@ -112,7 +112,7 @@
            userList: [],
            departList: [],
            checkedUser: [],
            openUser:false,
            openUser: false,
        }
    },
    created() {
@@ -126,26 +126,27 @@
        handleUser() {
            this.$refs.user.validate((valid) => {
                if (valid) {
                    const { depart } = this;
                    const { depart, checkedUser } = this;
                    console.log(depart);
                    // this.$axios.post('/sccg/depart/create', {
                    //     departName: depart.departName,
                    //     parentId: depart.parentId, departType: depart.departType, departDes: depart.departDes
                    // }).then(res => {
                    //     if (res.code === 200) {
                    //         this.$message({
                    //             message:res.message,
                    //             type:'success'
                    //         })
                    //         this.refresh();
                    //     }else if(res.code ===2001){
                    //         this.$message({
                    //             message:res.message,
                    //             type:'error'
                    //         })
                    //         this.refresh();
                    //     }
                    // })
                    console.log(checkedUser);
                    this.$axios.post('/sccg/depart/create', {
                        departName: depart.departName,
                        parentId: depart.parentId, departType: depart.departType, departDes: depart.departDes
                    }).then(res => {
                        if (res.code === 200) {
                            this.$message({
                                message:res.message,
                                type:'success'
                            })
                            this.refresh();
                        }else if(res.code ===2001){
                            this.$message({
                                message:res.message,
                                type:'error'
                            })
                            this.refresh();
                        }
                    })
                } else {
                    return false;
                }
@@ -171,23 +172,24 @@
                if (res.code === 200) {
                    console.log(res)
                    this.userList = res.data.records;
                    console.log(this.userList);
                }
            })
        },
        handleCheckedUserChange(value) {
            // console.log(value);
            if(value.length>3){
            if (value.length > 3) {
                console.log(this.checkedUser);
                this.$message({
                    type:'warning',
                    message:'最多只能添加三个成员'
                    type: 'warning',
                    message: '最多只能添加三个成员'
                })
            }
            // let checkedCount = value.length;
            // this.checkAll = checkedCount === this.cities.length;
            // this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
        },
        addUser(){
        addUser() {
            console.log(this.checkedUser);
            this.openUser = false;
        },
@@ -272,6 +274,7 @@
                position: absolute;
                z-index: 2000;
                right: 0;
                .box-card {
                    max-height: 200px;
                    overflow: hidden;