Files
hht-ximenzi-uni/pages/manage/empty-tray-back.vue

108 lines
2.8 KiB
Vue
Raw Normal View History

2024-08-19 15:45: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">
<view class="zd-col-5">
2024-08-26 16:05:16 +08:00
<span class="filter_label">当前点位</span>
</view>
<view class="zd-col-19">
<search-box
v-model="val1"
/>
</view>
</view>
2024-09-06 09:35:26 +08:00
<view class="zd-row border-bottom">
2024-08-19 15:45:30 +08:00
<view class="zd-col-5">
2024-08-26 16:05:16 +08:00
<span class="filter_label">载具号</span>
2024-08-19 15:45:30 +08:00
</view>
2024-08-26 16:05:16 +08:00
<view class="zd-col-19">
<link-scan ref="scanChild" @getScanlist="getScanlist"/>
2024-08-19 15:45:30 +08:00
</view>
</view>
2024-09-06 09:35:26 +08:00
<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>
2024-08-19 15:45:30 +08:00
</view>
</view>
<view class="zd-row submit-bar">
2024-09-06 09:35:26 +08:00
<button class="zd-col-4 button-default button-primary_s" @tap="clearUp">清空</button>
2024-09-06 10:51:49 +08:00
<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>
2024-08-19 15:45:30 +08:00
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2024-08-26 16:05:16 +08:00
import LinkScan from '@/components/LinkScan.vue'
2024-09-06 10:51:49 +08:00
import {handheldCageFrame} from '@/utils/getData2.js'
2024-08-19 15:45:30 +08:00
export default {
components: {
NavBar,
2024-08-26 16:05:16 +08:00
SearchBox,
LinkScan
2024-08-19 15:45:30 +08:00
},
data() {
return {
title: '',
val1: '',
2024-08-26 16:05:16 +08:00
val2: '',
2024-09-06 09:35:26 +08:00
options: [{ value: '1', text: '货架' }, { value: '2', text: '内部' }, { value: '3', text: '外协' }],
index: '',
2024-08-19 15:45:30 +08:00
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
2024-08-26 16:05:16 +08:00
getScanlist (e) {
this.val2 = e.join()
},
2024-09-06 10:51:49 +08:00
async _handheldCageFrame (type) {
2024-09-06 09:35:26 +08:00
this.disabled = true
2024-09-06 10:51:49 +08:00
if (type === '1' && (!this.val1 || !this.val2 || !this.index)) {
2024-09-06 09:35:26 +08:00
this.disabled = false
return
}
2024-09-06 10:51:49 +08:00
if (type === '2' && (!this.val1 || !this.val2)) {
2024-08-19 15:45:30 +08:00
this.disabled = false
return
}
try {
2024-09-06 10:51:49 +08:00
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, '')
}
2024-08-19 15:45:30 +08:00
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
clearUp () {
this.val1 = ''
2024-08-26 16:05:16 +08:00
this.val2 = ''
2024-09-06 09:35:26 +08:00
this.index = ''
2024-08-26 16:05:16 +08:00
this.$refs.scanChild.toDel()
2024-08-19 15:45:30 +08:00
this.disabled = false
}
}
}
</script>
<style lang="stylus">
</style>