bug整改
This commit is contained in:
+66
-34
@@ -5,18 +5,18 @@ layout("/layouts/platform_h5.html"){
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="入会申请" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
|
||||
|
||||
|
||||
<van-form ref="formRef" class="form-container" :show-error-message="false">
|
||||
<van-cell-group title="基础信息" class="form-section">
|
||||
<van-field v-model="formData.loginname" label="工号" readonly></van-field>
|
||||
@@ -110,21 +110,23 @@ layout("/layouts/platform_h5.html"){
|
||||
clearable
|
||||
maxlength="30"
|
||||
></van-field>
|
||||
|
||||
|
||||
<van-field v-model="formData.unitName" label="工作单位" readonly></van-field>
|
||||
<van-field v-model="formData.unionName" label="所属工会" readonly></van-field>
|
||||
<van-field label="所属校区" v-model="formData.campus" readonly clickable
|
||||
@click="showCampusPicker = true" placeholder="请选择所属校区">
|
||||
</van-field>
|
||||
<van-popup v-model="showCampusPicker" position="bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
:columns="campusColumns"
|
||||
@confirm="(v)=>{formData.campus = v;showCampusPicker = false}"
|
||||
@cancel="showCampusPicker = false"
|
||||
></van-picker>
|
||||
|
||||
<van-field
|
||||
v-model="formData.campusName"
|
||||
name="campusName"
|
||||
label="所属校区"
|
||||
readonly
|
||||
placeholder="请选择所属校区"
|
||||
@click="showCampusPicker = true"
|
||||
clickable
|
||||
></van-field>
|
||||
<van-popup position="bottom" round v-model:show="showCampusPicker">
|
||||
<van-picker :columns="campusColumns" @cancel="showCampusPicker = false" @confirm="onCampusColumns" show-toolbar></van-picker>
|
||||
</van-popup>
|
||||
|
||||
|
||||
<van-field
|
||||
v-model="formData.userState"
|
||||
name="userState"
|
||||
@@ -169,7 +171,7 @@ layout("/layouts/platform_h5.html"){
|
||||
maxlength="25"
|
||||
></van-field>
|
||||
</van-cell-group>
|
||||
|
||||
|
||||
<van-cell-group title="家庭信息" class="form-section up_down">
|
||||
<div class="van-cell">
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
@@ -212,11 +214,11 @@ layout("/layouts/platform_h5.html"){
|
||||
</template>
|
||||
</div>
|
||||
</van-cell-group>
|
||||
|
||||
|
||||
<van-cell-group title="个人简况" class="form-section">
|
||||
<text-editor v-model="formData.personalData"></text-editor>
|
||||
</van-cell-group>
|
||||
|
||||
|
||||
<van-cell-group title="入会意愿" class="form-section">
|
||||
<van-checkbox style="font-size: 17px;padding: 12px" icon-size="24px"
|
||||
v-model="formData.isVoluntary" shape="square">
|
||||
@@ -261,13 +263,14 @@ layout("/layouts/platform_h5.html"){
|
||||
showAcademicDegreePicker: false,
|
||||
// 校区
|
||||
showCampusPicker: false,
|
||||
campusColumns: [],
|
||||
// 生日
|
||||
showDatePicker: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
historyBack,
|
||||
|
||||
|
||||
onSave() {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
@@ -278,7 +281,7 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$axios.post('/platform/member/apply/submit/save', {data: JSON.stringify(this.formData)}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.success(res.msg)
|
||||
this.$pjaxReplace('/platform/h5/member/apply/mine')
|
||||
this.$pjaxReplace('/platform/member/apply/mine/h5')
|
||||
} else {
|
||||
this.$toast.fail('操作失败')
|
||||
console.log(res.msg)
|
||||
@@ -286,7 +289,7 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
@@ -307,7 +310,7 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
onFinishTask() {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
@@ -329,12 +332,12 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
onDateConfirm(value) {
|
||||
this.formData.birthday = value;
|
||||
this.showDatePicker = false;
|
||||
},
|
||||
|
||||
|
||||
async init() {
|
||||
let user
|
||||
const resp = await $.post('/platform/member/apply/submit/getSelfUserInfo')
|
||||
@@ -347,7 +350,7 @@ layout("/layouts/platform_h5.html"){
|
||||
} else {
|
||||
user = this.$store.state.user
|
||||
}
|
||||
|
||||
|
||||
if (this.id) {
|
||||
const res = await this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id })
|
||||
debugger
|
||||
@@ -381,7 +384,7 @@ layout("/layouts/platform_h5.html"){
|
||||
families,
|
||||
personalData
|
||||
} = user
|
||||
|
||||
|
||||
this.$set(this.formData, "userId", id)
|
||||
this.$set(this.formData, "username", username)
|
||||
this.$set(this.formData, "loginname", loginname)
|
||||
@@ -400,11 +403,26 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$set(this.formData, "unitId", unit ? unit.id : unitId)
|
||||
this.$set(this.formData, "unionName", union ? union.name : unionName)
|
||||
this.$set(this.formData, "unionId", union ? union.id : unionId)
|
||||
|
||||
|
||||
this.$set(this.formData, "mobile", mobile)
|
||||
this.$set(this.formData, "email", email)
|
||||
this.$set(this.formData, "families", families ? families : [])
|
||||
this.$set(this.formData, "personalData", personalData)
|
||||
|
||||
// 处理校区信息
|
||||
if (campus) {
|
||||
this.$set(this.formData, "campus", campus) // 保存校区代码值
|
||||
// 根据校区代码值查找对应的名称
|
||||
if (this.campusColumns && this.campusColumns.length > 0) {
|
||||
const campusItem = this.campusColumns.find(item => item.value === campus)
|
||||
if (campusItem) {
|
||||
this.$set(this.formData, "campusName", campusItem.text)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$set(this.formData, "campus", "")
|
||||
this.$set(this.formData, "campusName", "")
|
||||
}
|
||||
}
|
||||
},
|
||||
toChinesNum(num){
|
||||
@@ -425,7 +443,26 @@ layout("/layouts/platform_h5.html"){
|
||||
noWan = "0" + noWan;
|
||||
}
|
||||
return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
|
||||
}
|
||||
},
|
||||
onCampusColumns(o) {
|
||||
this.$set(this.formData, "campusName", o.text); // 显示名称
|
||||
this.$set(this.formData, "campus", o.value); // 字典值
|
||||
this.showCampusPicker = false;
|
||||
},
|
||||
async initDictOptions() {
|
||||
// 初始化校区字典数据
|
||||
const campusData = await this.$businessTool.getDictOptions('USER_CAMPUS')
|
||||
this.campusColumns = campusData.map(item => {
|
||||
return {value: item.code, text: item.name}
|
||||
})
|
||||
// 初始化完成后,如果已经有用户数据,更新校区显示名称
|
||||
if (this.formData.campus && this.campusColumns.length > 0) {
|
||||
const campusItem = this.campusColumns.find(item => item.value === this.formData.campus)
|
||||
if (campusItem) {
|
||||
this.$set(this.formData, "campusName", campusItem.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
nationColumns(){
|
||||
@@ -452,14 +489,9 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
return []
|
||||
},
|
||||
campusColumns(){
|
||||
if(this.dict && this.dict.type && this.dict.type.USER_CAMPUS){
|
||||
return this.dict.type.USER_CAMPUS.map(v=>v.value)
|
||||
}
|
||||
return []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initDictOptions();
|
||||
this.init()
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user