Commit cdcdcb63 by 施宇

报价数据自动填充

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