Commit 1dc8f9f9 by cwq0219

商户管理

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