Commit cdcdcb63 by 施宇

报价数据自动填充

parent 74572c23
......@@ -77,7 +77,7 @@
title="期货" checked id="daytext">
<div class="lineBlock" id="day">
<input type="text" placeholder="输入时间" class="boxsiz day_input input"
lay-verify="required|limitLengthLgThree" name="day">
lay-verify="required" name="day">
<i class="day"></i>
</div>
</div>
......@@ -128,7 +128,7 @@
<script src="__PUBLIC__/js/goodmanage/uploadsingle.js"></script>
<script type="text/html" id="deliveryHtml">
{{# if (d=='期货') { }}
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number|limitLengthLgThree"
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required"
name="day">
<i class="day"></i>
{{# } }}
......
......@@ -86,7 +86,7 @@
id="daytext">
<div class="lineBlock" id="day">
<input type="text" placeholder="输入时间" class="boxsiz day_input input"
lay-verify="required|number|limitLengthLgThree" name="day">
lay-verify="required" name="day">
<i class="day"></i>
</div>
</div>
......@@ -235,7 +235,7 @@
</script>
<script type="text/html" id="deliveryHtml">
{{# if (d=='期货') { }}
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number|limitLengthLgThree" name="day">
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required" name="day">
<i class="day"></i>
{{# } }}
</script>
......
......@@ -71,7 +71,7 @@
<input type="radio" name="delivery_time" lay-filter="delivery" value="现货" title="现货"/>
<input type="radio" name="delivery_time" lay-filter="delivery" value="期货" title="期货" checked id="daytext"/>
<div class="lineBlock" id="day">
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number|limitLengthLgThree" name="day" />
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required" name="day" />
<i class="day"></i>
</div>
</div>
......@@ -132,7 +132,7 @@
<script src="__PUBLIC__/js/quoteprice/releaseinquiry.js"></script>
<script type="text/html" id="deliveryHtml">
{{# if (d=='期货') { }}
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number|limitLengthLgThree" name="day">
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required" name="day">
<i class="day"></i>
{{# } }}
</script>
......
$(function () {
var quotedetail = {
list: [],
userinfo: {},
init: function () {
this.getUserData();
this.getMybjData();
......@@ -9,12 +10,14 @@ $(function () {
},
isClick: false,
getUserData: function () {
var self = this;
IcController.getData(apis.inquirySearch, 'GET', {
"inquiry_items_id/eq": Util.getRequest('id') || "",
}, function (res) {
var getNav = navTpl.innerHTML,
getDetail = detailTpl.innerHTML;
if (res.errcode == 0) {
self.userinfo = res.inquiry_list[Util.getRequest('id') || ''];
layui.laytpl(getNav).render(res.inquiry_list[Util.getRequest('id') || ''], function (html) {
$(".quote_detail_content .nav_title").empty().html(html);
});
......@@ -93,49 +96,52 @@ $(function () {
$('.from_mask').fadeOut()
});
$('.quote_detail_content').on('click', '.bj_btn', function () {
if ($(this).hasClass('disabled')||self.list.length == 3) {
if ($(this).hasClass('disabled') || self.list.length == 3) {
return
} else {
var len = self.list.length;
var parent = $('.from_mask');
var targetItem = {}
if (len) {
var targetItem = self.list[len - 1];
console.log(targetItem)
if (targetItem.goods_name) {
parent.find('[name="goods_name"]').val(targetItem.goods_name)
}
if (targetItem.brand_name) {
parent.find('[name="brand_name"]').val(targetItem.brand_name)
}
if (targetItem.encap) {
parent.find('[name="encap"]').val(targetItem.encap)
}
if (targetItem.number) {
parent.find('[name="number"]').val(targetItem.number)
}
if (!targetItem.price || targetItem.price == '0.00' || targetItem.price == '0') {
parent.find('[name="price"]').val()
parent.find('[name="currency"]').val('1');
layui.form.render('select');
} else {
parent.find('[name="price"]').val(targetItem.price)
if (targetItem.currency == 1) {
parent.find('[name="currency"]').val('1')
} else {
parent.find('[name="currency"]').val('2')
}
layui.form.render('select');
}
if (targetItem.delivery_time === '现货') {
parent.find('.layui-form-radio').eq(0).trigger('click');
targetItem = self.list[len - 1];
} else {
targetItem = self.userinfo
}
if (targetItem.goods_name) {
parent.find('[name="goods_name"]').val(targetItem.goods_name)
}
if (targetItem.brand_name) {
parent.find('[name="brand_name"]').val(targetItem.brand_name)
}
if (targetItem.encap) {
parent.find('[name="encap"]').val(targetItem.encap)
}
if (targetItem.number) {
parent.find('[name="number"]').val(targetItem.number)
}
if (!targetItem.price || targetItem.price == '0.00' || targetItem.price == '0') {
parent.find('[name="price"]').val()
parent.find('[name="currency"]').val('1');
layui.form.render('select');
} else {
parent.find('[name="price"]').val(targetItem.price)
if (targetItem.currency == 1) {
parent.find('[name="currency"]').val('1')
} else {
parent.find('.layui-form-radio').eq(1).trigger('click');
parent.find('[name="day"]').val(targetItem.delivery_time.slice(0, -1))
}
if (targetItem.remark) {
parent.find('[name="remark"]').val(targetItem.remark)
parent.find('[name="currency"]').val('2')
}
layui.form.render('select');
}
if (targetItem.delivery_time === '现货') {
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))
}
if (targetItem.remark) {
parent.find('[name="remark"]').val(targetItem.remark)
}
parent.fadeIn()
}
......@@ -193,7 +199,7 @@ $(function () {
});
layui.form.verify({
limitLengthThree: function (value, item) {
if (value.length < 3) {
......
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