|
|
|
@ -98,6 +98,37 @@ |
|
|
|
取消 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 库位号输入覆盖层 --> |
|
|
|
<div v-if="showLocationDialog" class="location-overlay"> |
|
|
|
<div class="location-modal"> |
|
|
|
<div class="modal-header"> |
|
|
|
<span class="modal-title">扫描库位号</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal-body"> |
|
|
|
<div class="location-input-section"> |
|
|
|
<div class="input-wrapper"> |
|
|
|
<i class="el-icon-location-outline input-icon"></i> |
|
|
|
<input |
|
|
|
v-model="locationCode" |
|
|
|
placeholder="请扫描库位号" |
|
|
|
@keyup.enter="submitInbound" |
|
|
|
ref="locationInput" |
|
|
|
class="location-input" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal-footer"> |
|
|
|
<button class="btn-cancel" @click="cancelLocationInput">取消</button> |
|
|
|
<button class="btn-confirm" @click="submitInbound" :disabled="!locationCode.trim()"> |
|
|
|
确认上架 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -112,7 +143,9 @@ export default { |
|
|
|
materialInfo: {}, |
|
|
|
labelList: [], |
|
|
|
inboundNo: '', |
|
|
|
partNo: '' |
|
|
|
partNo: '', |
|
|
|
showLocationDialog: false, |
|
|
|
locationCode: '' |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -188,10 +221,38 @@ export default { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 显示库位号输入对话框 |
|
|
|
this.showLocationDialog = true; |
|
|
|
this.locationCode = ''; |
|
|
|
|
|
|
|
// 聚焦到库位号输入框 |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.locationInput) { |
|
|
|
this.$refs.locationInput.focus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 取消库位号输入 |
|
|
|
cancelLocationInput() { |
|
|
|
this.showLocationDialog = false; |
|
|
|
this.locationCode = ''; |
|
|
|
}, |
|
|
|
|
|
|
|
// 提交入库 |
|
|
|
submitInbound() { |
|
|
|
if (!this.locationCode.trim()) { |
|
|
|
this.$message.warning('请输入库位号'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
const params = { |
|
|
|
site:this.materialInfo.site, |
|
|
|
buNo: this.materialInfo.buNo, |
|
|
|
inboundNo: this.inboundNo, |
|
|
|
partNo: this.partNo, |
|
|
|
warehouseId: getCurrentWarehouse(), |
|
|
|
locationCode: this.locationCode.trim(), |
|
|
|
labels: this.labelList.map(label => ({ |
|
|
|
labelCode: label.labelCode, |
|
|
|
quantity: label.quantity, |
|
|
|
@ -199,21 +260,22 @@ export default { |
|
|
|
})) |
|
|
|
}; |
|
|
|
|
|
|
|
this.$confirm('确定提交入库信息吗?', '确认入库', { |
|
|
|
this.$confirm(`确定将标签上架到库位 ${this.locationCode} 吗?`, '确认上架', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'info' |
|
|
|
}).then(() => { |
|
|
|
confirmInboundStorage(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('入库成功'); |
|
|
|
this.$message.success('上架成功'); |
|
|
|
this.showLocationDialog = false; |
|
|
|
this.$router.back(); |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '入库失败'); |
|
|
|
this.$message.error(data.msg || '上架失败'); |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error('入库失败:', error); |
|
|
|
this.$message.error('入库失败'); |
|
|
|
console.error('上架失败:', error); |
|
|
|
this.$message.error('上架失败'); |
|
|
|
}); |
|
|
|
}).catch(() => { |
|
|
|
// 用户取消 |
|
|
|
@ -612,4 +674,155 @@ export default { |
|
|
|
flex: 1.5; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* 库位号覆盖层样式 */ |
|
|
|
.location-overlay { |
|
|
|
position: fixed; |
|
|
|
top: 0; |
|
|
|
left: 0; |
|
|
|
right: 0; |
|
|
|
bottom: 0; |
|
|
|
background: rgba(0, 0, 0, 0.5); |
|
|
|
z-index: 9999; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
padding: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.location-modal { |
|
|
|
background: white; |
|
|
|
border-radius: 12px; |
|
|
|
width: 100%; |
|
|
|
max-width: 400px; |
|
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
|
|
|
|
.modal-header { |
|
|
|
background: #17B3A3; |
|
|
|
color: white; |
|
|
|
padding: 16px 20px; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.modal-title { |
|
|
|
font-size: 16px; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
|
|
|
|
.modal-body { |
|
|
|
padding: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.location-input-section { |
|
|
|
margin-bottom: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.input-label { |
|
|
|
font-size: 14px; |
|
|
|
color: #333; |
|
|
|
margin-bottom: 12px; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
|
|
|
|
.input-wrapper { |
|
|
|
position: relative; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.input-icon { |
|
|
|
position: absolute; |
|
|
|
left: 12px; |
|
|
|
font-size: 18px; |
|
|
|
color: #17B3A3; |
|
|
|
z-index: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.location-input { |
|
|
|
width: 100%; |
|
|
|
height: 48px; |
|
|
|
padding: 0 16px 0 40px; |
|
|
|
border: 1px solid #dcdfe6; |
|
|
|
border-radius: 8px; |
|
|
|
font-size: 16px; |
|
|
|
outline: none; |
|
|
|
transition: border-color 0.2s; |
|
|
|
} |
|
|
|
|
|
|
|
.location-input:focus { |
|
|
|
border-color: #17B3A3; |
|
|
|
} |
|
|
|
|
|
|
|
.location-input::placeholder { |
|
|
|
color: #c0c4cc; |
|
|
|
} |
|
|
|
|
|
|
|
.location-info { |
|
|
|
background: #f8f9fa; |
|
|
|
border-radius: 8px; |
|
|
|
padding: 16px; |
|
|
|
border-left: 4px solid #17B3A3; |
|
|
|
} |
|
|
|
|
|
|
|
.location-info .info-item { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.location-info .label { |
|
|
|
font-size: 14px; |
|
|
|
color: #666; |
|
|
|
margin-right: 12px; |
|
|
|
min-width: 80px; |
|
|
|
} |
|
|
|
|
|
|
|
.location-info .value { |
|
|
|
font-size: 14px; |
|
|
|
color: #333; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
|
|
|
|
.modal-footer { |
|
|
|
padding: 16px 20px; |
|
|
|
display: flex; |
|
|
|
justify-content: flex-end; |
|
|
|
gap: 12px; |
|
|
|
border-top: 1px solid #f0f0f0; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-cancel, |
|
|
|
.btn-confirm { |
|
|
|
padding: 10px 20px; |
|
|
|
border-radius: 6px; |
|
|
|
font-size: 14px; |
|
|
|
cursor: pointer; |
|
|
|
transition: all 0.2s; |
|
|
|
border: none; |
|
|
|
outline: none; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-cancel { |
|
|
|
background: #f5f5f5; |
|
|
|
color: #666; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-cancel:hover { |
|
|
|
background: #e6e6e6; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-confirm { |
|
|
|
background: #17B3A3; |
|
|
|
color: white; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-confirm:hover:not(:disabled) { |
|
|
|
background: #0d8f7f; |
|
|
|
} |
|
|
|
|
|
|
|
.btn-confirm:disabled { |
|
|
|
background: #c0c4cc; |
|
|
|
cursor: not-allowed; |
|
|
|
} |
|
|
|
</style> |