|
@@ -0,0 +1,174 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <title>商户号管理</title>
|
|
|
+ <script src="../../js/min-loader-next.js"></script>
|
|
|
+</head>
|
|
|
+<body class="content">
|
|
|
+ <div class="order-body">
|
|
|
+ <div class="order-tiaojian back-gray">
|
|
|
+ <div class="tiaojian-part1" id = "conditions">
|
|
|
+ <div class="fl f12-gray4-op mt4">所选条件:</div>
|
|
|
+ </div>
|
|
|
+ <div class="tiaojian-part2 fr demoTable">
|
|
|
+ <button class="layui-btn order-bnt1" data-type="reload" >搜索</button>
|
|
|
+ <button class="layui-btn order-bnt2" data-type="reset">重置</button>
|
|
|
+ <a href="#" id="toggle" class="top">收起</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <form class="layui-form" action="javascript:void(0)" id = "formName">
|
|
|
+ <div class="order-select back-border" id="content">
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="f12-gray4">商户名称:</label>
|
|
|
+ <input onchange = "changeSelectCon(0,this,'inp')" class="search-select" type="tel" name="accountName" id ="accountName" value="" placeholder="请输入商户名称" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="f12-gray4">商户号:</label>
|
|
|
+ <input onchange = "changeSelectCon(0,this,'inp')" class="search-select" type="tel" name="accountId" id ="accountId" value="" placeholder="请输入商户号" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="shadow-content" style="margin:1.5rem;">
|
|
|
+ <table id="tableTest" lay-filter="tableFilter"></table>
|
|
|
+ </div>
|
|
|
+ <script type="text/html" id="barDemo1">
|
|
|
+ <a class="layui-btn layui-btn-xs" lay-event="choose">选择</a>
|
|
|
+ </script>
|
|
|
+ <script>
|
|
|
+ var equId = getQueryString("equId");
|
|
|
+ $("#toggle").click(function() {
|
|
|
+ $(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
|
|
|
+ "<i class='iconfont up iconSelect_drop-down'/></i>");
|
|
|
+ $("#content").slideToggle();
|
|
|
+ });
|
|
|
+ var table;
|
|
|
+ layui.use('table', function(){
|
|
|
+ table = layui.table;
|
|
|
+
|
|
|
+ // 加载数据
|
|
|
+ table.render({
|
|
|
+ //tbname:'roleTable',
|
|
|
+ id: 'tableTest'
|
|
|
+ ,elem: '#tableTest'
|
|
|
+ ,limit:10
|
|
|
+ ,url: '../../MachineManageAction/queryBranch' //数据接口
|
|
|
+ ,method: 'post'
|
|
|
+ ,where:{MINView:"JSON"}
|
|
|
+ ,page: true //开启分页
|
|
|
+ ,cols: [[ //表头
|
|
|
+ {field: 'operate', title: '选择', width:'10%', toolbar: '#barDemo1'}
|
|
|
+ ,{field:'num', title: '序号',width:'10%', type:'numbers', align: 'center'}
|
|
|
+ ,{field: 'id', title: '商户号', width:'10%'}
|
|
|
+ ,{field: 'name', title: '商户名称', width:'20%'}
|
|
|
+ ,{field: 'createTime', title: '创建时间', width: '20%'}
|
|
|
+ ]]
|
|
|
+ ,done: function(res, curr, count){
|
|
|
+ //如果是异步请求数据方式,res即为你接口返回的信息。
|
|
|
+ //如果是直接赋值的方式,res即为:{data: [], count: 99} data为当前页数据、count为数据总长度
|
|
|
+ console.log(res);
|
|
|
+
|
|
|
+ //得到当前页码
|
|
|
+ console.log(curr);
|
|
|
+
|
|
|
+ //得到数据总量
|
|
|
+ console.log(count);
|
|
|
+ }
|
|
|
+ ,even: true //开启隔行背景
|
|
|
+ });
|
|
|
+
|
|
|
+ // 监听工具条(操作)
|
|
|
+ table.on('tool(tableFilter)', function(obj){ //注:tool是工具条事件名,tableFilter是table原始容器的属性 lay-filter="对应的值"
|
|
|
+ var data = obj.data; //获得当前行数据
|
|
|
+ var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
|
|
|
+ var tr = obj.tr; //获得当前行 tr 的DOM对象
|
|
|
+
|
|
|
+ if(layEvent === 'detail'){ //查看
|
|
|
+ showDetail(data);
|
|
|
+ //do somehing
|
|
|
+ } else if(layEvent == 'choose'){
|
|
|
+ layer.confirm('确定绑定该商户吗', function(index){
|
|
|
+ $.request({
|
|
|
+ action : '../../MachineManageAction/bindBranch',
|
|
|
+ data : {
|
|
|
+ equId : equId ,//机器名
|
|
|
+ branchId :data.id
|
|
|
+ },
|
|
|
+ success : function(data) {
|
|
|
+ //成功后刷新
|
|
|
+ deleteTabPage('201001-06');
|
|
|
+
|
|
|
+ },
|
|
|
+ error : function(data) {
|
|
|
+ layer.alert('操作失败!', {
|
|
|
+ icon: 5,
|
|
|
+ title: "提示"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var $ = layui.$, active = {
|
|
|
+ getCheckData: function(){ //获取选中数据
|
|
|
+ var checkStatus = table.checkStatus('tableTest')
|
|
|
+ ,data = checkStatus.data;
|
|
|
+ layer.alert(JSON.stringify(data));
|
|
|
+ }
|
|
|
+ ,getCheckLength: function(){ //获取选中数目
|
|
|
+ var checkStatus = table.checkStatus('tableTest')
|
|
|
+ ,data = checkStatus.data;
|
|
|
+ layer.msg('选中了:'+ data.length + ' 个');
|
|
|
+ }
|
|
|
+ ,isAll: function(){ //验证是否全选
|
|
|
+ var checkStatus = table.checkStatus('tableTest');
|
|
|
+ layer.msg(checkStatus.isAll ? '全选': '未全选')
|
|
|
+ }
|
|
|
+ //搜索
|
|
|
+ ,reload: function(){
|
|
|
+ reloadRole();
|
|
|
+ }
|
|
|
+ //重置
|
|
|
+ ,reset : function(){
|
|
|
+ $('#formName')[0].reset();
|
|
|
+ $("#conditions").html('<div class="fl f12-gray4-op mt4">所选条件:</div>');
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $('.layui-btn').on('click', function(){
|
|
|
+ var type = $(this).data('type');
|
|
|
+ active[type] ? active[type].call(this) : '';
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ function reloadRole() {
|
|
|
+ //角色名称
|
|
|
+ var accountName = $("#accountName").val();
|
|
|
+ var accountId = $("#accountId").val();
|
|
|
+ var type = $('#formName').find("select[name='type']").val();
|
|
|
+
|
|
|
+ //执行重载
|
|
|
+ table.reload('tableTest', {
|
|
|
+ page: {
|
|
|
+ curr: 1 //重新从第 1 页开始
|
|
|
+ }
|
|
|
+ ,where: {
|
|
|
+ accountName : accountName,
|
|
|
+ accountId : accountId,
|
|
|
+ type : type
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 新增
|
|
|
+ $("#addBtn").click(function(){
|
|
|
+ // 打开新增页面
|
|
|
+ openMainTabPage('515001-01', ' 新增公众号', 'businessNumManage/businessNumAdd.html', '', '515001', reloadRole);
|
|
|
+ })
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>
|