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