| | |
| | | :validate-on-rule-change="false" |
| | | label-width="76px" |
| | | > |
| | | <el-form-item label="类型" prop="type"> |
| | | <el-form-item label="类型" prop="userType"> |
| | | <el-radio-group |
| | | v-model="info.type" |
| | | v-model="info.userType" |
| | | style="float: left; margin-top: 15px" |
| | | > |
| | | <el-radio :label="1">个人</el-radio> |
| | | <el-radio :label="2">公司</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="真实姓名" prop="trueName" v-show="info.type == '1'"> |
| | | <el-form-item |
| | | label="真实姓名" |
| | | prop="trueName" |
| | | v-show="info.userType == '1'" |
| | | > |
| | | <el-input v-model="info.trueName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="公司名称" |
| | | prop="companyName" |
| | | v-show="info.type == '2'" |
| | | v-show="info.userType == '2'" |
| | | > |
| | | <el-input v-model="info.companyName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="联系人" prop="contact" v-show="info.type == '2'"> |
| | | <el-form-item label="联系人" prop="contact" v-show="info.userType == '2'"> |
| | | <el-input v-model="info.contact" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="邮箱" prop="email"> |
| | |
| | | }, |
| | | computed: { |
| | | infoRules() { |
| | | if (this.info.type == 1) { |
| | | if (this.info.userType == 1) { |
| | | return { |
| | | type: [{ required: true, message: "请选择类型" }], |
| | | userType: [{ required: true, message: "请选择类型" }], |
| | | trueName: [ |
| | | { required: true, message: "请填写真实姓名", trigger: "change" }, |
| | | ], |
| | |
| | | }; |
| | | } else { |
| | | return { |
| | | type: [{ required: true, message: "请选择类型" }], |
| | | userType: [{ required: true, message: "请选择类型" }], |
| | | companyName: [ |
| | | { required: true, message: "请填写公司名称", trigger: "change" }, |
| | | ], |
| | |
| | | } |
| | | }, |
| | | disabled() { |
| | | if (this.info.type == 1 && this.info.trueName) { |
| | | if (this.info.userType == 1 && this.info.trueName) { |
| | | return false; |
| | | } |
| | | |
| | | if (this.info.type == 2 && this.info.companyName && this.info.contact) { |
| | | if ( |
| | | this.info.userType == 2 && |
| | | this.info.companyName && |
| | | this.info.contact |
| | | ) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | }); |
| | | this.info.provinceId = this.info.address[0]; |
| | | this.info.areaId = this.info.address[1]; |
| | | for (const key in this.info) { |
| | | if (this.info[key] === "") { |
| | | delete this.info[key]; |
| | | } |
| | | } |
| | | if (this.info.userType == 2) { |
| | | this.info.trueName = this.info.companyName; |
| | | } |
| | | entireUserInfo(this.info) |
| | | .then(() => { |
| | | this.loading.close(); |
| | |
| | | }) |
| | | .catch((err) => { |
| | | this.loading.close(); |
| | | //后门 |
| | | this.$router.push({ |
| | | path: "/register/success", |
| | | query: { info: this.userInfo }, |
| | | }); |
| | | this.$notify({ |
| | | type: "error", |
| | | message: err.msg, |
| | |
| | | } |
| | | </style> |
| | | |
| | | <style lang="scss"> |
| | | .industrySelect.el-select-dropdown.el-popper { |
| | | <style lang="scss" > |
| | | .industrySelect.el-select-dropdown.el-popper ::v-deep { |
| | | margin: 0; |
| | | |
| | | .el-scrollbar { |
| | |
| | | .el-popper.el-cascader__dropdown.selectCascader { |
| | | border: none; |
| | | margin: 0; |
| | | |
| | | width: auto !important; |
| | | * { |
| | | color: #3d3d3d; |
| | | border-color: rgba(255, 255, 2555, 0.1); |
| | | } |
| | | |
| | | .el-cascader-panel { |
| | | height: 158px !important; |
| | | } |
| | | |
| | | .in-active-path { |
| | |
| | | width: 230px; |
| | | height: 175px; |
| | | } |
| | | |
| | | .el-scrollbar__view { |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .el-cascader-node__postfix::before { |
| | | display: none !important; |
| | | } |
| | | } |
| | | </style> |