123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- <!--库存列表-->
- <template>
- <view id="gasRecycle">
- <view class="top-picker-max-box">
- <view class="top-picker-box">
- <picker @change="facultyChange" :value="facultyIndex" :range="facultyArray">
- <view class="picker-view">
- <view>{{!facultyIndex?'学院':facultyArray[facultyIndex]}}</view>
- <img class="picker-img" src="@/pages_manage/images/icon_06.png" alt="">
- </view>
- </picker>
- </view>
- <view class="top-picker-box">
- <picker mode="date" @change="startChange($event)">
- <view class="picker-view">
- <view>{{!getData.startTime?'开始时间':getData.startTime}}</view>
- <img class="picker-img" src="@/pages_manage/images/icon_06.png" alt="">
- </view>
- </picker>
- </view>
- <view class="top-picker-box">
- <picker mode="date" @change="endChange($event)">
- <view class="picker-view">
- <view>{{!getData.endTime?'结束时间':getData.endTime}}</view>
- <img class="picker-img" src="@/pages_manage/images/icon_06.png" alt="">
- </view>
- </picker>
- </view>
- </view>
- <view class="search">
- <view class="search_t">
- <view class="search_n">
- <input v-model="getData.searchValue" type="text" placeholder="实验室名称/房间号">
- <img @click="searchBtn()" class="icon_img" src="@/pages_manage/images/icon_aqjc_ss.png"/>
- </view>
- </view>
- </view>
- <scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
- <view class="for-big-box" v-for="(item,index) in dataList" :key="index">
- <view class="for-time-p">{{item.gasName}}-{{item.levelName}}({{item.sizeName}})</view>
- <img class="for-back-img" src="@/pages_manage/images/Version2.2/for_min_bg.png">
- <view class="for-box" @click="goInfo(item)">
- <view class="for-box_t">使用量:{{item.usageAmount==null?'-':item.usageAmount}}Mpa</view>
- <view class="for-box_b">
- <img class="for-back-img" src="@/pages_manage/images/Version3.0/icon_qpgl_syl.png">
- <text>使用人: {{item.operator==null?'':item.operator}}</text>
- <img class="for-back-img" src="@/pages_manage/images/Version2.2/icon_wtzg_sj.png">
- <text>使用时间: {{item.startTime==null?'-':item.startTime}} - {{item.endTime==null?'-':item.endTime}}</text>
- </view>
- </view>
- </view>
- <view class="get-null-box" v-if="total==0">暂无更多数据</view>
- </scroll-view>
- <view class="sub_btn" @click="subBtn()">新增入库</view>
- </view>
- </template>
- <script>
- import { gasList,listDepartments,airbottleUsageRecordList } from '@/api/index.js'
- export default {
- name: "gasRecycle",
- data() {
- return {
- pageType:0,
- //列表请求参数
- getData:{
- pageNum:1,
- pageSize:20,
- collegeId:'',
- startTime:'',
- endTime:'',
- searchValue:'',
- },
- userType:uni.getStorageSync('userType'),
- gasBottleLevel:uni.getStorageSync('gasBottleLevel'),// 气瓶级别
- gasBottleSpecification:uni.getStorageSync('gasBottleSpecification'), // 气瓶规格
- dataList:[],
- noData:false,
- total:0,
- //院系选择器数据
- facultyList:[],
- facultyArray:[],
- facultyIndex:"",
- }
- },
- onLoad() {
-
- },
- onShow() {
- },
- mounted(){
- this.getList();
- this.listDepartments();
- },
- methods: {
- goInfo(d){
- uni.navigateTo({
- url:'/pages_manage/gasList/gasListDetail?id='+d.id
- });
- },
- //获取院系
- async listDepartments(){
- const {data} = await listDepartments();
- if(data.code == 200){
- let list = [];
- for(let i=0;i<data.data.length;i++){
- list.push(data.data[i].deptName)
- }
- this.facultyArray = list;
- list.unshift('全部院系');
- this.facultyList = data.data;
- this.facultyList.unshift({deptName:"全部院系", deptId:""})
- }
- },
- //学院选中
- facultyChange: function(e) {
- if(this.facultyArray[0]){
- this.facultyIndex = parseInt(e.target.value);
- this.getData.collegeId=this.facultyList[e.target.value].deptId;
- this.getList()
- }
- },
- //开始时间选中事件
- startChange(e){
- if(new Date(e.target.value).getTime()>=new Date(this.getData.endTime).getTime()){
- uni.showToast({
- title: '结束时间不能小于开始时间',
- icon:"none",
- mask:true,
- duration: 2000
- });
- }else{
- this.$set(this.getData,'startTime',e.target.value);
- }
- },
- //结束时间选中事件
- endChange(e){
- if(new Date(this.getData.startTime).getTime()>=new Date(e.target.value).getTime()){
- uni.showToast({
- title: '结束时间不能小于开始时间',
- icon:"none",
- mask:true,
- duration: 2000
- });
- }else{
- this.$set(this.getData,'endTime',e.target.value);
- this.getList()
- }
- },
- //实验室房间号搜索
- searchBtn(){
-
- },
- //新增入库
- subBtn(){
- uni.redirectTo({
- url:'/pages_student/useGasApply/useGasApplyAdd?status=0'
- });
- },
- //滚动加载事件
- scrollGet(){
- let self=this;
- if(self.total/self.getData.pageSize<=self.getData.pageNum){
- console.log('没有更多数据!')
- }else{
- setTimeout(function(){
- self.getData.pageNum += 1;
- self.getList();
- },1000)
-
- }
- },
- //获取列表数据
- async getList(){
- let _this = this;
- const {data} = await airbottleUsageRecordList(_this.getData);
- if(data.code==200){
- for(let i=0;i<data.data.records.length;i++){
- for(let b=0;b<this.gasBottleSpecification.length;b++){
- if(this.gasBottleSpecification[b].dictValue==data.data.records[i].size){
- data.data.records[i].sizeName=this.gasBottleSpecification[b].dictLabel
- }
- }
- for(let t=0;t<this.gasBottleLevel.length;t++){
- if(this.gasBottleLevel[t].dictValue==data.data.records[i].level){
- data.data.records[i].levelName=this.gasBottleLevel[t].dictLabel
- }
- }
-
- }
- let res = data.data.records;
- this.total=data.data.total;
- if(res && res.length>0){
- if(_this.getData.pageNum==1){
- _this.dataList=res;
- }else{
- _this.dataList=_this.dataList.concat(res);
- }
- }else{
- _this.noData=true;
- }
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- #gasRecycle {
- height: 100%;
- width: 100%;
- flex :1;
- display flex;
- flex-direction column
- overflow hidden;
- .top-picker-max-box{
- display:flex;
- padding:0 20rpx;
- background #fff
- border-bottom:1rpx solid #E0E0E0;
- .top-picker-box{
- line-height:80rpx;
- height:80rpx;
- .picker-view{
- display flex
- view{
- display:block;
- overflow:hidden;
- text-overflow:ellipsis;
- white-space:nowrap;
- font-size:28rpx;
- }
- .picker-img{
- width:24rpx;
- height:13rpx;
- margin-top:36rpx;
- margin-left:13rpx;
- }
- }
- }
- .top-picker-box:nth-child(1){
- text-align left
- width:320rpx;
- .picker-view{
- view{
- max-width:260rpx;
- }
- }
- }
- .top-picker-box:nth-child(2){
- text-align left
- width:215rpx;
- .picker-view{
- view{
- max-width:156rpx;
- }
- }
- }
- .top-picker-box:nth-child(3){
- text-align right
- width:195rpx;
- .picker-view{
- view{
- flex:1;
-
- }
- }
- }
- }
- /* 搜索 */
- .search{
- .search_t{
- background: #FFFFFF;
- padding: 20rpx;
- box-sizing: border-box;
- .search_n{
- width: 710rpx;
- height: 80rpx;
- border: 1px solid #E0E0E0;
- border-radius: 40rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding:0 40rpx;
- box-sizing: border-box;
- >input{
- width: 640rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #CCCCCC;
- line-height: 30rpx;
- }
- >img{
- width: 30rpx;
- height: 30rpx;
- }
- }
- }
- .search_b{
- display: flex;
- justify-content: center;
- align-items: center;
- margin: 20rpx 0;
- >text{
- display: inline-block;
- width: 200rpx;
- height: 60rpx;
- background: #FFFFFF;
- border-radius: 30rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 60rpx;
- text-align: center;
- margin-right: 20rpx;
- }
- }
- }
-
- .scroll-box{
- // flex:1;
- overflow-y scroll;
- margin-top: 20rpx;
- .for-big-box:last-child{
- margin-bottom:180rpx;
- }
- .for-big-box{
- margin:0 20rpx 20rpx;
- overflow hidden
- border-bottom-left-radius :20rpx;
- border-bottom-right-radius :20rpx;
- .for-time-p{
- background #fff
- line-height:87rpx;
- font-size:30rpx;
- padding:0 22rpx;
- border-top-left-radius:20rpx;
- border-top-right-radius:20rpx;
- }
- .for-back-img{
- height:30rpx;
- width:710rpx;
- }
- .for-box{
- overflow hidden;
- background: #fff;
- padding: 0 20rpx;
- box-sizing: border-box;
- .for-box_t{
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 28rpx;
- margin: 28rpx 0 40rpx 0;
- }
- .for-box_b{
- display: flex;
- >img{
- width: 28rpx;
- height: 28rpx;
- margin-right: 10rpx;
- }
- >text{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 26rpx;
- margin-bottom: 20rpx;
- }
- >text:nth-of-type(1){
- width: 190rpx;
- }
- }
- }
- }
- /*暂无数据*/
- .get-null-box{
- height:100rpx;
- line-height:100rpx;
- color:#999;
- text-align center
- }
- }
- /* 按钮 */
- .sub_btn{
- width: 650rpx;
- height: 100rpx;
- background: #0183FA;
- border-radius: 20rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 100rpx;
- text-align: center;
- margin-left: 50rpx;
- position: fixed;
- bottom:30rpx;
- z-index: 1000;
- }
- }
- </style>
|