现场调试修改 入库 出库 放货重新分配货位

This commit is contained in:
liuhanqing
2025-12-26 13:23:28 +08:00
parent ced125c8e9
commit 6b56e5f2ad
53 changed files with 3397 additions and 1832 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="container">
<view class="header">
<text class="title">{{ $t('outbound.bindShelf.materialInfo') }}</text>
<text class="title">物料信息</text>
</view>
<view class="warehouse-select">
@@ -9,7 +9,7 @@
v-model="selectedWarehouse"
:localdata="warehouseList"
:clear="false"
:placeholder="$t('outbound.bindShelf.selectWarehouse')"
placeholder="请选择仓库"
@change="handleWarehouseChange"
/>
</view>
@@ -19,13 +19,13 @@
v-model="selectedExit"
:localdata="exitList"
:clear="false"
:placeholder="$t('outbound.bindShelf.selectExit')"
placeholder="请选择出口"
@change="handleExitChange"
/>
</view>
<view class="loading-container" v-if="loading">
<text class="loading-text">{{ $t('outbound.bindShelf.loading') }}</text>
<text class="loading-text">加载中...</text>
</view>
<view class="materials-list" v-else-if="materialList.length > 0">
@@ -36,12 +36,12 @@
</view>
<view class="material-info">
<view class="material-title">{{ item.productName }}</view>
<view class="material-code">{{ $t('outbound.bindShelf.materialInfo') }}: {{ item.productId }}</view>
<view class="material-code">物料信息: {{ item.productId }}</view>
</view>
</view>
<view class="material-content">
<view class="quantity-control">
<text class="quantity-label">{{ $t('outbound.bindShelf.bindQuantity') }}</text>
<text class="quantity-label">绑定数量</text>
<input
type="number"
v-model="item.bindQuantity"
@@ -54,18 +54,18 @@
</view>
<view v-else class="no-data">
<text>{{ $t('outbound.bindShelf.noMaterialInfo') }}</text>
<text>暂无物料信息</text>
</view>
<view class="button-group">
<button class="bind-button" @click="openBindShelfPopup">{{ $t('outbound.bindShelf.bindShelf') }}</button>
<button class="bind-button" @click="openBindShelfPopup">绑定料架</button>
</view>
<!-- 绑定料架弹窗 -->
<uni-popup ref="bindShelfPopup" type="center">
<view class="popup-content">
<view class="popup-header">
<text class="popup-title">{{ $t('outbound.bindShelf.bindShelfTitle') }}</text>
<text class="popup-title">绑定料架</text>
<text class="popup-close" @click="closeBindShelfPopup">×</text>
</view>
@@ -74,7 +74,7 @@
<input
type="text"
v-model="shelfCode"
:placeholder="$t('outbound.bindShelf.scanShelfCode')"
placeholder="请扫描料架条码"
class="scan-input"
@input="fetchShelfInfo"
@clear="handleClear"
@@ -86,14 +86,13 @@
<view class="shelf-info" v-if="shelfInfo.length > 0">
<view v-for="(item, index) in shelfInfo" :key="index" class="shelf-item">
<text class="shelf-name">{{ item.productName || $t('outbound.bindShelf.unknownMaterial') }}</text>
<text class="shelf-code">{{ item.productId || $t('outbound.bindShelf.noCode') }}</text>
<text class="shelf-quantity">{{ item.quantity || $t('outbound.bindShelf.noQuantity') }}</text>
<text class="shelf-name">{{ item.productName || '未知物料' }}</text>
<text class="shelf-code">{{ item.productId || '无编码' }}</text>
</view>
</view>
<view class="popup-footer">
<button class="submit-button" @click="submitBindShelf">{{ $t('outbound.bindShelf.submit') }}</button>
<button class="submit-button" @click="submitBindShelf">提交</button>
</view>
</view>
</uni-popup>
@@ -245,7 +244,7 @@ export default {
this.materialList = (response.rows || []).map(item => ({
...item,
selected: false,
bindQuantity: item.quantity
bindQuantity: item.quantit
}))
} else {
uni.showToast({
@@ -257,7 +256,7 @@ export default {
} catch (error) {
console.error('获取物料信息失败:', error)
uni.showToast({
title: this.$t('outbound.bindShelf.noMaterialInfo'),
title: '暂无物料信息',
icon: 'none'
})
this.materialList = []
@@ -300,19 +299,6 @@ export default {
return
}
// 检查绑定数量是否为0或空
const invalidQuantityItem = selectedItems.find(item => {
return !item.bindQuantity || item.bindQuantity === 0
})
if (invalidQuantityItem) {
uni.showToast({
title: '绑定数量不能为0或空',
icon: 'none'
})
return
}
this.$refs.bindShelfPopup.open()
},
// 关闭绑定料架弹窗
@@ -374,7 +360,7 @@ export default {
async submitBindShelf() {
if (!this.shelfCode) {
uni.showToast({
title: this.$t('outbound.bindShelf.pleaseScanShelfCode'),
title: '请先扫描料架条码',
icon: 'none'
})
return
@@ -383,20 +369,7 @@ export default {
const selectedItems = this.materialList.filter(item => item.selected)
if (selectedItems.length === 0) {
uni.showToast({
title: this.$t('outbound.bindShelf.pleaseSelectMaterial'),
icon: 'none'
})
return
}
// 检查绑定数量是否为0或空
const invalidQuantityItem = selectedItems.find(item => {
return !item.bindQuantity || item.bindQuantity === 0
})
if (invalidQuantityItem) {
uni.showToast({
title: '绑定数量不能为0或空',
title: '请先选择需要绑定的物料',
icon: 'none'
})
return