Files
hht-tongbo/pages/WarehouseManage/ScrapInStore.vue

126 lines
3.0 KiB
Vue
Raw Normal View History

2022-10-19 17:18:14 +08:00
<template>
2022-10-19 17:29:44 +08:00
<view class="zd_container">
<nav-bar 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"
2022-12-03 14:31:36 +08:00
:focused="true"
2022-10-28 10:46:22 +08:00
@handleChange="handleChange"
2022-10-19 17:29:44 +08:00
/>
</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>
2022-10-28 10:28:13 +08:00
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label filter_label_1"></span>
</view>
<view class="filter_input_wraper filter_input_wraper_1">
<view class="iconfont icon_unchecked" :class="{'icon_checked': isV === '1'}" @tap="isVirtual">&#xe66b;</view>
<view class="filter_input_wraper_inn_text">虚拟库</view>
</view>
</view>
2022-10-19 17:29:44 +08:00
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
2022-10-27 19:33:24 +08:00
<th>木箱码</th>
2022-10-19 17:29:44 +08:00
<th>子卷号</th>
2022-10-27 19:33:24 +08:00
<th>物料编码</th>
<th>物料名称</th>
<th>重量KG</th>
2022-10-19 17:29:44 +08:00
</tr>
</thead>
<tbody>
2022-11-17 14:43:29 +08:00
<tr v-for="(e, i) in dataList" :key="i">
2022-11-17 14:23:07 +08:00
<td>{{e.package_box_sn}}</td>
2022-10-19 17:29:44 +08:00
<td>{{e.container_name}}</td>
2022-10-27 19:33:24 +08:00
<td>{{e.product_name}}</td>
<td>{{e.product_description}}</td>
<td>{{e.net_weight}}</td>
2022-10-19 17:29:44 +08:00
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
2022-11-17 14:43:29 +08:00
<button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0}" :disabled="disabled" @tap="_stConfirm">入库确认</button>
2022-11-09 13:30:32 +08:00
<button class="submit-button" @tap="_boxQuery(val1)">查询</button>
2022-10-19 17:29:44 +08:00
</view>
2022-10-19 17:18:14 +08:00
</view>
</template>
<script>
2022-10-19 17:29:44 +08:00
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2022-10-27 19:33:24 +08:00
import {boxQuery, stConfirm} from '@/utils/getData2.js'
2022-10-19 17:18:14 +08:00
export default {
2022-10-19 17:29:44 +08:00
components: {
NavBar,
SearchBox
},
2022-10-19 17:18:14 +08:00
data() {
return {
2022-10-19 17:29:44 +08:00
val1: '',
val2: '',
2023-02-04 18:46:06 +08:00
isV: '0',
2022-10-19 17:29:44 +08:00
dataList: [],
2022-10-27 19:33:24 +08:00
disabled: false
2022-10-19 17:18:14 +08:00
};
2022-10-19 17:29:44 +08:00
},
methods: {
2022-10-28 10:28:13 +08:00
/** 虚拟库 */
isVirtual () {
this.isV = this.isV === '0' ? '1' : '0'
},
2022-10-28 10:46:22 +08:00
handleChange (e) {
this._boxQuery(e)
},
2022-10-19 17:29:44 +08:00
/** 初始化查询 */
2022-10-28 10:46:22 +08:00
async _boxQuery (e) {
let res = await boxQuery(e, '1')
2022-10-19 17:29:44 +08:00
this.dataList = [...res.data]
},
/** 确认 */
2022-10-27 19:33:24 +08:00
async _stConfirm () {
2022-10-19 17:29:44 +08:00
this.disabled = true
2022-11-17 14:43:29 +08:00
if (!this.val1 || this.dataList.length === 0) {
2022-10-19 17:29:44 +08:00
this.disabled = false
return
}
try {
2022-11-18 09:30:31 +08:00
let res = await stConfirm(this.dataList, this.val2, '1', this.isV, '', this.val1)
2022-10-19 17:29:44 +08:00
this.disabled = false
2022-10-28 10:46:22 +08:00
this._boxQuery(this.val1)
2022-11-11 18:22:26 +08:00
uni.showToast({
title: res.message,
icon: 'none'
})
2022-10-19 17:29:44 +08:00
} catch (e) {
this.disabled = false
}
}
2022-10-19 17:18:14 +08:00
}
}
</script>
<style lang="stylus">
</style>