|
|
@ -88,8 +88,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px" @close="closeUser" class="dialog" :close-on-click-modal="false"> |
|
|
|
<el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px" @close="closeUser" class="dialog" :close-on-click-modal="false"> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px" label-suffix=":" :disabled="isDetail"> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px" label-suffix=":" :disabled="isDetail"> |
|
|
|
<el-form-item prop="account" label="账号"> |
|
|
|
<el-form-item prop="workNumber" label="工号/学号"> |
|
|
|
<el-input v-model="form.account" ref="account" placeholder="请输入账号" @change="accountChange"></el-input> |
|
|
|
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="userName" label="用户姓名"> |
|
|
|
<el-form-item prop="userName" label="用户姓名"> |
|
|
|
<el-input v-model="form.userName" placeholder="请输入姓名"></el-input> |
|
|
|
<el-input v-model="form.userName" placeholder="请输入姓名"></el-input> |
|
|
@ -109,9 +109,6 @@ |
|
|
|
<el-form-item prop="email" label="邮箱"> |
|
|
|
<el-form-item prop="email" label="邮箱"> |
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱" @change="emailChange"></el-input> |
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱" @change="emailChange"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="workNumber" label="工号/学号"> |
|
|
|
|
|
|
|
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
<el-input v-model="form.phone" maxlength="11" @change="phoneChange"></el-input> |
|
|
|
<el-input v-model="form.phone" maxlength="11" @change="phoneChange"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -203,12 +200,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
rules: { |
|
|
|
account: [ |
|
|
|
account: [ |
|
|
|
{ required: true, message: '请输入职工账号', trigger: 'blur' }, |
|
|
|
{ required: true, message: '请输入职工账号', trigger: 'blur' } |
|
|
|
{ |
|
|
|
|
|
|
|
pattern: /^[A-Za-z0-9]+$/, |
|
|
|
|
|
|
|
message: '请输入正确的账号', |
|
|
|
|
|
|
|
trigger: 'blur' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
userName: [ |
|
|
|
userName: [ |
|
|
|
{ required: true, message: '请输入用户姓名', trigger: 'blur' } |
|
|
|
{ required: true, message: '请输入用户姓名', trigger: 'blur' } |
|
|
@ -250,7 +242,6 @@ export default { |
|
|
|
workNumberRepeat: false, |
|
|
|
workNumberRepeat: false, |
|
|
|
phoneRepeat: false, |
|
|
|
phoneRepeat: false, |
|
|
|
emailRepeat: false, |
|
|
|
emailRepeat: false, |
|
|
|
originalAccount: '', |
|
|
|
|
|
|
|
originalWorkNumber: '', |
|
|
|
originalWorkNumber: '', |
|
|
|
originalPhone: '', |
|
|
|
originalPhone: '', |
|
|
|
originalEmail: '', |
|
|
|
originalEmail: '', |
|
|
@ -304,10 +295,11 @@ export default { |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageSize: this.pageSize, |
|
|
|
platformId: Setting.platformId, |
|
|
|
platformId: Setting.platformId, |
|
|
|
roleId: this.role, |
|
|
|
roleId: this.role, |
|
|
|
}).then(res => { |
|
|
|
}).then(({ pageList }) => { |
|
|
|
this.listData = res.pageList.records |
|
|
|
const { records, total } = pageList |
|
|
|
this.total = res.pageList.total |
|
|
|
this.listData = records |
|
|
|
if(!this.listData.length && this.total){ |
|
|
|
this.total = total |
|
|
|
|
|
|
|
if(!records.length && total){ |
|
|
|
this.page-- |
|
|
|
this.page-- |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
} |
|
|
|
} |
|
|
@ -341,27 +333,23 @@ export default { |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
accountChange(){ |
|
|
|
// 组合账号 |
|
|
|
if(this.form.account && this.form.account !== this.originalAccount){ |
|
|
|
renderAccount() { |
|
|
|
// type: 0:教师端,1:学生端,2:无端 |
|
|
|
const form = this.form |
|
|
|
this.$post(`${this.api.checkAccount}?account=${this.form.account}&type=2&platformId=${Setting.platformId}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => { |
|
|
|
// 平台id-端id-schoolId-workNumber组成账号 |
|
|
|
this.accountRepeat = false |
|
|
|
form.account = `${Setting.platformId}-2-${this.schoolId}-${form.workNumber}` |
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
this.accountRepeat = true |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.accountRepeat = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
workNumberChange(){ |
|
|
|
workNumberChange(){ |
|
|
|
if(this.form.workNumber && this.form.workNumber !== this.originalWorkNumber){ |
|
|
|
if(this.form.workNumber && this.form.workNumber !== this.originalWorkNumber){ |
|
|
|
this.$post(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => { |
|
|
|
this.$post(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => { |
|
|
|
this.workNumberRepeat = false |
|
|
|
this.workNumberRepeat = false |
|
|
|
|
|
|
|
this.renderAccount() |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
this.workNumberRepeat = true |
|
|
|
this.workNumberRepeat = true |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.workNumberRepeat = false |
|
|
|
this.workNumberRepeat = false |
|
|
|
|
|
|
|
this.renderAccount() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
phoneChange(){ |
|
|
|
phoneChange(){ |
|
|
@ -390,7 +378,6 @@ export default { |
|
|
|
this.$refs.form.resetFields() |
|
|
|
this.$refs.form.resetFields() |
|
|
|
this.form.userId = '' |
|
|
|
this.form.userId = '' |
|
|
|
this.form.accountId = '' |
|
|
|
this.form.accountId = '' |
|
|
|
this.originalAccount = '' |
|
|
|
|
|
|
|
this.originalWorkNumber = '' |
|
|
|
this.originalWorkNumber = '' |
|
|
|
this.accountRepeat = false |
|
|
|
this.accountRepeat = false |
|
|
|
this.workNumberRepeat = false |
|
|
|
this.workNumberRepeat = false |
|
|
@ -418,7 +405,6 @@ export default { |
|
|
|
password: '' |
|
|
|
password: '' |
|
|
|
} |
|
|
|
} |
|
|
|
// 先保存该用户的账号工号等信息,判重的时候如果判断到修改的字段跟这里保存的值一样,则不调判重的接口 |
|
|
|
// 先保存该用户的账号工号等信息,判重的时候如果判断到修改的字段跟这里保存的值一样,则不调判重的接口 |
|
|
|
this.originalAccount = data.account |
|
|
|
|
|
|
|
this.originalWorkNumber = data.workNumber |
|
|
|
this.originalWorkNumber = data.workNumber |
|
|
|
this.originalPhone = data.phone |
|
|
|
this.originalPhone = data.phone |
|
|
|
this.originalEmail = data.email |
|
|
|
this.originalEmail = data.email |
|
|
|