312 lines
14 KiB
HTML
312 lines
14 KiB
HTML
<!--#
|
|
layout("/mobile/platform.html"){
|
|
#-->
|
|
|
|
<div id="app" v-cloak>
|
|
|
|
<van-nav-bar title="会员申请" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar>
|
|
|
|
<van-form ref="form" @submit="doSubmit" validate-trigger="onSubmit"
|
|
class="mt5"
|
|
scroll-to-error
|
|
input-align="right"
|
|
:show-error-message="false">
|
|
<van-cell-group inset>
|
|
<van-field label="姓名" value="${@shiro.getPrincipalProperty('username')}"
|
|
left-icon="contact"
|
|
readonly></van-field>
|
|
<van-field label="性别" v-model="formData.sex" readonly
|
|
@click="sexPicker = true"
|
|
placeholder="请选择性别"
|
|
clickable
|
|
left-icon="ellipsis"></van-field>
|
|
<van-popup v-model="sexPicker" position="bottom">
|
|
<van-picker
|
|
show-toolbar
|
|
:columns="['男','女']"
|
|
@confirm="(val)=>{this.formData.sex = val;sexPicker=false}"
|
|
@cancel="sexPicker = false"
|
|
></van-picker>
|
|
</van-popup>
|
|
|
|
<van-field label="民族" v-model="formData.nation" readonly clickable
|
|
left-icon="bar-chart-o"
|
|
@click="nationPicker = true" placeholder="请选择民族"
|
|
:rules="[{ required:true, message: '请选择民族' }]"></van-field>
|
|
<van-popup v-model="nationPicker" position="bottom">
|
|
<van-picker
|
|
show-toolbar
|
|
:columns="nationColumns"
|
|
@confirm="(v)=>{formData.nation = v;nationPicker = false}"
|
|
@cancel="nationPicker = false"
|
|
></van-picker>
|
|
</van-popup>
|
|
|
|
<van-field label="学历" v-model="formData.education" readonly clickable
|
|
left-icon="coupon-o"
|
|
@click="educationPicker = true" placeholder="请选择学历"
|
|
:rules="[{ required:true, message: '请选择学历' }]"></van-field>
|
|
<van-popup v-model="educationPicker" position="bottom">
|
|
<van-picker
|
|
show-toolbar
|
|
:columns="educationColumns"
|
|
@confirm="(v)=>{formData.education = v;educationPicker = false}"
|
|
@cancel="educationPicker = false"
|
|
></van-picker>
|
|
</van-popup>
|
|
|
|
<van-field label="学位" v-model="formData.academicDegree" readonly clickable
|
|
left-icon="comment-o"
|
|
@click="academicDegreePicker = true" placeholder="请选择学位"
|
|
:rules="[{ required:true, message: '请选择学位' }]"></van-field>
|
|
<van-popup v-model="academicDegreePicker" position="bottom">
|
|
<van-picker
|
|
show-toolbar
|
|
:columns="academicDegreeColumns"
|
|
@confirm="(v)=>{formData.academicDegree = v;academicDegreePicker = false}"
|
|
@cancel="academicDegreePicker = false"
|
|
></van-picker>
|
|
</van-popup>
|
|
|
|
<van-field label="政治面貌" v-model="formData.political" placeholder="请填写政治面貌"
|
|
left-icon="label-o"
|
|
:rules="[{ required:true, message: '请填写政治面貌' }]"></van-field>
|
|
<van-field label="身份证" v-model="formData.idcard" placeholder="请填写身份证号码"
|
|
left-icon="idcard"
|
|
:rules="[{ required:true, message: '请填写身份证号码' }]"></van-field>
|
|
<van-field label="联系电话" v-model="formData.mobile" type="tel" placeholder="请填写联系电话"
|
|
left-icon="phone-o"
|
|
:rules="[{ required:true, message: '请填写联系电话' }]"></van-field>
|
|
</van-cell-group>
|
|
|
|
<van-cell-group inset class="mt10">
|
|
<van-field label="户口所在地" v-model="formData.registeredResidence" placeholder="请填写户口所在地"
|
|
left-icon="wap-home-o"
|
|
:rules="[{ required:true, message: '请填写户口所在地' }]"></van-field>
|
|
<van-field label="现居住地" v-model="formData.homeAddress" placeholder="请填写现居住地"
|
|
left-icon="home-o"
|
|
:rules="[{ required:true, message: '请填写现居住地' }]"></van-field>
|
|
<van-field label="工作单位" value="${@shiro.getPrincipalProperty('unit').getName()}"
|
|
left-icon="cluster-o"
|
|
readonly></van-field>
|
|
<van-field label="职务" v-model="formData.position" placeholder="请填写职务"
|
|
left-icon="debit-pay"
|
|
:rules="[{ required:true, message: '请填写职务' }]"></van-field>
|
|
</van-cell-group>
|
|
|
|
<van-cell-group inset class="mt10 up_down">
|
|
<div class="van-cell">
|
|
<div class="van-cell__title van-field__label" style="display: flex;justify-content: space-between">
|
|
<div style="display: flex;">
|
|
<div class="van-field__left-icon">
|
|
<i class="van-icon van-icon-friends-o"></i>
|
|
</div>
|
|
<div class="van-cell__title van-field__label" style="width: auto">
|
|
<span>家庭主要成员及联系方式</span>
|
|
</div>
|
|
</div>
|
|
|
|
<van-button v-if="family && family.length>0 && family.length<3" style="width: 40px"
|
|
icon="plus" type="primary" round size="mini"
|
|
@click="family.push({})"
|
|
native-type="button"></van-button>
|
|
</div>
|
|
<van-divider></van-divider>
|
|
<template v-if="family && family.length>0">
|
|
<div v-for="o,i in family" class="mt5">
|
|
<div style="font-weight: 700;display: flex;justify-content: space-between">
|
|
<span>成员{{toChinesNum(i+1)}}</span>
|
|
<van-button style="width: 40px"
|
|
icon="minus" type="danger" round size="mini"
|
|
@click="family.splice(i,1)"
|
|
native-type="button"></van-button>
|
|
</div>
|
|
<van-field label="关系" v-model="o.relation" placeholder="请填写与本人关系"
|
|
:rules="[{ required:true, message: '请填写与本人关系' }]"></van-field>
|
|
<van-field label="姓名" v-model="o.name" placeholder="请填写姓名"
|
|
:rules="[{ required:true, message: '请填写姓名' }]"></van-field>
|
|
<van-field label="联系方式" v-model="o.mobile" type="tel" placeholder="请填写联系方式"
|
|
:rules="[{ required:true, message: '请填写联系方式' }]"></van-field>
|
|
</div>
|
|
</template>
|
|
<template v-else>
|
|
<div style="padding: 50px;text-align: center">
|
|
<van-button style="width: 50px"
|
|
icon="plus" type="primary" round size="mini"
|
|
@click="family.push({})"
|
|
native-type="button"></van-button>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
</van-cell-group>
|
|
|
|
<van-cell-group inset class="mt10 up_down">
|
|
<div class="van-cell">
|
|
<div style="display: flex">
|
|
<div class="van-field__left-icon">
|
|
<i class="van-icon van-icon-notes-o"></i>
|
|
</div>
|
|
<div class="van-cell__title van-field__label">
|
|
<span>个人工作简历</span>
|
|
</div>
|
|
</div>
|
|
|
|
<van-divider></van-divider>
|
|
<van-field
|
|
v-model="formData.vita"
|
|
:rules="[{ required:true, message: '请填写个人工作简历' }]"
|
|
style="padding: 0"
|
|
input-align="left"
|
|
autosize
|
|
rows="4"
|
|
autosize
|
|
type="textarea"
|
|
maxlength="200"
|
|
placeholder="请输入个人工作简历"
|
|
show-word-limit
|
|
></van-field>
|
|
</div>
|
|
|
|
</van-cell-group>
|
|
|
|
<van-cell-group inset class="mt10 up_down">
|
|
<div class="van-cell">
|
|
<div style="display: flex">
|
|
<div class="van-field__left-icon">
|
|
<i class="van-icon van-icon-award-o"></i>
|
|
</div>
|
|
<div class="van-cell__title van-field__label">
|
|
<span>特长</span>
|
|
</div>
|
|
</div>
|
|
|
|
<van-divider></van-divider>
|
|
<van-field
|
|
v-model="formData.specialSkill"
|
|
:rules="[{ required:true, message: '请填写个人特长' }]"
|
|
style="padding: 0"
|
|
input-align="left"
|
|
autosize
|
|
rows="4"
|
|
autosize
|
|
type="textarea"
|
|
maxlength="200"
|
|
placeholder="请填写个人特长"
|
|
show-word-limit
|
|
></van-field>
|
|
</div>
|
|
</van-cell-group>
|
|
|
|
<div style="margin: 20px 20px 10px;">
|
|
<van-button native-type="submit" style="border-radius: 10px" block type="info" :color="themeColor">
|
|
提 交
|
|
</van-button>
|
|
</div>
|
|
</van-form>
|
|
|
|
</div>
|
|
<script>
|
|
const political = []
|
|
const vue = new Vue({
|
|
el: '#app',
|
|
mixins: [mobileMixins],
|
|
data() {
|
|
return {
|
|
sexPicker: false,
|
|
applyRecords: [],
|
|
formData: {},
|
|
nationPicker: false,
|
|
educationPicker: false,
|
|
academicDegreePicker: false,
|
|
family: [],
|
|
educationColumns: [
|
|
'博士研究生', '硕士研究生', '本科', '专科', '中专中技', '高中', '初中以下'
|
|
],
|
|
academicDegreeColumns: [
|
|
'学士', '硕士', '博士'
|
|
],
|
|
nationColumns: [],
|
|
memberStatusColumn: {
|
|
MEMBER: 1,
|
|
APPLYING: 2,
|
|
NOTMEBMER: 3,
|
|
},
|
|
memberStatus: null
|
|
}
|
|
},
|
|
methods: {
|
|
async doSubmit() {
|
|
const formData = clone(this.formData)
|
|
formData.family = JSON.stringify(this.family)
|
|
const resp = await $.post("/platform/member/apply/submit/doEdit", formData)
|
|
const data = await $.get("/platform/member/apply/submit/doApply", {memberStates: 1})
|
|
setTimeout(() => {
|
|
this.$toast.success('提交成功');
|
|
setTimeout(() => {
|
|
location.replace('/mobile/index')
|
|
}, 300)
|
|
}, 500)
|
|
},
|
|
addFamily() {
|
|
this.family.push({})
|
|
}
|
|
},
|
|
async created() {
|
|
this.$set(this.formData, "isMember", "${@shiro.getPrincipalProperty('member')}")
|
|
this.$set(this.formData, "sex", "${@shiro.getPrincipalProperty('sex')}")
|
|
this.$set(this.formData, "position", "${@shiro.getPrincipalProperty('position')}")
|
|
this.$set(this.formData, "nation", "${@shiro.getPrincipalProperty('nation')}")
|
|
this.$set(this.formData, "mobile", "${@shiro.getPrincipalProperty('mobile')}")
|
|
this.$set(this.formData, "political", "${@shiro.getPrincipalProperty('political')}")
|
|
this.$set(this.formData, "id", "${@shiro.getPrincipalProperty('id')}")
|
|
this.$set(this.formData, "education", "${@shiro.getPrincipalProperty('education')}")
|
|
this.$set(this.formData, "academicDegree", "${@shiro.getPrincipalProperty('academicDegree')}")
|
|
this.$set(this.formData, "idcard", "${@shiro.getPrincipalProperty('idcard')}")
|
|
this.$set(this.formData, "registeredResidence", "${@shiro.getPrincipalProperty('registeredResidence')}")
|
|
this.$set(this.formData, "homeAddress", "${@shiro.getPrincipalProperty('homeAddress')}")
|
|
this.$set(this.formData, "vita", "${@shiro.getPrincipalProperty('vita')}")
|
|
this.$set(this.formData, "specialSkill", "${@shiro.getPrincipalProperty('specialSkill')}")
|
|
const {data} = await $.get("/mobile/member/getAllNation");
|
|
/* this.nationColumns = data.map(v => {
|
|
return v.mzmc
|
|
}) */
|
|
this.nationColumns = nation
|
|
|
|
const resp = await $.get("/platform/member/apply/submit/unionInfo")
|
|
this.applyRecords = resp.data.records
|
|
if (resp.data.member === 1) {
|
|
this.memberStatus = this.memberStatusColumn.MEMBER
|
|
} else {
|
|
if (resp.data.record != null) {
|
|
this.memberStatus = this.memberStatusColumn.APPLYING
|
|
} else {
|
|
this.memberStatus = this.memberStatusColumn.NOTMEBMER
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
})
|
|
</script>
|
|
<style>
|
|
|
|
.up_down > .van-cell {
|
|
flex-flow: column;
|
|
}
|
|
|
|
.up_down > .van-cell > .van-field__label {
|
|
width: 100%;
|
|
}
|
|
|
|
.van-cell, .van-picker button, .submit .van-button--normal {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.van-divider {
|
|
margin: 10px 0;
|
|
}
|
|
|
|
</style>
|
|
<!--#
|
|
}
|
|
#--> |