From a4fdc08918de57f2fd80a95998b28f49db80862c Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Mon, 3 Nov 2025 16:03:39 +0800
Subject: [PATCH] =?UTF-8?q?2025-11-03=20pda=E5=B1=9E=E6=80=A7=E5=8F=98?=
=?UTF-8?q?=E5=8A=A8=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../property-change/propertyChange.vue | 53 +++++++++++++++++--
1 file changed, 50 insertions(+), 3 deletions(-)
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.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;