手持机
This commit is contained in:
@@ -126,6 +126,29 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
|
|
||||||
|
<!-- 入口选择弹出框 -->
|
||||||
|
<uni-popup ref="entrancePopup" type="center">
|
||||||
|
<view class="popup-content">
|
||||||
|
<view class="popup-title">选择入口</view>
|
||||||
|
<view class="popup-body">
|
||||||
|
<view class="input-group">
|
||||||
|
<text class="input-label">入口</text>
|
||||||
|
<picker @change="handleEntranceChange" :value="selectedEntranceIndex" :range="entranceList" range-key="name">
|
||||||
|
<view class="picker-input">
|
||||||
|
<text v-if="selectedEntrance">{{ selectedEntrance }}</text>
|
||||||
|
<text v-else class="placeholder-text">请选择入口</text>
|
||||||
|
<text class="picker-arrow">▼</text>
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="popup-buttons">
|
||||||
|
<button class="popup-btn confirm-btn" @click="handleConfirmEntrance" :disabled="!selectedEntrance" :class="{'disabled-btn': !selectedEntrance}">确认</button>
|
||||||
|
<button class="popup-btn cancel-btn" @click="handleCancelEntrance">取消</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -146,6 +169,11 @@
|
|||||||
cargoSpaceName: '',
|
cargoSpaceName: '',
|
||||||
cargoSpaceList: [],
|
cargoSpaceList: [],
|
||||||
cargoSpaceHeight: null,
|
cargoSpaceHeight: null,
|
||||||
|
// 入口选择相关
|
||||||
|
entranceList: [],
|
||||||
|
selectedEntrance: '',
|
||||||
|
selectedEntranceId: '',
|
||||||
|
selectedEntranceIndex: 0,
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -159,6 +187,25 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 根据仓库ID获取入口列表
|
||||||
|
getEntranceListByWarehouseId(warehouseId) {
|
||||||
|
this.entranceList = []
|
||||||
|
this.selectedEntrance = ''
|
||||||
|
this.selectedEntranceId = ''
|
||||||
|
this.selectedEntranceIndex = 0
|
||||||
|
|
||||||
|
if (warehouseId === '02') {
|
||||||
|
this.entranceList = [
|
||||||
|
{ id: 'G1001', name: 'G1001' },
|
||||||
|
{ id: 'G1007', name: 'G1007' }
|
||||||
|
]
|
||||||
|
} else if (warehouseId === '13') {
|
||||||
|
this.entranceList = [
|
||||||
|
{ id: 'G3006', name: 'G3006' },
|
||||||
|
{ id: 'G1001', name: 'G1001' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 处理货位选择
|
// 处理货位选择
|
||||||
async handleRecommendCargoSpace() {
|
async handleRecommendCargoSpace() {
|
||||||
@@ -310,40 +357,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const warehouseType = this.materialList[0].warehouseType
|
const warehouseType = this.materialList[0].warehouseType
|
||||||
|
const warehouseId = this.materialList[0].warehouseId
|
||||||
|
|
||||||
if (warehouseType === '1') {
|
if (warehouseType === '1') {
|
||||||
// 显示货位选择弹出框
|
// 显示货位选择弹出框
|
||||||
this.$refs.cargoSpacePopup.open()
|
this.$refs.cargoSpacePopup.open()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 非货位类型仓库,直接调用入库接口
|
// 非货位类型仓库,显示入口选择弹出框
|
||||||
try {
|
this.getEntranceListByWarehouseId(warehouseId)
|
||||||
const response = await addInJob({
|
if (this.entranceList.length > 0) {
|
||||||
trayCode: this.trayCode,
|
this.$refs.entrancePopup.open()
|
||||||
warehouseId: this.materialList[0].warehouseId
|
} else {
|
||||||
})
|
// 如果没有配置入口,直接调用入库接口
|
||||||
|
this.submitWithoutCargoSpace()
|
||||||
if (response.code === 200) {
|
|
||||||
uni.showToast({
|
|
||||||
title: this.$t('inbound.bindMsg.inboundSuccess'),
|
|
||||||
icon: 'success'
|
|
||||||
})
|
|
||||||
// 清空数据
|
|
||||||
this.trayCode = ''
|
|
||||||
this.materialList = []
|
|
||||||
this.stockinDetailId=''
|
|
||||||
// this.cargoSpaceId = ''
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: response.msg || this.$t('inbound.bindMsg.inboundFailed'),
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
uni.showToast({
|
|
||||||
title: this.$t('inbound.bindMsg.inboundFailed'),
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -366,6 +393,98 @@
|
|||||||
this.cargoSpaceName = ''
|
this.cargoSpaceName = ''
|
||||||
this.cargoSpaceHeight=''
|
this.cargoSpaceHeight=''
|
||||||
},
|
},
|
||||||
|
// 处理入口选择变化
|
||||||
|
handleEntranceChange(e) {
|
||||||
|
const index = e.detail.value
|
||||||
|
this.selectedEntranceIndex = index
|
||||||
|
if (this.entranceList[index]) {
|
||||||
|
this.selectedEntrance = this.entranceList[index].name
|
||||||
|
this.selectedEntranceId = this.entranceList[index].id
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 处理确认入口选择
|
||||||
|
async handleConfirmEntrance() {
|
||||||
|
if (!this.selectedEntranceId) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请选择入口',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$refs.entrancePopup.close()
|
||||||
|
this.submitWithEntrance()
|
||||||
|
},
|
||||||
|
// 处理取消入口选择
|
||||||
|
handleCancelEntrance() {
|
||||||
|
this.$refs.entrancePopup.close()
|
||||||
|
this.selectedEntrance = ''
|
||||||
|
this.selectedEntranceId = ''
|
||||||
|
this.selectedEntranceIndex = 0
|
||||||
|
},
|
||||||
|
// 不带货位信息提交入库
|
||||||
|
async submitWithoutCargoSpace() {
|
||||||
|
try {
|
||||||
|
const response = await addInJob({
|
||||||
|
trayCode: this.trayCode,
|
||||||
|
warehouseId: this.materialList[0].warehouseId
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: this.$t('inbound.bindMsg.inboundSuccess'),
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
// 清空数据
|
||||||
|
this.trayCode = ''
|
||||||
|
this.materialList = []
|
||||||
|
this.stockinDetailId = ''
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: response.msg || this.$t('inbound.bindMsg.inboundFailed'),
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({
|
||||||
|
title: this.$t('inbound.bindMsg.inboundFailed'),
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 带入口信息提交入库
|
||||||
|
async submitWithEntrance() {
|
||||||
|
try {
|
||||||
|
const response = await addInJob({
|
||||||
|
trayCode: this.trayCode,
|
||||||
|
warehouseId: this.materialList[0].warehouseId,
|
||||||
|
entranceId: this.selectedEntranceId
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: this.$t('inbound.bindMsg.inboundSuccess'),
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
// 清空数据
|
||||||
|
this.trayCode = ''
|
||||||
|
this.materialList = []
|
||||||
|
this.stockinDetailId = ''
|
||||||
|
this.selectedEntrance = ''
|
||||||
|
this.selectedEntranceId = ''
|
||||||
|
this.selectedEntranceIndex = 0
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: response.msg || this.$t('inbound.bindMsg.inboundFailed'),
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({
|
||||||
|
title: this.$t('inbound.bindMsg.inboundFailed'),
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
// 处理子单据输入事件
|
// 处理子单据输入事件
|
||||||
async handleSubOrderInput(value) {
|
async handleSubOrderInput(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -724,4 +843,25 @@
|
|||||||
color: #999;
|
color: #999;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.picker-input {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 20rpx;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
min-height: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeholder-text {
|
||||||
|
color: #999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-arrow {
|
||||||
|
color: #666;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ public class PdaServiceImp implements PdaService {
|
|||||||
public AjaxResult addInJob(TrayCodeMsg trayCodeMsg) {
|
public AjaxResult addInJob(TrayCodeMsg trayCodeMsg) {
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("v_tray_code", trayCodeMsg.getTrayCode());
|
map.put("v_tray_code", trayCodeMsg.getTrayCode());
|
||||||
// map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
|
map.put("v_entrance_id", trayCodeMsg.getEntranceId());
|
||||||
map.put("v_cargo_space_id", trayCodeMsg.getCargoSpaceId());
|
map.put("v_cargo_space_id", trayCodeMsg.getCargoSpaceId());
|
||||||
pdaMapper.addInJob(map);
|
pdaMapper.addInJob(map);
|
||||||
String result = map.get("v_result").toString();
|
String result = map.get("v_result").toString();
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
<select id="addInJob" parameterType="java.util.Map" statementType="CALLABLE">
|
<select id="addInJob" parameterType="java.util.Map" statementType="CALLABLE">
|
||||||
{call proc_add_in_job(
|
{call proc_add_in_job(
|
||||||
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
|
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{v_entrance_id,mode=IN,jdbcType=VARCHAR},
|
||||||
#{v_cargo_space_id,mode=IN,jdbcType=VARCHAR},
|
#{v_cargo_space_id,mode=IN,jdbcType=VARCHAR},
|
||||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||||
|
|||||||
Reference in New Issue
Block a user