chemicalDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <!-- 化学品详情-扫码 -->
  2. <template>
  3. <view class="course">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="header">
  6. <view class="header-l">
  7. <img :src="circularLogo">
  8. </view>
  9. <view class="header-r">
  10. <view class="header-r-t">
  11. <view>{{newData.chemicalName}}</view>
  12. <view>{{newData.chemicalLevel==1?'管控':'非管控'}}</view>
  13. <view :class="newData.status==0?'color-A':(newData.status==1?'color-B':'color-C')">{{newData.statusTag}}</view>
  14. </view>
  15. <view class="header-r-b">编码:{{newData.tagCode}}</view>
  16. <view class="header-r-b2">余量:{{newData.surplus}}{{newData.specUnit}}</view>
  17. </view>
  18. </view>
  19. <view class="tabTitle">
  20. <view class="tabTitle-li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  21. <view :class="{on:curTab==index}" class="tabTitle-text">{{item}}</view>
  22. <view :class="{on:curTab==index}" class="tabTitle-across"></view>
  23. </view>
  24. </view>
  25. <view class="list" v-if="pageType==0">
  26. <view class="list-border">
  27. <view class="list-li"><text>CAS:</text><text>{{newData.casNum}}</text></view>
  28. <view class="list-li"><text>别名:</text><text>{{newData.anotherName}}</text></view>
  29. <view class="list-li"><text>类别:</text><text>{{newData.chemicalCategoryName}}</text></view>
  30. <view class="list-li"><text>规格:</text><text>{{newData.specNum}}{{newData.specUnit}}/{{newData.packUnit}}</text></view>
  31. <view class="list-li"><text>归属人:</text><text>{{newData.belongName}}</text></view>
  32. </view>
  33. <view class="list-border">
  34. <view class="list-li"><text>学院:</text><text>{{newData.deptName}}</text></view>
  35. <view class="list-li"><text>楼栋:</text><text>{{newData.buildName}}-{{newData.floorName}}</text></view>
  36. <view class="list-li"><text>实验室:</text><text>{{newData.subName}}({{newData.subRoom}})</text></view>
  37. <view class="list-li"><text>存储位置:</text><text>{{newData.cabinetName}}-{{newData.doorName}}-{{newData.layers}}层</text></view>
  38. </view>
  39. </view>
  40. <viw class="list-tow" v-if="pageType==1" >
  41. <view class="list-tow-li" v-for="(item,index) in newData.chemicalUseList" :key="index">
  42. <view class="list-tow-li-t">
  43. <view class="list-tow-li-t-l"></view>
  44. <view class="list-tow-li-t-c">{{item.collectTime}}</view>
  45. <view class="list-tow-li-t-c2" :class="item.tagCode==1?'color-E':'color-D'">{{item.tagType}}</view>
  46. <view class="list-tow-li-t-r"></view>
  47. </view>
  48. <!-- tagCode 1领用,0是归还,3是空瓶出库-->
  49. <view class="list-tow-li-b">
  50. <view class="list-tow-li-b-li" v-if="item.tagCode==1 || item.tagCode==3"><text>领用人:</text><text>{{item.userName}}</text></view>
  51. <view class="list-tow-li-b-li" v-if="item.tagCode==1 || item.tagCode==3"><text>领用量:</text><text>{{item.collectNowNum}}{{item.specUnit}}</text></view>
  52. <view class="list-tow-li-b-li" v-if="item.tagCode==0"><text>归还人:</text><text>{{item.userName}}</text></view>
  53. <view class="list-tow-li-b-li" v-if="item.tagCode==0 || item.tagCode==3"><text>使用量:</text><text>{{item.useAmount}}{{item.specUnit}}</text></view>
  54. <view class="list-tow-li-b-li" v-if="item.tagCode==0"><text>余 量:</text><text>{{item.returnStockNum}}{{item.specUnit}}</text></view>
  55. <view class="list-tow-li-b-li"><text>双人认证:</text><text>{{item.doubleAuthen}}</text></view>
  56. </view>
  57. </view>
  58. </viw>
  59. <img class="null-img" v-if="pageType!=0 && !newData.chemicalUseList[0]" :src="imagesUrl('commonality/chemicalsInfoNull.png')">
  60. <p class="null-p" v-if="pageType!=0 && !newData.chemicalUseList[0]">暂无数据</p>
  61. <view class="tip" v-if="pageType!=0 && newData.chemicalUseList[0]">仅展示最近三个月的使用记录</view>
  62. </scroll-view>
  63. </view>
  64. </template>
  65. <script>
  66. import { config } from '@/api/request/config.js'
  67. import {chemicalAppletGetStockDetail} from '@/pages/api/index.js'
  68. export default {
  69. name: "rectifyList",
  70. components: {
  71. },
  72. data() {
  73. return {
  74. circularLogo:uni.getStorageSync('circularLogo'),
  75. baseUrl:config.base_url,
  76. pageType:0,//0基本信息 1使用记录 2申领记录
  77. form:{
  78. },
  79. tabText:['基本信息','使用记录'],
  80. curTab:0,
  81. newData:{
  82. chemicalName:'',
  83. chemicalLevel:'',
  84. status:'',
  85. tagCode:'',
  86. surplus:'',
  87. specUnit:'',
  88. casNum:'',
  89. anotherName:'',
  90. chemicalCategoryName:'',
  91. specNum:'',
  92. specUnit:'',
  93. packUnit:'',
  94. belongName:'',
  95. deptName:'',
  96. buildName:'',
  97. floorName:'',
  98. subName:'',
  99. subRoom:'',
  100. cabinetName:'',
  101. doorName:'',
  102. layers:'',
  103. chemicalUseList:[],
  104. },
  105. tagCode:'',
  106. dataList:[],
  107. nickName:'',
  108. }
  109. },
  110. onLoad(option) {
  111. this.tagCode=option.code;
  112. },
  113. onShow() {
  114. },
  115. mounted(){
  116. this.chemicalAppletGetStockDetail();
  117. },
  118. methods: {
  119. //滚动事件
  120. scrollGet(){},
  121. tabClick(index) {
  122. this.curTab = index;
  123. this.pageType = index;
  124. },
  125. //详情
  126. async chemicalAppletGetStockDetail(){
  127. let self = this;
  128. const {data} = await chemicalAppletGetStockDetail({tagCode:this.tagCode});
  129. if(data.code == 200){
  130. this.$set(this, 'newData', data.data);
  131. }
  132. },
  133. }
  134. }
  135. </script>
  136. <style lang="stylus" scoped>
  137. .course{
  138. height:100%;
  139. display flex;
  140. box-sizing: border-box;
  141. .info-max-box{
  142. flex: 1;
  143. overflow: scroll;
  144. }
  145. .header{
  146. width: 750rpx;
  147. min-height: 200rpx;
  148. background: #fff;
  149. display: flex;
  150. justify-content: flex-start;
  151. .header-l{
  152. width: 120rpx;
  153. height: 120rpx;
  154. background: #FFFFFF;
  155. border-radius: 60rpx;
  156. margin:40rpx 40rpx 0 30rpx;
  157. >img{
  158. width: 120rpx;
  159. height: 120rpx;
  160. }
  161. }
  162. .header-r{
  163. flex: 1;
  164. .header-r-t{
  165. display: flex;
  166. justify-content: flex-start;
  167. align-items: center;
  168. margin-top: 24rpx;
  169. >view:nth-of-type(1){
  170. font-weight: 400;
  171. font-size: 30rpx;
  172. color: #333333;
  173. line-height: 42rpx;
  174. }
  175. >view:nth-of-type(2){
  176. font-weight: 400;
  177. font-size: 24rpx;
  178. color: #0183FA;
  179. background: #FFFFFF;
  180. border-radius: 6rpx;
  181. border: 1rpx solid #0183FA;
  182. padding: 6rpx 16rpx;
  183. box-sizing: border-box;
  184. margin: 0 10rpx 0 14rpx;
  185. }
  186. >view:nth-of-type(3){
  187. font-size: 24rpx;
  188. border-radius: 6rpx;
  189. padding: 6rpx 14rpx;
  190. box-sizing: border-box;
  191. }
  192. .color-A{
  193. color: #999999;
  194. background: #EDEDED;
  195. }
  196. .color-B{
  197. color: #0183FA;
  198. background: rgba(1,131,250,0.2);
  199. }
  200. .color-C{
  201. color: #2B80FF;
  202. background: rgba(43,128,255,0.2);
  203. }
  204. }
  205. .header-r-b{
  206. font-size: 30rpx;
  207. font-family: PingFang SC-Medium, PingFang SC;
  208. font-weight: 400;
  209. color: #333333;
  210. line-height: 42rpx;
  211. margin-top: 24rpx;
  212. }
  213. .header-r-b2{
  214. font-size: 30rpx;
  215. font-family: PingFang SC-Medium, PingFang SC;
  216. font-weight: 400;
  217. color: #333333;
  218. line-height: 42rpx;
  219. margin-top: 24rpx;
  220. margin-bottom: 20rpx;
  221. display: flex;
  222. justify-content: space-between;
  223. .risk{
  224. width: 180rpx;
  225. height: 50rpx;
  226. border-radius: 80rpx;
  227. opacity: 1;
  228. border: 1rpx solid #FF0000;
  229. font-size: 28rpx;
  230. font-family: PingFang SC-Medium, PingFang SC;
  231. font-weight: 400;
  232. color: #FF0000;
  233. line-height: 50rpx;
  234. text-align: center;
  235. margin-right: 24rpx;
  236. }
  237. .ordinary{
  238. width: 180rpx;
  239. height: 50rpx;
  240. border-radius: 80rpx;
  241. opacity: 1;
  242. border: 1rpx solid #2BCB1D;
  243. font-size: 28rpx;
  244. font-family: PingFang SC-Medium, PingFang SC;
  245. font-weight: 400;
  246. color: #2BCB1D;
  247. line-height: 50rpx;
  248. text-align: center;
  249. margin-right: 24rpx;
  250. }
  251. }
  252. }
  253. }
  254. .tabTitle{
  255. width:100%;
  256. height: 100rpx;
  257. display flex;
  258. justify-content: flex-start;
  259. align-items: center;
  260. margin-bottom:20rpx;
  261. padding: 0 30rpx;
  262. box-sizing: border-box;
  263. .tabTitle-li{
  264. position: relative;
  265. width:120rpx;
  266. text-align center;
  267. margin-right: 48rpx;
  268. .tabTitle-text{
  269. display: inline-block;
  270. font-size: 30rpx;
  271. font-family: PingFang SC;
  272. font-weight: 500;
  273. color: #333333;
  274. line-height: 82rpx;
  275. position: relative;
  276. >text{
  277. position:absolute;
  278. min-width: 30rpx;
  279. min-height: 30rpx;
  280. border-radius:54%;
  281. background: #E80000;
  282. font-size: 18rpx;
  283. font-family: PingFang SC-Medium, PingFang SC;
  284. font-weight: 400;
  285. color: #FFFFFF;
  286. text-align: center;
  287. line-height: 30rpx;
  288. margin-left: 6rpx;
  289. padding:2rpx;
  290. box-sizing: border-box;
  291. }
  292. &.on{
  293. color:#0183FA;
  294. }
  295. }
  296. .tabTitle-across{
  297. width: 92rpx;
  298. height: 4rpx;
  299. background: #0183FA;
  300. border-radius: 2rpx;
  301. margin-left: 10rpx;
  302. display none;
  303. &.on{
  304. display block;
  305. }
  306. }
  307. }
  308. }
  309. .list{
  310. width: 750rpx;
  311. margin-top:20rpx;
  312. padding: 0 30rpx;
  313. box-sizing: border-box;
  314. .list-border{
  315. width: 690rpx;
  316. height: auto;
  317. background: #FFFFFF;
  318. border-radius: 20rpx 20rpx 20rpx 20rpx;
  319. padding: 0 30rpx;
  320. box-sizing: border-box;
  321. margin-bottom: 20rpx;
  322. .list-li{
  323. border-bottom: 1rpx solid #D8D8D8;
  324. display: flex;
  325. justify-content: space-between;
  326. >text:nth-of-type(1){
  327. font-size: 28rpx;
  328. font-family: PingFang SC-Medium, PingFang SC;
  329. font-weight: 400;
  330. color: #333333;
  331. line-height: 80rpx;
  332. }
  333. >text:nth-of-type(2){
  334. flex:1;
  335. font-size: 28rpx;
  336. font-family: PingFang SC-Medium, PingFang SC;
  337. font-weight: 400;
  338. color: #333333;
  339. line-height: 80rpx;
  340. text-align: right;
  341. overflow: hidden;//溢出隐藏
  342. text-overflow: ellipsis;//省略号
  343. white-space: nowrap;//强制文本不换行
  344. }
  345. }
  346. .list-li:last-child{
  347. border-bottom: none;
  348. }
  349. }
  350. }
  351. .list-tow{
  352. .list-tow-li{
  353. width: 690rpx;
  354. height:auto;
  355. background: #FFFFFF;
  356. border-radius: 10rpx;
  357. padding-bottom: 20rpx;
  358. box-sizing: border-box;
  359. margin: 0 30rpx 20rpx;
  360. .list-tow-li-t{
  361. position: relative;
  362. min-height: 110rpx;
  363. display: flex;
  364. justify-content: space-between;
  365. align-items: center;
  366. .list-tow-li-t-l{
  367. position: absolute;
  368. left:-15rpx;
  369. top: 76rpx;
  370. width: 30rpx;
  371. height: 30rpx;
  372. background:#F5F5F5;
  373. border-radius: 15rpx;
  374. }
  375. .list-tow-li-t-c{
  376. min-height: 40rpx;
  377. font-size: 30rpx;
  378. font-family: PingFang SC-Medium, PingFang SC;
  379. font-weight: 400;
  380. line-height: 36rpx;
  381. margin-left: 30rpx;
  382. margin-right: 20rpx;
  383. border-radius: 20rpx;
  384. padding: 20rpx 20rpx;
  385. box-sizing: border-box;
  386. }
  387. .list-tow-li-t-c2{
  388. background: rgba(31,165,13,0.2);
  389. border-radius: 0rpx 6rpx 0rpx 6rpx;
  390. font-size: 28rpx;
  391. font-family: PingFang SC-Medium, PingFang SC;
  392. font-weight: 400;
  393. color: #1FA50D;
  394. text-align: center;
  395. padding: 6rpx 12rpx;
  396. box-sizing: border-box;
  397. position: absolute;
  398. right: 0;
  399. top: 0;
  400. }
  401. .list-tow-li-t-r{
  402. position: absolute;
  403. right:-15rpx;
  404. top: 76rpx;
  405. width: 30rpx;
  406. height: 30rpx;
  407. background:#F5F5F5;
  408. border-radius: 15rpx;
  409. }
  410. .color-D{
  411. color: #07BC11;
  412. background: rgba(7,188,17,0.2);
  413. }
  414. .color-E{
  415. color: #0183FA;
  416. background: rgba(1,131,250,0.2);
  417. }
  418. }
  419. .list-tow-li-b{
  420. height:auto;
  421. border-top:1px dotted #D8D8D8;
  422. margin:0 30rpx;
  423. padding-top:14rpx;
  424. box-sizing: border-box;
  425. .list-tow-li-b-li{
  426. display: flex;
  427. justify-content: space-between;
  428. >text:nth-of-type(1){
  429. font-size: 28rpx;
  430. font-family: PingFang SC-Medium, PingFang SC;
  431. font-weight: 400;
  432. color: #666666;
  433. line-height: 74rpx;
  434. }
  435. >text:nth-of-type(2){
  436. font-size: 28rpx;
  437. font-family: PingFang SC-Medium, PingFang SC;
  438. font-weight: 400;
  439. color: #333333;
  440. line-height: 74rpx;
  441. }
  442. }
  443. }
  444. }
  445. }
  446. .null-img{
  447. width:300rpx;
  448. height:300rpx;
  449. display: block;
  450. margin:140rpx auto 15rpx;
  451. }
  452. .null-p{
  453. text-align: center;
  454. color:#999;
  455. font-size:28rpx;
  456. }
  457. .tip{
  458. font-size: 26rpx;
  459. font-family: PingFang SC-Medium, PingFang SC;
  460. font-weight: 400;
  461. color: #999999;
  462. line-height: 37rpx;
  463. text-align: center;
  464. margin-top: 42rpx;
  465. padding-bottom:140rpx;
  466. }
  467. }
  468. </style>