chemicalsInfo.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  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. <span>{{newData.chemicalName}}</span>
  9. <span class="color-border">{{newData.chemicalLevel == 1?'管控':'非管控'}}</span>
  10. <span :class="newData.useStatus == 0 || newData.useStatus == -1?'colorA':(
  11. newData.useStatus == 1 || newData.useStatus == 5?'colorB':(
  12. newData.useStatus == 2 ?'colorC':(
  13. newData.useStatus == 3 ?'colorD':(
  14. newData.useStatus == 4 ?'colorE':''))))">
  15. {{newData.useStatus == 0 || newData.useStatus == -1?'未使用':(
  16. newData.useStatus==1 || newData.useStatus==5?'使用中':(
  17. newData.useStatus==2?'超时未归还':(
  18. newData.useStatus==3?'空瓶出库':(
  19. newData.useStatus==4?'废弃出库':''))))}}
  20. </span>
  21. </view>
  22. <view class="title-two-box">编号:{{newData.tagCode}}</view>
  23. <view class="title-three-box">余量:{{newData.surplus}}{{newData.specUnit}}</view>
  24. </view>
  25. </view>
  26. <view class="table-button-max-box">
  27. <view class="table-button-box" @click='tableButtonCheck(1)'
  28. :class="pageType==1?'checkClass':''">
  29. <view>基本信息</view>
  30. <view></view>
  31. </view>
  32. <view class="table-button-box" @click='tableButtonCheck(2)'
  33. :class="pageType==2?'checkClass':''">
  34. <view>使用记录</view>
  35. <view></view>
  36. </view>
  37. </view>
  38. <!-- 基础信息 -->
  39. <view class="info-max-big-box" v-if="pageType == 1">
  40. <view class="info-big-box">
  41. <view class="info-box">
  42. <view>C A S</view>
  43. <view>:</view>
  44. <view>{{newData.casNum}}</view>
  45. </view>
  46. <view class="info-box">
  47. <view>别名</view>
  48. <view>:</view>
  49. <view>{{newData.chemicalNameChar}}</view>
  50. </view>
  51. <view class="info-box">
  52. <view>类别</view>
  53. <view>:</view>
  54. <view>{{newData.chemicalCategory}}</view>
  55. </view>
  56. <view class="info-box">
  57. <view>规格</view>
  58. <view>:</view>
  59. <view>{{newData.specNum}}{{newData.specUnit?newData.specUnit+'/瓶':''}}</view>
  60. </view>
  61. <view class="info-box">
  62. <view>归属人</view>
  63. <view>:</view>
  64. <view>{{newData.belongName}}</view>
  65. </view>
  66. <view class="info-box">
  67. <view style="width:120rpx;">存储位置</view>
  68. <view>:</view>
  69. <view>{{newData.cabinetName}}{{newData.doorName?' - '+newData.doorName:''}}{{newData.layers?' - '+newData.layers:''}}</view>
  70. </view>
  71. </view>
  72. <view class="info-big-box">
  73. <view class="info-box">
  74. <view>学院</view>
  75. <view>:</view>
  76. <view>{{newData.deptName}}</view>
  77. </view>
  78. <view class="info-box">
  79. <view>楼栋</view>
  80. <view>:</view>
  81. <view>{{newData.schoolName}} - {{newData.buildName}}</view>
  82. </view>
  83. <view class="info-box">
  84. <view>实验室</view>
  85. <view>:</view>
  86. <view>{{newData.subName}}{{newData.subRoom?'('+newData.subRoom+')':''}}</view>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 使用记录 -->
  91. <scroll-view class="info-list-box" v-if="pageType == 2" scroll-y @scrolltolower="scrollGet">
  92. <view class="for-max-big-box" v-for="(item,index) in dataList" :key="index">
  93. <view class="for-title-box">
  94. <view class="time-box">{{item.for0}}</view>
  95. <view class="position-top-right" :class="item.for9?'colorA':'colorB'">{{item.for9?'领用':'归还'}}</view>
  96. <view class="border-box"></view>
  97. <view class="position-left"></view>
  98. <view class="position-right"></view>
  99. </view>
  100. <view class="for-info-box" v-if="item.for9">
  101. <view class="for-info-min-box">
  102. <view>领用人</view>
  103. <view>:</view>
  104. <view>{{item.for1}}</view>
  105. </view>
  106. <view class="for-info-min-box">
  107. <view>领用量</view>
  108. <view>:</view>
  109. <view>{{item.for2}}</view>
  110. </view>
  111. <view class="for-info-min-box">
  112. <view style="width:120rpx;">双人认证</view>
  113. <view>:</view>
  114. <view>{{item.for3}}</view>
  115. </view>
  116. </view>
  117. <view class="for-info-box" v-if="!item.for9">
  118. <view class="for-info-min-box">
  119. <view>归还人</view>
  120. <view>:</view>
  121. <view>{{item.for4}}</view>
  122. </view>
  123. <view class="for-info-min-box">
  124. <view>使用量</view>
  125. <view>:</view>
  126. <view>{{item.for5}}</view>
  127. </view>
  128. <view class="for-info-min-box">
  129. <view>余量</view>
  130. <view>:</view>
  131. <view>{{item.for6}}</view>
  132. </view>
  133. <view class="for-info-min-box">
  134. <view style="width:120rpx;">双人认证</view>
  135. <view>:</view>
  136. <view>{{item.for7}}</view>
  137. </view>
  138. </view>
  139. </view>
  140. <view class="null-box" v-if="!dataList[0]">
  141. <img :src="imagesUrl('commonality/chemicalsInfoNull.png')">
  142. <view>暂无数据</view>
  143. </view>
  144. <view class="get-null-box">仅展示最近三个月使用记录</view>
  145. <view class="get-null-box" v-if="getDataType">暂无更多数据</view>
  146. </scroll-view>
  147. </view>
  148. </template>
  149. <script>
  150. export default {
  151. data() {
  152. return {
  153. circularLogo: uni.getStorageSync('circularLogo'),
  154. newData:{},
  155. pageType:1,
  156. //使用记录 相关
  157. queryParams: {
  158. page: 1,
  159. pageSize: 10,
  160. },
  161. total: 0,
  162. dataList: [
  163. {
  164. for0:'2024-03-03 10:33',
  165. for1:'黄老师',
  166. for2:'300ml',
  167. for3:'李腾腾 杨森',
  168. for4:'黄老师',
  169. for5:'300ml',
  170. for6:'100ml',
  171. for7:'李腾腾 杨森',
  172. for9:true,
  173. },
  174. {
  175. for0:'2024-03-03 10:33',
  176. for1:'黄老师',
  177. for2:'300ml',
  178. for3:'李腾腾 杨森',
  179. for4:'黄老师',
  180. for5:'300ml',
  181. for6:'100ml',
  182. for7:'李腾腾 杨森',
  183. for9:false,
  184. },
  185. ],
  186. getDataType: false,
  187. }
  188. },
  189. onLoad(option) {
  190. if(option.item){
  191. let obj = JSON.parse(decodeURIComponent(option.item))
  192. this.$set(this,'newData',obj);
  193. }else{
  194. }
  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. padding-bottom:40rpx;
  249. .logo-img{
  250. width:120rpx;
  251. height:120rpx;
  252. display: inline-block;
  253. margin:40rpx 40rpx 0 30rpx;
  254. }
  255. .title-box{
  256. flex:1;
  257. .title-one-box{
  258. margin:28rpx 47rpx 0 0;
  259. span:nth-child(1){
  260. font-size:30rpx;
  261. color:#333;
  262. line-height:45rpx;
  263. font-size:30rpx;
  264. font-weight:700;
  265. }
  266. span:nth-child(2){
  267. display: inline-block;
  268. min-width:100rpx;
  269. height:34rpx;
  270. line-height:32rpx;
  271. font-size:24rpx;
  272. margin:0 10rpx 0;
  273. text-align: center;
  274. border-radius:6rpx;
  275. }
  276. span:nth-child(3){
  277. display: inline-block;
  278. min-width:120rpx;
  279. height:34rpx;
  280. line-height:32rpx;
  281. font-size:24rpx;
  282. margin:0 10rpx 0;
  283. text-align: center;
  284. border-radius:6rpx;
  285. }
  286. }
  287. .title-two-box{
  288. line-height:50rpx;
  289. font-size:28rpx;
  290. margin-top:10rpx;
  291. }
  292. .title-three-box{
  293. line-height:50rpx;
  294. font-size:28rpx;
  295. }
  296. }
  297. }
  298. .table-button-max-box{
  299. display: flex;
  300. height:100rpx;
  301. .table-button-box{
  302. height:75rpx;
  303. width:120rpx;
  304. margin:25rpx 30rpx 0 30rpx;
  305. view:nth-child(1){
  306. font-size:30rpx;
  307. line-height:50rpx;
  308. height:50rpx;
  309. }
  310. }
  311. .checkClass{
  312. view:nth-child(1){
  313. color:#0183FA;
  314. }
  315. view:nth-child(2){
  316. height:4rpx;
  317. width:90rpx;
  318. margin:0 15rpx;
  319. background-color:#0183FA;
  320. }
  321. }
  322. }
  323. .info-max-big-box{
  324. margin:0 30rpx 0;
  325. .info-big-box{
  326. background-color:#fff;
  327. margin-bottom:20rpx;
  328. border-radius:20rpx;
  329. .info-box:nth-child(1){
  330. border-top:none;
  331. }
  332. .info-box{
  333. display: flex;
  334. border-top:1rpx solid #E0E0E0;
  335. margin:0 30rpx;
  336. view{
  337. line-height:80rpx;
  338. font-size:28rpx;
  339. color:#333;
  340. }
  341. view:nth-child(1){
  342. width:90rpx;
  343. text-align: justify;
  344. word-break: break-all;
  345. text-align-last: justify;
  346. }
  347. view:nth-child(2){
  348. margin-left:5rpx;
  349. }
  350. view:nth-child(3){
  351. flex:1;
  352. text-align: right;
  353. line-height:30rpx;
  354. padding:25rpx 0 25rpx 25rpx;
  355. }
  356. }
  357. }
  358. }
  359. .info-list-box{
  360. flex: 1;
  361. overflow: scroll;
  362. .for-max-big-box{
  363. background-color: #fff;
  364. margin:0 30rpx 20rpx 30rpx;
  365. border-radius:10rpx;
  366. .for-title-box{
  367. height:118rpx;
  368. position: relative;
  369. overflow: hidden;
  370. .time-box{
  371. height:100rpx;
  372. line-height:93rpx;
  373. font-size:28rpx;
  374. color:#333;
  375. padding-left:30rpx;
  376. }
  377. .position-top-right{
  378. position: absolute;
  379. top:0;
  380. right:0;
  381. width:100rpx;
  382. height:36rpx;
  383. line-height:36rpx;
  384. font-size:24rpx;
  385. text-align: center;
  386. border-radius: 0rpx 10rpx 0rpx 6rpx;
  387. }
  388. .colorA{
  389. color:#0183FA;
  390. background: rgba(1,131,250,0.2);
  391. }
  392. .colorB{
  393. color:#07BC11;
  394. background: rgba(7,188,17,0.2);
  395. }
  396. .border-box{
  397. border-top:1rpx dashed #F5F5F5;
  398. height:18rpx;
  399. }
  400. .position-left{
  401. width:30rpx;
  402. height:30rpx;
  403. z-index:1;
  404. position:absolute;
  405. bottom:3rpx;
  406. left:-15rpx;
  407. background-color: #F5F5F5;
  408. border-radius:50%;
  409. }
  410. .position-right{
  411. width:30rpx;
  412. height:30rpx;
  413. z-index:1;
  414. position:absolute;
  415. bottom:3rpx;
  416. right:-15rpx;
  417. background-color: #F5F5F5;
  418. border-radius:50%;
  419. }
  420. }
  421. .for-info-box{
  422. .for-info-min-box{
  423. display: flex;
  424. padding:0 30rpx;
  425. view{
  426. height:80rpx;
  427. line-height:80rpx;
  428. font-size:28rpx;
  429. color:#333;
  430. }
  431. view:nth-child(1){
  432. width:90rpx;
  433. text-align: justify;
  434. word-break: break-all;
  435. text-align-last: justify;
  436. }
  437. view:nth-child(2){
  438. margin-left:5rpx;
  439. }
  440. view:nth-child(3){
  441. flex:1;
  442. text-align: right
  443. }
  444. }
  445. }
  446. }
  447. .null-box{
  448. img{
  449. width:300rpx;
  450. height:300rpx;
  451. margin:150rpx 225rpx 0;
  452. display: inline-block;
  453. }
  454. view{
  455. color:#999;
  456. font-size:28rpx;
  457. line-height:40rpx;
  458. text-align: center;
  459. margin-top:15rpx;
  460. }
  461. }
  462. .get-null-box {
  463. height: 100rpx;
  464. line-height: 100rpx;
  465. color: #999;
  466. text-align center
  467. padding-bottom:200rpx;
  468. }
  469. }
  470. //管控/非管控
  471. .color-border{
  472. border:1px solid #0183FA;
  473. background: #fff;
  474. color:#0183FA;
  475. }
  476. //未使用
  477. .colorA{
  478. border:1px solid #EDEDED;
  479. background: #EDEDED;
  480. color:#999;
  481. }
  482. //使用中
  483. .colorB{
  484. border:1px solid rgba(1,131,250,0.2);
  485. background: rgba(1,131,250,0.2);
  486. color:#0183FA;
  487. }
  488. //超时未归还
  489. .colorC{
  490. border:1px solid rgba(255,140,0,0.2);
  491. background: rgba(255,140,0,0.2);
  492. color:#FF8C00;
  493. }
  494. //空瓶出库
  495. .colorD{
  496. border:1px solid rgba(43,128,255,0.2);
  497. background: rgba(43,128,255,0.2);
  498. color:#2B80FF;
  499. }
  500. //废弃出库
  501. .colorE{
  502. border:1px solid #D6D6D6;
  503. background: #D6D6D6;
  504. color:#666666;
  505. }
  506. //归还
  507. .colorF{
  508. border:1px solid rgba(7,188,17,0.2);
  509. background: rgba(7,188,17,0.2);
  510. color:#07BC11;
  511. }
  512. //存储
  513. .colorG{
  514. border:1px solid rgba(0,185,191,0.2);
  515. background: rgba(0,185,191,0.2);
  516. color:#00B9BF;
  517. }
  518. }
  519. </style>