171 lines
4.5 KiB
Vue
171 lines
4.5 KiB
Vue
<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">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">料箱编码</span>
|
|
</view>
|
|
<view class="zd-col-16">
|
|
<search-box
|
|
v-model="val1"
|
|
@handleChange="handleChange"
|
|
/>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom filter_input_disabled">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">拣选单据</span>
|
|
</view>
|
|
<view class="zd-col-16">
|
|
<input type="text" class="filter_input" v-model="data.code" disabled>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom filter_input_disabled">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">车间</span>
|
|
</view>
|
|
<view class="zd-col-16">
|
|
<input type="text" class="filter_input" v-model="data.product_area" disabled>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom filter_input_disabled">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">拣选仓库</span>
|
|
</view>
|
|
<view class="zd-col-16">
|
|
<input type="text" class="filter_input" v-model="data.stor_code" disabled>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom filter_input_disabled">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">拣选站台</span>
|
|
</view>
|
|
<view class="zd-col-16">
|
|
<input type="text" class="filter_input" v-model="data.point_code" disabled>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom filter_input_disabled">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">拣选数量</span>
|
|
</view>
|
|
<view class="zd-col-16">
|
|
<input type="number" class="filter_input" v-model="data.qty" disabled>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">移出料箱</span>
|
|
</view>
|
|
<view class="zd-col-16">
|
|
<search-box
|
|
v-model="val2"
|
|
/>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">是否机械搬运</span>
|
|
</view>
|
|
<view class="relative zd-col-16">
|
|
<switch :checked="isChecked" color="#4e6ef2" style="transform:scale(0.8)"/>
|
|
<text @tap="setWStatus" style="position: absolute;display: inline-block;width: 52px; height: 32px;left: 0;"></text>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-8">
|
|
<span class="filter_label">移入料箱</span>
|
|
</view>
|
|
<view class="zd-col-16">
|
|
<search-box
|
|
v-model="val3"
|
|
/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row submit-bar">
|
|
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
|
|
<button class="zd-col-16 button-primary" :class="{'button-info': !val1|| !val2 || !val3}" :disabled="disabled" @tap="_savePickTask">拣选确认</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import NavBar from '@/components/NavBar.vue'
|
|
import SearchBox from '@/components/SearchBox.vue'
|
|
import {queryPick, savePickTask} from '@/utils/getData2.js'
|
|
export default {
|
|
components: {
|
|
NavBar,
|
|
SearchBox
|
|
},
|
|
data() {
|
|
return {
|
|
val1: '',
|
|
val2: '',
|
|
val3: '',
|
|
isChecked: true,
|
|
data: {},
|
|
disabled: false
|
|
};
|
|
},
|
|
onLoad (options) {
|
|
this.title = options.title
|
|
},
|
|
onShow() {
|
|
if (this.$store.getters.publicObj !== '') {
|
|
this.data = this.$store.getters.publicObj
|
|
}
|
|
},
|
|
methods: {
|
|
handleChange (e) {
|
|
this._queryPick(e)
|
|
},
|
|
async _queryPick (e) {
|
|
let res = await queryPick('Picking', e)
|
|
this.data = res
|
|
},
|
|
setWStatus () {
|
|
this.isChecked = !this.isChecked
|
|
},
|
|
clearUp () {
|
|
this.data = {}
|
|
this.val1 = ''
|
|
this.val2 = ''
|
|
this.val3 = ''
|
|
this.isChecked = true
|
|
this.disabled = false
|
|
},
|
|
async _savePickTask () {
|
|
this.disabled = true
|
|
if (!this.val1|| !this.val2 || !this.val3) {
|
|
this.disabled = false
|
|
return
|
|
}
|
|
try {
|
|
let obj = Object.assign({}, this.data, {is_move: this.isChecked, pick_vehicle_23: this.val2, pick_vehicle_13: this.val3})
|
|
let res = await savePickTask(obj)
|
|
if (res.code === '200') {
|
|
uni.showToast({
|
|
title: res.msg,
|
|
icon: 'none'
|
|
})
|
|
this.clearUp()
|
|
} else {
|
|
this.disabled = false
|
|
}
|
|
} catch (e) {
|
|
this.disabled = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus">
|
|
|
|
</style>
|