Commit b6ff8d26 by huyue

修复编辑省编辑不了的问题

1 parent a82ab81a
...@@ -1170,15 +1170,15 @@ ...@@ -1170,15 +1170,15 @@
cityIdx = merchantForm.cityName cityIdx = merchantForm.cityName
provincecode = merchantForm.cityCode provincecode = merchantForm.cityCode
} }
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] // const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == provinceIdx) // var municipality = municipalities.find(item => item == provinceIdx)
if (municipality) { // if (municipality) {
cityIdx = cityIdx.slice(0, 2) + '城区' // // cityIdx = cityIdx.slice(0, 2) + '城区'
if (municipality === '重庆市') { // if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4) // provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县') // provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县')
} // }
} // }
// 判断省市是否匹配 // 判断省市是否匹配
// if (merchantForm.provinceName) { // if (merchantForm.provinceName) {
// if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) { // if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) {
......
...@@ -1124,15 +1124,15 @@ ...@@ -1124,15 +1124,15 @@
// 获取省市 // 获取省市
var provinceIdx = fullAddress.province var provinceIdx = fullAddress.province
var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] // const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == provinceIdx) // var municipality = municipalities.find(item => item == provinceIdx)
if (municipality) { // if (municipality) {
cityIdx = cityIdx.slice(0, 2) + '城区' // cityIdx = cityIdx.slice(0, 2) + '城区'
if (municipality === '重庆市') { // if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4) // provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县') // provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县')
} // }
} // }
// 判断省市是否匹配 // 判断省市是否匹配
// if (merchantForm.provinceName) { // if (merchantForm.provinceName) {
// if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) { // if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) {
......
...@@ -740,6 +740,7 @@ ...@@ -740,6 +740,7 @@
const external_data = helper.store.get('external').val const external_data = helper.store.get('external').val
// 省市区 // 省市区
getProvinceList() getProvinceList()
var _int = null
// 禁用所有input框的回车事件 // 禁用所有input框的回车事件
var inputs = document.getElementsByTagName('input') var inputs = document.getElementsByTagName('input')
...@@ -1486,15 +1487,15 @@ function clearRoleAuthTabContent() { ...@@ -1486,15 +1487,15 @@ function clearRoleAuthTabContent() {
cityIdx = merchantForm.cityName cityIdx = merchantForm.cityName
provincecode = merchantForm.cityCode provincecode = merchantForm.cityCode
} }
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] // const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == provinceIdx) // var municipality = municipalities.find(item => item == provinceIdx)
if (municipality) { // if (municipality) {
cityIdx = cityIdx.slice(0, 2) + '城区' // cityIdx = cityIdx.slice(0, 2) + '城区'
if (municipality === '重庆市') { // if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4) // provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县') // provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县')
} // }
} // }
// 判断省市是否匹配 // 判断省市是否匹配
if (merchantForm.provinceName) { if (merchantForm.provinceName) {
if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) { if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) {
...@@ -2004,9 +2005,28 @@ loadSuperiorMerchants(currentPage).then(function(list) { ...@@ -2004,9 +2005,28 @@ loadSuperiorMerchants(currentPage).then(function(list) {
} }
}); });
// 省市回显 // 省市回显
if (merchantForm.provinceName) { if (merchantForm.provinceName) {
console.log(provinceInfoList);
if (!provinceInfoList.length) {
_int = setInterval(function() {
if (provinceInfoList.length) showProince()
}, 100)
}
}
if (step == 1) {
getBusiScope()
getCarBrandTree()
getAccountType()
recoveryBusiScopeCus()
recoveryFile()
} else {
getById()
}
})
}
function showProince() {
var province = provinceInfoList.find(item => item.name.indexOf(merchantForm.provinceName) != -1) var province = provinceInfoList.find(item => item.name.indexOf(merchantForm.provinceName) != -1)
merchantForm.provinceName = province.name merchantForm.provinceName = province.name
cityInfo = province.districts cityInfo = province.districts
...@@ -2036,17 +2056,7 @@ loadSuperiorMerchants(currentPage).then(function(list) { ...@@ -2036,17 +2056,7 @@ loadSuperiorMerchants(currentPage).then(function(list) {
$('#startc').val(city.name) $('#startc').val(city.name)
} }
form.render('select') form.render('select')
} clearInterval(_int)
if (step == 1) {
getBusiScope()
getCarBrandTree()
getAccountType()
recoveryBusiScopeCus()
recoveryFile()
} else {
getById()
}
})
} }
...@@ -2301,6 +2311,7 @@ loadSuperiorMerchants(currentPage).then(function(list) { ...@@ -2301,6 +2311,7 @@ loadSuperiorMerchants(currentPage).then(function(list) {
// 省市区 // 省市区
function getProvinceList() { function getProvinceList() {
return new Promise((resolve, reject) => {
var params = { var params = {
keyword: '中国', keyword: '中国',
extensions_code: 1, extensions_code: 1,
...@@ -2319,6 +2330,7 @@ loadSuperiorMerchants(currentPage).then(function(list) { ...@@ -2319,6 +2330,7 @@ loadSuperiorMerchants(currentPage).then(function(list) {
}) })
pro.then(r => { pro.then(r => {
provinceInfoList = JSON.parse(r.data).districts[0].districts provinceInfoList = JSON.parse(r.data).districts[0].districts
resolve(provinceInfoList)
com.getSelect({ com.getSelect({
id: 'startp', id: 'startp',
name: 'provinceName', name: 'provinceName',
...@@ -2369,6 +2381,8 @@ loadSuperiorMerchants(currentPage).then(function(list) { ...@@ -2369,6 +2381,8 @@ loadSuperiorMerchants(currentPage).then(function(list) {
} }
}) })
}) })
})
// var ajax = layui.$.ajax // var ajax = layui.$.ajax
// ajax({ // ajax({
// // url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/glsx-oss-account-config', // // url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/glsx-oss-account-config',
......
...@@ -276,8 +276,11 @@ ...@@ -276,8 +276,11 @@
console.log(res) console.log(res)
if (res) { if (res) {
mapData.merchantAddress = res.surroundingPois.length ? res.surroundingPois[0].address : res.address mapData.merchantAddress = res.surroundingPois.length ? res.surroundingPois[0].address : res.address
modelVal('merchantAddress', mapData.merchantAddress) $('#merchantAddress').val(mapData.merchantAddress)
// modelVal('merchantAddress', mapData.merchantAddress)
mapData.geocoderAddress = res mapData.geocoderAddress = res
mapData.lat = res.point.lat
mapData.lng = res.point.lng
} }
}) })
// geocoder.getAddress(marker.getPosition(), function (status, result) { // geocoder.getAddress(marker.getPosition(), function (status, result) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!