|
|
@ -34,6 +34,16 @@ |
|
|
<span class="info-value">{{ stockInfo.qtyOnHand || '' }}</span> |
|
|
<span class="info-value">{{ stockInfo.qtyOnHand || '' }}</span> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="info-row"> |
|
|
|
|
|
<span class="info-label">物料编码</span> |
|
|
|
|
|
<span class="info-value">{{ stockInfo.partNo || '' }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="info-row"> |
|
|
|
|
|
<span class="info-label">物料名称</span> |
|
|
|
|
|
<span class="info-value">{{ stockInfo.partDesc || '' }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="info-row"> |
|
|
<div class="info-row"> |
|
|
<span class="info-label">所在仓库</span> |
|
|
<span class="info-label">所在仓库</span> |
|
|
<span class="info-value">{{ stockInfo.warehouseName || '' }}</span> |
|
|
<span class="info-value">{{ stockInfo.warehouseName || '' }}</span> |
|
|
@ -53,7 +63,16 @@ |
|
|
|
|
|
|
|
|
<div class="info-row"> |
|
|
<div class="info-row"> |
|
|
<span class="info-label">标签状态</span> |
|
|
<span class="info-label">标签状态</span> |
|
|
<span class="info-value" :class="stockInfo.status === '冻结' ? 'status-frozen' : 'status-normal'">{{ stockInfo.status || '' }}</span> |
|
|
|
|
|
|
|
|
<div class="input-wrapper"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="newStatus" |
|
|
|
|
|
placeholder="请选择状态" |
|
|
|
|
|
class="status-select" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option label="在库" value="在库"></el-option> |
|
|
|
|
|
<el-option label="冻结" value="冻结"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="info-row"> |
|
|
<div class="info-row"> |
|
|
@ -123,6 +142,7 @@ export default { |
|
|
scanCode: '', |
|
|
scanCode: '', |
|
|
stockInfo: {}, |
|
|
stockInfo: {}, |
|
|
newLocationId: '', |
|
|
newLocationId: '', |
|
|
|
|
|
newStatus: '', |
|
|
newProductionDate: '', |
|
|
newProductionDate: '', |
|
|
newExpiryDate: '' |
|
|
newExpiryDate: '' |
|
|
}; |
|
|
}; |
|
|
@ -149,9 +169,10 @@ export default { |
|
|
this.stockInfo = data.data; |
|
|
this.stockInfo = data.data; |
|
|
// 初始化输入值为当前值 |
|
|
// 初始化输入值为当前值 |
|
|
this.newLocationId = this.stockInfo.locationId || ''; |
|
|
this.newLocationId = this.stockInfo.locationId || ''; |
|
|
|
|
|
this.newStatus = this.stockInfo.status || ''; |
|
|
this.newProductionDate = this.stockInfo.productionDate ? moment(this.stockInfo.productionDate).format('YYYY-MM-DD') : ''; |
|
|
this.newProductionDate = this.stockInfo.productionDate ? moment(this.stockInfo.productionDate).format('YYYY-MM-DD') : ''; |
|
|
this.newExpiryDate = this.stockInfo.expiryDate ? moment(this.stockInfo.expiryDate).format('YYYY-MM-DD') : ''; |
|
|
this.newExpiryDate = this.stockInfo.expiryDate ? moment(this.stockInfo.expiryDate).format('YYYY-MM-DD') : ''; |
|
|
this.$message.success('获取标签信息成功'); |
|
|
|
|
|
|
|
|
this.$message.success('操作成功!'); |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.msg || '未找到该标签的库存信息'); |
|
|
this.$message.error(data.msg || '未找到该标签的库存信息'); |
|
|
this.stockInfo = {}; |
|
|
this.stockInfo = {}; |
|
|
@ -175,6 +196,15 @@ export default { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 校验:只有状态是"在库"或"冻结"的标签才能改标签状态 |
|
|
|
|
|
const oldStatus = this.stockInfo.status || ''; |
|
|
|
|
|
const hasStatusChange = this.newStatus !== oldStatus; |
|
|
|
|
|
|
|
|
|
|
|
if (hasStatusChange && oldStatus !== '在库' && oldStatus !== '冻结') { |
|
|
|
|
|
this.$message.error(`该标签状态为"${oldStatus}",不允许修改`); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 检查是否有变动 |
|
|
// 检查是否有变动 |
|
|
const oldLocationId = this.stockInfo.locationId || ''; |
|
|
const oldLocationId = this.stockInfo.locationId || ''; |
|
|
const oldProductionDate = this.stockInfo.productionDate ? moment(this.stockInfo.productionDate).format('YYYY-MM-DD') : ''; |
|
|
const oldProductionDate = this.stockInfo.productionDate ? moment(this.stockInfo.productionDate).format('YYYY-MM-DD') : ''; |
|
|
@ -184,7 +214,7 @@ export default { |
|
|
const hasProductionDateChange = this.newProductionDate !== oldProductionDate; |
|
|
const hasProductionDateChange = this.newProductionDate !== oldProductionDate; |
|
|
const hasExpiryDateChange = this.newExpiryDate !== oldExpiryDate; |
|
|
const hasExpiryDateChange = this.newExpiryDate !== oldExpiryDate; |
|
|
|
|
|
|
|
|
if (!hasLocationChange && !hasProductionDateChange && !hasExpiryDateChange) { |
|
|
|
|
|
|
|
|
if (!hasLocationChange && !hasProductionDateChange && !hasExpiryDateChange && !hasStatusChange) { |
|
|
this.$message.warning('没有检测到属性变动,请修改后再提交'); |
|
|
this.$message.warning('没有检测到属性变动,请修改后再提交'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
@ -200,6 +230,8 @@ export default { |
|
|
quantity: this.stockInfo.qtyOnHand, |
|
|
quantity: this.stockInfo.qtyOnHand, |
|
|
oldLocationId: oldLocationId, |
|
|
oldLocationId: oldLocationId, |
|
|
newLocationId: this.newLocationId, |
|
|
newLocationId: this.newLocationId, |
|
|
|
|
|
oldStatus: oldStatus, |
|
|
|
|
|
newStatus: this.newStatus, |
|
|
oldProductionDate: oldProductionDate, |
|
|
oldProductionDate: oldProductionDate, |
|
|
newProductionDate: this.newProductionDate, |
|
|
newProductionDate: this.newProductionDate, |
|
|
oldExpiryDate: oldExpiryDate, |
|
|
oldExpiryDate: oldExpiryDate, |
|
|
@ -211,6 +243,9 @@ export default { |
|
|
if (hasLocationChange) { |
|
|
if (hasLocationChange) { |
|
|
changeMsg += `库位: ${oldLocationId} → ${this.newLocationId}\n`; |
|
|
changeMsg += `库位: ${oldLocationId} → ${this.newLocationId}\n`; |
|
|
} |
|
|
} |
|
|
|
|
|
if (hasStatusChange) { |
|
|
|
|
|
changeMsg += `状态: ${oldStatus} → ${this.newStatus}\n`; |
|
|
|
|
|
} |
|
|
if (hasProductionDateChange) { |
|
|
if (hasProductionDateChange) { |
|
|
changeMsg += `生产日期: ${oldProductionDate} → ${this.newProductionDate}\n`; |
|
|
changeMsg += `生产日期: ${oldProductionDate} → ${this.newProductionDate}\n`; |
|
|
} |
|
|
} |
|
|
@ -267,6 +302,7 @@ export default { |
|
|
resetForm() { |
|
|
resetForm() { |
|
|
this.stockInfo = {}; |
|
|
this.stockInfo = {}; |
|
|
this.newLocationId = ''; |
|
|
this.newLocationId = ''; |
|
|
|
|
|
this.newStatus = ''; |
|
|
this.newProductionDate = ''; |
|
|
this.newProductionDate = ''; |
|
|
this.newExpiryDate = ''; |
|
|
this.newExpiryDate = ''; |
|
|
|
|
|
|
|
|
@ -410,6 +446,17 @@ export default { |
|
|
padding: 8px 12px; |
|
|
padding: 8px 12px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.status-select { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.status-select ::v-deep .el-input__inner { |
|
|
|
|
|
border: 1px solid #17B3A3; |
|
|
|
|
|
border-radius: 4px; |
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
padding: 8px 12px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/* 底部操作按钮 */ |
|
|
/* 底部操作按钮 */ |
|
|
.bottom-actions { |
|
|
.bottom-actions { |
|
|
display: flex; |
|
|
display: flex; |
|
|
|