var url = null; var recordList = null; //申请记录 var data = { "interfaceId": "5702", "outId": "10702", "reqDateTime": new Date(), "tokenAuth": "", "data": { "userName": "", } }; function init() { var user = JSON.parse(localStorage.getItem('user')); url = user.url + "/api-phone/v35/gateway"; data.tokenAuth = user.tokenAuth; data.data.userName = user.username; console.log(JSON.stringify(data.data),"work-record") getRecordList(); } //获取申请记录列表 function getRecordList() { 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") { recordList = result.data; // console.log(JSON.stringify(recordList)) renderRecordList(); } else { renderRecordList(); mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); } }, error: function() { renderRecordList(); mui.alert('系统繁忙,请重新登录尝试!', '提示', ["确定"], function() {}, "div"); } }) recordList = [{ "id": "59", "deptName": "1号仓", "status": "10", "applyUserName": "郝军", "type": "exercitation reprehenderit sint", "startTime": "1974-07-05 21:56", "endTime": "2013-08-19 05:43", "info": "sed adipisicing quis irure", "depotId": "90", "depotName": "即传状新五际" }, { "id": "39", "deptName": "1号仓", "status": "20", "applyUserName": "袁强", "type": "sed et sit irure eu", "startTime": "2015-10-25 12:30", "endTime": "1971-04-18 19:34", "info": "reprehenderit qui quis pariatur anim", "depotId": "89", "depotName": "当入物还算" }, { "id": "55", "deptName": "3号仓", "status": "20", "applyUserName": "宋丽", "type": "in", "startTime": "1994-10-12 18:25", "endTime": "2008-01-19 00:26", "info": "ex ullamco id dolor", "depotId": "42", "depotName": "新常技位中" }, { "id": "50", "deptName": "2号仓", "status": "10", "applyUserName": "黄超", "type": "nostrud elit", "startTime": "2018-07-07 10:25", "endTime": "2000-11-07 10:02", "info": "et minim", "depotId": "53", "depotName": "人离它军题" } ] } function renderRecordList() { var html = ''; if (recordList && recordList.length > 0) { $.each(recordList, function(index, item) { html += '
有效开始时间: ' + item.startTime + '
有效结束时间: ' + item.endTime + '