| | |
| | | <script th:src="@{/ajax/libs/mui/js/mui.js}"></script> |
| | | <script th:inline="javascript"> |
| | | var loginType = [[${loginType}]]; //登录方式 |
| | | var deptList = [[${deptList}]]; |
| | | var userName = [[${userName}]]; |
| | | openid = [[${openid}]]; //用户的openid |
| | | SERVE_URL = location.href.split("/wx/")[0]; //服务域名 |
| | |
| | | var total; |
| | | var pageCount; //总页码数 |
| | | var warnList; //每页数据 |
| | | var deptListMap = {}; |
| | | $(function () { |
| | | //所有库区 |
| | | if (deptList) { |
| | | for (var i = 0; i < deptList.length; i++) { |
| | | deptListMap[deptList[i].id] = deptList[i]; |
| | | } |
| | | } |
| | | |
| | | // 监听页面显示事件(微信 H5 环境) |
| | | window.addEventListener('pageshow', function() { |
| | | if (localStorage.getItem('needRefresh') === 'true') { |
| | |
| | | mui('#pullrefresh').pullRefresh().endPullupToRefresh((pageNo>=pageCount)); |
| | | var table = document.body.querySelector('.mui-table-view'); |
| | | for (var i = 0; i < warnList.length; i++) { |
| | | var deptName = deptListMap[warnList[i].deptId] ? deptListMap[warnList[i].deptId].kqmc : warnList[i].deptId; |
| | | console.log(deptListMap); |
| | | var li = document.createElement('li'); |
| | | li.className = 'mui-table-view-cell'; |
| | | var html = ''; |
| | | html += '<div onclick="toWarnDetail(\'' + warnList[i].id +'\',\'' + warnList[i].companyId + '\')" class="mui-table">'; |
| | | html += '<div class="mui-table-cell mui-col-xs-10"><h4 class="mui-ellipsis">' + warnList[i].id; |
| | | html += '</span></h4><h5>所属库区:<span>' + warnList[i].deptId; |
| | | html += '</span></h4><h5>所属库区:<span>' + deptName; |
| | | html += '</span></h5><h5>警告时间:<span>' + warnList[i].createTime; |
| | | html += '</span></h5><p class="mui-h6 mui-ellipsis">警告说明:' +warnList[i].content; |
| | | li.innerHTML = html; |