2026-01-27 10:56:30 +08:00
|
|
|
<template>
|
|
|
|
|
<view class="zd_container">
|
|
|
|
|
<!-- 码垛下料 -->
|
|
|
|
|
<nav-bar :title="title"></nav-bar>
|
|
|
|
|
<view class="zd_content">
|
|
|
|
|
<view class="zd_wrapper">
|
|
|
|
|
<view class="zd-row border-bottom">
|
2026-02-01 09:49:01 +08:00
|
|
|
<view class="zd-col-6">
|
|
|
|
|
<span class="filter_label">物料编码</span>
|
2026-01-27 10:56:30 +08:00
|
|
|
</view>
|
2026-02-01 09:49:01 +08:00
|
|
|
<view class="zd-col-13">
|
|
|
|
|
<search-box v-model="materialData.material_code"/>
|
2026-01-27 10:56:30 +08:00
|
|
|
</view>
|
2026-02-01 09:49:01 +08:00
|
|
|
<button class="mini-btn" type="primary" @tap="toJump('material?title=物料维护')">查询</button>
|
2026-01-27 10:56:30 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="zd-row border-bottom">
|
|
|
|
|
<view class="zd-col-7">
|
2026-02-01 09:49:01 +08:00
|
|
|
<span class="filter_label">盒数</span>
|
2026-01-27 10:56:30 +08:00
|
|
|
</view>
|
2026-02-01 09:49:01 +08:00
|
|
|
<view class="zd-col-24">
|
|
|
|
|
<input type="number" v-model="num" class="filter_input">
|
2026-01-27 10:56:30 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="zd-row border-bottom">
|
|
|
|
|
<view class="zd-col-7">
|
2026-02-01 09:49:01 +08:00
|
|
|
<span class="filter_label">当前点位</span>
|
2026-01-27 10:56:30 +08:00
|
|
|
</view>
|
2026-02-01 09:49:01 +08:00
|
|
|
<view class="zd-col-24 filter_select">
|
|
|
|
|
<search-box
|
|
|
|
|
v-model="val1"
|
|
|
|
|
/>
|
2026-01-27 10:56:30 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="zd-row submit-bar">
|
2026-02-01 09:49:01 +08:00
|
|
|
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
|
|
|
|
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !materialData.material_code || !num}" :disabled="disabled" @tap="_palletizingDown">下料</button>
|
2026-01-27 10:56:30 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import NavBar from '@/components/NavBar.vue'
|
|
|
|
|
import SearchBox from '@/components/SearchBox.vue'
|
2026-02-01 09:49:01 +08:00
|
|
|
import {palletizingDown} from '@/utils/getData3.js'
|
2026-01-27 10:56:30 +08:00
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
NavBar,
|
|
|
|
|
SearchBox
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
title: '',
|
|
|
|
|
val1: '',
|
2026-02-01 09:49:01 +08:00
|
|
|
materialData: {},
|
2026-01-27 10:56:30 +08:00
|
|
|
num: null,
|
|
|
|
|
disabled: false
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
onLoad (options) {
|
|
|
|
|
this.title = options.title
|
|
|
|
|
},
|
2026-02-01 09:49:01 +08:00
|
|
|
onShow () {
|
|
|
|
|
if (this.$store.getters.publicObj !== '') {
|
|
|
|
|
this.materialData = this.$store.getters.publicObj
|
|
|
|
|
this.$store.dispatch('setPublicObj', '')
|
|
|
|
|
}
|
|
|
|
|
},
|
2026-01-27 10:56:30 +08:00
|
|
|
methods: {
|
2026-02-01 09:49:01 +08:00
|
|
|
toJump (name) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/hdyy/wbc/${name}`
|
|
|
|
|
})
|
|
|
|
|
},
|
2026-01-27 10:56:30 +08:00
|
|
|
toEmpty () {
|
|
|
|
|
this.val1 = ''
|
|
|
|
|
this.num = null
|
2026-02-01 09:49:01 +08:00
|
|
|
this.materialData = {}
|
2026-01-27 10:56:30 +08:00
|
|
|
this.disabled = false
|
|
|
|
|
},
|
2026-02-01 09:49:01 +08:00
|
|
|
async _palletizingDown () {
|
2026-01-27 10:56:30 +08:00
|
|
|
this.disabled = true
|
2026-02-01 09:49:01 +08:00
|
|
|
if (!this.val1 || !this.materialData.material_code || !this.num) {
|
2026-01-27 10:56:30 +08:00
|
|
|
this.disabled = false
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
try {
|
2026-02-01 09:49:01 +08:00
|
|
|
let res = await palletizingDown(this.val1, this.materialData.material_code, this.num)
|
2026-01-27 10:56:30 +08:00
|
|
|
if (res) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.message,
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.toEmpty()
|
|
|
|
|
this.disabled = false
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.disabled = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|