seleteGas.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. console.log(item)
  75. this.$set(this.form,'gasName',item.gasName);
  76. this.$set(this.form,'gasComposition',item.gasComposition);
  77. this.$set(this.form,'level',item.level);
  78. this.$set(this.form,'levelName',item.levelName);
  79. this.$set(this.form,'size',item.size);
  80. this.$set(this.form,'sizeName',item.sizeName);
  81. this.$set(this.form,'levelSizeName',item.levelName+item.sizeName);
  82. uni.redirectTo({
  83. url:'/pages/gasBottle/stockList/storageAdd?form='+encodeURIComponent(JSON.stringify(this.form))
  84. });
  85. },
  86. //实验室搜索
  87. searchBtn(){
  88. this.dataList=[];
  89. this.getList();
  90. },
  91. //清除
  92. clearBtn(){
  93. this.getData.pageNum=1;
  94. this.getData.searchValue='';
  95. this.dataList=[];
  96. this.getList();
  97. },
  98. handleClick(doType){
  99. let self=this;
  100. if( doType=='subBtn'){//保存数据
  101. }
  102. },
  103. async getList(){
  104. let _this = this;
  105. const {data} = await airbottleBottleTypeList(_this.getData);
  106. if(data.code==200){
  107. for(let i=0;i<data.data.records.length;i++){
  108. for(let b=0;b<this.gasBottleSpecification.length;b++){
  109. if(this.gasBottleSpecification[b].dictValue==data.data.records[i].size){
  110. data.data.records[i].sizeName=this.gasBottleSpecification[b].dictLabel
  111. }
  112. }
  113. for(let t=0;t<this.gasBottleLevel.length;t++){
  114. if(this.gasBottleLevel[t].dictValue==data.data.records[i].level){
  115. data.data.records[i].levelName=this.gasBottleLevel[t].dictLabel
  116. }
  117. }
  118. }
  119. console.log(data.data.records)
  120. this.dataList=[...this.dataList,...data.data.records]
  121. _this.total=data.data.total;
  122. }
  123. }
  124. }
  125. }
  126. </script>
  127. <style lang="stylus" scoped>
  128. .examine{
  129. height:100%;
  130. display flex;
  131. .info-max-box{
  132. flex: 1;
  133. overflow: scroll;
  134. padding: 120rpx 0rpx 30rpx;
  135. box-sizing: border-box;
  136. }
  137. .lab_title{
  138. width: 750rpx;
  139. height: 100rpx;
  140. background: #FFFFFF;
  141. position: fixed;
  142. top: 0;
  143. padding: 10rpx 30rpx;
  144. box-sizing: border-box;
  145. .lab_title_r{
  146. width: 690rpx;
  147. height: 80rpx;
  148. position:relative;
  149. border-radius: 10rpx;
  150. border: 1rpx solid #E0E0E0;
  151. .lab_title_r_btn{
  152. width: 60rpx;
  153. height: 80rpx
  154. position: absolute;
  155. top: 0rpx;
  156. left:0rpx;
  157. >img{
  158. width: 20rpx;
  159. height: 20rpx;
  160. position: absolute;
  161. top: 30rpx;
  162. left: 24rpx;
  163. }
  164. }
  165. >input{
  166. width: 274rpx;
  167. height: 80rpx;
  168. position: absolute;
  169. top: 0rpx;
  170. left: 60rpx;
  171. }
  172. .clear{
  173. width: 60rpx;
  174. height: 80rpx
  175. position: absolute;
  176. top: 0rpx;
  177. right:20rpx;
  178. font-size: 30rpx;
  179. font-family: PingFang SC-Medium, PingFang SC;
  180. font-weight: 400;
  181. color: #0183FA;
  182. line-height: 80rpx;
  183. }
  184. }
  185. }
  186. .list{
  187. background: #FFFFFF;
  188. border-radius: 20rpx 20rpx 0rpx 0rpx;
  189. padding: 0 30rpx;
  190. box-sizing: border-box;
  191. margin: 0 30rpx;
  192. .list_li{
  193. display: flex;
  194. justify-content:space-between;
  195. align-items: center;
  196. height: 80rpx;
  197. border-bottom: 1rpx solid #E0E0E0;
  198. >text{
  199. font-size: 28rpx;
  200. font-family: PingFang SC-Medium, PingFang SC;
  201. font-weight: 400;
  202. line-height: 80rpx;
  203. overflow: hidden;
  204. text-overflow:ellipsis;
  205. white-space: nowrap;
  206. }
  207. >img{
  208. width: 24rpx;
  209. height: 16rpx;
  210. margin-right: 14rpx;
  211. }
  212. }
  213. .list_li:last-child{
  214. border: none;
  215. }
  216. .color_A{
  217. color: #333333;
  218. }
  219. .color_B{
  220. color: #0183FA;
  221. }
  222. }
  223. }
  224. </style>