chemicalsInfo.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <!-- 化学品信息(扫码进入) -->
  2. <template>
  3. <view id="chemicalsInfo">
  4. <view class="info-data-box">
  5. <img class="logo-img" :src="circularLogo">
  6. <view class="title-box">
  7. <view class="title-one-box">
  8. <view>{{newData.data1}}</view>
  9. <view>{{newData.data2?'管控':'非管控'}}</view>
  10. <view>{{newData.data3}}</view>
  11. </view>
  12. <view class="title-two-box">编号:{{newData.data4}}</view>
  13. <view class="title-three-box">余量:{{newData.data5}}</view>
  14. </view>
  15. </view>
  16. <view class="table-button-max-box">
  17. <view class="table-button-box" @click='tableButtonCheck(1)'
  18. :class="pageType==1?'checkClass':''">
  19. <view>基本信息</view>
  20. <view></view>
  21. </view>
  22. <view class="table-button-box" @click='tableButtonCheck(2)'
  23. :class="pageType==2?'checkClass':''">
  24. <view>使用记录</view>
  25. <view></view>
  26. </view>
  27. </view>
  28. <!-- 基础信息 -->
  29. <view class="info-max-big-box" v-if="pageType == 1">
  30. <view class="info-big-box">
  31. <view class="info-box">
  32. <view>C A S</view>
  33. <view>:</view>
  34. <view>{{newData.data6}}</view>
  35. </view>
  36. <view class="info-box">
  37. <view>别名</view>
  38. <view>:</view>
  39. <view>{{newData.data7}}</view>
  40. </view>
  41. <view class="info-box">
  42. <view>类别</view>
  43. <view>:</view>
  44. <view>{{newData.data8}}</view>
  45. </view>
  46. <view class="info-box">
  47. <view>规格</view>
  48. <view>:</view>
  49. <view>{{newData.data9}}</view>
  50. </view>
  51. <view class="info-box">
  52. <view>归属人</view>
  53. <view>:</view>
  54. <view>{{newData.data10}}</view>
  55. </view>
  56. <view class="info-box">
  57. <view style="width:120rpx;">存储位置</view>
  58. <view>:</view>
  59. <view>{{newData.data11}}</view>
  60. </view>
  61. </view>
  62. <view class="info-big-box">
  63. <view class="info-box">
  64. <view>学院</view>
  65. <view>:</view>
  66. <view>{{newData.data12}}</view>
  67. </view>
  68. <view class="info-box">
  69. <view>楼栋</view>
  70. <view>:</view>
  71. <view>{{newData.data13}}</view>
  72. </view>
  73. <view class="info-box">
  74. <view>实验室</view>
  75. <view>:</view>
  76. <view>{{newData.data14}}</view>
  77. </view>
  78. </view>
  79. </view>
  80. <!-- 使用记录 -->
  81. <scroll-view class="info-list-box" v-if="pageType == 2" scroll-y @scrolltolower="scrollGet">
  82. <view class="for-max-big-box" v-for="(item,index) in dataList" :key="index">
  83. <view class="for-title-box">
  84. <view class="time-box">{{item.for0}}</view>
  85. <view class="position-top-right" :class="item.for9?'colorA':'colorB'">{{item.for9?'领用':'归还'}}</view>
  86. <view class="border-box"></view>
  87. <view class="position-left"></view>
  88. <view class="position-right"></view>
  89. </view>
  90. <view class="for-info-box" v-if="item.for9">
  91. <view class="for-info-min-box">
  92. <view>领用人</view>
  93. <view>:</view>
  94. <view>{{item.for1}}</view>
  95. </view>
  96. <view class="for-info-min-box">
  97. <view>领用量</view>
  98. <view>:</view>
  99. <view>{{item.for2}}</view>
  100. </view>
  101. <view class="for-info-min-box">
  102. <view style="width:120rpx;">双人认证</view>
  103. <view>:</view>
  104. <view>{{item.for3}}</view>
  105. </view>
  106. </view>
  107. <view class="for-info-box" v-if="!item.for9">
  108. <view class="for-info-min-box">
  109. <view>归还人</view>
  110. <view>:</view>
  111. <view>{{item.for4}}</view>
  112. </view>
  113. <view class="for-info-min-box">
  114. <view>使用量</view>
  115. <view>:</view>
  116. <view>{{item.for5}}</view>
  117. </view>
  118. <view class="for-info-min-box">
  119. <view>余量</view>
  120. <view>:</view>
  121. <view>{{item.for6}}</view>
  122. </view>
  123. <view class="for-info-min-box">
  124. <view style="width:120rpx;">双人认证</view>
  125. <view>:</view>
  126. <view>{{item.for7}}</view>
  127. </view>
  128. </view>
  129. </view>
  130. <view class="null-box" v-if="!dataList[0]">
  131. <img :src="imagesUrl('commonality/chemicalsInfoNull.png')">
  132. <view>暂无数据</view>
  133. </view>
  134. <view class="get-null-box">仅展示最近三个月使用记录</view>
  135. <view class="get-null-box" v-if="getDataType">暂无更多数据</view>
  136. </scroll-view>
  137. </view>
  138. </template>
  139. <script>
  140. export default {
  141. data() {
  142. return {
  143. circularLogo: uni.getStorageSync('circularLogo'),
  144. newData:{
  145. data1:'化学品名称',
  146. data2:'1',
  147. data3:'使用中',
  148. data4:'123456789',
  149. data5:'450ml',
  150. data6:'123456789',
  151. data7:'别名名称',
  152. data8:'普通危化品',
  153. data9:'450ml/瓶',
  154. data10:'课题组',
  155. data11:'化学品柜-柜门-柜层',
  156. data12:'学院名称',
  157. data13:'校区-楼栋',
  158. data14:'实验室名称-(房间号)',
  159. },
  160. pageType:1,
  161. //使用记录 相关
  162. queryParams: {
  163. page: 1,
  164. pageSize: 10,
  165. },
  166. total: 0,
  167. dataList: [
  168. {
  169. for0:'2024-03-03 10:33',
  170. for1:'黄老师',
  171. for2:'300ml',
  172. for3:'李腾腾 杨森',
  173. for4:'黄老师',
  174. for5:'300ml',
  175. for6:'100ml',
  176. for7:'李腾腾 杨森',
  177. for9:true,
  178. },
  179. {
  180. for0:'2024-03-03 10:33',
  181. for1:'黄老师',
  182. for2:'300ml',
  183. for3:'李腾腾 杨森',
  184. for4:'黄老师',
  185. for5:'300ml',
  186. for6:'100ml',
  187. for7:'李腾腾 杨森',
  188. for9:false,
  189. },
  190. ],
  191. getDataType: false,
  192. }
  193. },
  194. onLoad(option) {
  195. },
  196. onShow() {
  197. },
  198. methods: {
  199. tableButtonCheck(type){
  200. if(this.pageType != type){
  201. this.$set(this,'pageType',type);
  202. }
  203. },
  204. //滚动事件
  205. scrollGet() {
  206. let self = this;
  207. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  208. this.$set(this, 'getDataType', true);
  209. } else {
  210. this.queryParams.page += 1;
  211. this.$nextTick(() => {
  212. this.getList();
  213. })
  214. }
  215. },
  216. getList(){
  217. // let self = this;
  218. // const {
  219. // data
  220. // } = await systemNoticeGetNoticeList(this.queryParams);
  221. // if (data.code == 200) {
  222. // if (self.queryParams.page == 1) {
  223. // this.$set(this,'dataList',data.data.records);
  224. // this.$set(this,'total',data.data.total);
  225. // if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  226. // this.$set(this, 'getDataType', true);
  227. // }
  228. // } else {
  229. // this.$set(this,'dataList',[...this.dataList, ...data.data.records]);
  230. // this.$set(this,'total',data.data.total);
  231. // if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  232. // this.$set(this, 'getDataType', true);
  233. // }
  234. // }
  235. // }
  236. },
  237. },
  238. }
  239. </script>
  240. <style lang="stylus" scoped>
  241. #chemicalsInfo {
  242. height: 100%;
  243. display flex;
  244. flex-direction: column;
  245. .info-data-box{
  246. display: flex;
  247. background-color: #fff;
  248. .logo-img{
  249. width:120rpx;
  250. height:120rpx;
  251. display: inline-block;
  252. margin:40rpx 40rpx 40rpx 30rpx;
  253. }
  254. .title-box{
  255. .title-one-box{
  256. display: flex;
  257. view:nth-child(1){
  258. font-size:30rpx;
  259. color:#333;
  260. }
  261. view:nth-child(2){
  262. }
  263. view:nth-child(3){
  264. }
  265. }
  266. .title-two-box{
  267. }
  268. .title-three-box{
  269. }
  270. }
  271. }
  272. .table-button-max-box{
  273. display: flex;
  274. height:100rpx;
  275. .table-button-box{
  276. height:75rpx;
  277. width:120rpx;
  278. margin:25rpx 30rpx 0 30rpx;
  279. view:nth-child(1){
  280. font-size:30rpx;
  281. line-height:50rpx;
  282. height:50rpx;
  283. }
  284. }
  285. .checkClass{
  286. view:nth-child(1){
  287. color:#0183FA;
  288. }
  289. view:nth-child(2){
  290. height:4rpx;
  291. width:90rpx;
  292. margin:0 15rpx;
  293. background-color:#0183FA;
  294. }
  295. }
  296. }
  297. .info-max-big-box{
  298. margin:0 30rpx 0;
  299. .info-big-box{
  300. background-color:#fff;
  301. margin-bottom:20rpx;
  302. border-radius:20rpx;
  303. .info-box:nth-child(1){
  304. border-top:none;
  305. }
  306. .info-box{
  307. display: flex;
  308. border-top:1rpx solid #E0E0E0;
  309. margin:0 30rpx;
  310. view{
  311. height:80rpx;
  312. line-height:80rpx;
  313. font-size:28rpx;
  314. color:#333;
  315. }
  316. view:nth-child(1){
  317. width:90rpx;
  318. text-align: justify;
  319. word-break: break-all;
  320. text-align-last: justify;
  321. }
  322. view:nth-child(2){
  323. margin-left:5rpx;
  324. }
  325. view:nth-child(3){
  326. flex:1;
  327. text-align: right
  328. }
  329. }
  330. }
  331. }
  332. .info-list-box{
  333. flex: 1;
  334. overflow: scroll;
  335. .for-max-big-box{
  336. background-color: #fff;
  337. margin:0 30rpx 20rpx 30rpx;
  338. border-radius:10rpx;
  339. .for-title-box{
  340. height:118rpx;
  341. position: relative;
  342. overflow: hidden;
  343. .time-box{
  344. height:100rpx;
  345. line-height:93rpx;
  346. font-size:28rpx;
  347. color:#333;
  348. padding-left:30rpx;
  349. }
  350. .position-top-right{
  351. position: absolute;
  352. top:0;
  353. right:0;
  354. width:100rpx;
  355. height:36rpx;
  356. line-height:36rpx;
  357. font-size:24rpx;
  358. text-align: center;
  359. border-radius: 0rpx 10rpx 0rpx 6rpx;
  360. }
  361. .colorA{
  362. color:#0183FA;
  363. background: rgba(1,131,250,0.2);
  364. }
  365. .colorB{
  366. color:#07BC11;
  367. background: rgba(7,188,17,0.2);
  368. }
  369. .border-box{
  370. border-top:1rpx dashed #F5F5F5;
  371. height:18rpx;
  372. }
  373. .position-left{
  374. width:30rpx;
  375. height:30rpx;
  376. z-index:1;
  377. position:absolute;
  378. bottom:3rpx;
  379. left:-15rpx;
  380. background-color: #F5F5F5;
  381. border-radius:50%;
  382. }
  383. .position-right{
  384. width:30rpx;
  385. height:30rpx;
  386. z-index:1;
  387. position:absolute;
  388. bottom:3rpx;
  389. right:-15rpx;
  390. background-color: #F5F5F5;
  391. border-radius:50%;
  392. }
  393. }
  394. .for-info-box{
  395. .for-info-min-box{
  396. display: flex;
  397. padding:0 30rpx;
  398. view{
  399. height:80rpx;
  400. line-height:80rpx;
  401. font-size:28rpx;
  402. color:#333;
  403. }
  404. view:nth-child(1){
  405. width:90rpx;
  406. text-align: justify;
  407. word-break: break-all;
  408. text-align-last: justify;
  409. }
  410. view:nth-child(2){
  411. margin-left:5rpx;
  412. }
  413. view:nth-child(3){
  414. flex:1;
  415. text-align: right
  416. }
  417. }
  418. }
  419. }
  420. .null-box{
  421. img{
  422. width:300rpx;
  423. height:300rpx;
  424. margin:150rpx 225rpx 0;
  425. display: inline-block;
  426. }
  427. view{
  428. color:#999;
  429. font-size:28rpx;
  430. line-height:40rpx;
  431. text-align: center;
  432. margin-top:15rpx;
  433. }
  434. }
  435. .get-null-box {
  436. height: 100rpx;
  437. line-height: 100rpx;
  438. color: #999;
  439. text-align center
  440. padding-bottom:200rpx;
  441. }
  442. }
  443. }
  444. </style>