|
@@ -34,16 +34,18 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="验证码" prop="code">
|
|
|
+ <el-form-item label="验证码" prop="code" v-if="id === 'add'">
|
|
|
<el-input
|
|
|
v-model="ruleForm.code"
|
|
|
:placeholder="'验证码'"
|
|
|
maxlength="6"
|
|
|
:disabled="isDetail"
|
|
|
>
|
|
|
- <el-button slot="append" :disabled="numbers > 60" @click="codeTap">{{
|
|
|
- numbers === 60 ? "获取验证码" : numbers + "s后重试"
|
|
|
- }}</el-button>
|
|
|
+ <send-verification-code
|
|
|
+ slot="append"
|
|
|
+ :mobile="ruleForm.mobile"
|
|
|
+ @phoneErr="phoneErr"
|
|
|
+ />
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -105,11 +107,8 @@ export default {
|
|
|
is_mainoptions: [],
|
|
|
isIndeterminate: false,
|
|
|
ruleForm: {
|
|
|
- password: "",
|
|
|
- username: "",
|
|
|
- nickname: "", // 账号名
|
|
|
mobile: "", //手机号
|
|
|
- role_id: "", //角色id
|
|
|
+ code: "",
|
|
|
},
|
|
|
platformoptions: [],
|
|
|
rules: {
|
|
@@ -135,6 +134,7 @@ export default {
|
|
|
this.showModelThis = val;
|
|
|
if (val) {
|
|
|
this.initForm();
|
|
|
+ console.log(this.ruleForm);
|
|
|
}
|
|
|
},
|
|
|
showModelThis(val) {
|
|
@@ -145,9 +145,11 @@ export default {
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
- itemidChange(e) {
|
|
|
- this.ruleForm.itemid = e;
|
|
|
- this.$refs.ruleForm.validateField("itemid");
|
|
|
+
|
|
|
+ phoneErr(e) {
|
|
|
+ if (!e) {
|
|
|
+ this.$refs.ruleForm.validateField("mobile");
|
|
|
+ }
|
|
|
},
|
|
|
async initForm() {
|
|
|
this.loading = true;
|
|
@@ -239,6 +241,7 @@ export default {
|
|
|
username: username || "",
|
|
|
nickname: nickname || "",
|
|
|
mobile: mobile || "",
|
|
|
+ code: "",
|
|
|
};
|
|
|
} else {
|
|
|
this.ruleForm = {
|
|
@@ -247,6 +250,7 @@ export default {
|
|
|
username: "",
|
|
|
nickname: "", // 账号名
|
|
|
mobile: "",
|
|
|
+ code: "",
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -257,7 +261,7 @@ export default {
|
|
|
if (valid) {
|
|
|
if (!this.loading) {
|
|
|
this.loading = true;
|
|
|
- const { username, nickname, password, mobile, email, id } = JSON.parse(
|
|
|
+ const { username, nickname, password, mobile, email, id,code } = JSON.parse(
|
|
|
JSON.stringify(this.ruleForm)
|
|
|
);
|
|
|
|
|
@@ -268,6 +272,7 @@ export default {
|
|
|
mobile,
|
|
|
email,
|
|
|
id,
|
|
|
+ code
|
|
|
};
|
|
|
|
|
|
let res = {};
|