Browse Source

机器设备修改

pangjl 4 năm trước cách đây
mục cha
commit
e6f9124360

+ 110 - 1
src/main/java/com/minpay/mt/machine/action/MachineManageAction.java

@@ -51,7 +51,7 @@ public class MachineManageAction implements IMINAction {
     /**
      * 添加设备
      */
-    public final static String ADD_PRODUCT_INF = "addProductInf";
+    public final static String ADD_PRODUCT_INF = "addMachine";
     /**
      * 修改设备
      */
@@ -106,8 +106,15 @@ public class MachineManageAction implements IMINAction {
 
     /**一键设置商品价格*/
     public final static String	EDIT_PROEQUREL_PRICE			= "editProEquRelPrice";
+
     /** 生成包含字符串信息的二维码图片**/
     public static final String CREATE_QRCODE = "createQrCode";
+
+    /**补货*/
+    public final static String	EDIT_PROEQUREL_NUM			= "editProEquRelNum";
+
+    /**解绑机台号*/
+    public final static String	DELETE_EQU			= "deleteEqu";
     private boolean contains;
 
 
@@ -124,6 +131,9 @@ public class MachineManageAction implements IMINAction {
     public MINActionResult queryEqumentInf(
             @MINParam(key = "machineId") String machineId,
             @MINParam(key = "state") String state,
+            @MINParam(key = "machineName") String machineName,
+            @MINParam(key = "mchntId") String mchntId,
+            @MINParam(key = "equType") String equType,
             @MINParam(key = "createUser") String createUser,
             @MINParam(key = "page", defaultValue = "1") int page,
             @MINParam(key = "limit", defaultValue = "3") int limit,
@@ -135,6 +145,9 @@ public class MachineManageAction implements IMINAction {
                 .getSystemProperties().get("WALLET_TO_METTING_PASSWORD_KEY").getKey();
         Map<String, String> map = new HashMap<String, String>();
         map.put("id", machineId);
+        map.put("mchntId", mchntId);
+        map.put("equType", equType);
+        map.put("machineName", machineName);
         map.put("createUser", createUser);
         map.put("channel", user.getChannel());//渠道号
         //验证操作员权限
@@ -1248,4 +1261,100 @@ public class MachineManageAction implements IMINAction {
         res.set("url", url);
         return res;
     }
+    /**
+     * 补货
+     * @param perId		设备id
+     * @param session
+     * @return
+     * @throws MINBusinessException
+     */
+    @MINAction(value = EDIT_PROEQUREL_NUM)
+    public MINActionResult editProEquRelNum(
+            @MINParam(key = "perId") String perId,
+            @MINParam(key = "proNum") String proNum,
+            MINSession session
+    ) throws MINBusinessException {
+
+        MINActionResult res = new MINActionResult();
+        //当前时间
+        String dateTime = DateUtil.getCurrentDateTimeString();
+        User user = session.getUser();
+        //操作员id
+        String userId = user.getId();
+        //渠道
+//		String channel = user.getChannel();
+        //校验设备是否正常
+        VmProEquRel equRel = Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmProEquRelMapper.class)
+                .selectByPrimaryKey(perId);
+        String proNumall = equRel.getCargoWayNums();
+        int comcosAndsal = CommonUtil.compare(proNum, proNumall);
+        if (comcosAndsal == 1 ) {
+            throw new MINBusinessException("补货量不能大于货道容量!");
+        }
+        if(equRel == null||equRel.getExeitState().equals(Constant.PROEQUREL_STT_02)){
+            throw new MINBusinessException("设备中该货物不存在!");
+        }
+
+        equRel.setProductNums(proNum);		//商品余量修改为货道容量
+        equRel.setModifyUser(userId);							//最后修改人
+        equRel.setModifyTime(dateTime);							//最后修改时间
+        Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmProEquRelMapper.class)
+                .updateByPrimaryKeySelective(equRel);
+
+        return res;
+    }
+    /**
+     * 添加设备
+     *
+     * @param session
+     * @return
+     * @throws MINBusinessException
+     */
+    @MINAction(value = DELETE_EQU, transaction = IMINTransactionEnum.CMT)
+    public MINActionResult deleteEqu(
+            @MINParam(key = "startEquCode") String startEquCode,
+            @MINParam(key = "endEquCode") String endEquCode,
+            MINSession session) throws MINBusinessException {
+
+        MINActionResult res = new MINActionResult();
+        //获取当前时间
+        String nowTime = DateUtil.getCurrentDateTimeString();
+        // 获取操作员信息
+        User user = session.getUser();
+        if (CommonUtil.isEmpty(startEquCode)) {
+            throw new MINBusinessException("起始解绑机台号为空");
+        }
+        if (!CommonUtil.isEmpty(endEquCode)) {
+            int code = CommonUtil.compare(startEquCode,endEquCode);
+            if (code == 0 || code == 1){
+                throw new MINBusinessException("起始解绑机台号不能大于等于结束解绑机台号");
+            }
+            for (int i = Integer.parseInt(startEquCode);i <= Integer.parseInt(endEquCode);i++){
+                VmEquipmentInfExample example = new VmEquipmentInfExample();
+                example.createCriteria().andMachineNoEqualTo(String.valueOf(i));
+                List<VmEquipmentInf> vmEquipmentInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmEquipmentInfMapper.class).selectByExample(example);
+                if (vmEquipmentInf != null && vmEquipmentInf.size() > 0){
+                    Service.lookup(IMINDataBaseService.class)
+                            .getMybatisMapper(VmEquipmentInfMapper.class)
+                            .deleteByPrimaryKey(vmEquipmentInf.get(0).getId());
+                }
+
+            }
+        }else{
+            VmEquipmentInfExample example = new VmEquipmentInfExample();
+            example.createCriteria().andMachineNoEqualTo(startEquCode);
+            List<VmEquipmentInf> vmEquipmentInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmEquipmentInfMapper.class).selectByExample(example);
+            if (vmEquipmentInf != null && vmEquipmentInf.size() > 0){
+                Service.lookup(IMINDataBaseService.class)
+                        .getMybatisMapper(VmEquipmentInfMapper.class)
+                        .deleteByPrimaryKey(vmEquipmentInf.get(0).getId());
+            }
+        }
+		/*// 记录操作日志
+		String logInfo = "操作员:" + user.getName() + "添加商品,商品编号:" + id;
+		Service.lookup(ILogService.class).logging(session, logInfo);*/
+        return res;
+    }
 }

+ 14 - 1
src/main/resources/com/minpay/db/table/own/mapper/MachineManageMapper.xml

@@ -12,11 +12,13 @@
 		p.VEQ_ADDRESS          'address',
 			p.VEQ_EQU_TYPE          'equType',
 		p.VEQ_EQU_IMG          'equImg',
-		p.VEQ_WC_ACCOUNT          'wcAccount',
+		vti.VTI_ID         'wcAccount',
+		vti.VTI_NAME         'wcAccountName',
 		p.VEQ_ZFB_ACCOUNT          'zfbAccount',
 		p.VEQ_CHARGE          'charge',
 		p.VEQ_CREDIT_CHANNEL          'creditChannel',
 		p.VEQ_PAYEE_NO          'payeeNo',
+		va.ACT_NAME				'payeeNoName',
 		p.VEQ_PAYMENT          'payment',
 		p.VEQ_PAYMENT_TYPE          'paymentType',
 		p.VEQ_BACKGROUND_ONE          'backgroundOne',
@@ -42,6 +44,8 @@
      	FROM vm_equipment_inf  p
      		LEFT JOIN 	im_user u ON u.USR_ID = p.VEQ_CREATE_USER
      		LEFT JOIN im_user e on e.USR_ID = p.VEQ_MODIFY_USER
+     		LEFT JOIN vm_tencent_inf vti ON vti.VTI_ID = p.VEQ_WC_ACCOUNT
+			LEFT JOIN vm_account va ON va.ACT_ID = p.VEQ_PAYEE_NO
      	WHERE 1=1
      	AND p.VEQ_STATE = '00'
 		<if test="dates!=null and dates!= ''">
@@ -51,6 +55,15 @@
 		<if test="id!=null and id!= ''">
 			AND p.VEQ_MACHINE_NO LIKE CONCAT("%",#{id, jdbcType = VARCHAR},"%")
 		</if>
+		<if test="machineName != null and machineName != ''">
+			AND p.VEQ_NAME like CONCAT('%', #{machineName,jdbcType=VARCHAR}, '%')
+		</if>
+		<if test="mchntId != null and mchntId != ''">
+			AND p.VEQ_BRANCHID like CONCAT('%', #{mchntId,jdbcType=VARCHAR}, '%')
+		</if>
+		<if test="equType != null and equType != ''">
+			AND p.VEQ_EQU_TYPE = #{equType, jdbcType = VARCHAR}
+		</if>
       	ORDER BY p.VEQ_CREATE_TIME  DESC
 	</select>
 	<select id="queryProEquRel" resultType="hashmap"

+ 303 - 0
src/main/webapp/admin/machineManage/checktencent.html

@@ -0,0 +1,303 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>公众号管理</title>
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+<body class="content">
+	<!-- <form class="layui-form" action="javascript:void(0)"  id = "formRole">
+		<div class="" style="padding: 0.5rem 1rem;">
+			<input class="y-left-input" type="text" name="name"  id ="name" value="" placeholder="请输入角色名称" />
+			<button class="y-search"  data-type="reset" >重置</button>
+			<button class="y-search"  data-type="reload" >搜索</button>
+			<button class="y-search" id = "addBtn">添加</button>
+		</div>
+		<div class="shadow-content" style="margin:1.5rem;">
+			<table id="tableTest" lay-filter="tableFilter"></table>
+		</div>
+	</form> -->
+	<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 = "formRole">
+			<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="tencentName"  id ="tencentName" 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="barDemo">
+		<!--<a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>-->
+     	<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
+     	<a class="layui-btn layui-btn-xs" lay-event="associated">关联客户</a>
+     	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
+      	<!-- 这里同样支持 laytpl 语法,如: -->
+     	{{#  if(d.certtype == '1'){ }}
+        	<a class="layui-btn layui-btn-xs" lay-event="check">审核</a>
+     	{{#  } }}
+   	</script>
+	<script type="text/html" id="barDemo1">
+		<a class="layui-btn layui-btn-xs" lay-event="choose">选择</a>
+	</script>
+    <script>
+	    $("#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: '../../TencentManageAction/tencentManageQuery' //数据接口
+		    ,method: 'post'
+		    ,where:{MINView:"JSON"}
+		    ,page: true //开启分页
+		    ,cols: [[ //表头
+				  {field: 'operate', title: '选择', width:'10%', toolbar: '#barDemo1'}
+		      ,{field:'num', title: '序号',width:'10%', type:'numbers'}
+		      ,{field: 'tencentName', title: '公众号名称', width:'10%'}
+		      ,{field: 'vxNum', title: '微信号', width:'10%'}
+		      ,{field: 'vxId', title: '微信原始ID', width:'10%'}
+		      ,{field: 'appId', title: 'APPID(应用ID)', width:'10%'}
+		      ,{field: 'appSecret', title: 'AppSecret(应用秘钥)', width:'15%'}
+		      ,{field: 'personName', 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 === 'del'){ //删除
+		      layer.confirm('确认删除此数据?', function(index){
+		        layer.close(index);
+		        //向服务端发送删除指令roleDelete
+		        $.request({
+					action : "../../TencentManageAction/deleteTencent",
+					data : {
+						id : data.vtiId
+					},
+					success : function(resData) {
+						if (resData.MINStatus == 0) {
+							layer.alert('操作成功!', {icon: 1});
+							obj.del(); //删除对应行(tr)的DOM结构,并更新缓存
+						} else {
+							layer.alert(resData.MINErrorMessage, {
+		  						icon: 5,
+		  						title: "提示"
+		  					}); 
+						}
+					},
+					error : function(data2){
+						layer.alert(data2.MINErrorMessage, {
+	  						icon: 5,
+	  						title: "提示"
+	  					}); 
+// 						layer.alert(resData.MINErrorMessage, {icon: 2});
+					}
+		      	});
+		      })
+		    } else if(layEvent === 'edit'){ //编辑
+		    	updateDetail(data);
+		    } else if(layEvent === 'associated'){ //关联客户
+				associatedDetail(data);
+			}else if(layEvent == 'choose'){
+				parentPass(data);
+			}
+		  });
+		  
+	     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(){
+	   		    	$('#formRole')[0].reset();
+	   		    	$("#conditions").html('<div class="fl f12-gray4-op mt4">所选条件:</div>');
+	   		    }
+	 	};
+// 		$('.demoTable .layui-btn').on('click', function(){
+// 		  var type = $(this).data('type');
+// 		  active[type] ? active[type].call(this) : '';
+// 		});
+		$('.layui-btn').on('click', function(){
+		  	var type = $(this).data('type');
+		  	active[type] ? active[type].call(this) : '';
+		});
+	 });
+      
+	function reloadRole() {
+		//角色名称
+    	var tencentName = $("#tencentName").val();
+        //执行重载
+	    table.reload('tableTest', {
+	        page: {
+	        	curr: 1 //重新从第 1 页开始
+	        }
+	        ,where: {
+				tencentName : tencentName,
+	        }
+	     });
+	}
+	
+      function updateDetail(data) {
+		  layui.sessionData("ROW_DATA", {key:"NOW_ROW", value:data});
+		  layer.open({
+	    	      type: 2,
+	    	      title: '公众号修改',
+	    	      shadeClose: true,
+	    	      shade:0.8,
+	    	      //maxmin: true, //开启最大化最小化按钮
+	    	      area: ['75%', '85%'],
+	    	      content: '../../admin/tencentManage/tencentUpdate.html'
+	    	});
+      }
+      function associatedDetail(data) {
+		  layui.sessionData("ROW_DATA", {key:"NOW_ROW", value:data});
+		  layer.open({
+	    	      type: 2,
+	    	      title: '关联客户',
+	    	      shadeClose: true,
+	    	      shade:0.8,
+	    	      //maxmin: true, //开启最大化最小化按钮
+	    	      area: ['75%', '85%'],
+	    	      content: '../../admin/tencentManage/tencentAssociated.html'
+	    	});
+      }
+
+		// 新增
+		$("#addBtn").click(function(){
+			// 打开新增页面
+			openMainTabPage('415001-01', ' 新增公众号', 'tencentManage/tencentAdd.html', '', '415001', reloadRole);
+		})
+	function changeSelectCon(index, t, type, dateValue){
+		if (type == "date") {
+			if (isEmpty(dateValue)) {
+				$("#search" + index).remove();
+			} else {
+				$("#search" + index).remove();
+				if (isEmpty($("#search" + index).attr("name"))) {
+					$("#conditions").append(getSelectConHtml(index, t, type,dateValue));
+				}
+			}
+		} else if (type == 'inp') {
+			if (isEmpty($(t).val())) {
+				$("#search" + index).remove();
+			} else {
+				$("#search" + index).remove();
+				if (isEmpty($("#search" + index).attr("name"))) {
+					$("#conditions").append(getSelectConHtml(index, t, type));
+				}
+			}
+		} else {
+			if (isEmpty($(t).val())) {
+				$("#search" + index).remove();
+			} else {
+				$("#search" + index).remove();
+				if (isEmpty($("#search" + index).attr("name"))) {
+					$(t).attr("id","subjects");
+					$("#conditions").append(getSelectConHtml(index, t, type));
+				}
+			}
+		}
+	}
+	var array = new Array('产品名称','订单编号');
+	function getSelectConHtml(index, t, type,dateValue){
+		var name;
+		var value;
+		if(type == "inp"){
+			value = t.value.substr(0,5)+"..";
+		}
+		if (type == "date") {
+			value = dateValue;
+		}
+		if(type == "sel"){
+			value = $("#state").find("option:selected").text();
+		}
+		if (type == "date") {
+			name = $("#"+t).attr("id");
+		} else {
+			name = $(t).attr("id");
+		}
+		var html = '<div class="fl xuanzhong-active" id = "search' + index + '" name = "' + name + '" onclick = "removeSearch(this)">' +
+						'<div class="fl">' + array[index] + '</div>' +
+						':<i class="iconfont">'+value+'</i>' +
+						'<svg class="icon" aria-hidden="true">' +
+						  '<use xlink:href="#iconicon_close1"></use>' +
+						'</svg>' +
+					'</div>';
+		return html;
+	}
+	function removeSearch(t) {
+		if ($(t).attr("name") == 'subjects') {
+			initSelect('state', "ORDER_STT", "state", ' ', true);
+			form.render();
+			$(t).remove();
+		} else {
+			$("#"+$(t).attr("name")).val('');
+			$(t).remove();
+		}
+	}
+		function parentPass(data){
+			window.parent.childRetunDatas(data);
+			parent.layer.close(parent.layer.index);
+		}
+    </script>
+</body>
+</html>

+ 215 - 0
src/main/webapp/admin/machineManage/chooseBusinessNum.html

@@ -0,0 +1,215 @@
+<!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 class="layui-inline">
+					<label class="f12-gray4">商户类型:</label>
+					<div class=""  style="display:inline-block" id = 'type' name = 'type'></div>
+				</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>
+	    $("#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: '../../BusinessNumManageAction/businessNumManageQuery' //数据接口
+		    ,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: 'accountName', title: '商户名称', width:'20%'}
+		      ,{field: 'accountId', title: '商户号', width:'20%'}
+		      ,{field: 'number', title: '终端号', width:'10%'}
+		      ,{field: 'typeDesc', title: '商户类型', width:'10%'}
+		      ,{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 === 'del'){ //删除
+		      layer.confirm('确认删除此数据?', function(index){
+		        layer.close(index);
+		        //向服务端发送删除指令roleDelete
+		        $.request({
+					action : "../../BusinessNumManageAction/deleteBusinessNum",
+					data : {
+						id : data.accountId
+					},
+					success : function(resData) {
+						if (resData.MINStatus == 0) {
+							layer.alert('操作成功!', {icon: 1});
+							obj.del(); //删除对应行(tr)的DOM结构,并更新缓存
+						} else {
+							layer.alert(resData.MINErrorMessage, {
+		  						icon: 5,
+		  						title: "提示"
+		  					}); 
+						}
+					},
+					error : function(data2){
+						layer.alert(data2.MINErrorMessage, {
+	  						icon: 5,
+	  						title: "提示"
+	  					}); 
+// 						layer.alert(resData.MINErrorMessage, {icon: 2});
+					}
+		      	});
+		      })
+		    } else if(layEvent === 'edit'){ //编辑
+		    	updateDetail(data);
+		    }else if(layEvent == 'choose'){
+				parentPass(data);
+			}
+		  });
+		  
+	     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>');
+	   		    }
+	 	};
+// 		$('.demoTable .layui-btn').on('click', function(){
+// 		  var type = $(this).data('type');
+// 		  active[type] ? active[type].call(this) : '';
+// 		});
+		$('.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
+	        }
+	     });
+	}
+
+		initSelect('type', "BUSINESSNUM_TYPE", "type", ' ', true);
+
+
+		function updateDetail(data) {
+		  layui.sessionData("ROW_DATA", {key:"NOW_ROW", value:data});
+		  layer.open({
+	    	      type: 2,
+	    	      title: '商户号修改',
+	    	      shadeClose: true,
+	    	      shade:0.8,
+	    	      //maxmin: true, //开启最大化最小化按钮
+	    	      area: ['75%', '85%'],
+	    	      content: '../../admin/businessNumManage/businessNumUpdate.html'
+	    	});
+      }
+		function parentPass(data){
+			window.parent.childRetunData(data);
+			parent.layer.close(parent.layer.index);
+		}
+		// 新增
+		$("#addBtn").click(function(){
+			// 打开新增页面
+			openMainTabPage('515001-01', ' 新增公众号', 'businessNumManage/businessNumAdd.html', '', '515001', reloadRole);
+		})
+    </script>
+</body>
+</html>

+ 0 - 28
src/main/webapp/admin/machineManage/chooseProduct.html

@@ -84,34 +84,6 @@ initSelectb('temState', "TEMPLATE_STATE", "temState", '', true);
 		});
 		form.render();
 	})
-   // layui.use('form', function(){
-   //      	var form = layui.form;
-   //      	$.request({
-   //  			action : 'CategoryManageAction/queryCategoryForProduct',
-   //  			data : {},
-   //  			success : function(data) {
-   //  				var selectName ="categoryName";
-   //  				var html = '<select categoryName="';
-   //  				html = html + selectName;
-   //  				html = html + '"';
-   //  				html = html + 'lay-search=""  lay-filter="'+selectName+'"';
-   //  				html = html + '><option value="">请选择商品分类</option>';
-   //  				$.each(data.data, function(i, j) {
-   //  					  html = html + '<option ';
-   //  					  html = html + 'value="';
-   //  				      html = html + j.categoryId + '">';
-   //  				      html = html + j.categoryName+ '</option>';
-   //  				})
-   //  				html = html + '</select>';
-   //  				$("#categoryName").html(html);
-   //  				form.render();
-   //  			}
-   //  		})
-   //  		form.on('select(categoryName)', function(data){
-	// 			$("#categoryId").val(data.value);
-   //
-   //  		})
-   //  	})
 	
 	var table;
       	layui.use('table', function(){

+ 161 - 0
src/main/webapp/admin/machineManage/deleteMachine.html

@@ -0,0 +1,161 @@
+
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>解绑设备</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+</head>
+
+<body class="content">
+
+    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+    </fieldset>
+
+    <form class="layui-form" action="">
+		<div style="padding-bottom:60px; ">
+         <div class="layui-form-item">
+            <div class="layui-inline">
+                <label class="layui-form-label">*解绑起始机台号:</label>
+                <div class="layui-input-inline">
+                    <input type="tel" name="startEquCode" id = "startEquCode" lay-verify="startEquCode"  placeholder="请输入解绑开始机台号"autocomplete="off" class="layui-input">
+                </div>
+            </div>
+             <div class="layui-inline">
+                 <label class="layui-form-label">解绑结束机台号:</label>
+                 <div class="layui-input-inline">
+                     <input type="tel" name="endEquCode" id = "endEquCode" lay-verify="endEquCode"  placeholder="请输入解绑结束机台号"autocomplete="off" class="layui-input">
+                 </div>
+             </div>
+        </div>
+            <div class="layui-form-item box-button" >
+            <div class="layui-input-block">
+                <button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
+          <button  class="layui-btn"  id="cancel">取消</button>
+            </div>
+        </div>
+		</div>
+    </form>
+      <script src="../../js/min-loader-next.js"></script>
+    <script>
+	    layui.use('form', function(){
+	    	  var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
+	    		//监听取消
+	      	$('#cancel').on('click', function(){
+	      	    	 parent.layer.close(parent.layer.index); 
+	      	   		});
+	    	  
+	    	  
+    	});  
+    
+	    	
+        
+        function renderForm(){
+			 layui.use('form', function(){
+				 var form = layui.form();//高版本建议把括号去掉,有的低版本,需要加()
+				 form.render();
+			 });
+		 }
+        layui.use(['form', 'layedit', 'laydate','layer'], function() {
+            var form = layui.form,
+            layer = layui.layer,
+            layedit = layui.layedit,
+            laydate = layui.laydate;
+            //日期
+            laydate.render({
+                elem: '#date'
+            });
+            laydate.render({
+                elem: '#date1'
+            });
+            
+            
+            
+
+            //创建一个编辑器
+            var editIndex = layedit.build('LAY_demo_editor');
+            
+            //自定义验证规则
+            /* form.verify({
+            	logonname: function(value) {
+                    if (isEmpty(value)) {
+                 		return   '用户名不能为空!';
+                 	} 
+                },
+                name: function(value) {
+                    if (isEmpty(value)) {
+                 		return   '姓名不能为空!';
+                 	} 
+                },
+                roleid: function(value) {
+                    if (isEmpty(value)) {
+                 		return   '请选择角色!';
+                 	} 
+                },
+                branchid: function(value) {
+                    if (isEmpty(value)) {
+                 		return   '请选择部门!';
+                 	} 
+                }
+            }); */
+            
+           
+            //监听指定开关
+          /*   form.on('switch(switchTest)', function(data) {
+                layer.msg('开关checked:' + (this.checked ? 'true' : 'false'), {
+                    offset: '6px'
+                });
+                layer.tips('温馨提示:请注意开关状态的文字可以随意定义,而不仅仅是ON|OFF', data.othis)
+            }); */
+
+         
+            form.verify({
+            	
+            	phone: function(value) {
+            		if(isEmpty(value)){
+    		    		return '请输入联系人手机号!';
+                    }
+            		
+            		
+                    if(!new RegExp("^1[0-9]{10}$").test(value)){
+    		    		return '联系人电话格式不正确!';
+                    }
+                    
+                    
+                }					
+            });
+           							/*  /^1[3|4|5|8][0-9]\d{4,8}$/ */
+           
+            //监听提交
+			form.on('submit(demo1)', function(data) {
+				$.request({
+					action : '../../MachineManageAction/deleteEqu',
+					data :  data.field ,
+					success : function(data) {
+						 layer.alert('删除成功!',  function(){
+                             deleteTabPage('201001-04');
+						}); 	
+					},
+					error : function(data2) {
+						layer.alert(data2.MINErrorMessage, {
+	  						icon: 5,
+	  						title: "提示"
+	  					}); 
+						// window.location.href='index.html';
+					}
+				});	
+                return false;
+			});
+            
+            
+            
+        });
+        initSelect('stt', "IM_USER_STATE", "stt", '0', true);
+    </script>
+
+</body>
+
+</html>

+ 42 - 14
src/main/webapp/admin/machineManage/editmachine.html

@@ -77,7 +77,8 @@
                 <div class="layui-inline">
                     <label class="layui-form-label">微信公众号:</label>
                     <div class="layui-input-inline">
-                        <input type="tel" name="wcAccount" id = "wcAccount" lay-verify="wcAccount"  placeholder="请输入微信公众号"autocomplete="off" class="layui-input">
+                        <input type="tel" name="wcAccountName" id = "wcAccountName" lay-verify="wcAccountName"  placeholder="请输入微信公众号"autocomplete="off" class="layui-input" onclick="chooseWeChat()">
+                        <input type="hidden" name="wcAccount" id = "wcAccount" lay-verify="wcAccount"  placeholder="请输入微信公众号"autocomplete="off" class="layui-input">
                     </div>
                 </div>
                 <div class="layui-inline">
@@ -88,6 +89,14 @@
                 </div>
             </div>
             <div class="layui-form-item">
+                <label class="layui-form-label fap-form-item-require" >收款通道:</label>
+                <div class="layui-input-block">
+                    <input type="checkbox" name="creditChannel" title="富有扫呗" lay-skin="primary" value = "00" lay-verify="required">
+                    <input type="checkbox" name="creditChannel" title="合利宝" lay-skin="primary" value = "01" lay-verify="required">
+                    <input type="checkbox" name="creditChannel" title="收钱吧" lay-skin="primary" value = "02" lay-verify="required">
+                </div>
+            </div>
+            <div class="layui-form-item">
                 <div class="layui-inline">
                     <label class="layui-form-label">手续费:</label>
                     <div class="layui-input-inline">
@@ -97,19 +106,12 @@
                 <div class="layui-inline">
                     <label class="layui-form-label">收款机构号/收款商户号:</label>
                     <div class="layui-input-inline">
-                        <input type="tel" name="payeeNo" id = "payeeNo" lay-verify="payeeNo"  placeholder="请输入收款机构号/收款商户号"autocomplete="off" class="layui-input">
+                        <input type="tel" name="payeeNoName" id = "payeeNoName" lay-verify="payeeNoName"  placeholder="请输入收款机构号/收款商户号"autocomplete="off" class="layui-input" onclick="checkmchnt()">
+                        <input type="hidden" name="payeeNo" id = "payeeNo" lay-verify="payeeNo"  placeholder="请输入收款机构号/收款商户号"autocomplete="off" class="layui-input">
                     </div>
                 </div>
             </div>
             <div class="layui-form-item">
-                <label class="layui-form-label fap-form-item-require" >收款通道:</label>
-                <div class="layui-input-block">
-                    <input type="checkbox" name="creditChannel" title="富有扫呗" lay-skin="primary" value = "00" lay-verify="required">
-                    <input type="checkbox" name="creditChannel" title="合利宝" lay-skin="primary" value = "01" lay-verify="required">
-                    <input type="checkbox" name="creditChannel" title="收钱吧" lay-skin="primary" value = "02" lay-verify="required">
-                </div>
-            </div>
-            <div class="layui-form-item">
                 <label class="layui-form-label" style = "width: 150px;">支付金额:</label>
                 <div class="layui-input-inline" id ="payment">
                 </div>
@@ -338,10 +340,8 @@
 					data :  data.field ,
 					success : function(data) {
 						 layer.alert('保存成功!',  function(){
-							 //window.parent.location.reload(); 
-							// window.parent.reload.click(); 
-			                 window.parent.location.reload(); 
-	  		                 parent. layer.close(layer.index);  
+
+                             deleteTabPage('201001-02');
 						}); 	
 					},
 					error : function(data2) {
@@ -358,6 +358,34 @@
             
             
         });
+        function checkmchnt(){
+            layer.open({
+                type: 2,
+                title: '选择收款商户号',
+                shadeClose: true,
+                shade: 0.8,
+                area: ['95%', '95%'],
+                content: 'chooseBusinessNum.html'
+            });
+        }
+        function chooseWeChat(){
+            layer.open({
+                type: 2,
+                title: '选择微信公众号',
+                shadeClose: true,
+                shade: 0.8,
+                area: ['95%', '95%'],
+                content: 'checktencent.html'
+            });
+        }
+        function childRetunData(data){
+            $("#payeeNoName").val(data.accountName);
+            $("#payeeNo").val(data.accountId);
+        }
+        function childRetunDatas(data){
+            $("#wcAccountName").val(data.tencentName);
+            $("#wcAccount").val(data.vtiId);
+        }
         initSelect('payment', "PAYMENT_AMT", "payment", '00', true);
     </script>
 

+ 1 - 1
src/main/webapp/admin/machineManage/machineDetail.html

@@ -218,7 +218,7 @@
 			});	 */
 		layer.prompt({title: '请输入补充至多少',value: perNum},function(value, index, elem){
 			$.request({
-				action : "ProEquRelManageAction/editProEquRelNum",
+				action : "MachineManageAction/editProEquRelNum",
 				data : {
 					perId : perId,
 					proNum:value

+ 36 - 10
src/main/webapp/admin/machineManage/machineManage.html

@@ -15,23 +15,28 @@
 			<button class="layui-btn order-bnt1"  data-type="reload" >搜索</button>
 			<button class="layui-btn  order-bnt2" data-type="reset">重置</button>
 			<button class="layui-btn order-bnt2" id = "addMachine">新增机器</button>
+			<button class="layui-btn order-bnt2" id = "deleteMachine">解绑机台号</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 readonly class="search-select" type="text" name="strDate" id ="strDate" value="" placeholder="请选择时间(区间)" />
-				</div>
-				<div class="layui-inline">
-					<label class="f12-gray4">标题:</label>
-					<input onchange = "changeSelectCon(1,this,'inp')"  class="search-select" type="text" name="titleId"  id ="titleId" value="" placeholder="请输入标题" />
+					<label class="f12-gray4">机台名称:</label>
+					<input onchange = "changeSelectCon(1,this,'inp')"  class="search-select" type="text" name="machineName"  id ="machineName" value="" placeholder="请输入机器名称" />
 				</div>
 				<div class="layui-inline">
 					<label class="f12-gray4">机台号:</label>
 					<input onchange = "changeSelectCon(2,this,'qpp')"  class="search-select" type="text" name="machineId"  id ="machineId" value="" placeholder="请输入机台号" />
 				</div>
+			<div class="layui-inline">
+				<label class="f12-gray4">商户号:</label>
+				<input onchange = "changeSelectCon(2,this,'mch')"  class="search-select" type="text" name="mchntId"  id ="mchntId" value="" placeholder="请输入商户号" />
+			</div>
+			<div class="layui-inline">
+				<label class="f12-gray4">机器类型:</label>
+				<div class=""  style="display:inline-block" id = 'equType'></div>
+			</div>
 			</div>
 	</form>
 
@@ -63,10 +68,14 @@
 </script>
 
 <script>
-	//添加消息
+	//新增机器
 	$(document).on('click','#addMachine', function(){
 		openMainTabPage('201001-01', ' 新增机器', 'machineManage/addmachine.html', '', '201001', reload);
 	});
+	//解绑机台号
+	$(document).on('click','#deleteMachine', function(){
+		openMainTabPage('201001-04', ' 解绑机台号', 'machineManage/deleteMachine.html', '', '201001', reload);
+	});
 	$("#toggle").click(function() {
 		$(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
 				"<i class='iconfont up iconSelect_drop-down'/></i>");
@@ -207,8 +216,10 @@
 	});
 	function reload() {
 		var strDate = $('#strDate').val();
-		var titleId = $('#titleId').val();
+		var machineName = $('#machineName').val();
 		var machineId = $('#machineId').val();
+		var mchntId = $('#mchntId').val();
+		var equType = $("select[name='equType']").val();
 		var paramId = '1';
 		//执行重载
 		table.reload('newsManage', {
@@ -217,9 +228,11 @@
 			}
 			,where: {
 				strDate : strDate,
-				titleId : titleId,
+				machineName : machineName,
 				paramId : paramId,
-				machineId 	: machineId
+				mchntId : mchntId,
+				machineId 	: machineId,
+				equType : equType
 			}
 		});
 	}
@@ -277,6 +290,15 @@
 					$("#conditions").append(getSelectConHtml(index, t, type));
 				}
 			}
+		}else if (type == 'mch') {
+			if (isEmpty($(t).val())) {
+				$("#search" + index).remove();
+			} else {
+				$("#search" + index).remove();
+				if (isEmpty($("#search" + index).attr("name"))) {
+					$("#conditions").append(getSelectConHtml(index, t, type));
+				}
+			}
 		}else {
 			if (isEmpty($(t).val())) {
 				$("#search" + index).remove();
@@ -302,6 +324,9 @@
 		if (type == "qpp") {
 			value = t.value.substr(0,5)+"..";
 		}
+		if (type == "mch") {
+			value = t.value.substr(0,5)+"..";
+		}
 		if(type == "sel"){
 			value = $("#state").find("option:selected").text();
 		}
@@ -341,6 +366,7 @@
 		layui.sessionData("ROW_DATA", {key:"NOW_ROW", value:data});
 		openMainTabPage('201001-03', ' 查看货道', 'machineManage/machineDetail.html', '', '201001', reload);
 	}
+	initSelect('equType', "EQUIPMENT_TYPE", "equType", ' ', true);
 </script>
 </body>
 </html>