Files
hht-hl-three-uni/pages/modules/EmptyOutStore.vue
2023-11-08 15:15:31 +08:00

132 lines
3.2 KiB
Vue

<template>
<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"
@handleChange="handleChange"
/>
</view>
</view>
<view class="filter_item">
<view class="filter_label">点位</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>序号</th>
<th>选择</th>
<th>货位</th>
<th>载具号</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.checked}">
<td>{{Number(i) + 1}}</td>
<td><span class="iconfont icon_unchecked" :class="{'icon_checked': e.checked}" @tap="toCheck(e)">&#xe66b;</span></td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !index || !checkArr.length}" :disabled="disabled" @tap="toSure">出库确认</button>
<button class="submit-button" @tap="_empOutgetIvt(val1)">查询</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {empOutgetIvt, empOutgetPoint, empOutconfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
options: [],
index: '',
val1: '',
dataList: [],
checkArr: [],
disabled: false
};
},
created () {
this._empOutgetPoint()
this._empOutgetIvt()
},
methods: {
handleChange (e) {
this._empOutgetIvt(e)
},
/** 选择器 */
selectChange(e) {
this.index = e
},
/** 点位下拉框查询 */
async _empOutgetPoint () {
let res = await empOutgetPoint()
res.data.map(el => {
this.$set(el, 'value', el.point_code)
this.$set(el, 'text', el.point_name)
})
this.options = [...res.data]
},
/** grid查询 */
async _empOutgetIvt (e) {
let res = await empOutgetIvt(this.val1, this.index)
res.data.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.data]
},
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
},
/** 确认 */
async toSure () {
this.disabled = true
if (!this.index || !this.checkArr.length) {
this.disabled = false
return
}
try {
let res = await empOutconfirm(this.checkArr, this.index)
this.disabled = false
this.dataList = []
this._empOutgetIvt()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
</style>