persnoalLocation.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <!DOCTYPE html>
  2. <html lang="en">
  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 http-equiv="X-UA-Compatible" content="ie=edge">
  8. <link rel="stylesheet" href="../../css/api.css">
  9. <!--<link rel="stylesheet" href="../../css/aui.css">-->
  10. <link rel="stylesheet" href="../../css/projeck.css">
  11. <title></title>
  12. <style>
  13. .aui-searchbar{
  14. width: 86%;
  15. height: 50px;
  16. margin-left: 40px;
  17. background-color: transparent;
  18. }
  19. .aui-searchbar .aui-searchbar-btn{
  20. color: #fff;
  21. }
  22. #search-input::placeholder{
  23. color: #fff;
  24. }
  25. .search_ico{
  26. width: 16px;
  27. height: 16px;
  28. display: block;
  29. position: absolute;
  30. background: url("../../image/seacrh001.png") no-repeat;
  31. background-size: cover;
  32. top: 7px;
  33. left: 17px;
  34. }
  35. .backBtn{
  36. margin-left: 5px;
  37. }
  38. .aui-searchbar-btn{
  39. font-size: 14px!important;
  40. }
  41. #search-input{
  42. font-size: 14px;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div class="api_layout">
  48. <header class="header-login">
  49. <img class="backBtn" src="../../image/btn_back.png" alt="" onclick="backIndex()">
  50. <div class="aui-searchbar" id="search">
  51. <div class="aui-searchbar-input aui-border-radius">
  52. <i class="search_ico"></i>
  53. <form>
  54. <input type="text" id="search-input" disabled>
  55. </form>
  56. </div>
  57. </div>
  58. </header>
  59. </div>
  60. <script src="../../script/api.js"></script>
  61. <!-- <script src="../../script/fastclick.min.js"></script> -->
  62. <script src="../../script/config.js"></script>
  63. <script>
  64. var UIInputId;
  65. apiready = function(){
  66. $api.fixStatusBar( $api.dom('header'));
  67. openFrameFun();
  68. fnInitUIInput();
  69. openSeachList();
  70. };
  71. function openFrameFun() {
  72. api.openFrame({
  73. name: 'personnelList',
  74. url: 'personnelList.html',
  75. rect: {
  76. x: 0,
  77. y: $api.dom('header').offsetHeight,
  78. w: 'auto',
  79. h: 'auto'
  80. },
  81. bounces: false,
  82. bgColor: 'rgba(0,0,0,0)',
  83. vScrollBarEnabled: true,
  84. hScrollBarEnabled: false,
  85. scrollEnabled:false,
  86. progress:{
  87. type:'page'
  88. },
  89. });
  90. };
  91. function backIndex() {
  92. api.closeWin();
  93. }
  94. // input
  95. function fnInitUIInput() {
  96. var searchText = $api.byId('search-input');
  97. var rect = $api.offset(searchText);
  98. var UIInput = api.require('UIInput');
  99. UIInput.open({
  100. rect: {
  101. x: rect.l,
  102. y: rect.t+1,
  103. w: rect.w,
  104. h: rect.h-1
  105. },
  106. styles: {
  107. bgColor: 'rgba(255, 255, 255, 0)',
  108. size: 14,
  109. color: '#fff',
  110. placeholder: {
  111. color: '#fff'
  112. }
  113. },
  114. autoFocus: false,
  115. maxRows: 1,
  116. placeholder: '搜索井下人员',
  117. keyboardType: 'search',
  118. fixedOn: api.frameName
  119. }, function(ret, err) {
  120. if (ret) {
  121. var uiInputId = ret.id;
  122. if (ret.eventType == "search") {
  123. UIInput.value({
  124. id: uiInputId
  125. }, function(ret, err) {
  126. if (ret) {
  127. if (ret.status) {
  128. if (ret.msg == "") {
  129. var UIListSearch = api.require('UIListSearch');
  130. UIListSearch.hide();
  131. }else {
  132. selectPersonal(ret.msg);
  133. // functionName()
  134. }
  135. }
  136. }
  137. });
  138. }
  139. }
  140. });
  141. }
  142. // 查询
  143. function openSeachList(){
  144. var UIListSearch = api.require('UIListSearch');
  145. UIListSearch.open({
  146. rect: {
  147. x: 0,
  148. y: $api.dom('header').offsetHeight,
  149. w: api.winWidth,
  150. h: api.winHeigh
  151. },
  152. contacts:[],
  153. fixedOn: api.frameName
  154. }, function(ret, err) {
  155. if (ret) {
  156. UIListSearch.hide();
  157. var UIInput = api.require('UIInput');
  158. UIInput.closeKeyboard({
  159. id:UIInputId
  160. });
  161. openDetails(ret.contact.staff_num,ret.contact.remark,ret.contact.dept_name);
  162. }
  163. });
  164. UIListSearch.hide();
  165. };
  166. // 查询
  167. function selectPersonal(names) {
  168. $http.fnReuestDataNologing(jinfengUrlRouter.searchPeople,'','post',{name:names},function (ret,err) {
  169. if (ret.code === 0) {
  170. functionName(JSON.stringify(ret.data))
  171. }
  172. })
  173. }
  174. // 数据更新
  175. function functionName(arr) {
  176. var UIListSearch = api.require('UIListSearch');
  177. UIListSearch.show();
  178. UIListSearch.reloadData({
  179. contacts:JSON.parse(arr)
  180. });
  181. }
  182. // 个人下井记录
  183. function openDetails(staff_num,username,depart_name) {
  184. $event.openTabLayout('logging', 'logging', '', {staff_num,username,depart_name});
  185. // $event.openPopup('auto','auto','personalInfo',{id: ids})
  186. }
  187. </script>
  188. </body>
  189. </html>