| | |
| | | <!-- 所属部门 --> |
| | | <el-form-item class="optionItem" label="所属部门:" prop="departmentId"> |
| | | <el-select v-model="user.departmentId" placeholder="请选择所属部门"> |
| | | <el-option v-for="item in typeList" :key="item.name" :label="item.departName" :value="item.id"> |
| | | <el-option v-for="item in typeList" :key="item.name" :label="item.departName" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <!-- <el-form-item class="optionItem" label="填写所属ip地址:" prop="ip"> |
| | | <el-input v-model="user.ip" placeholder="请填写所属ip地址"></el-input> |
| | | </el-form-item> --> |
| | | <el-form-item class="optionBtn"> |
| | | <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">提交</el-button> |
| | | <el-form-item> |
| | | <div class="optionBtn"> |
| | | <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">提交</el-button> |
| | | <el-button class="btn reset">重置</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | |
| | | callback(new Error("请填写登录密码")); |
| | | } else { |
| | | const rep = /^\w+$/; |
| | | if(!rep.test(value)){ |
| | | if (!rep.test(value)) { |
| | | callback(new Error("密码只能是以数字、26个英文字母或者下划线组成的字符串")); |
| | | } |
| | | } |
| | |
| | | callback(new Error("请填写用户姓名")); |
| | | } else { |
| | | const rep = /^[\u4E00-\u9FA5]{2,4}$/; |
| | | if(!rep.test(value)){ |
| | | if (!rep.test(value)) { |
| | | callback("请输入正确的用户姓名"); |
| | | } |
| | | } |
| | |
| | | callback(new Error("请填写手机号码")); |
| | | } else { |
| | | const rep = /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/ |
| | | if(!rep.test(value)){ |
| | | if (!rep.test(value)) { |
| | | callback("请输入正确的手机号码"); |
| | | } |
| | | } |
| | |
| | | const validateMail = (rule, value, callback) => { |
| | | if (value) { |
| | | const rep = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; |
| | | if(!rep.test(value)){ |
| | | if (!rep.test(value)) { |
| | | callback(new Error("请输入正确的邮箱")) |
| | | } |
| | | } |
| | |
| | | typeList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | const that = this ; |
| | | created() { |
| | | const that = this; |
| | | // 获取角色列表 |
| | | // this.$axios.get('') |
| | | // 获取用户类型列表 |
| | |
| | | // console.log(res); |
| | | // }) |
| | | // 获取全部部门列表 |
| | | this.$axios.get('sccg/depart/page').then(res=>{ |
| | | this.$axios.get('sccg/depart/page').then(res => { |
| | | that.typeList = res.data.records; |
| | | }) |
| | | }, |
| | | methods: { |
| | | handleUser() { |
| | | const {user} = this; |
| | | const { user } = this; |
| | | console.log(user); |
| | | this.$axios.post('sccg/admin/register',{ |
| | | departmentId:user.departmentId, |
| | | email:user.email, |
| | | jsDy:user.isDy, |
| | | jobTitle:user.jobTitle, |
| | | mobile:user.mobile, |
| | | nickName:user.nickName, |
| | | password:user.password, |
| | | userType:user.userType, |
| | | username:user.username, |
| | | }).then(res=>{ |
| | | if(res.code === 200){ |
| | | this.$axios.post('sccg/admin/register', { |
| | | departmentId: user.departmentId, |
| | | email: user.email, |
| | | jsDy: user.isDy, |
| | | jobTitle: user.jobTitle, |
| | | mobile: user.mobile, |
| | | nickName: user.nickName, |
| | | password: user.password, |
| | | userType: user.userType, |
| | | username: user.username, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.refresh(); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | props:['refresh'] |
| | | props: ['refresh'] |
| | | } |
| | | </script> |
| | | <style lang="scss" scpoed> |
| | | <style lang="scss" scoped> |
| | | .createUser { |
| | | border-radius: 1px; |
| | | // min-width: 1024px; |
| | | // min-height: 1450px; |
| | | background-color: #fff; |
| | | background-color: #09152f; |
| | | |
| | | header { |
| | | display: flex; |
| | |
| | | height: 60px; |
| | | line-height: 60px; |
| | | padding: 0 20px; |
| | | border: 1px solid #fff; |
| | | |
| | | .headerTitle { |
| | | color: #4b9bb7; |
| | | font-weight: 600; |
| | | color: #666; |
| | | } |
| | | |
| | | .headerTip span { |
| | |
| | | } |
| | | |
| | | .headerTip label { |
| | | color: #999999; |
| | | color: #4b9bb7; |
| | | } |
| | | } |
| | | |
| | | main { |
| | | border-top: 1px solid #f0f2f5; |
| | | border: 1px solid #fff; |
| | | text-align: left; |
| | | padding: 0 55px; |
| | | background-color: #09152f; |
| | | padding-bottom: 50px; |
| | | .mainTitle { |
| | | // margin-left: 60px; |
| | | color: #666; |
| | | color: #4b9bb7; |
| | | font-weight: 600; |
| | | line-height: 100px; |
| | | font-size: 14px; |
| | |
| | | .mainContent { |
| | | display: flex; |
| | | justify-content: center; |
| | | |
| | | &::v-deep .el-form-item__label { |
| | | color: #4b9bb7; |
| | | } |
| | | |
| | | &::v-deep .el-input__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | } |
| | | |
| | | .el-form-item__content { |
| | | width: 400px; |
| | | |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | .optionHandleSp{ |
| | | |
| | | .optionHandleSp { |
| | | display: flex; |
| | | .areaNumber,.moreNumber{ |
| | | |
| | | .areaNumber, |
| | | .moreNumber { |
| | | flex: 1; |
| | | } |
| | | .telNumber{ |
| | | |
| | | .telNumber { |
| | | flex: 2; |
| | | } |
| | | } |
| | | .optionBtn{ |
| | | |
| | | .optionBtn { |
| | | display: flex; |
| | | justify-content: center; |
| | | margin-top: 80px; |
| | | .btn{ |
| | | margin-top: 20px; |
| | | |
| | | .btn { |
| | | padding: 12px 50px; |
| | | } |
| | | } |