searchMaterialsStorage.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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. <title></title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  9. <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  10. <link rel="stylesheet" type="text/css" href="../../css/table.css" />
  11. <link rel="stylesheet" href="../../css/projeck.css">
  12. <style>
  13. html,
  14. body {
  15. /*background: #FAFAFA;*/
  16. background: #FAFAFA;
  17. max-height: 100%
  18. }
  19. .api_seach_material_box {
  20. height: 62.5px;
  21. width: 100%;
  22. position: fixed;
  23. top: 0;
  24. left: 0;
  25. z-index: 1000;
  26. background: #009FE8;
  27. }
  28. /*物资搜索输入框*/
  29. .api_seach_material {
  30. height: 34px;
  31. display: flex;
  32. justify-content: center;
  33. align-items: center;
  34. background: rgba(255, 255, 255, 1);
  35. border-radius: 34px;
  36. margin: 14px 12px;
  37. }
  38. .api_seach_material div {
  39. font-size: 16px;
  40. font-weight: 400;
  41. color: rgba(146, 146, 146, 1);
  42. padding-left: 5px;
  43. }
  44. .api_seach_material img {
  45. display: inline-block;
  46. width: 16px;
  47. height: 16px;
  48. }
  49. .get_materials_storage_list_table {}
  50. .el-pagination {
  51. margin-top: 10px;
  52. float: right;
  53. }
  54. .header-container {
  55. width: 100%;
  56. margin-top: 62.5px
  57. /*position: fixed;
  58. top: 62.5px;
  59. left: 0;*/
  60. }
  61. .header-container ul {
  62. width: 820px;
  63. height: 60px;
  64. display: flex;
  65. align-items: center;
  66. overflow-x: scroll;
  67. text-align: center;
  68. background: rgba(243, 246, 250, 1);
  69. }
  70. #tableList {
  71. width: 820px;
  72. text-align: center;
  73. }
  74. #tableList ul li {
  75. height: 60px;
  76. /*padding: 10px 0;*/
  77. display: flex;
  78. align-items: center;
  79. text-align: center;
  80. justify-content: space-around;
  81. border-bottom: solid 1px #E0E1E2;
  82. }
  83. .encode_width,
  84. .name_width,
  85. .storage_width {
  86. width: 100px
  87. }
  88. .specs_width {
  89. width: 200px;
  90. }
  91. .depiction_width {
  92. width: 200px;
  93. }
  94. .depiction_width_item,
  95. .specs_width_item {
  96. width: 200px;
  97. }
  98. .depiction_width_item div {
  99. width: 100%;
  100. word-break: break-all;
  101. text-overflow: ellipsis;
  102. display: -webkit-box;
  103. /** 对象作为伸缩盒子模型显示 **/
  104. -webkit-box-orient: vertical;
  105. /** 设置或检索伸缩盒对象的子元素的排列方式 **/
  106. -webkit-line-clamp: 2;
  107. /** 显示的行数 **/
  108. overflow: hidden;
  109. /** 隐藏超出的内容 **/
  110. }
  111. .num_width {
  112. width: 70px;
  113. }
  114. .unit_width {
  115. width: 50px;
  116. }
  117. </style>
  118. </head>
  119. <body>
  120. <div id="app">
  121. <div class="list_container">
  122. <div style="padding-bottom:10px;" class="api_seach_material_box">
  123. <div class="api_seach_material" id="api_seach_material" onclick="openDiffSearchType()">
  124. <img src="../../image/search.png" alt="">
  125. <div>搜索</div>
  126. </div>
  127. </div>
  128. <div class="header-container">
  129. <ul>
  130. <li class="encode_width">物资编码</li>
  131. <li class="name_width">物资名称</li>
  132. <li class="specs_width">规则型号</li>
  133. <li class="depiction_width">物资描述</li>
  134. <li class="num_width">数量</li>
  135. <li class="unit_width">单位</li>
  136. <li class="storage_width">所在位置</li>
  137. </ul>
  138. </div>
  139. <div id="tableList"></div>
  140. <div class="noText" v-show="marterialLength == 0">
  141. <img src="../../image/noText.png" alt="">
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </body>
  147. <script src="../../script/config.js" charset="utf-8"></script>
  148. <script type="text/javascript" src="../../script/api.js"></script>
  149. <script src="../../script/doT.min.js" charset="utf-8"></script>
  150. <script src="../../script/fastclick.min.js" charset="utf-8"></script>
  151. <script type="text/template" id="templateMaterial">
  152. {{~it:value}}
  153. <ul style="display: flex">
  154. <li class="encode_width">
  155. <div>
  156. {{=value.encode}}
  157. </div>
  158. </li>
  159. {{?value.name}}
  160. <li class="name_width">
  161. <div>{{=value.name}}</div>
  162. </li>
  163. {{??}}
  164. <li class="name_width">
  165. <div>暂无数据</div>
  166. </li>
  167. {{?}} {{?value.specs}}
  168. <li class="specs_width_item">
  169. <div>
  170. {{=value.specs}}
  171. </div>
  172. </li>
  173. {{??}}
  174. <li class="specs_width_item">
  175. <div>
  176. 暂无数据
  177. </div>
  178. </li>
  179. {{?}}
  180. <li class="depiction_width_item">
  181. <div>
  182. {{=value.depiction}}
  183. </div>
  184. </li>
  185. <li class="num_width">
  186. <div>
  187. {{=value.num}}
  188. </div>
  189. </li>
  190. <li class="unit_width">
  191. <div>
  192. {{=value.unit}}
  193. </div>
  194. </li>
  195. <li class="storage_width">
  196. <div>
  197. {{=value.storage}}
  198. </div>
  199. </li>
  200. </ul>
  201. {{~}}
  202. </script>
  203. <script>
  204. var materialNameStorage = '',
  205. materialSpecsStorage = '',
  206. materialPositionStorage = '',
  207. page = 1;
  208. apiready = function() {
  209. materialNameStorage = api.pageParam.materialName;
  210. materialSpecsStorage = api.pageParam.materialSpecs;
  211. materialPositionStorage = api.pageParam.materialPosition;
  212. getMaterialList();
  213. api.addEventListener({
  214. name: 'scrolltobottom',
  215. extra: {
  216. threshold: 0
  217. }
  218. }, function(ret, err) {
  219. // ajax 在已经加载列表的基础上,请求加载下一页页面
  220. getMaterialList(page+=1);
  221. });
  222. }
  223. function getMaterialList(page) {
  224. api.showProgress({
  225. title: '加载中',
  226. // text: '先喝杯茶...',
  227. modal: true
  228. });
  229. $http.fnReuestDataNologing(UrlRouter.getMaterial, '', 'get', {
  230. depiction: '',
  231. storage: materialPositionStorage,
  232. classify: '',
  233. encode: '',
  234. name: materialNameStorage,
  235. specs: materialSpecsStorage,
  236. page: page
  237. }, function(ret, err) {
  238. if (ret.code === 0) {
  239. api.hideProgress();
  240. $apis.html(tableList, '#templateMaterial', ret.data.data);
  241. if (ret.data.data.length) {
  242. $api.addCls($api.dom('.noText'), 'hide');
  243. } else {
  244. $api.removeCls($api.dom('.noText'), 'hide');
  245. }
  246. }
  247. });
  248. }
  249. function openDiffSearchType() {
  250. $event.openTabLayout('diffSearchType'+ Math.random(), '../material/diffSearchType', '物资查询', '')
  251. }
  252. </script>
  253. </html>