chemicalDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  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">{{infoData.chemicalName}}</view>
  11. <view class="header_r_b">CAS号:{{infoData.casNum}}</view>
  12. <view class="header_r_b2">库存量:{{infoData.outUsages}}{{infoData.chemicalAmountUnit}}<text class="risk" v-if="infoData.hazardLevel==1">危险化学品</text><text class="ordinary" v-if="infoData.hazardLevel==2">普通化学品</text></view>
  13. </view>
  14. </view>
  15. <view class="tabTitle">
  16. <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  17. <view :class="{on:curTab==index}" class="tabTitle_text">{{item}}</view>
  18. <view :class="{on:curTab==index}" class="tabTitle_across"></view>
  19. </view>
  20. </view>
  21. <view class="list" v-if="pageType==0">
  22. <view class="list_li"><text>编号:</text><text>{{infoData.chemicalNum}}</text></view>
  23. <view class="list_li"><text>别名:</text><text>{{infoData.anotherName}}</text></view>
  24. <view class="list_li"><text>分类:</text><text>{{infoData.classifyName}}</text></view>
  25. <view class="list_li"><text>属性:</text><text>{{infoData.classifyAttribute?infoData.classifyAttribute:'-'}}</text></view>
  26. <view class="list_li"><text>形态:</text><text>{{infoData.chemicalShapeName}}</text></view>
  27. <view class="list_li"><text>容量规格:</text><text>{{infoData.chemicalAmount}}{{infoData.chemicalAmountUnit}}</text></view>
  28. <view class="list_li"><text>库存量:</text><text>{{infoData.outUsages}}{{infoData.chemicalAmountUnit}}</text></view>
  29. <view class="list_li"><text>有效期:</text><text>{{infoData.expirationTime}}</text></view>
  30. <view class="list_li"><text>学院:</text><text>{{infoData.deptName}}</text></view>
  31. <view class="list_li"><text>楼栋:</text><text>{{infoData.buildName}}</text></view>
  32. <view class="list_li"><text>实验室:</text><text>{{infoData.subName}}</text></view>
  33. <view class="list_li"><text>柜子:</text><text>{{infoData.cabinetName}}</text></view>
  34. </view>
  35. <viw class="list_tow" v-if="pageType==1 || pageType==2" v-for="(item,index) in dataList">
  36. <view class="list_tow_t"><text>{{item.timeStr}}</text><text v-if="pageType==2">申购人:{{nickName}}</text></view>
  37. <view class="list_tow_li" v-for="(item2,index2) in item.data">
  38. <view class="list_tow_li_t">
  39. <view class="list_tow_li_t_l"></view>
  40. <view class="list_tow_li_t_c">{{item2.chemicalName}}</view>
  41. <view class="list_tow_li_t_c2" v-if="item2.useStatus==1 || item2.useStatus==2">领用中</view>
  42. <view class="list_tow_li_t_r"></view>
  43. </view>
  44. <view class="list_tow_li_b">
  45. <!-- 使用记录 -->
  46. <view class="list_tow_li_b_li"><text>CAS号:</text><text>{{item2.casNum?item2.casNum:''}}</text></view>
  47. <view class="list_tow_li_b_li" v-if="pageType==1 && item2.useStatus==0"><text>使用量:</text><text>{{item2.usageAmount}}</text></view>
  48. <view class="list_tow_li_b_li" v-if="pageType==1"><text>领用人:</text><text>{{item2.nickName}}</text></view>
  49. <view class="list_tow_li_b_li" v-if="pageType==1 && item2.useStatus==0"><text>余量:</text><text>{{item2.returnStockNum}}</text></view>
  50. <view class="list_tow_li_b_li" v-if="pageType==1 && (item2.useStatus==1 || item2.useStatus==2)"><text>损耗量:</text><text>{{item2.lossAmount}}</text></view>
  51. <!-- 申领记录 -->
  52. <view class="list_tow_li_b_li" v-if="pageType==2"><text>归属人:</text><text>{{item2.nickName}}</text></view>
  53. <view class="list_tow_li_b_li" v-if="pageType==2"><text>净重:</text><text>{{item2.outUsages}}{{item2.chemicalAmountUnit}}</text></view>
  54. </view>
  55. </view>
  56. </viw>
  57. <view class="tip" v-if="pageType==1 || pageType==2">仅展示最近三个月的申购记录</view>
  58. </scroll-view>
  59. </view>
  60. </template>
  61. <script>
  62. import { config } from '@/api/request/config.js'
  63. import {appStockListDetail,useRecordByCode,applyByCode,chemical_shape} from '@/api/index.js'
  64. export default {
  65. name: "rectifyList",
  66. components: {
  67. },
  68. data() {
  69. return {
  70. circularLogo:uni.getStorageSync('circularLogo'),
  71. baseUrl:config.base_url,
  72. pageType:0,//0基本信息 1使用记录 2申领记录
  73. form:{
  74. },
  75. tabText:['基本信息','使用记录','申领记录'],
  76. curTab:0,
  77. infoData:{},
  78. tagCode:'23072006367',
  79. dataList:[],
  80. nickName:'',
  81. }
  82. },
  83. onLoad(option) {
  84. this.tagCode=option.code;
  85. },
  86. onShow() {
  87. },
  88. mounted(){
  89. this.chemical_shape();
  90. },
  91. methods: {
  92. //滚动事件
  93. scrollGet(){},
  94. tabClick(index) {
  95. this.curTab = index;
  96. this.pageType = index;
  97. this.dataList=[];
  98. if(this.pageType==1){
  99. this.getList()
  100. }else if(this.pageType==2){
  101. this.getList2()
  102. }
  103. },
  104. handleClick(doType){
  105. let self=this;
  106. if(doType=='sign'){//签到遮罩层
  107. this.dialogVisible=true;
  108. }else if(doType=='signSubmit'){//确认签到
  109. this.shadeStatus=1;
  110. setTimeout(function () {
  111. self.dialogVisible=false;
  112. }, 3000);
  113. }else if(doType=='door'){//柜门
  114. uni.navigateTo({
  115. url: '/pages/pages_patrolInspector/chemicalCatalogue?pageType=1'
  116. });
  117. }else if(doType=='cancel'){//取消返回小程序首页
  118. }
  119. },
  120. //化学品形态
  121. async chemical_shape(){
  122. let _this = this;
  123. const {data} = await chemical_shape({tagCode:this.tagCode});
  124. if(data.code == 200){
  125. this.morphologyData=data.data;
  126. this.appStockListDetail();
  127. }
  128. },
  129. //详情
  130. async appStockListDetail(){
  131. let _this = this;
  132. const {data} = await appStockListDetail({tagCode:this.tagCode});
  133. if(data.code == 200){
  134. _this.infoData=data.data[0];
  135. _this.morphologyData.forEach(function(item){
  136. if(item.dictValue==_this.infoData.chemicalShape){
  137. _this.infoData.chemicalShapeName=item.dictLabel
  138. }
  139. })
  140. }
  141. },
  142. //使用记录
  143. async getList(){
  144. let self = this;
  145. const {data} = await useRecordByCode({tagCode:this.tagCode});
  146. if(data.code==200){
  147. this.dataList=data.data
  148. }
  149. },
  150. //申领记录
  151. async getList2(){
  152. let self = this;
  153. const {data} = await applyByCode({tagCode:this.tagCode});
  154. if(data.code==200){
  155. this.dataList=data.data
  156. this.nickName=data.data[0].data[0].nickName
  157. }
  158. },
  159. //关闭弹窗
  160. dialogOutfire() {
  161. this.dialogVisible = !this.dialogVisible
  162. },
  163. //提交
  164. async submitForm(){
  165. let _this = this;
  166. const {data} = await checkClapRectify(_this.form);
  167. if(data.code == 200){
  168. uni.showToast({
  169. title: '提交成功',
  170. icon:"none",
  171. mask:true,
  172. duration: 2000
  173. });
  174. uni.redirectTo({
  175. url: '/pages_safetyExamine/snapshotManage/snapshotList?pageType='+this.pageType
  176. });
  177. }
  178. },
  179. }
  180. }
  181. </script>
  182. <style lang="stylus" scoped>
  183. .course{
  184. height:100%;
  185. display flex;
  186. box-sizing: border-box;
  187. .info-max-box{
  188. flex: 1;
  189. overflow: scroll;
  190. }
  191. .header{
  192. width: 750rpx;
  193. min-height: 275rpx;
  194. background: #0096F3;
  195. display: flex;
  196. justify-content: flex-start;
  197. .header_l{
  198. width: 150rpx;
  199. height: 150rpx;
  200. background: #FFFFFF;
  201. border-radius: 75rpx;
  202. margin:62rpx 40rpx 0 30rpx;
  203. >img{
  204. width: 150rpx;
  205. height: 150rpx;
  206. }
  207. }
  208. .header_r{
  209. flex: 1;
  210. .header_r_t{
  211. font-size: 34rpx;
  212. font-family: PingFang SC-Bold, PingFang SC;
  213. font-weight: 400;
  214. color: #FFFFFF;
  215. line-height: 48rpx;
  216. margin-top: 52rpx;
  217. }
  218. .header_r_b{
  219. font-size: 30rpx;
  220. font-family: PingFang SC-Medium, PingFang SC;
  221. font-weight: 400;
  222. color: #FFFFFF;
  223. line-height: 42rpx;
  224. margin-top: 24rpx;
  225. }
  226. .header_r_b2{
  227. font-size: 30rpx;
  228. font-family: PingFang SC-Medium, PingFang SC;
  229. font-weight: 400;
  230. color: #FFFFFF;
  231. line-height: 42rpx;
  232. margin-top: 24rpx;
  233. margin-bottom: 20rpx;
  234. display: flex;
  235. justify-content: space-between;
  236. .risk{
  237. width: 180rpx;
  238. height: 50rpx;
  239. border-radius: 80rpx;
  240. opacity: 1;
  241. border: 1rpx solid #FF0000;
  242. font-size: 28rpx;
  243. font-family: PingFang SC-Medium, PingFang SC;
  244. font-weight: 400;
  245. color: #FF0000;
  246. line-height: 50rpx;
  247. text-align: center;
  248. margin-right: 24rpx;
  249. }
  250. .ordinary{
  251. width: 180rpx;
  252. height: 50rpx;
  253. border-radius: 80rpx;
  254. opacity: 1;
  255. border: 1rpx solid #2BCB1D;
  256. font-size: 28rpx;
  257. font-family: PingFang SC-Medium, PingFang SC;
  258. font-weight: 400;
  259. color: #2BCB1D;
  260. line-height: 50rpx;
  261. text-align: center;
  262. margin-right: 24rpx;
  263. }
  264. }
  265. }
  266. }
  267. .tabTitle{
  268. width:100%;
  269. height: 100rpx;
  270. background: #fff;
  271. display flex;
  272. justify-content: flex-start;
  273. align-items: center;
  274. margin-bottom:20rpx;
  275. padding: 0 30rpx;
  276. box-sizing: border-box;
  277. .tabTitle_li{
  278. position: relative;
  279. width:120rpx;
  280. text-align center;
  281. margin-right: 48rpx;
  282. .tabTitle_text{
  283. display: inline-block;
  284. font-size: 30rpx;
  285. font-family: PingFang SC;
  286. font-weight: 500;
  287. color: #333333;
  288. line-height: 46rpx;
  289. position: relative;
  290. >text{
  291. position:absolute;
  292. min-width: 30rpx;
  293. min-height: 30rpx;
  294. border-radius:54%;
  295. background: #E80000;
  296. font-size: 18rpx;
  297. font-family: PingFang SC-Medium, PingFang SC;
  298. font-weight: 400;
  299. color: #FFFFFF;
  300. text-align: center;
  301. line-height: 30rpx;
  302. margin-left: 6rpx;
  303. padding:2rpx;
  304. box-sizing: border-box;
  305. }
  306. &.on{
  307. color:#0183FA;
  308. }
  309. }
  310. .tabTitle_across{
  311. width: 50rpx;
  312. height: 4rpx;
  313. background: #0183FA;
  314. border-radius: 2rpx;
  315. margin-left 30rpx;
  316. display none;
  317. &.on{
  318. display block;
  319. }
  320. }
  321. }
  322. }
  323. .list{
  324. width: 750rpx;
  325. height: auto;
  326. background: #FFFFFF;
  327. margin-top:20rpx;
  328. padding: 0 30rpx;
  329. box-sizing: border-box;
  330. .list_li{
  331. border-bottom: 1rpx solid #D8D8D8;
  332. display: flex;
  333. justify-content: space-between;
  334. >text:nth-of-type(1){
  335. font-size: 28rpx;
  336. font-family: PingFang SC-Medium, PingFang SC;
  337. font-weight: 400;
  338. color: #666666;
  339. line-height: 80rpx;
  340. }
  341. >text:nth-of-type(2){
  342. flex:1;
  343. font-size: 28rpx;
  344. font-family: PingFang SC-Medium, PingFang SC;
  345. font-weight: 400;
  346. color: #333333;
  347. line-height: 80rpx;
  348. text-align: right;
  349. overflow: hidden;//溢出隐藏
  350. text-overflow: ellipsis;//省略号
  351. white-space: nowrap;//强制文本不换行
  352. }
  353. }
  354. .list_li:last-child{
  355. border-bottom: none;
  356. }
  357. }
  358. .list_tow{
  359. .list_tow_t{
  360. display: flex;
  361. justify-content: space-between;
  362. padding: 0 30rpx;
  363. box-sizing: border-box;
  364. >text:nth-of-type(1){
  365. height: 80rpx;
  366. font-size: 30rpx;
  367. font-family: PingFang SC-Medium, PingFang SC;
  368. font-weight: 400;
  369. color: #666666;
  370. line-height: 80rpx;
  371. }
  372. >text:nth-of-type(2){
  373. height: 80rpx;
  374. font-size: 30rpx;
  375. font-family: PingFang SC-Medium, PingFang SC;
  376. font-weight: 400;
  377. color: #333333;
  378. line-height: 80rpx;
  379. box-sizing: border-box;
  380. }
  381. }
  382. .list_tow_li{
  383. width: 690rpx;
  384. height:auto;
  385. background: #FFFFFF;
  386. border-radius: 10rpx;
  387. padding-bottom: 52rpx;
  388. box-sizing: border-box;
  389. margin: 0 30rpx 20rpx;
  390. .list_tow_li_t{
  391. position: relative;
  392. min-height: 110rpx;
  393. display: flex;
  394. justify-content: space-between;
  395. align-items: center;
  396. .list_tow_li_t_l{
  397. position: absolute;
  398. left:-15rpx;
  399. top: 76rpx;
  400. width: 30rpx;
  401. height: 30rpx;
  402. background:#F5F5F5;
  403. border-radius: 15rpx;
  404. }
  405. .list_tow_li_t_c{
  406. min-height: 40rpx;
  407. font-size: 30rpx;
  408. font-family: PingFang SC-Medium, PingFang SC;
  409. font-weight: 400;
  410. line-height: 36rpx;
  411. margin-left: 30rpx;
  412. margin-right: 20rpx;
  413. border-radius: 20rpx;
  414. padding: 20rpx 20rpx;
  415. box-sizing: border-box;
  416. }
  417. .list_tow_li_t_c2{
  418. width: 130rpx;
  419. height: 50rpx;
  420. background: rgba(31,165,13,0.2);
  421. border-radius: 80rpx 80rpx 80rpx 80rpx;
  422. font-size: 28rpx;
  423. font-family: PingFang SC-Medium, PingFang SC;
  424. font-weight: 400;
  425. color: #1FA50D;
  426. line-height: 50rpx;
  427. text-align: center;
  428. margin-right: 34rpx;
  429. }
  430. .list_tow_li_t_r{
  431. position: absolute;
  432. right:-15rpx;
  433. top: 76rpx;
  434. width: 30rpx;
  435. height: 30rpx;
  436. background:#F5F5F5;
  437. border-radius: 15rpx;
  438. }
  439. }
  440. .list_tow_li_b{
  441. height:auto;
  442. border-top:1px dotted #D8D8D8;
  443. margin:0 30rpx;
  444. padding-top:14rpx;
  445. box-sizing: border-box;
  446. .list_tow_li_b_li{
  447. display: flex;
  448. justify-content: space-between;
  449. >text:nth-of-type(1){
  450. font-size: 28rpx;
  451. font-family: PingFang SC-Medium, PingFang SC;
  452. font-weight: 400;
  453. color: #666666;
  454. line-height: 74rpx;
  455. }
  456. >text:nth-of-type(2){
  457. font-size: 28rpx;
  458. font-family: PingFang SC-Medium, PingFang SC;
  459. font-weight: 400;
  460. color: #333333;
  461. line-height: 74rpx;
  462. }
  463. }
  464. }
  465. }
  466. }
  467. .tip{
  468. font-size: 26rpx;
  469. font-family: PingFang SC-Medium, PingFang SC;
  470. font-weight: 400;
  471. color: #999999;
  472. line-height: 37rpx;
  473. text-align: center;
  474. margin-top: 42rpx;
  475. }
  476. }
  477. </style>