任务推送解耦

This commit is contained in:
liuhanqing
2025-10-13 10:54:17 +08:00
parent 3581436d6c
commit b884a7164e
14 changed files with 1088 additions and 1065 deletions

View File

@@ -75,7 +75,7 @@
</view>
</uni-popup>
<view class="table-container" v-if="materialList.length > 0">
<uni-table border stripe :emptyText="$t('inbound.bindMsg.noData')">
<uni-tr>
@@ -97,7 +97,7 @@
<view class="button-group" v-if="materialList.length > 0">
<button class="confirm-button" @click="handleConfirm">{{ $t('inbound.bindMsg.confirmInbound') }}</button>
</view>
<!-- 货位选择弹出框 -->
<uni-popup ref="cargoSpacePopup" type="center">
<view class="popup-content">
@@ -174,7 +174,7 @@
selectedEntrance: '',
selectedEntranceId: '',
selectedEntranceIndex: 0,
}
},
onReady() {
@@ -183,8 +183,8 @@
this.$refs.trayCodeInput.onFocus()
})
}, 100)
},
methods: {
// 根据仓库ID获取入口列表
@@ -193,7 +193,7 @@
this.selectedEntrance = ''
this.selectedEntranceId = ''
this.selectedEntranceIndex = 0
if (warehouseId === '02') {
this.entranceList = [
{ id: 'G1001', name: 'G1001' },
@@ -202,11 +202,13 @@
} else if (warehouseId === '13') {
this.entranceList = [
{ id: 'G3006', name: 'G3006' },
{ id: 'G1001', name: 'G1001' }
{ id: 'G2007', name: 'G2007' },
{ id: 'G4006', name: 'G4006' },
{ id: 'G5006', name: 'G5006' }
]
}
},
// 处理货位选择
async handleRecommendCargoSpace() {
// try {
@@ -268,14 +270,14 @@
})
return
}
try {
const response = await addInJob({
cargoSpaceId: this.cargoSpaceId,
trayCode: this.trayCode,
warehouseId: this.materialList[0].warehouseId
})
if (response.code === 200) {
uni.showToast({
title: this.$t('inbound.bindMsg.inboundSuccess'),
@@ -324,7 +326,7 @@
async fetchTrayInfo(trayCode) {
try {
const response = await getTrayInfo(trayCode)
if (response.code===200) {
if(response.data.length>0){
@@ -332,7 +334,7 @@
}else{
this.materialList=[]
}
} else {
uni.showToast({
title: response.msg || this.$t('inbound.bindMsg.getTrayInfoFailed'),
@@ -362,7 +364,7 @@
if (warehouseType === '1') {
// 显示货位选择弹出框
this.$refs.cargoSpacePopup.open()
} else {
// 非货位类型仓库,显示入口选择弹出框
this.getEntranceListByWarehouseId(warehouseId)
@@ -428,7 +430,7 @@
trayCode: this.trayCode,
warehouseId: this.materialList[0].warehouseId
})
if (response.code === 200) {
uni.showToast({
title: this.$t('inbound.bindMsg.inboundSuccess'),
@@ -459,7 +461,7 @@
warehouseId: this.materialList[0].warehouseId,
entranceId: this.selectedEntranceId
})
if (response.code === 200) {
uni.showToast({
title: this.$t('inbound.bindMsg.inboundSuccess'),
@@ -503,7 +505,7 @@
if (this.subOrderInfo) {
this.$refs.subOrderPopup.open()
}
}
},
// 处理子单据清除事件
@@ -579,7 +581,7 @@
icon: 'none'
})
}
const response = await bindTray({
trayCode: this.trayCode,
@@ -597,7 +599,7 @@
this.subOrderInfo = null
this.inQuantity=''
this.fetchTrayInfo(this.trayCode)
} else {
uni.showToast({
title: response.msg || this.$t('inbound.bindMsg.bindFailed'),
@@ -621,7 +623,7 @@
trayCode: this.trayCode,
stockinDetailId: stockinDetailId
})
if (response.code === 200) {
uni.showToast({
title: this.$t('inbound.bindMsg.unbindSuccess'),
@@ -644,7 +646,7 @@
}
}
}
</script>
<style>
@@ -665,38 +667,38 @@
.container {
padding: 20rpx;
}
.input-group {
margin-bottom: 30rpx;
}
.input-label {
display: block;
margin-bottom: 10rpx;
font-size: 28rpx;
color: #333;
}
.scan-icon {
font-size: 40rpx;
padding: 0 20rpx;
}
.table-container {
background-color: #ffffff;
border-radius: 8rpx;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
}
.cargo-space-container {
margin-bottom: 30rpx;
}
.cargo-space-input {
display: flex;
align-items: center;
}
.recommend-btn {
background-color: #409eff;
color: #ffffff;
@@ -707,12 +709,12 @@
font-size: 28rpx;
margin-left: 20rpx;
}
.button-group {
margin-top: 30rpx;
padding: 0 20rpx;
}
.confirm-button {
background-color: #409eff;
color: #ffffff;