Commit 92cdb9bf by 徐忆琳

Merge branch 'xuyl_dev_v3.7.0' into 'v3.7.0'

修复子商户来源bug

See merge request !47
2 parents bf06a0ba 0132beac
......@@ -987,7 +987,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 = []
......@@ -1001,7 +1000,6 @@
merchantBrandId
}
})
console.log(merchantForm.merchantBrandList)
params.merchantBrandListJson = JSON.stringify(merchantForm.merchantBrandList)
}
if (merchantForm.merchantFiles.length) {
......@@ -1029,8 +1027,17 @@
} else {
params.status = 1
}
console.log(params)
request(params, function (res) {
verifyMerchantName(params.merchantName,params,loading)
layer.close(loading)
return false
})
function nextStepRequest(params,loading){
params.createdSource = 1
request(params, function (res) {
if (res.code == '0') {
layer.close(loading)
if (editLevel == 3) {
......@@ -1063,12 +1070,40 @@
}
})
}
} else {
layer.close(loading)
}
})
layer.close(loading)
}
function verifyMerchantName(name,paramsM,loading){
var params = {
method: 'merchants.api.merchant.checkMerchantNameRepeat',
merchantName: paramsM.merchantName
}
request(params, function (res) {
if(res && res.data == true){
return nextStepRequest(paramsM,loading)
}else if(res && res.data ==false){
return verifyDialog(paramsM,loading)
}
})
return false
})
}
function verifyDialog(params,loading){
// 验证商户名是否重复
layer.confirm('商户名称已经被使用,是否确定继续使用', {
title: "提示",
btn: ['取消', '确定'] //可以无限个按钮
,btn2: function(index, layero){
//按钮【按钮二】的回调
nextStepRequest(params,loading)
}
}, function(index, layero){
//按钮【按钮一】的回调
layer.close(index);
layer.close(loading)
})
}
function findId(nodeList) {
var idList = []
......@@ -1115,7 +1150,6 @@
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) + '郊县')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!