手持机
This commit is contained in:
@@ -1,19 +1,29 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="input-group">
|
||||
<uni-easyinput
|
||||
v-model="trayCode"
|
||||
:placeholder="$t('outbound.ckMakeSureByTray.trayCodePlaceholder')"
|
||||
:clearable="true"
|
||||
@input="handleInput"
|
||||
@clear="handleClear"
|
||||
ref="trayCodeInput"
|
||||
>
|
||||
<template #right>
|
||||
<text class="scan-icon" @click="handleScan">📷</text>
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
</view>
|
||||
<view class="input-group">
|
||||
<uni-easyinput
|
||||
v-model="trayCode"
|
||||
:placeholder="$t('outbound.ckMakeSureByTray.trayCodePlaceholder')"
|
||||
:clearable="true"
|
||||
@input="handleInput"
|
||||
@clear="handleClear"
|
||||
ref="trayCodeInput"
|
||||
>
|
||||
<template #right>
|
||||
<text class="scan-icon" @click="handleScan">📷</text>
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
</view>
|
||||
|
||||
<!-- 条件显示出口下拉框 -->
|
||||
<view class="select-group" v-if="showEntrySelect">
|
||||
<view class="select-label">{{ $t('outbound.ckMakeSureByTray.exit') }}</view>
|
||||
<uni-data-select
|
||||
v-model="selectedEntry"
|
||||
:localdata="entryOptions"
|
||||
:placeholder=" $t('outbound.ckMakeSureByTray.exitPlaceholder')"
|
||||
></uni-data-select>
|
||||
</view>
|
||||
|
||||
<view class="loading-container" v-if="loading">
|
||||
<uni-load-more status="loading" :content-text="{contentdown: $t('outbound.ckMakeSureByTray.loading'),contentrefresh: $t('outbound.ckMakeSureByTray.loading'),contentnomore: $t('outbound.ckMakeSureByTray.noMoreData')}"></uni-load-more>
|
||||
@@ -69,19 +79,48 @@
|
||||
return {
|
||||
trayCode: '',
|
||||
materialList: [],
|
||||
loading: false
|
||||
loading: false,
|
||||
showEntrySelect: false,
|
||||
entryOptions: [],
|
||||
selectedEntry: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 处理输入事件
|
||||
handleInput(value) {
|
||||
async handleInput(value) {
|
||||
if (value) {
|
||||
this.fetchTrayInfo(value)
|
||||
await this.fetchTrayInfo(value)
|
||||
const first = this.materialList && this.materialList.length > 0 ? this.materialList[0] : null
|
||||
if (first && (first.warehouseId === '02' || first.warehouseId === '13')) {
|
||||
this.showEntrySelect = true
|
||||
if (first.warehouseId === '02') {
|
||||
this.entryOptions = [
|
||||
{ text: 'G1001', value: 'G1001' },
|
||||
{ text: 'G1007', value: 'G1007' }
|
||||
]
|
||||
} else {
|
||||
this.entryOptions = [
|
||||
{ text: 'G4004', value: 'G4004' },
|
||||
{ text: 'G4005', value: 'G4005' },
|
||||
{ text: 'G4006', value: 'G4006' },
|
||||
{ text: 'G5004', value: 'G5004' },
|
||||
{ text: 'G5005', value: 'G5005' },
|
||||
{ text: 'G5006', value: 'G5006' }
|
||||
]
|
||||
}
|
||||
} else {
|
||||
this.showEntrySelect = false
|
||||
this.entryOptions = []
|
||||
this.selectedEntry = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
// 处理清除事件
|
||||
handleClear() {
|
||||
this.materialList = []
|
||||
this.showEntrySelect = false
|
||||
this.entryOptions = []
|
||||
this.selectedEntry = ''
|
||||
},
|
||||
// 处理扫码事件
|
||||
handleScan() {
|
||||
@@ -131,10 +170,20 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 当入口下拉框显示时,校验是否选择了入口
|
||||
if (this.showEntrySelect && !this.selectedEntry) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.ckMakeSureByTray.selectExit'),
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const response=await ckMakeSure({
|
||||
trayCode: this.trayCode
|
||||
trayCode: this.trayCode,
|
||||
exitId: this.selectedEntry
|
||||
|
||||
})
|
||||
if (response.code==200) {
|
||||
@@ -145,14 +194,17 @@
|
||||
// 清空数据
|
||||
this.trayCode = ''
|
||||
this.materialList = []
|
||||
this.showEntrySelect = false
|
||||
this.entryOptions = []
|
||||
this.selectedEntry = ''
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: response.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.ckMakeSureByTray.outboundFailed'),
|
||||
@@ -178,6 +230,19 @@
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.select-group {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.select-label {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.scan-icon {
|
||||
font-size: 40rpx;
|
||||
padding: 0 20rpx;
|
||||
|
||||
Reference in New Issue
Block a user