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

Loading…
Cancel
Save