Commit c1b4db3a by cwq0219

上一步,下一步

1 parent 3798154f
......@@ -294,8 +294,8 @@
<div class="layui-form-item">
<label class="layui-form-label required">登录账户名:</label>
<div class="layui-input-inline">
<input class="layui-input" name="merchantLoginAccount" maxlength="15" placeholder="请输入登录账户名" required
lay-verify="required">
<input class="layui-input" id="merchantLoginAccountEl" name="merchantLoginAccount" maxlength="15"
placeholder="请输入登录账户名" required lay-verify="required">
</div>
</div>
<div class="layui-form-item">
......@@ -379,6 +379,7 @@
// 是否工厂
var isFactory = true
var parentInfo = {}
var isFreshSecond = true
var merchantForm = {
channelId: '',
......@@ -437,6 +438,10 @@
lay('#endDate').html(value)
}
})
editLevel = qs('editLevel')
isFactory = (qs('isFactory') == 'true')
step = qs('step')
init()
// helper.store.set('merchantMapObj', {
......@@ -530,20 +535,27 @@
if (merchantForm.merchantFiles.length) {
params.merchantFiles = JSON.stringify(merchantForm.merchantFiles)
}
if (editLevel == 1) {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
} else if (editLevel == 2) {
if (merchantId) {
params.id = merchantId
if (!isFactory) {
params.parentId = parentInfo.parentId
}
params.method = 'cn.com.glsx.merchants.merchant.updateMerchant'
} else if (editLevel == 1) {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
} else if (editLevel == 3) {
params.id = merchantId
} else if (editLevel == 2) {
if (!isFactory) {
params.parentId = parentInfo.parentId
}
params.method = 'cn.com.glsx.merchants.merchant.updateMerchant'
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
}
// else if (editLevel == 3) {
// params.id = merchantId
// if (!isFactory) {
// params.parentId = parentInfo.parentId
// }
// params.method = 'cn.com.glsx.merchants.merchant.updateMerchant'
// }
// 保存状态 1.草稿 2.发布 3.注销 4.过期
if (merchantForm.status) {
params.status = merchantForm.status
......@@ -562,14 +574,26 @@
})
go('merchant', 'index')
} else {
merchantId = res.data
if (!merchantId) {
merchantId = res.data
}
merchantForm.merchantAccountLevel = parseInt(merchantForm.merchantAccountLevel)
getMerchantApi(merchantId, function (respone) {
form.val('merchantForm', respone.data)
merchantForm = respone.data
accountTypeVisible = true
var el = $('#accountTypeEl')
el.empty()
// recoveryBusiScopeCus()
// getCarBrandTree()
recoveryFile()
getAccountType()
baseIsShow(false)
treeIsShow(true)
getById()
if (isFreshSecond) {
getById()
isFreshSecond = false
}
})
}
}
......@@ -731,44 +755,61 @@
}
function init() {
editLevel = qs('editLevel')
isFactory = (qs('isFactory') == 'true')
step = qs('step')
if (step == 1) {
baseIsShow(true)
treeIsShow(false)
} else {
baseIsShow(false)
treeIsShow(true)
}
// 创建商户
if (editLevel == 1) {
$('#accountLevelEl').attr('disabled', true)
getBusiScope()
getCarBrandTree()
getAccountLevel()
getAccountType()
if (!merchantId) {
$('#accountLevelEl').attr('disabled', true)
getBusiScope()
getCarBrandTree()
getAccountLevel()
getAccountType()
} else {
$('#validPeriodEl').attr('disabled', true)
$('#merchantLoginAccountEl').attr('disabled', true)
}
} else {
merchantId = qs('id')
$('#preStep').remove()
if (!merchantId) {
merchantId = qs('id')
}
console.log(merchantId)
if (editLevel == 3) {
$('#firstBtn').text('确定')
$('#preStep').remove()
$('#validPeriodEl').attr('disabled', true)
$('#merchantLoginAccountEl').attr('disabled', true)
accountTypeVisible = true
$('#accountLevelEl').attr('disabled', true)
} else {
getBusiScope()
getCarBrandTree()
if (!merchantId) {
getBusiScope()
getCarBrandTree()
}
}
if (isFactory) {
getAccountLevel()
getMerchantInfo()
} else {
// 创建/编辑子商户
parentMerchantId = qs('parentId')
// $('#validPeriodEl').attr('disabled', true)
if (!parentMerchantId) {
parentMerchantId = qs('parentId')
}
$('#validPeriodEl').attr('disabled', true)
$('#channelEl').attr('disabled', true)
getParentInfo()
if (editLevel == 3 || (editLevel == 2 && !merchantId)) {
getParentInfo()
} else {
$('#merchantLoginAccountEl').attr('disabled', true)
$('#accountLevelEl').attr('disabled', true)
}
}
}
if (isFactory) {
......@@ -1016,7 +1057,7 @@
// console.log(res.data, 'account_type')
baseData.accountTypeList = res.data
var checkedList = []
if (editLevel == 3 && merchantForm.accountType) {
if (merchantId && merchantForm.accountType) {
checkedList = merchantForm.accountType.split(',')
}
var el = $('#accountTypeEl')
......@@ -1034,7 +1075,7 @@
optionEl.attr('disabled', true)
}
// 修改-回显
if (editLevel == 3) {
if (merchantId) {
for (var i = 0; i <= checkedList.length; i++) {
if (checkedList[i] == item.dictValue) {
optionEl.attr("checked", true)
......@@ -1055,7 +1096,7 @@
optionEl.attr('disabled', true)
}
// 修改-回显
if (editLevel == 3) {
if (merchantId) {
for (var i = 0; i <= checkedList.length; i++) {
if (checkedList[i] == item.dictValue) {
optionEl.attr("checked", true)
......
......@@ -25,7 +25,12 @@
.layui-btn-xs {
cursor: pointer;
}
.channel,.accountLevel,.accountType,.customerStatus,.searchInputBtn{
.channel,
.accountLevel,
.accountType,
.customerStatus,
.searchInputBtn {
margin-left: 20px;
}
</style>
......@@ -68,7 +73,7 @@
</div>
<div class="layui-inline loginName" pane>
<div class="layui-input-inline" style="width: 120px;">
<select name="name" lay-filter="nameFilter">
<select name="accountOrPhone" lay-filter="nameFilter">
<option value="0">账号登录名</option>
<option value="1">手机号</option>
</select>
......@@ -188,7 +193,7 @@
var merchantTable = table.render({
elem: '#merchantTable',
page: false,
skin: 'nob',
skin: 'nob',
cols: [
[{
field: 'index',
......@@ -319,7 +324,8 @@
fixed: false, //不固定
// maxmin: true,
btn: ['确定', '取消'],
content: 'validPeriodForm.html?id=' + row.id + '&effectiveTime=' + row.effectiveTime + '&merchantAccountLevel=' + row.merchantAccountLevel + '&status=' + row.status,
content: 'validPeriodForm.html?id=' + row.id + '&effectiveTime=' + row.effectiveTime +
'&merchantAccountLevel=' + row.merchantAccountLevel + '&status=' + row.status,
yes: function (index, layero) {
var body = layer.getChildFrame('body', index)
helper.store.set('isRefresh', false)
......@@ -372,11 +378,16 @@
var searchData = $('#searchForm [name]').serializeArray()
// console.log(searchData)
$.each(searchData, function () {
params[this.name] = this.value
if (this.name == 'merchantLoginAccount') {
var attrName = params.accountOrPhone == '0' ? 'merchantLoginAccount' : 'merchantLegalPersonPhone'
params[attrName] = this.value
} else {
params[this.name] = this.value
}
})
// console.log(params)
request(params, function (res) {
var data = helper.formateNullFieldData(res.data)
var data = helper.formateNullFieldData(res.data)
$.each(data.data, function (index, item) {
item.index = index + 1 + page.pageSize * (page.pageNum - 1)
item.btn = {
......
......@@ -25,9 +25,12 @@ layui.define(['ztree'], function (exports) {
var p = gtree.opt.checkedList
if (p.indexOf(treeNode.id) != -1) {
treeNode.checked = true
if (inst) {
inst.updateNode(treeNode)
}
var i= setInterval(function(){
if (inst) {
clearInterval(i)
inst.updateNode(treeNode)
}
},20)
}
}
if (gtree.opt && gtree.opt.chkDisabled) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!