chemicalDetail.vue 12 KB

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