Browse Source

删除无用引入

master
zq 1 month ago
parent
commit
2315183322
  1. 218
      pages/home/index.vue

218
pages/home/index.vue

@ -1,80 +1,72 @@
<template>
<!-- <view style="height:100vh">
<Mescroll @resultEvent="getList" ref="scroll" rqurl="/api/getlist">
<template v-slot:list> -->
<view class="home-wrap">
<view class="amountWrap flex">
<view class="amountLeft flex">
<view class="amountName">库存件数</view>
<view class="remain">{{ storage_count || 0 }}</view>
</view>
<view class="amountRight flex">
<view class="amountName">出库件数</view>
<view class="outbound">{{ delivery_count || 0 }}</view>
</view>
</view>
<view class="patientTab">
<view :class="'notActive ft32' + (status == '1' ? ' active PfScMedium' : '')"
@click="changeWaitType('1')">
库存列表</view>
<view :class="'notActive ft32' + (status == '2' ? ' active PfScMedium' : '')"
@click="changeWaitType('2')">
出库列表
<view class="home-wrap">
<view class="amountWrap flex">
<view class="amountLeft flex">
<view class="amountName">库存件数</view>
<view class="remain">{{ storage_count || 0 }}</view>
</view>
<view class="amountRight flex">
<view class="amountName">出库件数</view>
<view class="outbound">{{ delivery_count || 0 }}</view>
</view>
</view>
<view class="patientTab">
<view :class="'notActive ft32' + (status == '1' ? ' active PfScMedium' : '')" @click="changeWaitType('1')">
库存列表</view>
<view :class="'notActive ft32' + (status == '2' ? ' active PfScMedium' : '')" @click="changeWaitType('2')">
出库列表
</view>
</view>
<!-- <view class="patient-type-tab1"> -->
<scroll-view class="patient-type-tab1" @scrolltolower="onScroll" scroll-y>
<view class="bed-wait-container">
<view class="bed-wait-list">
<view class="bed-wait-item" v-for="(item, index) in bedWaitList" :key="index"
@click="lookDetail(item)">
<view class="bed-wait-info">
<view class="bed-wait-name PfScMedium">{{ item.coin_name }}</view>
<view class="bed-sex">{{ item.year }}</view>
<view :class="'bed-desc'">
{{ item.rating_code }}
</view>
</view>
</view>
<!-- <view class="patient-type-tab1"> -->
<scroll-view class="patient-type-tab1" @scrolltolower="onScroll" scroll-y>
<view class="bed-wait-container">
<view class="bed-wait-list">
<view class="bed-wait-item" v-for="(item, index) in bedWaitList" :key="index"
@click="lookDetail(item)">
<view class="bed-wait-info">
<view class="bed-wait-name PfScMedium">{{ item.coin_name }}</view>
<view class="bed-sex">{{ item.year }}</view>
<view :class="'bed-desc'">
{{ item.rating_code }}
</view>
</view>
<view class="bed-wait-time flex-between">
<view class="bed-visit-time">{{ item.operate_time }}</view>
<view class="bed-checkin-time">{{ item.rating_department }}</view>
</view>
</view>
</view>
</view>
<view v-if="loading" class="loading-text">加载中...</view>
<view v-if="noMore" class="no-more-text">没有更多数据了</view>
<view class="page-padding" v-show="bedWaitList && bedWaitList.length && bedWaitList.length > 0">
</view>
</scroll-view>
<!-- </view> -->
<view class="bed-wait-time flex-between">
<view class="bed-visit-time">{{ item.operate_time }}</view>
<view class="bed-checkin-time">{{ item.rating_department }}</view>
</view>
<view class="qrcode_wrap">
<img :src="cssUrl + 'qrcode_get.png'" alt="" @click="scanQrcode">
</view>
<!-- <button @click="scanQrcode">哈哈哈</button> -->
<PopUpCommon ref="coinsPopup" :showClose="true" zIndex="top">
<view class="popWrap">
<view class="pop-title PfScMedium">{{ titleType[scanCodeDetail.ancient_coin_status] }}</view>
<view class="content">
<CoinsDetail :scanCodeDetail="scanCodeDetail" />
</view>
<PageBottomBtn :text="btnText[scanCodeDetail.ancient_coin_status]" cancelTxt="取消" @click="onConfirm"
@cancelClick="onCancel" :show-cancel="true" />
</view>
</PopUpCommon>
</view>
<!-- </template>
</Mescroll>
</view> -->
</view>
<view v-if="loading" class="loading-text">加载中...</view>
<view v-if="noMore" class="no-more-text">没有更多数据了</view>
<view class="page-padding" v-show="bedWaitList && bedWaitList.length && bedWaitList.length > 0">
</view>
</scroll-view>
<!-- </view> -->
<view class="qrcode_wrap">
<img :src="cssUrl + 'qrcode_get.png'" alt="" @click="scanQrcode">
</view>
<!-- <button @click="scanQrcode">哈哈哈</button> -->
<PopUpCommon ref="coinsPopup" :showClose="true" zIndex="top">
<view class="popWrap">
<view class="pop-title PfScMedium">{{ titleType[scanCodeDetail.ancient_coin_status] }}</view>
<view class="content">
<CoinsDetail :scanCodeDetail="scanCodeDetail" />
</view>
<PageBottomBtn :text="btnText[scanCodeDetail.ancient_coin_status]" cancelTxt="取消" @click="onConfirm"
@cancelClick="onCancel" :show-cancel="true" />
</view>
</PopUpCommon>
</view>
</template>
<script>
@ -82,14 +74,12 @@ import ListBox from '@/components/listBox.vue';
import PopUpCommon from '@/components/common/popUpCommon.vue';
import CoinsDetail from '../coinsDetail';
import PageBottomBtn from '@/components/pageBottomBtn.vue'
import Mescroll from '@/components/common/mescroll.vue'
export default {
options: { styleIsolation: "shared" },
components: {
PopUpCommon,
PageBottomBtn,
Mescroll,
ListBox,
CoinsDetail
},
@ -131,10 +121,10 @@ export default {
size: "24.0*1.1mm,3.5g",
year: "1889"
},
loading:false,
noMore:false,
page:1,
pagesize:7
loading: false,
noMore: false,
page: 1,
pagesize: 7
}
},
@ -158,23 +148,23 @@ export default {
}
},
methods: {
onScroll(){
console.log(this.noMore,'000',this.loading,'this.loading==');
onScroll() {
console.log(this.noMore, '000', this.loading, 'this.loading==');
if (!this.noMore && !this.loading) {
this.page++;
this.getCoinsList();
}
},
getList(e){
console.log(e,'=====eeee');
getList(e) {
console.log(e, '=====eeee');
},
getCoinsList() {
this.loading = true;
//
this.$http.req('/api/getlist', { status: this.status, page: this.page, pagesize: this.pagesize}, 'POST').then(data => {
this.$http.req('/api/getlist', { status: this.status, page: this.page, pagesize: this.pagesize }, 'POST').then(data => {
uni.stopPullDownRefresh();
this.loading = false;
if ( data.list.length === 0 || data.length == 0 ) {
if (data.list.length === 0 || data.length == 0) {
this.noMore = true;
uni.showToast({ title: '没有更多数据了', icon: 'none' });
return;
@ -187,12 +177,12 @@ export default {
}
this.storage_count = data.storage_count;
this.delivery_count = data.delivery_count;
}).catch(res=>{
}).catch(res => {
this.loading = false;
});
},
lookDetail(item) {
uni.setStorageSync('detail',JSON.stringify(item))
uni.setStorageSync('detail', JSON.stringify(item))
// let url = `/pages/coinsDetail/index`
let url = `/pages/coinsDetail/index?id=${item.rating_code}`
this.$nav.navToPath(url)
@ -218,7 +208,7 @@ export default {
},
complete(res) {
if (res.errMsg === 'scanCode:ok') {
console.log('扫码成功11:', res.result,this);
console.log('扫码成功11:', res.result, this);
} else if (res.errMsg === 'scanCode:fail cancel') {
console.log('用户取消扫码');
} else {
@ -231,18 +221,18 @@ export default {
})
// #endif
},
getScanQrcode(result){
getScanQrcode(result) {
this.$http.req('/api/get_scan_code_detail', {
url:result
url: result
}, 'POST').then(data => {
console.log(data,'data===data');
this.scanCodeDetail = data;
this.$set(this,'scanCodeDetail',data)
setTimeout(()=>{
console.log(this.scanCodeDetail,'222');
this.$refs.coinsPopup.openPop();
},500)
}).catch(res=>{
console.log(data, 'data===data');
this.scanCodeDetail = data;
this.$set(this, 'scanCodeDetail', data)
setTimeout(() => {
console.log(this.scanCodeDetail, '222');
this.$refs.coinsPopup.openPop();
}, 500)
}).catch(res => {
});
},
async onConfirm() {
@ -251,29 +241,29 @@ export default {
let operate = ''
// url
let status = this.scanCodeDetail.ancient_coin_status;
if(status ==0 || status == 2){
if (status == 0 || status == 2) {
operate = '1'
}else{
} else {
operate = '2'
}
//
this.$http.req(url, {
scan_code_detail:JSON.stringify(this.scanCodeDetail),
scan_code_detail: JSON.stringify(this.scanCodeDetail),
operate: operate
}, 'POST').then(data => {
// -
//
if (status == 0 || status == '2') {
if (this.status != '1') this.status = '1'
} else {
if (this.status != '2') this.status = '2'
}
this.bedWaitList = [];
this.page = 1;
//
this.getCoinsList()
this.$refs.coinsPopup.closePop()
}).catch(res=>{
// -
//
if (status == 0 || status == '2') {
if (this.status != '1') this.status = '1'
} else {
if (this.status != '2') this.status = '2'
}
this.bedWaitList = [];
this.page = 1;
//
this.getCoinsList()
this.$refs.coinsPopup.closePop()
}).catch(res => {
this.loading = false;
});
@ -536,13 +526,15 @@ export default {
border-radius: 12rpx;
}
.page-padding{
.page-padding {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
width: 100%;
height: 206rpx;
}
.loading-text, .no-more-text {
.loading-text,
.no-more-text {
text-align: center;
padding: 20rpx;
color: #999;

Loading…
Cancel
Save