Commit 1dc8f9f9 by cwq0219

商户管理

1 parent c5c56b44
...@@ -722,7 +722,6 @@ ...@@ -722,7 +722,6 @@
} else { } else {
getBusiScope() getBusiScope()
getCarBrandTree() getCarBrandTree()
getAccountType()
} }
if (isFactory) { if (isFactory) {
getAccountLevel() getAccountLevel()
...@@ -786,13 +785,14 @@ ...@@ -786,13 +785,14 @@
function getParentInfo() { function getParentInfo() {
// console.log(parentMerchantId) // console.log(parentMerchantId)
getMerchantApi(parentMerchantId, function (res) { getMerchantApi(parentMerchantId, function (res) {
// console.log(res.data) // console.log(res.data, 'parentInfo')
var data = res.data var data = res.data
parentInfo = { parentInfo = {
parentId: data.id, parentId: data.id,
parentName: data.merchantName, parentName: data.merchantName,
parentAccountType: data.accountType,
parentAccountTypeName: data.accountTypeNames, parentAccountTypeName: data.accountTypeNames,
parentAccountType: data.merchantType, parentMerchantAccountLevel: data.merchantAccountLevel,
channelId: data.channelId, channelId: data.channelId,
effectiveTime: data.effectiveTime effectiveTime: data.effectiveTime
} }
...@@ -800,6 +800,8 @@ ...@@ -800,6 +800,8 @@
if (editLevel == 3) { if (editLevel == 3) {
getMerchantInfo() getMerchantInfo()
$('#accountLevelEl').attr('disabled', true) $('#accountLevelEl').attr('disabled', true)
} else {
getAccountType()
} }
getAccountLevel() getAccountLevel()
}) })
...@@ -819,11 +821,7 @@ ...@@ -819,11 +821,7 @@
getAccountType() getAccountType()
recoveryBusiScopeCus() recoveryBusiScopeCus()
recoveryFile() recoveryFile()
// if (merchantForm.status == 1) {
// findMenuFunTreeByMerId()
// } else {
getById() getById()
// }
}) })
} }
...@@ -883,13 +881,14 @@ ...@@ -883,13 +881,14 @@
// 账户等级 // 账户等级
function getAccountLevel() { function getAccountLevel() {
// console.log('???????????')
getDictData('account_level', function (res) { getDictData('account_level', function (res) {
baseData.accountLevelList = res.data baseData.accountLevelList = res.data
// console.log(baseData.accountLevelList) // console.log(baseData.accountLevelList)
if (!isFactory) { if (!isFactory) {
var tempList = [] var tempList = []
$.each(baseData.accountLevelList, function (index, item) { $.each(baseData.accountLevelList, function (index, item) {
if (item.dictValue > parentInfo.parentAccountType) { if (item.dictValue > parentInfo.parentMerchantAccountLevel) {
tempList.push(baseData.accountLevelList[index]) tempList.push(baseData.accountLevelList[index])
} }
}) })
...@@ -973,7 +972,7 @@ ...@@ -973,7 +972,7 @@
// 账户类型 // 账户类型
function getAccountType() { function getAccountType() {
getDictData('account_type', function (res) { getDictData('account_type', function (res) {
// console.log(res.data) // console.log(res.data, 'account_type')
baseData.accountTypeList = res.data baseData.accountTypeList = res.data
var checkedList = [] var checkedList = []
if (editLevel == 3 && merchantForm.accountType) { if (editLevel == 3 && merchantForm.accountType) {
...@@ -981,20 +980,44 @@ ...@@ -981,20 +980,44 @@
} }
var el = $('#accountTypeEl') var el = $('#accountTypeEl')
$.each(baseData.accountTypeList, function (index, item) { $.each(baseData.accountTypeList, function (index, item) {
var optionEl = $('<input type="checkbox" class="accounttypeId" name="accountType[' + item // console.log(item)
.dictValue + ']" title=' + if (parentMerchantId) {
item.dictLabel + ' value="' + item.dictValue + '">') var parentLevelList = parentInfo.parentAccountType.split(',')
// 修改-回显 for (var k = 0; k <= parentLevelList.length; k++) {
if (editLevel == 3) { if (item.dictValue == parseInt(parentLevelList[k])) {
for (var i = 0; i <= checkedList.length; i++) { var optionEl = $('<input type="checkbox" class="accounttypeId" name="accountType[' + item
if (checkedList[i] == item.dictValue) { .dictValue + ']" title=' +
optionEl.attr("checked", true) item.dictLabel + ' value="' + item.dictValue + '">')
// 修改-回显
if (editLevel == 3) {
for (var i = 0; i <= checkedList.length; i++) {
if (checkedList[i] == item.dictValue) {
optionEl.attr("checked", true)
break
}
}
}
el.append(optionEl)
form.render('checkbox')
break break
} }
} }
} else {
var optionEl = $('<input type="checkbox" class="accounttypeId" name="accountType[' + item
.dictValue + ']" title=' +
item.dictLabel + ' value="' + item.dictValue + '">')
// 修改-回显
if (editLevel == 3) {
for (var i = 0; i <= checkedList.length; i++) {
if (checkedList[i] == item.dictValue) {
optionEl.attr("checked", true)
break
}
}
}
el.append(optionEl)
form.render('checkbox')
} }
el.append(optionEl)
form.render('checkbox')
}) })
}) })
} }
...@@ -1278,19 +1301,26 @@ ...@@ -1278,19 +1301,26 @@
var menuIds = [] var menuIds = []
var functionIds = [] var functionIds = []
var functionIdLists = [] var functionIdLists = []
var functionValueIdLists = []
var nodes = productObj.treeObj.getCheckedNodes(true) var nodes = productObj.treeObj.getCheckedNodes(true)
$.each(nodes, function (index, item) { $.each(nodes, function (index, item) {
// console.log(item)
if (item.logo == 'function') { if (item.logo == 'function') {
functionIdLists.push(item) functionIdLists.push(item)
} else if (item.logo == 'functionValue') {
functionValueIdLists.push(item)
} else { } else {
menuIds.push(item.id) if (item.logo != 'neglect') {
menuIds.push(item.id)
}
} }
}) })
$.each(functionIdLists, function (idx, m) { $.each(functionValueIdLists, function (idx, m) {
// m.parentId // m.parentId
// console.log(m)
var findIdx = -1 var findIdx = -1
$.each(functionIds, function (idn, n) { $.each(functionIds, function (idn, n) {
if (n.mendId == m.parentId) { if (n.functionId == m.parentId) {
findIdx = idn findIdx = idn
} }
}) })
...@@ -1304,6 +1334,13 @@ ...@@ -1304,6 +1334,13 @@
}) })
} }
}) })
$.each(functionIdLists, function (idx, m) {
// console.log(m)
functionIds.push({
functionId: m.parentId,
mendId: m.superParentId
})
})
productList.push({ productList.push({
productId: productObj.productId, productId: productObj.productId,
functionIds: functionIds, functionIds: functionIds,
...@@ -1349,12 +1386,12 @@ ...@@ -1349,12 +1386,12 @@
getAuthList() getAuthList()
console.log(merchantForm) console.log(merchantForm)
console.log(requestList) console.log(requestList)
// 草稿
var params = { var params = {
merchantId: merchantId, merchantId: merchantId,
accountTypes: JSON.stringify(requestList) accountTypes: JSON.stringify(requestList)
} }
params.method = 'cn.com.glsx.merchants.merchant.updatePermissions' params.method = 'cn.com.glsx.merchants.merchant.updatePermissions'
// 草稿
if (merchantForm.status == 1) { if (merchantForm.status == 1) {
params.status = 2 params.status = 2
} else { } else {
......
...@@ -25,15 +25,7 @@ ...@@ -25,15 +25,7 @@
.layui-btn-xs { .layui-btn-xs {
cursor: pointer; cursor: pointer;
} }
<<<<<<< HEAD
.channel,
.accountLevel,
.accountType,
.customerStatus {
=======
.channel,.accountLevel,.accountType,.customerStatus,.searchInputBtn{ .channel,.accountLevel,.accountType,.customerStatus,.searchInputBtn{
>>>>>>> 748fc6c8146388d08c693751df225c092e4569de
margin-left: 20px; margin-left: 20px;
} }
</style> </style>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!