hiddenDangerItemsSearch.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!-- 隐患项搜索 -->
  2. <template>
  3. <view class="hiddenDangerItemsSearch">
  4. <view class="header">
  5. <view class="search">
  6. <view class="search-r">
  7. <img src="@/pages_safetyCheck/images/icon_aqjc_ss.png" @click="searchBtn">
  8. <input type="text" v-model="searchValue" placeholder="模糊搜索检查项" name="search" @confirm='searchBtn'
  9. confirm-type='search' maxlength="50" placeholder-style="color: #333333;font-size:24rpx;">
  10. </view>
  11. <view class="cancel" @click="cancelBtn">取消</view>
  12. </view>
  13. </view>
  14. <view class="list">
  15. <view class="list-li" v-for="(item,index) in dataList" @click="confirm(item)">
  16. {{item.hazardCheckCode}}{{item.hazardCheckName}}
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. config
  24. } from '@/api/request/config.js'
  25. import {
  26. securityCheckOptionList,
  27. } from '@/pages_safetyCheck/api/index.js'
  28. export default {
  29. name: "hiddenDangerItemsSearch",
  30. components: {
  31. },
  32. data() {
  33. return {
  34. baseUrl: config.base_url,
  35. pageType: 1,
  36. checkOptionList: [],
  37. dataList: [],
  38. searchValue: '',
  39. form: {},
  40. }
  41. },
  42. onLoad(option) {
  43. if (option.form) {
  44. this.form = JSON.parse(decodeURIComponent(option.form));
  45. }
  46. },
  47. onShow() {
  48. },
  49. mounted() {
  50. this.treeselect();
  51. },
  52. methods: {
  53. //滚动事件
  54. scrollGet() {},
  55. //实验室搜索
  56. searchBtn() {
  57. this.dataList = [];
  58. this.treeselect();
  59. },
  60. //取消
  61. cancelBtn() {
  62. this.searchValue = '';
  63. this.dataList = [];
  64. this.treeselect();
  65. },
  66. confirm(row) {
  67. this.$set(this.form, "hazardCheckId1", row.hazardCheckId1)
  68. this.$set(this.form, "hazardCheckName1", row.hazardCheckName1)
  69. this.$set(this.form, "hazardCheckCode1", row.hazardCheckCode1)
  70. this.$set(this.form, "hazardCheckId2", row.hazardCheckId2)
  71. this.$set(this.form, "hazardCheckName2", row.hazardCheckName2)
  72. this.$set(this.form, "hazardCheckCode2", row.hazardCheckCode2)
  73. this.$set(this.form, "hazardCheckId", row.hazardCheckId)
  74. this.$set(this.form, "hazardCheckName", row.hazardCheckName)
  75. this.$set(this.form, "hazardCheckCode", row.hazardCheckCode)
  76. this.$set(this.form, "hazardCheckPoint", row.hazardCheckPoint)
  77. uni.redirectTo({
  78. url: '/pages_safetyCheck/views/snapshotManage/snapshotList?form=' + encodeURIComponent(JSON.stringify(this.form))
  79. });
  80. },
  81. async treeselect() {
  82. let self = this;
  83. const {
  84. data
  85. } = await securityCheckOptionList({
  86. searchValue: this.searchValue
  87. });
  88. if (data.code == 200) {
  89. let list = [];
  90. data.data.forEach(function(item) {
  91. item.children.forEach(function(item2) {
  92. item2.children.forEach(function(item3) {
  93. list.push({
  94. hazardCheckId1: item.id,
  95. hazardCheckName1: item.name,
  96. hazardCheckCode1: item.code,
  97. hazardCheckId2: item2.id,
  98. hazardCheckName2: item2.name,
  99. hazardCheckCode2: item2.code,
  100. hazardCheckId: item3.id,
  101. hazardCheckName: item3.name,
  102. hazardCheckCode: item3.code,
  103. hazardCheckPoint: item3.mainPoint
  104. })
  105. })
  106. })
  107. })
  108. this.dataList = list
  109. }
  110. },
  111. }
  112. }
  113. </script>
  114. <style lang="stylus" scoped>
  115. .hiddenDangerItemsSearch {
  116. height: 100%;
  117. display flex;
  118. box-sizing: border-box;
  119. #totalColor-A {
  120. color: #0183FA;
  121. background: rgba(1, 131, 250, 0.2);
  122. }
  123. #totalColor-B {
  124. color: #16B531;
  125. background: rgba(22, 181, 49, 0.2);
  126. }
  127. #totalColor-C {
  128. color: #FF8C00;
  129. background: rgba(255, 140, 0, 0.2);
  130. }
  131. .header {
  132. width: 100%;
  133. position: fixed;
  134. top: 0rpx;
  135. z-index: 100;
  136. background: #fff;
  137. .search {
  138. width: 750rpx;
  139. height: 100rpx;
  140. background: #FFFFFF;
  141. border-radius: 0rpx 0rpx 0rpx 0rpx;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. .search-r {
  146. width: 610rpx;
  147. height: 60rpx;
  148. background: #FFFFFF;
  149. border-radius: 50rpx 50rpx 50rpx 50rpx;
  150. border: 1rpx solid #E0E0E0;
  151. font-size: 24rpx;
  152. color: #999999;
  153. line-height: 60rpx;
  154. text-align: left;
  155. display: flex;
  156. justify-content: flex-start;
  157. align-items: center;
  158. padding: 0 20rpx;
  159. box-sizing: border-box;
  160. >img {
  161. width: 30rpx;
  162. height: 30rpx;
  163. margin-right: 20rpx;
  164. }
  165. >input {
  166. width: 500rpx;
  167. }
  168. }
  169. }
  170. .cancel {
  171. font-size: 28rpx;
  172. color: #0183FA;
  173. line-height: 30rpx;
  174. text-align: left;
  175. margin-left: 18rpx;
  176. }
  177. }
  178. .list {
  179. width: 750rpx;
  180. background: #FFFFFF;
  181. margin-top: 110rpx;
  182. padding-top: 12rpx;
  183. box-sizing: border-box;
  184. .list-li {
  185. min-height: 80rpx;
  186. margin: 0 30rpx;
  187. font-size: 29rpx;
  188. color: #3D3D3D;
  189. line-height: 80rpx;
  190. text-align: left;
  191. border-bottom: 1rpx solid #E0E0E0;
  192. }
  193. }
  194. }
  195. </style>