Commit b6aa5d56 by cwq0219

商户管理

1 parent b3900535
<!DOCTYPE html>
<html lang="zh">
<head>
<head>
<meta charset="utf-8" />
<meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
......@@ -10,8 +11,9 @@
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<link rel="stylesheet" type="text/css" href="/css/merchant.css" />
<title>商户管理</title>
</head>
<body>
</head>
<body>
<div id="app">
<main class="bg-white wrapper detail">
<div class="layui-tab">
......@@ -104,16 +106,19 @@
<option value="021">上海</option>
<option value="0571">杭州</option>
</select>
<div class="layui-tab" lay-filter="funAuth">
<ul class="layui-tab-title"></ul>
<div class="layui-tab-content"></div>
</div>
</h3>
</div>
<div class="layui-tab-item">
<div class="wrapper-merchant">
<div class="merchant-left">
<div>
<div>深圳</div>
<div>商户号</div>
<div>宁接口了接口了就</div>
</div>
<div id="secondmerchantName"></div>
<div id="secondmerchantId">商户号</div>
<div id="">宁接口了接口了就</div>
</form>
<form class="layui-form" action="">
<div class="layui-inline">
<div class="layui-input-inline">
......@@ -194,13 +199,15 @@
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script src="/js/load.js"></script>
<script>
layui.use(['request', 'gtree', 'element', 'helper', 'table'], function() {
layui.use(['request', 'gtree', 'element', 'helper', 'table', 'form'], function () {
var $ = layui.$
var request = layui.request
var tree = layui.gtree
var helper = layui.helper
var table = layui.table
var id = qs('id')
var form = layui.form
var merchantId = qs('merchantId')
var merchantInfo = {}
var basicArr = [
'merchantLoginAccount',
'accountTypeNames',
......@@ -216,10 +223,25 @@
'merchantBrandName'
]
var roleData = {}
init()
function init() {
getFirstInfo()
getSecondInfo()
getSecondTree()
getSecondTable(subMerchantTable)
}
// 查询角色详情
var params = { id: 31, method: 'cn.com.glsx.merchants.merchant.findMerchantDetail' }
request(params, function(res) {
console.log(res)
function getFirstInfo() {
var params = {
id: merchantId,
method: 'cn.com.glsx.merchants.merchant.findMerchantDetail'
}
request(params, function (res) {
console.log(res, '账户信息')
if (res.code == '0') {
roleData = helper.clone(true, res.data)
for (var i in basicArr) {
......@@ -227,52 +249,102 @@
}
}
})
}
// 上下级商户 - 信息
function getSecondInfo() {
request({
method: 'cn.com.glsx.merchants.menu.findSubordinateRelationship',
id: merchantId
}, function (res) {
console.log(res.data)
var data = res.data
var arr = ['merchantName', 'merchantId', '']
$.each(arr, function (index, item) {
console.log(data[item])
$('#second' + item).text(data[item])
})
})
}
// 上下级商户数
var treeParams = { id: 31, method: 'cn.com.glsx.merchants.merchant.findMerchantTree' }
// 上下级商户 - 树
function getSecondTree() {
var treeParams = {
id: merchantId,
method: 'cn.com.glsx.merchants.merchant.findMerchantTree'
}
var merchants = {}
request(treeParams, function(res) {
request(treeParams, function (res) {
if (res.code == '0') {
merchants = tree.create('merchantTree', res.data)
merchants.expandAll(true)
}
})
}
// 列表
// 列表配置
var subMerchantTable = table.render({
elem: '#subMerchantTable',
page: false,
cols: [
[
{ field: '', title: '序号', type: 'numbers', width: 80 },
{ field: 'staffName', title: '员工姓名', width: 120 },
{ field: 'roleName', title: '角色', width: 120 },
{ field: 'merchantName', title: '登录账户', width: 120 },
{ field: 'statusName', title: '登录密码', width: 120 },
{ field: 'createdAccount ', title: '创建者', width: 100 },
{ field: 'createdTime', title: '创建时间', width: 150 }
[{
field: '',
title: '序号',
type: 'numbers',
width: 80
},
{
field: 'staffName',
title: '员工姓名',
width: 120
},
{
field: 'roleName',
title: '角色',
width: 120
},
{
field: 'merchantName',
title: '登录账户',
width: 120
},
{
field: 'statusName',
title: '登录密码',
width: 120
},
{
field: 'createdAccount ',
title: '创建者',
width: 100
},
{
field: 'createdTime',
title: '创建时间',
width: 150
}
]
]
})
getTabelList(subMerchantTable)
// 获取table列表接口
function getTabelList(table, isResetPageNum = false) {
request(
{
method: 'cn.com.glsx.merchants.merchant.findMerchantStaffList',
merchantId: 31
function getSecondTable(table, isResetPageNum = false) {
request({
method: 'cn.com.glsx.merchants.staff.findMerchantStaffList',
merchantId: merchantId
},
function(res) {
function (res) {
console.log(res)
var data = res.data
var options = {
data: data
}
table.reload(options)
subMerchantTable.reload(options)
}
)
}
})
</script>
</body>
</body>
</html>
\ No newline at end of file
......@@ -218,7 +218,7 @@
switch (eventName) {
// 查看
case 'handleDetail':
go('merchant', 'detail')
go('merchant', 'detail', { merchantId: row.id })
break
// 修改
case 'handleEdit':
......@@ -361,7 +361,7 @@
// 本身
if (item.id == user.merchantId) {
item.btn.createStaff = true
if (merchantAccountLevel != 4) {
if (item.merchantAccountLevel != 4) {
item.btn.createSubMerchant = true
}
} else { // 下级商户
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!