Explorar el Código

Merge remote-tracking branch 'origin/master'

sunqing hace 4 años
padre
commit
f77174e145

+ 142 - 0
src/main/java/com/minpay/mt/machine/action/MachineManageAction.java

@@ -96,6 +96,12 @@ public class MachineManageAction implements IMINAction {
      * 关闭音乐
      */
     public final static String CLOSE_SONG = "closeSong";
+
+    /**一键补货*/
+    public final static String	ADD_PROEQUREL_NUM			= "addProEquRelNum";
+
+    /**一键设置商品价格*/
+    public final static String	EDIT_PROEQUREL_PRICE			= "editProEquRelPrice";
     private boolean contains;
 
 
@@ -1041,4 +1047,140 @@ public class MachineManageAction implements IMINAction {
                 .updateByPrimaryKeySelective(pro);
         return res;
     }
+    /**
+     * 一键补货
+     * @param equId		设备id
+     * @param session
+     * @return
+     * @throws MINBusinessException
+     */
+    @MINAction(value = ADD_PROEQUREL_NUM, transaction = IMINTransactionEnum.CMT)
+    public MINActionResult addProEquRelNum(
+            @MINParam(key = "equId") String equId,
+            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();
+        //校验设备是否正常
+        VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmEquipmentInfMapper.class)
+                .selectByPrimaryKey(equId);
+        if(equipmentInf == null){
+            throw new MINBusinessException("该设备不存在!");
+        }else if(equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)){
+            throw new MINBusinessException("该设备已销毁!");
+        }
+        //查询设备中的商品
+        VmProEquRelExample proEquRelExample = new VmProEquRelExample();
+        proEquRelExample.createCriteria().andEquipmentIdEqualTo(equId)
+                .andChannelEqualTo("V01")
+                .andExeitStateEqualTo(Constant.PROEQUREL_STT_00);
+        List<VmProEquRel> list2 = Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmProEquRelMapper.class)
+                .selectByExample(proEquRelExample);
+        for (int i = 0; i < list2.size(); i++) {
+            VmProEquRel equRel = list2.get(i);
+            equRel.setProductNums(equRel.getCargoWayNums());		//商品余量修改为货道容量
+            equRel.setModifyUser(userId);							//最后修改人
+            equRel.setModifyTime(dateTime);							//最后修改时间
+            Service.lookup(IMINDataBaseService.class)
+                    .getMybatisMapper(VmProEquRelMapper.class)
+                    .updateByPrimaryKeySelective(equRel);
+        }
+        return res;
+    }
+    /**
+     * 一键设置商品价格
+     * @param equId				设备id
+     * @param sallPrice			售货价
+     * @param gamePrice			游戏价
+     * @param costPrice			成本价
+     * @param type				游戏类型
+     * @param isPromotton		是否促销
+     * @param promottonPrice	促销价
+     * @param session
+     * @return
+     * @throws MINBusinessException
+     */
+    @MINAction(value = EDIT_PROEQUREL_PRICE, transaction = IMINTransactionEnum.CMT)
+    public MINActionResult editProEquRelPrice(
+            @MINParam(key = "equId") String equId,
+            @MINParam(key = "sallPrice") String sallPrice,
+            @MINParam(key = "gamePrice") String gamePrice,
+            @MINParam(key = "costPrice") String costPrice,
+            @MINParam(key = "type") String type,
+            @MINParam(key = "isPromotton") String isPromotton,
+            @MINParam(key = "promottonPrice") String promottonPrice,
+            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();
+        //校验设备是否正常
+        VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmEquipmentInfMapper.class)
+                .selectByPrimaryKey(equId);
+        if(equipmentInf == null){
+            throw new MINBusinessException("该设备不存在!");
+        }else if(equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)){
+            throw new MINBusinessException("该设备已销毁!");
+        }
+
+        int comcosAndsal = CommonUtil.compare(costPrice, sallPrice);
+        int comcosAndgam = CommonUtil.compare(costPrice, gamePrice);
+        int comgamAndsal = CommonUtil.compare(gamePrice, sallPrice);
+//		int comcosAndpro = CommonUtil.compare(costPrice, promottonPrice);
+        int comproAndsal = CommonUtil.compare(promottonPrice, sallPrice);
+        if (comcosAndsal == 1 || comcosAndsal == 0) {
+            throw new MINBusinessException("成本价不能大于或等于售货价!");
+        }
+/*		if (comcosAndgam == 1 || comcosAndgam == 0) {
+			throw new MINBusinessException("成本价不能大于或等于游戏价!");
+		}
+		if (comgamAndsal == 1 || comgamAndsal == 0) {
+			throw new MINBusinessException("游戏价不能大于或等于售货价!");
+		}*/
+//		if (comcosAndpro == 1 || comcosAndpro == 0) {
+//			throw new MINBusinessException("成本价不能大于或等于促销价!");
+//		}
+        if (comproAndsal == 1 || comproAndsal == 0) {
+            throw new MINBusinessException("促销价不能大于或等于售货价!");
+        }
+        //查询设备中的商品
+        VmProEquRelExample proEquRelExample = new VmProEquRelExample();
+        proEquRelExample.createCriteria().andEquipmentIdEqualTo(equId)
+                .andChannelEqualTo("V01")
+                .andExeitStateEqualTo(Constant.PROEQUREL_STT_00);
+        List<VmProEquRel> list2 = Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmProEquRelMapper.class)
+                .selectByExample(proEquRelExample);
+        for (int i = 0; i < list2.size(); i++) {
+            VmProEquRel equRel = list2.get(i);
+            equRel.setSallPrice(sallPrice);							//售货价
+            equRel.setGamePrice(gamePrice);							//游戏价
+            equRel.setCostPrice(costPrice);							//成本价
+            equRel.setIsPromotion(isPromotton);						//是否促销
+            equRel.setPromotionPrice(promottonPrice);				//促销价
+            equRel.setGameType(type);					    		//游戏类型
+            equRel.setModifyUser(userId);							//最后修改人
+            equRel.setModifyTime(dateTime);							//最后修改时间
+            Service.lookup(IMINDataBaseService.class)
+                    .getMybatisMapper(VmProEquRelMapper.class)
+                    .updateByPrimaryKeySelective(equRel);
+        }
+        return res;
+    }
 }

+ 105 - 0
src/main/webapp/admin/machineManage/addEquproductNum.html

@@ -0,0 +1,105 @@
+<!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">
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+<body>
+    
+	<div class="form-input  demoTable" style="margin-top: 10%">
+	 <button class="layui-btn" id = "addAll">一键补满</button>
+	  <button class="layui-btn" id = "addNum">手动输入</button>
+	</div>
+    <script>
+    var equId = getQueryString("equId");
+  	//一键补满
+	$(document).on('click','#addAll',function(){
+		layer.confirm('确认一键补满?', function(index){
+		 	layer.close(index);
+	        $.request({
+				action : "MachineManageAction/addProEquRelNum",
+				data : {
+					equId : equId,
+					proState:'222'
+				},
+				success : function(resData) {
+					if (resData.MINStatus == 0) {
+						
+						layer.alert('操作成功!', {icon: 1});
+						 window.parent.location.reload(); 
+  		                 parent. layer.close(layer.index);  
+					} else {
+						layer.alert(resData.MINErrorMessage, {
+	  						icon: 5,
+	  						title: "提示"
+	  					}); 
+					}
+				},
+				error : function(data2){
+					layer.alert(data2.MINErrorMessage, {
+  						icon: 5,
+  						title: "提示"
+  					}); 
+				}
+	      	});
+		});
+	});
+	//手动输入
+	$(document).on('click','#addNum',function(){
+		layer.prompt({title: '请输入补充至多少'},function(value, index, elem){
+			$.request({
+				action : "ProEquRelManageAction/editProEquRelNumAll",
+				data : {
+					equId : equId,
+					proNum:value
+				},
+				success : function(resData) {
+					if (resData.MINStatus == 0) {
+						
+						layer.alert('操作成功!', {icon: 1});
+						 window.parent.location.reload(); 
+  		                 parent. layer.close(layer.index);  
+					} else {
+						layer.alert(resData.MINErrorMessage, {
+	  						icon: 5,
+	  						title: "提示"
+	  					}); 
+					}
+				},
+				error : function(data2){
+					layer.alert(data2.MINErrorMessage, {
+  						icon: 5,
+  						title: "提示"
+  					}); 
+				}
+	      	});
+		});
+	});
+	//获取url参数
+	function getQueryString(name){
+   		var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
+   		var r = window.location.search.substr(1).match(reg);
+   		if(r!=null)return  unescape(r[2]); return null;
+	}
+	//校验
+	layui.use(['form', 'layedit', 'laydate','layer'], function() {
+        var form = layui.form,
+        layer = layui.layer,
+        layedit = layui.layedit,
+        laydate = layui.laydate;
+        form.verify({
+        	temName: function(value) {
+        		if(isEmpty(value)){
+		    		return '请选择模版!';
+                }
+        	}
+        });
+	 }) 
+    </script>
+</body>
+
+</html>

+ 198 - 0
src/main/webapp/admin/machineManage/addEquproductPrice.html

@@ -0,0 +1,198 @@
+<!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">
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+<body>
+    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
+    </fieldset>
+    
+	<form class="layui-form" action="javascript:void(0)" id = "form2">
+		<div class="layui-form-item">
+		    <label class="layui-form-label">*售货价:</label>
+		    <div class="layui-input-inline">
+		        <input type="text" name="sallPrice" maxlength="30" id ="sallPrice" lay-verify="sallPrice" autocomplete="off" placeholder="请输入售货价" class="layui-input">
+		        <input type="hidden" name="equId" maxlength="30" id ="equId" lay-verify="equId" autocomplete="off" class="layui-input">
+		    </div>
+		    <label class="layui-form-label">*成本价:</label>
+		    <div class="layui-input-inline">
+		        <input type="text" name="costPrice" maxlength="30" id ="costPrice" lay-verify="costPrice" autocomplete="off" placeholder="请输入成本价" class="layui-input">
+		    </div>
+		
+		</div>
+		<div class="layui-form-item">
+            <label class="layui-form-label">*是否促销:</label>
+            <div class="layui-input-inline" id ="isPromotton">
+           </div>
+           <label class="layui-form-label">*促销价:</label>
+		    <div class="layui-input-inline">
+		        <input type="text" name="promottonPrice" maxlength="30" id ="promottonPrice" lay-verify="promottonPrice" autocomplete="off" placeholder="请输入促销" class="layui-input">
+		    </div>
+		    
+		</div>		
+		<div class="layui-form-item" ondblclick="openGame()">
+		    <label class="layui-form-label">*游戏价:</label>
+		    <div class="layui-input-inline">
+		        <input type="text" name="gamePrice" maxlength="30" id ="gamePrice" lay-verify="gamePrice" autocomplete="off" placeholder="请输入游戏价" class="layui-input">
+		    </div>
+		</div>
+		<div class="layui-form-item" id = "game" ondblclick="closeGame()">
+			 <label class="layui-form-label">*游戏类型:</label>
+	            	<div class="layui-input-inline" id ="type">
+	          	 	</div>
+		</div>
+	    
+        <div class="layui-form-item box-button" >
+	        <div class="layui-input-block">
+	            <button class="layui-btn" lay-submit="" lay-filter="demo1" lay-filter="demo1" >提交</button>
+	            <button  class="layui-btn"  id="cancel">取消</button>
+	        </div>
+	    
+    	</div>
+	</form>
+    <script>
+    var equId = getQueryString("equId");
+    $("#equId").val(equId);
+        layui.use('form', function(){
+       		var form = layui.form;
+       			$('#game').hide();
+       		//自定义验证规则
+          	form.verify({
+          		sallPrice : function(value, item){
+	               	if (isEmpty(value)) {
+                        return '售货价不能为空';
+                    }
+               	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){ 
+                    return '售货价为正数';
+                  }
+               	if(!(/^\d+(\.\d{0,2})?$/.test(value))){ 
+                    return '售货价小数点后保留两位数';
+                  }
+				          },gamePrice : function(value, item){
+				             	if (isEmpty(value)) {
+				                    return '游戏价不能为空';
+				                }
+				           	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){ 
+				                return '游戏价为正数';
+				              }
+				           	if(!(/^\d+(\.\d{0,2})?$/.test(value))){ 
+				                return '游戏价小数点后保留两位数';
+				              }
+				      },costPrice : function(value, item){
+				       	if (isEmpty(value)) {
+				            return '成本价不能为空';
+				        }
+				   	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){ 
+				        return '成本价为正数';
+				      }
+				   	if(!(/^\d+(\.\d{0,2})?$/.test(value))){ 
+				        return '成本价小数点后保留两位数';
+				      }
+				}      
+				      ,isPromotton : function(value, item){
+				         	if (isEmpty(value)) {
+				              return '请选择是否促销';
+				          }
+				  }   
+				     
+          	});
+	       	//监听提交
+	  	    form.on('submit(demo1)', function(data) {
+	  	    	/* var imgUrl = $("#licence")[0].src;
+	  	    	if(data.field.isContainImg == "on"){
+	  	    		data.field.isContainImg = "1"
+	  	    	}else{
+	  	    		data.field.isContainImg = "0"
+	  	    	}
+	  	    	data.field.imgUrl = imgUrl; */
+	  			$.request({
+	  				action : '../../MachineManageAction/editProEquRelPrice',
+	  				data : data.field ,
+	  				success : function(data) {
+	  					 layer.alert('操作成功!',  function(){
+	  						 
+	  						 window.parent.location.reload(); 
+	  		                 parent. layer.close(layer.index);  
+	  					}); 	
+	  				},
+	  				error : function(data) {
+	  					 layer.alert(data.MINErrorMessage, {
+	  						icon: 5,
+	  						title: "提示"
+	  					}); 
+	  				}
+	  			});	
+	  	        return false;
+	  	    });
+	       	
+	  	  $('#cancel').on('click', function(){
+		    	 parent.layer.close(parent.layer.index); 
+		    });
+	       	  
+    });
+        
+    //上传文件测试
+	layui.use('upload', function(){
+	  var upload = layui.upload;
+	  //执行实例
+	  var uploadInst = upload.render({
+	    elem: '#test1' ,//绑定元素
+	    url: '../../FileManageAction/uploadFile', //上传接口
+	    data:{ MINView: "JSON"},
+	    done: function(res){
+	    	if(res.MINStatus == 0){//上传成功
+	    		$("#licence").attr("src",res.data.src);
+	    	}else{//失败
+	    		layer.alert(res.MINErrorMessage, {
+					icon: 5,
+					title: "提示"
+				}); 
+	    		return;
+	    	}
+	      //上传完毕回调
+	    }
+	    ,error: function(index, upload){
+	    	alert("false");
+	      //请求异常回调
+	    }
+	  });
+	});	
+
+	
+	function openGame(){
+		$('#game').show();
+     }
+	 function closeGame(){
+		$('#game').hide();
+	 }
+	//获取url参数
+	function getQueryString(name){
+   		var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
+   		var r = window.location.search.substr(1).match(reg);
+   		if(r!=null)return  unescape(r[2]); return null;
+	}
+	//校验
+	layui.use(['form', 'layedit', 'laydate','layer'], function() {
+        var form = layui.form,
+        layer = layui.layer,
+        layedit = layui.layedit,
+        laydate = layui.laydate;
+        form.verify({
+        	temName: function(value) {
+        		if(isEmpty(value)){
+		    		return '请选择模版!';
+                }
+        	}
+        });
+	 }) 
+	  initSelect('isPromotton', "IS_PROMOTION", "isPromotton", '', true);
+	  initSelect('type', 'GAME_TYPE', 'type', '', true);
+    </script>
+</body>
+
+</html>

+ 246 - 0
src/main/webapp/admin/machineManage/chooseEquipment.html

@@ -0,0 +1,246 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>设备管理</title>
+    <script src="../../js/min-loader-next.js"></script>
+</head>
+
+<body>
+<form class="layui-form" id = "formName" >
+<div class="form-input" >
+	<div class="layui-form-item">
+	        <div class="layui-inline">
+	            	<label class="layui-form-label">设备名称:</label>
+		            <div class="layui-input-block">
+		                <input type="tel" name="equName"  id ="equName" lay-verify="equName"  autocomplete="off" placeholder="请输入设备名称" class="layui-input">
+		            </div>
+	            </div>
+
+            <div class="layui-inline">
+           	<label class="layui-form-label">设备编号:</label>
+		    <div class="layui-input-inline" style="width: 100px">
+        <input type="text" name="machineNomin" id = "machineNomin" placeholder="设备编号开始" lay-verify="machineNomin" autocomplete="off" class="layui-input" maxlength="6">
+      </div>
+      <div class="layui-form-mid">-</div>
+      <div class="layui-input-inline" style="width: 100px;">
+        <input type="text" name="machineNomax" id ="machineNomax" placeholder="设备编号结束" lay-verify="machineNomax" autocomplete="off" class="layui-input" maxlength="6">
+      </div>
+           </div>
+      </div>
+	   <div class="layui-form-item">
+			<div class="layui-inline">
+	            	<label class="layui-form-label">设备编号:</label>
+		            <div class="layui-input-block">
+		                <input type="tel" name="machineNo"  id ="machineNo" lay-verify="machineNo"  autocomplete="off" placeholder="请输入设备编号" class="layui-input">
+		            </div>
+	            </div>
+	   </div>
+	
+</div>
+</form>
+<div class="form-input  demoTable"  >
+	 <button class="layui-btn" data-type="reload" >搜索</button>
+	  <button class="layui-btn" data-type="reset">重置</button>
+	  <button class="layui-btn" data-type="getCheckData">一键复制</button>
+	  
+	  
+</div>
+    <table id="tableTest" lay-filter="tableFilter"></table>
+    <!--操作功能-->
+   <script type="text/html" id="checkboxDemo">
+     	<input type="checkbox"  {{ identity == '99' ? 'checked' : '' }}>
+    </script> 
+<script>
+var copyEquId = getQueryString("equId");
+initSelectb('equState', "EQUIPMENT_STATE", "equState", '', true);
+	layui.use('laydate', function(){
+		var laydate = layui.laydate;
+	 	/* laydate.render({
+	        elem: '#date'
+	    });
+	    laydate.render({
+	        elem: '#date1'
+	    }); */
+		//日期范围
+		laydate.render({
+		    elem: '#dates'
+		   ,range: true
+		   ,format:'yyyyMMdd'
+		});
+	})
+	layui.use('form', function(){
+		var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
+		//监听提交
+  	    form.on('submit(demo1)', function(data) {
+
+  			$.request({
+  				action : '../../EquipmentManageAction/addEquipment',
+  				data : data.field ,
+  				success : function(data) {
+  					 layer.alert('操作成功!',  function(){
+  						 
+  						 window.parent.location.reload(); 
+  		                 parent. layer.close(layer.index);  
+  					}); 	
+  				},
+  				error : function(data) {
+  					 layer.alert(data.MINErrorMessage, {
+  						icon: 5,
+  						title: "提示"
+  					}); 
+  				}
+  			});	
+  	        return false;
+  	    });
+  	  $('#cancel').on('click', function(){
+	    	 parent.layer.close(parent.layer.index); 
+	    });
+	})
+	var table;
+	layui.use('table', function(){
+		table = layui.table;
+		table.render({
+			id : 'tableTest'
+		    ,elem: '#tableTest'
+		    ,limit:10
+		   	// ,height: 315
+		    ,url: 'MachineManageAction/queryEquipmentLine' //数据接口
+		    ,method: 'post'
+		    ,where:{MINView:"JSON", token: 'sasasas'}
+		    ,page: true //开启分页
+		    ,cols: [[ //表头
+			  {type:'checkbox',width:50, toolbar: '#checkboxDemo'}
+		     ,{type:'numbers',title: '序号',width:50}
+		     ,{field: 'machineNo', title: '设备编号',width:90}	     
+		     ,{field: 'equId', title: '编号', width:130}
+		     ,{field: 'equName', title: '设备名称', width:120}
+		     ,{field: 'temRow', title: '货道列', width:120}
+		     ,{field: 'temLine', title: '货道行', width:120}
+		     ,{field: 'sttDesc', title: '状态',width:100}
+		      ,{field: 'createUser', title: '创建人',width:180}
+		      ,{field: 'createTime', title: '创建日期',width:180}
+		      ,{field: 'equRemarks', title: '备注',width:100} 
+		    ]]
+		    ,done: function(res, curr, count){
+		        //如果是异步请求数据方式,res即为你接口返回的信息。
+		        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对象
+		    var  equId = data.equId;
+		    var userChannel = data.userchannel;
+		    if(layEvent == 'choose'){ //选择
+		    	addProEquRelCopy(equId);
+			}
+		});
+		var $ = layui.$, active = {
+ 		    reload: function(){
+ 		    	var equName = $('#equName').val();
+ 		    	var userName = $('#userName').val();
+ 		    	var machineNo = $('#machineNo').val();
+ 		    	var machineNomin = $('#machineNomin').val();
+ 		    	var machineNomax = $('#machineNomax').val();
+ 		    	var equState = $("select[name='equState']").val();
+ 		    	var temId = $("select[name='template']").val();
+ 		         //执行重载
+  		     	table.reload('tableTest', {
+	  		        page: {
+	  		          curr: 1 //重新从第 1 页开始
+	  		        }
+	  		        ,where: {
+	  		        	equName : equName,
+	  		        	userName : userName,
+	  		        	temId : temId,
+	  		        	equState : equState,
+	  		        	machineNomin : machineNomin,
+	  		        	machineNomax : machineNomax,
+	  		        	machineNo : machineNo
+	  		        }
+  		      	});
+ 		    },getCheckData: function(){ //获取选中数据
+   		    	
+				var checkStatus = table.checkStatus('tableTest')
+				,data = checkStatus.data;
+				var equIdStr = "";
+				
+				for (var i = 0; i < data.length; i++) {
+					equIdStr += data[i].equId+",";
+				}
+				$.request({
+					action : 'MachineManageAction/addProEquRelAllCopy',
+					data : { 
+						equId: equIdStr,
+						copyEquId : copyEquId
+					},
+					success : function(data) {
+						 layer.alert('操作成功!',  function(){
+							 window.parent.location.reload(); 
+	  		                 parent. layer.close(layer.index);  
+						}); 	
+					},
+					error : function(data) {
+						 layer.alert(data.MINErrorMessage, {
+							icon: 5,
+							title: "提示"
+						}); 
+					}
+				});	
+ 		   		  
+ 		   		  
+ 		   		  
+	   		}
+	   		   
+ 		    ,reset: function(){
+ 		    	$('#formName')[0].reset()
+ 		    	
+ 		    }
+	 	};
+		$('.demoTable .layui-btn').on('click', function(){
+		  	var type = $(this).data('type');
+		  	active[type] ? active[type].call(this) : '';
+		});
+	      
+	});
+	
+	//补货
+	function addProEquRelCopy(equId) {
+			$.request({
+				action : '../../ProEquRelManageAction/addProEquRelCopy',
+				data : { equId: equId,copyEquId:copyEquId},
+				success : function(data) {
+					 layer.alert('操作成功!',  function(){
+						 window.parent.location.reload(); 
+  		                 parent. layer.close(layer.index);  
+					}); 	
+				},
+				error : function(data) {
+					 layer.alert(data.MINErrorMessage, {
+						icon: 5,
+						title: "提示"
+					}); 
+				}
+			});	
+	}
+	
+	
+	
+	
+</script>
+     
+  
+  
+</body>
+
+</html>

+ 2 - 2
src/main/webapp/admin/machineManage/editEquproduct.html

@@ -326,8 +326,8 @@
                 }
         	}
         });
-	 }) 
-	   
+	 })
+	initSelect('isPromotton', "IS_PROMOTION", "isPromotton", '', true);
     </script>
 </body>
 

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

@@ -17,7 +17,7 @@
 	        <div class="layui-input-block">
 	             <button class="layui-btn" lay-submit="" lay-filter="demo4" lay-filter="demo4" >复制商品到新机器</button>
 	             <button class="layui-btn" lay-submit="" lay-filter="demo3" lay-filter="demo3" >一键设置价格</button>
-	             <button class="layui-btn" lay-submit="" lay-filter="demo2" lay-filter="demo2" >一键上货</button>
+<!--	             <button class="layui-btn" lay-submit="" lay-filter="demo2" lay-filter="demo2" >一键上货</button>-->
 	             <button class="layui-btn" lay-submit="" lay-filter="demo1" lay-filter="demo1" >一键补货</button>
 	        </div>
 	    
@@ -105,7 +105,7 @@
 		   	      shade: 0.8,
 		   	      //maxmin: true, //开启最大化最小化按钮
 		   	      area: ['40%', '50%'],
-		   	      content: 'addEquproductNum.html?&equId='+rowData.equId
+		   	      content: 'addEquproductNum.html?&equId='+rowData.id
 			});
   	        return false;
   	    });
@@ -116,7 +116,7 @@
 		   	      shade: 0.8,
 		   	      //maxmin: true, //开启最大化最小化按钮
 		   	      area: ['100%', '100%'],
-		   	      content: 'addEquproductAll.html?&equId='+rowData.equId
+		   	      content: 'addEquproductAll.html?&equId='+rowData.id
 			});
   	        return false;
   	    });
@@ -127,7 +127,7 @@
 		   	      shade: 0.8,
 		   	      //maxmin: true, //开启最大化最小化按钮
 		   	      area: ['80%', '90%'],
-		   	      content: 'addEquproductPrice.html?&equId='+rowData.equId
+		   	      content: 'addEquproductPrice.html?&equId='+rowData.id
 			});
   	        return false;
   	    });