xubh il y a 5 ans
Parent
commit
aff3242f73

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

@@ -510,6 +510,7 @@ public class MachineManageAction implements IMINAction {
             @MINParam(key = "proId") String proId,
             @MINParam(key = "equId") String equId,
             @MINParam(key = "luck") String luck,
+            @MINParam(key = "drawAmount") String drawAmount,
             MINSession session
     ) throws MINBusinessException {
 
@@ -622,6 +623,9 @@ public class MachineManageAction implements IMINAction {
         proEquRel.setModifyUser(uId);                        //最后修改人
         proEquRel.setModifyTime(dateTime);                    //最后修改时间
         proEquRel.setExeitState("00");    //状态 00正常
+        if (!CommonUtil.isEmpty(drawAmount)) {
+            proEquRel.setDrawAmount(drawAmount);
+        }
 
         Service.lookup(IMINDataBaseService.class)
                 .getMybatisMapper(VmProEquRelMapper.class)

+ 84 - 10
src/main/webapp/admin/machineManage/addEquproduct.html

@@ -50,11 +50,11 @@
 		<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="number"  onblur="value=zhzs(this.value)"   name="sallPrice" maxlength="30" id ="sallPrice" lay-verify="sallPrice" autocomplete="off" placeholder="请输入售货价" 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">
+		        <input type="number"  onblur="value=zhzs(this.value)"   name="costPrice" maxlength="30" id ="costPrice" lay-verify="costPrice" autocomplete="off" placeholder="请输入成本价" class="layui-input">
 		    </div>
 		
 		</div>
@@ -64,14 +64,14 @@
 			</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="number"  onblur="value=zhzs(this.value)"  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">
-		        <input type="text" name="gamePrice" maxlength="30" id ="gamePrice" lay-verify="gamePrice" autocomplete="off" placeholder="请输入游戏价" class="layui-input">
+		        <input type="number"  onblur="value=zhzs(this.value)"  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()">
@@ -82,6 +82,18 @@
 		    </div>
 		    </div>
 		</div>
+		<div class="layui-form-item" id = "range" style="display: none;">
+			<div class="layui-inline">
+				<label class="layui-form-label">中奖范围</label>
+				<div class="layui-input-inline" style="width: 100px;">
+					<input type="text" name="price_min" placeholder="¥"  autocomplete="off"  lay-verify="price_min"  class="layui-input" id = "price_min" maxlength="10">
+				</div>
+				<div class="layui-form-mid">-</div>
+				<div class="layui-input-inline" style="width: 100px;">
+					<input type="text" name="price_max" placeholder="¥"  autocomplete="off" lay-verify="price_max"   class="layui-input" id = "price_max" maxlength="10">
+				</div>
+			</div>
+		</div>
 		<div class="layui-form-item">
             <label class="layui-form-label">备注:</label>
             <div class="layui-input-block" >
@@ -186,6 +198,29 @@
 	  	    		data.field.isContainImg = "0"
 	  	    	}
 	  	    	data.field.imgUrl = imgUrl; */
+				var type = $("select[name='type']").val();
+				if(type == '02'){
+					var price_min = $('#price_min').val();
+					var price_max = $('#price_max').val();
+					if(isEmpty(price_min)){
+						layer.msg('中奖范围不能为空',function() {time:2000});
+						return false;
+					}
+					if(isEmpty(price_max)){
+						layer.msg('中奖范围不能为空',function() {time:2000});
+						return false;
+					}
+					if(isNaN(price_min)){
+						layer.msg('中奖范围类型错误',function() {time:2000});
+						return false;
+					}
+					if(isNaN(price_max)){
+						layer.msg('中奖范围类型错误',function() {time:2000});
+						return false;
+					}
+					data.field.drawAmount = price_min+'-'+price_max;
+				}
+
 	  			$.request({
 	  				action : '../../MachineManageAction/addProEquRel',
 	  				data : data.field ,
@@ -209,11 +244,14 @@
 			  deleteTabPage('201001-03-04');
 		    });
 	  	form.on('select(type)', function(data){
-    		if(data.value ==30){
-        		  $('#luckno').show();
-        	  }else{
-        		  $('#luckno').hide();
-        	  }
+			if(data.value == 03){
+				$('#luckno').show();
+			}else if(data.value == 02){
+				$('#range').show();
+			}else{
+				$('#range').hide();
+				$('#luckno').hide();
+			}
         });    
     });
         
@@ -284,10 +322,46 @@
                 }
         	}
         });
-	 }) 
+	})
 	  initSelect('isPromotton', "IS_PROMOTION", "isPromotton", '', true);
 	  initSelect('isFragile', "IS_FRAGILE", "isFragile", '', true);
 	  initSelect('type', 'GAME_EQU_TYPE', 'type', '', true);
+	//(商品售价+促销价)~(商品售价+游戏价)
+	$("#sallPrice").bind('input propertychange',function(){
+		zjfwstr();
+	});
+	$("#gamePrice").bind('input propertychange',function(){
+		zjfwstr();
+	});
+	$("#promottonPrice").bind('input propertychange',function(){
+		zjfwstr();
+	});
+	function  zjfwstr() {
+		var type = $("select[name='type']").val();
+		if(type == '02'){
+			//售价
+			var sallPrice = parseFloat($('#sallPrice').val()).toFixed(2);; ;
+			//游戏价
+			var gamePrice = parseFloat($('#gamePrice').val()).toFixed(2);;
+			//促销价
+			var promottonPrice = parseFloat($('#promottonPrice').val()).toFixed(2);;
+			$('#price_min').val(parseFloat(parseFloat(sallPrice)+ parseFloat(promottonPrice)).toFixed(2) );
+			$('#price_max').val(parseFloat(parseFloat(sallPrice)+parseFloat(gamePrice)).toFixed(2));
+
+		}
+
+	}
+	/*自定义处理数字*/
+	function zhzs(value) {
+		value = value.replace(/^0{1,}/g, '');
+		if (value != '')
+			value = parseFloat(value).toFixed(2);
+		else
+			value = parseFloat(0).toFixed(2);
+		return value;
+	}
+
+
     </script>
 </body>
 

+ 7 - 5
src/main/webapp/admin/machineManage/editEquproduct.html

@@ -397,14 +397,16 @@
 	function  zjfwstr() {
 		var type =$("#type").val();
 		if(type == '02'){
+
 			//售价
-			var sallPrice = parseInt($('#sallPrice').val()); ;
+			var sallPrice = parseFloat($('#sallPrice').val()).toFixed(2);; ;
 			//游戏价
-			var gamePrice = parseInt($('#gamePrice').val());
+			var gamePrice = parseFloat($('#gamePrice').val()).toFixed(2);;
 			//促销价
-			var promottonPrice = parseInt($('#promottonPrice').val());
-			$('#price_min').val(sallPrice + promottonPrice);
-			$('#price_max').val(sallPrice + gamePrice);
+			var promottonPrice = parseFloat($('#promottonPrice').val()).toFixed(2);;
+			$('#price_min').val(parseFloat(parseFloat(sallPrice)+ parseFloat(promottonPrice)).toFixed(2) );
+			$('#price_max').val(parseFloat(parseFloat(sallPrice)+parseFloat(gamePrice)).toFixed(2));
+
 		}
 
 	}