Commit f8513cc3 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !23
2 parents b890b906 4b7d3cfc
...@@ -382,6 +382,7 @@ ...@@ -382,6 +382,7 @@
} }
}) })
treeTab.tabChange('roleAuth', authList[0].accounttypeId) treeTab.tabChange('roleAuth', authList[0].accounttypeId)
$(window).resize();
} }
} }
}) })
......
...@@ -424,7 +424,7 @@ ...@@ -424,7 +424,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label> <label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline" style="position: relative;"> <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> <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="carBrandTree" class="wrapper-tree hide" style="height: 200px; overflow-y: scroll"></div>
<div id="noCarbrand" class="no-car hide">暂无数据</div> <div id="noCarbrand" class="no-car hide">暂无数据</div>
...@@ -640,6 +640,7 @@ ...@@ -640,6 +640,7 @@
var provinceInfoList = [] var provinceInfoList = []
var cityInfo = [] var cityInfo = []
var addressData = {}
// 省市区 // 省市区
getProvinceList() getProvinceList()
// com.getSelect({ // com.getSelect({
...@@ -1054,16 +1055,32 @@ ...@@ -1054,16 +1055,32 @@
merchantForm.lat = res.lat merchantForm.lat = res.lat
merchantForm.lng = res.lng merchantForm.lng = res.lng
merchantForm.merchantAddress = res.merchantAddress 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 = ''
var provinceIdx = fullAddress.province var cityIdx = ''
var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district if (fullAddress) {
provinceIdx = fullAddress.province
cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
} else {
provinceIdx = merchantForm.provinceName
cityIdx = merchantForm.cityName
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) + '城区'
console.log(cityIdx);
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) + '郊县')
...@@ -1095,7 +1112,6 @@ ...@@ -1095,7 +1112,6 @@
select: function (data) { select: function (data) {
const { value } = data const { value } = data
if (value) { if (value) {
console.log(cityInfo);
merchantForm.cityName = value merchantForm.cityName = value
var cityChange = cityInfo.find(item => item.name == value) var cityChange = cityInfo.find(item => item.name == value)
merchantForm.cityCode = cityChange.adcode merchantForm.cityCode = cityChange.adcode
...@@ -1104,7 +1120,6 @@ ...@@ -1104,7 +1120,6 @@
} }
}) })
var city = cityInfo.find(item => item.name == cityIdx) var city = cityInfo.find(item => item.name == cityIdx)
console.log(city);
merchantForm.cityCode = city.adcode merchantForm.cityCode = city.adcode
merchantForm.cityName = city.name merchantForm.cityName = city.name
$('#startc').val(merchantForm.cityName) $('#startc').val(merchantForm.cityName)
......
...@@ -408,7 +408,7 @@ ...@@ -408,7 +408,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label> <label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline" style="position: relative;"> <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> <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="carBrandTree" class="hide" style="height: 200px; overflow-y: scroll"></div>
<div id="noCarbrand" class="no-car hide">暂无数据</div> <div id="noCarbrand" class="no-car hide">暂无数据</div>
...@@ -631,6 +631,7 @@ ...@@ -631,6 +631,7 @@
} }
var provinceInfoList = [] var provinceInfoList = []
var cityInfo = [] var cityInfo = []
var addressData = {}
// 省市区 // 省市区
getProvinceList() getProvinceList()
// com.getSelect({ // com.getSelect({
...@@ -1064,9 +1065,18 @@ ...@@ -1064,9 +1065,18 @@
merchantForm.lat = res.lat merchantForm.lat = res.lat
merchantForm.lng = res.lng merchantForm.lng = res.lng
merchantForm.merchantAddress = res.merchantAddress 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 provinceIdx = fullAddress.province
var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] const municipalities = ['北京市', '天津市', '上海市', '重庆市']
......
...@@ -704,6 +704,7 @@ ...@@ -704,6 +704,7 @@
// businessScopeCustomize // businessScopeCustomize
if (res.code == '0') { if (res.code == '0') {
roleData = helper.clone(true, res.data) roleData = helper.clone(true, res.data)
console.log(roleData, '====');
for (var i in basicArr) { for (var i in basicArr) {
// if (basicArr[i] == 'businessTypeName' && roleData.businessScopeCustomize) { // if (basicArr[i] == 'businessTypeName' && roleData.businessScopeCustomize) {
// roleData.businessTypeName = roleData.businessTypeName ? roleData.businessTypeName + ',' + roleData.businessScopeCustomize : roleData.businessScopeCustomize // roleData.businessTypeName = roleData.businessTypeName ? roleData.businessTypeName + ',' + roleData.businessScopeCustomize : roleData.businessScopeCustomize
...@@ -717,6 +718,12 @@ ...@@ -717,6 +718,12 @@
$('#sapBox').removeClass('hide') $('#sapBox').removeClass('hide')
} }
roleData.bussinessBegintime ? $('#businessTime').text(roleData.bussinessBegintime + '-' + roleData.bussinessEndtime) : $('#businessTime').text('-') 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') // var effectiveTimeNameEl = $('#effectiveTimeName')
// if (roleData.merchantAccountLevel == 4) { // 门店 // if (roleData.merchantAccountLevel == 4) { // 门店
// if (roleData.status == 1 || roleData.status == 5) { // if (roleData.status == 1 || roleData.status == 5) {
......
...@@ -493,7 +493,7 @@ ...@@ -493,7 +493,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label> <label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline" style="position: relative;"> <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" <button id="checkCarBrand" type="button"
class="layui-btn btn-no-border check-carbrand">全选</button> class="layui-btn btn-no-border check-carbrand">全选</button>
<div id="carBrandTree" class="hide" style="height: 200px; overflow-y: scroll"></div> <div id="carBrandTree" class="hide" style="height: 200px; overflow-y: scroll"></div>
...@@ -630,6 +630,7 @@ ...@@ -630,6 +630,7 @@
} }
var provinceInfoList = [] var provinceInfoList = []
var cityInfo = [] var cityInfo = []
var addressData = {}
// 省市区 // 省市区
getProvinceList() getProvinceList()
// com.getSelect({ // com.getSelect({
...@@ -944,7 +945,6 @@ ...@@ -944,7 +945,6 @@
if (treeObj) { if (treeObj) {
let getCheckedNodes = treeObj.getCheckedNodes(true) let getCheckedNodes = treeObj.getCheckedNodes(true)
const getCheckedKeys = treeObj.getCheckedNodes(true).map(item => item.id) const getCheckedKeys = treeObj.getCheckedNodes(true).map(item => item.id)
console.log(getCheckedKeys)
getCheckedNodes = getCheckedNodes.filter(item => item.children) getCheckedNodes = getCheckedNodes.filter(item => item.children)
merchantForm.merchantBrandList = getCheckedNodes.map(car => { merchantForm.merchantBrandList = getCheckedNodes.map(car => {
let merchantBrandId = [] let merchantBrandId = []
...@@ -958,7 +958,6 @@ ...@@ -958,7 +958,6 @@
merchantBrandId merchantBrandId
} }
}) })
console.log(merchantForm.merchantBrandList)
params.merchantBrandListJson = JSON.stringify(merchantForm.merchantBrandList) params.merchantBrandListJson = JSON.stringify(merchantForm.merchantBrandList)
} }
if (merchantForm.merchantFiles.length) { if (merchantForm.merchantFiles.length) {
...@@ -1025,16 +1024,33 @@ ...@@ -1025,16 +1024,33 @@
merchantForm.lat = res.lat merchantForm.lat = res.lat
merchantForm.lng = res.lng merchantForm.lng = res.lng
merchantForm.merchantAddress = res.merchantAddress 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 provinceIdx = ''
var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district 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 = ['北京市', '天津市', '上海市', '重庆市'] 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) + '城区'
console.log(cityIdx);
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) + '郊县')
...@@ -1051,7 +1067,6 @@ ...@@ -1051,7 +1067,6 @@
} }
} }
$('#addrEl').val(merchantForm.merchantAddress) $('#addrEl').val(merchantForm.merchantAddress)
console.log(provinceInfoList);
var province = provinceInfoList.find(item => item.name.indexOf(provinceIdx) != -1) var province = provinceInfoList.find(item => item.name.indexOf(provinceIdx) != -1)
$('#startp').val(province.name) $('#startp').val(province.name)
cityInfo = province.districtList cityInfo = province.districtList
...@@ -1479,10 +1494,12 @@ ...@@ -1479,10 +1494,12 @@
} }
} }
}) })
if (merchantForm.cityName) {
var city = cityInfo.find(item => item.name.indexOf(merchantForm.cityName) != -1) var city = cityInfo.find(item => item.name.indexOf(merchantForm.cityName) != -1)
merchantForm.cityName = city.name merchantForm.cityName = city.name
// merchantForm.cityCode = city.cityId // merchantForm.cityCode = city.cityId
$('#startc').val(city.name) $('#startc').val(city.name)
}
form.render('select'); form.render('select');
} }
if (step == 1) { if (step == 1) {
......
...@@ -67,10 +67,10 @@ ...@@ -67,10 +67,10 @@
</button> </button>
</div> </div>
<div class="layui-form-item"> <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 id="container"></div>
</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>
<div class="layui-form-item"> <div class="layui-form-item">
<input name="merchantAddress" id="merchantAddress" class="layui-input" placeholder="请输入详细地址,如道路、门牌号等"> <input name="merchantAddress" id="merchantAddress" class="layui-input" placeholder="请输入详细地址,如道路、门牌号等">
......
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
} }
}) })
treeTab.tabChange('roleAuth', authList[0].accounttypeId) treeTab.tabChange('roleAuth', authList[0].accounttypeId)
$(window).resize();
} }
}) })
} }
......
...@@ -4,7 +4,7 @@ layui.define(['store'], function (exports) { ...@@ -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}$/, 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]+$/, 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!