379 lines
18 KiB
HTML
379 lines
18 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
|
|
:rules="[{ required:true, message: '请选择性别' }]"
|
|
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.political" readonly clickable
|
|
left-icon="label-o"
|
|
@click="politicalPicker = true" placeholder="请选择政治面貌"
|
|
:rules="[{ required:true, message: '请选择政治面貌' }]"></van-field>
|
|
<van-popup v-model="politicalPicker" position="bottom">
|
|
<van-picker
|
|
show-toolbar
|
|
:columns="politicalColumns"
|
|
@confirm="(v)=>{formData.political = v;politicalPicker = false}"
|
|
@cancel="politicalPicker = false"
|
|
></van-picker>
|
|
</van-popup>
|
|
|
|
<van-field label="婚否" v-model="formData.marriage" readonly clickable
|
|
left-icon="flower-o"
|
|
@click="marriagePicker = true" placeholder="请选择婚否"
|
|
:rules="[{ required:true, message: '请选择婚否' }]"></van-field>
|
|
<van-popup v-model="marriagePicker" position="bottom">
|
|
<van-picker
|
|
show-toolbar
|
|
:columns="marriageColumns"
|
|
@confirm="(v)=>{formData.marriage = v;marriagePicker = false}"
|
|
@cancel="marriagePicker = false"
|
|
></van-picker>
|
|
</van-popup>
|
|
|
|
<van-field label="身份证" v-model="formData.idcard" placeholder="请填写身份证号码"
|
|
left-icon="idcard"
|
|
:rules="[{ required:true, message: '请填写身份证号码' },{pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号码格式错误'}]"></van-field>
|
|
|
|
<van-field label="联系电话" v-model="formData.mobile" type="tel" placeholder="请填写联系电话"
|
|
left-icon="phone-o"
|
|
:rules="[{ required:true, message: '请填写联系电话' },{pattern: /^1[3456789]\d{9}$/, message: '联系电话格式错误'}]"></van-field>
|
|
|
|
<van-field label="所属单位" v-model="formData.unitname" readonly clickable
|
|
left-icon="flower-o"
|
|
@click="unitPicker = true" placeholder="请选择所属单位"
|
|
:rules="[{ required:true, message: '请选择所属单位' }]"></van-field>
|
|
<van-popup v-model="unitPicker" position="bottom">
|
|
<van-picker
|
|
show-toolbar
|
|
value-key="name"
|
|
:columns="unitColumns"
|
|
@confirm="(v)=>{formData.unitname = v.name;formData.unitid = v.id;unitPicker = false}"
|
|
@cancel="unitPicker = false"
|
|
></van-picker>
|
|
</van-popup>
|
|
|
|
<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="岗位" placeholder="请填写岗位" v-model="formData.jobTitle"
|
|
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 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>
|
|
|
|
<van-cell-group class="mt10" inset>
|
|
<van-field label="签字" required style="flex-flow: column">
|
|
<template #label>
|
|
<div class="mb10">签  字</div>
|
|
</template>
|
|
<template #input>
|
|
<mobile-sign :my_sign.sync="formData.sign" ref="signature"></mobile-sign>
|
|
</template>
|
|
</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="formData.family && formData.family.length>0 && formData.family.length<3" style="width: 40px"
|
|
icon="plus" type="primary" round size="mini"
|
|
@click="formData.family.push({})"
|
|
native-type="button"></van-button>
|
|
</div>
|
|
<van-divider></van-divider>
|
|
<template v-if="formData.family && formData.family.length>0">
|
|
<div v-for="o,i in formData.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="formData.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.unit" type="tel" placeholder="请填写单位"></van-field>
|
|
<van-field label="备注" v-model="o.remark" type="tel" placeholder="请填写备注"></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="formData.family.push({})"
|
|
native-type="button"></van-button>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
</van-cell-group>
|
|
|
|
<div style="margin: 20px 20px 10px;">
|
|
<van-button
|
|
:disabled="!(unionInfo.apply||unionInfo.reApply)"
|
|
native-type="submit" style="border-radius: 10px" block type="info" :color="themeColor">
|
|
<span v-if="unionInfo.apply||unionInfo.reApply">{{unionInfo.reApply?'重新申请':'申请加入'}}</span>
|
|
<span v-else-if="unionInfo.record">{{unionInfo.record.stateName}}</span>
|
|
<span v-else>您已是会员</span>
|
|
</van-button>
|
|
</div>
|
|
</van-form>
|
|
|
|
</div>
|
|
<script>
|
|
const political = []
|
|
const vue = new Vue({
|
|
el: '#app',
|
|
mixins: [mobileMixins],
|
|
data() {
|
|
return {
|
|
unionInfo: {},
|
|
sexPicker: false,
|
|
applyRecords: [],
|
|
formData: {},
|
|
nationPicker: false,
|
|
educationPicker: false,
|
|
academicDegreePicker: false,
|
|
educationColumns: [],
|
|
academicDegreeColumns: [
|
|
'学士', '硕士', '博士'
|
|
],
|
|
nationColumns: [],
|
|
memberStatusColumn: {
|
|
MEMBER: 1,
|
|
APPLYING: 2,
|
|
NOTMEBMER: 3,
|
|
},
|
|
memberStatus: null,
|
|
politicalPicker: false,
|
|
politicalColumns: [],
|
|
marriagePicker: false,
|
|
marriageColumns: [],
|
|
unitPicker: false,
|
|
unitColumns: [],
|
|
}
|
|
},
|
|
components: {
|
|
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
|
|
},
|
|
methods: {
|
|
async doSubmit() {
|
|
this.$refs.signature.submitSign()
|
|
if (this.$refs.signature.checkNull()) {
|
|
vant.Toast('请签字')
|
|
return
|
|
}
|
|
await this.$refs.signature.updateSign()
|
|
const formData = clone(this.formData)
|
|
formData.family = JSON.stringify(this.formData.family)
|
|
const loading = this.$toast.loading({
|
|
message: '数据提交中...',
|
|
forbidClick: true,
|
|
overlay: true,
|
|
duration: 0
|
|
})
|
|
const resp = await $.post("/platform/member/apply/submit/doEdit", formData)
|
|
const data = await $.post("/platform/member/apply/submit/doApply", {
|
|
memberStates: 1,
|
|
sign: formData.sign,
|
|
})
|
|
setTimeout(() => {
|
|
this.$toast.success('提交成功');
|
|
loading.close()
|
|
setTimeout(() => {
|
|
location.replace('/mobile/index')
|
|
}, 300)
|
|
}, 500)
|
|
},
|
|
async getUnionInfo() {
|
|
const resp = await $.get("/platform/member/apply/submit/unionInfo")
|
|
if (resp.code === 0) {
|
|
this.unionInfo = resp.data
|
|
this.formData = resp.data
|
|
this.$set(this.formData, "family", resp.data.family ? JSON.parse(resp.data.family) : [])
|
|
this.formData = resp.data
|
|
} else {
|
|
this.$toast(resp.msg)
|
|
}
|
|
},
|
|
},
|
|
async created() {
|
|
this.$set(this.formData, "isMember", "${@shiro.getPrincipalProperty('member')}")
|
|
if ("${@shiro.getPrincipalProperty('sex')}" === '未知') {
|
|
this.$set(this.formData, "sex", '')
|
|
} else {
|
|
this.$set(this.formData, "sex", "${@shiro.getPrincipalProperty('sex')}")
|
|
}
|
|
this.$set(this.formData, "position", "${@shiro.getPrincipalProperty('position')}")
|
|
this.$set(this.formData, "marriage", "${@shiro.getPrincipalProperty('marriage')}")
|
|
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')}")
|
|
this.$set(this.formData, "jobTitle", "${@shiro.getPrincipalProperty('jobTitle')}")
|
|
this.$set(this.formData, "unitname", "${@shiro.getPrincipalProperty('unit').getName()}")
|
|
this.nationColumns = nation
|
|
|
|
const education = await getDictByCode('Education')
|
|
this.educationColumns = education.map(o => o.code)
|
|
const political = await getDictByCode('political')
|
|
this.politicalColumns = political.map(o => o.code)
|
|
const marriage = await getDictByCode('maritalStatus')
|
|
this.marriageColumns = marriage.map(o => o.code)
|
|
|
|
this.unitColumns = await getUnionUnits()
|
|
|
|
await this.getUnionInfo()
|
|
}
|
|
})
|
|
</script>
|
|
<style>
|
|
|
|
.up_down > .van-cell {
|
|
flex-flow: column;
|
|
}
|
|
|
|
.up_down > .van-cell > .van-field__label {
|
|
width: 100%;
|
|
}
|
|
|
|
.van-divider {
|
|
margin: 10px 0;
|
|
}
|
|
|
|
</style>
|
|
<!--#
|
|
}
|
|
#-->
|