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

155 lines
3.5 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>
2023-05-10 15:32:25 +08:00
<view class="search-item flexend">
<button class="confirm-button" @tap="toDelect">清空</button>
<button class="confirm-button" @tap="toSelect">选择订单</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !index1 || !val1 || dataList.length === 0}" :disabled="disabled" @tap="toSure">入库确认</button>
</view>
2023-04-11 14:08:11 +08:00
</view>
</view>
<view class="grid-wrap">
<table class="grid-table">
<thead>
<tr>
2023-04-14 16:20:48 +08:00
<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>
2023-04-12 20:07:02 +08:00
<tr v-for="(e, i) in dataList" :key="i">
2023-04-14 16:20:48 +08:00
<td>{{e.sale_code}}</td>
2023-04-12 20:07:02 +08:00
<td>{{e.order_line_code}}</td>
<td>{{e.material_spec}}</td>
2023-04-14 16:01:12 +08:00
<td>{{e.assign_qty}}</td>
2023-04-12 20:07:02 +08:00
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</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'
2023-04-13 18:56:04 +08:00
import {finishproductPoint, InstoreOrder} from '@/utils/getData2.js'
2023-04-11 14:08:11 +08:00
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
2023-04-13 18:56:04 +08:00
options1: [],
2023-04-11 14:08:11 +08:00
index1: 'A1',
val1: '',
dataList: [],
pkId: '',
disabled: false
};
},
2023-04-13 16:41:42 +08:00
onShow() {
2023-04-12 20:07:02 +08:00
if (this.$store.getters.publicArr) {
this.dataList = this.$store.getters.publicArr
}
2023-04-11 14:08:11 +08:00
},
2023-04-13 16:41:42 +08:00
destroyed () {
this.$store.dispatch('setPublicArr', '')
},
2023-04-13 18:56:04 +08:00
created () {
this._finishproductPoint()
},
2023-04-11 14:08:11 +08:00
methods: {
/** 选择器1 */
selectChange1(e) {
this.index1 = e
},
2023-04-12 20:07:02 +08:00
toDelect () {
2023-04-11 14:08:11 +08:00
this.dataList = []
this.pkId = ''
2023-04-12 20:07:02 +08:00
this.$store.dispatch('setPublicArr', '')
2023-04-11 14:08:11 +08:00
},
2023-04-13 18:56:04 +08:00
async _finishproductPoint () {
let res = await finishproductPoint('1')
this.options1 = [...res]
2023-04-11 14:08:11 +08:00
},
async toSure () {
this.disabled = true
2023-04-12 20:07:02 +08:00
if (!this.index1) {
2023-04-11 14:08:11 +08:00
uni.showToast({
2023-04-12 20:07:02 +08:00
title: '请选择入库点',
2023-04-11 14:08:11 +08:00
icon: 'none'
})
this.disabled = false
return
}
2023-04-12 20:07:02 +08:00
if (!this.val1) {
2023-04-11 14:08:11 +08:00
uni.showToast({
2023-04-12 20:07:02 +08:00
title: '请输入载具号',
2023-04-11 14:08:11 +08:00
icon: 'none'
})
this.disabled = false
return
}
2023-04-12 20:07:02 +08:00
if (this.dataList.length === 0) {
2023-04-11 14:08:11 +08:00
uni.showToast({
2023-04-12 20:07:02 +08:00
title: '请选择订单信息',
2023-04-11 14:08:11 +08:00
icon: 'none'
})
this.disabled = false
return
}
try {
2023-04-12 20:07:02 +08:00
let res = await InstoreOrder(this.index1, this.val1, this.dataList)
2023-04-11 14:08:11 +08:00
this.disabled = false
2023-04-12 20:07:02 +08:00
this.index1 = ''
this.val1 = ''
this.toDelect()
2023-04-11 14:08:11 +08:00
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
2023-04-12 11:13:31 +08:00
toSelect () {
2023-04-12 20:07:02 +08:00
uni.navigateTo({
url: '/pages/management/MaterList'
})
2023-04-11 14:08:11 +08:00
}
}
}
</script>
2023-05-10 15:32:25 +08:00
<style lang="stylus" scoped>
@import '../../common/style/mixin.styl';
.search-item
&:nth-child(1),&:nth-child(2)
width 30%
&:nth-child(3)
width 36%
</style>