Commit b65c928a by cwq0219

bug修复

1 parent 8e54d11b
......@@ -418,7 +418,13 @@
if (productData.products && productData.products.lengt != 0) {
for (var j = 0; j < productData.products.length; j++) {
menuData = productData.products[j]
var idList = menuData.menuIds.concat(menuData.functionIds)
var idList = ''
// idList = menuData.menuIds.concat(menuData.functionIds)
if (menuData.menuIds) {
idList = menuData.menuIds.concat(menuData.functionIds)
} else {
idList = menuData.functionIds
}
active.treeTabAdd({
name: menuData.productName,
value: menuData.productId
......@@ -467,10 +473,13 @@
method: 'cn.com.glsx.merchants.merchant.findMerchantTree'
}
request(treeParams, function (res) {
console.log(res)
if (res.code == '0') {
merchants = tree.create('merchantTree', res.data, null, false)
merchants.expandAll(true)
all_nodes = merchants.getNodes()
var targetNode = merchants.getNodeByParam('id', merchantId)
merchants.selectNode(targetNode)
bindEvent()
}
})
......@@ -481,10 +490,13 @@
var txt = $('#treeInput').val()
if (!txt) {
merchants.showNodes(all_nodes)
var targetNode = merchants.getNodeByParam('id', merchantId)
merchants.selectNode(all_nodes[0])
} else {
var show_nodes = merchants.getNodesByParamFuzzy('label', txt)
merchants.hideNodes(all_nodes)
merchants.showNodes(show_nodes)
merchants.selectNode(show_nodes[0])
}
})
return false
......
......@@ -130,8 +130,11 @@
<form class="layui-form" lay-filter="merchantForm">
<div class="layui-form-item edit-title" style="position: relative;">
<div class="layui-input-inline">企业基本信息</div>
<div class="layui-input-inline" style="position: absolute; right: 0; top: 5px; font-size: normal;">
<select id="channelEl" name="channelId"></select>
<div class="layui-input-item" style="position: absolute; right: 0; top: 5px; font-size: normal;">
<label class="layui-form-label">渠道:</label>
<div class="layui-input-inline">
<select id="channelEl" name="channelId"></select>
</div>
</div>
</div>
<div class="layui-form-item">
......@@ -142,7 +145,7 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"></label>
<label class="layui-form-label">商户简称:</label>
<div class="layui-input-inline">
<input class="layui-input" maxlength="15" name="merchantAbbreviation" placeholder="请输入商户简称">
</div>
......@@ -150,14 +153,14 @@
<div class="layui-form-item">
<label class="layui-form-label">商户类型:</label>
<div class="layui-input-inline" style="width: 100px; margin: 0;">
<select name="merchantType" id="merchantTypeEl">
<select name="merchantType" id="merchantTypeEl" lay-filter="merchantTypeFilter">
<option value="1">个人</option>
<option value="2">企业</option>
</select>
</div>
<div class="layui-input-inline" style="width: 220px;">
<input class="layui-input" maxlength="50" lay-verify="merchantOrgcode" name="merchantOrgcode"
placeholder="请输入组织机构号码">
id="merchantOrgcodeEl" placeholder="请输入身份证号码">
</div>
</div>
<div class="layui-form-item">
......@@ -290,13 +293,6 @@
<div class="m-t-10" id="parentName"></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">账户类型:</label>
<div class="layui-input-inline">
<!-- <input class="layui-input layui-btn-disabled" name="parentAccountTypeName" placeholder="请输入账户类型"> -->
<div class="m-t-10" id="parentAccountTypeName"></div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required">登录账户名:</label>
......@@ -474,12 +470,14 @@
// console.log(validator.PHONEREG)
// 校验
form.verify({
// merchantOrgcode: function (value) {
// var merchantType = $('#merchantTypeEl option:selected').val()
// if(value && (merchantType == '1') && !validator.checkIdCard(value)) {
// return '请填入正确的身份证'
// }
// },
merchantOrgcode: function (value) {
var merchantType = $('#merchantTypeEl option:selected').val()
if (value) {
if ((merchantType == 1) && !validator.checkIdCard(value)) {
return '请填入正确的身份证'
}
}
},
merchantLoginAccount: function (value) {
if (value && value.length < 3) {
return '登录账户名请填入3-15位字符'
......@@ -497,6 +495,14 @@
}
})
form.on('select(merchantTypeFilter)', function (data) {
if (data.value == 1) {
$('#merchantOrgcodeEl').attr('placeholder', '请输入身份证号码')
} else {
$('#merchantOrgcodeEl').attr('placeholder', '请输入组织机构号码')
}
})
form.on('submit(handleFirstSubmit)', function (data) {
// console.log(editLevel)
// console.log(data.field)
......@@ -732,11 +738,6 @@
}
})
// console.log($('#merchantTypeEl'))
// $('#merchantTypeEl').on('change', function() {
// console.log('?????????????')
// })
$('.upload').on('change', function (e) {
// console.log(e)
var idx = $(this).data('idx')
......@@ -788,6 +789,12 @@
}
function init() {
// var index = layer.load(2, {
// shade: true,
// time: 10 * 1000
// }); //又换了种风格,并且设定最长等待10秒
//关闭
// layer.close(index);
getChannel()
getPeriod()
......@@ -902,12 +909,11 @@
parentId: data.id,
parentName: data.merchantName + '(' + data.merchantNo + ')',
parentAccountType: data.accountType,
parentAccountTypeName: data.accountTypeNames,
parentMerchantAccountLevel: data.merchantAccountLevel,
channelId: data.channelId,
effectiveTime: data.effectiveTime
}
var attrList = ['parentName', 'parentAccountTypeName']
var attrList = ['parentName']
$.each(attrList, function (index, item) {
$('#' + item).text(parentInfo[item])
})
......@@ -930,6 +936,9 @@
if (merchantForm.status != 1) {
$('#draft').remove()
}
if (merchantForm.merchantType == 2) {
$('#merchantOrgcodeEl').attr('placeholder', '请输入组织机构号码')
}
console.log(merchantForm)
getBusiScope()
getCarBrandTree()
......@@ -996,7 +1005,6 @@
// 账户等级
function getAccountLevel() {
// console.log('???????????')
getDictData('account_level', function (res) {
baseData.accountLevelList = res.data
// console.log(baseData.accountLevelList)
......@@ -1004,7 +1012,11 @@
var tempList = []
$.each(baseData.accountLevelList, function (index, item) {
if (item.dictValue > parentInfo.parentMerchantAccountLevel) {
tempList.push(baseData.accountLevelList[index])
if (parentInfo.parentMerchantAccountLevel == 1 && item.dictValue == 3) {
} else {
tempList.push(baseData.accountLevelList[index])
}
}
})
baseData.accountLevelList = tempList
......@@ -1363,7 +1375,13 @@
for (var j = 0; j < productData.products.length; j++) {
menuData = productData.products[j]
selectArr.push(menuData.productId)
var idList = menuData.menuIds.concat(menuData.functionIds)
var idList = ''
// idList = menuData.menuIds.concat(menuData.functionIds)
if (menuData.menuIds) {
idList = menuData.menuIds.concat(menuData.functionIds)
} else {
idList = menuData.functionIds
}
active.treeTabAdd({
name: menuData.productName,
value: menuData.productId
......
......@@ -10,6 +10,7 @@
layui.define(['ztree'], function (exports) {
var $ = layui.$
var tree = layui.ztree
function onNodeCreated(event, treeId, treeNode) {
if (treeNode.logo == 'functionValue') {
var tId = treeNode.getParentNode().tId
......@@ -23,15 +24,20 @@ layui.define(['ztree'], function (exports) {
}
if (gtree.opt && gtree.opt.checkedList) {
var p = gtree.opt.checkedList
if (p.indexOf(treeNode.id) != -1) {
treeNode.checked = true
var i= setInterval(function(){
if (inst) {
clearInterval(i)
inst.updateNode(treeNode)
}
},20)
if (p.indexOf(treeNode.id) != -1) {
treeNode.checked = true
// var i= setInterval(function(){
// if (inst) {
// clearInterval(i)
// inst.updateNode(treeNode)
// }
// },20)
// var time = setTimeout(function () {
if (inst) {
inst.updateNode(treeNode)
}
// }, 1000)
}
}
if (gtree.opt && gtree.opt.chkDisabled) {
treeNode.chkDisabled = true
......@@ -44,7 +50,10 @@ layui.define(['ztree'], function (exports) {
},
check: {
enable: true,
chkboxType: { Y: 'ps', N: 's' }
chkboxType: {
Y: 'ps',
N: 's'
}
},
data: {
key: {
......@@ -70,4 +79,4 @@ layui.define(['ztree'], function (exports) {
}
}
exports('gtree', gtree)
})
})
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!