Commit 21b9a46b by wangzhihui

Merge branch 'SAAS+V4.54.0-0630' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.54.0-0630
2 parents 7b242b35 aec57dd2
...@@ -208,7 +208,7 @@ export default { ...@@ -208,7 +208,7 @@ export default {
type: "select", type: "select",
isClear: true, isClear: true,
optionList: [], optionList: [],
optionId: "adcode", optionId: "code",
optionLabel: "name", optionLabel: "name",
optionsName: "provinceInfoList", optionsName: "provinceInfoList",
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
...@@ -216,7 +216,7 @@ export default { ...@@ -216,7 +216,7 @@ export default {
this.baseData.cityList = [] this.baseData.cityList = []
this.getOptionsList() this.getOptionsList()
if (value) { if (value) {
const params = { districtName: this.baseData.provinceInfoList.find(item => item.adcode == value).name } const params = { districtName: this.baseData.provinceInfoList.find(item => item.code == value).name }
getDistrictDetail(params).then(res => { getDistrictDetail(params).then(res => {
if (res && res.length) { if (res && res.length) {
this.baseData.cityList = res[0].districts this.baseData.cityList = res[0].districts
...@@ -1002,69 +1002,29 @@ export default { ...@@ -1002,69 +1002,29 @@ export default {
// 省市区 // 省市区
getProvinceList() { getProvinceList() {
var map = new AMap.Map("district", { const params = { districtName: '中国' }
resizeEnable: true getDistrictDetail(params).then(res => {
}) console.log(res)
AMap.plugin(["AMap.DistrictSearch"], () => { if (res && res.length) {
var opts = { this.baseData.provinceInfoList = res[0].districts
subdistrict: 1, // 返回下一级行政区
level: "city", // 查询的范围
showbiz: true // 查询行政级别为 市
}
var districtSearch = new AMap.DistrictSearch(opts)
districtSearch.search("中国", (status, result) => {
this.baseData.provinceInfoList = result.districtList[0].districtList
this.getOptionsList() this.getOptionsList()
// com.getSelect({ }
// id: 'startp',
// name: 'provinceName',
// url: '/area/list',
// // value: 'provinceId',
// data: provinceInfoList,
// value: 'name',
// text: 'name',
// param: {},
// select: function (data) {
// const { value } = data
// if (value) {
// // var province = provinceInfoList.find(item => item.provinceId == value)
// var province = provinceInfoList.find(item => item.name == value)
// cityInfo = province.districtList
// merchantForm.provinceCode = province.adcode
// merchantForm.provinceName = province.name
// $('#addrEl').val('')
// } else {
// cityInfo = []
// merchantForm.provinceCode = ''
// merchantForm.provinceName = ''
// }
// merchantForm.cityCode = ''
// merchantForm.cityName = ''
// com.getSelect({
// id: 'startc',
// name: 'cityName',
// url: '/area/list',
// value: 'name',
// text: 'name',
// data: cityInfo,
// link: 'startp',
// select: function (data) {
// const { value } = data
// if (value) {
// // var city = cityInfo.find(item => item.cityId == value)
// var city = cityInfo.find(item => item.name == value)
// merchantForm.cityCode = city.adcode
// merchantForm.cityName = city.name
// } else {
// merchantForm.cityCode = ''
// merchantForm.cityName = ''
// }
// }
// })
// }
// })
})
}) })
// var map = new AMap.Map("district", {
// resizeEnable: true
// })
// AMap.plugin(["AMap.DistrictSearch"], () => {
// var opts = {
// subdistrict: 1, // 返回下一级行政区
// level: "city", // 查询的范围
// showbiz: true // 查询行政级别为 市
// }
// var districtSearch = new AMap.DistrictSearch(opts)
// districtSearch.search("中国", (status, result) => {
// this.baseData.provinceInfoList = result.districtList[0].districtList
// this.getOptionsList()
// })
// })
}, },
handleSearch() { handleSearch() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!