Commit 75d1837a by 施宇

111

parent 12e1a57b
......@@ -59,7 +59,7 @@
<span class="input_title lineBlock">*单价:</span>
<div class="input_parent">
<input type="text" name="price" placeholder="请输入接受价格"
class="input boxsiz price_input" lay-verify="required|number">
class="input boxsiz price_input" lay-verify="required|number|pointLimit">
<div class="rmb layui-form">
<select name="currency" lay-verify="required">
<option value="1">CNY</option>
......
......@@ -69,7 +69,7 @@
<span class="input_title lineBlock">报价:</span>
<div class="input_parent">
<input type="text" name="price" placeholder="请输入接受价格" class="input boxsiz price_input"
lay-verify="required|number">
lay-verify="required|number|pointLimit">
<div class="rmb layui-form">
<select name="currency" lay-verify="required">
<option value="1">CNY</option>
......
......@@ -56,7 +56,7 @@
<span class="input_title lineBlock">*单价:</span>
<div class="input_parent">
<input type="text" name="price" placeholder="请输入接受价格"
class="input boxsiz price_input" lay-verify="required|number">
class="input boxsiz price_input" lay-verify="required|number|pointLimit">
<div class="rmb layui-form">
<select name="currency" lay-verify="required">
<option value="1">CNY</option>
......
......@@ -517,6 +517,14 @@
}, function () {
$('.' + ele2).stop().slideUp()
})
},
fourPoint:function(num){//检测价格是否是四位小数点的小数
var strArr = num.split('.');
if ((strArr.length == 1) || (strArr.length == 2 && strArr[1].length == 4)) {
return true
} else {
return false;
}
}
};
if (typeof define === "function" && define.amd) {
......
......@@ -70,6 +70,7 @@
layui.form.val("goodsave", {
"day": res['goods_list'][id].delivery_time.replace('天', '')
});
$("#daytext").val(res['goods_list'][id].delivery_time);
}
......@@ -251,8 +252,7 @@
token: opt.token
});
id ? url = apis.goodsSave : url = apis.goodsAdd;
id ? url = apis.goodsSave : url = apis.goodsAdd;
IcController.getData(url, 'GET', params, function (res) {
if (res.errcode === 0) {
......@@ -314,7 +314,12 @@
if (value.length > 3) {
return '货期不能大于3个字符'
}
}
},
pointLimit: function (value, item) {
if(!Util.fourPoint(value)){
return '价格只支持4位小数点'
}
},
});
return this;
......
......@@ -136,7 +136,8 @@ $(function () {
parent.find('.layui-form-radio').eq(0).trigger('click');
} else {
parent.find('.layui-form-radio').eq(1).trigger('click');
parent.find('[name="day"]').val(targetItem.delivery_time.slice(0, -1))
$("#daytext").val(targetItem.delivery_time);
parent.find('[name="day"]').val(targetItem.delivery_time.slice(0, -1));
}
if (targetItem.remark) {
parent.find('[name="remark"]').val(targetItem.remark)
......@@ -215,7 +216,12 @@ $(function () {
if (value.length > 3) {
return '货期不能大于3个字符'
}
}
},
pointLimit: function (value, item) {
if(!Util.fourPoint(value)){
return '价格只支持4位小数点'
}
},
});
}
......
......@@ -215,7 +215,12 @@
if (value.length > 3) {
return '货期不能大于3个字符'
}
}
},
pointLimit: function (value, item) {
if(!Util.fourPoint(value)){
return '价格只支持4位小数点'
}
},
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment