var url = null; var auditList = null; var workAuditData = null; var dateTime; //工单审核列表 var data = { "interfaceId": "5703", "outId": "10703", "reqDateTime": new Date(), "tokenAuth": "", "data": { "deptId": "", } }; //工单审核 var data1 = { "interfaceId": "5704", "outId": "10704", "reqDateTime": new Date(), "tokenAuth": "", "data": { "id": "", "status": "" } }; function init() { var user = JSON.parse(localStorage.getItem('user')); var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId')); url = user.url + "/api/phone/v35/gateway"; data.tokenAuth = user.tokenAuth; data1.tokenAuth = user.tokenAuth; data.data.deptId = selectDeptId; dateTime = getDate(new Date()); getAuditList(); } //日期格式化yyyy-MM-dd function getDate(date) { var year = date.getFullYear(); var month, day,hour,minute; month = date.getMonth() + 1; if (month > 0 && month <= 9) { month = "0" + month; } day = date.getDate() if (day > 0 && day <= 9) { day = "0" + day } hour = date.getHours(); minute = date.getMinutes(); return year + "-" + month + "-" + day + " "+ hour + ":" + minute } //获取工单审核列表 function getAuditList() { console.log(JSON.stringify(data.data),"work-aduit","工单审核列表") mui.ajax(url, { type: "POST", dataType: "json", crossDomain: true, contentType: "application/json;charset=utf-8", data: JSON.stringify(data), success: function(result) { if (result.code == "0000") { auditList = result.data; // console.log(JSON.stringify(auditList)) renderAuditList(); } else { renderAuditList(); mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); } }, error: function() { renderAuditList(); mui.alert('系统繁忙,请重新登录尝试!', '提示', ["确定"], function() {}, "div"); } }) } function renderAuditList() { var html = ''; if (auditList && auditList.length > 0) { $.each(auditList, function(index, item) { html += '