Commit 4b7d3cfc by 前端

Merge branch 'kuangyq_v2.1.1' into 'develop'

Kuangyq v2.1.1

See merge request !22
2 parents 8c4dc39c 6513fa98
......@@ -382,6 +382,7 @@
}
})
treeTab.tabChange('roleAuth', authList[0].accounttypeId)
$(window).resize();
}
}
})
......
......@@ -424,7 +424,7 @@
<div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline" style="position: relative;">
<input class="layui-input" placeholder="车型品牌" id="brand" />
<input class="layui-input" placeholder="请输入品牌/子品牌名称搜索" id="brand" />
<button id="checkCarBrand" type="button" class="layui-btn btn-no-border check-carbrand">全选</button>
<div id="carBrandTree" class="wrapper-tree hide" style="height: 200px; overflow-y: scroll"></div>
<div id="noCarbrand" class="no-car hide">暂无数据</div>
......@@ -640,6 +640,7 @@
var provinceInfoList = []
var cityInfo = []
var addressData = {}
// 省市区
getProvinceList()
// com.getSelect({
......@@ -1054,16 +1055,32 @@
merchantForm.lat = res.lat
merchantForm.lng = res.lng
merchantForm.merchantAddress = res.merchantAddress
var fullAddress = res.geocoderAddress.addressComponent
var fullAddress = ''
var provincecode = ''
if (res.geocoderAddress) {
fullAddress = res.geocoderAddress.addressComponent
provincecode = res.geocoderAddress.adcode
addressData.fullAddress = res.geocoderAddress.addressComponent
addressData.provincecode = res.geocoderAddress.adcode
} else {
fullAddress = addressData.fullAddress
provincecode = addressData.provincecode
}
// 获取省市
var provincecode = res.geocoderAddress.adcode
var provinceIdx = fullAddress.province
var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
var provinceIdx = ''
var cityIdx = ''
if (fullAddress) {
provinceIdx = fullAddress.province
cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
} else {
provinceIdx = merchantForm.provinceName
cityIdx = merchantForm.cityName
provincecode = merchantForm.cityCode
}
const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == provinceIdx)
if (municipality) {
cityIdx = cityIdx.slice(0, 2) + '城区'
console.log(cityIdx);
if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县')
......@@ -1095,7 +1112,6 @@
select: function (data) {
const { value } = data
if (value) {
console.log(cityInfo);
merchantForm.cityName = value
var cityChange = cityInfo.find(item => item.name == value)
merchantForm.cityCode = cityChange.adcode
......@@ -1104,7 +1120,6 @@
}
})
var city = cityInfo.find(item => item.name == cityIdx)
console.log(city);
merchantForm.cityCode = city.adcode
merchantForm.cityName = city.name
$('#startc').val(merchantForm.cityName)
......
......@@ -408,7 +408,7 @@
<div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline" style="position: relative;">
<input class="layui-input" placeholder="车型品牌" id="brand" />
<input class="layui-input" placeholder="请输入品牌/子品牌名称搜索" id="brand" />
<button id="checkCarBrand" type="button" class="layui-btn btn-no-border check-carbrand">全选</button>
<div id="carBrandTree" class="hide" style="height: 200px; overflow-y: scroll"></div>
<div id="noCarbrand" class="no-car hide">暂无数据</div>
......@@ -631,6 +631,7 @@
}
var provinceInfoList = []
var cityInfo = []
var addressData = {}
// 省市区
getProvinceList()
// com.getSelect({
......@@ -1064,9 +1065,18 @@
merchantForm.lat = res.lat
merchantForm.lng = res.lng
merchantForm.merchantAddress = res.merchantAddress
var fullAddress = res.geocoderAddress.addressComponent
var fullAddress = ''
var provincecode = ''
if (res.geocoderAddress) {
fullAddress = res.geocoderAddress.addressComponent
provincecode = res.geocoderAddress.adcode
addressData.fullAddress = res.geocoderAddress.addressComponent
addressData.provincecode = res.geocoderAddress.adcode
} else {
fullAddress = addressData.fullAddress
provincecode = addressData.provincecode
}
// 获取省市
var provincecode = res.geocoderAddress.adcode
var provinceIdx = fullAddress.province
var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
const municipalities = ['北京市', '天津市', '上海市', '重庆市']
......
......@@ -704,6 +704,7 @@
// businessScopeCustomize
if (res.code == '0') {
roleData = helper.clone(true, res.data)
console.log(roleData, '====');
for (var i in basicArr) {
// if (basicArr[i] == 'businessTypeName' && roleData.businessScopeCustomize) {
// roleData.businessTypeName = roleData.businessTypeName ? roleData.businessTypeName + ',' + roleData.businessScopeCustomize : roleData.businessScopeCustomize
......@@ -717,6 +718,12 @@
$('#sapBox').removeClass('hide')
}
roleData.bussinessBegintime ? $('#businessTime').text(roleData.bussinessBegintime + '-' + roleData.bussinessEndtime) : $('#businessTime').text('-')
if (roleData.provinceName) {
roleData.merchantAddress ? $('#merchantAddress').text(roleData.merchantAddress) : $('#merchantAddress').text(roleData.provinceName + ' ' + roleData.cityName)
} else {
$('#merchantAddress').text('-')
}
// roleData.merchantAddress
// var effectiveTimeNameEl = $('#effectiveTimeName')
// if (roleData.merchantAccountLevel == 4) { // 门店
// if (roleData.status == 1 || roleData.status == 5) {
......
......@@ -493,7 +493,7 @@
<div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline" style="position: relative;">
<input class="layui-input" placeholder="车型品牌" id="brand" />
<input class="layui-input" placeholder="请输入品牌/子品牌名称搜索" id="brand" />
<button id="checkCarBrand" type="button"
class="layui-btn btn-no-border check-carbrand">全选</button>
<div id="carBrandTree" class="hide" style="height: 200px; overflow-y: scroll"></div>
......@@ -630,6 +630,7 @@
}
var provinceInfoList = []
var cityInfo = []
var addressData = {}
// 省市区
getProvinceList()
// com.getSelect({
......@@ -944,7 +945,6 @@
if (treeObj) {
let getCheckedNodes = treeObj.getCheckedNodes(true)
const getCheckedKeys = treeObj.getCheckedNodes(true).map(item => item.id)
console.log(getCheckedKeys)
getCheckedNodes = getCheckedNodes.filter(item => item.children)
merchantForm.merchantBrandList = getCheckedNodes.map(car => {
let merchantBrandId = []
......@@ -958,7 +958,6 @@
merchantBrandId
}
})
console.log(merchantForm.merchantBrandList)
params.merchantBrandListJson = JSON.stringify(merchantForm.merchantBrandList)
}
if (merchantForm.merchantFiles.length) {
......@@ -1025,16 +1024,33 @@
merchantForm.lat = res.lat
merchantForm.lng = res.lng
merchantForm.merchantAddress = res.merchantAddress
var fullAddress = res.geocoderAddress.addressComponent
var fullAddress = ''
var provincecode = ''
if (res.geocoderAddress) {
fullAddress = res.geocoderAddress.addressComponent
provincecode = res.geocoderAddress.adcode
addressData.fullAddress = res.geocoderAddress.addressComponent
addressData.provincecode = res.geocoderAddress.adcode
} else {
fullAddress = addressData.fullAddress
provincecode = addressData.provincecode
}
// 获取省市
var provincecode = res.geocoderAddress.adcode
var provinceIdx = fullAddress.province
var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
// 如果没有点击地图地址,省市信息从返回数据读取
var provinceIdx = ''
var cityIdx = ''
if (fullAddress) {
provinceIdx = fullAddress.province
cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
} else {
provinceIdx = merchantForm.provinceName
cityIdx = merchantForm.cityName
provincecode = merchantForm.cityCode
}
const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == provinceIdx)
if (municipality) {
cityIdx = cityIdx.slice(0, 2) + '城区'
console.log(cityIdx);
if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县')
......@@ -1051,7 +1067,6 @@
}
}
$('#addrEl').val(merchantForm.merchantAddress)
console.log(provinceInfoList);
var province = provinceInfoList.find(item => item.name.indexOf(provinceIdx) != -1)
$('#startp').val(province.name)
cityInfo = province.districtList
......@@ -1479,10 +1494,12 @@
}
}
})
var city = cityInfo.find(item => item.name.indexOf(merchantForm.cityName) != -1)
merchantForm.cityName = city.name
// merchantForm.cityCode = city.cityId
$('#startc').val(city.name)
if (merchantForm.cityName) {
var city = cityInfo.find(item => item.name.indexOf(merchantForm.cityName) != -1)
merchantForm.cityName = city.name
// merchantForm.cityCode = city.cityId
$('#startc').val(city.name)
}
form.render('select');
}
if (step == 1) {
......
......@@ -67,10 +67,10 @@
</button>
</div>
<div class="layui-form-item">
<div class="layui-input-inline" style="width: 400px; height: 300px;">
<div class="layui-input-inline" style="width: 100%; height: 300px;">
<div id="container"></div>
</div>
<div class="poi-list layui-input-inline poi-list" id="pois"></div>
<!-- <div class="poi-list layui-input-inline poi-list" id="pois"></div> -->
</div>
<div class="layui-form-item">
<input name="merchantAddress" id="merchantAddress" class="layui-input" placeholder="请输入详细地址,如道路、门牌号等">
......
......@@ -207,6 +207,7 @@
}
})
treeTab.tabChange('roleAuth', authList[0].accounttypeId)
$(window).resize();
}
})
}
......
......@@ -4,7 +4,7 @@ layui.define(['store'], function (exports) {
PHONEREG: /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/,
/* 手机号码或固话格式校验正则 */
PHONETWO: /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/,
PHONETWO: /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/,
/* 同时包含字母和数字 */
ISNUMANDLETTERS: /^[a-zA-Z0-9]+$/,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!