chemicalDetail.vue 11 KB

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