Commit 84816475 by 前端

Merge branch 'huy_dev_v2.1.0' into 'v2.1.0'

Huy dev v2.1.0

See merge request !17
2 parents 08df0d92 2d1c705b
...@@ -1095,9 +1095,10 @@ ...@@ -1095,9 +1095,10 @@
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
cityInfo = cityInfo.find(item => item.name == value) var cityChange = cityInfo.find(item => item.name == value)
merchantForm.cityCode = cityInfo.adcode merchantForm.cityCode = cityChange.adcode
$('#addrEl').val('') $('#addrEl').val('')
} }
} }
......
...@@ -1106,8 +1106,8 @@ ...@@ -1106,8 +1106,8 @@
const { value } = data const { value } = data
if (value) { if (value) {
merchantForm.cityName = value merchantForm.cityName = value
cityInfo = cityInfo.find(item => item.cityName == value) var cityChange = cityInfo.find(item => item.cityName == value)
merchantForm.cityCode = cityInfo.adcode merchantForm.cityCode = cityChange.adcode
$('#addrEl').val('') $('#addrEl').val('')
} }
} }
......
...@@ -334,7 +334,7 @@ ...@@ -334,7 +334,7 @@
</div> --> </div> -->
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label required">账户类型:</label> <label class="layui-form-label required">账户类型:</label>
<div class="layui-input-inline w-70" id="accountTypeEl"></div> <div class="layui-input-inline" style="width: calc(100% - 200px)" id="accountTypeEl"></div>
</div> </div>
</div> </div>
<div class="edit-box clearfix"> <div class="edit-box clearfix">
...@@ -494,7 +494,8 @@ ...@@ -494,7 +494,8 @@
<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>
</div> </div>
...@@ -551,7 +552,8 @@ ...@@ -551,7 +552,8 @@
</div> </div>
<script src="https://img02.glsx.com.cn/layui/layui.js"></script> <script src="https://img02.glsx.com.cn/layui/layui.js"></script>
<script src="/js/load.js"></script> <script src="/js/load.js"></script>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=44cc16e43ad7ed3358df507bd0618181&plugin=AMap.Geocoder&plugin=AMap.PlaceSearch&plugin=AMap.Geolocation"> <script type="text/javascript"
src="https://webapi.amap.com/maps?v=1.4.15&key=44cc16e43ad7ed3358df507bd0618181&plugin=AMap.Geocoder&plugin=AMap.PlaceSearch&plugin=AMap.Geolocation">
</script> </script>
<script src="/js/validator.js"></script> <script src="/js/validator.js"></script>
<script> <script>
...@@ -943,7 +945,7 @@ ...@@ -943,7 +945,7 @@
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) 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 = []
car.children.forEach(item => { car.children.forEach(item => {
...@@ -1049,7 +1051,8 @@ ...@@ -1049,7 +1051,8 @@
} }
} }
$('#addrEl').val(merchantForm.merchantAddress) $('#addrEl').val(merchantForm.merchantAddress)
var province = provinceInfoList.find(item => item.provinceName.indexOf(province) != -1) console.log(provinceInfoList);
var province = provinceInfoList.find(item => item.name.indexOf(provinceIdx) != -1)
$('#startp').val(province.name) $('#startp').val(province.name)
cityInfo = province.districtList cityInfo = province.districtList
merchantForm.provinceName = province.name merchantForm.provinceName = province.name
...@@ -1060,13 +1063,13 @@ ...@@ -1060,13 +1063,13 @@
text: 'name', text: 'name',
data: cityInfo, data: cityInfo,
link: 'startp', link: 'startp',
isFirst: false, // isFirst: false,
select: function (data) { select: function (data) {
const { value } = data const { value } = data
if (value) { if (value) {
merchantForm.cityName = value merchantForm.cityName = value
var city = cityInfo.find(item => item.cityName == value) var cityChange = cityInfo.find(item => item.name == value)
merchantForm.cityCode = city.adcode merchantForm.cityCode = cityChange.adcode
$('#addrEl').val('') $('#addrEl').val('')
} }
} }
...@@ -1074,7 +1077,7 @@ ...@@ -1074,7 +1077,7 @@
var city = cityInfo.find(item => item.name == cityIdx) var city = cityInfo.find(item => item.name == cityIdx)
merchantForm.cityCode = city.adcode merchantForm.cityCode = city.adcode
merchantForm.cityName = city.name merchantForm.cityName = city.name
$('#startc').val(city.cityName) $('#startc').val(city.name)
form.render('select'); form.render('select');
layer.close(index) layer.close(index)
} else { } else {
...@@ -1128,7 +1131,7 @@ ...@@ -1128,7 +1131,7 @@
var checkAll = false var checkAll = false
var checkCarBrand = $('#checkCarBrand') var checkCarBrand = $('#checkCarBrand')
// 主营品牌全选 // 主营品牌全选
checkCarBrand.on('click', function() { checkCarBrand.on('click', function () {
checkAll = !checkAll checkAll = !checkAll
treeObj.checkAllNodes(checkAll) treeObj.checkAllNodes(checkAll)
if (checkAll) { if (checkAll) {
...@@ -1454,7 +1457,6 @@ ...@@ -1454,7 +1457,6 @@
} }
// 省市回显 // 省市回显
if (merchantForm.provinceName) { if (merchantForm.provinceName) {
console.log(provinceInfoList, '====');
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.districtList cityInfo = province.districtList
...@@ -1471,8 +1473,8 @@ ...@@ -1471,8 +1473,8 @@
const { value } = data const { value } = data
if (value) { if (value) {
merchantForm.cityName = value merchantForm.cityName = value
var city = cityInfo.find(item => item.cityName == value) var cityChange = cityInfo.find(item => item.name == value)
merchantForm.cityCode = city.cityId merchantForm.cityCode = cityChange.adcode
$('#addrEl').val('') $('#addrEl').val('')
} }
} }
...@@ -1509,7 +1511,7 @@ ...@@ -1509,7 +1511,7 @@
var checkedList = [] var checkedList = []
if (editLevel == 3 && merchantForm.merchantBrandMain) { if (editLevel == 3 && merchantForm.merchantBrandMain) {
// checkedList = merchantForm.merchantBrandMain.split(',') // checkedList = merchantForm.merchantBrandMain.split(',')
checkedList = merchantForm.merchantBrandMain.replaceAll(';',',').split(',') checkedList = merchantForm.merchantBrandMain.replaceAll(';', ',').split(',')
$.each(checkedList, function (index, item) { $.each(checkedList, function (index, item) {
checkedList[index] = parseInt(item) checkedList[index] = parseInt(item)
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!