|
@@ -14,7 +14,6 @@
|
|
|
<div class="tiaojian-part2 fr demoTable">
|
|
|
<button class="layui-btn order-bnt1" data-type="reload" >搜索</button>
|
|
|
<button class="layui-btn order-bnt2" data-type="reset">重置</button>
|
|
|
- <button class="layui-btn order-bnt2" id = "addUser">添加</button>
|
|
|
<a href="#" id="toggle" class="top">收起</a>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -22,16 +21,16 @@
|
|
|
<div class="order-select back-border" id="content">
|
|
|
<div class="layui-inline">
|
|
|
<label class="f12-gray4">机台号 :</label>
|
|
|
- <input type="tel" name="machineNo" id ="machineNo" autocomplete="off" placeholder="请输入机台号" class="layui-input">
|
|
|
+ <input type="tel" name="machineNo" id ="machineNo" onchange = "changeSelectCon(0,this,'inp')" placeholder="请输入机台号" class="search-select">
|
|
|
</div>
|
|
|
<div class="layui-inline">
|
|
|
<label class="f12-gray4">订单号:</label>
|
|
|
- <input type="tel" name="orderNo" id ="orderNo" autocomplete="off" placeholder="请输入订单号" class="layui-input">
|
|
|
+ <input type="tel" name="orderNo" id ="orderNo" onchange = "changeSelectCon(1,this,'inp')" placeholder="请输入订单号" class="search-select">
|
|
|
</div>
|
|
|
<div class="d-dashed" style="margin: 10px 0;"></div>
|
|
|
<div class="layui-inline">
|
|
|
<label class="f12-gray4">取货时间:</label>
|
|
|
- <input class="search-select" type="text" id="pickUpDates" placeholder="日期(区间)" readonly />
|
|
|
+ <input class="search-select" type="text" id="pickUpDates" placeholder="日期(区间)" readonly />
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
@@ -55,7 +54,7 @@
|
|
|
,range: true
|
|
|
,format:'yyyyMMdd'
|
|
|
,done: function(value, date, endDate){
|
|
|
- changeSelectCon(1,"dates",'date',value)
|
|
|
+ changeSelectCon(3,"pickUpDates",'date',value)
|
|
|
}
|
|
|
});
|
|
|
form = layui.form;
|
|
@@ -121,6 +120,77 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ function changeSelectCon(index, t, type, dateValue){
|
|
|
+ if (type == "date") {
|
|
|
+ if (isEmpty(dateValue)) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type,dateValue));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (type == 'inp') {
|
|
|
+ if (isEmpty($(t).val())) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (isEmpty($(t).val())) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $(t).attr("id",dateValue);
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type,dateValue));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var array = new Array('机台号','订单号','取货时间');
|
|
|
+ function getSelectConHtml(index, t, type,dateValue){
|
|
|
+ var name;
|
|
|
+ var value;
|
|
|
+ if(type == "inp"){
|
|
|
+ value = t.value.substr(0,5)+"..";
|
|
|
+ }
|
|
|
+ if (type == "date") {
|
|
|
+ value = dateValue;
|
|
|
+ }
|
|
|
+ if(type == "sel" && dateValue =="state"){
|
|
|
+ value = $("#state").find("option:selected").text();
|
|
|
+ }
|
|
|
+ if(type == "sel" && dateValue =="roleid"){
|
|
|
+ value = $("#roleid").find("option:selected").text();
|
|
|
+ }
|
|
|
+ if (type == "date") {
|
|
|
+ name = $("#"+t).attr("id");
|
|
|
+ } else {
|
|
|
+ name = $(t).attr("id");
|
|
|
+ }
|
|
|
+ var html = '<div class="fl xuanzhong-active" id = "search' + index + '" name = "' + name + '" onclick = "removeSearch(this)">' +
|
|
|
+ '<div class="fl">' + array[index] + '</div>' +
|
|
|
+ ':<i class="iconfont">'+value+'</i>' +
|
|
|
+ '<svg class="icon" aria-hidden="true">' +
|
|
|
+ '<use xlink:href="#iconicon_close1"></use>' +
|
|
|
+ '</svg>' +
|
|
|
+ '</div>';
|
|
|
+ return html;
|
|
|
+ }
|
|
|
+ function removeSearch(t) {
|
|
|
+ if ($(t).attr("name") == 'state') {
|
|
|
+ initSelect('state', "IM_USER_STATE", "state", ' ', true);
|
|
|
+ form.render();
|
|
|
+ $(t).remove();
|
|
|
+ } else {
|
|
|
+ $("#"+$(t).attr("name")).val('');
|
|
|
+ $(t).remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|