Commit 286343ce by 胡悦

商户添加搜索条件

1 parent e23acfa0
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<style>
.h20 {
height: 20px;
}
.mb5 {
margin-bottom: 5px;
}
.merchant .layui-table {
margin: 0;
width: 100%;
}
.merchant #searchForm .layui-inline {
margin-bottom: 5px;
vertical-align: top;
}
.layui-btn-xs {
cursor: pointer;
}
.layui-form-label {
width: 130px;
}
.accountLevel,
.customerState,
.accountType,
.mode {
margin-left: 30px;
}
.input-before-name {
width: 80px;
text-align: right;
display: inline-block;
}
.commonInput {
width: 260px;
}
#relevancyBtn {
display: flex;
align-items: center;
}
.relevancyImg {
width: 20px;
height: 20px;
margin-right: 5px;
}
.hide {
display: none;
}
.show {
display: inline-block;
}
.merchantTable .layui-table-cell {
/* height: auto; */
/* line-height: 88px; */
white-space: normal;
overflow: hidden;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
display: -webkit-box;
word-break: break-all;
}
.input-before-name {
width: 120px;
}
</style>
<title>商户管理</title>
</head>
<body>
<div class="merchant" id="app">
<main>
<div class="context-block">
<div class="search-block">
<div class="h20"></div>
<form class="layui-form" lay-filter="searchFilter" id="searchForm">
<div class="layui-inline hide" id="operateEl">
<button class="layui-btn mb5 createBtn" id="addBtn">
<i class="layui-icon layui-icon-addition"></i>
<span>创建商户</span>
</button>
</div>
<!-- <div class="hide"> -->
<div id="relevancyEl" class="layui-inline hide">
<button class="layui-btn mb5" id="relevancyBtn">
<img class="relevancyImg" src="../../css/img/relevancy.png" alt="" />
门店账户关联企微
</button>
</div>
<head>
<meta charset="utf-8" />
<meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<style>
.h20 {
height: 20px;
}
.mb5 {
margin-bottom: 5px;
}
.merchant .layui-table {
margin: 0;
width: 100%;
}
.merchant #searchForm .layui-inline {
margin-bottom: 5px;
vertical-align: top;
}
.layui-btn-xs {
cursor: pointer;
}
.layui-form-label {
width: 130px;
}
.accountLevel,
.customerState,
.accountType,
.mode {
margin-left: 30px;
}
.input-before-name {
width: 80px;
text-align: right;
display: inline-block;
}
.commonInput {
width: 260px;
}
#relevancyBtn {
display: flex;
align-items: center;
}
.relevancyImg {
width: 20px;
height: 20px;
margin-right: 5px;
}
.hide {
display: none;
}
.show {
display: inline-block;
}
.merchantTable .layui-table-cell {
/* height: auto; */
/* line-height: 88px; */
white-space: normal;
overflow: hidden;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
display: -webkit-box;
word-break: break-all;
}
.input-before-name {
width: 120px;
}
input[type=number] {
-moz-appearance: textfield;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
</style>
<title>商户管理</title>
</head>
<body>
<div class="merchant" id="app">
<main>
<div class="context-block">
<div class="search-block">
<div class="h20"></div>
<form class="layui-form" lay-filter="searchFilter" id="searchForm">
<div class="layui-inline hide" id="operateEl">
<button class="layui-btn mb5 createBtn" id="addBtn">
<i class="layui-icon layui-icon-addition"></i>
<span>创建商户</span>
</button>
</div>
<!-- <div class="hide"> -->
<div id="relevancyEl" class="layui-inline hide">
<button class="layui-btn mb5" id="relevancyBtn">
<img class="relevancyImg" src="../../css/img/relevancy.png" alt="" />
门店账户关联企微
</button>
</div>
<!-- </div> -->
<div class="layui-inline singleRow">
<div id="relevancySearch" class="layui-inline">
<div class="layui-inline channel">
<label class="layui-form-label">是否已关联企微:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="isRelevance">
<option value="0">全部</option>
<option value="1">已关联</option>
<option value="2">未关联</option>
</select>
</div>
</div>
</div>
<div id="channelBox" class="hide" style="display: inline-block">
<div class="layui-inline">
<label class="layui-form-label">渠道:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="channelId" id="channelIdEl">
<option value="">全部</option>
</select>
</div>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">账户等级:</label>
<div class="layui-input-inline" style="width: 246px;">
<select name="merchantAccountLevel" id="accountLevelEl">
<option value="">全部</option>
<!-- </div> -->
<div class="layui-inline singleRow">
<div id="relevancySearch" class="layui-inline">
<div class="layui-inline channel">
<label class="layui-form-label">是否已关联企微:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="isRelevance">
<option value="0">全部</option>
<option value="1">已关联</option>
<option value="2">未关联</option>
</select>
</div>
</div>
</div>
<div id="channelBox" class="hide" style="display: inline-block">
<div class="layui-inline">
<label class="layui-form-label">账户状态:</label>
<label class="layui-form-label">渠道:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="status" id="searchStatusEl">
<select name="channelId" id="channelIdEl">
<option value="">全部</option>
</select>
</div>
</div>
<div class="layui-inline loginName" style="margin-left: 40px;">
<div class="layui-input-inline updateSelectAngle" style="width: 120px">
<select name="accountOrPhone" lay-filter="nameFilter">
<option value="0">登录账号名</option>
<option value="1">手机号</option>
</select>
</div>
<!-- margin-left: -5px -->
<div class="layui-input-inline" style="width: 246px; margin-left: -4px">
<input
class="layui-input"
type="text"
placeholder="请输入"
name="merchantLoginAccount"
id="updateCircleAngle"
onkeydown="if (event.keyCode == 13) {event.keyCode = 0;event.returnValue = false;}"
/>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">账户等级:</label>
<div class="layui-input-inline" style="width: 246px;">
<select name="merchantAccountLevel" id="accountLevelEl">
<option value="">全部</option>
</select>
</div>
<div id="accountType" class="layui-inline hide">
<label class="layui-form-label">账户类型:</label>
<div class="layui-input-inline" style="width: 246px;">
<select name="accounttypeId" id="accountTypeIdEl">
<option value="">全部</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">账户状态:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="status" id="searchStatusEl">
<option value="">全部</option>
</select>
</div>
<div id="model" class="layui-inline hide">
<label class="layui-form-label">模式:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="merchantModel" id="searchModelEl">
<option value="">全部</option>
</select>
</div>
</div>
<div class="layui-inline loginName" style="margin-left: 40px;">
<div class="layui-input-inline updateSelectAngle" style="width: 120px">
<select name="accountOrPhone" lay-filter="nameFilter">
<option value="0">登录账号名</option>
<option value="1">手机号</option>
</select>
</div>
<div id="parentMerchant" class="layui-inline hide">
<label class="layui-form-label">上级商户:</label>
<div class="layui-input-inline" style="width: 246px">
<input class="layui-input" type="text" placeholder="请输入" name="parentMerchant" />
</div>
</div>
<div style="display: inline-flex; justify-content: space-between">
<div class="layui-inline customerStatus">
<div class="layui-input-inline">
<input
class="layui-input"
type="text"
style="width: 367px; margin-left: 40px;"
name="merchantName"
placeholder="请输入商户名称/关联的企业微信名"
onkeydown="if (event.keyCode == 13) {event.keyCode = 0;event.returnValue = false;}"
/>
</div>
</div>
<!-- margin-left: -5px -->
<div class="layui-input-inline" style="width: 246px; margin-left: -4px">
<input class="layui-input" type="text" placeholder="请输入" name="merchantLoginAccount"
id="updateCircleAngle"
onkeydown="if (event.keyCode == 13) {event.keyCode = 0;event.returnValue = false;}" />
</div>
</div>
<div id="accountType" class="layui-inline hide">
<label class="layui-form-label">账户类型:</label>
<div class="layui-input-inline" style="width: 246px;">
<select name="accounttypeId" id="accountTypeIdEl">
<option value="">全部</option>
</select>
</div>
</div>
<div id="model" class="layui-inline hide">
<label class="layui-form-label">模式:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="merchantModel" id="searchModelEl">
<option value="">全部</option>
</select>
</div>
</div>
<div id="parentMerchant" class="layui-inline hide">
<label class="layui-form-label">上级商户:</label>
<div class="layui-input-inline" style="width: 246px">
<input class="layui-input" type="text" placeholder="请输入" name="parentMerchant" />
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">上级商户号:</label>
<div class="layui-input-inline" style="width: 246px">
<input class="layui-input" maxlength="11" type="number" placeholder="请输入" name="parentMerchantNo" />
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">商户号:</label>
<div class="layui-input-inline" style="width: 246px">
<input class="layui-input" maxlength="11" type="number" placeholder="请输入" name="merchantNo" />
</div>
<div class="layui-inline searchInputBtn" style="float: right;">
<button class="layui-btn" lay-submit lay-filter="searchSubmit">查询</button>
</div>
<div style="display: inline-flex; justify-content: space-between">
<div class="layui-inline customerStatus">
<div class="layui-input-inline">
<input class="layui-input" type="text" style="width: 367px; margin-left: 40px;" name="merchantName"
placeholder="请输入商户名称/关联的企业微信名"
onkeydown="if (event.keyCode == 13) {event.keyCode = 0;event.returnValue = false;}" />
</div>
</div>
</div>
</form>
<div class="table-page merchantTable">
<table class="layui-table" id="merchantTable" lay-filter="merchant-table-filter"></table>
<div id="merchantPage" class="align-left"></div>
<div class="layui-inline searchInputBtn" style="float: right;">
<button class="layui-btn" lay-submit lay-filter="searchSubmit">查询</button>
</div>
</div>
</form>
<div class="table-page merchantTable">
<table class="layui-table" id="merchantTable" lay-filter="merchant-table-filter"></table>
<div id="merchantPage" class="align-left"></div>
</div>
</div>
</main>
</div>
</div>
</main>
</div>
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="/js/load.js"></script>
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="/js/load.js"></script>
<script type="text/html" id="accountTypeTpl">
<script type="text/html" id="accountTypeTpl">
<ul>
{{# var accountTypes=d.accountTypeNames.split(",")}} {{# }} {{# if((d.accountTypeNames)){ }} {{# layui.each(accountTypes,function(index,item){ }}
<li><span>{{item}}</span></li>
......@@ -232,7 +246,7 @@
{{# } }}
</ul>
</script>
<script type="text/html" id="merchantBtns">
<script type="text/html" id="merchantBtns">
<div>
<a class="layui-btn-xs" lay-event="handleDetail">查看</a>
{{# if((d.btn.edit)){ }}
......@@ -250,644 +264,645 @@
{{# } }}
</div>
</script>
<script>
layui.use(['gtree', 'request', 'helper', 'table', 'laypage', 'layer'], function() {
var tree = layui.gtree
var request = layui.request
var table = layui.table
var laypage = layui.laypage
var form = layui.form
var $ = layui.$
var helper = layui.helper
var accountInfo = helper.store.get('accountInfo')
window.isDxternal = accountInfo ? 1 : 2 // 1 SCRM, default 运营平台
var baseData = {
statusList: [],
channelList: [],
accountLevelList: [],
accountTypeList: [],
modelList: []
}
<script>
layui.use(['gtree', 'request', 'helper', 'table', 'laypage', 'layer'], function () {
var tree = layui.gtree
var request = layui.request
var table = layui.table
var laypage = layui.laypage
var form = layui.form
var $ = layui.$
var helper = layui.helper
var accountInfo = helper.store.get('accountInfo')
window.isDxternal = accountInfo ? 1 : 2 // 1 SCRM, default 运营平台
var baseData = {
statusList: [],
channelList: [],
accountLevelList: [],
accountTypeList: [],
modelList: []
}
var page = {
pageNum: 1,
pageSize: 10
}
var pageOptions = {
elem: 'merchantPage',
groups: 5,
layout: ['count', 'page', 'skip'],
jump: function(obj, first) {
//obj包含了当前分页的所有参数,比如:
// console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
// console.log(obj.limit); //得到每页显示的条数
page.pageNum = obj.curr
page.pageSize = obj.limit
//首次不执行
if (!first) {
//do something
getTabelList()
}
var page = {
pageNum: 1,
pageSize: 10
}
var pageOptions = {
elem: 'merchantPage',
groups: 5,
layout: ['count', 'page', 'skip'],
jump: function (obj, first) {
//obj包含了当前分页的所有参数,比如:
// console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
// console.log(obj.limit); //得到每页显示的条数
page.pageNum = obj.curr
page.pageSize = obj.limit
//首次不执行
if (!first) {
//do something
getTabelList()
}
}
var cols = [
{
field: 'index',
title: '序号',
align: 'center',
width: 60
},
{
field: 'merchantNo',
title: '商户号',
align: 'center',
width: 100
},
{
field: 'merchantName',
title: '商户名称',
align: 'center',
width: 130
},
{
field: 'merchantModelName',
title: '模式',
align: 'center',
width: 130
},
{
field: 'accountTypeNames',
title: '账户类型',
align: 'left',
width: 140,
templet: '#accountTypeTpl'
},
{
field: 'merchantLoginAccount',
title: '登录账户',
align: 'center',
width: 108
},
{
field: 'accountLevelName',
title: '账户等级',
align: 'center',
width: 100
},
{
field: 'parentMerchant',
title: '上级商户',
align: 'center',
width: 120
},
{
field: 'statusName',
title: '账户状态',
align: 'center',
width: 100
},
{
field: 'merchantLegalPerson',
title: '联系人',
align: 'center',
width: 100
},
{
field: 'merchantLegalPersonPhone',
title: '手机号',
align: 'center',
width: 120
},
{
field: 'entmicroName',
title: '关联的企业微信',
align: 'center',
width: 130
// }, {
// field: 'merchantAddress',
// title: '商户地址',
// align: 'center',
// width: 160
},
{
field: 'updatedTime',
title: '更新时间',
align: 'center',
width: 90
},
{
align: 'left',
title: '操作',
toolbar: '#merchantBtns',
width: 230,
fixed: 'right'
// },
// {
// align: 'left',
// title: '账户开关',
// toolbar: '#vaildPeriod',
// width: 150,
// fixed: 'right'
}
]
var colums = [
{
field: 'index',
title: '序号',
align: 'center',
width: 60
},
{
field: 'merchantName',
title: '商户名称',
align: 'center',
width: 150
},
{
field: 'entmicroName',
title: '关联的企业微信',
align: 'center',
width: 130
},
{
field: 'accountTypeNames',
title: '账户类型',
align: 'center',
width: 150,
templet: '#accountTypeTpl'
},
{
field: 'merchantLoginAccount',
title: '登录账户',
align: 'center',
width: 180
},
{
field: 'accountLevelName',
title: '账户等级',
align: 'center',
width: 100
},
{
field: 'parentMerchant',
title: '上级商户',
align: 'center',
width: 100
},
{
field: 'statusName',
title: '账户状态',
align: 'center',
width: 100
},
{
field: 'merchantLegalPerson',
title: '联系人',
align: 'center',
width: 100
},
{
field: 'merchantLegalPersonPhone',
title: '手机号',
align: 'center',
width: 120
},
{
field: 'updatedTime',
title: '更新时间',
align: 'center',
width: 180
},
{
align: 'center',
title: '操作',
toolbar: '#merchantBtns',
width: 150,
fixed: 'right'
}
]
var merchantTable = table.render({
elem: '#merchantTable',
page: false,
skin: 'nob',
height: 'full-300',
cols: window.isDxternal != 1 ? [cols] : [colums],
done: function() {
$("[data-field='lowerHairPath']").css('display', 'none')
$('.layui-table-main tr').each(function(index, val) {
$($('.layui-table-fixed-l .layui-table-body tbody tr')[index]).height($(val).height())
$($('.layui-table-fixed-r .layui-table-body tbody tr')[index]).height($(val).height())
})
//动态监听表头高度变化,冻结行跟着改变高度
$('.layui-table-header tr').resize(function() {
$('.layui-table-header tr').each(function(index, val) {
$($('.layui-table-fixed .layui-table-header table tr')[index]).height($(val).height())
})
})
//初始化高度,使得冻结行表头高度一致
$('.layui-table-header tr').each(function(index, val) {
}
var cols = [
{
field: 'index',
title: '序号',
align: 'center',
width: 60
},
{
field: 'merchantNo',
title: '商户号',
align: 'center',
width: 100
},
{
field: 'merchantName',
title: '商户名称',
align: 'center',
width: 130
},
{
field: 'merchantModelName',
title: '模式',
align: 'center',
width: 130
},
{
field: 'accountTypeNames',
title: '账户类型',
align: 'left',
width: 140,
templet: '#accountTypeTpl'
},
{
field: 'merchantLoginAccount',
title: '登录账户',
align: 'center',
width: 108
},
{
field: 'accountLevelName',
title: '账户等级',
align: 'center',
width: 100
},
{
field: 'parentMerchant',
title: '上级商户',
align: 'center',
width: 120
},
{
field: 'statusName',
title: '账户状态',
align: 'center',
width: 100
},
{
field: 'merchantLegalPerson',
title: '联系人',
align: 'center',
width: 100
},
{
field: 'merchantLegalPersonPhone',
title: '手机号',
align: 'center',
width: 120
},
{
field: 'entmicroName',
title: '关联的企业微信',
align: 'center',
width: 130
// }, {
// field: 'merchantAddress',
// title: '商户地址',
// align: 'center',
// width: 160
},
{
field: 'updatedTime',
title: '更新时间',
align: 'center',
width: 90
},
{
align: 'left',
title: '操作',
toolbar: '#merchantBtns',
width: 230,
fixed: 'right'
// },
// {
// align: 'left',
// title: '账户开关',
// toolbar: '#vaildPeriod',
// width: 150,
// fixed: 'right'
}
]
var colums = [
{
field: 'index',
title: '序号',
align: 'center',
width: 60
},
{
field: 'merchantName',
title: '商户名称',
align: 'center',
width: 150
},
{
field: 'entmicroName',
title: '关联的企业微信',
align: 'center',
width: 130
},
{
field: 'accountTypeNames',
title: '账户类型',
align: 'center',
width: 150,
templet: '#accountTypeTpl'
},
{
field: 'merchantLoginAccount',
title: '登录账户',
align: 'center',
width: 180
},
{
field: 'accountLevelName',
title: '账户等级',
align: 'center',
width: 100
},
{
field: 'parentMerchant',
title: '上级商户',
align: 'center',
width: 100
},
{
field: 'statusName',
title: '账户状态',
align: 'center',
width: 100
},
{
field: 'merchantLegalPerson',
title: '联系人',
align: 'center',
width: 100
},
{
field: 'merchantLegalPersonPhone',
title: '手机号',
align: 'center',
width: 120
},
{
field: 'updatedTime',
title: '更新时间',
align: 'center',
width: 180
},
{
align: 'center',
title: '操作',
toolbar: '#merchantBtns',
width: 150,
fixed: 'right'
}
]
var merchantTable = table.render({
elem: '#merchantTable',
page: false,
skin: 'nob',
height: 'full-300',
cols: window.isDxternal != 1 ? [cols] : [colums],
done: function () {
$("[data-field='lowerHairPath']").css('display', 'none')
$('.layui-table-main tr').each(function (index, val) {
$($('.layui-table-fixed-l .layui-table-body tbody tr')[index]).height($(val).height())
$($('.layui-table-fixed-r .layui-table-body tbody tr')[index]).height($(val).height())
})
//动态监听表头高度变化,冻结行跟着改变高度
$('.layui-table-header tr').resize(function () {
$('.layui-table-header tr').each(function (index, val) {
$($('.layui-table-fixed .layui-table-header table tr')[index]).height($(val).height())
})
//动态监听表体高度变化,冻结行跟着改变高度
$('.layui-table-body tr').resize(function() {
$('.layui-table-body tr').each(function(index, val) {
$($('.layui-table-fixed .layui-table-body table tr')[index]).height($(val).height())
})
})
//初始化高度,使得冻结行表体高度一致
$('.layui-table-body tr').each(function(index, val) {
})
//初始化高度,使得冻结行表头高度一致
$('.layui-table-header tr').each(function (index, val) {
$($('.layui-table-fixed .layui-table-header table tr')[index]).height($(val).height())
})
//动态监听表体高度变化,冻结行跟着改变高度
$('.layui-table-body tr').resize(function () {
$('.layui-table-body tr').each(function (index, val) {
$($('.layui-table-fixed .layui-table-body table tr')[index]).height($(val).height())
})
}
})
})
//初始化高度,使得冻结行表体高度一致
$('.layui-table-body tr').each(function (index, val) {
$($('.layui-table-fixed .layui-table-body table tr')[index]).height($(val).height())
})
}
})
table.on('tool(merchant-table-filter)', function(obj) {
var eventName = obj.event
var row = obj.data
switch (eventName) {
// 查看
case 'handleDetail':
go('merchant', 'detail', {
merchantId: row.id
})
break
// 修改
case 'handleEdit':
// editLevel - 1-创建新商户;2-创建子商户;3-修改
// step - 1-基本信息;2-权限树
// merchantAccountLevel 账户等级(1-工厂;2-省代;3-市代;4-门店)
go('merchant', 'edit', {
editLevel: 3,
id: row.id,
parentId: row.parentId,
isFactory: row.merchantAccountLevel == 1,
step: 1,
model: row.merchantModel,
status: row.status,
merchantAccountLevel: row.merchantAccountLevel
})
break
case 'handleAuthority':
// editLevel - 1-创建新商户;2-创建子商户;3-修改
// step - 1-基本信息;2-权限树
// merchantAccountLevel 账户等级
go('merchant', 'edit', {
editLevel: 3,
id: row.id,
parentId: row.parentId,
isFactory: row.merchantAccountLevel == 1,
id: row.id,
step: 2
})
break
// 创建子商户/门店
case 'handleAddMerchant':
// 1-创建新商户;2-创建子商户;3-修改
go('merchant', 'addSubMerchant', {
editLevel: 2,
parentId: row.id,
isFactory: 'false',
step: 1,
merchantAccountLevel: row.merchantAccountLevel
})
break
// 创建员工
case 'handleAddStaff':
go('employee', 'add', {
merchantId: row.id,
merchantName: row.merchantName,
channel: 'merchant'
})
break
// 修改账户有效期
case 'handleVaildPeriod':
var area = ['580px', '230px']
if (row.merchantAccountLevel == 4) {
// area = ['750px', '480px']
area = ['700px', '480px']
}
layer.open({
type: 2,
title: '',
closeBtn: 0,
area: area,
fixed: false, //不固定
// maxmin: true,
btn: ['确定', '取消'],
content:
'validPeriodForm.html?id=' +
row.id +
'&effectiveStarttime=' +
row.effectiveStarttime +
'&expireDate=' +
row.expireDate +
'&status=' +
row.status +
'&merchantAccountLevel=' +
row.merchantAccountLevel,
yes: function(index, layero) {
var body = layer.getChildFrame('body', index)
helper.store.set('isRefresh', false)
body.find('#periodVerifyBtn').click()
},
end: function() {
var isRefresh = helper.store.get('isRefresh')
if (isRefresh) {
getTabelList()
layer.msg('修改成功', {
icon: 1
})
}
helper.store.remove('isRefresh')
table.on('tool(merchant-table-filter)', function (obj) {
var eventName = obj.event
var row = obj.data
switch (eventName) {
// 查看
case 'handleDetail':
go('merchant', 'detail', {
merchantId: row.id
})
break
// 修改
case 'handleEdit':
// editLevel - 1-创建新商户;2-创建子商户;3-修改
// step - 1-基本信息;2-权限树
// merchantAccountLevel 账户等级(1-工厂;2-省代;3-市代;4-门店)
go('merchant', 'edit', {
editLevel: 3,
id: row.id,
parentId: row.parentId,
isFactory: row.merchantAccountLevel == 1,
step: 1,
model: row.merchantModel,
status: row.status,
merchantAccountLevel: row.merchantAccountLevel
})
break
case 'handleAuthority':
// editLevel - 1-创建新商户;2-创建子商户;3-修改
// step - 1-基本信息;2-权限树
// merchantAccountLevel 账户等级
go('merchant', 'edit', {
editLevel: 3,
id: row.id,
parentId: row.parentId,
isFactory: row.merchantAccountLevel == 1,
id: row.id,
step: 2
})
break
// 创建子商户/门店
case 'handleAddMerchant':
// 1-创建新商户;2-创建子商户;3-修改
go('merchant', 'addSubMerchant', {
editLevel: 2,
parentId: row.id,
isFactory: 'false',
step: 1,
merchantAccountLevel: row.merchantAccountLevel
})
break
// 创建员工
case 'handleAddStaff':
go('employee', 'add', {
merchantId: row.id,
merchantName: row.merchantName,
channel: 'merchant'
})
break
// 修改账户有效期
case 'handleVaildPeriod':
var area = ['580px', '230px']
if (row.merchantAccountLevel == 4) {
// area = ['750px', '480px']
area = ['700px', '480px']
}
layer.open({
type: 2,
title: '',
closeBtn: 0,
area: area,
fixed: false, //不固定
// maxmin: true,
btn: ['确定', '取消'],
content:
'validPeriodForm.html?id=' +
row.id +
'&effectiveStarttime=' +
row.effectiveStarttime +
'&expireDate=' +
row.expireDate +
'&status=' +
row.status +
'&merchantAccountLevel=' +
row.merchantAccountLevel,
yes: function (index, layero) {
var body = layer.getChildFrame('body', index)
helper.store.set('isRefresh', false)
body.find('#periodVerifyBtn').click()
},
end: function () {
var isRefresh = helper.store.get('isRefresh')
if (isRefresh) {
getTabelList()
layer.msg('修改成功', {
icon: 1
})
}
})
break
}
})
helper.store.remove('isRefresh')
}
})
break
}
})
init()
init()
$('#addBtn').on('click', function(e) {
// 1-创建新商户;2-创建子商户;3-修改
// e.target.blur()
go('merchant', 'add', {
editLevel: 1,
step: 1,
isFactory: 'true'
})
return false
$('#addBtn').on('click', function (e) {
// 1-创建新商户;2-创建子商户;3-修改
// e.target.blur()
go('merchant', 'add', {
editLevel: 1,
step: 1,
isFactory: 'true'
})
return false
})
$('#relevancyBtn').on('click', function() {
$messenger.emit('route-to', { path: '/settings/baseInfo/relevance' })
})
// 搜索绑定事件
form.on('submit(searchSubmit)', function() {
getTabelList(true)
return false
})
$('#relevancyBtn').on('click', function () {
$messenger.emit('route-to', { path: '/settings/baseInfo/relevance' })
})
// 搜索绑定事件
form.on('submit(searchSubmit)', function () {
getTabelList(true)
return false
})
// 查询
function handleSearch() {
getTabelList(true)
}
// 查询
function handleSearch() {
getTabelList(true)
}
// 获取表格数据
function getTabelList(isResetPageNum) {
var params = {
pageNum: page.pageNum,
pageSize: page.pageSize,
method: 'merchants.api.menu.findMerchantByPage'
// 获取表格数据
function getTabelList(isResetPageNum) {
var params = {
pageNum: page.pageNum,
pageSize: page.pageSize,
method: 'merchants.api.menu.findMerchantByPage'
}
var searchData = $('#searchForm [name]').serializeArray()
$.each(searchData, function () {
if (this.name == 'merchantLoginAccount') {
var attrName = params.accountOrPhone == '0' ? 'merchantLoginAccount' : 'merchantLegalPersonPhone'
params[attrName] = this.value
} else {
params[this.name] = this.value
}
var searchData = $('#searchForm [name]').serializeArray()
$.each(searchData, function() {
if (this.name == 'merchantLoginAccount') {
var attrName = params.accountOrPhone == '0' ? 'merchantLoginAccount' : 'merchantLegalPersonPhone'
params[attrName] = this.value
} else {
params[this.name] = this.value
})
request(params, function (res) {
var data = helper.formateNullFieldData(res.data)
$.each(data.data, function (index, item) {
item.index = index + 1 + page.pageSize * (page.pageNum - 1)
item.btn = {
edit: false,
createSubMerchant: false,
createStaff: false,
editPeriod: false
}
})
request(params, function(res) {
var data = helper.formateNullFieldData(res.data)
$.each(data.data, function(index, item) {
item.index = index + 1 + page.pageSize * (page.pageNum - 1)
item.btn = {
edit: false,
createSubMerchant: false,
createStaff: false,
editPeriod: false
}
/** btn
* check - 查看(无需判断,均有)
* edit - 修改
* createSubMerchant - 创建子商户/门店
* createStaff - 创建员工
* editPeriod - 修改账户有效期
* **/
// status(账户状态 - 列表):1-草稿;2-正常;3-注销;4-过期
// merchantAccountLevel(账户等级 - 列表):1-工厂;2-省代;3-市代;4-门店
// 外部系统
switch (window.isDxternal) {
case 1:
if (item.status == 2) {
// 本身
if (item.merchantNo == accountInfo.merchantId) {
item.btn.createStaff = true
if (item.merchantAccountLevel != 4) {
item.btn.createSubMerchant = true
}
} else {
// 下级商户
item.btn.edit = true
item.btn.editPeriod = true
// 直属门店
if (item.merchantAccountLevel == 4) {
if (item.parentId == accountInfo.merchantId) {
item.btn.createStaff = true
}
} else {
item.btn.createSubMerchant = true
}
}
} else if (item.status != 3) {
item.btn.edit = true
if (item.status == 4) {
item.btn.editPeriod = true
}
}
break
default:
// 超管登录
if (item.status != 3) {
item.btn.edit = true
}
if (item.status == 2) {
/** btn
* check - 查看(无需判断,均有)
* edit - 修改
* createSubMerchant - 创建子商户/门店
* createStaff - 创建员工
* editPeriod - 修改账户有效期
* **/
// status(账户状态 - 列表):1-草稿;2-正常;3-注销;4-过期
// merchantAccountLevel(账户等级 - 列表):1-工厂;2-省代;3-市代;4-门店
// 外部系统
switch (window.isDxternal) {
case 1:
if (item.status == 2) {
// 本身
if (item.merchantNo == accountInfo.merchantId) {
item.btn.createStaff = true
if (item.merchantAccountLevel != 4) {
item.btn.createSubMerchant = true
}
} else {
// 下级商户
item.btn.edit = true
item.btn.editPeriod = true
// 直属门店
if (item.merchantAccountLevel == 4) {
if (item.parentId == accountInfo.merchantId) {
item.btn.createStaff = true
}
} else {
item.btn.createSubMerchant = true
}
}
if (item.status != 1) {
} else if (item.status != 3) {
item.btn.edit = true
if (item.status == 4) {
item.btn.editPeriod = true
}
}
// if (isDxternal) {
// // 状态 - 正常
// if (item.status == 2) {
// // 本身
// if (item.id == user.merchantId) {
// item.btn.createStaff = true
// if (item.merchantAccountLevel != 4) {
// item.btn.createSubMerchant = true
// }
// } else {
// // 下级商户
// // console.log(item)
// item.btn.edit = true
// item.btn.editPeriod = true
// // 直属门店
// if (item.merchantAccountLevel == 4) {
// if (item.parentId == user.merchantId) {
// item.btn.createStaff = true
// }
// } else {
// item.btn.createSubMerchant = true
// }
// }
// } else if (item.status != 3) {
// item.btn.edit = true
// if (item.status == 4) {
// item.btn.editPeriod = true
// }
// }
// } else {
// // 超管登录
// if (item.status != 3) {
// item.btn.edit = true
// }
// if (item.status == 2) {
// item.btn.createStaff = true
// if (item.merchantAccountLevel != 4) {
// item.btn.createSubMerchant = true
// }
// }
// if (item.status != 1) {
// item.btn.editPeriod = true
// }
// }
})
var options = {
data: data.data
}
pageOptions.count = data.count
if (isResetPageNum) {
pageOptions.curr = 1
}
break
default:
// 超管登录
if (item.status != 3) {
item.btn.edit = true
}
if (item.status == 2) {
item.btn.createStaff = true
if (item.merchantAccountLevel != 4) {
item.btn.createSubMerchant = true
}
}
if (item.status != 1) {
item.btn.editPeriod = true
}
}
laypage.render(pageOptions)
merchantTable.reload(options)
// if (isDxternal) {
// // 状态 - 正常
// if (item.status == 2) {
// // 本身
// if (item.id == user.merchantId) {
// item.btn.createStaff = true
// if (item.merchantAccountLevel != 4) {
// item.btn.createSubMerchant = true
// }
// } else {
// // 下级商户
// // console.log(item)
// item.btn.edit = true
// item.btn.editPeriod = true
// // 直属门店
// if (item.merchantAccountLevel == 4) {
// if (item.parentId == user.merchantId) {
// item.btn.createStaff = true
// }
// } else {
// item.btn.createSubMerchant = true
// }
// }
// } else if (item.status != 3) {
// item.btn.edit = true
// if (item.status == 4) {
// item.btn.editPeriod = true
// }
// }
// } else {
// // 超管登录
// if (item.status != 3) {
// item.btn.edit = true
// }
// if (item.status == 2) {
// item.btn.createStaff = true
// if (item.merchantAccountLevel != 4) {
// item.btn.createSubMerchant = true
// }
// }
// if (item.status != 1) {
// item.btn.editPeriod = true
// }
// }
})
}
var options = {
data: data.data
}
pageOptions.count = data.count
if (isResetPageNum) {
pageOptions.curr = 1
}
laypage.render(pageOptions)
merchantTable.reload(options)
})
}
// 获取字典数据
function getDictData(dictType, fn) {
request(
{
method: 'merchants.api.menu.findAllDictData',
dictType: dictType
},
function(res) {
fn && fn(res)
}
)
}
// 获取字典数据
function getDictData(dictType, fn) {
request(
{
method: 'merchants.api.menu.findAllDictData',
dictType: dictType
},
function (res) {
fn && fn(res)
}
)
}
// 设置option
function setSelectOption(elName, listName, optionId, optionLabel) {
var el = $(elName)
$.each(baseData[listName], function(index, item) {
el.append(new Option(item[optionLabel], item[optionId]))
})
form.render('select')
}
// 设置option
function setSelectOption(elName, listName, optionId, optionLabel) {
var el = $(elName)
$.each(baseData[listName], function (index, item) {
el.append(new Option(item[optionLabel], item[optionId]))
})
form.render('select')
}
// 获取有效期
function getVaildPeriod() {
getDictData('merchant_status', function(res) {
baseData.statusList = res.data
setSelectOption('#searchStatusEl', 'statusList', 'dictValue', 'dictLabel')
})
}
// 获取有效期
function getVaildPeriod() {
getDictData('merchant_status', function (res) {
baseData.statusList = res.data
setSelectOption('#searchStatusEl', 'statusList', 'dictValue', 'dictLabel')
})
}
// 获取渠道
function getChannel() {
getDictData('channel', function(res) {
baseData.channelList = res.data
setSelectOption('#channelIdEl', 'channelList', 'dictValue', 'dictLabel')
})
}
// 获取渠道
function getChannel() {
getDictData('channel', function (res) {
baseData.channelList = res.data
setSelectOption('#channelIdEl', 'channelList', 'dictValue', 'dictLabel')
})
}
// 获取账户等级
function getAccountLevel() {
getDictData('account_level', function(res) {
baseData.accountLevelList = res.data
setSelectOption('#accountLevelEl', 'accountLevelList', 'dictValue', 'dictLabel')
})
}
// 获取账户等级
function getAccountLevel() {
getDictData('account_level', function (res) {
baseData.accountLevelList = res.data
setSelectOption('#accountLevelEl', 'accountLevelList', 'dictValue', 'dictLabel')
})
}
// 获取账户类型
function getAccountType() {
getDictData('account_type', function(res) {
baseData.accountTypeList = res.data
setSelectOption('#accountTypeIdEl', 'accountTypeList', 'dictValue', 'dictLabel')
})
}
// 获取账户类型
function getAccountType() {
getDictData('account_type', function (res) {
baseData.accountTypeList = res.data
setSelectOption('#accountTypeIdEl', 'accountTypeList', 'dictValue', 'dictLabel')
})
}
// 获取模式
function getModel() {
getDictData('merchant_model', function(res) {
baseData.modelList = res.data
setSelectOption('#searchModelEl', 'modelList', 'dictValue', 'dictLabel')
})
}
// 获取模式
function getModel() {
getDictData('merchant_model', function (res) {
baseData.modelList = res.data
setSelectOption('#searchModelEl', 'modelList', 'dictValue', 'dictLabel')
})
}
// SCRM系统 搜索加按钮
function glBtn() {
$('#operateEl').remove()
$('#channelBox').remove()
if (accountInfo.model == 1 && accountInfo.merchantAccountLevel == 1) {
$('#relevancyEl').removeClass('hide')
$('#relevancyEl').addClass('show')
}
if (accountInfo.merchantAccountLevel == 4) {
$('#relevancySearch').addClass('hide')
}
// $('#relevancySearch').addClass('show')
$('#model').remove()
$('#accountType').remove()
// SCRM系统 搜索加按钮
function glBtn() {
$('#operateEl').remove()
$('#channelBox').remove()
if (accountInfo.model == 1 && accountInfo.merchantAccountLevel == 1) {
$('#relevancyEl').removeClass('hide')
$('#relevancyEl').addClass('show')
}
// gl功能点
function scrmBtn() {
// $('#channelBox').remove()
$('#operateEl').addClass('show')
$('#channelBox').addClass('show')
// $('#relevancyEl').remove()
// $('#relevancySearch').remove()
$('#model').addClass('show')
$('#accountType').addClass('show')
$('#parentMerchant').addClass('show')
$('#parentMerchant').removeClass('hide')
if (accountInfo.merchantAccountLevel == 4) {
$('#relevancySearch').addClass('hide')
}
// $('#relevancySearch').addClass('show')
$('#model').remove()
$('#accountType').remove()
}
// 运营平台
function init() {
switch (window.isDxternal) {
// scrm 系统
case 1:
glBtn()
break
// 广联运营系统
default:
getChannel()
getModel()
scrmBtn()
}
// if (!isDxternal) {
// getChannel()
// getAccountLevel()
// getAccountType()
// getModel()
// } else {
// elRemove()
// }
getAccountLevel()
getAccountType()
getVaildPeriod()
getTabelList()
// gl功能点
function scrmBtn() {
// $('#channelBox').remove()
$('#operateEl').addClass('show')
$('#channelBox').addClass('show')
// $('#relevancyEl').remove()
// $('#relevancySearch').remove()
$('#model').addClass('show')
$('#accountType').addClass('show')
$('#parentMerchant').addClass('show')
$('#parentMerchant').removeClass('hide')
}
// 运营平台
function init() {
switch (window.isDxternal) {
// scrm 系统
case 1:
glBtn()
break
// 广联运营系统
default:
getChannel()
getModel()
scrmBtn()
}
})
</script>
</body>
</html>
// if (!isDxternal) {
// getChannel()
// getAccountLevel()
// getAccountType()
// getModel()
// } else {
// elRemove()
// }
getAccountLevel()
getAccountType()
getVaildPeriod()
getTabelList()
}
})
</script>
</body>
</html>
\ 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!