scanCodeCheck.vue 4.5 KB

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