|
@@ -3,7 +3,7 @@
|
|
|
* @Author: 空白格
|
|
|
* @Date: 2022-08-17 11:30:23
|
|
|
* @LastEditors: gcz
|
|
|
- * @LastEditTime: 2022-08-18 18:01:04
|
|
|
+ * @LastEditTime: 2022-08-19 16:00:55
|
|
|
* @FilePath: \veterans_client_web\src\views\PersonalCenter\ApplyEducationAuth\ApplyEducationAuthIndex.vue
|
|
|
* @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
|
|
|
-->
|
|
@@ -58,29 +58,30 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="户籍类别" prop="houseTypeId">
|
|
|
- <el-radio-group v-model="form.houseTypeId">
|
|
|
+ <el-radio-group v-model="form.houseTypeId" @change="houseTypeChange">
|
|
|
<el-radio
|
|
|
v-for="(item, index) in houseTypeList"
|
|
|
- :label="item.label"
|
|
|
+ :label="item.text"
|
|
|
:key="index"
|
|
|
>
|
|
|
+ {{item.label}}
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="户籍地" prop="veteHousehRegi">
|
|
|
+ <el-form-item label="户籍地" prop="veteHousehRegiCode">
|
|
|
<el-cascader
|
|
|
filterable
|
|
|
size="large"
|
|
|
ref="addressSelect"
|
|
|
:options="addressOptions"
|
|
|
- v-model="form.veteHousehRegi"
|
|
|
+ v-model="form.veteHousehRegiCode"
|
|
|
:leafOnly="true"
|
|
|
@change="regiAddrChange"
|
|
|
>
|
|
|
</el-cascader>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="文化程度" prop="degrEduc">
|
|
|
- <el-select v-model="form.degrEduc" placeholder="请选择您的文化程度">
|
|
|
+ <el-select @change="degrEducChange" v-model="form.degrEduc" placeholder="请选择您的文化程度">
|
|
|
<el-option
|
|
|
v-for="item in degrEducList"
|
|
|
:key="item.index"
|
|
@@ -91,6 +92,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="政治面貌" prop="politOutlook">
|
|
|
<el-select
|
|
|
+ @change="politOutlookChange"
|
|
|
v-model="form.politOutlook"
|
|
|
placeholder="请选择您的政治面貌"
|
|
|
>
|
|
@@ -106,14 +108,16 @@
|
|
|
<el-radio-group v-model="form.jobStatus">
|
|
|
<el-radio
|
|
|
v-for="(item, index) in employmentStatusList"
|
|
|
- :label="item.label"
|
|
|
+ :label="item.text"
|
|
|
:key="index"
|
|
|
>
|
|
|
+ {{item.label}}
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="薪资范围" prop="salaryRangeName">
|
|
|
<el-select
|
|
|
+ @change="salaryRangeChange"
|
|
|
v-model="form.salaryRangeName"
|
|
|
placeholder="请选择您的薪资范围"
|
|
|
>
|
|
@@ -142,9 +146,10 @@
|
|
|
class="uploader file-uploader"
|
|
|
:action="action"
|
|
|
:show-file-list="false"
|
|
|
+ :file-list="fileList"
|
|
|
:on-success="fileUploadSuccess"
|
|
|
accept="image/*"
|
|
|
- :limit="1"
|
|
|
+ :limit="2"
|
|
|
list-type="picture"
|
|
|
>
|
|
|
<img v-if="fileTempImg" :src="fileTempImg" class="uploader-img" />
|
|
@@ -164,16 +169,20 @@
|
|
|
<script>
|
|
|
import { getDictData } from "@/api/Dict";
|
|
|
import { getIdInfo } from "@/api/PersonalCenter";
|
|
|
+import { veteEduc,getVeteEducData } from "@/api/ApplyEducationAuth";
|
|
|
// https://github.com/Plortinus/element-china-area-data
|
|
|
-import { regionDataPlus,regionData, CodeToText } from "element-china-area-data";
|
|
|
-// import { mapState } from "vuex";
|
|
|
+import { regionDataPlus,regionData, CodeToText,TextToCode } from "element-china-area-data";
|
|
|
+import { mapState } from "vuex";
|
|
|
export default {
|
|
|
name: "ApplyEducationAuthIndex",
|
|
|
data() {
|
|
|
return {
|
|
|
// 上传地址
|
|
|
action: process.env.VUE_APP_BASE_API+'/file/upload/single/minio',
|
|
|
+ // action: process.env.VUE_APP_UPLOAD_URL,
|
|
|
+ // action:'http://api.veterans.hongweisoft.com/file/upload/single/minio',
|
|
|
addressOptions: regionData,
|
|
|
+ fileList:[],
|
|
|
form: {
|
|
|
veteName: "",
|
|
|
veteIdCard: "",
|
|
@@ -188,7 +197,8 @@ export default {
|
|
|
politOutlook: "",
|
|
|
politOutlookId: "",
|
|
|
veteHousehRegi: "",
|
|
|
- veteHousehArea: "",
|
|
|
+ veteHousehRegiCode: ['520000'],
|
|
|
+ veteHousehArea: ['520000'],
|
|
|
veteResiAddress: "",
|
|
|
veteDateBirth: "",
|
|
|
veteStatus: "1",
|
|
@@ -282,6 +292,13 @@ export default {
|
|
|
trigger: ["change", "blur"],
|
|
|
},
|
|
|
],
|
|
|
+ veteHousehRegiCode: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择户籍地",
|
|
|
+ trigger: ["change", "blur"],
|
|
|
+ },
|
|
|
+ ],
|
|
|
// salaryRangeName: [
|
|
|
// {
|
|
|
// required: true,
|
|
@@ -324,9 +341,9 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- // ...mapState({
|
|
|
- // userInfo: (state) => state.user.userInfo,
|
|
|
- // }),
|
|
|
+ ...mapState({
|
|
|
+ userInfo: (state) => state.user.userInfo,
|
|
|
+ }),
|
|
|
fileTempImg() {
|
|
|
// console.log('this.form.files',this.form.files);
|
|
|
if (this.form.files.length >= 1) {
|
|
@@ -337,22 +354,22 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
- // this.form.vetePhone = this.vuex_user.mobile;
|
|
|
- // console.log('this.userInfo',this);
|
|
|
- // console.log('this.userInfo',this.userInfo.name);
|
|
|
this.getVeteDegrEduc();
|
|
|
this.getVetePolitOutlook();
|
|
|
this.getVeteHouseType();
|
|
|
this.getSalaryRange();
|
|
|
this.getEmploymentStatus();
|
|
|
- // this.getVeteEducData();
|
|
|
+ this.getVeteEducData();
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
* 获取已经提交的数据
|
|
|
*/
|
|
|
getVeteEducData() {
|
|
|
- this.$u.api.getVeteEducData().then((res) => {
|
|
|
+ getVeteEducData().then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
const data = res.data;
|
|
|
for (let key in data.veteEduc) {
|
|
@@ -382,17 +399,25 @@ export default {
|
|
|
});
|
|
|
// 户籍区域
|
|
|
if (
|
|
|
- data.veteEduc.provinceName &&
|
|
|
- data.veteEduc.cityName &&
|
|
|
- data.veteEduc.areaName
|
|
|
+ data.veteEduc.provinceId &&
|
|
|
+ data.veteEduc.cityId &&
|
|
|
+ data.veteEduc.areaId
|
|
|
) {
|
|
|
this.form.veteHousehArea =
|
|
|
- data.veteEduc.provinceName +
|
|
|
- "-" +
|
|
|
- data.veteEduc.cityName +
|
|
|
- "-" +
|
|
|
- data.veteEduc.areaName;
|
|
|
+ [
|
|
|
+ data.veteEduc.provinceId.toString(),
|
|
|
+ data.veteEduc.cityId.toString(),
|
|
|
+ data.veteEduc.areaId.toString()
|
|
|
+ ];
|
|
|
+ this.form.veteHousehRegiCode = [
|
|
|
+ data.veteEduc.provinceId.toString(),
|
|
|
+ data.veteEduc.cityId.toString(),
|
|
|
+ data.veteEduc.areaId.toString()
|
|
|
+ ]
|
|
|
+ console.log('this.form',JSON.parse(JSON.stringify(this.form)));
|
|
|
}
|
|
|
+ console.log('employmentStatusList',this.employmentStatusList);
|
|
|
+ console.log('houseTypeList',this.houseTypeList);
|
|
|
// 薪资范围
|
|
|
this.form.salaryRange = data.veteEduc.salaryRange;
|
|
|
this.salaryRangeList.forEach((item, index) => {
|
|
@@ -529,20 +554,23 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
addrChange(value) {
|
|
|
- this.provinceName = value[0];
|
|
|
- this.cityName = value[1];
|
|
|
- this.areaName = value[2];
|
|
|
- // this.form.veteHousehArea = CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
|
|
|
+ this.form.provinceId =value[0];
|
|
|
+ this.form.cityId = value[1];
|
|
|
+ this.form.areaId = value[2];
|
|
|
+ this.form.provinceName = CodeToText[value[0]];
|
|
|
+ this.form.cityName = CodeToText[value[1]];
|
|
|
+ this.form.areaName = CodeToText[value[2]];
|
|
|
+ this.form.veteResiAddress = CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
|
|
|
// console.log(
|
|
|
// CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]],
|
|
|
// "选中地址"
|
|
|
// );
|
|
|
+ console.log("this.provinceName", this.provinceName);
|
|
|
console.log("addrChange", value);
|
|
|
// console.log("this.form.veteHousehArea", this.form.veteHousehArea);
|
|
|
},
|
|
|
regiAddrChange(value) {
|
|
|
- this.form.veteHousehRegi =
|
|
|
- CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
|
|
|
+ this.form.veteHousehRegi = `${CodeToText[value[0]]}-${CodeToText[value[1]]}-${CodeToText[value[2]]}`;
|
|
|
console.log(
|
|
|
CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]],
|
|
|
"选中地址"
|
|
@@ -552,6 +580,7 @@ export default {
|
|
|
},
|
|
|
submit() {
|
|
|
console.log('this.form',JSON.parse(JSON.stringify(this.form)));
|
|
|
+ this.form.vetePhone = this.userInfo.mobile;
|
|
|
this.$refs['form'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.files.length < 1) {
|
|
@@ -570,7 +599,7 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
params.veteEduc.veteSex = params.veteEduc.veteSex === '男' ? 0 : 1;
|
|
|
- this.$u.api.veteEduc(params).then(res => {
|
|
|
+ veteEduc(params).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({
|
|
|
message: '提交成功,等待审核!',
|
|
@@ -593,6 +622,56 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ houseTypeChange(e){
|
|
|
+ for (let index = 0; index < this.houseTypeList.length; index++) {
|
|
|
+ const item = this.houseTypeList[index];
|
|
|
+ if(item.text == e){
|
|
|
+ console.log('this.form',this.form);
|
|
|
+ this.form.houseType = this.houseTypeList[index].label;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // jobStatusChange(e){
|
|
|
+ // for (let index = 0; index < this.employmentStatusList.length; index++) {
|
|
|
+ // const item = this.employmentStatusList[index];
|
|
|
+ // if(item.text == e){
|
|
|
+ // console.log('this.form',this.form);
|
|
|
+ // this.form.jobStatus = this.employmentStatusList[index].label;
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ degrEducChange(e){
|
|
|
+ for (let index = 0; index < this.degrEducList.length; index++) {
|
|
|
+ const item = this.degrEducList[index];
|
|
|
+ if(item.text == e){
|
|
|
+ this.form.degrEduc = this.degrEducList[index].label;
|
|
|
+ this.form.degrEducId = this.degrEducList[index].value;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ politOutlookChange(e){
|
|
|
+ for (let index = 0; index < this.politOutlookList.length; index++) {
|
|
|
+ const item = this.politOutlookList[index];
|
|
|
+ if(item.text == e){
|
|
|
+ this.form.politOutlook = this.politOutlookList[index].label;
|
|
|
+ this.form.politOutlookId = this.politOutlookList[index].value;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ salaryRangeChange(e){
|
|
|
+ for (let index = 0; index < this.salaryRangeList.length; index++) {
|
|
|
+ const item = this.salaryRangeList[index];
|
|
|
+ if(item.text == e){
|
|
|
+ this.form.salaryRangeName = this.salaryRangeList[index].label;
|
|
|
+ this.form.salaryRange = this.salaryRangeList[index].value;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
resetForm() {
|
|
|
this.$refs['form'].resetFields();
|
|
|
}
|