This commit is contained in:
xulu
2021-09-02 09:15:24 +08:00
parent 0e0fb27136
commit d115bd19dd
9 changed files with 573 additions and 42 deletions

View File

@@ -149,8 +149,8 @@
// 关闭模态框
backGood() {
this.$refs.name_Form.resetFields();
this.$refs.email_Form.resetFields();
this.nameForm.account = ''
this.emailForm.email = ''
this.tableData_name = [];
},
@@ -184,6 +184,12 @@
.then(res => {
if (res.code == 0) {
this.tableData_name = res.data.users;
if (this.tableData_name == '') {
this.$message({
message: 'No Result!',
type: 'warning'
});
}
} else {
this.$message.error(res.msg);
}
@@ -202,67 +208,88 @@
// 用户名匹配
matchSub(index, row) {
this.loading = true;
this.$api
.post('api/Board/relationUser', {
'user_id': row.user_id,
'journal_id': this.query.journal_id,
'jboard_id': this.marchForm.board_id,
})
.then(res => {
if (res.code == 0) {
this.loading = false;
this.$refs.name_Form.resetFields();
this.$refs.email_Form.resetFields();
this.tableData_name = [];
this.$message.success(`Match successful`);
this.marVisible = false;
this.getDate();
} else {
this.loading = false;
this.$message.error(res.msg);
}
})
.catch(err => {
this.loading = false;
this.$message.error(err);
});
this.$refs.name_Form.validate((valid) => {
if (valid) {
this.loading = true;
this.$api
.post('api/Board/relationUser', {
'email': row.email,
'user_id': row.user_id,
'journal_id': this.query.journal_id,
'jboard_id': this.marchForm.board_id,
})
.then(res => {
if (res.code == 0) {
this.loading = false;
// this.$refs.name_Form.resetFields();
// this.$refs.email_Form.resetFields();
this.tableData_name = [];
this.$message.success(`Match successful`);
this.marVisible = false;
this.getDate();
} else {
this.loading = false;
this.$message.error(res.msg);
}
})
.catch(err => {
this.loading = false;
this.$message.error(err);
});
} else {
return false;
}
});
},
// 邮箱匹配
matchMit(emailForm) {
this.$refs.email_Form.validate((valid) => {
if (valid) {
this.loading = true;
this.$api
.post('api/Board/searchUserByEmail', emailForm)
.then(res => {
if (res.code == 0) {
let aco_email = res.data.user_info.user_id
let aco_email = res.data.user.email
let aco_uesid = res.data.user.user_id
this.$api
.post('api/Board/relationUser', {
'email': aco_email,
'user_id': aco_uesid,
'journal_id': this.query.journal_id,
'jboard_id': this.marchForm.board_id,
})
.then(res => {
if (res.code == 0) {
this.$refs.name_Form.resetFields();
this.$refs.email_Form.resetFields();
this.loading = false;
// this.$refs.name_Form.resetFields();
// this.$refs.email_Form.resetFields();
this.tableData_name = [];
this.$message.success(`Match successful`);
this.marVisible = false;
this.getDate();
} else {
this.$message.error(res.msg);
this.loading = false;
this.$message({
message: 'No Result!',
type: 'warning'
});
// this.$message.error(res.msg);
}
})
.catch(err => {
this.loading = false;
this.$message.error(err);
});
} else {
this.loading = false;
this.$message.error(res.msg);
}
})
.catch(err => {
this.loading = false;
this.$message.error(err);
});