safetyCard.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <!-- 安全信息牌 -->
  2. <template>
  3. <view id="safetyCard">
  4. <view class="top-name-max-box">
  5. <view class="name-box back-ff">
  6. <view v-for="(minItem,index1) in subject" :key="index1" v-if="minItem.dictValue === itemData.subDept">{{minItem.dictLabel}}</view>
  7. <view class="color-33">{{itemData.name}}</view>
  8. </view>
  9. <view class="address-box color-99">{{itemData.address}}</view>
  10. </view>
  11. <view class="text-max-box">
  12. <view class="text-min-box">
  13. <view>责任单位:</view>
  14. <view>{{itemData.deptName}}</view>
  15. </view>
  16. <view class="text-min-box">
  17. <view>实验室负责人:</view>
  18. <view>{{itemData.adminName}}</view>
  19. </view>
  20. <view class="text-min-box">
  21. <view>联系方式:</view>
  22. <view>{{itemData.adminPhone}}</view>
  23. </view>
  24. <view class="text-min-box">
  25. <view>安全负责人:</view>
  26. <view>{{itemData.safeUserName?itemData.safeUserName:'无'}}</view>
  27. </view>
  28. <view class="text-min-box">
  29. <view>联系方式:</view>
  30. <view>{{itemData.safeUserPhone?itemData.safeUserPhone:'无'}}</view>
  31. </view>
  32. </view>
  33. <view class="safety-max-box" v-if="itemData.hazardCategory[0]||itemData.riskMeasure[0]||itemData.outfire[0]">
  34. <view class="max-for-box" v-if="itemData.hazardCategory[0]">
  35. <view class="title-box">主要危险类别</view>
  36. <view class="for-box" v-for="(item,index1) in itemData.hazardCategory" :key="index1">
  37. <view v-for="(minItem,index2) in hazardCategory" :key="index2" v-if="minItem.dictValue == item">● {{minItem.dictLabel}}</view>
  38. </view>
  39. </view>
  40. <view class="max-for-box" v-if="itemData.riskMeasure[0]">
  41. <view class="title-box">风控防控措施</view>
  42. <view class="for-box" v-for="(item,index1) in itemData.riskMeasure" :key="index1">
  43. <view v-for="(minItem,index2) in riskMeasure" :key="index2" v-if="minItem.dictValue == item">● {{minItem.dictLabel}}</view>
  44. </view>
  45. </view>
  46. <view class="max-for-box" v-if="itemData.outfire[0]">
  47. <view class="title-box">灭火要点</view>
  48. <view class="for-box" v-for="(item,index1) in itemData.outfire" :key="index1">
  49. <view v-for="(minItem,index2) in extinguishingKeyPoints" :key="index2" v-if="minItem.dictValue == item">● {{minItem.dictLabel}}</view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="img-bottom-box" v-if="itemData.safeSigns[0]||itemData.qrCode">
  54. <view class="title-box">安全警示标识</view>
  55. <view class="for-box" :key="index1">
  56. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_jzxy.png" v-if="item == 'xiyan'" v-for="(item,index) in itemData.safeSigns" :key="index">
  57. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_jzys.png" v-if="item == 'yinshi'" v-for="(item,index) in itemData.safeSigns" :key="index">
  58. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_dxaq.png" v-if="item == 'anquan'" v-for="(item,index) in itemData.safeSigns" :key="index">
  59. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_gzf.png" v-if="item == 'gongzuofu'" v-for="(item,index) in itemData.safeSigns" :key="index">
  60. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_gbmc.png" v-if="item == 'menchuang'" v-for="(item,index) in itemData.safeSigns" :key="index">
  61. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_gbsd.png" v-if="item == 'shuidian'" v-for="(item,index) in itemData.safeSigns" :key="index">
  62. <img v-if="itemData.qrCode" class="code-img" :src="itemData.qrCode">
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import { getDicts } from '@/api/apiDemo/index.js'
  69. export default {
  70. data() {
  71. return {
  72. itemData:{},
  73. text:"",
  74. subject:[],
  75. safetyWarning:[],
  76. hazardCategory:[],
  77. riskMeasure:[],
  78. extinguishingKeyPoints:[]
  79. }
  80. },
  81. onLoad(option) {
  82. this.getSafetyWarning();
  83. this.getHazardCategory();
  84. this.getRiskMeasure();
  85. this.getExtinguishingKeyPoints();
  86. this.itemData = JSON.parse(decodeURIComponent(option.item));
  87. if(this.itemData.safeUserName){
  88. this.itemData.safeUserName = this.itemData.safeUserName.replace(/,/,'、');
  89. }
  90. if(this.itemData.safeUserPhone){
  91. this.itemData.safeUserPhone = this.itemData.safeUserPhone.replace(/,/,'、');
  92. }
  93. if(this.itemData.hazardCategory){
  94. this.itemData.hazardCategory = this.itemData.hazardCategory.split(',')
  95. }
  96. if(this.itemData.riskMeasure){
  97. this.itemData.riskMeasure = this.itemData.riskMeasure.split(',')
  98. }
  99. if(this.itemData.safeSigns){
  100. this.itemData.safeSigns = this.itemData.safeSigns.split(',')
  101. }
  102. if(this.itemData.outfire){
  103. this.itemData.outfire = this.itemData.outfire.split(',')
  104. }
  105. this.subject = JSON.parse(decodeURIComponent(option.subject));
  106. },
  107. methods: {
  108. async getSafetyWarning(){
  109. const {data} = await getDicts('sys_safety_warning');
  110. if(data.code == 200){
  111. this.safetyWarning = data.data;
  112. }
  113. },
  114. async getHazardCategory(){
  115. const {data} = await getDicts('sys_hazard_category');
  116. if(data.code == 200){
  117. this.hazardCategory = data.data;
  118. }
  119. },
  120. async getRiskMeasure(){
  121. const {data} = await getDicts('sys_risk_measure');
  122. if(data.code == 200){
  123. this.riskMeasure = data.data;
  124. }
  125. },
  126. async getExtinguishingKeyPoints(){
  127. const {data} = await getDicts('sys_extinguishing_key_points');
  128. if(data.code == 200){
  129. this.extinguishingKeyPoints = data.data;
  130. }
  131. },
  132. }
  133. }
  134. </script>
  135. <style lang="stylus" scoped>
  136. #safetyCard{
  137. height:100%;
  138. overflow-y:scroll;
  139. overflow-x hidden
  140. .top-name-max-box{
  141. background #fff
  142. overflow hidden
  143. .name-box{
  144. margin:27rpx 20rpx 0;
  145. display:flex;
  146. view:nth-child(1){
  147. background:#f95f5f;
  148. color:#fff;
  149. border-radius:6rpx;
  150. font-size:20rpx;
  151. padding:0 10rpx;
  152. height:42rpx;
  153. line-height:42rpx;
  154. }
  155. view:nth-child(2){
  156. color:#333;
  157. margin-left:20rpx;
  158. font-size:28rpx;
  159. height:30rpx;
  160. line-height:42rpx;
  161. font-weight:700;
  162. }
  163. }
  164. .address-box{
  165. margin:22rpx 20rpx;
  166. font-size:26rpx;
  167. }
  168. }
  169. .text-max-box{
  170. margin-top:20rpx;
  171. background #fff
  172. padding:8rpx 20rpx;
  173. .text-min-box{
  174. display:flex;
  175. view{
  176. line-height:66rpx;
  177. height:66rpx;
  178. font-size:28rpx;
  179. }
  180. view:nth-child(1){
  181. width:220rpx;
  182. color:#333;
  183. }
  184. view:nth-child(2){
  185. flex:1;
  186. color:#999;
  187. text-align:right;
  188. }
  189. }
  190. }
  191. .safety-max-box{
  192. margin-top:20rpx;
  193. background #fff
  194. padding:8rpx 20rpx;
  195. .max-for-box{
  196. .title-box{
  197. line-height:76rpx;
  198. font-size:28rpx;
  199. color:#333;
  200. }
  201. .for-box{
  202. line-height:48rpx;
  203. font-size:26rpx;
  204. color:#999;
  205. }
  206. }
  207. }
  208. .img-bottom-box{
  209. margin-top:20rpx;
  210. background #fff
  211. padding:8rpx 20rpx 20rpx;
  212. .title-box{
  213. line-height:76rpx;
  214. font-size:28rpx;
  215. color:#333;
  216. }
  217. .for-box{
  218. line-height:48rpx;
  219. font-size:26rpx;
  220. color:#999;
  221. .img-ojb{
  222. display inline-block
  223. width:86rpx;
  224. height:114rpx;
  225. margin-right:20rpx;
  226. }
  227. .code-img{
  228. width:200rpx;
  229. height:200rpx;
  230. margin:20rpx auto 40rpx;
  231. }
  232. }
  233. }
  234. }
  235. </style>