|
|
@@ -19,7 +19,7 @@
|
|
|
class="mb20">
|
|
|
<el-step title="登录信息"></el-step>
|
|
|
<el-step title="个人信息"></el-step>
|
|
|
- <!-- <el-step title="其它信息"></el-step> -->
|
|
|
+ <el-step title="项目信息" v-if="form.registerType == '20'"></el-step>
|
|
|
</el-steps>
|
|
|
<el-form ref="loginInfoRef"
|
|
|
size="mini"
|
|
|
@@ -153,16 +153,43 @@
|
|
|
end-placeholder="结束日期" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <el-form ref="projectInfoRef"
|
|
|
+ size="mini"
|
|
|
+ v-show="active == 2"
|
|
|
+ :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="80px">
|
|
|
+ <el-form-item label="项目"
|
|
|
+ prop="projectList">
|
|
|
+ <template #label>
|
|
|
+ 项目
|
|
|
+ <el-button type="text" icon="el-icon-plus" @click="addProject"></el-button>
|
|
|
+ </template>
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item, index) in form.projectList" :key="index" class="flex project-item mb4">
|
|
|
+ <el-input v-model="item.projectName" size="mini" placeholder="项目名称" class="mr4"></el-input>
|
|
|
+ <el-select v-model="item.projectType" size="mini" placeholder="项目类型" class="mr4">
|
|
|
+ <el-option v-for="item in pjtTypeList"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue" />
|
|
|
+ </el-select>
|
|
|
+ <el-input v-model="item.projectSource" size="mini" placeholder="项目来源" class="mr4"></el-input>
|
|
|
+ <el-button type="text" icon="el-icon-delete" @click="delProjectItem(index)"></el-button>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
<div class="buttons">
|
|
|
<el-button size="mini"
|
|
|
v-if="active > 0"
|
|
|
@click="preStep">上一步</el-button>
|
|
|
<el-button size="mini"
|
|
|
- v-if="active < 1"
|
|
|
+ v-if="active < (form.registerType == '10' ? 1 : 2)"
|
|
|
type="primary"
|
|
|
@click="nextStep">下一步</el-button>
|
|
|
<el-button size="mini"
|
|
|
- v-if="active === 1"
|
|
|
+ v-if="(form.registerType == '10' && active === 1) || (form.registerType == '20' && active === 2)"
|
|
|
@click="onRegister"
|
|
|
type="primary">注册</el-button>
|
|
|
</div>
|
|
|
@@ -200,6 +227,17 @@ export default {
|
|
|
};
|
|
|
const checkUnit = (rule, value, callback) => {
|
|
|
|
|
|
+ }
|
|
|
+ const checkProjectList = (rule, value, callback) => {
|
|
|
+ if(!value || !value.length) {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ for(const item of value) {
|
|
|
+ if(!item.projectName || !item.projectType || !item.projectSource) {
|
|
|
+ callback(new Error("请完善项目信息"))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback()
|
|
|
}
|
|
|
return {
|
|
|
active: 0,
|
|
|
@@ -229,7 +267,8 @@ export default {
|
|
|
registerType: '10',
|
|
|
applyPg: {},
|
|
|
projectGroupName: '',
|
|
|
- projectGroupId: null
|
|
|
+ projectGroupId: null,
|
|
|
+ projectList: []
|
|
|
},
|
|
|
rules: {
|
|
|
userName: [
|
|
|
@@ -265,6 +304,9 @@ export default {
|
|
|
projectDate: [
|
|
|
{ required: true, validator: checkDate, trigger: "change" },
|
|
|
],
|
|
|
+ projectList: [
|
|
|
+ { required: true, validator: checkProjectList, trigger: "change" },
|
|
|
+ ],
|
|
|
phone: [{ required: true, message: "请输入手机号", trigger: "blur" }],
|
|
|
email: [{ required: true, message: "请输入邮箱", trigger: "blur" }],
|
|
|
},
|
|
|
@@ -274,6 +316,7 @@ export default {
|
|
|
userCertList: [],
|
|
|
deptData: [],
|
|
|
pjtList: [],
|
|
|
+ pjtTypeList: []
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -287,30 +330,47 @@ export default {
|
|
|
getDictDataByType("sys_user_certificate"),
|
|
|
getDeptTree(),
|
|
|
getProjectGroupList(),
|
|
|
- ]).then(([type, sex, cert, dept, pjt]) => {
|
|
|
+ getDictDataByType("sci_pjt_level")
|
|
|
+ ]).then(([type, sex, cert, dept, pjt, pjtType]) => {
|
|
|
this.userTypeList = type.data.values || [];
|
|
|
this.userSexList = sex.data.values || [];
|
|
|
this.userCertList = cert.data.values || [];
|
|
|
this.deptData = dept.data || [];
|
|
|
this.pjtList = pjt.data.list || [];
|
|
|
+ this.pjtTypeList = pjtType.data.values || [];
|
|
|
});
|
|
|
},
|
|
|
changeType(val) {
|
|
|
this.form.registerType = val;
|
|
|
+ if(val === '10' && this.active == 2) {
|
|
|
+ this.active = 1
|
|
|
+ }
|
|
|
},
|
|
|
// 部门选择
|
|
|
deptChange() {
|
|
|
const nodes = this.$refs.casc.getCheckedNodes();
|
|
|
this.form.deptName = nodes[0].label;
|
|
|
},
|
|
|
+ addProject() {
|
|
|
+ this.form.projectList.push({
|
|
|
+ projectName: '',
|
|
|
+ projectType: '',
|
|
|
+ projectSource: '',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ delProjectItem(idx) {
|
|
|
+ this.form.projectList.splice(idx, 1)
|
|
|
+ },
|
|
|
preStep() {
|
|
|
this.active--;
|
|
|
},
|
|
|
nextStep() {
|
|
|
- if (this.active < 2) {
|
|
|
+ if (this.active < 3) {
|
|
|
let form = "loginInfoRef";
|
|
|
if (this.active == 1) {
|
|
|
form = "personInfoRef";
|
|
|
+ } else if (this.active == 2) {
|
|
|
+ form = "projectInfoRef";
|
|
|
}
|
|
|
this.$refs[form].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
@@ -320,7 +380,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onRegister() {
|
|
|
- this.$refs.personInfoRef.validate(async valid => {
|
|
|
+ const form = this.form.registerType == '10' ? 'personInfoRef' : 'projectInfoRef'
|
|
|
+ this.$refs[form].validate(async valid => {
|
|
|
if(valid) {
|
|
|
const params = JSON.parse(JSON.stringify(this.form))
|
|
|
params.password = crypto.sm3(params.password);
|
|
|
@@ -369,6 +430,7 @@ a {
|
|
|
.login {
|
|
|
width: 100%;
|
|
|
height: calc(100vh - 116px);
|
|
|
+ overflow: hidden;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
@@ -441,4 +503,7 @@ a {
|
|
|
.el-steps {
|
|
|
justify-content: center;
|
|
|
}
|
|
|
+.project-item > div {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
</style>
|