|
|
@@ -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) {
|