newScanCodeCheck.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="shade">
  3. <view class="null-box" @click="dialogClose()"></view>
  4. <view class="shade_n">
  5. <view class="title">
  6. <view>请选择实验室222</view>
  7. </view>
  8. <view class="batch">
  9. <view class="batch-li" @click="batchClick(item)" v-for="(item,index) in batchList">
  10. <view class="batch-li-l">
  11. <text>{{item.planTitle}}-{{item.checkName}}</text>
  12. <text>{{item.subName}}{{item.roomNum?'('+item.roomNum+')':''}}</text>
  13. </view>
  14. <view class="batch-li-r">
  15. <img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. securityAppCheckManageList,
  25. securityAppCheckSetOptionList,
  26. securityAppCheckPlanScanCode,
  27. } from '@/pages_safetyCheck/api/index.js'
  28. import {
  29. config
  30. } from '@/api/request/config.js'
  31. export default {
  32. name: "iotControl",
  33. props: {
  34. subjectData: {},
  35. },
  36. data() {
  37. return {
  38. newData:{},
  39. batchList: [],
  40. checkCategory: null,
  41. }
  42. },
  43. created() {
  44. },
  45. mounted() {
  46. this.$set(this, 'batchList', this.subjectData);
  47. // this.securityAppCheckPlanScanCode();
  48. },
  49. methods: {
  50. dialogClose() {
  51. this.$parent.goPage('securityCheck',false);
  52. },
  53. batchClick(row) {
  54. let infoData = row;
  55. infoData.pageType = 0;
  56. uni.navigateTo({
  57. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
  58. JSON.stringify(infoData))
  59. });
  60. },
  61. //查询计划
  62. async securityAppCheckPlanScanCode() {
  63. let self = this;
  64. let obj = {
  65. subId:this.newData.subId,
  66. checkCategory:this.checkCategory,
  67. };
  68. if(this.newData.planSetId){
  69. obj.planSetId = this.newData.planSetId;
  70. }
  71. const {
  72. data
  73. } = await securityAppCheckPlanScanCode(obj);
  74. if (data.code == 200) {
  75. if(data.data[0]){
  76. if(data.data[1]){
  77. //多个
  78. setTimeout(function() {
  79. self.$set(self,'batchList',data.data);
  80. }, 1000);
  81. }else{
  82. //单个
  83. let infoData = data.data[0];
  84. infoData.pageType = 0;
  85. uni.navigateTo({
  86. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
  87. JSON.stringify(infoData))
  88. });
  89. }
  90. }else{
  91. //没有
  92. uni.showToast({
  93. title: '该实验室暂无检查计划!',
  94. icon: "none",
  95. mask: true,
  96. duration: 2000
  97. });
  98. this.dialogClose();
  99. }
  100. }
  101. },
  102. },
  103. onHide() {
  104. },
  105. beforeDestroy() {
  106. },
  107. }
  108. </script>
  109. <style lang="stylus" scoped>
  110. .shade {
  111. height: 100%;
  112. width: 100%;
  113. position: fixed;
  114. display: flex;
  115. flex-direction: column;
  116. z-index: 200;
  117. background: rgba(0, 0, 0, 0.2);
  118. top: 0;
  119. .null-box {
  120. flex: 1;
  121. }
  122. .shade_n {
  123. position: absolute;
  124. bottom: 0;
  125. left: 0;
  126. width: 750rpx;
  127. height: 466rpx;
  128. background: #FFFFFF;
  129. border-radius: 20rpx 20rpx 0rpx 0rpx;
  130. overflow-y: auto;
  131. .title {
  132. display: flex;
  133. justify-content: space-between;
  134. align-items: center;
  135. padding: 0 50rpx 0 284rpx;
  136. box-sizing: border-box;
  137. border-bottom: 1rpx solid #E0E0E0;
  138. >view {
  139. font-size: 30rpx;
  140. color: #3D3D3D;
  141. line-height: 90rpx;
  142. text-align: left;
  143. }
  144. >img {
  145. width: 24rpx;
  146. height: 12rpx;
  147. }
  148. }
  149. .batch {
  150. padding: 0 30rpx;
  151. box-sizing: border-box;
  152. .batch-li {
  153. display: flex;
  154. justify-content: space-between;
  155. align-items: center;
  156. border-bottom: 1rpx solid #E0E0E0;
  157. padding: 20rpx 0 16rpx 0rpx;
  158. box-sizing: border-box;
  159. .batch-li-l {
  160. >text:nth-of-type(1) {
  161. display: block;
  162. font-size: 30rpx;
  163. color: #333333;
  164. line-height: 42rpx;
  165. text-align: left;
  166. }
  167. >text:nth-of-type(2) {
  168. display: block;
  169. font-size: 28rpx;
  170. color: #666666;
  171. line-height: 39rpx;
  172. text-align: left;
  173. margin-top: 6rpx;
  174. }
  175. }
  176. .batch-li-r {
  177. font-size: 28rpx;
  178. color: #666666;
  179. line-height: 39rpx;
  180. text-align: left;
  181. display: flex;
  182. justify-content: flex-start;
  183. align-items: center;
  184. >img {
  185. width: 24rpx;
  186. height: 24rpx;
  187. margin-left: 9rpx;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. }
  194. </style>