Files
hht-shangdianke-uni/pages/WarehouseManage/XuniDeliveryConfirm.vue
2024-02-01 13:55:27 +08:00

144 lines
3.7 KiB
Vue

<template>
<view class="zd_container">
<nav-bar :inner2="true" @goIn="goIn" 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" :focused="true" @handleChange="handleChange1" -->
<search-box v-model="val1" :focused="focusedStatus" @handleChange="handleChange1"
/>
</view>
</view>
<!-- <view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">物料</span>
</view>
<view class="filter_input_wraper">
<search-box v-model="val2" />
</view>
</view> -->
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">总净重</span>
</view>
<view class="filter_input_wraper">
<input type="number" class="filter_input filter_input_disabled" v-model="net_weight_num" disabled>
</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>重量kg</th>
<th>更换外包</th>
<th>更换内包</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'bgyellow': e.colro_flag === '1'}">
<td>{{e.package_box_sn}}</td>
<td>{{e.container_name}}</td>
<td>{{e.product_name}}</td>
<td>{{e.product_description}}</td>
<td>{{e.net_weight}}</td>
<td>{{e.change_out}}</td>
<td>{{e.change_in}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !dataList.length}" :disabled="disabled1" @tap="_virtualoutConfirm">出库确认</button>
<button class="submit-button" @tap="_virtualivtQuery">查询</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {virtualivtQuery, virtualoutConfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
focusedStatus: true,
val1: '',
val2: '',
billCode: '',
dataList: [],
disabled1: false,
net_weight_num: ''
};
},
onLoad (option) {
this.billCode = option.billcode
this._virtualivtQuery()
},
methods: {
handleChange1 (e) {
this._virtualivtQuery()
},
goIn () {
uni.navigateTo({
url: `/pages/WarehouseManage/XuniDelivery`
})
},
handleChange (e) {
// console.log(e)
},
/** 初始化查询 */
async _virtualivtQuery () {
let res = await virtualivtQuery(this.val1, this.val2, this.billCode)
this.dataList = [...res.data]
this.net_weight_num = res.net_weight_num
},
async _virtualoutConfirm () {
this.focusedStatus = false
if (!this.dataList.length) {
return
}
this.disabled1 = true
try {
let res = await virtualoutConfirm(this.dataList, this.val1)
this.disabled1 = false
this.val1 = ''
this.val2 = ''
this._virtualivtQuery()
uni.showToast({
title: res.message,
icon: 'none'
})
this.focusedStatus = true
} catch (e) {
this.disabled1 = false
}
}
}
}
</script>
<style lang="stylus">
.zd_content
padding-bottom 77rpx
.slide_new table td:nth-child(1), .slide_new table th:nth-child(1)
box-shadow 1px 0 2px rgba(0,0,0,.12)
.bgyellow td
background-color #E9B451
</style>