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

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

@@ -5,13 +5,13 @@
v-model="selectedWarehouse"
:localdata="warehouseList"
:clear="false"
:placeholder="$t('stocktaking.confirmPK.selectWarehouse')"
placeholder="请选择仓库"
@change="handleWarehouseChange"
/>
</view>
<view class="add-button-container" v-if="selectedWarehouse!=''">
<button class="add-button" @click="showAddMaterialPopup">{{ $t('stocktaking.confirmPK.addMaterial') }}</button>
<button class="add-button" @click="showAddMaterialPopup">新增物料</button>
</view>
<view class="inventory-list" v-if="inventoryList.length > 0">
@@ -19,19 +19,19 @@
<uni-card>
<view class="card-content">
<view class="info-row">
<text class="label">{{ $t('stocktaking.confirmPK.materialCode') }}:</text>
<text class="label">物料编码:</text>
<text class="value">{{ item.extraField.productId }}</text>
</view>
<view class="info-row">
<text class="label">{{ $t('stocktaking.confirmPK.materialName') }}:</text>
<text class="label">物料名称:</text>
<text class="value">{{ item.extraField.materialDesc }}</text>
</view>
<view class="info-row">
<text class="label">{{ $t('stocktaking.confirmPK.inventoryQuantity') }}:</text>
<text class="label">库存数量:</text>
<text class="value">{{ item.quantity }}</text>
</view>
<view class="info-row">
<text class="label">{{ $t('stocktaking.confirmPK.countQuantity') }}:</text>
<text class="label">盘点数量:</text>
<view class="value">
<uni-easyinput
v-model.number="item.newQuantity"
@@ -43,7 +43,7 @@
</view>
</view>
<view class="button-row">
<button class="confirm-button" @click="handleConfirm(item)">{{ $t('stocktaking.confirmPK.countButton') }}</button>
<button class="confirm-button" @click="handleConfirm(item)">盘点</button>
</view>
</view>
</uni-card>
@@ -51,26 +51,26 @@
</view>
<view class="empty-state" v-else>
<text>{{ $t('stocktaking.confirmPK.noInventoryData') }}</text>
<text>暂无盘点数据</text>
</view>
<!-- 新增物料弹窗 -->
<uni-popup ref="addMaterialPopup" type="center">
<view class="popup-content">
<view class="popup-title">{{ $t('stocktaking.confirmPK.addMaterialTitle') }}</view>
<view class="popup-title">新增物料</view>
<view class="popup-form">
<view class="form-item">
<text class="form-label">{{ $t('stocktaking.confirmPK.materialCodeLabel') }}</text>
<uni-easyinput v-model="newMaterial.productId" :placeholder="$t('stocktaking.confirm.materialCodePlaceholder')" />
<text class="form-label">物料编码</text>
<uni-easyinput v-model="newMaterial.productId" placeholder="请输入物料编码" />
</view>
<view class="form-item">
<text class="form-label">{{ $t('stocktaking.confirmPK.quantityLabel') }}</text>
<uni-easyinput v-model="newMaterial.newQuantity" type="number" :placeholder="$t('stocktaking.confirm.quantityPlaceholder')" />
<text class="form-label">数量</text>
<uni-easyinput v-model="newMaterial.newQuantity" type="number" placeholder="请输入数量" />
</view>
</view>
<view class="popup-buttons">
<button class="cancel-btn" @click="hideAddMaterialPopup">{{ $t('stocktaking.confirmPK.cancel') }}</button>
<button class="submit-btn" @click="handleAddMaterial">{{ $t('stocktaking.confirmPK.confirm') }}</button>
<button class="cancel-btn" @click="hideAddMaterialPopup">取消</button>
<button class="submit-btn" @click="handleAddMaterial">确定</button>
</view>
</view>
</uni-popup>
@@ -122,7 +122,7 @@
} catch (error) {
console.error('获取仓库列表失败:', error)
uni.showToast({
title: this.$t('stocktaking.confirmPK.getWarehouseListFailed'),
title: '获取仓库列表失败',
icon: 'none'
})
}
@@ -144,7 +144,7 @@
} catch (error) {
console.error('获取库存列表失败:', error)
uni.showToast({
title: this.$t('stocktaking.confirmPK.getInventoryListFailed'),
title: '获取库存列表失败',
icon: 'none'
})
}
@@ -159,14 +159,14 @@
async handleConfirm(item) {
if (!item.newQuantity || item.newQuantity < 0) {
uni.showToast({
title: this.$t('stocktaking.confirmPK.enterValidCountQuantity'),
title: '请输入有效的盘点数量',
icon: 'none'
})
return
}
if(item.newQuantity==item.quantity){
uni.showToast({
title: this.$t('stocktaking.confirmPK.quantityMatch'),
title: '库存数量与盘点数量一致,无需盘点',
icon: 'none'
})
}
@@ -181,21 +181,21 @@
if (response.code === 200) {
uni.showToast({
title: this.$t('stocktaking.confirmPK.countSuccess'),
title: '盘点成功',
icon: 'success'
})
// 刷新库存列表
this.getInventoryList()
} else {
uni.showToast({
title: response.msg || this.$t('stocktaking.confirmPK.countFailed'),
title: response.msg || '盘点失败',
icon: 'none'
})
}
} catch (error) {
console.error('盘点失败:', error)
uni.showToast({
title: this.$t('stocktaking.confirmPK.countFailed'),
title: '盘点失败',
icon: 'none'
})
}
@@ -213,7 +213,7 @@
showAddMaterialPopup() {
if(!this.selectedWarehouse)
return uni.showToast({
title: this.$t('stocktaking.confirmPK.selectWarehouse'),
title: '请选择仓库',
icon: 'none'
})
this.$refs.addMaterialPopup.open()
@@ -233,7 +233,7 @@
async handleAddMaterial() {
if (!this.newMaterial.productId || !this.newMaterial.newQuantity || this.newMaterial.newQuantity < 0) {
uni.showToast({
title: this.$t('stocktaking.confirmPK.enterValidMaterialInfo'),
title: '请输入有效的物料信息',
icon: 'none'
})
return
@@ -249,7 +249,7 @@
if (response.code === 200) {
uni.showToast({
title: this.$t('stocktaking.confirmPK.addSuccess'),
title: '新增成功',
icon: 'success'
})
// 关闭弹窗并刷新列表
@@ -257,7 +257,7 @@
this.getInventoryList()
} else {
uni.showToast({
title: response.msg || this.$t('stocktaking.confirmPK.addFailed'),
title: response.msg || '新增失败',
icon: 'none'
})
}