wordOrderGrid.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <meta name="format-detection" content="telephone=no">
  8. <title>审批列表</title>
  9. <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  10. <link rel="stylesheet" href="../../css/aui.css">
  11. <link rel="stylesheet" href="../../css/projeck.css">
  12. <style media="screen">
  13. * {
  14. box-sizing: border-box;
  15. }
  16. html,
  17. body {
  18. height: 100%;
  19. width: 100%;
  20. }
  21. .max-container {
  22. width: 100vw;
  23. height: 100vh;
  24. display: flex;
  25. justify-content: space-between;
  26. }
  27. .left-container {
  28. width: 30vw;
  29. height: 100%;
  30. background: rgba(236, 240, 241, 0.8);
  31. }
  32. .right-container {
  33. width: 70vw;
  34. height: 100%;
  35. display: flex;
  36. flex-wrap: wrap;
  37. /*加这个属性是为了解决 flex-wrap 子标签会有很大的空隙行问题*/
  38. align-content:flex-start;
  39. overflow-y: scroll;
  40. }
  41. .department-item {
  42. height: 50px;
  43. }
  44. .department-item:hover {
  45. border-left: solid 3px #3498DB;
  46. background: #fff;
  47. }
  48. .department-item-child {
  49. margin: 0 10px;
  50. border-bottom: solid 1px #BDC3C7;
  51. color: #7F8C8D;
  52. text-align: center;
  53. line-height: 50px
  54. }
  55. .department-item-child:hover {
  56. color: #3498DB;
  57. border-bottom: none;
  58. }
  59. .grid-item-child {
  60. width: 25%;
  61. height: 100px;
  62. padding-top: 5px;
  63. }
  64. .grid-items {
  65. text-align: center;
  66. font-size: 16px;
  67. }
  68. .grid-items img {
  69. width: 40px;
  70. height: 40px;
  71. border-radius: 50%;
  72. margin: 0 auto;
  73. }
  74. .grid-items p {
  75. height: 42px;
  76. overflow: hidden;
  77. text-overflow: ellipsis;
  78. display: -webkit-box;
  79. -webkit-line-clamp: 2;
  80. -webkit-box-orient: vertical;
  81. padding: 0 5px;
  82. margin-top: 10px;
  83. }
  84. </style>
  85. </head>
  86. <body>
  87. <div class="max-container">
  88. <div class="left-container" id="listItem">
  89. </div>
  90. <div class="right-container" id="seeApply">
  91. </div>
  92. <div class="noText hide">
  93. <img src="../../image/noText.png" alt="">
  94. </div>
  95. </div>
  96. </body>
  97. </html>
  98. <!-- 左侧部门名称-->
  99. <script type="text/template" id="departItem">
  100. {{~it:value}}
  101. <div class="department-item">
  102. <div class="department-item-child" onclick="openItem('{{=value.id}}')">
  103. <span>{{=value.title}}</span>
  104. </div>
  105. </div>
  106. {{~}}
  107. </script>
  108. <!-- 右侧每个部门的工单项目 -->
  109. <script type="text/template" id="templateApply">
  110. {{~it:value}} {{?value.id !=5 && value.id !=6}}
  111. <div class="grid-item-child" onclick="openChangeFill('{{=value.id}}','{{=value.title}}')">
  112. <div class="grid-items">
  113. <img src="{{=value.icon}}">
  114. <p>{{=value.title}}</p>
  115. </div>
  116. </div>
  117. {{?}} {{~}}
  118. </script>
  119. <script type="text/javascript" src="../../script/api.js"></script>
  120. <script type="text/javascript" src="../../script/doT.min.js"></script>
  121. <script type="text/javascript" src="../../script/zepto.js"></script>
  122. <script src="../../script/config.js" charset="utf-8"></script>
  123. <script type="text/javascript">
  124. var toast = new auiToast(),
  125. token, tokens, firstId
  126. apiready = function() {
  127. var info = $api.getStorage('data'),
  128. token = JSON.parse(info).data.access_token;
  129. tokens = token
  130. // openOrderList(token),
  131. departmentList(token)
  132. };
  133. // 可申请工单列表
  134. function openOrderList(token) {
  135. var headers = {
  136. "Authorization": "Bearer " + token
  137. };
  138. $http.fnReuestData(UrlRouter.getAll_list, headers, 'get', '', function(ret, err) {
  139. toast.hide()
  140. if (ret && ret.code == 0) {
  141. if (ret.data.length > 0) {
  142. $apis.html(seeApply, '#templateApply', ret.data);
  143. $api.addCls($api.dom('.noText'), 'hide')
  144. } else {
  145. $apis.html(seeApply, '#templateApply', ret.data);
  146. $api.removeCls($api.dom('.noText'), 'hide');
  147. }
  148. } else {
  149. api.toast({
  150. msg: '暂无数据',
  151. duration: 2000,
  152. location: 'bottom'
  153. });
  154. }
  155. })
  156. }
  157. // 获取部门列表
  158. function departmentList(token) {
  159. var headers = {
  160. "Authorization": "Bearer " + token
  161. }
  162. $http.fnReuestDataNologing(UrlRouter.wordOrderList, headers, 'get', '', function(ret, err) {
  163. if (ret && ret.code == 0) {
  164. if (ret.data.length > 0) {
  165. firstId = ret.data[0].id;
  166. openItem(firstId);
  167. $apis.html(listItem, '#departItem', ret.data);
  168. // $api.css($api.dom('.department-item'), 'background: #fff');
  169. } else {
  170. api.toast({
  171. msg: '加载超时,请检查网络',
  172. duration: 2000,
  173. location: 'bottom'
  174. });
  175. }
  176. }
  177. })
  178. }
  179. //applyList
  180. function openItem(id) {
  181. var headers = {
  182. "Authorization": "Bearer " + tokens,
  183. }
  184. let idObj = {
  185. id: id
  186. }
  187. $http.fnReuestDataNologing(UrlRouter.applyList, headers, 'post', idObj, function(ret, err) {
  188. if (ret && ret.code == 0) {
  189. if (ret.data.length > 0) {
  190. $apis.html(seeApply, '#templateApply', ret.data);
  191. } else {
  192. api.toast({
  193. msg: '暂无数据',
  194. duration: 2000,
  195. location: 'bottom'
  196. });
  197. }
  198. }
  199. })
  200. }
  201. // 填写工单
  202. function openChangeFill(ids, title) {
  203. var pageParam = {
  204. id: ids,
  205. title: title
  206. }
  207. $event.openWin('changeFill_win', 'changefillword_win', pageParam, '')
  208. }
  209. </script>