Files
hht-hengsen-uni/pages/entry/group-to-store.vue

127 lines
2.8 KiB
Vue
Raw Normal View History

2024-07-22 17:32:37 +08:00
<template>
<view class="zd_container">
2024-08-02 17:26:50 +08:00
<!-- 组盘入库 -->
2024-07-22 17:32:37 +08:00
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具编码</span>
</view>
2024-08-02 17:26:50 +08:00
<view class="zd-col-24">
2024-07-22 17:32:37 +08:00
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">关联单据</span>
</view>
2024-08-02 17:26:50 +08:00
<view class="zd-col-24">
<input type="text" class="filter_input" @tap="toJump" v-model="val2">
2024-07-22 17:32:37 +08:00
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
2024-08-02 17:26:50 +08:00
<th>物料编码</th>
2024-07-22 17:32:37 +08:00
<th>物料名称</th>
<th>物料规格</th>
<th>批次</th>
<th>单重</th>
</tr>
</thead>
<tbody>
2024-08-02 17:26:50 +08:00
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.material_code}}</td>
2024-07-22 17:32:37 +08:00
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.single_weight}}</td>
</tr>
</tbody>
</table>
</view>
</view>
2024-08-02 17:26:50 +08:00
</view>
<view class="compute_wraper">
2024-07-22 17:32:37 +08:00
</view>
<view class="zd-row submit-bar">
2024-08-02 17:26:50 +08:00
<view class="zd-col-10"></view>
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !checkArr.length}" :disabled="disabled">组盘确认</button>
2024-07-22 17:32:37 +08:00
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2024-08-02 17:26:50 +08:00
import {mdGruopDick} from '@/utils/getData2.js'
2024-07-22 17:32:37 +08:00
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
dataList: [],
2024-08-02 17:26:50 +08:00
checkArr: '',
2024-07-22 17:32:37 +08:00
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
2024-08-02 17:26:50 +08:00
onShow () {
if (this.$store.getters.publicArr.length) {
this.dataList = [...this.$store.getters.publicArr]
this.$store.dispatch('setPublicArr', '')
}
},
2024-07-22 17:32:37 +08:00
methods: {
2024-08-02 17:26:50 +08:00
toJump () {
uni.navigateTo({
url: '/pages/entry/document?title=关联单据'
})
2024-07-22 17:32:37 +08:00
},
2024-08-02 17:26:50 +08:00
toEmpty () {
this.val1 = ''
this.dataList = []
2024-07-22 17:32:37 +08:00
},
2024-08-02 17:26:50 +08:00
async _mdGruopDick () {
2024-07-22 17:32:37 +08:00
this.disabled = true
2024-08-02 17:26:50 +08:00
if (!this.checkArr.length) {
2024-07-22 17:32:37 +08:00
this.disabled = false
return
}
try {
2024-08-02 17:26:50 +08:00
let res = await mdGruopDick(this.dataList, this.val1, this.val2)
2024-07-22 17:32:37 +08:00
this.disabled = false
uni.showToast({
2024-08-02 17:26:50 +08:00
title: res.msg,
2024-07-22 17:32:37 +08:00
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
@import '../../common/style/mixin.styl';
.msg_wrapper
height auto
min-height 30%
</style>