var baseUrl = "https://custproj00011-2.ceydz.com/front"; var token = sessionStorage.getItem("token"); $('#c_portalResPublic_codeContainer-1680865358089 .jc_report').css({ 'background': 'url("../img/beijing1.jpg") no-repeat center', 'background-size': 'cover', 'height': document.documentElement.clientHeight + 'px' }) $(document).ready(function() { // 判断是否登陆 }); //点击查询 $(".jc_reportbtn").click(function() { let huozhengzuzi = $("#huozhengzuzi").val(); let reportNo = $("#reportNo").val(); let data = { huozhengzuzi, reportNo, }; // console.log("发送数据", data); if (huozhengzuzi == "" || reportNo == "") { layer.msg("请输入信息"); } else { $.ajax({ beforeSend: function(XMLHttpRequest) { XMLHttpRequest.setRequestHeader("token", token); }, type: "get", url: baseUrl + "/wangrui/wentan/getReportList", contentType: "application/json;charset=UTF-8", data: { huozhengzuzi, reportNo, }, success: (res) => { // console.log("成功了", res); var table = layui.table; table.render({ elem: "#jc_table", data: res.content, cols: [ [ //表头 field 对应字段 { field: "year", title: "年份", align: "center", width: '52' }, { field: "huozhengzuzi", title: "获证组织", align: "center", width: '200' }, { field: "reportName", title: "证书/报告名称", align: "center", width: '124' }, { field: "reportNo", title: "证书/报告编号", align: "center", width: '124' }, { field: "guigexinghao", title: "产品名称/规格型号", align: "center", width: '123' }, { field: "renzhengTime", title: "证书/报告时间", align: "center", width: '100',templet: function (row){ return timeFormatter(row.renzhengTime);}}, { field: "reportStatus", title: "证书/报告状态 \n(有效/撤销/其他)", align: "center", width: '130' }, { field: "youxiaoqi", title: "有效期", align: "center", width: '100'}, { field: "jigouName", title: "发证机构", align: "center", width: '123' }, ], ], }); }, error: (err) => { // console.log("失败了", err); layer.msg("失败", { icon: 2, }); }, complete: (xml) => { const contentLength = xml.responseJSON.content.length; let status = ""; if (contentLength == 0) { status = 1; } else { status = 0; } const rzForm = { reportNo, huozhengzuzi, status, }; }, }); var html = `