|
@ -5,28 +5,33 @@ |
|
|
<div class="container px-6 bg-white"> |
|
|
<div class="container px-6 bg-white"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-title text-gray-400">姓名<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<div class="item-title text-gray-400">姓名<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<input class="text-right outline-none" v-model="name" type="text" placeholder="请输入您的姓名" /> |
|
|
<input class="text-right outline-none" :disabled="isApply" v-model="name" type="text" placeholder="请输入您的姓名" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-title text-gray-400">身份证号<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<div class="item-title text-gray-400">身份证号<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<input class="text-right outline-none" v-model="idCard" type="text" placeholder="请输入您的身份证号" /> |
|
|
<input class="text-right outline-none" :disabled="isApply" v-model="idCard" type="text" placeholder="请输入您的身份证号" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-title text-gray-400">年龄</div> |
|
|
<div class="item-title text-gray-400">年龄</div> |
|
|
<input class="text-right outline-none" v-model="age" type="number" placeholder="请输入您的年龄" /> |
|
|
<input class="text-right outline-none" :disabled="isApply" v-model="age" type="number" placeholder="请输入您的年龄" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-title text-gray-400">性别</div> |
|
|
<div class="item-title text-gray-400">性别</div> |
|
|
<a-radio-group :options="plainOptions" :default-value="value" @change="onChange" /> |
|
|
<input v-if="isApply" class="text-right outline-none" disabled v-model="genderName" /> |
|
|
|
|
|
<a-radio-group v-else v-model="gender" @change="onChange"> |
|
|
|
|
|
<a-radio :value="1"> 男 </a-radio> |
|
|
|
|
|
<a-radio :value="0"> 女 </a-radio> |
|
|
|
|
|
</a-radio-group> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-title text-gray-400">身份<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<div class="item-title text-gray-400">身份<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<div class="flex justify-end items-center"> |
|
|
<input v-if="isApply" class="text-right outline-none" disabled v-model="positionName" /> |
|
|
<span class="mr-1 truncate">请选择当前等级</span> |
|
|
<div v-else class="flex justify-end items-center" @click="openMenu(1)"> |
|
|
|
|
|
<span class="mr-1 truncate">{{ positionName }}</span> |
|
|
<a-icon type="right" /> |
|
|
<a-icon type="right" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -37,12 +42,12 @@ |
|
|
<div class="container px-6 bg-white"> |
|
|
<div class="container px-6 bg-white"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-title text-gray-400">地址</div> |
|
|
<div class="item-title text-gray-400">地址</div> |
|
|
<input class="text-right outline-none" v-model="name" type="text" placeholder="请输入您的详细地址" /> |
|
|
<input class="text-right outline-none" :disabled="isApply" v-model="address" type="text" placeholder="请输入您的详细地址" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-title text-gray-400">电话<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<div class="item-title text-gray-400">电话<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<input class="text-right outline-none" v-model="idCard" type="text" placeholder="请输入您的电话" /> |
|
|
<input class="text-right outline-none" :disabled="isApply" v-model="phone" type="text" placeholder="请输入您的电话" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
@ -51,7 +56,8 @@ |
|
|
<div class="container px-6 bg-white"> |
|
|
<div class="container px-6 bg-white"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-box flex justify-between items-center border-b"> |
|
|
<div class="item-title text-gray-400">培训目标<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<div class="item-title text-gray-400">培训目标<span class="text-red-500 ml-1 align-middle">*</span></div> |
|
|
<div class="flex justify-end items-center" @click="openMenu"> |
|
|
<input v-if="isApply" class="text-right outline-none" disabled v-model="targetName" /> |
|
|
|
|
|
<div v-else class="flex justify-end items-center" @click="openMenu(2)"> |
|
|
<span class="mr-1 truncate">{{ targetName }}</span> |
|
|
<span class="mr-1 truncate">{{ targetName }}</span> |
|
|
<a-icon type="right" /> |
|
|
<a-icon type="right" /> |
|
|
</div> |
|
|
</div> |
|
@ -64,7 +70,7 @@ |
|
|
|
|
|
|
|
|
<div class="fixed top-0 bottom-0 left-0 right-0 bg-black bg-opacity-60" v-if="showMenu"> |
|
|
<div class="fixed top-0 bottom-0 left-0 right-0 bg-black bg-opacity-60" v-if="showMenu"> |
|
|
<div class="target-list absolute bottom-0 w-full bg-white"> |
|
|
<div class="target-list absolute bottom-0 w-full bg-white"> |
|
|
<div class="item-box text-center font-semibold border-b">培训目标/当前身份</div> |
|
|
<div class="item-box text-center font-semibold border-b">{{ title }}</div> |
|
|
<div class="list"> |
|
|
<div class="list"> |
|
|
<div class="item-box text-center" v-for="(item, index) in targetList" :key="index" :id="item.id" @click="selectTarget(item)"> |
|
|
<div class="item-box text-center" v-for="(item, index) in targetList" :key="index" :id="item.id" @click="selectTarget(item)"> |
|
|
{{ item.name }} |
|
|
{{ item.name }} |
|
@ -94,8 +100,6 @@ |
|
|
import { mapState, mapMutations } from 'vuex'; |
|
|
import { mapState, mapMutations } from 'vuex'; |
|
|
import { getUserInfo, submitSignUp, getPositionList } from '@/config/api'; |
|
|
import { getUserInfo, submitSignUp, getPositionList } from '@/config/api'; |
|
|
|
|
|
|
|
|
const plainOptions = ['男', '女']; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -103,17 +107,20 @@ export default { |
|
|
name: '', // 姓名 |
|
|
name: '', // 姓名 |
|
|
idCard: '', // 身份证 |
|
|
idCard: '', // 身份证 |
|
|
age: '', // 年龄 |
|
|
age: '', // 年龄 |
|
|
gender: 0, // 性别 |
|
|
gender: -1, // 性别 |
|
|
|
|
|
genderName: '', // 性别 |
|
|
positionId: 0, // 身份 |
|
|
positionId: 0, // 身份 |
|
|
|
|
|
positionName: '请选择当前身份', // 身份 |
|
|
address: '', // 地址 |
|
|
address: '', // 地址 |
|
|
phone: '', // 手机 |
|
|
phone: '', // 手机 |
|
|
targetId: 0, // 目标 |
|
|
targetId: 0, // 目标 |
|
|
targetName: '请选择培训目标', // 目标名称 |
|
|
targetName: '请选择培训目标', // 目标名称 |
|
|
plainOptions, // 单选选项 |
|
|
|
|
|
value: '女', // 单选默认选中 |
|
|
|
|
|
targetList: [], |
|
|
targetList: [], |
|
|
showMenu: false, |
|
|
showMenu: false, |
|
|
isApply: 0, // 是否已经报完名 |
|
|
isApply: 1, // 是否已经报完名 |
|
|
|
|
|
title: '', |
|
|
|
|
|
playerId: '', |
|
|
|
|
|
currType: 1, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -123,33 +130,24 @@ export default { |
|
|
this.timer = setInterval(async () => { |
|
|
this.timer = setInterval(async () => { |
|
|
if (this.projectId) { |
|
|
if (this.projectId) { |
|
|
clearInterval(this.timer); |
|
|
clearInterval(this.timer); |
|
|
await this.setParams(); |
|
|
await this.getUserInfo(); |
|
|
await this.getTargetList(); |
|
|
await this.getTargetList(); |
|
|
|
|
|
|
|
|
// 自动移动到目标位置 |
|
|
|
|
|
// document.querySelector('#scrollTo').scrollIntoView({ |
|
|
|
|
|
// behavior: 'smooth', // 平滑过渡 |
|
|
|
|
|
// block: 'start', // 上边框与视窗顶部平齐。默认值 |
|
|
|
|
|
// }); |
|
|
|
|
|
} |
|
|
} |
|
|
}, 300); |
|
|
}, 300); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
// ...mapMutations('home', ['setStartTime', 'setEndTime', 'setMemberIdList']), |
|
|
|
|
|
|
|
|
|
|
|
onChange(e) { |
|
|
onChange(e) { |
|
|
console.log('radio1 checked', e.target.value); |
|
|
this.gender = e.target.value; |
|
|
this.gender = e.target.value == '男' ? 1 : 0; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async setParams() { |
|
|
|
|
|
const { projectId, startTime, endTime, memberIdList, roleId } = this; |
|
|
|
|
|
const params = { param: { projectId, memberIdList, startTime, endTime, roleId } }; |
|
|
|
|
|
await this.getUserInfo(); |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async openMenu() { |
|
|
async openMenu(type) { |
|
|
|
|
|
this.currType = type; |
|
|
|
|
|
if (type === 1) { |
|
|
|
|
|
this.title = '当前身份'; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.title = '培训目标'; |
|
|
|
|
|
} |
|
|
await this.getTargetList(); |
|
|
await this.getTargetList(); |
|
|
this.showMenu = true; |
|
|
this.showMenu = true; |
|
|
}, |
|
|
}, |
|
@ -163,8 +161,13 @@ export default { |
|
|
*/ |
|
|
*/ |
|
|
selectTarget(item) { |
|
|
selectTarget(item) { |
|
|
this.cancel(); |
|
|
this.cancel(); |
|
|
this.targetId = item.id; |
|
|
if (this.currType == 1) { |
|
|
this.targetName = item.name; |
|
|
this.positionId = item.id; |
|
|
|
|
|
this.positionName = item.name; |
|
|
|
|
|
} else if (this.currType == 2) { |
|
|
|
|
|
this.targetId = item.id; |
|
|
|
|
|
this.targetName = item.name; |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -211,7 +214,7 @@ export default { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!this.targetId === 0) { |
|
|
if (this.targetId === 0) { |
|
|
this.$message.info('请选择培训目标'); |
|
|
this.$message.info('请选择培训目标'); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
@ -223,7 +226,7 @@ export default { |
|
|
idCard: this.idCard, |
|
|
idCard: this.idCard, |
|
|
age: this.age, |
|
|
age: this.age, |
|
|
gender: this.gender, |
|
|
gender: this.gender, |
|
|
position: this.positionId, |
|
|
positionId: this.positionId, |
|
|
address: this.address, |
|
|
address: this.address, |
|
|
phone: this.phone, |
|
|
phone: this.phone, |
|
|
targetId: this.targetId, |
|
|
targetId: this.targetId, |
|
@ -233,7 +236,7 @@ export default { |
|
|
const res = await submitSignUp(params); |
|
|
const res = await submitSignUp(params); |
|
|
const { code, msg, data } = res.data; |
|
|
const { code, msg, data } = res.data; |
|
|
if (code === 200) { |
|
|
if (code === 200) { |
|
|
console.log(data); |
|
|
window.history.back(); |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg || '获取失败'); |
|
|
this.$message.error(msg || '获取失败'); |
|
|
throw msg; |
|
|
throw msg; |
|
@ -251,16 +254,21 @@ export default { |
|
|
const params = { param: { projectId: this.projectId } }; |
|
|
const params = { param: { projectId: this.projectId } }; |
|
|
const res = await getUserInfo(params); |
|
|
const res = await getUserInfo(params); |
|
|
const { code, msg, data } = res.data; |
|
|
const { code, msg, data } = res.data; |
|
|
if (code === 200 && data) { |
|
|
if (code === 200) { |
|
|
this.isApply = 1; |
|
|
if (data) { |
|
|
this.name = data.name; |
|
|
this.isApply = 1; |
|
|
this.idCard = data.idCard; |
|
|
this.name = data.name; |
|
|
this.age = data.age; |
|
|
this.idCard = data.idCard; |
|
|
this.gender = data.gender; |
|
|
this.age = data.age; |
|
|
this.position = data.position; |
|
|
this.genderName = data.gender == 1 ? '男' : '女'; |
|
|
this.address = data.address; |
|
|
this.gender = data.gender; |
|
|
this.phone = data.phone; |
|
|
this.positionName = data.position; |
|
|
this.targetId = data.targetId; |
|
|
this.address = data.address; |
|
|
|
|
|
this.phone = data.phone; |
|
|
|
|
|
this.targetName = data.target; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.isApply = 0; |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg || '获取失败'); |
|
|
this.$message.error(msg || '获取失败'); |
|
|
throw msg; |
|
|
throw msg; |
|
@ -300,6 +308,10 @@ export default { |
|
|
width: calc(100% - 80px); |
|
|
width: calc(100% - 80px); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
input:disabled { |
|
|
|
|
|
background-color: transparent; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
div.flex { |
|
|
div.flex { |
|
|
width: calc(100% - 80px); |
|
|
width: calc(100% - 80px); |
|
|
} |
|
|
} |
|
|