|
|
|
@ -2,7 +2,7 @@ |
|
|
|
<html class="x-admin-sm"> |
|
|
|
<head> |
|
|
|
<meta charset="UTF-8"> |
|
|
|
<title>设备信息总览</title> |
|
|
|
<title>产品信息总览</title> |
|
|
|
<meta name="renderer" content="webkit"> |
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|
|
|
<meta name="viewport" |
|
|
|
@ -66,7 +66,7 @@ |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
<div class="layui-inline layui-show-xs-block"> |
|
|
|
<input style="display: none" lay-verify="" id="findText" type="text" name="message" |
|
|
|
<input style="display: none" lay-verify="" id="productId" type="text" name="productId" |
|
|
|
autocomplete="false" placeholder="" lay-reqText="" class="layui-input"> |
|
|
|
</div> |
|
|
|
<div class="layui-inline layui-show-xs-block"> |
|
|
|
@ -98,7 +98,7 @@ |
|
|
|
$("#refresh").click(function () { |
|
|
|
$("#myForm")[0].reset(); |
|
|
|
layui.form.render(); |
|
|
|
$("#findText").hide(); |
|
|
|
$("#productId").hide(); |
|
|
|
parent.layui.notice.remove(); |
|
|
|
parent.layui.notice.success("设备序列号列表已校准", "<div class = 'layui-icon layui-icon-heart-fill'> 同步成功</div>", parent.noticeOpt6); |
|
|
|
table.render({ |
|
|
|
@ -115,42 +115,17 @@ |
|
|
|
, first: false //不显示首页 |
|
|
|
, last: false //不显示尾页 |
|
|
|
} |
|
|
|
, cols: [[ //表头,style: 'background-color: #bee4ca ; color: #2c2525 ' ,style: 'background-color: #acd3ed;color: #2c2525;' ,style: 'background-color: #bda9c5' |
|
|
|
{ |
|
|
|
field: 'productId', |
|
|
|
title: '产品ID', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'status', title: '状态', |
|
|
|
width: 90, align: 'center', |
|
|
|
templet: function (d) { |
|
|
|
if (d.status == 1) { |
|
|
|
return '<span style="color: #ab3635;font-family: 黑体;font-weight: bold;">正常</span>' |
|
|
|
} else { |
|
|
|
return '<span style="color: #33912b;font-family: 黑体;font-weight: bold;">停用</span>' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'operation', |
|
|
|
title: '操作', |
|
|
|
width: 90, |
|
|
|
align: 'center', |
|
|
|
toolbar: '#barDemo' |
|
|
|
} |
|
|
|
]] |
|
|
|
, cols: [get_cols()] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
//动态显示 |
|
|
|
parent.layui.notice.remove(); |
|
|
|
parent.layui.notice.info('设备信息总览', '已进入', parent.noticeOpt1); |
|
|
|
parent.layui.notice.info('产品信息总览', '已进入', parent.noticeOpt1); |
|
|
|
setTimeout(function () { |
|
|
|
$('.flag').show(); |
|
|
|
tableIns.resize(); |
|
|
|
},20); |
|
|
|
}, 20); |
|
|
|
|
|
|
|
|
|
|
|
//自定义验证规则 |
|
|
|
@ -163,7 +138,7 @@ |
|
|
|
} |
|
|
|
// return '请选择搜索项!' |
|
|
|
}, |
|
|
|
message: function (value) { |
|
|
|
productId: function (value) { |
|
|
|
if (!value) { |
|
|
|
parent.layui.notice.remove(); |
|
|
|
parent.layui.notice.error('请输入要搜索的内容', '操作异常', parent.noticeOpt5); |
|
|
|
@ -179,27 +154,27 @@ |
|
|
|
// console.log(data.elem); //得到select原始DOM对象 |
|
|
|
// console.log(data.value); //得到被选中的值 |
|
|
|
// console.log(data.othis); //得到美化后的DOM对象 |
|
|
|
var findText = $("#findText"); |
|
|
|
var select = data.value; |
|
|
|
let productId = $("#productId"); |
|
|
|
let select = data.value; |
|
|
|
//默认不显示输入框 |
|
|
|
findText.hide(); |
|
|
|
productId.hide(); |
|
|
|
//重置验证类型 |
|
|
|
findText.attr('lay-verify', ''); |
|
|
|
productId.attr('lay-verify', ''); |
|
|
|
//每次切换搜索项后都要清空里面的值 |
|
|
|
findText.val(''); |
|
|
|
// console.log(findText.val); |
|
|
|
productId.val(''); |
|
|
|
// console.log(productId.val); |
|
|
|
switch (select) { |
|
|
|
case "1": |
|
|
|
findText.attr('lay-verify', 'message'); |
|
|
|
findText.attr('placeholder', '请输入要搜索的设备ID'); |
|
|
|
// findText.attr('lay-reqText', '请输入要搜索的设备ID'); |
|
|
|
findText.show(); |
|
|
|
productId.attr('lay-verify', 'productId'); |
|
|
|
productId.attr('placeholder', '请输入要搜索的产品ID'); |
|
|
|
// productId.attr('lay-reqText', '请输入要搜索的设备ID'); |
|
|
|
productId.show(); |
|
|
|
break; |
|
|
|
case "2": |
|
|
|
findText.attr('lay-verify', 'message'); |
|
|
|
findText.attr('placeholder', '请输入要搜索的设备类型'); |
|
|
|
// findText.attr('lay-reqText', '请输入要搜索的设备类型'); |
|
|
|
findText.show(); |
|
|
|
productId.attr('lay-verify', 'productId'); |
|
|
|
productId.attr('placeholder', '请输入要搜索的产品类型'); |
|
|
|
// productId.attr('lay-reqText', '请输入要搜索的设备类型'); |
|
|
|
productId.show(); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
@ -220,69 +195,73 @@ |
|
|
|
, first: false //不显示首页 |
|
|
|
, last: false //不显示尾页 |
|
|
|
} |
|
|
|
, cols: [[ //表头,style: 'background-color: #bee4ca ; color: #2c2525 ' ,style: 'background-color: #acd3ed;color: #2c2525;' ,style: 'background-color: #bda9c5' |
|
|
|
, cols: [get_cols()] |
|
|
|
}); |
|
|
|
|
|
|
|
function get_cols() { |
|
|
|
return [ //表头,style: 'background-color: #bee4ca ; color: #2c2525 ' ,style: 'background-color: #acd3ed;color: #2c2525;' ,style: 'background-color: #bda9c5' |
|
|
|
{ |
|
|
|
field: 'productId', |
|
|
|
title: '设备ID', |
|
|
|
title: '产品ID', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'productName', |
|
|
|
title: '设备名称', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
field: 'productName', |
|
|
|
title: '产品名称', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'productDesc', |
|
|
|
title: '设备描述', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
field: 'productDesc', |
|
|
|
title: '产品描述', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'productTypeValue', |
|
|
|
title: '产品分类名称', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
field: 'productTypeValue', |
|
|
|
title: '产品分类名称', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'secondaryTypeValue', |
|
|
|
title: '二级分类名称', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
field: 'secondaryTypeValue', |
|
|
|
title: '二级分类名称', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'thirdTypeValue', |
|
|
|
title: '三级分类名称', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
field: 'thirdTypeValue', |
|
|
|
title: '三级分类名称', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'encryptionType', |
|
|
|
title: '加密认证方式', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
field: 'encryptionType', |
|
|
|
title: '加密认证方式', |
|
|
|
minWidth: 100, |
|
|
|
align: 'center' |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'status', title: '状态', |
|
|
|
width: 90, align: 'center', |
|
|
|
templet: function (d) { |
|
|
|
if (d.status == 1) { |
|
|
|
return '<span style="color: #33912b;font-family: 黑体;font-weight: bold;">正常</span>' |
|
|
|
} else { |
|
|
|
return '<span style="color: #ab3635;font-family: 黑体;font-weight: bold;">停用</span>' |
|
|
|
} |
|
|
|
field: 'status', title: '状态', |
|
|
|
width: 90, align: 'center', |
|
|
|
templet: function (d) { |
|
|
|
if (d.status == 1) { |
|
|
|
return '<span style="color: #33912b;font-family: 黑体;font-weight: bold;">正常</span>' |
|
|
|
} else { |
|
|
|
return '<span style="color: #ab3635;font-family: 黑体;font-weight: bold;">停用</span>' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
, { |
|
|
|
field: 'operation', |
|
|
|
title: '操作', |
|
|
|
width: 90, |
|
|
|
align: 'center', |
|
|
|
toolbar: '#barDemo' |
|
|
|
} |
|
|
|
]] |
|
|
|
}); |
|
|
|
field: 'operation', |
|
|
|
title: '操作', |
|
|
|
width: 90, |
|
|
|
align: 'center', |
|
|
|
toolbar: '#barDemo' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
//搜索功能 |
|
|
|
form.on('submit(search)', function (data) { |
|
|
|
@ -292,7 +271,7 @@ |
|
|
|
tableIns.reload({ |
|
|
|
where: { //设定异步数据接口的额外参数,任意设 |
|
|
|
choose: data.field.option |
|
|
|
, message: data.field.message |
|
|
|
, productId: data.field.productId |
|
|
|
} |
|
|
|
, page: { |
|
|
|
curr: 1 //重新从第 1 页开始 |
|
|
|
|