var fun = { init: function () { //获取异常类型 fn.getInspectDeviceType(fun.getInspectDeviceType); fn.getInspectDeviceUnusualTypePDA(fun.getInspectDeviceUnusualTypePDA); fn.getInspectDeviceMainTeance(fun.getInspectDeviceMainTeance); fn.getInspectEmployeeOutRule(fun.getInspectEmployeeOutRule); fn.getInspectBerthUnusualType(fun.getInspectBerthUnusualType); fn.getInspectDeviceUnusualTypePrinter(fun.getInspectDeviceUnusualTypePrinter); fn.getInspectDeviceUnusualTypeEQP(fun.getInspectDeviceUnusualTypeEQP); commSelect.plName_select("#insreport-transSelectPark",true,null,null,3); $('#insreport-taskType').selectpicker('refresh'); fun.dateInit(); fun.createTableData(); }, dateInit:function () { /**日 时间初始化*/ $('#daydaterange-btnsta').val(moment().subtract('days', 0).format('YYYY-MM-DD')); $('#daydaterange-btnend').val(moment().subtract('days', 0).format('YYYY-MM-DD')); //开始日期 $("#daydaterange-btnsta").datetimepicker({ endDate: moment().subtract('days', 0).format('YYYY-MM-DD'), format: 'yyyy-mm-dd', autoclose: true, startView: 2, //maxDate:moment().subtract('months', 3), minView: 2, forceParse: false, locale: "zh-CN", language: 'zh-CN', pickerPosition: "bottom-right" }) //结束日期 $("#daydaterange-btnend").datetimepicker({ endDate: moment().subtract('days', 0).format('YYYY-MM-DD'), format: 'yyyy-mm-dd', autoclose: true, startView: 2, //maxDate:moment().subtract('months', 3), minView: 2, forceParse: false, locale: "zh-CN", language: 'zh-CN', pickerPosition: "bottom-right" }) }, //默认生成表格数据 createTableData:function () { $('#insreport-billtable').bootstrapTable('destroy').bootstrapTable({ striped: true,//表格显示条纹 pagination: true, //启动分页 pageNumber: 1, //当前第几页 pageSize: 10, //每页显示的记录数 pageList: [10, 15, 20], //记录数可选列表 sidePagination: 'server',//表示服务端分页 queryParamsType: 'limit', // sortable: true, //是否启用排序 // sortOrder: "asc", method: 'POST',//请求方法 paginationPreText: '<', paginationNextText: '>', ajax: feetableLoadRequest,//自定义ajax加载数据 // uniqueId:'id', columns: [ {field: 'plName', title: '车场名称', width: '15%', align: "left",formatter:commonObj.replacenull}, { field: 'parkAreaName', title: '泊位区间', width: '15%', align: "left", formatter:commonObj.replacenull // sortable: true }, { field: 'inspectType', title: '任务类型', width: '15%', align: "left", formatter: function(value){ if (undefined != value && null != value) { if (value == '1') { return '车位巡查' } else if (value == '2') { return '设备巡查'; }else if (value == '3') { return '人员巡查'; } } else { return '-'; } } }, { field: 'inspectName', title: '巡查员', width: '15%', align: "left", formatter:commonObj.replacenull }, { field: 'unusualType', title: '异常信息', width: '10%', align: "left", formatter:fun.unusualInformationFormatter }, { field: 'createTime', title: '上报时间', width: '15%', align: "left", formatter:commonObj.timeFormatter }, { field: 'poptype', title: '操作', width: '15%', align: "left", formatter:fun.popFormater }, ] }); }, getInspectDeviceType: function (data) { if (null == data) { return; } InspectDeviceTypes = []; $.each(data, function (index, item) { var InspectDeviceType={}; InspectDeviceType.value = item.codeValue; InspectDeviceType.name = item.codeValueName; InspectDeviceTypes.push(InspectDeviceType); }); }, getInspectDeviceUnusualTypePDA: function (data) { if (null == data) { return; } InspectDeviceUnusualTypePDAs = []; $.each(data, function (index, item) { var InspectDeviceUnusualTypePDA={}; InspectDeviceUnusualTypePDA.value = item.codeValue; InspectDeviceUnusualTypePDA.name = item.codeValueName; InspectDeviceUnusualTypePDAs.push(InspectDeviceUnusualTypePDA); }); }, getInspectDeviceMainTeance: function (data) { if (null == data) { return; } InspectDeviceMainTeances = []; $.each(data, function (index, item) { var InspectDeviceMainTeance={}; InspectDeviceMainTeance.value = item.codeValue; InspectDeviceMainTeance.name = item.codeValueName; InspectDeviceMainTeances.push(InspectDeviceMainTeance); }); }, getInspectEmployeeOutRule: function (data) { if (null == data) { return; } InspectEmployeeOutRules = []; $.each(data, function (index, item) { var InspectEmployeeOutRule={}; InspectEmployeeOutRule.value = item.codeValue; InspectEmployeeOutRule.name = item.codeValueName; InspectEmployeeOutRules.push(InspectEmployeeOutRule); }); }, getInspectBerthUnusualType: function (data) { if (null == data) { return; } InspectBerthUnusualTypes = []; $.each(data, function (index, item) { var InspectBerthUnusualType={}; InspectBerthUnusualType.value = item.codeValue; InspectBerthUnusualType.name = item.codeValueName; InspectBerthUnusualTypes.push(InspectBerthUnusualType); }); }, getInspectDeviceUnusualTypePrinter: function (data) { if (null == data) { return; } InspectDeviceUnusualTypePrinters = []; $.each(data, function (index, item) { var InspectDeviceUnusualTypePrinter={}; InspectDeviceUnusualTypePrinter.value = item.codeValue; InspectDeviceUnusualTypePrinter.name = item.codeValueName; InspectDeviceUnusualTypePrinters.push(InspectDeviceUnusualTypePrinter); }); }, getInspectDeviceUnusualTypeEQP: function (data) { if (null == data) { return; } InspectDeviceUnusualTypeEQPs = []; $.each(data, function (index, item) { var InspectDeviceUnusualTypeEQP={}; InspectDeviceUnusualTypeEQP.value = item.codeValue; InspectDeviceUnusualTypeEQP.name = item.codeValueName; InspectDeviceUnusualTypeEQPs.push(InspectDeviceUnusualTypeEQP); }); }, deviceTypeFormatter:function(value){ var deviceType = "无"; if(value == null){ return deviceType; } $.each(InspectDeviceTypes, function(index,item) { if(value == item.value){ deviceType = item.name; } }); return deviceType; }, //异常信息转换 unusualInformationFormatterStr:function(value,row,index){ var unusualInformation = ""; if(row == null){ return unusualInformation } if(row.inspectType == null){ return unusualInformation }else if(row.inspectType == 1){//车位巡查 if(row.unusualType == null){ return unusualInformation } $.each(InspectBerthUnusualTypes,function(index,item){ if(row.unusualType == item.value){ unusualInformation = item.name; } }); return unusualInformation }else if(row.inspectType == 2){//设备巡查 if(row.unusualType == null){ return unusualInformation } if(row.deviceType == null){ return unusualInformation } if(row.deviceType == 1){//设备-PDA $.each(InspectDeviceUnusualTypePDAs,function(index,item){ if(row.unusualType == item.value){ unusualInformation = item.name; } }); } if(row.deviceType == 2){//设备-地磁 $.each(InspectDeviceUnusualTypeEQPs,function(index,item){ if(row.unusualType == item.value){ unusualInformation = item.name; } }); } if(row.deviceType == 3){//设备-打印机 $.each(InspectDeviceUnusualTypePrinters,function(index,item){ if(row.unusualType == item.value){ unusualInformation = item.name; } }); } return unusualInformation }else if(row.inspectType == 3){//人员巡查 if(row.outRuleType == null){ return '