Commit 92ccbc0e authored by jiacheng.mao's avatar jiacheng.mao

解决用户基本信息,户籍省市区三级联动的问题

parent 2337e79a
'use strict' 'use strict'
module.exports = { module.exports = {
NODE_ENV: '"development"', NODE_ENV: '"production"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV), CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true, debug: true,
isMobilePlatform: true, isMobilePlatform: true,
loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=appadmin&password=" ', loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=appadmin&password=" ',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_DEV&apiName="', basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_UAT&apiName="',
rootPath: '"http://180.104.121.66:8088/r/api"', rootPath: '"http://180.104.121.66:8088/r/api"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"', filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_UAT&apiName=file_view&"',
ocrPath:'"http://180.104.121.66:8088/r/api"', ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_DEV&apiName="', fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="',
appId: '"com.xcmg.app.dev"', appId: '"com.xcmg.app.dev"',
currentVersion: '"3.7.8"' currentVersion: '"4.1.2"'
} }
...@@ -11,5 +11,5 @@ module.exports = { ...@@ -11,5 +11,5 @@ module.exports = {
ocrPath:'"http://www.xcmgfs.com:8087/r/api"', ocrPath:'"http://www.xcmgfs.com:8087/r/api"',
fileUploadSvcPath:'"http://www.xcmgfs.com:8087/r/api/app/fileUploadSvc?sysName=XCMG_PROD&apiName="', fileUploadSvcPath:'"http://www.xcmgfs.com:8087/r/api/app/fileUploadSvc?sysName=XCMG_PROD&apiName="',
appId: '"com.xcmg.app"', appId: '"com.xcmg.app"',
currentVersion: '"0.4.1"' currentVersion: '"0.4.2"'
} }
...@@ -11,5 +11,5 @@ module.exports = { ...@@ -11,5 +11,5 @@ module.exports = {
ocrPath:'"http://180.104.121.66:8088/r/api"', ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="', fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="',
appId: '"com.xcmg.app.dev"', appId: '"com.xcmg.app.dev"',
currentVersion: '"4.0.9"' currentVersion: '"4.1.2"'
} }
...@@ -169,36 +169,36 @@ ...@@ -169,36 +169,36 @@
<div slot="name" class="required">户籍地址省</div> <div slot="name" class="required">户籍地址省</div>
<input <input
slot="content" slot="content"
v-model="baseInfo.register_province_name" v-model="baseInfo.register_province_n"
placeholder="上传身份证自动填充" placeholder="上传身份证自动填充"
type="text" type="text"
readonly readonly
onfocus="this.blur()" onfocus="this.blur()"
@click="selectProvince()" @click="selectRegisterProvince()"
> >
</item> </item>
<item :showArrow="true"> <item :showArrow="true">
<div slot="name" class="required">户籍地址市</div> <div slot="name" class="required">户籍地址市</div>
<input <input
slot="content" slot="content"
v-model="baseInfo.register_city_name" v-model="baseInfo.register_city_n"
placeholder="上传身份证自动填充" placeholder="上传身份证自动填充"
type="text" type="text"
readonly readonly
onfocus="this.blur()" onfocus="this.blur()"
@click="selectCity()" @click="selectRegisterCity()"
> >
</item> </item>
<item :showArrow="true"> <item :showArrow="true">
<div slot="name" class="required">户籍地址区/县</div> <div slot="name" class="required">户籍地址区/县</div>
<input <input
slot="content" slot="content"
v-model="baseInfo.register_district_name" v-model="baseInfo.register_district_n"
placeholder="上传身份证自动填充" placeholder="上传身份证自动填充"
type="text" type="text"
readonly readonly
onfocus="this.blur()" onfocus="this.blur()"
@click="selectDistrict()" @click="selectRegisterDistrict()"
> >
</item> </item>
<item> <item>
...@@ -460,6 +460,9 @@ export default { ...@@ -460,6 +460,9 @@ export default {
bp_type: '', bp_type: '',
}, // 查询出来的第二个角色 }, // 查询出来的第二个角色
multiRoleList: [], // 查询出来的多角色 multiRoleList: [], // 查询出来的多角色
registerProvinceList: [],
registerCityList: [],
registerDistrictList: [],
baseInfo: { baseInfo: {
bp_type_n: '', bp_type_n: '',
academic_background_n: '', academic_background_n: '',
...@@ -478,11 +481,11 @@ export default { ...@@ -478,11 +481,11 @@ export default {
living_address: '', living_address: '',
address_on_resident_booklit: '', address_on_resident_booklit: '',
register_province: '', register_province: '',
register_province_name: '', register_province_n: '',
register_city: '', register_city: '',
register_city_name: '', register_city_n: '',
register_district: '', register_district: '',
register_district_name: '', register_district_n: '',
marital_status: '', marital_status: '',
academic_background: '', academic_background: '',
bp_name_sp: '', bp_name_sp: '',
...@@ -571,6 +574,11 @@ export default { ...@@ -571,6 +574,11 @@ export default {
this.getMarital() this.getMarital()
this.getDrivingLicenseType() this.getDrivingLicenseType()
this.getProvince() this.getProvince()
this.getCity()
this.getDistrict()
this.getRegisterProvince()
this.getRegisterCity()
this.getRegisterDistrict()
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
// 绑定查询入口 // 绑定查询入口
...@@ -611,11 +619,11 @@ export default { ...@@ -611,11 +619,11 @@ export default {
living_address: '', living_address: '',
address_on_resident_booklit: '', address_on_resident_booklit: '',
register_province: '', register_province: '',
register_province_name: '', register_province_n: '',
register_city: '', register_city: '',
register_city_name: '', register_city_n: '',
register_district: '', register_district: '',
register_district_name: '', register_district_n: '',
marital_status: '', marital_status: '',
academic_background: '', academic_background: '',
bp_name_sp: '', bp_name_sp: '',
...@@ -702,11 +710,11 @@ export default { ...@@ -702,11 +710,11 @@ export default {
living_address: '', living_address: '',
address_on_resident_booklit: '', address_on_resident_booklit: '',
register_province: '', register_province: '',
register_province_name: '', register_province_n: '',
register_city: '', register_city: '',
register_city_name: '', register_city_n: '',
register_district: '', register_district: '',
register_district_name: '', register_district_n: '',
marital_status: '', marital_status: '',
academic_background: '', academic_background: '',
bp_name_sp: '', bp_name_sp: '',
...@@ -843,6 +851,10 @@ export default { ...@@ -843,6 +851,10 @@ export default {
vm.addRows(vm.baseInfo.address_on_resident_booklit) vm.addRows(vm.baseInfo.address_on_resident_booklit)
vm.addRowsLive(vm.baseInfo.living_address) vm.addRowsLive(vm.baseInfo.living_address)
// vm.peopleList = res.info.agent_username.split(',') // vm.peopleList = res.info.agent_username.split(',')
vm.getCity()
vm.getDistrict()
vm.getRegisterCity()
vm.getRegisterDistrict()
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
...@@ -1697,70 +1709,40 @@ export default { ...@@ -1697,70 +1709,40 @@ export default {
code: 'bp_type', code: 'bp_type',
object: {}, object: {},
returnItem: function (index, obj) { returnItem: function (index, obj) {
if (e === 'register') { vm.baseInfo.province_id = obj.bp_type
vm.baseInfo.register_province = obj.bp_type vm.baseInfo.province_name = obj.bp_type_n
vm.baseInfo.register_province_name = obj.bp_type_n
} else {
vm.baseInfo.province_id = obj.bp_type
vm.baseInfo.province_name = obj.bp_type_n
}
vm.getCity() vm.getCity()
}, },
}) })
}, },
selectCity (e) { selectCity () {
let vm = this let vm = this
if (e === 'register') { if (vm.baseInfo.province_id === '') {
if (vm.baseInfo.register_province === '') { hlsPopup.showLongCenter('请先选择省份')
hlsPopup.showLongCenter('请先选择省份')
}
} else {
if (vm.baseInfo.province_id === '') {
hlsPopup.showLongCenter('请先选择省份')
}
} }
vm.hlsPopup.selectList({ vm.hlsPopup.selectList({
list: vm.cityList, list: vm.cityList,
code: 'bp_type', code: 'bp_type',
object: {}, object: {},
returnItem: function (index, obj) { returnItem: function (index, obj) {
if (e === 'register') { vm.baseInfo.city_id = obj.bp_type
vm.baseInfo.register_city = obj.bp_type vm.baseInfo.city_name = obj.bp_type_n
vm.baseInfo.register_city_name = obj.bp_type_n
} else {
vm.baseInfo.city_id = obj.bp_type
vm.baseInfo.city_name = obj.bp_type_n
}
vm.getDistrict() vm.getDistrict()
}, },
}) })
}, },
selectDistrict (e) { selectDistrict () {
let vm = this let vm = this
if (e === 'register') { if (vm.baseInfo.city_id === '' || vm.baseInfo.province_id === '') {
if (vm.baseInfo.register_province === '' || vm.baseInfo.register_city === '') { hlsPopup.showLongCenter('请先选择城市')
hlsPopup.showLongCenter('请先选择城市')
}
} else {
if (vm.baseInfo.city_id === '' || vm.baseInfo.province_id === '') {
hlsPopup.showLongCenter('请先选择城市')
}
} }
vm.hlsPopup.selectList({ vm.hlsPopup.selectList({
list: vm.districtList, list: vm.districtList,
code: 'bp_type', code: 'bp_type',
object: {}, object: {},
returnItem: function (index, obj) { returnItem: function (index, obj) {
if (e === 'register') { vm.baseInfo.district_id = obj.bp_type
vm.baseInfo.register_district = obj.bp_type vm.baseInfo.district_name = obj.bp_type_n
vm.baseInfo.register_district_name = obj.bp_type_n
} else {
vm.baseInfo.district_id = obj.bp_type
vm.baseInfo.district_name = obj.bp_type_n
}
}, },
}) })
}, },
...@@ -1784,6 +1766,9 @@ export default { ...@@ -1784,6 +1766,9 @@ export default {
getCity () { getCity () {
let vm = this let vm = this
let url = process.env.basePath + 'fnd_city_query' let url = process.env.basePath + 'fnd_city_query'
if (!vm.baseInfo.province_id) {
return
}
let param = { let param = {
province_id: vm.baseInfo.province_id, province_id: vm.baseInfo.province_id,
} }
...@@ -1803,6 +1788,9 @@ export default { ...@@ -1803,6 +1788,9 @@ export default {
getDistrict () { getDistrict () {
let vm = this let vm = this
let url = process.env.basePath + 'fnd_district_query' let url = process.env.basePath + 'fnd_district_query'
if (!vm.baseInfo.city_id) {
return
}
let param = { let param = {
city_id: vm.baseInfo.city_id, city_id: vm.baseInfo.city_id,
} }
...@@ -1819,6 +1807,111 @@ export default { ...@@ -1819,6 +1807,111 @@ export default {
} }
}) })
}, },
selectRegisterProvince () {
let vm = this
vm.hlsPopup.selectList({
list: vm.registerProvinceList,
code: 'bp_type',
object: {},
returnItem: function (index, obj) {
vm.baseInfo.register_province = obj.bp_type
vm.baseInfo.register_province_n = obj.bp_type_n
vm.getRegisterCity()
},
})
},
selectRegisterCity () {
let vm = this
if (vm.baseInfo.register_province === '') {
hlsPopup.showLongCenter('请先选择省份')
}
vm.hlsPopup.selectList({
list: vm.registerCityList,
code: 'bp_type',
object: {},
returnItem: function (index, obj) {
vm.baseInfo.register_city = obj.bp_type
vm.baseInfo.register_city_n = obj.bp_type_n
vm.getRegisterDistrict()
},
})
},
selectRegisterDistrict () {
let vm = this
if (vm.baseInfo.register_province === '' || vm.baseInfo.register_city === '') {
hlsPopup.showLongCenter('请先选择城市')
}
vm.hlsPopup.selectList({
list: vm.registerDistrictList,
code: 'bp_type',
object: {},
returnItem: function (index, obj) {
vm.baseInfo.register_district = obj.bp_type
vm.baseInfo.register_district_n = obj.bp_type_n
},
})
},
getRegisterProvince () {
let vm = this
let url = process.env.basePath + 'fnd_province_query'
let param = {}
vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.registerProvinceList = res.lists.map(item => {
return {
code: item.province_id,
code_name: item.province_name,
}
})
}
})
},
getRegisterCity () {
let vm = this
let url = process.env.basePath + 'fnd_city_query'
if (!vm.baseInfo.register_province) {
return
}
let param = {
province_id: vm.baseInfo.register_province,
}
// vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.registerCityList = res.lists.map(item => {
return {
code: item.city_id,
code_name: item.city_name,
}
})
}
})
},
getRegisterDistrict () {
let vm = this
let url = process.env.basePath + 'fnd_district_query'
if (!vm.baseInfo.register_city) {
return
}
let param = {
city_id: vm.baseInfo.register_city,
}
// vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.registerDistrictList = res.lists.map(item => {
return {
code: item.district_id,
code_name: item.district_name,
}
})
}
})
},
getMarital () { getMarital () {
let vm = this let vm = this
let url = process.env.basePath + 'bp_marital_status_query' let url = process.env.basePath + 'bp_marital_status_query'
...@@ -1907,7 +2000,7 @@ export default { ...@@ -1907,7 +2000,7 @@ export default {
res.lists.forEach(item => { res.lists.forEach(item => {
if (item.province_code.indexOf(p) !== -1) { if (item.province_code.indexOf(p) !== -1) {
vm.$set(vm.baseInfo, 'register_province', item.province_id) vm.$set(vm.baseInfo, 'register_province', item.province_id)
vm.$set(vm.baseInfo, 'register_province_name', item.province_name) vm.$set(vm.baseInfo, 'register_province_n', item.province_name)
} }
}) })
} }
...@@ -1921,7 +2014,7 @@ export default { ...@@ -1921,7 +2014,7 @@ export default {
suc.lists.forEach(item => { suc.lists.forEach(item => {
if (item.city_code.indexOf(c) !== -1) { if (item.city_code.indexOf(c) !== -1) {
vm.$set(vm.baseInfo, 'register_city', item.city_id) vm.$set(vm.baseInfo, 'register_city', item.city_id)
vm.$set(vm.baseInfo, 'register_city_name', item.city_name) vm.$set(vm.baseInfo, 'register_city_n', item.city_name)
} }
}) })
} }
...@@ -1935,7 +2028,7 @@ export default { ...@@ -1935,7 +2028,7 @@ export default {
suc.lists.forEach(item => { suc.lists.forEach(item => {
if (item.district_code.indexOf(d) !== -1) { if (item.district_code.indexOf(d) !== -1) {
vm.$set(vm.baseInfo, 'register_district', item.district_id) vm.$set(vm.baseInfo, 'register_district', item.district_id)
vm.$set(vm.baseInfo, 'register_district_name', item.district_name) vm.$set(vm.baseInfo, 'register_district_n', item.district_name)
} }
}) })
} }
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><script type=text/javascript src=./static/vuePlatform.js></script><script type=text/javascript src=./static/prototype.js></script><script type=text/javascript src=./cordova.js></script><script type=text/javascript src="http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"></script><title>徐工金服</title><link href=./static/css/app.fb52dd271f35e6cb942abb94eb5f18bb.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.16dc3c74f4e0c838ce1f.js></script><script type=text/javascript src=./static/js/vendor.a2bd9868e7885d7ce8da.js></script><script type=text/javascript src=./static/js/app.279bb6618e94708c8fd3.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><script type=text/javascript src=./static/vuePlatform.js></script><script type=text/javascript src=./static/prototype.js></script><script type=text/javascript src=./cordova.js></script><script type=text/javascript src="http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"></script><title>徐工金服</title><link href=./static/css/app.fb52dd271f35e6cb942abb94eb5f18bb.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.29e8de5cf04e4fe4d693.js></script><script type=text/javascript src=./static/js/vendor.6fb9a8a9e3d7464e35f7.js></script><script type=text/javascript src=./static/js/app.7e7cbcc92f7463151cf8.js></script></body></html>
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment