<template>
|
<view class="exit_index">
|
<view class="exit_header"></view>
|
<view class="exit_content">
|
<view class="exit_content_search">
|
<u-row gutter="5" customStyle="padding-right: 10px">
|
<u-col span="5" @click="propPicker()">
|
<u-input
|
v-model="value"
|
border="surround"
|
disabled
|
disabledColor="#FFFFFF"
|
placeholder="请选择堆场"
|
></u-input>
|
</u-col>
|
<u-col span="5">
|
<u-input
|
v-model="ringNum"
|
border="surround"
|
placeholder="请输入环号"
|
></u-input>
|
</u-col>
|
<u-col span="2">
|
<u-button type="primary" size="small" text="查询" color="#1977FF" @click="searchData()"></u-button>
|
</u-col>
|
</u-row>
|
</view>
|
<scroll-view :scroll-top="scrollTop" refresher-enabled="true" scroll-y="true" class="exit_content_scroll"
|
refresher-background="#EAEAEA" @scrolltolower="scrolltoLower" :refresher-triggered="triggered"
|
@refresherrefresh="refresherrefresh">
|
<view
|
class="exit_scroll_item"
|
v-for="item in exitList"
|
:key="item.pipeOutId">
|
<view class="scroll_item_header">
|
车辆信息
|
</view>
|
<view class="scroll_item_content">
|
<view class="item_content_info">
|
<text class="label">车牌号:</text>
|
<text>{{item.carBrand}}</text>
|
</view>
|
<view class="item_content_info">
|
<text class="label">车辆类型:</text>
|
<text>{{item.carTypeName}}</text>
|
</view>
|
<view class="item_content_info">
|
<text class="label">司机:</text>
|
<text>{{item.carDriver}}</text>
|
</view>
|
<view class="item_content_info">
|
<text class="label">联系电话:</text>
|
<text>{{item.carPhone}}</text>
|
</view>
|
<view class="item_content_info">
|
<text class="label">出库时间:</text>
|
<text style="color: #1977FF;">{{item.createTime}}</text>
|
</view>
|
</view>
|
<view class="scroll_item_button" @click="propDetail(item)">
|
出库管片详情
|
</view>
|
</view>
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
|
</scroll-view>
|
</view>
|
<u-picker
|
:show="showPicker"
|
:columns="columsData"
|
keyName="waterCultivatedName"
|
closeOnClickOverlay
|
@cancel="showPicker = false"
|
@confirm="confirmPicker"
|
@close="showPicker = false">
|
</u-picker>
|
<u-popup :show="showProp" round="10" @close="showProp = false">
|
<view class="prop_content">
|
<view class="prop_content_title">
|
出库管片详情
|
</view>
|
<view class="prop_content_list">
|
<view class="scroll_item scroll_item-title" style="background: #EDF3FF;">
|
<text class="scroll_item_dot">环号</text>
|
<text class="scroll_item_dot">块号</text>
|
<text class="scroll_item_dot">管片编号</text>
|
</view>
|
<scroll-view scroll-y="true" class="scroll_view">
|
<view
|
class="scroll_item"
|
v-for="item in propInfo"
|
:key="item.pipeId">
|
<text class="scroll_item_dot">{{item.ringNum}}</text>
|
<text class="scroll_item_dot">{{item.blockNumName}}</text>
|
<text class="scroll_item_dot">{{item.pipeNum}}</text>
|
</view>
|
</scroll-view>
|
</view>
|
</view>
|
</u-popup>
|
<u-picker
|
:show="showPicker"
|
:columns="columsData"
|
keyName="repoName"
|
closeOnClickOverlay
|
@cancel="showPicker = false"
|
@confirm="confirmPicker"
|
@close="showPicker = false"
|
></u-picker>
|
</view>
|
</template>
|
|
<script>
|
import { throttle } from '../../plugins/public';
|
export default {
|
data() {
|
return {
|
value: '',
|
repoIdValue: '',
|
ringNum: '', // 环号
|
pageNum: 1,
|
pageSize: 10,
|
loadPage: '',
|
scrollTop: 0,
|
triggered: true,
|
status: 'loading',
|
iconType: 'flower',
|
loadText: {
|
loading: '努力加载中',
|
nomore: '没有更多数据了'
|
},
|
exitList: [], // 入库列表信息
|
showPicker: false, // 选择堆场
|
columsData: [], // 堆场信息
|
showProp: false, // 出库管片详情弹窗
|
propInfo: [], // 出库管片详情信息
|
}
|
},
|
onShow() {
|
const that = this;
|
uni.$off('scancodedate');
|
uni.$on('scancodedate', function(data) {
|
console.log(data.code, '扫码结果');
|
that.$api.exit.pipeOutStoreScan({
|
pipeNum: data.code.slice(-17)
|
}).then((res) => {
|
if(res.success) {
|
uni.$u.toast('扫描完成!');
|
uni.navigateTo({
|
url: '../exitIndex/scanIndex?pipeNum=' + data.code.slice(-17)
|
})
|
} else {
|
uni.$u.toast(res.statusMsg);
|
}
|
})
|
})
|
that.getRepoRecordData();
|
that.searchData();
|
},
|
onUnload() {
|
// 移除监听事件
|
uni.$off('scancodedate');
|
},
|
methods: {
|
// 获取管片信息详情
|
async getPipeDetailInfo(pipeNum) {
|
const { data } = await this.$api.exit.getPipeDetailInfo({
|
pipeNum: pipeNum
|
});
|
return data;
|
},
|
// 获取堆场信息
|
async getRepoRecordData() {
|
this.columsData = [];
|
const { data } = await this.$api.putbank.getRepoRecordData();
|
this.$set(this.columsData, 0, data);
|
},
|
// 查询出库列表
|
async searchPipeOutList() {
|
const { data } = await this.$api.exit.searchPipeOutList({
|
pageNum: this.pageNum,
|
pageSize: this.pageSize,
|
ringNum: this.ringNum,
|
repoId: this.repoIdValue
|
})
|
return data;
|
},
|
// 查询
|
searchData() {
|
this.triggered = true;
|
this.exitList = [];
|
this.searchPipeOutList().then((data) => {
|
this.exitList = data.list;
|
this.loadPage = data.pages;
|
this.triggered = false;
|
this.status = 'nomore';
|
}).catch(() => {
|
this.triggered = false;
|
this.status = 'nomore';
|
uni.$u.toast('没有更多数据了');
|
})
|
},
|
//自定义下拉刷新
|
refresherrefresh: throttle(function() {
|
this.status = 'loading';
|
this.pageNum = 1;
|
this.searchData();
|
uni.$u.toast('刷新成功');
|
}, 500),
|
//触底刷新
|
scrolltoLower: throttle(function() {
|
this.status = 'loading';
|
if(this.pageNum >= this.loadPage) {
|
setTimeout(() => {
|
this.status = 'nomore';
|
uni.$u.toast('没有更数据了');
|
},1000)
|
return;
|
} else {
|
this.pageNum += 1;
|
this.searchPipeOutList().then((data) => {
|
this.loadPage = data.pages;
|
this.exitList.push(...data.list);
|
this.status = 'nomore';
|
})
|
}
|
}, 3000),
|
// 查看车辆管片详情
|
propDetail(item) {
|
this.showProp = true;
|
this.$api.exit.getCarPipeDetailInfo({
|
pipeOutId: item.pipeOutId
|
}).then((res) => {
|
if(res.success) {
|
this.propInfo = res.data.pipeInfos;
|
} else {
|
uni.$u.toast(res.statusMsg);
|
}
|
})
|
},
|
// 打开选择堆场
|
propPicker() {
|
this.value = '';
|
this.repoIdValue = ''
|
this.showPicker = true;
|
},
|
// 确认选择堆场
|
confirmPicker(data) {
|
this.value = data.value[0].repoName;
|
this.repoIdValue = data.value[0].repoId;
|
this.showPicker = false;
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.exit_index {
|
position: relative;
|
width: 100vw;
|
height: 100vh;
|
background: #F6F6F6;
|
|
.exit_header {
|
height: 16%;
|
background: #1976FF;
|
border-radius: 0 0 30% 30%;
|
}
|
|
.exit_content {
|
position: absolute;
|
top: 4%;
|
left: 50%;
|
transform: translateX(-50%);
|
width: calc(100% - 30px);
|
height: 96%;
|
|
.exit_content_search {
|
padding: 20px 10px;
|
margin-bottom: 10px;
|
background: #FFFFFF;
|
border-radius: 2px;
|
}
|
|
.exit_content_scroll {
|
height: 85%;
|
|
.exit_scroll_item {
|
margin: 10px 0;
|
background: #FFFFFF;
|
border-radius: 4px;
|
|
&:first-child {
|
margin-top: 0;
|
}
|
|
.scroll_item_header {
|
position: relative;
|
padding: 10px 20px;
|
color: #1977FF;
|
font-size: 18px;
|
background: #DAE9FF;
|
border-radius: 4px 4px 0 0;
|
|
&::before {
|
content: '';
|
position: absolute;
|
top: 50%;
|
left: 10px;
|
transform: translateY(-50%);
|
width: 3px;
|
height: 45%;
|
background: #1977FF;
|
}
|
}
|
|
.scroll_item_content {
|
padding: 10px;
|
margin: 15px 10px;
|
background: #F6F9FE;
|
|
.item_content_info {
|
display: flex;
|
align-items: center;
|
padding: 2px 0;
|
|
.label {
|
color: #AFB0B1;
|
}
|
}
|
}
|
|
.scroll_item_button {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
padding: 10px 0;
|
color: #1976FF;
|
font-size: 18px;
|
border-top: 1px solid #F6F6F6;
|
|
&:active {
|
opacity: .8;
|
}
|
}
|
}
|
}
|
}
|
|
.prop_content {
|
padding: 10px;
|
|
.prop_content_title {
|
position: relative;
|
padding: 10px;
|
font-size: 18px;
|
|
&::before {
|
content: '';
|
position: absolute;
|
top: 50%;
|
left: 0;
|
transform: translateY(-50%);
|
width: 3px;
|
height: 45%;
|
background: #1976FF;
|
}
|
}
|
|
.prop_content_list {
|
max-height: 400px;
|
overflow-y: auto;
|
|
.scroll_view {
|
height: 80%;
|
background: #1977FF;
|
}
|
|
.scroll_item-title {
|
color: #1976FF;
|
font-size: 16px;
|
background: #EDF3FF;
|
}
|
|
.scroll_item {
|
display: flex;
|
justify-content: space-around;
|
padding: 5px 10px;
|
font-size: 14px;
|
background: #FFFFFF;
|
|
&:nth-child(even) {
|
background: #EDF3FF;
|
}
|
|
.scroll_item_dot {
|
width: 25%;
|
padding: 0 10px;
|
white-space: nowrap;
|
text-align: center;
|
|
&:last-child {
|
width: 50%;
|
}
|
}
|
}
|
}
|
}
|
}
|
|
::v-deep .u-button--small {
|
height: 36px;
|
}
|
</style>
|