seleteGas.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <!-- 安全检查-发起巡查计划-选择内容 -->
  2. <template>
  3. <view class="examine">
  4. <view class="lab_title">
  5. <view class="lab_title_r">
  6. <view class="lab_title_r_btn" @click="searchBtn">
  7. <img src="@/pages_safetyExamine/images/icon_aqjc_ss.png"/>
  8. </view>
  9. <input type="text" v-model="getData.searchValue" placeholder="请输入检查内容" maxlength="50" placeholder-style="color: #CCCCCC;font-size:26rpx;">
  10. <view class="clear" @click="clearBtn">清除</view>
  11. </view>
  12. </view>
  13. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  14. <view>
  15. <view class="list">
  16. <view class="list_li" v-for="(item,index) in dataList" :key="index" @click="labSelete(item)">
  17. <text :class="item.type?'color_B':'color_A'">{{item.gasName}}-{{item.levelName}}({{item.sizeName}})</text>
  18. <img v-if="item.type" src="@/pages_safetyExamine/images/icon_xzwt_xz.png">
  19. </view>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. </template>
  25. <script>
  26. import { config } from '@/api/request/config.js'
  27. import {airbottleBottleTypeList,getDicts} from '@/api/index.js'
  28. export default {
  29. name: "rectifyList",
  30. components: {
  31. },
  32. data() {
  33. return {
  34. pageType:0,
  35. //列表请求参数
  36. getData:{
  37. pageNum:1,
  38. pageSize:20,
  39. searchValue:'',
  40. },
  41. total:0,
  42. dataList:[],
  43. seleteListDevice:[],//临时存储选中的
  44. form:{},
  45. gasBottleLevel:uni.getStorageSync('gasBottleLevel'),// 气瓶级别
  46. gasBottleSpecification:uni.getStorageSync('gasBottleSpecification'), // 气瓶规格
  47. }
  48. },
  49. onLoad(option) {
  50. if(option.form){
  51. this.form=JSON.parse(decodeURIComponent(option.form));
  52. }
  53. },
  54. onShow() {
  55. },
  56. mounted(){
  57. this.getList();
  58. },
  59. methods: {
  60. //滚动事件
  61. scrollGet(){
  62. let self=this;
  63. if(self.total/self.getData.pageSize<=self.getData.pageNum){
  64. console.log('没有更多数据!')
  65. }else{
  66. setTimeout(function(){
  67. self.getData.pageNum += 1;
  68. self.getList();
  69. },1000)
  70. }
  71. },
  72. //点击选择实验室
  73. labSelete(item){
  74. this.$set(this.form,'gasName',item.gasName);
  75. this.$set(this.form,'gasComposition',item.gasComposition);
  76. this.$set(this.form,'level',item.level);
  77. this.$set(this.form,'levelName',item.levelName);
  78. this.$set(this.form,'size',item.size);
  79. this.$set(this.form,'sizeName',item.sizeName);
  80. this.$set(this.form,'levelSizeName',item.levelName+item.sizeName);
  81. uni.redirectTo({
  82. url:'/pages/gasBottle/stockList/storageAdd?form='+encodeURIComponent(JSON.stringify(this.form))
  83. });
  84. },
  85. //实验室搜索
  86. searchBtn(){
  87. this.dataList=[];
  88. this.getList();
  89. },
  90. //清除
  91. clearBtn(){
  92. this.getData.pageNum=1;
  93. this.getData.searchValue='';
  94. this.dataList=[];
  95. this.getList();
  96. },
  97. handleClick(doType){
  98. let self=this;
  99. if( doType=='subBtn'){//保存数据
  100. }
  101. },
  102. async getList(){
  103. let _this = this;
  104. const {data} = await airbottleBottleTypeList(_this.getData);
  105. if(data.code==200){
  106. for(let i=0;i<data.data.records.length;i++){
  107. for(let b=0;b<this.gasBottleSpecification.length;b++){
  108. if(this.gasBottleSpecification[b].dictValue==data.data.records[i].size){
  109. data.data.records[i].sizeName=this.gasBottleSpecification[b].dictLabel
  110. }
  111. }
  112. for(let t=0;t<this.gasBottleLevel.length;t++){
  113. if(this.gasBottleLevel[t].dictValue==data.data.records[i].level){
  114. data.data.records[i].levelName=this.gasBottleLevel[t].dictLabel
  115. }
  116. }
  117. }
  118. this.dataList=[...this.dataList,...data.data.records]
  119. _this.total=data.data.total;
  120. }
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="stylus" scoped>
  126. .examine{
  127. height:100%;
  128. display flex;
  129. .info-max-box{
  130. flex: 1;
  131. overflow: scroll;
  132. padding: 120rpx 0rpx 30rpx;
  133. box-sizing: border-box;
  134. }
  135. .lab_title{
  136. width: 750rpx;
  137. height: 100rpx;
  138. background: #FFFFFF;
  139. position: fixed;
  140. top: 0;
  141. padding: 10rpx 30rpx;
  142. box-sizing: border-box;
  143. .lab_title_r{
  144. width: 690rpx;
  145. height: 80rpx;
  146. position:relative;
  147. border-radius: 10rpx;
  148. border: 1rpx solid #E0E0E0;
  149. .lab_title_r_btn{
  150. width: 60rpx;
  151. height: 80rpx
  152. position: absolute;
  153. top: 0rpx;
  154. left:0rpx;
  155. >img{
  156. width: 20rpx;
  157. height: 20rpx;
  158. position: absolute;
  159. top: 30rpx;
  160. left: 24rpx;
  161. }
  162. }
  163. >input{
  164. width: 274rpx;
  165. height: 80rpx;
  166. position: absolute;
  167. top: 0rpx;
  168. left: 60rpx;
  169. }
  170. .clear{
  171. width: 60rpx;
  172. height: 80rpx
  173. position: absolute;
  174. top: 0rpx;
  175. right:20rpx;
  176. font-size: 30rpx;
  177. font-family: PingFang SC-Medium, PingFang SC;
  178. font-weight: 400;
  179. color: #0183FA;
  180. line-height: 80rpx;
  181. }
  182. }
  183. }
  184. .list{
  185. background: #FFFFFF;
  186. border-radius: 20rpx 20rpx 0rpx 0rpx;
  187. padding: 0 30rpx;
  188. box-sizing: border-box;
  189. margin: 0 30rpx;
  190. .list_li{
  191. display: flex;
  192. justify-content:space-between;
  193. align-items: center;
  194. height: 80rpx;
  195. border-bottom: 1rpx solid #E0E0E0;
  196. >text{
  197. font-size: 28rpx;
  198. font-family: PingFang SC-Medium, PingFang SC;
  199. font-weight: 400;
  200. line-height: 80rpx;
  201. overflow: hidden;
  202. text-overflow:ellipsis;
  203. white-space: nowrap;
  204. }
  205. >img{
  206. width: 24rpx;
  207. height: 16rpx;
  208. margin-right: 14rpx;
  209. }
  210. }
  211. .list_li:last-child{
  212. border: none;
  213. }
  214. .color_A{
  215. color: #333333;
  216. }
  217. .color_B{
  218. color: #0183FA;
  219. }
  220. }
  221. }
  222. </style>