Commit 17458eaf by 施宇

询价有效期

parent 12e0258e
......@@ -88,6 +88,7 @@
</div>
<div class="num fl boxsiz ellipsis"> 数量:<span class="bold"> {{d.number}} PCS</span></div>
<div class="hq fl boxsiz ellipsis"> 货期:<span>{{d.delivery_time}}</span></div>
<div class="yxq fl boxsiz ellipsis"> 询价有效期:<span>{{d.end_time_date || '--'}}</span></div>
<div class="bz fl boxsiz ellipsis"> 备注:<span> {{d.remark||'--'}}</span></div>
</div>
</div>
......
......@@ -68,7 +68,7 @@
<div class="yxq input_div ">
<span class="input_title lineBlock">*询价有效期:</span>
<div class="input_parent">
<input type="text" name="price" placeholder="请选择截止日期"
<input type="text" name="end_time" placeholder="请选择截止日期"
class="input boxsiz yxq_input" lay-verify="required" id="yxq">
<div class="yxq_logo layui-form">
<span class="icon iconfont iconjuxing13"></span>
......
!function () {
! function () {
window.ReleaseInquiry = {
isClick: false,
imgUrl: "",
......@@ -6,16 +6,17 @@
this.created(this).mounted(this).isIe(this).handleBind(this);
},
created: function (opt) {
//日期控件初始化
layui.laydate.render({
elem: '#yxq',
theme: '#0D84D1'
});
//日期控件初始化
layui.laydate.render({
elem: '#yxq',
theme: '#0D84D1',
trigger: 'click',
min:new Date().toLocaleDateString().split('/').join('-'),
max:365
});
return this;
},
mounted: function (opt) {
return this;
},
uploadFun: function () {
......@@ -26,8 +27,8 @@
data: {
token: Util.getCookie('token'),
source: 2,
},
field: "upload",
before: function () {
......@@ -50,10 +51,10 @@
err: function () {
layer.closeAll('loading');
layer.msg('上传失败');
}
});
},
isIe: function (opt) {
if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE8.0" || navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE9.0")) {
......@@ -65,8 +66,7 @@
iframe.attachEvent("onload", opt.iframeOnload);
} else {
iframe.onload = opt.iframeOnload;
}
;
};
opt.formSubmit();
$('#mineFiles').on('change', function () {
layer.load(1, {
......@@ -105,7 +105,7 @@
} catch (e) {
layer.closeAll('loading');
layer.msg('上传失败');
}
if (json) {
layer.closeAll('loading');
......@@ -116,80 +116,83 @@
ReleaseInquiry.imgUrl = json.data[0] || '';
} else {
layer.msg(json.errmsg)
}
}
},
handleBind: function (opt) {
//货期选择
layui.form.on('radio(delivery)', function (data) {
var str = '期货';
data.value == '现货' ? str = '现货' : str = '期货';
var getTpl = deliveryHtml.innerHTML;
layui.laytpl(getTpl).render(str, function (html) {
$("#day").empty().html(html);
});
});
//天数同步期货
$(document).on('input propertychange', 'input[name="day"]', function () {
var val = $(this).val();
$("#daytext").val(val + '天');
});
$('.cz').on('click', function () {
$('#xj_form')[0].reset();
})
//上传商品发布
layui.form.on('submit(add)', function (data) {
var date = data.field.end_time;
date = date.replace(/-/g,'/');
var timeStap =new Date(date+' 23:59:59').getTime()/1000
data.field.end_time = timeStap;//设置选中的时间变为时间戳
$(data.elem).addClass("layui-btn-disabled");
var parmas = $.extend({}, data.field, {
goods_images: opt.imgUrl
})
if (!opt.isClick) {
opt.isClick = true;
IcController.getData(apis.inquiryadd + '?token=' + Util.getCookie('token'), 'get', parmas, function (res) {
if (res.errcode == 0) {
layer.msg('发布询价成功', {
time: 2000
}, function () {
window.location.href = '/inquiry';
});
} else {
layer.msg(res.errmsg);
opt.isClick = false;
$(data.elem).removeClass("layui-btn-disabled");
}
});
}
});
$('.form_content').on('click', '.deleteicon', function () {
if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE8.0" || navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE9.0")) {
//ie版本
$('#fileLoad').show();
......@@ -200,10 +203,10 @@
$('.upload_result').hide();
$('.upload_result img').attr('src', '');
opt.imgUrl = "";
});
layui.form.verify({
limitLengthThree: function (value, item) {
if (value.length < 3) {
......@@ -215,8 +218,8 @@
return '品牌不能小于2个字符'
}
},
limitStock:function(value, item){
if(value>10000000){
limitStock: function (value, item) {
if (value > 10000000) {
return '库存最大为10000000(一千万)'
}
},
......@@ -226,16 +229,16 @@
}
},
pointLimit: function (value, item) {
if(!Util.fourPoint(value)){
return '价格为整数或不超过4位小数'
if (!Util.fourPoint(value)) {
return '价格为整数或不超过4位小数'
}
if(value>1000000){
if (value > 1000000) {
return '价格最大为1000000(一百万)'
}
}
}
});
return this;
},
}, $(function () {
......
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