Files
pad-hl-hcx-new/pages/management/FinishedInStore.vue

154 lines
3.7 KiB
Vue
Raw Normal View History

2023-04-11 14:08:11 +08:00
<template>
<view class="content">
<nav-bar title="成品入库"></nav-bar>
<view class="search-confirm-wrap">
<view class="search-wrap">
<view class="search-item">
2023-04-12 11:13:31 +08:00
<label class="search-label">入库点</label>
2023-04-11 14:08:11 +08:00
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
<view class="search-item">
2023-04-12 11:13:31 +08:00
<label class="search-label">载具号</label>
2023-04-11 14:08:11 +08:00
<view class="filter_input_wraper">
<search-box
v-model="val1"
/>
</view>
</view>
</view>
<view class="confirm-button-wrap">
<button class="confirm-button" @tap="toSearch">查询</button>
2023-04-12 11:13:31 +08:00
<button class="confirm-button" :class="{'confirm-button_disabled': !pkId}" :disabled="disabled" @tap="toSelect">选择订单</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !pkId || !index2 || !val1 || !index3}" :disabled="disabled" @tap="toSure">入库确认</button>
2023-04-11 14:08:11 +08:00
</view>
</view>
<view class="grid-wrap">
<table class="grid-table">
<thead>
<tr>
<th>选择</th>
2023-04-12 11:13:31 +08:00
<th>订单行号</th>
<th>规格</th>
<th>入库数量</th>
<th>物料编码</th>
<th>物料名称</th>
2023-04-11 14:08:11 +08:00
</tr>
</thead>
<tbody>
<tr v-for="e in dataList" :key="e.position_code" @click="toRadio(e)">
<td>
<view class="iconfont icon-check" :class="{'icon-checked': pkId === e.position_code}"></view>
</td>
<td>{{e.cacheline_code}}</td>
<td>{{e.position_code}}</td>
<td>{{e.vehicle_code}}</td>
2023-04-12 11:13:31 +08:00
<td></td>
<td></td>
2023-04-11 14:08:11 +08:00
</tr>
</tbody>
</table>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getCacheLine, inOutExceptionInstQuery, inOutExceptionInstConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
options1: [{text: 'A1', value: 'A1'}, {text: 'A2', value: 'A2'}],
index1: 'A1',
val1: '',
dataList: [],
pkId: '',
disabled: false
};
},
created() {
},
methods: {
/** 选择器1 */
selectChange1(e) {
this.index1 = e
},
toSearch () {
this.dataList = []
this.pkId = ''
this._inOutExceptionInstQuery()
},
async _getCacheLine (id) {
let res = await getCacheLine(id)
this.options2 = [...res]
},
async _inOutExceptionInstQuery () {
let res = await inOutExceptionInstQuery(this.index2)
this.dataList = [...res]
},
async toSure () {
this.disabled = true
if (!this.pkId) {
uni.showToast({
title: '请选择',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index2) {
uni.showToast({
title: '请选择缓存线',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index3) {
uni.showToast({
title: '请选择位置类型',
icon: 'none'
})
this.disabled = false
return
}
if (!this.val1) {
uni.showToast({
title: '请扫满箱码',
icon: 'none'
})
this.disabled = false
return
}
try {
let res = await inOutExceptionInstConfirm(this.index2, this.val1, this.pkId, this.index3)
this.disabled = false
this.toSearch()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
toRadio (e) {
this.pkId = this.pkId === e.position_code ? '' : e.position_code
2023-04-12 11:13:31 +08:00
},
toSelect () {
if (!this.pkId) {
uni.navigateTo({
url: '/pages/management/MaterList'
})
}
2023-04-11 14:08:11 +08:00
}
}
}
</script>