Changes Update User
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<label class="label"
|
||||
>{{ isVietnamese ? 'Tên tài khoản' : 'Username' }}<b class="ml-1 has-text-danger">*</b></label
|
||||
>{{ isVietnamese ? 'Tên đăng nhập' : 'Username' }}<b class="ml-1 has-text-danger">*</b></label
|
||||
>
|
||||
<div class="control">
|
||||
<input class="input" type="text" placeholder="" v-model="username" />
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<label class="label"
|
||||
>{{ isVietnamese ? 'Họ và tên' : 'Full name' }}<b class="ml-1 has-text-danger">*</b></label
|
||||
>{{!dealer? isVietnamese ? 'Họ và tên' : 'Full name': isVietnamese ? 'Tên tài khoản' : 'Dealer name' }}<b class="ml-1 has-text-danger">*</b></label
|
||||
>
|
||||
<div class="control">
|
||||
<input class="input" type="text" placeholder="" v-model="fullname" />
|
||||
@@ -209,7 +209,7 @@ export default {
|
||||
} else if (this.username !== this.username.replace(' ', '')) {
|
||||
this.errors.push({ name: 'username', text: 'Tài khoản không được chứa khoảng trắng' });
|
||||
} else if (this.username.length < 5) {
|
||||
this.errors.push({ name: 'fullname', text: 'Tài khoản quá ngắn. Yêu cầu từ 5 kí tự trở nên' });
|
||||
this.errors.push({ name: 'username', text: 'Tài khoản quá ngắn. Yêu cầu từ 5 kí tự trở nên' });
|
||||
}
|
||||
if (this.$empty(this.password)) {
|
||||
this.errors.push({ name: 'password', text: 'Mật khẩu không được bỏ trống' });
|
||||
@@ -276,24 +276,97 @@ export default {
|
||||
} else {
|
||||
//send email
|
||||
if (this.email) {
|
||||
let content = `<p>Xin chào ${this.fullname}, </p>`;
|
||||
content += '<p>Tài khoản đăng nhập của bạn đã được khởi tạo và sẵn sàng sử dụng:</p>';
|
||||
content += `<p>Username: ${this.username}</p>`;
|
||||
content += `<p>Password: ${this.password}</p>`;
|
||||
content += `<p>Đội ngũ Utopia.</p>`;
|
||||
let info = { subject: 'Tài khoản đăng nhập Utopia', to: this.email, sender: 1, content: content };
|
||||
let rs = await this.$insertapi('sendemail', info);
|
||||
let loginUrl = this.$mode === 'dev' ? 'https://dev.biz.utopia.com.vn/' : 'https://biz.utopia.com.vn/';
|
||||
await this.templateEmail(loginUrl);
|
||||
}
|
||||
}
|
||||
if (this.dealer) {
|
||||
let copy = this.$copy(this.row);
|
||||
copy.user = this.user.id;
|
||||
await this.$updaterow('dealer', copy, null, this.pagename);
|
||||
let obj = { user: this.user.id, apps: 11 };
|
||||
await this.$insertapi('userapps', obj, undefined, false);
|
||||
let loginUrl = this.$mode === 'dev' ? 'https://dev.dealer.utopia.com.vn/' : 'https://dealer.utopia.com.vn/';
|
||||
await this.templateEmail(loginUrl);
|
||||
}
|
||||
this.loading = false;
|
||||
this.$dialog('Tạo tài khoản thành công.', 'Thành công', 'Success', 10);
|
||||
this.$emit('close');
|
||||
},
|
||||
async templateEmail(loginUrl) {
|
||||
let content = `
|
||||
<table width="100%" bgcolor="#f4f6f8" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td align="center" style="padding:30px 15px;">
|
||||
<table width="600" cellpadding="0" cellspacing="0" border="0"
|
||||
style="background:#ffffff; font-family:Arial, Helvetica, sans-serif; color:#333333; border-collapse:collapse;">
|
||||
<tr>
|
||||
<td style="padding:30px 25px; font-size:15px; line-height:1.6;">
|
||||
|
||||
<p style="margin:0 0 15px 0;">
|
||||
Xin chào <strong>${this.fullname}</strong>,
|
||||
</p>
|
||||
|
||||
<p style="margin:0 0 15px 0;">
|
||||
Tài khoản đăng nhập của bạn đã được khởi tạo thành công và sẵn sàng sử dụng.
|
||||
</p>
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin:15px 0;">
|
||||
<tr>
|
||||
<td width="120" style="padding:6px 0;"><strong>Username:</strong></td>
|
||||
<td style="padding:6px 0;">${this.username}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:6px 0;"><strong>Password:</strong></td>
|
||||
<td style="padding:6px 0;">${this.password}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellpadding="0" cellspacing="0" border="0" align="center" style="margin:25px auto;">
|
||||
<tr>
|
||||
<td align="center" bgcolor="#2f6fed" style="border-radius:4px;">
|
||||
<a href="${loginUrl}"
|
||||
target="_blank"
|
||||
style="display:inline-block;
|
||||
padding:12px 28px;
|
||||
font-size:15px;
|
||||
color:#ffffff;
|
||||
text-decoration:none;
|
||||
font-weight:bold;">
|
||||
Đăng nhập ngay
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="margin:25px 0 0 0;">
|
||||
Trân trọng,<br/>
|
||||
<strong>Đội ngũ Utopia</strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"
|
||||
style="padding:20px; font-size:12px; color:#777777; border-top:1px solid #eeeeee;">
|
||||
© ${new Date().getFullYear()} Utopia. All rights reserved.<br/>
|
||||
Đây là email tự động, vui lòng không phản hồi email này.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
`;
|
||||
|
||||
let info = {
|
||||
subject: this.dealer
|
||||
? `${this.$mode === 'dev' ? '[DEV] ' : ''}Thông báo khởi tạo tài khoản – Cổng thông tin Đại lý Utopia`
|
||||
: `${this.$mode === 'dev' ? '[DEV] ' : ''}Thông báo khởi tạo tài khoản – Cổng thông tin Chủ đầu tư Utopia`,
|
||||
to: this.email,
|
||||
sender: 1,
|
||||
content: content,
|
||||
};
|
||||
await this.$insertapi('sendemail', info, undefined, false);
|
||||
},
|
||||
|
||||
selected(attr, obj) {
|
||||
this.option = obj;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user