Browse Source

机器设备修改

pangjl 5 years ago
parent
commit
e64e3e4adf

+ 16 - 4
src/main/java/com/minpay/mt/machine/action/MachineManageAction.java

@@ -365,8 +365,8 @@ public class MachineManageAction implements IMINAction {
                 .queryProEquRel(map);
         //格式化时间和状态
         list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime", "modifyTime");
-        list = new MINCopyFormat("{perState:'sttDesc',isPromotton:'isPromottonDesc',isFragile:'isFragileDesc'}").format(list);
-        list = Service.lookup(IFormatService.class).formatEnum(list, "{sttDesc:'PROEQUREL_STATE',isPromottonDesc:'IS_PROMOTION',isFragileDesc:'IS_FRAGILE'}");
+        list = new MINCopyFormat("{perState:'sttDesc',isPromotton:'isPromottonDesc',isFragile:'isFragileDesc',type:'typeDesc'}").format(list);
+        list = Service.lookup(IFormatService.class).formatEnum(list, "{sttDesc:'PROEQUREL_STATE',isPromottonDesc:'IS_PROMOTION',typeDesc:'GAME_SETUP_TYPE'}");
         //传递数据
         res.set(IMINBusinessConstant.F_PAGING_LAY, list);
         return res;
@@ -560,10 +560,18 @@ public class MachineManageAction implements IMINAction {
         proEquRel.setCargoWayNums(perNum);                    //货道容量
         proEquRel.setProductNums(numbers);                    //商品余量
         proEquRel.setSallPrice(sallPrice);                    //售货价
-        proEquRel.setGamePrice(gamePrice);                    //游戏价
+        if (!CommonUtil.isEmpty(gamePrice)) {
+            proEquRel.setGamePrice(gamePrice);        //游戏价
+        }else {
+            proEquRel.setGamePrice("0");
+        }
         proEquRel.setCostPrice(costPrice);                    //成本价
         proEquRel.setIsPromotion(isPromotton);                //是否促销
-        proEquRel.setPromotionPrice(promottonPrice);        //促销价
+        if (!CommonUtil.isEmpty(promottonPrice)) {
+            proEquRel.setPromotionPrice(promottonPrice);        //促销价
+        }else {
+            proEquRel.setPromotionPrice("0");
+        }
         /*		proEquRel.setIsFragile(isFragile);					//是否易碎
          */
         proEquRel.setUserId(uId);                            //商户id
@@ -717,6 +725,8 @@ public class MachineManageAction implements IMINAction {
         }
         if (!CommonUtil.isEmpty(gamePrice)) {
             proEquRel.setGamePrice(gamePrice);                    //游戏价
+        }else{
+            proEquRel.setGamePrice("0");
         }
         if (!CommonUtil.isEmpty(costPrice)) {
             proEquRel.setCostPrice(costPrice);                    //成本价
@@ -726,6 +736,8 @@ public class MachineManageAction implements IMINAction {
         }
         if (!CommonUtil.isEmpty(promottonPrice)) {
             proEquRel.setPromotionPrice(promottonPrice);        //促销价
+        }else {
+            proEquRel.setPromotionPrice("0");
         }
 		/*if(!CommonUtil.isEmpty(isFragile)){
 			proEquRel.setIsFragile(isFragile);					//是否易碎

+ 35 - 31
src/main/webapp/admin/machineManage/addEquproduct.html

@@ -59,9 +59,9 @@
 		
 		</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" id ="type">
+			</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">
@@ -69,9 +69,6 @@
 		    
 		</div>		
 		<div class="layui-form-item" >
-			<label class="layui-form-label">*游戏类型:</label>
-			<div class="layui-input-inline" id ="type">
-			</div>
 		    <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">
@@ -110,7 +107,7 @@
 	$("#row").html("第"+accAdd(perRow,1)+"层,"+"第"+accAdd(perLine,1)+"列");
         layui.use('form', function(){
        		var form = layui.form;
-       			$('#game').hide();
+			$('#game').hide();
        		//自定义验证规则
           	form.verify({
           		name: function(value) {
@@ -127,17 +124,7 @@
                	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){
+				},costPrice : function(value, item){
 				       	if (isEmpty(value)) {
 				            return '成本价不能为空';
 				        }
@@ -147,31 +134,48 @@
 				   	if(!(/^\d+(\.\d{0,2})?$/.test(value))){ 
 				        return '成本价小数点后保留两位数';
 				      }
-				}      
-				      ,isPromotton : function(value, item){
-				         	if (isEmpty(value)) {
-				              return '请选择是否促销';
-				          }
-				  }  ,perNum : function(value, item){
+				} ,perNum : function(value, item){
 				         	if (isEmpty(value)) {
 				              return '请输入货道容量';
 				          }
 				     	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){ 
 				          return '货道容量为正数';
 				        }
-				  }     
-				      ,numbers : function(value, item){
+				  },numbers : function(value, item){
 				       	if (isEmpty(value)) {
 				            return '请输入商品余量';
 				        }
 				   	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){ 
 				        return '商品余量为正数';
 				      }
-				}/* ,promottonPrice : function(value, item){
-				     	if(!(/^\d+(\.\d{0,2})?$/.test(value))){ 
-				          return '促销价小数点后保留两位数';
-				        }
-				  }  */
+				},type : function(value,item){
+					if (!isEmpty(value)) {
+						if (value =='02'){
+							var promottonPrice = $("#promottonPrice").val();
+							var gamePrice = $("#gamePrice").val();
+							if(isEmpty(gamePrice)){
+								return '当前游戏类型为游戏购,请输入游戏价';
+							}else {
+								if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(gamePrice))){
+									return '游戏价为正数';
+								}
+								if(!(/^\d+(\.\d{0,2})?$/.test(gamePrice))){
+									return '游戏价小数点后保留两位数';
+								}
+							}
+							if(isEmpty(promottonPrice)){
+								return '当前游戏类型为游戏购,请输入促销价';
+							}else {
+								if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(promottonPrice))){
+									return '促销价为正数';
+								}
+								if(!(/^\d+(\.\d{0,2})?$/.test(promottonPrice))){
+									return '促销价小数点后保留两位数';
+								}
+							}
+						}
+					}
+				}
           	});
 	       	//监听提交
 	  	    form.on('submit(demo1)', function(data) {

+ 49 - 45
src/main/webapp/admin/machineManage/editEquproduct.html

@@ -58,19 +58,16 @@
 		
 		</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" id ="type">
+            </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">
+		        <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" >
-			<label class="layui-form-label">*游戏类型:</label>
-			<div class="layui-input-inline" id ="type">
-			</div>
 		    <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">
@@ -149,40 +146,26 @@
 	               	if (isEmpty(value)) {
                         return '售货价不能为空';
                     }
-               	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){ 
+                	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){
                     return '售货价为正数';
-                  }
-               	if(!(/^\d+(\.\d{0,2})?$/.test(value))){ 
+                    }
+               	    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){
+                    }
+                },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 '请选择是否促销';
-			          }
-			  },perNum : 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 '成本价小数点后保留两位数';
+			        }
+			    },perNum : function(value, item){
+                    if (isEmpty(value)) {
+                        return '请输入货道容量';
+                    }
 			     	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){ 
 			          return '货道容量为正数';
 			        }
@@ -190,16 +173,37 @@
 			       	if (isEmpty(value)) {
 			            return '请输入商品余量';
 			        }
-			   	if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){ 
-			        return '商品余量为正数';
-			      }
-			} ,promottonPrice : function(value, item){
-				if (!isEmpty(value)) {
-			     	if(!(/^\d+(\.\d{0,2})?$/.test(value))){ 
-			          return '促销价小数点后保留两位数';
+			   	    if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value))){
+			            return '商品余量为正数';
 			        }
-		        }
-		  } 
+			    } ,type : function(value,item){
+                    if (!isEmpty(value)) {
+                        if (value =='02'){
+                            var promottonPrice = $("#promottonPrice").val();
+                            var gamePrice = $("#gamePrice").val();
+                            if(isEmpty(gamePrice)){
+                                return '当前游戏类型为游戏购,请输入游戏价';
+                            }else {
+                                if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(gamePrice))){
+                                    return '游戏价为正数';
+                                }
+                                if(!(/^\d+(\.\d{0,2})?$/.test(gamePrice))){
+                                    return '游戏价小数点后保留两位数';
+                                }
+                            }
+                            if(isEmpty(promottonPrice)){
+                                return '当前游戏类型为游戏购,请输入促销价';
+                            }else {
+                                if(!(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(promottonPrice))){
+                                    return '促销价为正数';
+                                }
+                                if(!(/^\d+(\.\d{0,2})?$/.test(promottonPrice))){
+                                    return '促销价小数点后保留两位数';
+                                }
+                            }
+                        }
+                    }
+                }
           	});
 	       	//监听提交
 	  	    form.on('submit(demo1)', function(data) {

+ 6 - 3
src/main/webapp/admin/machineManage/machineDetail.html

@@ -81,12 +81,15 @@
 						$("#C"+data.data[k].perRow+"B"+data.data[k].perLine+"C").css("background","#f0f0f0");
 						$("#C"+data.data[k].perRow+"B"+data.data[k].perLine+"X").hide();
 					}else{
-						debugger
-						html1 +='<img src="'+data.data[k].proFmpic+'" height="100px" width="100px">'+
+						debugger;
+						html1 +='<img src="'+data.data[k].proFmpic+'" height="50px" width="50px">'+
         				'<p style="margin-top:10px;">'+data.data[k].proName+'</p>'+
         				'<p>售货价:¥'+data.data[k].sallPrice+'</p>'+
-        				'<p>是否促销:'+data.data[k].isPromottonDesc+'</p>'+
+						'<p>促销价:¥'+data.data[k].promottonPrice+'</p>'+
+						'<p>游戏价:¥'+data.data[k].gamePrice+'</p>'+
+        				'<p>游戏类型:'+data.data[k].typeDesc+'</p>'+
         				'<p>商品余量:'+data.data[k].numbers+'</p>'+
+						'<p>货道容量:'+data.data[k].perNum+'</p>'+
         				'<p style="margin-bottom:10px;">货道指令:'+data.data[k].aisle+'</p>'+
         				'<button class="layui-btn layui-btn-sm" onclick="proEquRelDetail('+data.data[k].perRow+','+data.data[k].perLine+','+data.data[k].perId+')" style="display:none">查看</button>'+
         				'<button class="layui-btn layui-btn-sm" onclick="addProEquRelNum('+data.data[k].perRow+','+data.data[k].perLine+','+data.data[k].perId+','+data.data[k].perNum+')">补货</button>'+