Files
hht-ynhl-one-uni/pages/SecondPhase/EmptyBoxOutStore.vue
2025-05-23 15:38:21 +08:00

162 lines
4.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="zd_container">
<!-- <nav-bar title="空木箱出库"></nav-bar> -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">木箱号</span>
</view>
<view class="filter_input_wraper">
<search-box v-model="val1" @handleChange="handleChange1" />
</view>
</view>
<view v-if="editValue.length" class="msg_item" style="margin-bottom:16rpx;">已扫木箱号{{editValue.toString()}}</view>
<view class="zd-row filter_item">
<view class="zd-col-11 zd-row">
<view class="filter_label">已选木箱数</view>
<view class="filter_input_wraper">
<view class="filter_input" style="font-size: 34rpx; color: #ff6a00;text-align: center;">{{selectedNum}}</view>
</view>
</view>
<view class="zd-col-11 zd-row">
<view class="filter_label" style="width:auto">可选木箱数</view>
<view class="filter_input_wraper">
<view class="filter_input" style="font-size: 34rpx; color: #4e6ef2;text-align: center;">{{selectedNum !== null ? (10 - selectedNum) : null}}</view>
</view>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>选择</th>
<th>木箱号</th>
<th>木箱料号</th>
<th>木箱描述</th>
<th>最大子卷数</th>
<th>木箱长度</th>
<th>木箱宽度</th>
<th>木箱高度</th>
<th>载具类型</th>
<th>木箱重量</th>
<th>仓位</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.checked}" @tap="toCheck(e)">
<td><span class="iconfont icon_unchecked" :class="{'icon_checked': e.checked}">&#xe66b;</span></td>
<td>{{e.box_no}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.num}}</td>
<td>{{e.box_length}}</td>
<td>{{e.box_width}}</td>
<td>{{e.box_high}}</td>
<td>{{e.vehicle_type}}</td>
<td>{{e.box_weight}}</td>
<td>{{e.struct_code}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submitbar">
<button class="zd-col-6 btn-submit btn-default" @tap="clearUp">清空</button>
<button class="zd-col-15 btn-submit btn-success" :class="{'btn-info': !checkArr.length}" :disabled="disabled" @tap="_twoBoxOut">出库确认</button>
</view>
<up-top ref="UT" :scrollTop="top"></up-top>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import UpTop from '@/components/upTop.vue'
import {twoQueryBoxIvt, twoBoxOut} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox,
UpTop
},
data() {
return {
title: '',
top: 0,
val1: '',
editValue: [], // 扫描木箱号集合
selectedNum: null, // 已选木箱数
dataList: [],
checkArr: [],
disabled: false
};
},
onPageScroll(e) {
this.$refs.UT.topData(e.scrollTop)
},
onLoad (options) {
this.title = options.title
},
methods: {
handleChange1 (e) {
if (e) {
this._twoQueryBoxIvt(e)
}
},
async _twoQueryBoxIvt (e) {
try {
let res = await twoQueryBoxIvt(e)
if (res && res.data.length) {
res.data.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...this.dataList, ...res.data]
this.editValue.push(this.val1)
}
} catch (e) {
this.val1 = ''
}
},
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
this.selectedNum = this.checkArr.length
if (this.selectedNum > 10) {
e.checked = false
this.checkArr = this.dataList.filter(i => { return i.checked === true })
this.selectedNum = this.checkArr.length
}
},
async _twoBoxOut () {
this.disabled = true
if (!this.checkArr.length) {
this.disabled = false
return
}
try {
let res = await twoBoxOut(this.checkArr)
uni.showToast({
title: res.message,
icon: 'none'
})
this.clearUp()
} catch (e) {
this.disabled = false
}
},
clearUp () {
this.val1 = ''
this.editValue = []
this.selectedNum = null
this.checkArr = []
this.dataList = []
this.disabled = false
}
}
}
</script>