materialsList.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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" href="../../css/projeck.css">
  11. <style>
  12. body{
  13. background: #FAFAFA;
  14. }
  15. /*物资*/
  16. /*物资搜索输入框*/
  17. .api_seach_material{
  18. display: flex;
  19. padding: 0 15px;
  20. box-sizing: border-box;
  21. background: #f1f5f7;
  22. width: 90%;
  23. margin: auto;
  24. margin-top: 10px;
  25. justify-content: space-between;
  26. /*border-bottom: 1px solid #ebebeb;*/
  27. }
  28. .api_seach_material_box{
  29. height: auto;
  30. width: 100%;
  31. position: fixed;
  32. top: 0;
  33. left: 0;
  34. z-index: 1000;
  35. background: #fff;
  36. }
  37. .api_seach_material input{
  38. box-sizing: border-box;
  39. height: 44px;
  40. padding-left: 15px;
  41. border: none;
  42. outline: none;
  43. padding-right: 40px;
  44. -webkit-tap-highlight-color:rgba(0,0,0,0);
  45. -webkit-tap-highlight-color: transparent;
  46. }
  47. .right_api_seach {
  48. display: flex;
  49. align-items: center;
  50. width: 100px;
  51. color: #262626;
  52. }
  53. .api_seach_btn {
  54. padding-left: 15px;
  55. }
  56. .icon-close {
  57. width: 20px;
  58. height: 20px;
  59. line-height: 20px;
  60. border-radius: 20px;
  61. display: none;
  62. text-align: center;
  63. background-color: rgba(0, 0, 0, 0.1);
  64. }
  65. /*.right_api_seach {
  66. display: flex;
  67. justify-content: space-around;
  68. align-items: center;
  69. width: 120px;
  70. color: #262626;
  71. }
  72. .api_seach_btn {
  73. padding-left: 15px;
  74. }*/
  75. /* 物资列表主体页面*/
  76. .get_materials_list {
  77. margin-top: 70px;
  78. font-size: 14px;
  79. color: #000;
  80. }
  81. .template_material_box {
  82. padding: 10px;
  83. margin: 10px;
  84. display: flex;
  85. flex-flow: column;
  86. border: solid 1px #ebeef3;
  87. }
  88. /*物资描述 (容器头部)*/
  89. .material_depiction_header {
  90. }
  91. /*仓库名称(容器中间)*/
  92. .material_center {
  93. display: flex;
  94. }
  95. .material_s_num,.material_s_price {
  96. padding-left: 10px;
  97. }
  98. .material_s_num {
  99. color: #fa8c16
  100. }
  101. .material_storage {
  102. color: #009fe8
  103. }
  104. /**/
  105. /*单价 数量 分类等 */
  106. .material_depiction_footer {
  107. display: flex;
  108. font-size: 12px;
  109. color: #909399
  110. }
  111. .material_footer_item {
  112. padding-left: 10px;
  113. }
  114. </style>
  115. </head>
  116. <body>
  117. <!-- 顶部搜索框 -->
  118. <div style="padding-bottom:10px;"class="api_seach_material_box relative after-borders">
  119. <div class="api_seach_material" id="api_seach_material">
  120. <input type="text" name="" value="" placeholder="请输入物资的名称或编号" autofocus="autofocus" class="info" id="info_input">
  121. <div class="right_api_seach" onclick="getDepiction()">
  122. <div class="icon-close" onclick="closeSearch()">
  123. <i class="aui-iconfont aui-icon-close"></i>
  124. </div>
  125. <div class="api_seach_meterial_line">
  126. |
  127. </div>
  128. <div class="api_seach_btn">
  129. 搜索
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="get_materials_list" id='materials_list'>
  135. </div>
  136. <div class="noText hide">
  137. <img src="../../image/noText.png" alt="">
  138. </div>
  139. </body>
  140. </html>
  141. <!-- 物资列表页面 -->
  142. <script type="text/template" id="templateMaterial">
  143. {{~it:value}}
  144. <div class="template_material_box">
  145. <div class="material_depiction_header material_item">
  146. {{=value.depiction}}
  147. </div>
  148. <div class="material_center material_item">
  149. <div class="material_storage">{{=value.storage}}</div>
  150. <!-- <div class="material_s_price">¥{{=value.s_price}}</div> -->
  151. <div class="material_s_num">{{=value.s_num}}{{=value.unit}}</div>
  152. </div>
  153. <div class="material_depiction_footer material_item">
  154. <div class="material_c_name">{{=value.c_name}}</div>
  155. <div class="material_encode material_footer_item">{{=value.encode}}</div>
  156. </div>
  157. </div>
  158. {{~}}
  159. </script>
  160. <script type="text/javascript" src="../../script/api.js"></script>
  161. <script src="../../script/doT.min.js" charset="utf-8"></script>
  162. <script src="../../script/config.js" charset="utf-8"></script>
  163. <script src="../../script/zepto.js" charset="utf-8">
  164. </script>
  165. <script type="text/javascript">
  166. </script>
  167. <script>
  168. let toast = new auiToast();
  169. let storage,classify
  170. apiready = function () {
  171. storage = api.pageParam.storage || '';
  172. classify = api.pageParam.classify || '';
  173. depiction = api.pageParam.material_name || '';
  174. getMaterialList(depiction,storage,classify);
  175. $api.val($api.byId('info_input'), depiction);
  176. // $('#info_input').keyup(function() {
  177. // $api.css($api.dom('.icon-close'), 'display: block');
  178. // })
  179. }
  180. function getMaterialList(depiction,storage,classify) {
  181. $http.fnReuestDataNologing(UrlRouter.getMaterial, '', 'get', {depiction: depiction,storage: storage,classify: classify}, function(ret,err) {
  182. if (ret.code === 0) {
  183. // console.log(JSON.stringify(ret.data.data));
  184. $apis.html(materials_list,'#templateMaterial',ret.data.data);
  185. if(ret.data.data.length) {
  186. $api.addCls($api.dom('.noText'), 'hide');
  187. } else {
  188. $api.removeCls($api.dom('.noText'), 'hide');
  189. }
  190. }
  191. });
  192. }
  193. function getDepiction() {
  194. let searchDepiction = $api.val($api.byId('info_input'));
  195. if(searchDepiction) {
  196. getMaterialList(searchDepiction,storage,'')
  197. } else {
  198. getMaterialList(searchDepiction,storage,classify)
  199. }
  200. }
  201. // function closeSearch() {
  202. // $api.css($api.dom('.icon-close'), 'display: none');
  203. // $api.val($api.byId('info_input'), '');
  204. // }
  205. </script>