<template>
|
<view class="scan_index">
|
<view class="scan_header"></view>
|
<view class="scan_content">
|
<view class="scan_content_search">
|
<u-row gutter="5">
|
<u-col span="6" @click="propStock()">
|
<u-input
|
v-model="value"
|
border="surround"
|
disabled
|
disabledColor="#FFFFFF"
|
placeholder="请选择入库堆场"
|
></u-input>
|
</u-col>
|
<u-col span="6" @click="propCell()">
|
<u-input
|
v-model="cell"
|
border="surround"
|
disabled
|
disabledColor="#FFFFFF"
|
placeholder="请选择单元"
|
></u-input>
|
</u-col>
|
</u-row>
|
</view>
|
<view class="scan_content_cistern" :data="cultivatedInfo">
|
<view class="cistern_header">
|
水养池位置:{{cultivatedInfo.waterCultivatedName}}
|
</view>
|
<view class="cistern_content">
|
<view class="item_content_info">
|
<text class="label">已水养时长:</text>
|
<text>目前没有</text>
|
</view>
|
<view class="item_content_info">
|
<text class="label">入池时间:</text>
|
<text>{{cultivatedInfo.createTime}}</text>
|
</view>
|
<view class="item_content_info">
|
<text class="label">入池操作人:</text>
|
<text>{{cultivatedInfo.createUser}}</text>
|
</view>
|
<view class="item_content_info">
|
<text class="label">预计完成水养时间:</text>
|
<text>{{cultivatedInfo.expectTime}}</text>
|
</view>
|
</view>
|
</view>
|
<view class="scan_content_scroll">
|
<view class="scroll_item scroll_item-title">
|
<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, index) in pipeIntoList"
|
:key="index">
|
<text class="scroll_item_dot">{{item.ringNum}}</text>
|
<text class="scroll_item_dot">{{item.blockNum}}</text>
|
<text class="scroll_item_dot">{{item.pipeNum}}</text>
|
</view>
|
</scroll-view>
|
</view>
|
<view class="scan_content_button">
|
<u-button
|
type="primary"
|
text="提交"
|
@click="propModal()">
|
</u-button>
|
</view>
|
</view>
|
<u-picker
|
:show="showStock"
|
:columns="stockData"
|
keyName="repoName"
|
closeOnClickOverlay
|
@cancel="showStock = false"
|
@confirm="confirmStock"
|
@close="showStock = false"
|
></u-picker>
|
<u-picker
|
:show="showCell"
|
:columns="cellData"
|
keyName="unitName"
|
closeOnClickOverlay
|
@cancel="showCell = false"
|
@confirm="confirmCell"
|
@close="showCell = false"
|
></u-picker>
|
<u-modal
|
:show="showModal"
|
content='是否确认入库信息'
|
showCancelButton
|
@cancel="showModal = false"
|
@confirm="submitCisternInfo"
|
></u-modal>
|
</view>
|
</template>
|
|
<script>
|
import { throttle } from '../../plugins/public';
|
export default {
|
data() {
|
return {
|
ringNum: '', // 环号
|
value: '', // 入库堆场展示
|
stockValue: '', // 入库堆场
|
cell: '', // 单元展示
|
cellValue: '' ,// 单元
|
showStock: false, // 选择堆场
|
stockData: [], // 堆场信息
|
showCell: false, // 选择单元
|
cellData: [], // 单元信息
|
pipeIntoList: [], // 环信息
|
showModal: false, // 模态框
|
cultivatedInfo: {}, // 水养池信息
|
}
|
},
|
onLoad(option) {
|
uni.$off('scancodedate');
|
const data = JSON.parse(option.data);
|
this.pipeIntoList = data.pipeIntoList;
|
this.cultivatedInfo = data.cultivatedInfo;
|
this.stockData.push(data.repoPullDown);
|
this.ringNum = data.pipeIntoList[0].ringNum;
|
},
|
methods: {
|
// 打开选择堆场
|
propStock() {
|
this.value = '';
|
this.stockValue = '';
|
this.cellData = [];
|
this.showStock = true;
|
},
|
// 打开选择单元
|
propCell() {
|
this.cell = '';
|
this.cellValue = '';
|
this.showCell = true;
|
},
|
// 确认选择堆场信息
|
confirmStock(data) {
|
this.value = data.value[0].repoName;
|
this.stockValue = data.value[0].repoId;
|
this.$set(this.cellData, 0, data.value[0].repoUnitList);
|
this.showStock = false;
|
},
|
// 确认选择单元信息
|
confirmCell(data) {
|
this.cell = data.value[0].unitName;
|
this.cellValue = data.value[0].unitId;
|
this.showCell = false;
|
},
|
propModal() {
|
if(!this.stockValue) {
|
uni.$u.toast('请选择堆场');
|
return false;
|
} else if(!this.cellValue) {
|
uni.$u.toast('请输入单元');
|
return false;
|
} else {
|
this.showModal = true;
|
}
|
},
|
// 确认提交入库信息
|
submitCisternInfo: throttle(function() {
|
this.$api.putbank.submitPipePutbankInfo({
|
repoId: this.stockValue,
|
unitId: this.cellValue,
|
ringNum: this.ringNum
|
}).then((res) => {
|
if(res.success) {
|
uni.$u.toast('入库成功!');
|
uni.navigateBack();
|
} else {
|
uni.$u.toast(res.statusMsg);
|
}
|
})
|
}, 3000),
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.scan_index {
|
position: relative;
|
width: 100vw;
|
height: 100vh;
|
background: #F6F6F6;
|
|
.scan_header {
|
height: 14%;
|
background: #1976FF;
|
border-radius: 0 0 30% 30%;
|
}
|
|
.scan_content {
|
position: absolute;
|
top: 4%;
|
left: 50%;
|
transform: translateX(-50%);
|
width: calc(100% - 30px);
|
height: 96%;
|
|
.scan_content_search {
|
padding: 15px 10px;
|
margin-bottom: 10px;
|
background: #FFFFFF;
|
border-radius: 4px;
|
}
|
|
.scan_content_cistern {
|
margin-bottom: 10px;
|
background: #FFFFFF;
|
border-radius: 4px;
|
|
.cistern_header {
|
position: relative;
|
padding: 5px 20px;
|
color: #1976FF;
|
font-size: 18px;
|
background: #DAE9FF;
|
|
&::before {
|
content: '';
|
position: absolute;
|
top: 50%;
|
left: 10px;
|
transform: translateY(-50%);
|
width: 3px;
|
height: 45%;
|
background: #1976FF;
|
border-radius: 4px 4px 0 0;
|
}
|
}
|
|
.cistern_content {
|
padding: 15px 0 15px 10px;
|
border-radius: 0 0 4px 4px;
|
|
.item_content_info {
|
display: flex;
|
align-items: center;
|
padding: 2px 10px;
|
background: #EDF3FF;
|
|
&:first-child {
|
padding-top: 10px;
|
}
|
|
&:last-child {
|
padding-bottom: 10px;
|
}
|
|
.label {
|
color: #AFB0B1;
|
}
|
}
|
}
|
}
|
|
.scan_content_scroll {
|
height: 43.8%;
|
|
.scroll_item {
|
display: flex;
|
justify-content: space-around;
|
padding: 5px 10px;
|
font-size: 14px;
|
background: #FFFFFF;
|
|
&:nth-child(odd) {
|
background: #EDF3FF;
|
}
|
|
.scroll_item_dot {
|
width: 25%;
|
text-align: center;
|
|
&:last-child {
|
width: 50%;
|
}
|
}
|
}
|
|
.scroll_item-title {
|
color: #1976FF;
|
font-size: 16px;
|
background: #EDF3FF;
|
}
|
|
.scroll_view {
|
height: 85%;
|
}
|
}
|
|
.scan_content_button {
|
padding-bottom: 8px;
|
}
|
}
|
}
|
</style>
|