[fix] 保全:联系方式变更, E-a-04联系方式变更 页逻辑完成, 正在进行mock开发

This commit is contained in:
tian.guangyuan
2020-04-08 18:07:18 +08:00
parent bdaa2e56e6
commit affcb65f36
4 changed files with 86 additions and 77 deletions

View File

@@ -0,0 +1,10 @@
import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url'
export function edorChange(data) {
return request({
url: getUrl('/edor/item/change', 0),
method: 'post',
data
})
}

4
src/config/preserve.js Normal file
View File

@@ -0,0 +1,4 @@
// 保全
export default {
'/edor/item/change': 'https://mockapi.eolinker.com/ScCp8u6b1d5781111d84f7b3fe45a0852e59758cd7a87e5/edor/item/change',
}

View File

@@ -11,6 +11,8 @@ import product from './product'
import serve from './serve'
import common from './common'
import survey from './survey'
import preserve from './preserve'
const mockBaseUrl = 'http://rap2api.taobao.org/app/mock'
let baseObj = {
@@ -18,6 +20,6 @@ let baseObj = {
'/user/info': mockBaseUrl + '/223948/info',
'/user/logout': mockBaseUrl + '/223948/logout'
}
Object.assign(baseObj, proposal, sale, customer, my, product, serve, common, survey)
Object.assign(baseObj, proposal, sale, customer, my, product, serve, common, survey, preserve)
export default baseObj

View File

@@ -4,9 +4,9 @@
<!-- 基本信息 -->
<van-cell-group class="mt10">
<p style="border-bottom: 1px solid #ebedf0;" class="fs15 fwb pl10 pv12">基本信息</p>
<van-field label="姓名" required :value="basicInfo.customerName" readonly />
<van-field label="姓名" required :value="customerInfo.customerName" readonly />
<van-field
v-model="basicInfo.customerMobile"
v-model="customerInfo.customerMobile"
clearable
required
label="移动电话"
@@ -26,16 +26,21 @@
v-validate="'required'"
@click="homeShow = true"
/>
<van-field v-model="basicInfo.homeAddress" label="" name="详细地址" placeholder="请输入详细地址" v-validate="'required'" clearable maxlength="30" />
<van-field v-model="basicInfo.homeZip" label="邮编" required name="邮编" placeholder="请输入" v-validate="'required|zipCode'" maxlength="6" clearable />
<van-field v-model="basicInfo.customerEmail" label="电子邮箱" name="电子邮箱" placeholder="非必填" v-validate="'email'" clearable />
<van-field v-model="basicInfo.homePhone" label="固定电话" name="固定电话" placeholder="非必填" maxlength="13" clearable />
<van-field v-model="customerInfo.address" label="" name="详细地址" placeholder="请输入详细地址" v-validate="'required'" clearable maxlength="30" />
<van-field
v-model="customerInfo.homeZip"
label="邮编"
required
name="邮编"
placeholder="请输入"
v-validate="'required|zipCode'"
maxlength="6"
clearable
/>
<van-field v-model="customerInfo.customerEmail" label="电子邮箱" name="电子邮箱" placeholder="非必填" v-validate="'email'" clearable />
<van-field v-model="customerInfo.homePhone" label="固定电话" name="固定电话" placeholder="非必填" maxlength="13" clearable />
</van-cell-group>
<div class="bottom-btn bg-white"><van-button type="danger" size="large" @click="nextStep" v-no-more-click="2000">下一步</van-button></div>
<!-- 家庭地址选择 -->
<van-popup v-model="homeShow" position="bottom">
<van-area :area-list="areaList" value="110101" @confirm="sureArea($event)" @cancel="homeShow = false" />
@@ -44,7 +49,8 @@
</template>
<script>
import { Field, CellGroup, Checkbox, Popup, Picker, Area, RadioGroup, Radio } from 'vant'
import { Field, CellGroup, Popup, Picker, Area } from 'vant'
import { edorChange } from '@/api/ebiz/preserve/preserve'
import areaList from '@/assets/js/utils/area'
import getAreaName from '@/assets/js/utils/get-area-name'
export default {
@@ -52,53 +58,45 @@ export default {
components: {
[Field.name]: Field,
[CellGroup.name]: CellGroup,
[Checkbox.name]: Checkbox,
[Popup.name]: Popup,
[Picker.name]: Picker,
[Area.name]: Area,
[RadioGroup.name]: RadioGroup,
[Radio.name]: Radio
[Area.name]: Area
},
data() {
return {
areaList,
homeName: '',
homeShow: false,
basicInfo: {
customerName: '',
customerSex: '',
customerBirthday: '',
idType: '1',
idNo: '',
isEndDate: '', // 证件截止日期
isLongId: '1', // 长期
customerMobile: '', // 移动电话
customerEmail: '', // 电子邮箱
customerNo: '',
companyAddress: '', // 单位详细地址
companyProvince: '',
companyCity: '',
companyArea: '',
companyZip: '',
companyPhone: '',
homeAddress: '', // 家庭详细地址
homeProvince: '',
homeCity: '',
homeArea: '',
homeZip: '',
homePhone: '',
nationality: '', //国籍
jobname: '', //职业类别
jobcode: '', //职业编码
addressStatus: '0', // 设为联系地址
address: '', // 联系详细地址
let feachData = {
surrenderDTOList: [
{
surrenderId: '',
edorapplyNo: '',
surrenderType: '1',
customerInfoDTOList: []
}
]
},
customerInfo = {
surrenderId: '',
customerNo: '客户号',
customerType: '客户类型',
customerName: '客户姓名',
idType: '证件类型',
idNo: '证件号码',
customerMobile: '客户手机号',
customerEmail: '客户邮箱',
province: '',
city: '',
area: '',
zipCode: '',
telephone: ''
},
customerInfo: {}
address: '详细地址',
homeZip: '邮编',
homePhone: '固定电话',
isNewInfo: '是否变更后信息'
}
feachData.surrenderDTOList[0].customerInfoDTOList.push(customerInfo)
return {
homeName: '',
homeShow: false,
areaList,
feachData,
customerInfo
}
},
created() {
@@ -114,14 +112,9 @@ export default {
if (localStorage.customerInfo) {
this.customerInfo = JSON.parse(localStorage.customerInfo)
}
for (var key in this.basicInfo) {
if (this.customerInfo[key]) {
this.basicInfo[key] = this.customerInfo[key]
}
}
//家庭地址
if (this.basicInfo.homeProvince && this.basicInfo.homeCity && this.basicInfo.homeArea) {
this.homeName = getAreaName([{ code: this.basicInfo.homeProvince }, { code: this.basicInfo.homeCity }, { code: this.basicInfo.homeArea }])
//地址
if (this.customerInfo.province && this.customerInfo.city && this.customerInfo.area) {
this.homeName = getAreaName([{ code: this.customerInfo.province }, { code: this.customerInfo.city }, { code: this.customerInfo.area }])
}
})
},
@@ -129,7 +122,7 @@ export default {
//区域选择
sureArea(area) {
this.homeName = getAreaName(area)
;[this.basicInfo.homeProvince, this.basicInfo.homeCity, this.basicInfo.homeArea] = [area[0].code, area[1].code, area[2].code]
;[this.customerInfo.province, this.customerInfo.city, this.customerInfo.area] = [area[0].code, area[1].code, area[2].code]
this.homeShow = false
},
// 下一步
@@ -137,17 +130,23 @@ export default {
//表单校验
this.$validator.validate().then(valid => {
if (true == valid) {
// if (res.result == 0) {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/preserve/HandleResult'
},
routerInfo: '/preserve/HandleResult'
edorChange(this.feachData)
.then( res => {
if (res.result == 0) {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/preserve/HandleResult'
},
routerInfo: '/preserve/HandleResult'
})
} else {
this.$toast(res.resultMessage)
}
})
.catch( err => {
console.log(err);
})
// } else {
// this.$toast(res.resultMessage)
// }
} else {
this.$toast(this.$validator.errors.all()[0])
return
@@ -160,11 +159,5 @@ export default {
<style lang="scss" scoped>
.basic-info-container {
/deep/.van-checkbox {
margin-left: auto;
}
/deep/.van-radio {
margin-left: auto;
}
}
</style>