123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557 |
- <!-- 化学品信息(扫码进入) -->
- <template>
- <view id="chemicalsInfo">
- <view class="info-data-box">
- <img class="logo-img" :src="circularLogo">
- <view class="title-box">
- <view class="title-one-box">
- <span>{{newData.chemicalName}}</span>
- <span class="color-border">{{newData.chemicalLevel == 1?'管控':'非管控'}}</span>
- <span :class="newData.useStatus == 0 || newData.useStatus == -1?'colorA':(
- newData.useStatus == 1 || newData.useStatus == 5?'colorB':(
- newData.useStatus == 2 ?'colorC':(
- newData.useStatus == 3 ?'colorD':(
- newData.useStatus == 4 ?'colorE':''))))">
- {{newData.useStatus == 0 || newData.useStatus == -1?'未使用':(
- newData.useStatus==1 || newData.useStatus==5?'使用中':(
- newData.useStatus==2?'超时未归还':(
- newData.useStatus==3?'空瓶出库':(
- newData.useStatus==4?'废弃出库':''))))}}
- </span>
- </view>
- <view class="title-two-box">编号:{{newData.tagCode}}</view>
- <view class="title-three-box">余量:{{newData.surplus}}{{newData.specUnit}}</view>
- </view>
- </view>
- <view class="table-button-max-box">
- <view class="table-button-box" @click='tableButtonCheck(1)'
- :class="pageType==1?'checkClass':''">
- <view>基本信息</view>
- <view></view>
- </view>
- <view class="table-button-box" @click='tableButtonCheck(2)'
- :class="pageType==2?'checkClass':''">
- <view>使用记录</view>
- <view></view>
- </view>
- </view>
- <!-- 基础信息 -->
- <view class="info-max-big-box" v-if="pageType == 1">
- <view class="info-big-box">
- <view class="info-box">
- <view>C A S</view>
- <view>:</view>
- <view>{{newData.casNum}}</view>
- </view>
- <view class="info-box">
- <view>别名</view>
- <view>:</view>
- <view>{{newData.chemicalNameChar}}</view>
- </view>
- <view class="info-box">
- <view>类别</view>
- <view>:</view>
- <view>{{newData.chemicalCategory}}</view>
- </view>
- <view class="info-box">
- <view>规格</view>
- <view>:</view>
- <view>{{newData.specNum}}{{newData.specUnit?newData.specUnit+'/瓶':''}}</view>
- </view>
- <view class="info-box">
- <view>归属人</view>
- <view>:</view>
- <view>{{newData.belongName}}</view>
- </view>
- <view class="info-box">
- <view style="width:120rpx;">存储位置</view>
- <view>:</view>
- <view>{{newData.cabinetName}}{{newData.doorName?' - '+newData.doorName:''}}{{newData.layers?' - '+newData.layers:''}}</view>
- </view>
- </view>
- <view class="info-big-box">
- <view class="info-box">
- <view>学院</view>
- <view>:</view>
- <view>{{newData.deptName}}</view>
- </view>
- <view class="info-box">
- <view>楼栋</view>
- <view>:</view>
- <view>{{newData.schoolName}} - {{newData.buildName}}</view>
- </view>
- <view class="info-box">
- <view>实验室</view>
- <view>:</view>
- <view>{{newData.subName}}{{newData.subRoom?'('+newData.subRoom+')':''}}</view>
- </view>
- </view>
- </view>
- <!-- 使用记录 -->
- <scroll-view class="info-list-box" v-if="pageType == 2" scroll-y @scrolltolower="scrollGet">
- <view class="for-max-big-box" v-for="(item,index) in dataList" :key="index">
- <view class="for-title-box">
- <view class="time-box">{{item.joinOutTime}}</view>
- <view class="position-top-right"
- :class="item.type == 0?'colorF':(
- item.type == 1?'colorD':(
- item.type == 3?'colorD':(
- item.type == 4?'colorE':(
- item.type == 5?'colorD':(
- item.type == 6?'colorG':'')))))">
- {{item.type == 0?'归还':(
- item.type == 1?'领用':(
- item.type == 3?'空瓶出库':(
- item.type == 4?'废弃出库':(
- item.type == 5?'整瓶领用':(
- item.type == 6?'存储':'')))))}}
- </view>
- <view class="border-box"></view>
- <view class="position-left"></view>
- <view class="position-right"></view>
- </view>
- <!-- 领用/整瓶领用 -->
- <view class="for-info-box" v-if="item.type == 1 || item.type == 5">
- <view class="for-info-min-box">
- <view>领用人</view>
- <view>:</view>
- <view>{{item.useName}}</view>
- </view>
- <view class="for-info-min-box">
- <view>领用量</view>
- <view>:</view>
- <view>{{item.collectStockNum}}</view>
- </view>
- <view class="for-info-min-box">
- <view style="width:120rpx;">双人认证</view>
- <view>:</view>
- <view>{{item.oneUserName}}</view>
- </view>
- </view>
- <!-- 存储 -->
- <view class="for-info-box" v-if="item.type == 6">
- <view class="for-info-min-box">
- <view>存储人</view>
- <view>:</view>
- <view>{{item.useName}}</view>
- </view>
- <view class="for-info-min-box">
- <view>余量</view>
- <view>:</view>
- <view>{{item.surplus}}</view>
- </view>
- <view class="for-info-min-box">
- <view style="width:120rpx;">双人认证</view>
- <view>:</view>
- <view>{{item.oneUserName}}</view>
- </view>
- </view>
- <!-- 废弃出库/空瓶出库 -->
- <view class="for-info-box" v-if="item.type == 3 ||item.type == 4">
- <view class="for-info-min-box">
- <view>废弃人</view>
- <view>:</view>
- <view>{{item.useName}}</view>
- </view>
- <view class="for-info-min-box">
- <view style="width:120rpx;">双人认证</view>
- <view>:</view>
- <view>{{item.oneUserName}}</view>
- </view>
- <view class="for-info-min-box">
- <view style="width:120rpx;">出库原因</view>
- <view>:</view>
- <view>{{item.reason}}</view>
- </view>
- </view>
- <!-- 归还 -->
- <view class="for-info-box" v-if="item.type == 0">
- <view class="for-info-min-box">
- <view>归还人</view>
- <view>:</view>
- <view>{{item.useName}}</view>
- </view>
- <view class="for-info-min-box">
- <view>使用量</view>
- <view>:</view>
- <view>{{item.usages}}</view>
- </view>
- <view class="for-info-min-box">
- <view>余量</view>
- <view>:</view>
- <view>{{item.surplus}}</view>
- </view>
- <view class="for-info-min-box">
- <view style="width:120rpx;">双人认证</view>
- <view>:</view>
- <view>{{item.oneUserName}}</view>
- </view>
- </view>
- </view>
- <view class="null-box" v-if="!dataList[0]">
- <img :src="imagesUrl('commonality/chemicalsInfoNull.png')">
- <view>暂无数据</view>
- </view>
- <view class="get-null-box" v-if="getDataType">仅展示最近三个月使用记录</view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- chemicalAppletSelectStockRecord,
- } from '@/pages_basics/api/index.js'
- export default {
- data() {
- return {
- circularLogo: uni.getStorageSync('circularLogo'),
- newData:{},
- pageType:1,
- //使用记录 相关
- queryParams: {
- page: 1,
- pageSize: 10,
- },
- total: 0,
- dataList: [],
- getDataType: false,
- }
- },
- onLoad(option) {
- if(option.item){
- let obj = JSON.parse(decodeURIComponent(option.item))
- this.$set(this,'newData',obj);
- }
- },
- onShow() {
- this.getList();
- },
- methods: {
- tableButtonCheck(type){
- if(this.pageType != type){
- this.$set(this,'pageType',type);
- }
- },
- //滚动事件
- scrollGet() {
- let self = this;
- if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- } else {
- this.queryParams.page += 1;
- this.$nextTick(() => {
- this.getList();
- })
- }
- },
- async getList(){
- let self = this;
- let obj = JSON.parse(JSON.stringify(this.queryParams))
- obj.tagCode = this.newData.code;
- const {
- data
- } = await chemicalAppletSelectStockRecord(obj);
- if (data.code == 200) {
- if (self.queryParams.page == 1) {
- this.$set(this,'dataList',data.data.records);
- this.$set(this,'total',data.data.total);
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- } else {
- this.$set(this,'dataList',[...this.dataList, ...data.data.records]);
- this.$set(this,'total',data.data.total);
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }
- }
- },
- },
- }
- </script>
- <style lang="stylus" scoped>
- #chemicalsInfo {
- height: 100%;
- display flex;
- flex-direction: column;
- .info-data-box{
- display: flex;
- background-color: #fff;
- padding-bottom:40rpx;
- .logo-img{
- width:120rpx;
- height:120rpx;
- display: inline-block;
- margin:40rpx 40rpx 0 30rpx;
- }
- .title-box{
- flex:1;
- .title-one-box{
- margin:28rpx 47rpx 0 0;
- span:nth-child(1){
- font-size:30rpx;
- color:#333;
- line-height:45rpx;
- font-size:30rpx;
- font-weight:700;
- }
- span:nth-child(2){
- display: inline-block;
- min-width:100rpx;
- height:34rpx;
- line-height:32rpx;
- font-size:24rpx;
- margin:0 10rpx 0;
- text-align: center;
- border-radius:6rpx;
- }
- span:nth-child(3){
- display: inline-block;
- min-width:120rpx;
- height:34rpx;
- line-height:32rpx;
- font-size:24rpx;
- margin:0 10rpx 0;
- text-align: center;
- border-radius:6rpx;
- }
- }
- .title-two-box{
- line-height:50rpx;
- font-size:28rpx;
- margin-top:10rpx;
- }
- .title-three-box{
- line-height:50rpx;
- font-size:28rpx;
- }
- }
- }
- .table-button-max-box{
- display: flex;
- height:100rpx;
- .table-button-box{
- height:75rpx;
- width:120rpx;
- margin:25rpx 30rpx 0 30rpx;
- view:nth-child(1){
- font-size:30rpx;
- line-height:50rpx;
- height:50rpx;
- }
- }
- .checkClass{
- view:nth-child(1){
- color:#0183FA;
- }
- view:nth-child(2){
- height:4rpx;
- width:90rpx;
- margin:0 15rpx;
- background-color:#0183FA;
- }
- }
- }
- .info-max-big-box{
- margin:0 30rpx 0;
- .info-big-box{
- background-color:#fff;
- margin-bottom:20rpx;
- border-radius:20rpx;
- .info-box:nth-child(1){
- border-top:none;
- }
- .info-box{
- display: flex;
- border-top:1rpx solid #E0E0E0;
- margin:0 30rpx;
- view{
- line-height:80rpx;
- font-size:28rpx;
- color:#333;
- }
- view:nth-child(1){
- width:90rpx;
- text-align: justify;
- word-break: break-all;
- text-align-last: justify;
- }
- view:nth-child(2){
- margin-left:5rpx;
- }
- view:nth-child(3){
- flex:1;
- text-align: right;
- line-height:30rpx;
- padding:25rpx 0 25rpx 25rpx;
- }
- }
- }
- }
- .info-list-box{
- flex: 1;
- overflow: scroll;
- .for-max-big-box{
- background-color: #fff;
- margin:0 30rpx 20rpx 30rpx;
- border-radius:10rpx;
- .for-title-box{
- height:118rpx;
- position: relative;
- overflow: hidden;
- .time-box{
- height:100rpx;
- line-height:93rpx;
- font-size:28rpx;
- color:#333;
- padding-left:30rpx;
- }
- .position-top-right{
- position: absolute;
- top:0;
- right:0;
- width:100rpx;
- height:36rpx;
- line-height:36rpx;
- font-size:24rpx;
- text-align: center;
- border-radius: 0rpx 10rpx 0rpx 6rpx;
- }
- .colorA{
- color:#0183FA;
- background: rgba(1,131,250,0.2);
- }
- .colorB{
- color:#07BC11;
- background: rgba(7,188,17,0.2);
- }
- .border-box{
- border-top:1rpx dashed #F5F5F5;
- height:18rpx;
- }
- .position-left{
- width:30rpx;
- height:30rpx;
- z-index:1;
- position:absolute;
- bottom:3rpx;
- left:-15rpx;
- background-color: #F5F5F5;
- border-radius:50%;
- }
- .position-right{
- width:30rpx;
- height:30rpx;
- z-index:1;
- position:absolute;
- bottom:3rpx;
- right:-15rpx;
- background-color: #F5F5F5;
- border-radius:50%;
-
- }
- }
- .for-info-box{
- .for-info-min-box{
- display: flex;
- padding:0 30rpx;
- view{
- line-height:80rpx;
- font-size:28rpx;
- color:#333;
- }
- view:nth-child(1){
- width:90rpx;
- text-align: justify;
- word-break: break-all;
- text-align-last: justify;
- }
- view:nth-child(2){
- margin-left:5rpx;
- }
- view:nth-child(3){
- flex:1;
- text-align: right
- line-height:30rpx;
- padding:25rpx 0 25rpx 25rpx;
- }
- }
- }
- }
- .null-box{
- img{
- width:300rpx;
- height:300rpx;
- margin:150rpx 225rpx 0;
- display: inline-block;
- }
- view{
- color:#999;
- font-size:28rpx;
- line-height:40rpx;
- text-align: center;
- margin-top:15rpx;
- }
- }
- .get-null-box {
- height: 100rpx;
- line-height: 100rpx;
- color: #999;
- text-align center
- padding-bottom:200rpx;
- }
- }
- //管控/非管控
- .color-border{
- border:1px solid #0183FA;
- background: #fff;
- color:#0183FA;
- }
- //未使用
- .colorA{
- border:1px solid #EDEDED;
- background: #EDEDED;
- color:#999;
- }
- //使用中
- .colorB{
- border:1px solid rgba(1,131,250,0.2);
- background: rgba(1,131,250,0.2);
- color:#0183FA;
- }
- //超时未归还
- .colorC{
- border:1px solid rgba(255,140,0,0.2);
- background: rgba(255,140,0,0.2);
- color:#FF8C00;
- }
- //空瓶出库
- .colorD{
- border:1px solid rgba(43,128,255,0.2);
- background: rgba(43,128,255,0.2);
- color:#2B80FF;
- }
- //废弃出库
- .colorE{
- border:1px solid #D6D6D6;
- background: #D6D6D6;
- color:#666666;
- }
- //归还
- .colorF{
- border:1px solid rgba(7,188,17,0.2);
- background: rgba(7,188,17,0.2);
- color:#07BC11;
- }
- //存储
- .colorG{
- border:1px solid rgba(0,185,191,0.2);
- background: rgba(0,185,191,0.2);
- color:#00B9BF;
- }
- }
- </style>
|