|
|
|
@ -66,16 +66,16 @@ |
|
|
|
|
|
|
|
<!-- 右列:入库数量和单位 --> |
|
|
|
<div class="material-column quantity-column"> |
|
|
|
<!-- 入库数量 --> |
|
|
|
<div class="input-item"> |
|
|
|
<span class="input-label">入库数量</span> |
|
|
|
<el-input |
|
|
|
v-model="actualQty" |
|
|
|
placeholder="入库数量" |
|
|
|
type="number" |
|
|
|
@keyup.enter.native="handleAddMaterial" |
|
|
|
class="input-field" clearable |
|
|
|
/> |
|
|
|
<!-- 入库数量和批次号 --> |
|
|
|
<div class="input-row"> |
|
|
|
<div class="input-item quantity-item"> |
|
|
|
<span class="input-label">入库数量</span> |
|
|
|
<el-input class="inlineNumber numInput" v-model="actualQty" placeholder="入库数量" type="number" @keyup.enter.native="handleAddMaterial" clearable/> |
|
|
|
</div> |
|
|
|
<div class="input-item batch-item"> |
|
|
|
<span class="input-label">批次号</span> |
|
|
|
<el-input class="inlineNumber numInput" v-model="batchNo" placeholder="*" @keyup.enter.native="handleAddMaterial" ref="batchInput" clearable/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 单位 --> |
|
|
|
@ -101,6 +101,9 @@ |
|
|
|
<i class="el-icon-circle-check"></i> |
|
|
|
<span>入库信息确认</span> |
|
|
|
</div> |
|
|
|
<div class="title-right"> |
|
|
|
<span class="material-list-link" @click="showMaterialListDialog">物料清单</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 物料列表 --> |
|
|
|
@ -109,6 +112,7 @@ |
|
|
|
<div class="col-no">NO.</div> |
|
|
|
<div class="col-label">标签条码</div> |
|
|
|
<div class="col-part">物料编码</div> |
|
|
|
<div class="col-batch">批次号</div> |
|
|
|
<div class="col-qty">标签数量</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -121,6 +125,7 @@ |
|
|
|
<div class="col-no">{{ materialList.length - index }}</div> |
|
|
|
<div class="col-label">{{ item.labelCode || item.materialCode }}</div> |
|
|
|
<div class="col-part">{{ item.materialCode }}</div> |
|
|
|
<div class="col-batch">{{ item.batchNo || '-' }}</div> |
|
|
|
<div class="col-qty">{{ item.actualQty }}</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -234,6 +239,7 @@ export default { |
|
|
|
return { |
|
|
|
materialCode: '', |
|
|
|
actualQty: '', |
|
|
|
batchNo: '*', |
|
|
|
inboundInfo: {}, |
|
|
|
materialList: [], |
|
|
|
originalMaterialList: [], |
|
|
|
@ -298,10 +304,19 @@ export default { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查是否已经添加过该物料 |
|
|
|
const exists = this.materialList.find(item => item.materialCode === this.materialCode.trim()); |
|
|
|
if (!this.batchNo.trim()) { |
|
|
|
this.$message.warning('请输入批次号'); |
|
|
|
this.$refs.batchInput.focus(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查是否已经添加过该物料和批次号组合 |
|
|
|
const exists = this.materialList.find(item => |
|
|
|
item.materialCode === this.materialCode.trim() && |
|
|
|
item.batchNo === this.batchNo.trim() |
|
|
|
); |
|
|
|
if (exists) { |
|
|
|
this.$message.warning('该物料已添加,请勿重复添加'); |
|
|
|
this.$message.warning('该物料和批次号组合已添加,请勿重复添加'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
@ -312,6 +327,7 @@ export default { |
|
|
|
inboundNo: this.inboundNo, |
|
|
|
materialCode: this.materialCode.trim(), |
|
|
|
actualQty: parseFloat(this.actualQty), |
|
|
|
batchNo: this.batchNo.trim(), |
|
|
|
warehouseId: getCurrentWarehouse() |
|
|
|
}; |
|
|
|
|
|
|
|
@ -326,12 +342,14 @@ export default { |
|
|
|
materialName: materialData.materialName, |
|
|
|
unit: materialData.unit, |
|
|
|
actualQty: materialData.actualQty, |
|
|
|
batchNo: this.batchNo.trim(), |
|
|
|
labelCode: materialData.labelCode |
|
|
|
}); |
|
|
|
|
|
|
|
// 清空输入 |
|
|
|
this.materialCode = ''; |
|
|
|
this.actualQty = ''; |
|
|
|
this.batchNo = '*'; |
|
|
|
this.currentMaterial = {}; |
|
|
|
|
|
|
|
// 聚焦到物料编码输入框 |
|
|
|
@ -378,20 +396,18 @@ export default { |
|
|
|
this.$message.warning('请输入库位号'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
const params = { |
|
|
|
site: this.inboundInfo.site, |
|
|
|
buNo: this.inboundInfo.buNo, |
|
|
|
inboundNo: this.inboundNo, |
|
|
|
warehouseId: getCurrentWarehouse(), |
|
|
|
locationCode: this.locationCode.trim(), |
|
|
|
materials: this.materialList.map(material => ({ |
|
|
|
materialCode: material.materialCode, |
|
|
|
actualQty: material.actualQty, |
|
|
|
batchNo: material.batchNo, |
|
|
|
labelCode: material.labelCode |
|
|
|
})) |
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
confirmOtherInbound(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('入库成功'); |
|
|
|
@ -496,6 +512,11 @@ export default { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 初始化字段 |
|
|
|
this.materialCode = ''; |
|
|
|
this.actualQty = ''; |
|
|
|
this.batchNo = '*'; |
|
|
|
|
|
|
|
// 聚焦物料编码输入框 |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.materialInput) { |
|
|
|
@ -681,6 +702,16 @@ export default { |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.batch-item { |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.input-row { |
|
|
|
display: flex; |
|
|
|
gap: 8px; |
|
|
|
margin-bottom: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.input-label { |
|
|
|
font-size: 14px; |
|
|
|
color: #666; |
|
|
|
@ -899,6 +930,11 @@ export default { |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.col-batch { |
|
|
|
flex: 1.5; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.col-qty { |
|
|
|
width: 60px; |
|
|
|
text-align: center; |
|
|
|
@ -1328,5 +1364,32 @@ export default { |
|
|
|
.col-label, .col-part { |
|
|
|
flex: 1.5; |
|
|
|
} |
|
|
|
|
|
|
|
.col-batch { |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
} |
|
|
|
.material-list-link { |
|
|
|
color: #17B3A3; |
|
|
|
font-size: 14px; |
|
|
|
font-weight: 500; |
|
|
|
cursor: pointer; |
|
|
|
text-decoration: underline; |
|
|
|
transition: color 0.2s ease; |
|
|
|
} |
|
|
|
|
|
|
|
.material-list-link:hover { |
|
|
|
color: #0d8f7f; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .inlineNumber input::-webkit-outer-spin-button, |
|
|
|
/deep/ .inlineNumber input::-webkit-inner-spin-button { |
|
|
|
-webkit-appearance: none; |
|
|
|
|
|
|
|
} |
|
|
|
/deep/ .inlineNumber input[type="number"]{ |
|
|
|
-moz-appearance: textfield; |
|
|
|
padding-right: 5px !important; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|