materialsClassify_win.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. /*width: 100%;*/
  41. padding-left: 15px;
  42. border: none;
  43. outline: none;
  44. padding-right: 40px;
  45. -webkit-tap-highlight-color:rgba(0,0,0,0);
  46. -webkit-tap-highlight-color: transparent;
  47. }
  48. .right_api_seach {
  49. display: flex;
  50. align-items: center;
  51. width: 100px;
  52. color: #262626;
  53. }
  54. .api_seach_btn {
  55. padding-left: 15px;
  56. }
  57. /*物资分类样式*/
  58. .get_materials_classify_list {
  59. margin-top: 70px;
  60. }
  61. .materials_classify_container {
  62. box-sizing: border-box;
  63. display: flex;
  64. align-items: center;
  65. padding: 10px;
  66. margin: 10px 0 0 0;
  67. border-top: solid 1px #e8e8e8;
  68. border-bottom: solid 1px #e8e8e8;
  69. background: #fff;
  70. }
  71. /*.materials_classify_title {
  72. padding: 10px 0 0 10px;
  73. color: #1890ff;
  74. background: red;
  75. }*/
  76. .left_classify_id {
  77. display: flex;
  78. flex-flow: column;
  79. justify-content: center;
  80. align-items: center;
  81. width: 50px;
  82. height: 50px;
  83. margin-left: 10px;
  84. border-radius: 50px;
  85. background: #009fe8;
  86. color: #fafafa;
  87. }
  88. .right_classify_title {
  89. margin-left: 50px;
  90. /*color: #009fe8;*/
  91. }
  92. </style>
  93. </head>
  94. <body>
  95. <!-- 顶部搜索框 -->
  96. <div style="padding-bottom:10px;"class="api_seach_material_box relative after-borders">
  97. <div class="api_seach_material" id="api_seach_material">
  98. <input type="text" name="" value="" placeholder="请输入需要查询的物资" autofocus="autofocus" class="info" id="info_input">
  99. <div class="right_api_seach" onclick="getDepiction()">
  100. <div class="api_seach_meterial_line">
  101. |
  102. </div>
  103. <div class="api_seach_btn">
  104. 搜索
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <!-- 分类列表 -->
  110. <div class="get_materials_classify_list" id='materials_classify_list'>
  111. </div>
  112. <div class="noText hide">
  113. <img src="../../image/noText.png" alt="">
  114. </div>
  115. </body>
  116. </html>
  117. <script type="text/javascript" src="../../script/api.js"></script>
  118. <script src="../../script/doT.min.js" charset="utf-8"></script>
  119. <script src="../../script/config.js" charset="utf-8"></script>
  120. <!-- 物资分类 -->
  121. <script type="text/template" id="templateMaterialClassify">
  122. {{~it:value}}
  123. <div class="materials_classify_container" onclick="getMaterialsChidList('{{=value.id}}')">
  124. <div class="left_classify_id">
  125. <div class="classify_number">编号</div>
  126. <div class="classify_id">{{=value.id}}</div>
  127. </div>
  128. <div class="right_classify_title">
  129. {{=value.title}}
  130. </div>
  131. </div>
  132. {{~}}
  133. </script>
  134. <script>
  135. let toast = new auiToast();
  136. let storageValue
  137. apiready = function () {
  138. getMaterialsClassify()
  139. let storage = api.pageParam.id || '';
  140. storageValue = storage
  141. // console.log(JSON.stringify(storageValue));
  142. }
  143. const getMaterialsClassify = () => {
  144. $http.fnReuestData(UrlRouter.getMaterialClassifyList,'','get','',handleMaterClassifyCb)
  145. }
  146. const handleMaterClassifyCb = (ret,err) => {
  147. if (ret.code === 0) {
  148. $apis.html(materials_classify_list,'#templateMaterialClassify',ret.data);
  149. toast.hide()
  150. } else {
  151. toast.hide()
  152. api.toast({
  153. msg: '获取信息失败',
  154. duration: 2000,
  155. location: 'top'
  156. });
  157. }
  158. }
  159. const getDepiction = () => {
  160. const material_name = $api.val($api.byId('info_input'));
  161. let pageParams = {
  162. material_name: material_name,
  163. storage: storageValue
  164. }
  165. $api.val($api.byId('info_input'), '');
  166. $event.openTabLayout('materialsList','materialsList','物资列表',pageParams);
  167. }
  168. const getMaterialsChidList = (id) => {
  169. let pageParams = {
  170. classify: id || '',
  171. storage: storageValue
  172. }
  173. $event.openTabLayout('materialsList'+Math.random(),'materialsList','物资列表',pageParams);
  174. }
  175. </script>