108 lines
2.8 KiB
Vue
108 lines
2.8 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-5">
|
|
<span class="filter_label">当前点位</span>
|
|
</view>
|
|
<view class="zd-col-19">
|
|
<search-box
|
|
v-model="val1"
|
|
/>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row border-bottom">
|
|
<view class="zd-col-5">
|
|
<span class="filter_label">载具号</span>
|
|
</view>
|
|
<view class="zd-col-19">
|
|
<link-scan ref="scanChild" @getScanlist="getScanlist"/>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row">
|
|
<view class="zd-col-5">
|
|
<span class="filter_label">目的地</span>
|
|
</view>
|
|
<view class="zd-col-19 filter_select">
|
|
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row submit-bar">
|
|
<button class="zd-col-4 button-default button-primary_s" @tap="clearUp">清空</button>
|
|
<button class="zd-col-9 button-primary button-primary_s" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_handheldCageFrame('1')">空笼框送回确认</button>
|
|
<button class="zd-col-9 button-primary button-primary_s" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handheldCageFrame('2')">空料架送回确认</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import NavBar from '@/components/NavBar.vue'
|
|
import SearchBox from '@/components/SearchBox.vue'
|
|
import LinkScan from '@/components/LinkScan.vue'
|
|
import {handheldCageFrame} from '@/utils/getData2.js'
|
|
export default {
|
|
components: {
|
|
NavBar,
|
|
SearchBox,
|
|
LinkScan
|
|
},
|
|
data() {
|
|
return {
|
|
title: '',
|
|
val1: '',
|
|
val2: '',
|
|
options: [{ value: '1', text: '货架' }, { value: '2', text: '内部' }, { value: '3', text: '外协' }],
|
|
index: '',
|
|
disabled: false
|
|
};
|
|
},
|
|
onLoad (options) {
|
|
this.title = options.title
|
|
},
|
|
methods: {
|
|
getScanlist (e) {
|
|
this.val2 = e.join()
|
|
},
|
|
async _handheldCageFrame (type) {
|
|
this.disabled = true
|
|
if (type === '1' && (!this.val1 || !this.val2 || !this.index)) {
|
|
this.disabled = false
|
|
return
|
|
}
|
|
if (type === '2' && (!this.val1 || !this.val2)) {
|
|
this.disabled = false
|
|
return
|
|
}
|
|
try {
|
|
if (type === '1') {
|
|
let res = await handheldCageFrame(type, this.val1, this.val2, this.index)
|
|
} else if (type === '2') {
|
|
let res = await handheldCageFrame(type, this.val1, this.val2, '')
|
|
}
|
|
this.clearUp()
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
} catch (e) {
|
|
this.disabled = false
|
|
}
|
|
},
|
|
clearUp () {
|
|
this.val1 = ''
|
|
this.val2 = ''
|
|
this.index = ''
|
|
this.$refs.scanChild.toDel()
|
|
this.disabled = false
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus">
|
|
</style>
|