diff --git a/src/views/modules/property-change/propertyChange.vue b/src/views/modules/property-change/propertyChange.vue index e29b7ae..af00320 100644 --- a/src/views/modules/property-change/propertyChange.vue +++ b/src/views/modules/property-change/propertyChange.vue @@ -34,6 +34,16 @@ {{ stockInfo.qtyOnHand || '' }} +
+ 物料编码 + {{ stockInfo.partNo || '' }} +
+ +
+ 物料名称 + {{ stockInfo.partDesc || '' }} +
+
所在仓库 {{ stockInfo.warehouseName || '' }} @@ -53,7 +63,16 @@
标签状态 - {{ stockInfo.status || '' }} +
+ + + + +
@@ -123,6 +142,7 @@ export default { scanCode: '', stockInfo: {}, newLocationId: '', + newStatus: '', newProductionDate: '', newExpiryDate: '' }; @@ -149,9 +169,10 @@ export default { this.stockInfo = data.data; // 初始化输入值为当前值 this.newLocationId = this.stockInfo.locationId || ''; + this.newStatus = this.stockInfo.status || ''; 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.$message.success('获取标签信息成功'); + this.$message.success('操作成功!'); } else { this.$message.error(data.msg || '未找到该标签的库存信息'); this.stockInfo = {}; @@ -175,6 +196,15 @@ export default { 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 oldProductionDate = this.stockInfo.productionDate ? moment(this.stockInfo.productionDate).format('YYYY-MM-DD') : ''; @@ -184,7 +214,7 @@ export default { const hasProductionDateChange = this.newProductionDate !== oldProductionDate; const hasExpiryDateChange = this.newExpiryDate !== oldExpiryDate; - if (!hasLocationChange && !hasProductionDateChange && !hasExpiryDateChange) { + if (!hasLocationChange && !hasProductionDateChange && !hasExpiryDateChange && !hasStatusChange) { this.$message.warning('没有检测到属性变动,请修改后再提交'); return; } @@ -200,6 +230,8 @@ export default { quantity: this.stockInfo.qtyOnHand, oldLocationId: oldLocationId, newLocationId: this.newLocationId, + oldStatus: oldStatus, + newStatus: this.newStatus, oldProductionDate: oldProductionDate, newProductionDate: this.newProductionDate, oldExpiryDate: oldExpiryDate, @@ -211,6 +243,9 @@ export default { if (hasLocationChange) { changeMsg += `库位: ${oldLocationId} → ${this.newLocationId}\n`; } + if (hasStatusChange) { + changeMsg += `状态: ${oldStatus} → ${this.newStatus}\n`; + } if (hasProductionDateChange) { changeMsg += `生产日期: ${oldProductionDate} → ${this.newProductionDate}\n`; } @@ -267,6 +302,7 @@ export default { resetForm() { this.stockInfo = {}; this.newLocationId = ''; + this.newStatus = ''; this.newProductionDate = ''; this.newExpiryDate = ''; @@ -410,6 +446,17 @@ export default { 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 { display: flex;